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 |
---|---|---|---|---|---|---|
GET /family_years GET /family_years.json | def index
@family_years = FamilyYear.all.includes(family: [:community]).order("communities.code ASC", "families.name ASC")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end",
"def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end",
"def years(make)\n make_id = get_object_id make\n response = get_url \"Years/#{make_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetYearsResult\"].map{|r| r[\"Year\"]}\n end",
"def fiscal_years\n get_fiscal_years\n end",
"def show\n @family_year = FamilyYear.where(school_year: @enrollment.school_year).where(family_id: @family.id).first\n\n\tend",
"def get_all_fiscal_years\n get_fiscal_years(Date.today - 4.years)\n end",
"def set_family_year\n @family_year = FamilyYear.find(params[:id])\n end",
"def faith_years\n (Time.now.year - 1991).ordinalize\n end",
"def years_by_make(make)\n make_request :get, '/years/byMake/' + make.to_s\n end",
"def index\n @fiscal_years = FiscalYear.all\n end",
"def index\n @years = Year.all\n end",
"def index\n @years = Year.all\n end",
"def index\n @team_years = TeamYear.all\n end",
"def index\n @firework_years = FireworkYear.all\n end",
"def load_fiscal_years\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def load_all_years\n @all_years = FiscalYear.order(:year)\n @year = FiscalYear.find_by_year(cookies[:year])\n @year = @current_fiscal_year if @year.blank?\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def display\n @years = (1990..2012).to_a\n @girl_names = Babyname.where(birth_year: params[:year], gender: \"F\")\n # @boy_names = Babyname.where(birth_year: params[:year], gender: \"M\")[0...100]\n end",
"def index\n @grad_years = GradYear.all\n end",
"def amy_years\n (Time.now.year - 1977).ordinalize\n end",
"def year\n self.range('year')\n end",
"def human_years \n age * DOG_YEARS\n end",
"def index\n @sponsor_years = SponsorYear.all\n end",
"def get_district_list ( year )\n get_api_resource \"#{@@api_base_url}districts/#{year}\"\n end",
"def show\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermo_oil_distribution_year }\n end\n end",
"def index\n @acedemic_years = AcedemicYear.all\n end",
"def get_district_teams ( district_key, year )\n get_api_resource \"#{@@api_base_url}district/#{district_key}/#{year}/teams\"\n end",
"def get_team_years_participated_with_http_info(team_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_years_participated ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_years_participated\"\n end\n # resource path\n local_var_path = '/team/{team_key}/years_participated'.sub('{' + 'team_key' + '}', CGI.escape(team_key.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 header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\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<Integer>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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: TeamApi#get_team_years_participated\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_project_fiscal_years project\n if project.blank?\n []\n elsif project.multi_year?\n a = []\n (current_fiscal_year_year..current_fiscal_year_year + 49).map{ |y| [fiscal_year(y), y] }.each do |fy|\n if fy[1] < project.fy_year\n next\n else\n a << fy\n end\n end\n a\n else\n [[project.fiscal_year, project.fy_year]]\n end\n end",
"def index\n @schoolyears = Schoolyear.all\n end",
"def year\n yearInSchool\n end",
"def index\n @built_years = BuiltYear.all\n end",
"def dog_years(age)\n \thuman_year = age * 7\n \tp human_year.to_i\n end",
"def years_needed\n 30\n end",
"def security_advisories_year_year_get_with_http_info(year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.security_advisories_year_year_get ...\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling DefaultApi.security_advisories_year_year_get\"\n end\n # resource path\n local_var_path = \"/security/advisories/year/{year}\".sub('{' + 'year' + '}', year.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['psirt_openvuln_api_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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#security_advisories_year_year_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @family = get_family(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def get_years\n year = slice_year\n till_year = year.to_i - @past_years\n years = []\n year.to_i.downto(till_year) { |y| years << y }\n years\n end",
"def get_year\n @year ||= params[:year] ? params[:year].to_i : Time.now.year\n end",
"def academic_years\n Education::AcademicYear.where(id: education_cohorts.pluck(:academic_year_id))\n end",
"def year_ranking\n ranked_albums = SortCollection.sort_albums('year')\n render json: ranked_albums.sort_by(&:last).reverse[0...5].to_h, status: 200\n end",
"def index\n @years = Year.order(:id)\n end",
"def year\n 2020\n end",
"def school_years\n load_school_years\n @school_years.sort { |s1, s2| s1.start_date.year <=> s2.start_date.year } \n end",
"def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def dog_years(human_years)\n human_years * 7\n end",
"def index\n @families = Family.all.paginate(page: params[:page])\n render json: @families\n end",
"def age_in_dog_years\n 405\n end",
"def show\n @family_crest = FamilyCrest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_crest }\n end\n end",
"def get_fiscal_years(date = nil, num_forecasting_years = nil)\n if date\n current_year = fiscal_year_year_on_date(date)\n else\n current_year = current_planning_year_year\n end\n a = []\n\n # get last fiscal year from current year and num of forecasting years\n if num_forecasting_years.nil?\n last_year = last_fiscal_year_year\n else\n last_year = current_year + num_forecasting_years\n end\n\n (current_year..last_year).each do |year|\n a << [fiscal_year(year), year]\n end\n a\n end",
"def index\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def dog_years(human_years)\n \tputs human_years / 7\n end",
"def show\n family = current_family\n p current_family\n render json: family.as_json\n end",
"def dog_years(year)\n\t\tp year*7\n\tend",
"def year\n @year = params[:id].to_i\n date_format = \"'%Y'\"\n @speakers = generate_speaker_list_with_counts_for_date(@year,date_format,\"event_date\")\n end",
"def index\n @signature_years = SignatureYear.all\n end",
"def age_in_years\n raise 'birth date undefined' if birth_date.nil?\n year_delta = congress_start.year - birth_date.year\n birthday_after_congress? ? year_delta - 1 : year_delta\n end",
"def new\n @year_insurances = YearInsurance.active.joins(:family)\n @reimbursement = Reimbursement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reimbursement }\n end\n end",
"def dog_years (human_years)\n human_years * 7\n end",
"def citations_list_years(search_key)\n entries = config.bibtex.query(search_key)\n\n years ||= []\n\n entries.each do |entry|\n next if entry.type == :string\n years |= [entry.year.to_i]\n end\n\n years.sort { |x, y| x.to_i <=> y.to_i}.reverse\n end",
"def show\n @gss = @grade_section.students_for_academic_year(params[:year])\n end",
"def get_content_years\n @board = Board.find(params[:id]) rescue nil\n #list = ContentYear.where(:board_id => @Board.id,:publisher_id => current_user.id).map {|u| Hash[value: u.id, name: u.name]}\n list = @board.content_years.map {|u| Hash[value: u.id, name: u.name]} rescue []\n render json: list\n end",
"def load_view\n\n @fiscal_years = (current_fiscal_year_year..current_fiscal_year_year + 49).map{ |y| [fiscal_year(y), y] }\n render params[:view]\n\n end",
"def reporte_churn_rate\n\t\tcurrent_year = params[:year].to_i\n\t\tdata = HistoricoPerdidaClientes.reporte_churn_rate(current_year)\n\t\trender :json => data\n\tend",
"def current_age_for_birth_year(birth_year)\n return 2016 - birth_year\nend",
"def associated_years\n years = \"\"\n \n\t start_date = event_start\n\t start_date = entry_deadline if is_opportunity?\n\t \n years << start_date.year.to_s if !start_date.blank?\n years << ' '\n years << event_finish.year.to_s if !event_finish.blank?\n \n #remove duplicates and trim off spaces\n unique_years = years.strip.split(' ').uniq.sort\n result = unique_years\n if unique_years.length > 1\n result = []\n for y in unique_years[0]..unique_years[1]\n result << y\n end\n end\n result\n #now we have the 2004-2008 case to deal with, we wish to create [2004,2005,...2008]\n \n end",
"def index\n @parliaments = Parliament.sorted_start_year\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parliaments }\n end\n end",
"def year\n self._id['year']\n end",
"def history_years_by_make(make)\n make_request :get, '/histyears/byMake/' + make.to_s\n end",
"def current_age_for_birth_year(birth_year)\n Time.now.year - birth_year\nend",
"def finding_year_and_category\n @year = []\n if @data.present?\n if params[:year].present? && params[:category].present?\n #debugger\n @data[\"prizes\"].group_by {|x| @year << x if (x[\"year\"]==params[:year] && x[\"category\"]==params[:category])}\n elsif params[:year].present?\n @data[\"prizes\"].group_by {|x| @year << x if x[\"year\"]==params[:year]}\n else\n @data[\"prizes\"].group_by {|x| @year << x if x[\"category\"] == params[:category]}\n end\n end\n render :json => @year\n end",
"def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def show\n @cold_production_year = ColdProductionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cold_production_year }\n end\n end",
"def get_year_ary\n (Date.today.year-99..Date.today.year).inject([]){|x,y| x << y}.reverse\n end",
"def show\n @thermo_oil_production = ThermoOilProduction.find(params[:id])\n @thermo_oil_production_years = ThermoOilProductionYear.find_all_by_thermoOilProduction_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermo_oil_production }\n end\n end",
"def index\n @worker_salaries = WorkerSalary.paginate(:page => params[:page], :per_page => per_page).order('year desc')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worker_salaries }\n end\n end",
"def find_years(current_id)\n find(:all, :conditions => [\"#{_(:id)} <= ?\",current_id]).collect{ |y| [y.description] }\n end",
"def year(year_range = (1930..1950))\n rand(year_range)\nend",
"def centuryFromYear(year)\n if (year % 100 == 0)\n year/100\n else\n (year/100) + 1\n end\nend",
"def year_of_birth(current_year, age)\n\tcurrent_year - age\n\tend",
"def show\n @anniversary = Anniversary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anniversary }\n end\n end",
"def population_year\n query_root_node(\"fao:populationYear/text()\", @@NAMESPACES).to_s\n end",
"def birth_year\n @current_year - @age\n end",
"def years() 365 * days end",
"def inspect\n \"the year is \" + humanize_list(@years)\n end",
"def years\n case @age\n when 1..5 then puts \"You are a baby\"\n when 6..12 then puts \"You are a child\"\n when 13..21 then puts \"You are a young people\"\n when 22...35 then puts \"You are adult\"\n end\n end",
"def show\n @family = Family.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def years\n use_date = params[:dt] || \"created_at\"\n @age_limit = (params[:years] || \"2\").to_i.years.ago\n date_format = \"'%Y-%m'\"\n @dates = AudioMessage.active\n .where(\"audio_messages.#{use_date} > ?\",@age_limit)\n .group(\"date_format(audio_messages.#{use_date},#{date_format})\")\n .order(\"audio_messages.#{use_date} DESC\")\n .count\n @speakers_by_date = {}\n @dates.keys.each do |date|\n @speakers_by_date[date] =\n generate_speaker_list_with_counts_for_date(date,date_format,use_date)\n end\n # Peek at most recent load date\n @latest_addition_date = AudioMessage.maximum('created_at')\n end",
"def get_team_awards_by_year_with_http_info(team_key, year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_awards_by_year ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_awards_by_year\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling TeamApi.get_team_awards_by_year\"\n end\n # resource path\n local_var_path = '/team/{team_key}/awards/{year}'.sub('{' + 'team_key' + '}', CGI.escape(team_key.to_s)).sub('{' + 'year' + '}', CGI.escape(year.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 header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\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<Award>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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: TeamApi#get_team_awards_by_year\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def makes_by_year(year)\n make_request :get, '/makes/byYear/' + year.to_s\n end",
"def century(year)\n century = year / 100 if year % 100 == 0\n century = (year / 100) + 1 if year % 100 != 0\n \"#{century}#{ordinal(century)}\"\nend",
"def index\n @club_awards = ClubAward.all\n @years = ClubAward.pluck(:year).map{|x| x}.uniq.sort\n @award_types = AwardType.all\n end",
"def year; end",
"def year; end",
"def year\n end",
"def get_winners\n json = get_json('http://oscars.yipitdata.com/')\n json.results.collect do |films_array|\n find_winner(films_array.films).tap do |winner|\n winner[:year] = films_array.year[0,4]\n end\n end\n end",
"def students_for_grade_level_next_year_json\n params.require(:workspace_id)\n params.require(:school_id)\n params.require(:grade_level_next_year)\n school_id = params[:school_id].to_i\n grade_level_next_year = params[:grade_level_next_year]\n\n # Check authorization by grade level, differently than normal.\n students = queries.authorized_students_for_next_year(school_id, grade_level_next_year)\n students_json = ClassListQueries.students_as_json(students)\n\n # educator names\n educators_json = Educator.where(school_id: school_id).as_json(only: [:id, :full_name])\n\n render json: {\n students: students_json,\n educators: educators_json,\n current_educator_id: current_educator.id\n }\n end",
"def index\n @family_members = FamilyMember.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @family_members }\n end\n end"
] | [
"0.6833005",
"0.66414714",
"0.6628266",
"0.6559421",
"0.64723235",
"0.6391704",
"0.6384029",
"0.6362805",
"0.6243158",
"0.6195845",
"0.6155874",
"0.6155874",
"0.6136192",
"0.60688007",
"0.60654944",
"0.60566515",
"0.59732074",
"0.5971816",
"0.5971816",
"0.5971816",
"0.5963321",
"0.5956508",
"0.5931205",
"0.59211034",
"0.587573",
"0.58668333",
"0.5862567",
"0.58436465",
"0.583492",
"0.5822631",
"0.5818407",
"0.5812555",
"0.58046174",
"0.5798701",
"0.5787051",
"0.57832444",
"0.578094",
"0.5771058",
"0.5769977",
"0.5765635",
"0.57535756",
"0.57519346",
"0.5744888",
"0.5738021",
"0.57341546",
"0.5724381",
"0.5713996",
"0.569579",
"0.5660024",
"0.56591594",
"0.5644396",
"0.56431824",
"0.56390256",
"0.563528",
"0.5633286",
"0.5628022",
"0.56249493",
"0.56229115",
"0.5616193",
"0.5611828",
"0.5605509",
"0.5601104",
"0.5595658",
"0.55847424",
"0.5575604",
"0.55754113",
"0.5573341",
"0.55711",
"0.55699646",
"0.5559882",
"0.55551314",
"0.5541272",
"0.5530661",
"0.5503119",
"0.5495031",
"0.5492905",
"0.5487714",
"0.54818696",
"0.54792917",
"0.547578",
"0.5466134",
"0.5465838",
"0.54542345",
"0.54520017",
"0.5445022",
"0.54415125",
"0.5433188",
"0.5429239",
"0.5428774",
"0.5426305",
"0.54241407",
"0.5423322",
"0.5423034",
"0.54196036",
"0.5416422",
"0.5416422",
"0.5411852",
"0.5408113",
"0.5406751",
"0.5405434"
] | 0.63060474 | 8 |
GET /family_years/1 GET /family_years/1.json | def show
@family = @family_year.family
@children = Child.joins(:family).where("families.id = ?", @family.id).order("children.code ASC")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end",
"def show\n @family_year = FamilyYear.where(school_year: @enrollment.school_year).where(family_id: @family.id).first\n\n\tend",
"def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end",
"def set_family_year\n @family_year = FamilyYear.find(params[:id])\n end",
"def years(make)\n make_id = get_object_id make\n response = get_url \"Years/#{make_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetYearsResult\"].map{|r| r[\"Year\"]}\n end",
"def show\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermo_oil_distribution_year }\n end\n end",
"def fiscal_years\n get_fiscal_years\n end",
"def index\n @years = Year.all\n end",
"def index\n @years = Year.all\n end",
"def years_by_make(make)\n make_request :get, '/years/byMake/' + make.to_s\n end",
"def index\n @fiscal_years = FiscalYear.all\n end",
"def show\n @family = get_family(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def index\n @family_years = FamilyYear.all.includes(family: [:community]).order(\"communities.code ASC\", \"families.name ASC\")\n end",
"def index\n @team_years = TeamYear.all\n end",
"def index\n @firework_years = FireworkYear.all\n end",
"def show\n @family_crest = FamilyCrest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_crest }\n end\n end",
"def faith_years\n (Time.now.year - 1991).ordinalize\n end",
"def show\n @cold_production_year = ColdProductionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cold_production_year }\n end\n end",
"def show\n @anniversary = Anniversary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anniversary }\n end\n end",
"def show\n family = current_family\n p current_family\n render json: family.as_json\n end",
"def show\n @family = Family.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def year\n self.range('year')\n end",
"def get_all_fiscal_years\n get_fiscal_years(Date.today - 4.years)\n end",
"def index\n @grad_years = GradYear.all\n end",
"def security_advisories_year_year_get_with_http_info(year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.security_advisories_year_year_get ...\"\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling DefaultApi.security_advisories_year_year_get\"\n end\n # resource path\n local_var_path = \"/security/advisories/year/{year}\".sub('{' + 'year' + '}', year.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['psirt_openvuln_api_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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#security_advisories_year_year_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def display\n @years = (1990..2012).to_a\n @girl_names = Babyname.where(birth_year: params[:year], gender: \"F\")\n # @boy_names = Babyname.where(birth_year: params[:year], gender: \"M\")[0...100]\n end",
"def index\n @acedemic_years = AcedemicYear.all\n end",
"def show\n @family = Family.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family }\n end\n end",
"def load_fiscal_years\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def new\n @year_insurances = YearInsurance.active.joins(:family)\n @reimbursement = Reimbursement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reimbursement }\n end\n end",
"def index\n @sponsor_years = SponsorYear.all\n end",
"def show\n @thermo_oil_production = ThermoOilProduction.find(params[:id])\n @thermo_oil_production_years = ThermoOilProductionYear.find_all_by_thermoOilProduction_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @thermo_oil_production }\n end\n end",
"def index\n @years = Year.order(:id)\n end",
"def load_all_years\n @all_years = FiscalYear.order(:year)\n @year = FiscalYear.find_by_year(cookies[:year])\n @year = @current_fiscal_year if @year.blank?\n end",
"def get_year\n @year ||= params[:year] ? params[:year].to_i : Time.now.year\n end",
"def index\n @schoolyears = Schoolyear.all\n end",
"def get_team_years_participated_with_http_info(team_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TeamApi.get_team_years_participated ...'\n end\n # verify the required parameter 'team_key' is set\n if @api_client.config.client_side_validation && team_key.nil?\n fail ArgumentError, \"Missing the required parameter 'team_key' when calling TeamApi.get_team_years_participated\"\n end\n # resource path\n local_var_path = '/team/{team_key}/years_participated'.sub('{' + 'team_key' + '}', CGI.escape(team_key.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 header_params[:'If-Modified-Since'] = opts[:'if_modified_since'] if !opts[:'if_modified_since'].nil?\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<Integer>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['apiKey']\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: TeamApi#get_team_years_participated\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @built_years = BuiltYear.all\n end",
"def year_ranking\n ranked_albums = SortCollection.sort_albums('year')\n render json: ranked_albums.sort_by(&:last).reverse[0...5].to_h, status: 200\n end",
"def show\n @yearly_info = YearlyInfo.find(params[:id])\n end",
"def reporte_churn_rate\n\t\tcurrent_year = params[:year].to_i\n\t\tdata = HistoricoPerdidaClientes.reporte_churn_rate(current_year)\n\t\trender :json => data\n\tend",
"def index\n @families = Family.all.paginate(page: params[:page])\n render json: @families\n end",
"def index\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def year\n self._id['year']\n end",
"def year\n yearInSchool\n end",
"def show\n @gss = @grade_section.students_for_academic_year(params[:year])\n end",
"def show\n @family_history = FamilyHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @family_history }\n end\n end",
"def year\n 2020\n end",
"def index\n @parliaments = Parliament.sorted_start_year\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @parliaments }\n end\n end",
"def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end",
"def index\n @worker_salaries = WorkerSalary.paginate(:page => params[:page], :per_page => per_page).order('year desc')\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @worker_salaries }\n end\n end",
"def year\n @year = params[:id].to_i\n date_format = \"'%Y'\"\n @speakers = generate_speaker_list_with_counts_for_date(@year,date_format,\"event_date\")\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def show\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @early_pregnancy }\n end\n end",
"def show\n # @donation_year_link = DonationYearLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @donation_year_link }\n end\n end",
"def human_years\n age * DOG_YEARS\n end",
"def history_years_by_make(make)\n make_request :get, '/histyears/byMake/' + make.to_s\n end",
"def show\n # render json: @birthday_party\n end",
"def update\n respond_to do |format|\n if @family_year.update(family_year_params)\n format.html { redirect_to @family_year, notice: tr(\"family_year_updated\") }\n else\n format.html { render :edit }\n end\n end\n end",
"def get_district_list ( year )\n get_api_resource \"#{@@api_base_url}districts/#{year}\"\n end",
"def load_view\n\n @fiscal_years = (current_fiscal_year_year..current_fiscal_year_year + 49).map{ |y| [fiscal_year(y), y] }\n render params[:view]\n\n end",
"def show\n @golf_cource = GolfCource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golf_cource }\n end\n end",
"def new\n @budget = Budget.new\n @budget.year = Time.new.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end",
"def human_years \n age * DOG_YEARS\n end",
"def dog_years(age)\n \thuman_year = age * 7\n \tp human_year.to_i\n end",
"def finding_year_and_category\n @year = []\n if @data.present?\n if params[:year].present? && params[:category].present?\n #debugger\n @data[\"prizes\"].group_by {|x| @year << x if (x[\"year\"]==params[:year] && x[\"category\"]==params[:category])}\n elsif params[:year].present?\n @data[\"prizes\"].group_by {|x| @year << x if x[\"year\"]==params[:year]}\n else\n @data[\"prizes\"].group_by {|x| @year << x if x[\"category\"] == params[:category]}\n end\n end\n render :json => @year\n end",
"def show\n @company_financial = CompanyFinancial.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company_financial }\n end\n end",
"def index\n @signature_years = SignatureYear.all\n end",
"def age_in_dog_years\n 405\n end",
"def index\n @registrations = Registration.order(:last_name).where(\"created_at >= ?\", Date.today.beginning_of_year)\n\n respond_to do |format|\n format.html\n format.json { render json: @registrations, include: { students: { only: [:first_name, :last_name, :shirt_size]}} }\n end\n end",
"def show\n @salary_range = SalaryRange.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @salary_range }\n end\n end",
"def amy_years\n (Time.now.year - 1977).ordinalize\n end",
"def show\n @undergraduate_major = UndergraduateMajor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @undergraduate_major }\n end\n end",
"def show\n @compressed_air_distribution_year = CompressedAirDistributionYear.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compressed_air_distribution_year }\n end\n end",
"def index\n periods = current_user.school.periods.all\n\n render json: periods\n end",
"def show\n @college_fee = CollegeFee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college_fee }\n end\n end",
"def season(year, **options) = get(\"/seasons/#{year}\", **{ sportId: 1 }.merge(options))",
"def show\n camp_applications = current_family.application.camps\n render json: camp_applications.as_json\n end",
"def makes_by_year(year)\n make_request :get, '/makes/byYear/' + year.to_s\n end",
"def get_content_years\n @board = Board.find(params[:id]) rescue nil\n #list = ContentYear.where(:board_id => @Board.id,:publisher_id => current_user.id).map {|u| Hash[value: u.id, name: u.name]}\n list = @board.content_years.map {|u| Hash[value: u.id, name: u.name]} rescue []\n render json: list\n end",
"def index\n @subscriptions_by_year = @subscriptions.group_by(&:year)\n @year = params[:year] || @subscriptions_by_year.keys.sort.last\n @member = Member.find(params[:member_id]) if params[:member_id]\n @subscriptions = @subscriptions_by_year[@year]\n\n respond_to do |format|\n format.html # index.html.erb\n format.tex\n format.json { render json: @subscriptions }\n end\n end",
"def get_district_teams ( district_key, year )\n get_api_resource \"#{@@api_base_url}district/#{district_key}/#{year}/teams\"\n end",
"def index\n @family_members = FamilyMember.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @family_members }\n end\n end",
"def create\n @family_year = FamilyYear.new(family_year_params)\n\n respond_to do |format|\n if @family_year.save\n format.html { redirect_to @family_year, notice: tr(\"family_year_created\") }\n else\n format.html { render :new }\n end\n end\n end",
"def students_for_grade_level_next_year_json\n params.require(:workspace_id)\n params.require(:school_id)\n params.require(:grade_level_next_year)\n school_id = params[:school_id].to_i\n grade_level_next_year = params[:grade_level_next_year]\n\n # Check authorization by grade level, differently than normal.\n students = queries.authorized_students_for_next_year(school_id, grade_level_next_year)\n students_json = ClassListQueries.students_as_json(students)\n\n # educator names\n educators_json = Educator.where(school_id: school_id).as_json(only: [:id, :full_name])\n\n render json: {\n students: students_json,\n educators: educators_json,\n current_educator_id: current_educator.id\n }\n end",
"def academic_years\n Education::AcademicYear.where(id: education_cohorts.pluck(:academic_year_id))\n end",
"def show\n @college = College.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college }\n end\n end",
"def set_yearly_info\n @yearly_info = YearlyInfo.find(params[:id])\n end",
"def show\n @membership_fee = MembershipFee.find(params[:id])\n @member = Member.find(@membership_fee.member_id)\n @school_year = SchoolYear.find(@membership_fee.school_year_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @membership_fee }\n end\n end",
"def show\n begin\n @gender = Gender.find(params[:id]) \n\n render json: @gender, status: 200\n rescue ActiveRecord::RecordNotFound\n render json: {status: \"gender not found\"}, status: 404\n end\n end",
"def show\n @personnage = Personnage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @personnage }\n end\n end",
"def show\n @holy_book = HolyBook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @holy_book }\n end\n end",
"def get_project_fiscal_years project\n if project.blank?\n []\n elsif project.multi_year?\n a = []\n (current_fiscal_year_year..current_fiscal_year_year + 49).map{ |y| [fiscal_year(y), y] }.each do |fy|\n if fy[1] < project.fy_year\n next\n else\n a << fy\n end\n end\n a\n else\n [[project.fiscal_year, project.fy_year]]\n end\n end",
"def show\n @target_age = TargetAge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @target_age }\n end\n end",
"def new\n @family_crest = FamilyCrest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @family_crest }\n end\n end",
"def show\n @title = \"Возрастная группа\"\n @age_group = AgeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @age_group }\n end\n end",
"def years_needed\n 30\n end",
"def show\n respond_to do |format|\n if current_user==nil\n render json: {error: 'No estas logeado'}, status: 401\n elsif @family==nil\n format.json { render json: {error: \"El familiar no existe\"}, status: :not_found }\n elsif current_user.families.include?(@family)==false\n format.json { render json: {error: 'No posees permisos para ver a esta persona'}, status: 401 }\n else\n format.json { render json: {family: @family, intolerances: @family.intolerances} }\n end\n format.html {}\n end\n end"
] | [
"0.679021",
"0.6696747",
"0.6626246",
"0.6564271",
"0.6364004",
"0.6322235",
"0.6225273",
"0.6194543",
"0.6194543",
"0.6193806",
"0.61402535",
"0.6138562",
"0.6069623",
"0.6063348",
"0.6033476",
"0.6004253",
"0.598569",
"0.5971555",
"0.59233683",
"0.59174055",
"0.5897581",
"0.5895541",
"0.5880061",
"0.5864399",
"0.584154",
"0.5840771",
"0.58360964",
"0.58292973",
"0.58217543",
"0.5812329",
"0.58113694",
"0.58087736",
"0.58044714",
"0.58011746",
"0.5797248",
"0.57914793",
"0.5785737",
"0.5776325",
"0.5767454",
"0.5758838",
"0.57400703",
"0.57343096",
"0.5702536",
"0.56960166",
"0.568701",
"0.5683845",
"0.56813854",
"0.56592417",
"0.5651319",
"0.56471807",
"0.56413007",
"0.5639376",
"0.56352043",
"0.56223875",
"0.56223875",
"0.56223875",
"0.56211936",
"0.5603971",
"0.5601354",
"0.5581606",
"0.55774015",
"0.5577084",
"0.5572917",
"0.5567694",
"0.55600756",
"0.5555726",
"0.5551616",
"0.55501527",
"0.553266",
"0.55235624",
"0.5523319",
"0.5522056",
"0.55203545",
"0.55186546",
"0.55093163",
"0.5507428",
"0.55071396",
"0.55053777",
"0.55037147",
"0.55022323",
"0.5491511",
"0.548969",
"0.5488525",
"0.548136",
"0.5478572",
"0.54759866",
"0.5474434",
"0.5469069",
"0.54658866",
"0.5462112",
"0.54593414",
"0.54582655",
"0.5458112",
"0.54560137",
"0.5445708",
"0.5444811",
"0.544472",
"0.5444641",
"0.5440114",
"0.5436262",
"0.5427319"
] | 0.0 | -1 |
POST /family_years POST /family_years.json | def create
@family_year = FamilyYear.new(family_year_params)
respond_to do |format|
if @family_year.save
format.html { redirect_to @family_year, notice: tr("family_year_created") }
else
format.html { render :new }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @fiscal_year = FiscalYear.new(fiscal_year_params)\n\n respond_to do |format|\n if @fiscal_year.save\n format.html { redirect_to @fiscal_year, notice: 'Fiscal year was successfully created.' }\n format.json { render :show, status: :created, location: @fiscal_year }\n else\n format.html { render :new }\n format.json { render json: @fiscal_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_family_year\n @family_year = FamilyYear.find(params[:id])\n end",
"def create\n @pupil_has_year = PupilHasYear.new(pupil_has_year_params)\n\n respond_to do |format|\n if @pupil_has_year.save\n format.html { redirect_to pupil_has_years_path, notice: 'Pupil has year was successfully created.' }\n format.json { render :show, status: :created, location: @pupil_has_year }\n else\n format.html { render :new }\n format.json { render json: @pupil_has_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render :show, status: :created, location: @year }\n else\n format.html { render :new }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render :show, status: :created, location: @year }\n else\n format.html { render :new }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @firework_year = FireworkYear.new(firework_year_params)\n\n respond_to do |format|\n if @firework_year.save\n format.html { redirect_to @firework_year, notice: 'Firework year was successfully created.' }\n format.json { render :show, status: :created, location: @firework_year }\n else\n format.html { render :new }\n format.json { render json: @firework_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @year = Year.new(year_params)\n\n respond_to do |format|\n if @year.save\n format.html { redirect_to @year, notice: 'Year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @year }\n else\n format.html { render action: 'new' }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def acedemic_year_params\n params.require(:acedemic_year).permit(:year, :start_date, :end_date, :grade_ids => [], :fee_ids => [])\n end",
"def create\n @team_year = TeamYear.new(team_year_params)\n\n respond_to do |format|\n if @team_year.save\n format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }\n format.json { render :show, status: :created, location: @team_year }\n else\n format.html { render :new }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @reimbursement = Reimbursement.new(params[:reimbursement])\n @year_insurances = YearInsurance.active.joins(:family)\n respond_to do |format|\n if @reimbursement.save\n format.html { redirect_to reimbursements_path, notice: 'Reimbursement was successfully created.' }\n format.json { render json: @reimbursement, status: :created, location: @reimbursement }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reimbursement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sponsor_year = SponsorYear.new(sponsor_year_params)\n\n respond_to do |format|\n if @sponsor_year.save\n format.html { redirect_to @sponsor_year, notice: 'Sponsor year was successfully created.' }\n format.json { render :show, status: :created, location: @sponsor_year }\n else\n format.html { render :new }\n format.json { render json: @sponsor_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @team_year = TeamYear.new(team_year_params)\n\n respond_to do |format|\n if @team_year.save\n format.html { redirect_to @team_year, notice: 'Team year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_year }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def firework_year_params\n params.require(:firework_year).permit(:year)\n end",
"def fiscal_year_params\n params.require(:fiscal_year).permit(:client_id, :year, :transactions)\n end",
"def create\n @grad_year = GradYear.new(grad_year_params)\n\n respond_to do |format|\n if @grad_year.save\n format.html { redirect_to @grad_year, notice: 'Grad year was successfully created.' }\n format.json { render :show, status: :created, location: @grad_year }\n else\n format.html { render :new }\n format.json { render json: @grad_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @built_year = BuiltYear.new(built_year_params)\n\n respond_to do |format|\n if @built_year.save\n format.html { redirect_to @built_year, notice: 'Built year was successfully created.' }\n format.json { render action: 'show', status: :created, location: @built_year }\n else\n format.html { render action: 'new' }\n format.json { render json: @built_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def family_year_params\n if @user.can_access_interview_notes?\n params.require(:family_year).permit(:community_id, :family_id, :school_year, :picture, :notes)\n else\n params.require(:family_year).permit(:community_id, :family_id, :school_year, :picture)\n end \n end",
"def create\n @schoolyear = Schoolyear.new(schoolyear_params)\n\n respond_to do |format|\n if @schoolyear.save\n format.html { redirect_to @schoolyear, notice: 'Schoolyear was successfully created.' }\n format.json { render :show, status: :created, location: @schoolyear }\n else\n format.html { render :new }\n format.json { render json: @schoolyear.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @signature_year = SignatureYear.new(signature_year_params)\n respond_to do |format|\n if @signature_year.save\n format.html { redirect_to @signature_year, notice: t('.success') }\n format.json { render :show, status: :created, location: @signature_year }\n else\n format.html { render :new }\n format.json { render json: @signature_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @year_group = YearGroup.new(year_group_params)\n\n respond_to do |format|\n if @year_group.save\n format.html { redirect_to @year_group, notice: 'Year group was successfully created.' }\n format.json { render :show, status: :created, location: @year_group }\n else\n format.html { render :new }\n format.json { render json: @year_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @year_insurances = YearInsurance.active.joins(:family)\n @reimbursement = Reimbursement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reimbursement }\n end\n end",
"def create\n @new_year = FiscalYear.new(params[:fiscal_year])\n unless @new_year.save\n flash[:error] = \"Fiscal year already exists or improperly formatted.\"\n render :index\n return\n end\n flash[:notice] = \"Fiscal year created\"\n redirect_to fiscal_years_path\n end",
"def create\n @thermo_oil_distribution_year = ThermoOilDistributionYear.new(params[:thermo_oil_distribution_year])\n\n respond_to do |format|\n if @thermo_oil_distribution_year.save\n format.html { redirect_to @thermo_oil_distribution_year, notice: 'Thermo oil distribution year was successfully created.' }\n format.json { render json: @thermo_oil_distribution_year, status: :created, location: @thermo_oil_distribution_year }\n else\n format.html { render action: \"new\" }\n format.json { render json: @thermo_oil_distribution_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_yearly_data\n number = @slide_number.to_i + 1\n yearly_data = Nokogiri::HTML(\n open(\n \"#{ENV['API_DOMAIN_2']}#{Time.now.year}-horoscope\"\n )\n ).css(\"div.shareable-section-wrapper.shareable-yearly\").last\n return {} if yearly_data.blank?\n inner_data = yearly_data.css(\"div[#{number}] p\")\n final_data = \"\"\n inner_data.css(\"p\").each do |para|\n final_data = final_data + para.text + \"</br></br></t>\"\n end\n\n data = {\n sign: @sign_name.to_s,\n duration: \"yearly\",\n horoscope_text: final_data\n } if final_data\n Horoscope.create(data) if final_data and data\n end",
"def create\n @mp_year = MpYear.new(mp_year_params)\n\n respond_to do |format|\n if @mp_year.save\n format.html { redirect_to mp_years_path, notice: 'Mp year was successfully created.' }\n format.json { render :show, status: :created, location: @mp_year }\n else\n format.html { render :new }\n format.json { render json: @mp_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @yearly_info = current_user.yearly_info.build(yearly_info_params)\n\n respond_to do |format|\n if @yearly_info.save\n format.html { redirect_to @yearly_info, notice: 'Yearly info was successfully created.' }\n format.json { render action: 'show', status: :created, location: @yearly_info }\n else\n format.html { render action: 'new' }\n format.json { render json: @yearly_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def year_params\n params.require(:year).permit(:id, :year)\n end",
"def uni_years\n @uni_years = UniYear.where(university_id: params[:university_id])\n \n respond_to do |format|\n format.json { render json: @uni_years }\n end\n end",
"def year_params\n params.require(:year).permit(:value)\n end",
"def team_year_params\n params.require(:team_year).permit(:athlete_id, :team_id, :year)\n end",
"def signature_year_params\n params.require(:signature_year).permit(:year)\n end",
"def built_year_params\n params.require(:built_year).permit(:year, :gearbox, :engine_displacement)\n end",
"def update\n respond_to do |format|\n if @family_year.update(family_year_params)\n format.html { redirect_to @family_year, notice: tr(\"family_year_updated\") }\n else\n format.html { render :edit }\n end\n end\n end",
"def sponsor_year_params\n params.require(:sponsor_year).permit(:sponsor_id, :year_id, :sponsor_level_id)\n end",
"def create\n @language_family = LanguageFamily.new(language_family_params)\n\n respond_to do |format|\n if @language_family.save\n format.html { redirect_to @language_family, notice: 'Language family was successfully created.' }\n format.json { render action: 'show', status: :created, location: @language_family }\n else\n format.html { render action: 'new' }\n format.json { render json: @language_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n family_params\n f = params[:family]\n @family = Family.new\n @family.name = f[:name]\n\n respond_to do |format|\n if @family.save\n format.html { redirect_to @family, notice: 'Family was successfully created.' }\n format.json { render action: 'show', status: :created, location: @family }\n else\n format.html { render action: 'new' }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def grad_year_params\n params.require(:grad_year).permit(:year)\n end",
"def fiscal_years\n get_fiscal_years\n end",
"def create\n @acedemic_year = AcedemicYear.new(acedemic_year_params)\n acedemic_year_last = AcedemicYear.try(:last)\n respond_to do |format|\n if @acedemic_year.save\n if @acedemic_year.present?\n if acedemic_year_last.present?\n list_grades = acedemic_year_last.grades.map{ |g| {name: g.name, acedemic_year_id: @acedemic_year.id} }\n Grade.create(list_grades)\n Term.create([\n {name: \"First Term\", acedemic_year_id: @acedemic_year.id},\n {name: \"Second Term\", acedemic_year_id: @acedemic_year.id},\n {name: \"Third Term\", acedemic_year_id: @acedemic_year.id}\n ])\n end\n end\n format.html { redirect_to @acedemic_year, notice: 'Academic year was successfully created.' }\n format.json { render :show, status: :created, location: @acedemic_year }\n else\n format.html { render :new }\n format.json { render json: @acedemic_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def team_year_params\n params.require(:team_year).permit(:year, :team, :wins, :losses, :win_percentage, :offensive_rating, :defensive_rating, :season_outcome, :team_url, :team_home_url)\n end",
"def create\n @year_class = YearClass.new(year_class_params)\n\n respond_to do |format|\n if @year_class.save\n format.html { redirect_to @year_class, notice: 'Year class was successfully created.' }\n format.json { render :show, status: :created, location: @year_class }\n else\n format.html { render :new }\n format.json { render json: @year_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_school_year(school_year)\n activate_school_year(school_year) if @active.nil?\n @school_years << school_year if school_year.valid?\n school_year.save!\n school_year\n end",
"def year_params\n params.require(:year).permit(:id)\n end",
"def faith_years\n (Time.now.year - 1991).ordinalize\n end",
"def create\n @family_crest = FamilyCrest.new(params[:family_crest])\n\n respond_to do |format|\n if @family_crest.save\n format.html { redirect_to @family_crest, notice: 'Family crest was successfully created.' }\n format.json { render json: @family_crest, status: :created, location: @family_crest }\n else\n format.html { render action: \"new\" }\n format.json { render json: @family_crest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @early_pregnancy = EarlyPregnancy.new(params[:early_pregnancy])\n\n respond_to do |format|\n if @early_pregnancy.save\n format.html { redirect_to @early_pregnancy, notice: 'Early pregnancy was successfully created.' }\n format.json { render json: @early_pregnancy, status: :created, location: @early_pregnancy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @early_pregnancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def yearly_info_params\n params.require(:yearly_info).permit(:essay, :comments, :year, :role)\n end",
"def graduating_class_params\n params.require(:graduating_class).permit(:year)\n end",
"def create\n @cold_production_year = ColdProductionYear.new(params[:cold_production_year])\n\n respond_to do |format|\n if @cold_production_year.save\n format.html { redirect_to @cold_production_year, notice: 'Cold production year was successfully created.' }\n format.json { render json: @cold_production_year, status: :created, location: @cold_production_year }\n else\n format.html { render action: \"new\" }\n format.json { render json: @cold_production_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def schoolyear_params\n params.require(:schoolyear).permit(:name)\n end",
"def create\n @gakunenn = Gakunenn.new(gakunenn_params)\n\n respond_to do |format|\n if @gakunenn.save\n format.html { redirect_to @gakunenn, notice: \"学年を追加しました\" }\n format.json { render :show, status: :created, location: @gakunenn }\n else\n format.html { render :new }\n format.json { render json: @gakunenn.errors, status: :unprocessable_entity }\n end\n end\n end",
"def year_group_params\n params.require(:year_group).permit(:name, :code)\n end",
"def create\n @family = Family.new(family_params)\n addMembers\n respond_to do |format|\n if @family.save\n format.html { redirect_to @family, notice: 'Family was successfully created.' }\n format.json { render :show, status: :created, location: @family }\n else\n format.html { render :new }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"def create\n @person = current_user.created_people.new(person_params_with_school)\n if @person.save\n render :show, status: :created, location: api_v1_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end",
"def new\n @festival = Festival.new\n \n fy = @festival.festival_years.build\n e = fy.events.build\n a = e.build_address\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @festival }\n end\n end",
"def create\n study_period_params.permit!\n @study_period = StudyPeriod.new(study_period_params)\n @study_period.study_year = @year\n\n respond_to do |format|\n if @study_period.save\n format.html { redirect_to new_study_year_study_process_graphic_path(current_user.current_year, @study_period), notice: 'Учебный отрезок успешно создан.' }\n format.json { render action: 'show', status: :created, location: @study_period }\n else\n format.html { render action: 'new' }\n format.json { render json: @study_period.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @family = Family.new(params[:family])\n if User.find_by_email(session[:user_email]).identity >= 3 #if user is at least manager+\n @family.approved_by = User.find_by_email(session[:user_email]).id\n @family.display = true\n end\n respond_to do |format|\n if @family.save\n format.html { redirect_to session[:redirect_path], notice: 'Family was successfully created.' }\n format.json { render json: @family, status: :created, location: @family }\n else\n flash[:error] = \"Sorry, one or more fields were not entered correctly. Please double-check that the information is correct.\"\n format.html { render action: \"new\" }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def farmer_family_params\n params.require(:farmer_family).permit(:name, :cpf, :farmer_id, :gender, :birthday)\n end",
"def dog_years(human_years)\n human_years * 7\n end",
"def create_jobfamily\n @jobfamily = @company.jobfamilies.create(name: params[:jobfamily][:name])\n respond_to do |format|\n format.json { render json: @jobfamily }\n end\n end",
"def create\n @academic_year = AcademicYear.new(params[:academic_year])\n\n if @academic_year.save\n @academic_years = AcademicYear.paginate :page=>params[:page], :per_page=>15\n\n flash[:notice] = t('flash_msg48')\n else\n @error = true\n end\n end",
"def create\n @family_relationship = FamilyRelationship.new(family_relationship_params)\n\n respond_to do |format|\n if @family_relationship.save\n format.html { redirect_to @family_relationship, notice: 'Family relationship was successfully created.' }\n format.json { render :show, status: :created, location: @family_relationship }\n else\n format.html { render :new }\n format.json { render json: @family_relationship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n family = @family_year.family\n @family_year.destroy\n respond_to do |format|\n format.html { redirect_to family, notice: tr(\"family_year_destroyed\") }\n end\n end",
"def create\n @time_of_year = TimeOfYear.new(time_of_year_params)\n\n respond_to do |format|\n if @time_of_year.save\n format.html { redirect_to @time_of_year, notice: 'Time of year was successfully created.' }\n format.json { render :show, status: :created, location: @time_of_year }\n else\n format.html { render :new }\n format.json { render json: @time_of_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @target_age = TargetAge.new(params[:target_age])\n\n respond_to do |format|\n if @target_age.save\n format.html { redirect_to @target_age, notice: 'Target age was successfully created.' }\n format.json { render json: @target_age, status: :created, location: @target_age }\n else\n format.html { render action: \"new\" }\n format.json { render json: @target_age.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @family_crest = FamilyCrest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @family_crest }\n end\n end",
"def celebrate_birthday=(years)\n\t\t@age += years\n\tend",
"def dog_years (human_years)\n human_years * 7\n end",
"def new\n @budget = Budget.new\n @budget.year = Time.new.year\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @budget }\n end\n end",
"def load_fiscal_years\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def create\n @sub_family = SubFamily.new(sub_family_params)\n\n respond_to do |format|\n if @sub_family.save\n format.html { redirect_to @sub_family, notice: 'Sub familia foi criada.' }\n format.json { render :show, status: :created, location: @sub_family }\n else\n format.html { render :new }\n format.json { render json: @sub_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def pupil_has_year_params\n params.require(:pupil_has_year).permit(:year_id, :payment_id, :pupil_id, :adjusted_price)\n end",
"def vacancy_params\n params.permit(:year, :specialization_name)\n end",
"def destroy\n @fiscal_year.destroy\n respond_to do |format|\n format.html { redirect_to fiscal_years_url, notice: 'Fiscal year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def new\n @family = Family.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @family }\n end\n end",
"def year_params\n params.require(:year).permit(:year, :file)\n end",
"def create\n @family_document = FamilyDocument.new(family_document_params)\n\n respond_to do |format|\n if @family_document.save\n format.html { redirect_to @family_document, notice: \"Family document was successfully created.\" }\n format.json { render :show, status: :created, location: @family_document }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @family_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @new_fiscal_year = FiscalYear.new\n @fiscal_years = FiscalYear.order(:year)\n end",
"def create\n params[:family][:user_id] = current_user.id if params[:family][:user_id]==nil\n params[:family][:name] = params[:family][:name].split(\" \").map{|a| a.capitalize}.join(\" \")\n @family = Family.new(family_params)\n # if current_user.families.count == 0\n # current_user.username = @family.name\n # current_user.save\n # end\n\n respond_to do |format|\n if @family.save\n format.json { render json: {created: @family} }\n format.html { redirect_to @family, notice: 'Family was successfully created.' }\n else\n format.json { render json: @family.errors, status: :unprocessable_entity }\n format.html { render :new }\n end\n end\n end",
"def witness_year_params\n params.require(:witness_year).permit(:available_day1, :available_day2, :available_day3, :available_day4, :available_day5, :available_day6,\n :available_day7, :can_morning, :can_afternoon, :can_evening)\n end",
"def get_team_years_participated ( team_key )\n get_api_resource \"#{@@api_base_url}team/#{team_key}/years_participated\"\n end",
"def create\n @alumni = Alumni.new(alumni_params)\n @alumni.grad_semester = Alumni.grad_semester(params[:grad_season], params[:grad_year])\n # params[:grad_season] is Spring or Fall\n # params[:grad_year] is the actual year\n # This is so hacky. grad_season and grad_year are separate from the\n # other Alumni attributes when we're processing the form input because\n # it would be silly to have grad_season, grad_year, and grad_semester\n # when grad_semester is just the concatenation of grad_season and grad_year.\n # Similar funny business in update.\n respond_to do |format|\n if @alumni.save and @current_user.save\n # TODO: Actually subscribe them to the mailing list through Google Apps\n #if @alumni.mailing_list\n #end\n\n format.html { redirect_to(@alumni, notice: 'Alumni was successfully created.') }\n format.xml { render xml: @alumni, status: :created, location: @alumni }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @alumni.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @personnage = Personnage.new(params[:personnage])\n\n respond_to do |format|\n if @personnage.save\n format.html { redirect_to @personnage, notice: 'Personnage was successfully created.' }\n format.json { render json: @personnage, status: :created, location: @personnage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @thermo_oil_distribution_year = ThermoOilDistributionYear.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thermo_oil_distribution_year }\n end\n end",
"def create\n @cage = current_user.cages.new(params[:cage])\n\n respond_to do |format|\n if @cage.save\n format.json { render json: @cage, status: :created, location: @cage }\n else\n format.json { render json: @cage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def human_years\n age * DOG_YEARS\n end",
"def family_params\r\n params.require(:family).permit(:name)\r\n end",
"def family_document_params\n params.require(:family_document).permit(:professional_id, :code)\n end",
"def create\n @family = Family.new(family_params)\n @family.church = current_church\n\n if @family.save\n flash[:notice] = t('.success', name: @family.name)\n redirect_to action: :index\n else\n render :new\n end\n end",
"def league_year_params\n params.require(:league_year).permit(:league_id, :start_date, :end_date, :season_name, :season_type, :current_season, :season_year)\n end",
"def family_params\n params.require(:family).permit(:name)\n end",
"def update\n respond_to do |format|\n if @pupil_has_year.update(pupil_has_year_params)\n format.html { redirect_to pupil_has_years_path, notice: 'Pupil has year was successfully updated.' }\n format.json { render :show, status: :ok, location: @pupil_has_year }\n else\n format.html { render :edit }\n format.json { render json: @pupil_has_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def dog_years(years)\n\t\tnew_years = years * 7\n\t\tputs new_years\n\tend",
"def family_params\n params.require(:family).permit(:name, :status)\n end",
"def family_relationship_params\n params.require(:family_relationship).permit(:code, :name)\n end",
"def create\n @aulas_falta = AulasFalta.new(params[:aulas_falta])\n @aulas_falta.ano_letivo = Time.now.year\n respond_to do |format|\n if @aulas_falta.save\n flash[:notice] = 'AulasFalta was successfully created.'\n format.html { redirect_to(@aulas_falta) }\n format.xml { render :xml => @aulas_falta, :status => :created, :location => @aulas_falta }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @aulas_falta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @gage = Gage.new(params[:gage])\n\n respond_to do |format|\n if @gage.save\n format.html { redirect_to @gage, notice: 'Gage was successfully created.' }\n format.json { render json: @gage, status: :created, location: @gage }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6438343",
"0.62902886",
"0.6277119",
"0.62587136",
"0.62587136",
"0.6258327",
"0.6238422",
"0.6130075",
"0.60942996",
"0.6091296",
"0.60606706",
"0.6060202",
"0.60494065",
"0.60237074",
"0.5958604",
"0.5944585",
"0.59040654",
"0.5886411",
"0.58839154",
"0.58768266",
"0.5851221",
"0.57908314",
"0.57879275",
"0.576272",
"0.5719611",
"0.57014173",
"0.56822276",
"0.5678016",
"0.5652658",
"0.5640719",
"0.56262696",
"0.5625777",
"0.5585979",
"0.5574522",
"0.55679184",
"0.5541058",
"0.55406845",
"0.55348366",
"0.55283964",
"0.5515039",
"0.55108213",
"0.5505643",
"0.5490885",
"0.5481541",
"0.5473545",
"0.5466138",
"0.5456127",
"0.5445616",
"0.5441796",
"0.54199535",
"0.54175097",
"0.5415481",
"0.5402049",
"0.5387987",
"0.537424",
"0.5365297",
"0.53651243",
"0.53540176",
"0.53514564",
"0.53499967",
"0.5348781",
"0.53389543",
"0.5327915",
"0.53199655",
"0.5313926",
"0.5310511",
"0.53051",
"0.52958506",
"0.52920073",
"0.528836",
"0.52766144",
"0.5274687",
"0.5270383",
"0.5255071",
"0.5252562",
"0.5251569",
"0.5249773",
"0.52487415",
"0.5240656",
"0.5232074",
"0.52286994",
"0.52232844",
"0.5220026",
"0.5218334",
"0.51949066",
"0.51947194",
"0.5186593",
"0.5186593",
"0.5186593",
"0.5181545",
"0.5175605",
"0.51755756",
"0.51719666",
"0.51704645",
"0.5165257",
"0.5164364",
"0.5163907",
"0.51632243",
"0.51559305",
"0.51551235"
] | 0.68905896 | 0 |
PATCH/PUT /family_years/1 PATCH/PUT /family_years/1.json | def update
respond_to do |format|
if @family_year.update(family_year_params)
format.html { redirect_to @family_year, notice: tr("family_year_updated") }
else
format.html { render :edit }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n respond_to do |format|\n if @fiscal_year.update(fiscal_year_params)\n format.html { redirect_to @fiscal_year, notice: 'Fiscal year was successfully updated.' }\n format.json { render :show, status: :ok, location: @fiscal_year }\n else\n format.html { render :edit }\n format.json { render json: @fiscal_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @year.update(year_params)\n format.html { redirect_to @year, notice: 'Year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_family_year\n @family_year = FamilyYear.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @family.update(family_params)\n format.html { redirect_to @family, notice: 'Family was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @firework_year.update(firework_year_params)\n format.html { redirect_to @firework_year, notice: 'Firework year was successfully updated.' }\n format.json { render :show, status: :ok, location: @firework_year }\n else\n format.html { render :edit }\n format.json { render json: @firework_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @year.update(year_params)\n format.html { redirect_to @year, notice: 'Year was successfully updated.' }\n format.json { render :show, status: :ok, location: @year }\n else\n format.html { render :edit }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @year.update(year_params)\n format.html { redirect_to @year, notice: 'Year was successfully updated.' }\n format.json { render :show, status: :ok, location: @year }\n else\n format.html { render :edit }\n format.json { render json: @year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @team_year.update(team_year_params)\n format.html { redirect_to @team_year, notice: 'Team year was successfully updated.' }\n format.json { render :show, status: :ok, location: @team_year }\n else\n format.html { render :edit }\n format.json { render json: @team_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @yearly_info.update(yearly_info_params)\n format.html { redirect_to @yearly_info, notice: 'Yearly info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @yearly_info.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @pupil_has_year.update(pupil_has_year_params)\n format.html { redirect_to pupil_has_years_path, notice: 'Pupil has year was successfully updated.' }\n format.json { render :show, status: :ok, location: @pupil_has_year }\n else\n format.html { render :edit }\n format.json { render json: @pupil_has_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @built_year.update(built_year_params)\n format.html { redirect_to @built_year, notice: 'Built year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @built_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @family.update(family_params)\r\n format.html { redirect_to @family, notice: 'Family was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @family }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @family.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @family = Family.find(params[:id])\n @user = User.find_by_email(session[:user_email])\n if @user && @user.identity == 2\n\[email protected]_by = nil\n end\n respond_to do |format|\n if @family.update_attributes(params[:family])\n format.html { redirect_to session[:redirect_path], notice: 'Family was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n @family.slug=nil\n if @family.update(family_params)\n format.html { redirect_to @family, notice: 'La familia fue actualizada exitosamente.' }\n format.json { render :show, status: :ok, location: @family }\n else\n format.html { render :edit }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @family_crest = FamilyCrest.find(params[:id])\n\n respond_to do |format|\n if @family_crest.update_attributes(params[:family_crest])\n format.html { redirect_to @family_crest, notice: 'Family crest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_crest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n params[:family][:name] = params[:family][:name].split(\" \").map{|a| a.capitalize}.join(\" \")\n if @family.update(family_params)\n format.json { render :show, status: :ok, location: @family }\n format.html { redirect_to @family, notice: 'Family was successfully updated.' }\n else\n format.json { render json: @family.errors, status: :unprocessable_entity }\n format.html { render :edit }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sponsor_year.update(sponsor_year_params)\n format.html { redirect_to @sponsor_year, notice: 'Sponsor year was successfully updated.' }\n format.json { render :show, status: :ok, location: @sponsor_year }\n else\n format.html { render :edit }\n format.json { render json: @sponsor_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @mp_year.update(mp_year_params)\n format.html { redirect_to mp_years_path, notice: 'Mp year was successfully updated.' }\n format.json { render :show, status: :ok, location: @mp_year }\n else\n format.html { render :edit }\n format.json { render json: @mp_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @family_document.update(family_document_params)\n format.html { redirect_to @family_document, notice: \"Family document was successfully updated.\" }\n format.json { render :show, status: :ok, location: @family_document }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @family_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @family = Family.find(params[:id])\n\n respond_to do |format|\n if @family.update_attributes(params[:family])\n flash[:notice] = \"Family #{@family.business_name} was successfully updated.\"\n format.html { redirect_to(@family) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @family.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @acedemic_year.update(acedemic_year_params)\n format.html { redirect_to @acedemic_year, notice: 'Academic year was successfully updated.' }\n format.json { render :show, status: :ok, location: @acedemic_year }\n else\n format.html { render :edit }\n format.json { render json: @acedemic_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @signature_year.update(signature_year_params)\n format.html { redirect_to @signature_year, notice: t('.success') }\n format.json { render :show, status: :ok, location: @signature_year }\n else\n format.html { render :edit }\n format.json { render json: @signature_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @language_family.update(language_family_params)\n format.html { redirect_to @language_family, notice: 'Language family was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @language_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sub_family.update(sub_family_params)\n format.html { redirect_to @sub_family, notice: 'Sub família foi atualizada.' }\n format.json { render :show, status: :ok, location: @sub_family }\n else\n format.html { render :edit }\n format.json { render json: @sub_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @year_group.update(year_group_params)\n format.html { redirect_to @year_group, notice: 'Year group was successfully updated.' }\n format.json { render :show, status: :ok, location: @year_group }\n else\n format.html { render :edit }\n format.json { render json: @year_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n\n respond_to do |format|\n if @early_pregnancy.update_attributes(params[:early_pregnancy])\n format.html { redirect_to @early_pregnancy, notice: 'Early pregnancy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @early_pregnancy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n\n respond_to do |format|\n if @thermo_oil_distribution_year.update_attributes(params[:thermo_oil_distribution_year])\n format.html { redirect_to @thermo_oil_distribution_year, notice: 'Thermo oil distribution year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @thermo_oil_distribution_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @family_group.update(family_group_params)\n format.html { redirect_to @family_group, notice: 'Family group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @family_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @schoolyear.update(schoolyear_params)\n format.html { redirect_to @schoolyear, notice: 'Schoolyear was successfully updated.' }\n format.json { render :show, status: :ok, location: @schoolyear }\n else\n format.html { render :edit }\n format.json { render json: @schoolyear.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grad_year.update(grad_year_params)\n format.html { redirect_to @grad_year, notice: 'Grad year was successfully updated.' }\n format.json { render :show, status: :ok, location: @grad_year }\n else\n format.html { render :edit }\n format.json { render json: @grad_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end",
"def update\n addMembers\n respond_to do |format|\n if @family.update(family_params)\n format.html { redirect_to @family, notice: 'Family was successfully updated.' }\n format.json { render :show, status: :ok, location: @family }\n else\n format.html { render :edit }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @family_relationship.update(family_relationship_params)\n format.html { redirect_to @family_relationship, notice: 'Family relationship was successfully updated.' }\n format.json { render :show, status: :ok, location: @family_relationship }\n else\n format.html { render :edit }\n format.json { render json: @family_relationship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # go to params hash and get the id\n the_id = params['id']\n\n # grab a single family based on the id\n family = Family.find_by(id: the_id)\n\n # update it\n if family.update!(\n first_name: params[:first_name],\n last_name: params[:last_name],\n email: params[:email],\n password: params[:password],\n phone_number: params[:phone_number],\n street_address: params[:street_address],\n secondary_address: params[:secondary_address],\n city: params[:city],\n state: params[:state],\n zip_code: params[:zip_code],\n photo: params[:photo])\n render json: family.as_json\n else\n render json: {errors: family.errors.full_messages}\n end\n end",
"def update\n @cold_production_year = ColdProductionYear.find(params[:id])\n\n respond_to do |format|\n if @cold_production_year.update_attributes(params[:cold_production_year])\n format.html { redirect_to @cold_production_year, notice: 'Cold production year was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cold_production_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @control_family = ControlFamily.find(params[:id])\n\n respond_to do |format|\n if @control_family.update_attributes(params[:control_family])\n format.html { redirect_to @control_family, :notice => 'Control family was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @control_family.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @person.update_attributes(params[:person])\n respond_with(@person)\n end",
"def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end",
"def update!(**args)\n @age_years = args[:age_years] if args.key?(:age_years)\n @min_age_years = args[:min_age_years] if args.key?(:min_age_years)\n end",
"def update\n @reimbursement = Reimbursement.find(params[:id])\n @year_insurances = YearInsurance.active.joins(:family)\n respond_to do |format|\n if @reimbursement.update_attributes(params[:reimbursement])\n format.html { redirect_to reimbursements_path, notice: 'Reimbursement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reimbursement.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'FOAF was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n study_period_params.permit!\n @study_period.study_year = @year\n respond_to do |format|\n if @study_period.update(study_period_params)\n format.html { redirect_to study_year_study_periods_path(current_user.current_year), notice: 'Учебный отрезок успешно обновлен.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @study_period.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thirtyfife.update(thirtyfife_params)\n format.html { redirect_to @thirtyfife, notice: 'Thirtyfive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thirtyfife.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@family ||= Family.find(params[:id])\n respond_to do |format|\n if @family.update_attributes(params[:family])\n flash[:notice] = 'Family was successfully updated.'\n format.html { redirect_to(@family) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @family.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @time_of_year.update(time_of_year_params)\n format.html { redirect_to @time_of_year, notice: 'Time of year was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_of_year }\n else\n format.html { render :edit }\n format.json { render json: @time_of_year.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'Foaf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @college_fee = CollegeFee.find(params[:id])\n\n respond_to do |format|\n if @college_fee.update_attributes(params[:college_fee])\n format.html { redirect_to @college_fee, notice: 'College fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @college_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @cage.update_attributes(params[:cage])\n format.json { head :no_content }\n else\n format.json { render json: @cage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @family_member = FamilyMember.find(params[:id])\n\n respond_to do |format|\n if @family_member.update_attributes(params[:family_member])\n format.html { redirect_to @family_member, notice: 'Family member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @family_member = FamilyMember.find(params[:id])\n\n respond_to do |format|\n if @family_member.update_attributes(family_member_params)\n format.html { redirect_to @family_member, notice: 'Family member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_member.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @organization_person = OrganizationPerson.find(params[:id])\n\n if @organization_person.update(organization_person_params)\n render json: @organization_person\n else\n render json: @organization_person.errors, status: :unprocessable_entity\n end\n end",
"def update\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n if @golfer.update_attributes(params[:golfer])\n format.html { redirect_to @golfer, notice: 'Golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @family_unit = FamilyUnit.find(params[:id])\n\n respond_to do |format|\n if @family_unit.update_attributes(params[:family_unit])\n format.html { redirect_to @family_unit, notice: 'Family unit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_unit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @family_history.update(family_history_params)\n format.html { redirect_to patient_path(@family_history.patient), notice: 'Family history was successfully updated.' }\n format.json { render :show, status: :ok, location: @family_history }\n else\n format.html { render :edit }\n format.json { render json: @family_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @family_history = FamilyHistory.find(params[:id])\n\n respond_to do |format|\n if @family_history.update_attributes(params[:family_history])\n format.html { redirect_to PersonalDetail.find(@family_history.personal_detail_id), notice: 'Family history was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @family_history.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @personnage = Personnage.find(params[:id])\n\n respond_to do |format|\n if @personnage.update_attributes(params[:personnage])\n format.html { redirect_to @personnage, notice: 'Personnage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @os_family.update(os_family_params)\n format.html { redirect_to @os_family, notice: 'Os family was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_family }\n else\n format.html { render :edit }\n format.json { render json: @os_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @person = Person.find(params[:id])\n # @person.pct_complete = @person.requirement_progress\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, :notice => 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @person.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative_update.update(api_v1_initiative_update_params)\n format.html { redirect_to @api_v1_initiative_update, notice: 'Initiative update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative.update(api_v1_initiative_params)\n format.html { redirect_to @api_v1_initiative, notice: 'Initiative was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\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\n @anniversary = Anniversary.find(params[:id])\n\n respond_to do |format|\n if @anniversary.update_attributes(params[:anniversary])\n format.html { redirect_to @anniversary, notice: 'Anniversary was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @anniversary.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @events_by_year = EventsByYear.find(params[:id])\n\n respond_to do |format|\n if @events_by_year.update_attributes(params[:events_by_year])\n flash[:notice] = 'EventsByYear was successfully updated.'\n format.html { redirect_to(@events_by_year) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @events_by_year.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @golf_cource = GolfCource.find(params[:id])\n\n respond_to do |format|\n if @golf_cource.update_attributes(params[:golf_cource])\n format.html { redirect_to scaffold_golf_cource_url(@golf_cource), notice: 'Golf cource was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @golf_cource.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @feria2009calificacion = Feria2009calificacion.find(params[:id])\n\n respond_to do |format|\n if @feria2009calificacion.update_attributes(params[:feria2009calificacion])\n format.html { redirect_to(@feria2009calificacion, :notice => 'Feria2009calificacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feria2009calificacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @fred = Fred.find(params[:id])\n\n respond_to do |format|\n if @fred.update_attributes(params[:fred])\n format.html { redirect_to @fred, notice: 'Fred was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fred.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @year_class.update(year_class_params)\n format.html { redirect_to @year_class, notice: 'Year class was successfully updated.' }\n format.json { render :show, status: :ok, location: @year_class }\n else\n format.html { render :edit }\n format.json { render json: @year_class.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @familium = Familium.find(params[:id])\n\n respond_to do |format|\n if @familium.update_attributes(params[:familium])\n format.html { redirect_to @familium, notice: 'Familia fue actualizada existosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @familium.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @femalejump_head.update(femalejump_head_params)\n format.html { redirect_to @femalejump_head, notice: 'Femalejump head was successfully updated.' }\n format.json { render :show, status: :ok, location: @femalejump_head }\n else\n format.html { render :edit }\n format.json { render json: @femalejump_head.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_initiative_field.update(api_v1_initiative_field_params)\n format.html { redirect_to @api_v1_initiative_field, notice: 'Initiative field was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_initiative_field }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_initiative_field.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @holy_book = HolyBook.find(params[:id])\n\n respond_to do |format|\n if @holy_book.update_attributes(params[:holy_book])\n format.html { redirect_to @holy_book, notice: 'Holy book was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @holy_book.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to people_path, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update!(**args)\n @family_calendar_id = args[:family_calendar_id] if args.key?(:family_calendar_id)\n end",
"def update\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n if @gage.update_attributes(params[:gage])\n format.html { redirect_to @gage, notice: 'Gage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @female800mt.update(female800mt_params)\n format.html { redirect_to @female800mt, notice: 'Female800mt was successfully updated.' }\n format.json { render :show, status: :ok, location: @female800mt }\n else\n format.html { render :edit }\n format.json { render json: @female800mt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # { clinic: {id: references, \"license_id\"=>nil, \"name\"=>string } }\n \n if @clinic.update_attributes(params[:clinic].except(:api_license_id))\n head :no_content\n else\n render json: clinic.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n @initiative = Initiative.find(params[:id])\n \n respond_to do |format|\n if @initiative.update_attributes(params[:initiative])\n \n format.html { redirect_to @initiative, notice: 'Initiative was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @initiative.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @salary_range = SalaryRange.find(params[:id])\n\n respond_to do |format|\n if @salary_range.update_attributes(params[:salary_range])\n format.html { redirect_to @salary_range, notice: 'Salary range was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @salary_range.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @relation_industry.update(relation_industry_params)\n format.html { redirect_to @relation_industry, notice: 'Relation industry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @relation_industry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @personnage.update(personnage_params)\n format.html { redirect_to @personnage, notice: \"Personnage was successfully updated.\" }\n format.json { render :show, status: :ok, location: @personnage }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @freerange.update(freerange_params)\n format.html { redirect_to current_user }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @freerange.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @target_age = TargetAge.find(params[:id])\n\n respond_to do |format|\n if @target_age.update_attributes(params[:target_age])\n format.html { redirect_to @target_age, notice: 'Target age was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @target_age.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @office_career.update(office_career_params)\n head :no_content\n end",
"def update\n respond_to do |format|\n if @family_bond.update(family_bond_params)\n format.html { redirect_to @family_bond, notice: 'Family bond was successfully updated.' }\n format.json { render :show, status: :ok, location: @family_bond }\n else\n format.html { render :edit }\n format.json { render json: @family_bond.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @farmer_family.update(farmer_family_params)\n SystemLog.create(description: \"Atualizou as informações do membro da família do agricultor #{@farmer.name}(#{@farmer.farmer_code}) chamado #{@farmer_family.name}\", author: name_and_type_of_logged_user)\n format.html { redirect_to [@group, @farmer_family.farmer, @farmer_family], notice: 'Integrante da familia atualizado com sucesso.' }\n format.json { render :show, status: :ok, location: @farmer_family }\n else\n format.html { render :edit }\n format.json { render json: @farmer_family.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agency.update_attributes(params[:agency])\n format.html { redirect_to @agency, notice: 'Agency was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @agency = Agency.find(params[:id])\n\n if @agency.update(agency_params)\n #head :no_content\n render json: @agency, status: :accepted, location: @agency #sera? status accepted? \n else\n render json: @agency.errors, status: :unprocessable_entity\n end\n end",
"def update\n @employment = Employment.find(params[:id])\n\n respond_to do |format|\n if @employment.update_attributes(params[:employment])\n format.html { redirect_to @employment, notice: 'Employment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @college = College.find(params[:id])\n\n respond_to do |format|\n if @college.update_attributes(params[:college])\n format.html { redirect_to '/colleges', notice: 'College was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @college.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @contractor_feature = ContractorFeature.find(params[:id])\n\n respond_to do |format|\n if @contractor_feature.update_attributes(params[:contractor_feature])\n format.html { redirect_to @contractor_feature, notice: 'Contractor feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contractor_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @agency.update(agency_params)\n format.html { redirect_to @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: @agency.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n fiscal_year = FiscalYear.find(params[:id])\n unless fiscal_year.update_attributes(params[:fiscal_year])\n flash[:error] = \"Fiscal year already exists\"\n render :index \n return\n end\n flash[:notice] = t(:settings) + t(:updated)\n redirect_to fiscal_years_path\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6571609",
"0.65660876",
"0.6565878",
"0.65470546",
"0.65375054",
"0.6528177",
"0.6469223",
"0.6469223",
"0.64307237",
"0.6422923",
"0.6367424",
"0.63638264",
"0.6359064",
"0.6343613",
"0.6286524",
"0.6277244",
"0.6255928",
"0.6230749",
"0.61950463",
"0.61632437",
"0.61591387",
"0.61479276",
"0.6137258",
"0.6137078",
"0.6124551",
"0.61242354",
"0.6122952",
"0.60829365",
"0.6081977",
"0.6073694",
"0.60162014",
"0.6002441",
"0.60023963",
"0.59863",
"0.598521",
"0.5982047",
"0.5977721",
"0.597055",
"0.59618306",
"0.5960461",
"0.5956345",
"0.5945202",
"0.5943176",
"0.59246916",
"0.5923774",
"0.59187114",
"0.59142125",
"0.5909477",
"0.5893699",
"0.5892037",
"0.5891789",
"0.5887355",
"0.58750963",
"0.5874467",
"0.5869912",
"0.5864073",
"0.5862691",
"0.586266",
"0.5862656",
"0.5857982",
"0.5857403",
"0.58418894",
"0.5826721",
"0.58186495",
"0.58138895",
"0.580388",
"0.5789274",
"0.57781416",
"0.5776449",
"0.5772831",
"0.5771067",
"0.5769785",
"0.5756716",
"0.57505614",
"0.57490504",
"0.5744832",
"0.57445705",
"0.5738777",
"0.5735596",
"0.5733266",
"0.5726345",
"0.5725746",
"0.5722561",
"0.57170343",
"0.57132244",
"0.57041603",
"0.5698547",
"0.56933874",
"0.5690642",
"0.5686827",
"0.5684353",
"0.56811154",
"0.56745493",
"0.56730247",
"0.5672239",
"0.5672205",
"0.5671886",
"0.5665014",
"0.56645787",
"0.56645787"
] | 0.71121293 | 0 |
DELETE /family_years/1 DELETE /family_years/1.json | def destroy
family = @family_year.family
@family_year.destroy
respond_to do |format|
format.html { redirect_to family, notice: tr("family_year_destroyed") }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @built_year.destroy\n respond_to do |format|\n format.html { redirect_to built_years_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @yearly_info.destroy\n respond_to do |format|\n format.html { redirect_to yearly_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fiscal_year.destroy\n respond_to do |format|\n format.html { redirect_to fiscal_years_url, notice: 'Fiscal year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_crest = FamilyCrest.find(params[:id])\n @family_crest.destroy\n\n respond_to do |format|\n format.html { redirect_to family_crests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @firework_year.destroy\n respond_to do |format|\n format.html { redirect_to firework_years_url, notice: 'Firework year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family = Family.find(params[:id])\n @family.destroy\n\n respond_to do |format|\n format.html { redirect_to families_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family.destroy\n respond_to do |format|\n format.html { redirect_to families_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @year.destroy\n respond_to do |format|\n format.html { redirect_to years_url, notice: 'Year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @year.destroy\n respond_to do |format|\n format.html { redirect_to years_url, notice: 'Year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @signature_year.destroy\n respond_to do |format|\n format.html { redirect_to signature_years_url, notice: t('.success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family = Family.find(params[:id])\n @family.destroy\n\n respond_to do |format|\n format.html { redirect_to session[:redirect_path] }\n format.json { head :ok }\n end\n end",
"def destroy\n @family.destroy\n respond_to do |format|\n format.html { redirect_to families_url, notice: 'La familia fue eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thermo_oil_distribution_year = ThermoOilDistributionYear.find(params[:id])\n @thermo_oil_distribution_year.destroy\n\n respond_to do |format|\n format.html { redirect_to thermo_oil_distribution_years_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grad_year.destroy\n respond_to do |format|\n format.html { redirect_to grad_years_url, notice: 'Grad year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sponsor_year.destroy\n respond_to do |format|\n format.html { redirect_to sponsor_years_url, notice: 'Sponsor year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family.destroy\n respond_to do |format|\n format.html { redirect_to families_url, notice: 'Family was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pupil_has_year.destroy\n respond_to do |format|\n format.html { redirect_to pupil_has_years_url, notice: 'Pupil has year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @team_year.destroy\n respond_to do |format|\n format.html { redirect_to team_years_url, notice: 'Team year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @family.destroy\r\n respond_to do |format|\r\n format.html { redirect_to families_url, notice: 'Family was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @schoolyear.destroy\n respond_to do |format|\n format.html { redirect_to schoolyears_url, notice: 'Schoolyear was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_of_year.destroy\n respond_to do |format|\n format.html { redirect_to time_of_years_url, notice: 'Time of year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_history = FamilyHistory.find(params[:id])\n @family_history.destroy\n\n respond_to do |format|\n format.html { redirect_to family_histories_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @year_group.destroy\n respond_to do |format|\n format.html { redirect_to year_groups_url, notice: 'Year group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cold_production_year = ColdProductionYear.find(params[:id])\n @cold_production_year.destroy\n\n respond_to do |format|\n format.html { redirect_to cold_production_years_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 @birth.destroy\n respond_to do |format|\n format.html { redirect_to births_url, notice: 'Birth was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @academic_year = AcademicYear.find(params[:id])\n @academic_year.destroy\n\n respond_to do |format|\n format.html { redirect_to(academic_years_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client_sex = ClientSex.find(params[:id])\n @client_sex.destroy\n\n respond_to do |format|\n format.html { redirect_to client_sexes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n# @family = Family.find(params[:id])\n# @family.destroy\n#\n# respond_to do |format|\n# format.html { redirect_to(families_url) }\n# format.xml { head :ok }\n# end\n end",
"def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_document.destroy\n respond_to do |format|\n format.html { redirect_to family_documents_url, notice: \"Family document was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @barrels_income.destroy\n respond_to do |format|\n format.html { redirect_to barrels_incomes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @personnage = Personnage.find(params[:id])\n @personnage.destroy\n\n respond_to do |format|\n format.html { redirect_to personnages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_group.destroy\n respond_to do |format|\n format.html { redirect_to family_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thirtyfife.destroy\n respond_to do |format|\n format.html { redirect_to thirtyfives_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_unit = FamilyUnit.find(params[:id])\n @family_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to family_units_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @familium = Familium.find(params[:id])\n @familium.destroy\n\n respond_to do |format|\n format.html { redirect_to familia_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_history.destroy\n respond_to do |format|\n format.html { redirect_to family_histories_url, notice: 'Family history was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @language_family.destroy\n respond_to do |format|\n format.html { redirect_to language_families_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gage = Gage.find(params[:id])\n @gage.destroy\n\n respond_to do |format|\n format.html { redirect_to gages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @franchisee_royalty.destroy\n respond_to do |format|\n format.html { redirect_to franchisee_royalties_url, notice: 'Franchisee royalty was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n \n end",
"def destroy\n @thirtyfour.destroy\n respond_to do |format|\n format.html { redirect_to thirtyfours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @campus_food = CampusFood.find(params[:id])\n @campus_food.destroy\n\n respond_to do |format|\n format.html { redirect_to campus_foods_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @person = Person.find(params[:id])\n @person.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end",
"def destroy\n @alumno.destroy\n respond_to do |format|\n format.html { redirect_to grupos_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @undergraduate_major = UndergraduateMajor.find(params[:id])\n @undergraduate_major.destroy\n\n respond_to do |format|\n format.html { redirect_to undergraduate_majors_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @target_age = TargetAge.find(params[:id])\n @target_age.destroy\n\n respond_to do |format|\n format.html { redirect_to target_ages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @college_fee = CollegeFee.find(params[:id])\n @college_fee.destroy\n\n respond_to do |format|\n format.html { redirect_to college_fees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @mp_year.destroy\n respond_to do |format|\n format.html { redirect_to mp_years_url, notice: 'Mp year was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @golf_cource = GolfCource.find(params[:id])\n @golf_cource.destroy\n\n respond_to do |format|\n format.html { redirect_to scaffold_golf_cources_url }\n format.json { head :ok }\n end\n end",
"def destroy\n\t\t@family ||= Family.find(params[:id])\n @family.destroy\n respond_to do |format|\n format.html { redirect_to(families_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @anniversary = Anniversary.find(params[:id])\n @anniversary.destroy\n\n respond_to do |format|\n format.html { redirect_to anniversaries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @early_pregnancy = EarlyPregnancy.find(params[:id])\n @early_pregnancy.destroy\n\n respond_to do |format|\n format.html { redirect_to early_pregnancies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @os_family.destroy\n respond_to do |format|\n format.html { redirect_to os_families_url, notice: 'Os family was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @code_club_school.destroy\n respond_to do |format|\n format.html { redirect_to code_club_schools_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agency.update_attribute(:status, 'N')\n respond_to do |format|\n format.html { redirect_to agencies_url, notice: 'Agency was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @relation_industry.destroy\n respond_to do |format|\n format.html { redirect_to relation_industries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @personal_finance.destroy\n respond_to do |format|\n format.html { redirect_to personal_finances_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @academic_degree.destroy\n respond_to do |format|\n format.html { redirect_to '/maestricos/prueba?titulo=Grado+Academico&tabla=AcademicDegree' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company_country = CompanyCountry.find(params[:id])\n @company_country.destroy\n\n respond_to do |format|\n format.html { redirect_to company_countries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_member = FamilyMember.find(params[:id])\n @family_member.destroy\n\n respond_to do |format|\n format.html { redirect_to family_members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_member = FamilyMember.find(params[:id])\n @family_member.destroy\n\n respond_to do |format|\n format.html { redirect_to family_members_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thirtyone.destroy\n respond_to do |format|\n format.html { redirect_to thirtyones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @femalejump_head.destroy\n respond_to do |format|\n format.html { redirect_to femalejump_heads_url, notice: 'Femalejump head was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n respond_to do |format|\n if current_user.families.include?(@family)\n @family.destroy\n format.json { render json: {destroyed: \"Familiar '#{@family.name}' eliminado correctamente\"}, status: :ok }\n else\n format.json { render json: {error: \"No posees los permisos para eliminar a esta persona\", families: current_user.families}, status: 401 }\n # format.json { head :no_content }\n end\n format.html { redirect_to families_url, notice: 'Family was successfully destroyed.' }\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 @thirtyeight.destroy\n respond_to do |format|\n format.html { redirect_to thirtyeights_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thirtythree.destroy\n respond_to do |format|\n format.html { redirect_to thirtythrees_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @female800mt.destroy\n respond_to do |format|\n format.html { redirect_to female800mts_url, notice: 'Female800mt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_initiative_update.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_initiative_updates_url, notice: 'Initiative update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @golfer = Golfer.find(params[:id])\n @golfer.destroy\n\n respond_to do |format|\n format.html { redirect_to golfers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @events_by_year = EventsByYear.find(params[:id])\n @events_by_year.destroy\n\n respond_to do |format|\n format.html { redirect_to(events_by_years_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @family_member.destroy\n respond_to do |format|\n format.html { redirect_to family_members_url, notice: 'Family member was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @family_relationship.destroy\n respond_to do |format|\n format.html { redirect_to family_relationships_url, notice: 'Family relationship was successfully destroyed.' }\n format.json { head :no_content }\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",
"def destroy\n @karyalay_attribute.destroy\n respond_to do |format|\n format.html { redirect_to karyalay_attributes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @surgery = Surgery.find(params[:id])\n @surgery.destroy\n\n respond_to do |format|\n format.html { redirect_to surgeries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @person = Person.find(params[:id])\n @person.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 @year_class.destroy\n respond_to do |format|\n format.html { redirect_to year_classes_url, notice: 'Year class was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @forest.destroy\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @familium.destroy\n respond_to do |format|\n format.html { redirect_to familia_url, notice: 'Familium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n p = @award.patient\n @award.destroy\n p.reload\n respond_to do |format|\n format.html { redirect_to awards_url, notice: 'Award was successfully destroyed.' }\n format.json { render json: {:award => @award, :lifetime => p.lifetime_total, :year => p.funds_this_year, :quarter => p.funds_this_quarter } }\n end\n end",
"def destroy\n @forest = Forest.find(params[:id])\n @forest.destroy\n\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n genus = Genu.all;\n genus.each do |genu|\n if(genu.sub_family_id == @sub_family.id)\n genu.destroy\n end\n end\n @sub_family.destroy\n respond_to do |format|\n format.html { redirect_to sub_families_url, notice: 'Sub família foi deletada.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @goody = Goody.find(params[:id])\n @goody.destroy\n\n respond_to do |format|\n format.html { redirect_to goodies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :ok }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def destroy\n @college = College.find(params[:id])\n @college.destroy\n\n respond_to do |format|\n format.html { redirect_to colleges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @org_award.destroy\n respond_to do |format|\n format.html { redirect_to org_awards_url, notice: 'Org award was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_v1_initiative.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_initiatives_url, notice: 'Initiative was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @company.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @female1500mt.destroy\n respond_to do |format|\n format.html { redirect_to female1500mts_url, notice: 'Female1500mt was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @club_path = ClubPath.find(params[:id])\n @club_path.destroy\n\n respond_to do |format|\n format.html { redirect_to club_paths_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @country = Country.find(params[:id])\n @country.destroy\n\n respond_to do |format|\n format.html { redirect_to countries_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.70793766",
"0.693862",
"0.69196165",
"0.6907",
"0.68951106",
"0.68950105",
"0.68873906",
"0.68519294",
"0.68505776",
"0.68505776",
"0.6843548",
"0.68267834",
"0.679136",
"0.6744069",
"0.6718606",
"0.6680135",
"0.66764873",
"0.66675436",
"0.6657135",
"0.6625322",
"0.6612354",
"0.6610305",
"0.66024786",
"0.66018593",
"0.6600405",
"0.65986633",
"0.6585657",
"0.65848196",
"0.65815115",
"0.657648",
"0.65753233",
"0.65530515",
"0.65468895",
"0.65396404",
"0.6537184",
"0.65317374",
"0.652503",
"0.65247154",
"0.6511135",
"0.65108377",
"0.65105855",
"0.65096366",
"0.65034723",
"0.6484603",
"0.6478087",
"0.64747006",
"0.6474316",
"0.6472996",
"0.6466975",
"0.6466657",
"0.64625144",
"0.64611125",
"0.6460684",
"0.64523375",
"0.6444872",
"0.64403605",
"0.6437397",
"0.64373535",
"0.6430446",
"0.64240485",
"0.64237404",
"0.6421334",
"0.64180833",
"0.6416225",
"0.6416225",
"0.63994825",
"0.63991535",
"0.6398735",
"0.6397859",
"0.6390494",
"0.6389829",
"0.63893336",
"0.63784677",
"0.63736093",
"0.6367652",
"0.6359917",
"0.63595617",
"0.6357419",
"0.63565874",
"0.63560075",
"0.63534904",
"0.6348242",
"0.6347669",
"0.6346047",
"0.63428694",
"0.63391435",
"0.63378626",
"0.63357455",
"0.63356423",
"0.6334731",
"0.6334731",
"0.6334731",
"0.6334528",
"0.63332206",
"0.6327361",
"0.6320561",
"0.63174623",
"0.6314257",
"0.6313781",
"0.6313386"
] | 0.713918 | 0 |
Use callbacks to share common setup or constraints between actions. | def set_family_year
@family_year = FamilyYear.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 family_year_params
if @user.can_access_interview_notes?
params.require(:family_year).permit(:community_id, :family_id, :school_year, :picture, :notes)
else
params.require(:family_year).permit(:community_id, :family_id, :school_year, :picture)
end
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 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 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 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 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 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.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] | 0.0 | -1 |
transfer the payement to poster account. | def transfer_money
@recipient_details = BankDetail.where("user_id =?", params[:poster_id]).first
@booking = Booking.find(params[:booking_id])
if @recipient_details
@price = @booking.price.to_i
data = PaymentTransfer.transfer_money_to_poster(@booking,@recipient_details)
if data.class == Stripe::InvalidRequestError
redirect_to :back, :notice => "Stripe error while creating customer: #{data.message}"
else
redirect_to payement_transfers_path
flash[:notice] = "Payement was successfully transfered to #{@recipient_details.stripe_card_id_token}. Amount transfer to poster $#{data[0]} and commision is $#{data[1]}"
end
else
transfer_payment = @booking.update_columns(comment: "Waiting for poster bank account.")
flash[:error] = "No bank detail added for payment"
redirect_to payement_transfers_path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_confirmation\n Transfer.create(\n receiver: self,\n amount: 1_000.0,\n source_currency: 'USD',\n target_currency: 'USD',\n exchange_rate: 1.0,\n status: Transfer::SUCCESS\n )\n super\n end",
"def transfer(tx)\n pay_id = get_payment_id(tx.id)\n puts \" the transaction will be transferred here ... for payment id : \" , get_payment_id(tx.id) , \" the listing author is : \" , tx.listing_author_id\n seller_account = razorpay_accounts_api.get(person_id: tx.listing_author_id, community_id: tx.community_id).data\n if seller_account && seller_account[:verification_status] == \"activated\"\n razorpay_api.direct_transfer(community: tx.community_id, payment_id: pay_id, amount: order_total(tx).cents - order_commission(tx).cents, razorpay_account_id: seller_account[:razorpay_account_id])\n else \n raise \"The Seller Account is not verified\"\n end \n payment = {}\n Result::Success.new(payment)\n rescue => exception\n Result::Error.new(exception.message)\n end",
"def transfer\n\t\tattributes = super\n\t\tself.last_backup_date = Date.today\n\t\tset_next_backup_date\n\t\tself.save\n\t\tlog_transfer(attributes)\n\tend",
"def transfer(*args)\n commit 'MassPay', build_mass_pay_request(*args)\n end",
"def transfer(amount,to,memo=nil)\n client.post(transaction_url,{:amount=>amount,:to=>to,:memo=>memo}) if client\n end",
"def give_back_money\n if(@transaction.sender)\n @transaction.sender.balance += @transaction.amount\n @transaction.sender.save\n \n end\n\n if(@transaction.receiver)\n @transaction.receiver.balance -= Monetize.parse(convert(Money.new(@transaction.amount,findCurrency(@transaction.sender_id,@transaction.receiver_id,'sent')), @transaction.receiver.currency)).fractional\n @transaction.receiver.save\n end\n end",
"def pay\n @cash_out = CashOut.find(params[:id])\n\n @transaction = Transaction.new\n @transaction.user = @cash_out.user\n @transaction.transaction_type = 'payment'\n @transaction.amount = @cash_out.amount * -1\n @transaction.attachable = @cash_out\n @transaction.transaction_at = Time.now\n\n if @transaction.save\n @cash_out.status = 'paid'\n @cash_out.paid_at = @transaction.transaction_at\n @cash_out.save\n\n flash[:notice] = \"Se ha realizado el pago\"\n redirect_to [:admin, @cash_out]\n else\n flash[:error] = \"No se pudo realizar el pago\"\n redirect_to [:admin, @cash_out]\n end\n end",
"def transfer_funds!\n self.transfer = Stripe::Transfer.create(transfer_params)\n end",
"def transfer\n @purchase = Purchase.find_by(invoice_id: params[:invoice_id])\n authorize(@purchase)\n @bank_account = BankAccount.first\n end",
"def transfer_funds()\n vendor = Portfolio.find(self.seller_id)\n customer = Portfolio.find(self.buyer_id)\n amount = self.transaction_cost\n customer.balance -= amount\n vendor.balance += amount\n \n Transactor.transaction do \n raise \"Transaction of funds failed!\" unless customer.save && vendor.save\n end\n end",
"def transfer\n @purchase = Purchase.find_by(invoice_id: params[:invoice_id])\n @bank_account = BankAccount.first\n end",
"def create\n @payment = Payment.new(payment_params)\n @user = User.find(params[:user_id])\n @payment.proofreader_id = current_user.id\n @payment.request = current_user.balance \n \n \n Stripe.api_key = ENV[\"STRIPE_API_KEY\"]\n token = params[:stripeToken]\n\n recipient = Stripe::Recipient.create(\n :name => @payment.legalname,\n :type => \"individual\",\n :bank_account => token\n )\n current_user.recipient = recipient.id\n current_user.save\n \n\n transfer = Stripe::Transfer.create(\n :amount => (@payment.request * 97).floor,\n :currency => \"usd\",\n :recipient => current_user.recipient\n )\n\n current_user.balance = 0\n current_user.save\n\n respond_to do |format|\n if @payment.save\n format.html { redirect_to dashboard_path, notice: 'Payment was successfully made. You should see your money in your account within 7 business days.' }\n format.json { render action: 'show', status: :created, location: @payment }\n else\n format.html { render action: 'new' }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_transaction_process\n bet_wallet.persist_wallet!\n end",
"def transfer_ownership(recipient)\n update_attribute(:user_id, recipient.id)\n 'extension.ownership_transfer.done'\n end",
"def transfer(amount, other)\n @balance -= amount\n other.balance += amount\n puts \"#{@owner} your balance will be #{@balance} after the transfering to #{other.owner}\"\n end",
"def transfer; end",
"def transfer; end",
"def pay\n \n Notifyer.print( 'Shop::StripeTransfer#pay' , self ) if Rails.env.development?\n \n set_description\n self.process!\n \n begin\n Stripe::Transfer.create(\n amount: self.amount.round.to_i,\n destination: self.destination,\n source_transaction: self.source_transaction,\n currency: self.currency,\n description: self.description,\n metadata: {\n 'description' => self.description,\n 'order_item_id' => self.order_item_id\n },\n statement_descriptor: \"#{self.description} test 001\",\n application_fee: self.application_fee,\n #recipient: self.destination \n )\n self.finis!\n rescue Stripe::StripeError => e\n self.fail!\n self.update(stripe_errors: e.message)\n errored('Shop::StripeTransfer#pay', e )\n return false\n end\n true\n end",
"def create\n @profile = current_user.profile\n @payment = Payment.new(payment_params)\n @payment.profile = current_user.profile\n if @payment.save\n uri = URI('http://acm.ut.ac.ir/epayment/payments')\n parameters = {\n 'merchant' => \"4452A141\",\n 'amount' => @payment.amount,\n 'redirect' => \"http://acm.ut.ac.ir/events/payments/approve\"}\n response = transact(uri, parameters)\n puts response.body\n @payment.response = response.body\n parsed_response = JSON.parse(response.body)\n if parsed_response[\"status\"] != 1\n redirect_to payments_path, notice: \"در ارتباط با بانک خطایی رخ دادهاست.\"\n return\n end\n @payment.reference_key = parsed_response[\"reference\"]\n if @payment.save\n redirect_to parsed_response[\"bank\"]\n return\n else\n render :new\n end\n else\n render :new\n end\n\n end",
"def tradeya_postponed(n)\n @tradeya = n.trade.item\n @offer = n.trade.offer\n headers['X-SMTPAPI'] = '{\"category\": \"TradeYa postponed offerer copy\"}'\n mail(:to => @offer.user.email, :subject => 'TradeYa has been Postponed', :from => 'TradeYa <[email protected]>', :content_type => \"text/html\")\n end",
"def do_pay\n self.paid_at = Time.now.utc\n self.send_paid\n end",
"def transfer_funds_to(amount, target)\n self.balance -= amount\n target.balance += amount\n Account.transaction do\n raise \"Transaction Failed\" unless self.save && target.save && self.balance >0\n end\n end",
"def wepay_postfill\n # If the user approved the 'preapproval' and \n if params.has_key?('preapproval_id')\n @order = Order.find_by_token(params[:preapproval_id])\n unless @order.nil?\n wepay = WePay.new(Settings.wepay_client_id, Settings.wepay_access_token, _use_stage = (!Rails.env.production?))\n # Let's find the user information on Wepay end..\n response = wepay.call('/preapproval', Settings.wepay_access_token, {\n :preapproval_id => params[:preapproval_id]\n })\n \n @order.wepay_postfill(response)\n if params['status'] != 'approved' \n redirect_to :action => :share, :uuid => @order.uuid\n else\n redirect_to root_url\n end\n else\n redirect_to root_url\n end\n else\n redirect_to root_url\n end\n end",
"def transfer_logic(receiver_id, amount)\n receiver = User.find(receiver_id)\n sender = current_user\n sender.credits -= amount\n receiver.credits += amount\n sender.save\n receiver.save\n login(sender)\n end",
"def send_payment_and_dispose!\n mturk_bonus_assignment(self.mturk_assignment_id, self.mturk_worker_id)\n mturk_approve_assignment(self.mturk_assignment_id)\n self.update_attributes(:paid_at => Time.now)\n dispose_hit_on_mturk(self.mturk_hit_id) #we can also delete it on mturk, tidy up\n end",
"def transfer_to(account, amount)\n # `account.name` is accessing the name of the account we are transfering to\n debit amount, \"Transfer to #{account.name}\"\n account.credit amount, \"Transfer from #{@name}\"\n end",
"def transfer(amount, destination_account, options={})\n process('transfer', amount, options) do |gw|\n gw.transfer(amount.cents, destination_account, options)\n end\n end",
"def receive_payment(transaction)\n self.credit(transaction.amount)\n self.save!\n transaction.subscription.reload # reloaded to that the paid_through date is correct\n transaction.message = \"now paid through #{self.paid_through}\"\n\n begin\n Freemium.mailer.deliver_invoice(transaction)\n rescue => e\n transaction.message = \"error sending invoice\"\n end\n end",
"def update\n\n debt = Debt.find_by_id(params[:id])\n payment = BigDecimal( debt_params[:amount] )\n\n # Since the debted user is paying the indebted user,\n # we can simulate this as the indebted user \"owing\"\n # the debted user (a.k.a. the debt owner) the payed off\n # debt.\n Debt.settleDebt(debt.owner, debt.indebted, payment)\n flash[:success] = \"Debt has been paid successfully.\"\n redirect_to root_url\n end",
"def reverse_transfer \n if @status == \"complete\" \n sender.balance += @amount\n receiver.balance -= @amount\n @status = \"reversed\"\n end \n end",
"def transfer(raccount, amount, purpose = [])\n end",
"def transfer_to_stakeholders_account params\n Notifyer.print( 'Stake#transfer_to_stakeholders_account' , params: params ) if Rails.env.development?\n \n \n begin\n order_item = Shop::OrderItem.cached_find( params[:order_item_id] )\n params[:application_fee] = Admin.digiramp_fees( params[:amount] )\n\n \n # sending transfers with same sender and recipient will fail\n begin\n send_micro_transaction params\n rescue => e\n errored('Stake#transfer_to_stakeholders_account', e ) unless Rails.env.development?\n Notifyer.print( 'Stake#transfer_to_stakeholders_account' , \"Not sending money to origin account\" ) if Rails.env.development?\n end\n \n update_income params\n\n rescue => e\n errored('Stake#transfer_to_stakeholders_account', e )\n end \n end",
"def paypal_pay(other_account, amount, currency, subject, note)\n puts \"paypal_pay request: #{other_account}, #{amount}, #{subject}, #{note}\"\n unfinished_transaction = PaypalTransaction.create!({ from: OUR_PAYPAL_ACCOUNT, to: other_account, amount: amount })\n response = EXPRESS_GATEWAY.transfer (amount * 100), other_account, subject: subject, note: note, currency: currency\n unfinished_transaction.response = response.to_yaml\n if response.success? then\n # We don't get back a transaction ID in the response for mass payments.\n # unfinished_transaction.paypal_transaction_id = response.paypal_transaction_id\n unfinished_transaction.save!\n else\n unfinished_transaction.destroy\n end\n\n puts \"paypal_pay response: #{response.to_yaml}\"\n\n # Returns a hash including the response and the transaction.\n { response: response, transaction: unfinished_transaction }\n end",
"def set_postpaid\n postpaid = 1\n end",
"def transfer(options={})\n self.transfer_amount = Money.new(0, self.person ? self.person.default_currency : 'USD') unless self.transfer_amount\n \n return Response.new(false, transfer_amount, :transfer, \n :description => self.errors.full_messages.to_sentence) unless self.valid?\n\n result = Response.new\n PiggyBankAccount.transaction do\n self.person.piggy_bank.lock!\n begin\n I18n.switch_locale(self.person.default_locale) do\n # transfer net transfer amount to paypal\n response = PaypalDepositAccount::gateway.transfer(\n self.net_transfer_amount, # money amount of type Money\n self.paypal_account, # paypal account (email)\n :subject => MESSAGE_PAYPAL_SUBJECT.t % {\n :name => self.person.name\n },\n :description => MESSAGE_PAYPAL_DESCRIPTION.t % {\n :account => self.paypal_account,\n :name => self.person.name,\n :gross_amount => self.gross_transfer_amount.format,\n :net_amount => self.net_transfer_amount.format,\n :fee => self.transaction_fee.abs.format,\n :date => Date.today.to_s(:short)\n }\n )\n \n if response.success?\n # withdraw gross transfer amount from user's piggy bank\n result = self.person.piggy_bank.withdraw(\n self.gross_transfer_amount,\n options.merge(\n :fee => false,\n :description => MESSAGE_USER_PIGGY_BANK_DESCRIPTION.t % {\n :account => self.paypal_account,\n :name => self.person.name,\n :gross_amount => self.gross_transfer_amount.format,\n :net_amount => self.net_transfer_amount.format,\n :fee => self.transaction_fee.abs.format,\n :date => Date.today.to_s(:short)\n }\n )\n )\n\n # ...and deposit the transaction fee to Probono's piggy bank\n if result.success?\n result.fee = self.transaction_fee\n probono_result = Organization.probono.piggy_bank.deposit(\n self.transaction_fee.abs,\n options.merge(\n :description => MESSAGE_PROBONO_PIGGY_BANK_DESCRIPTION.t % {\n :account => self.paypal_account,\n :name => self.person.name,\n :gross_amount => self.transfer_amount.format,\n :net_amount => (self.transfer_amount - self.transaction_fee.abs).format,\n :fee => self.transaction_fee.abs.format,\n :date => Date.today.to_s(:short)\n }\n )\n )\n end\n else\n result = Response.new(response.success?, self.transfer_amount, :transfer)\n result.authorization = response.authorization\n result.description = response.message\n result.params = response.params\n result.test = response.test?\n end\n end\n rescue ActiveMerchant::ActiveMerchantError => e\n result = Response.new(false, self.transfer_amount, :transfer)\n result.authorization = nil\n result.description = e.message\n result.params = {}\n result.test = PaypalDepositAccount::gateway.test?\n end\n end\n result\n end",
"def payout!\n ApplicationRecord.transaction do\n # rollback if no pledges to payout\n raise ActiveRecord::Rollback if pledges.unpaid.empty?\n\n transaction = Transaction::InternalTransfer::FundraiserCashOut.create!(\n description: \"Payout Fundraiser(#{id}): Account Balance: $#{account_balance}\",\n audited: true\n )\n total = account_balance\n transaction.splits.create!(amount: -total, item: self)\n transaction.splits.create!(amount: total, item: person)\n\n # update all of the pledges with rewards that have a merch fee, so that we do not charge twice for merchandise\n # if/when paid out again when it closes.\n pledges.unpaid.update_all status: Pledge::Status::PAID\n end\n end",
"def pay\n unless self.payment_id\n payment = create_payment\n self.payment_id = payment.id\n self.status = 'paid'\n self.pay_date = Time.now\n self.save\n add_to_balance\n end\n end",
"def reverse_transfer\n if self.status == \"complete\"\n self.receiver.deposit(-self.amount)\n self.sender.deposit(self.amount)\n self.status = \"reversed\"\n end\n end",
"def valitation\n # Create a payment and send ID\n end",
"def pay\n @group = Group.find(params[:group_id])\n @gexpense = Gexpense.find(params[:gexpense_id])\n @member_expense = MemberExpense.find(params[:id])\n\n @member_expense.update_attribute(:paid, true)\n \n redirect_to request.referer\n end",
"def update\n orig = CardTransaction.find(params[:id])\n debug 'orig loaded'\n trans = orig.clone\n debug 'orig cloned'\n trans.amount = params[:card_transaction][:amount]\n trans.save\n debug 'trans saved'\n debug \"transaction: #{trans.inspect}\"\n stat = do_refund(orig, trans)\n debug stat.inspect\n if transaction['respstat'] == 'A' && trans.receiptData?\n redirect_to payment_receipt_url(trans.id)\n else\n redirect_to payments_url # the list of payments\n end\n rescue\n redirect_to payments_url # the list of payments\n end",
"def pay(amount)\n @bankroll -= amount\n @@bankroll -= amount\n end",
"def push_transfer(params)\n params[:grsp] = params.delete :reseller\n\n run_command :rsp2rsp_push_transfer, nil, params\n end",
"def reverse_transfer\n if @status == \"complete\"\n @sender.balance += amount\n @receiver.balance -= amount\n @status = \"reversed\"\n end\n end",
"def transfer ( bank, person, amount)\r\n\t\tif @bank_listing[person.id_number][:balance] >= amount\r\n\t\t\t@bank_listing[person.id_number][:balance]-=amount\r\n\t\t\tputs \"#{@bank_name}: #{person.name}, your transfer of #{amount} to #{bank.bank_name} is complete.\"\r\n\t\t\tbank.deposit(person, amount)\r\n\t\telse\r\n\t\t\tputs \"#{@bank_name}: Sorry #{person.name}, insufficient funds.\"\r\n\t\tend\r\n\t\t\t\r\n\tend",
"def post_billing(req)\n with_stripe_error_handlers do\n customer = Stripe::Customer.retrieve(@dealership.customer_id)\n customer.card = posted['stripeToken']\n customer.save\n req.session['billing_flash_msg'] = \"Card updated successfully.\"\n redirect \"/admin/#{@dealership.slug}/billing\"\n end\n end",
"def associate_payment_profile\n order = Spree::Order.where(\"email = ?\", @user.email).order(\"created_at\").last\n if order.try(:payments).present?\n payment_source = order.payments.last.source\n payment_source.update_attributes(user_id: @user.id)\n end\n end",
"def transfer(amount, address)\n amount = cast_amount(amount)\n raise Mobius::Client::Error::InsufficientFunds if app_balance < amount\n submit_tx { |operations| operations << payment_op(amount, dest: address, src: user_keypair) }\n rescue Faraday::ClientError => err\n handle(err)\n end",
"def reverse_transfer\n#can only reverse executed accounts\n if valid? && receiver.balance > amount && self.status == \"complete\"\n receiver.balance -= amount\n sender.balance += amount\n self.status = \"reversed\"\n else\n#rejects a transfer if an account isn't valid\n reject_transfer\n end\n end",
"def protected_transfer\n transfer\n end",
"def transact\n get_subscription\n token = params[:stripe_token] || raise('Can not transact without stripe token')\n plan = Plan.find(params[:payment][:plan_id])\n \n cs = Ripple::Subscription::CompanySubscription.new(@subscription)\n new_subscription = cs.change_stripe_plan(plan.name, token)\n flash[:notice] = \"Customer was charged, and subscription upgraded.\"\n redirect_to admin_company_path(@company)\n end",
"def amazon_postfill\n unless params[:callerReference].blank?\n @order = Order.postfill!(params)\n end\n # \"A\" means the user cancelled the preorder before clicking \"Confirm\" on Amazon Payments.\n if params['status'] != 'A' && @order.present?\n redirect_to :action => :share, :uuid => @order.uuid\n else\n redirect_to root_url\n end\n end",
"def transfer(amount, destination_account, options={})\n process('transfer', amount) do |gw|\n gw.transfer(amount, destination_account, options)\n end\n end",
"def update_transfer\n return unless $game_player.transfer?\n transfer_player\n end",
"def transfer_funds\n raise \"payment must be paid\" if !payment.paid?\n\n bank_account = PagarMe::BankAccount.new(bank_account_attributes.delete(:bank_account))\n bank_account.create\n raise \"unable to create an bank account\" unless bank_account.id.present?\n\n transfer = PagarMe::Transfer.new({\n bank_account_id: bank_account.id,\n amount: value_for_transaction\n })\n transfer.create\n raise \"unable to create a transfer\" unless transfer.id.present?\n\n #avoid sending notification\n payment.update(state: 'pending_refund')\n payment.payment_transfers.create!({\n user: payment.user,\n transfer_id: transfer.id,\n transfer_data: transfer.to_json\n })\n end",
"def transferMoneyFromCard\n results1 = postTransaction(@current_user[\"id\"], @current_user[\"id\"], params[:money]) # create initial state\n transact = results1.parsed_response # transact object to get the id in the rest of the process\n if results1.code == 201\n logTransaction(\"Transfer\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"initial\", 0)\n resultsGet = HTTParty.get(\"http://192.168.99.104:3003/credit_card?id=\"+params[:cardId].to_s)\n userA = (resultsGet[\"user_id\"])\n if userA != (@current_user[\"id\"])\n renderError(\"Forbidden\",403,\"current user has no access\")\n return -1\n else\n if (resultsGet[\"amount\"]<(params[:money]).to_i)\n renderError(\"Bad Request\", 400, \"The credit card do not have enough money\")\n else\n actualMoney=checkMoneyUser(userA)\n newMoneyUser=(actualMoney[\"money\"]).to_f + (params[:money]).to_i\n newMoneyCard=resultsGet[\"amount\"].to_i - (params[:money]).to_i\n optionsCd = {\n :body => {\"amount\": newMoneyCard}.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n resultCd = HTTParty.put(\"http://192.168.99.104:3003/credit_cards?id=\"+params[:cardId].to_s, optionsCd)#subtract money from card\n if resultCd.code == 204\n logUpdateCard(params[:cardId], newMoneyCard, 0)\n results2 = updateTransaction(\"pending\", transact[\"id\"])# put pending state\n if results2.code == 204\n logTransaction(\"Transfer\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"pending\", 0)\n else\n ##########ERROR EN UPDATE TRANSACCION (pending)###### Se devuelve el dinero a la tarjeta, state incomplete\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: results4.parsed_response, status: results4.code\n ##########ERROR EN UPDATE TRANSACCION (pending)###### Se devuelve el dinero a la tarjeta, state incomplete\n end\n else\n ##########ERROR EN UPDATE A TARJETA###### Se devuelve el dinero a la tarjeta, state incomplete\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: resultCd.parsed_response, status: resultCd.code\n ##########ERROR EN UPDATE TRANSACCION (pending)###### Se devuelve el dinero a la tarjeta, state incomplete\n end\n resultUs = updateMoney(newMoneyUser, userA.to_s) #add money to user\n if resultUs.code == 204\n logUpdateMoney(userA.to_s, newMoneyUser, 0)\n results3 = updateTransaction(\"complete\", transact[\"id\"])# put complete state\n if results3.code == 204\n logTransaction(\"Transfer\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"complete\", 0)\n subject = \"Transferencia de tarjeta de credito\"\n content = \"Has recibido una transferencia de la cuenta \" + params[:cardId].to_s + \" por valor de $\" + (params[:money]).to_s\n createNotification(@current_user[\"id\"],subject, content, @current_user_notification_key)\n head 201 # transaction created and state complete\n else\n ##########ERROR EN UPDATE TRANSACCION (complete)###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n #le quita al que recibe\n undoUpdateMoney(params[:userid], newMoneyUser.to_f , newMoneyUser.to_f - (params[:money]).to_i)\n #le pone dinero de nuevo a la tarjeta\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: results3.parsed_response, status: results3.code\n ##########ERROR EN UPDATE TRANSACCION (complete)###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n end\n else\n ##########ERROR EN UPDATE MONEY###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n #le quita al que recibe\n undoUpdateMoney(params[:userid], newMoneyUser.to_f , newMoneyUser.to_f - (params[:money]).to_i)\n #le pone dinero de nuevo a la tarjeta\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: resultUs.parsed_response, status: resultUs.code\n ##########ERROR EN UPDATE MONEY###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n end\n end\n end\n else\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"incomplete\", 1)\n end\n render json: results1.parsed_response, status: results1.code\n end\n end",
"def payout\n\t\t# if !current_user.merchant_id.blank?\n # \t\t\taccount = Stripe::Account.retrieve(current_user.merchant_id)\n # \t\t\t@login_link = account.login_links.create()\n\t\t# end\n end",
"def donate\n\n @context_user = @receiver.user\n \n # Test that the transfer money between the two people is a viable option\n rec_acc = @receiver.monetary_processor_account\n pay_acc = @sender.monetary_processor_account\n \n rec_usid = rec_acc.account_identifier\n pay_usid = pay_acc.account_identifier\n \n @donation.update_attributes do |d|\n d.receiver_wmid = rec_acc\n d.sender_wmid = pay_acc\n end\n store_donation\n \n res = WebMoney::Ext::Client.get_max_transaction_amount(pay_usid, rec_usid, @donation.purse_type[0].to_i)\n \n # Verify maximum transaction possible\n @max_amount = res.maxAmount\n if @max_amount < @amount.to_f\n @amount = @max_amount\n if @amount.to_i != -1\n flash.now[:warning] = \"The maximum that you can contribute is %s.\" / \"#{@amount}\"\n end\n end\n \n # We are confirmed, lets do it!\n if params[:confirm]\n \n # confirm their password\n @account_setting = current_user.account_setting\n unless @account_setting.validate_password(current_user,params[:password])\n flash.now[:error] = \"Invalid Password\".t\n return\n end\n \n # want to see the result logged for debugging?\n # WebMoney::Ext::Client.config.merge!({:debug => true, :wiredump => true})\n transfer = WebMoneyTransfer.create(\n :source_wmid => @sender.webmoney_account,\n :destination_wmid => @receiver.webmoney_account,\n :purse_type => @donation.purse_type[0].to_i,\n :amount => @donation.amount)\n \n res = WebMoney::Ext::Client.send_funds(\n pay_usid,\n rec_usid,\n transfer.request_number,\n @donation.purse_type[0].to_i,\n @donation.amount,\n @donation.item_name)\n \n if res.errordesc == 'Success'\n MonetaryDonation.from_webmoney_donation(@donation).save\n \n transfer.update_attribute(:success, true)\n flash[:success] = \"You have successfully transfered %s\" / [@donation.amount]\n clear_donation\n redirect_back_or_default '/'\n else\n transfer.update_attributes(:success => false, :response => res.errordesc)\n flash.now[:error] = res.errordesc.t\n end\n end\n end",
"def transfer(amount, *args)\n do_transaction :transfer_out, amount, *args\n end",
"def create\n @debt = Debt.new(params[:debt])\n\n if params[:debit]\n @debt.user_from_id, @debt.user_to_id = @debt.user_to_id, @debt.user_from_id\n end\n\n if @debt.save\n redirect_to :back, :notice => t(:debt_added) \n # todo: send message to receiver if is_user?\n else\n redirect_to :back, :alert => \"#{t(:debt_not_added)}. #{error_format @debt.errors}\"\n end\n end",
"def payment\n @amount = 10.00\n @sim_transaction = AuthorizeNet::SIM::Transaction.new(AUTHORIZE_NET_CONFIG['api_login_id'], AUTHORIZE_NET_CONFIG['api_transaction_key'], @amount, :hosted_payment_form => true)\n @sim_transaction.set_hosted_payment_receipt(AuthorizeNet::SIM::HostedReceiptPage.new(:link_method => AuthorizeNet::SIM::HostedReceiptPage::LinkMethod::GET, :link_text => 'Continue', :link_url => payments_thank_you_url(:only_path => false)))\n\n end",
"def transfer(at, category_id, account_id, amount, vendor, comment)\r\n\t\tta = Transaction.new\r\n\t\tta.at = at\r\n\t\tta.account = accounts.to_a.find { |account| account.id == account_id.to_i }\r\n\t\tta.amount = amount\r\n\t\tta.vendor = vendor\r\n\t\tta.comment = comment\r\n\t\tta.category = categories.to_a.find { |category| category.id == category_id.to_i }\r\n\t\tta.user = ta.account.user\r\n\r\n\t\tif ta.valid?\r\n\t\t\tta.save\r\n\t\t\treload\r\n\t\tend\r\n\r\n\r\n\t\treturn ta\r\n\tend",
"def pay(payment)\n retval\n end",
"def pay!\n update_attributes paid: true, paid_at: DateTime.now\n end",
"def handle_transfer(resp_body)\n params = {\n id: resp_body[:id],\n from: resp_body[:from],\n to: resp_body[:to],\n by: resp_body[:by],\n from_amount: Amount.new(\n currency: resp_body[:fromAmount][:currency],\n value: resp_body[:fromAmount][:value]\n ),\n to_amount: Amount.new(\n currency: resp_body[:fromAmount][:currency],\n value: resp_body[:fromAmount][:value]\n ),\n banking_id: resp_body[:banking_id],\n memo: resp_body[:memo],\n type: Utils.parse_enum(resp_body[:type]),\n status: Utils.parse_enum(resp_body[:status]),\n refund: Refund.new(resp_body[:refund]),\n created_at: Utils.parse_epoch(resp_body[:created])\n }\n TransferItem.new(@member_account, params)\n end",
"def reverse_transfer\n if @status == \"complete\" || @reversal_eligibility == \"yes\"\n receiver.withdraw(amount)\n sender.deposit(amount)\n @status = \"reversed\"\n @reversal_eligibility = \"no\"\n \"The transfer was successfully reversed. $#{amount} was returned to the account of origin.\"\n else\n \"Unable to reverse transaction.\"\n end\n end",
"def transfer\n @extension = Extension.with_owner_and_lowercase_name(owner_name: params[:username], lowercase_name: params[:id])\n authorize! @extension, :transfer_ownership?\n recipient = @extension.transferrable_to_users.find(transfer_ownership_params[:user_id])\n msg = @extension.transfer_ownership(recipient)\n redirect_to owner_scoped_extension_url(@extension), notice: t(msg, extension: @extension.name, user: recipient.username)\n end",
"def transfer_funds\n Dialog::space\n @acct_list = bank.account_list(@man_name, @man_pin)\n @account_id_array = Display::account_info(@acct_list)\n from = Dialog::transfer_acct_1\n to = Dialog::transfer_acct_2\n how_much = Dialog::transfer_ammount\n bank.money_transfer(from, to, how_much)\n end",
"def donate\r\n @fund += 25\r\n puts \"Project #{@name} received a generous donation!\"\r\n end",
"def make_payement(amount)\n if amount\n @paid_amount = amount\n end\n end",
"def debt_payment\n loan_proceeds = 0\n debt_rate * loan_proceeds\n end",
"def save_with_payment\n if(self.merchandise_id.present?) #if a purchase is being made\n puts \"13x\" ##########\n @merchandise = Merchandise.find(self.merchandise_id)\n self.pricesold = @merchandise.price\n self.author_id = @merchandise.user_id \n seller = User.find(@merchandise.user_id)\n amt = (@merchandise.price * 100).to_i \n desc = @merchandise.name \n %%if self.group_id.present?\n self.groupcut = ((@merchandise.price * 5).to_i).to_f/100\n self.authorcut = ((@merchandise.price * 92).to_i - 30).to_f/100 - self.groupcut\n else%\n self.groupcut = 0.0\n self.authorcut = ((@merchandise.price * 92.1).to_i - 30).to_f/100\n %%end%\n\n else #If a donation is being made\n puts \"14x\" ##########\n self.pricesold = pricesold\n self.author_id = author_id\n seller = User.find(self.author_id)\n amt = (pricesold * 100).to_i\n self.authorcut = ((pricesold * 92.1).to_i - 30).to_f/100\n if self.user_id.present?\n purchaser = User.find(self.user_id)\n desc = \"Donation of $\" + String(pricesold) + \" from \" + purchaser.name\n else\n desc = \"Donation of $\" + String(pricesold) + \" from anonymous customer\"\n end\n end\n\n sellerstripeaccount = Stripe::Account.retrieve(seller.stripeid)\n puts seller.stripeid + \" <-- SELLER stripeid\" ###########\n %%if self.group_id.present? #not used right now\n group = Group.find(self.group_id)\n groupstripeaccount = Stripe::Account.retrieve(group.stripeid)\n end%\n\n if self.email.present?\n puts \"15x\" ##########\n #\n customer = Stripe::Customer.create(\n :source => stripe_card_token, #token from? purchases.js.coffee?\n :description => \"anonymous customer\", # what info do I really want here\n :email => self.email\n )\n puts customer.id ###########\n puts customer.email\n\n else\n puts \"16x\" ##########\n @purchaser = User.find(self.user_id)\n puts @purchaser.name + \" here 16x\" ###########################\n if(@purchaser.stripe_customer_token).present?\n puts \"17x stripe customer token is present\" ##########\n customer = Stripe::Customer.retrieve(@purchaser.stripe_customer_token)\n puts customer.id + \" getting customer id from stripe customer token \"########### CHECKING\n if stripe_card_token.present?\n customer.source = stripe_card_token\n customer.save\n end\n else\n puts \"18x\" ##########\n customer = Stripe::Customer.create(\n :source => stripe_card_token, #token from? purchases.js.coffee?\n :description => @purchaser.name, # what info do I really want here\n :email => @purchaser.email\n )\n @purchaser.update_attribute(:stripe_customer_token, customer.id)\n puts customer.id + \" BUYER customer id\"######## this is customer id for the buyer\n # works upto here\n end\n end\n\n if seller.id == 143 || seller.id == 1403 || seller.id == 1452 || seller.id == 1338 || seller.id == 1442\n puts \"19x\" ##########\n charge = Stripe::Charge.create({\n :amount => amt,\n :currency => \"usd\",\n :customer => customer.id,\n :description => desc\n })\n else\n puts \"20x\" ##########\n # transfergrp = \"purchase\" + (Purchase.maximum(:id) + 1).to_s #won't work when lots of simultaneous purchases\n appfee = ((amt * 5)/100)\n\n puts customer.id ########\n puts sellerstripeaccount.id ########\n token = Stripe::Token.create({\n :customer => customer.id,\n }, {:stripe_account => sellerstripeaccount.id} )\n\n puts \"token end here 20x\" #############\n\n charge = Stripe::Charge.create( {\n :amount => amt, # amt charged to customer's credit card\n :currency => \"usd\",\n :source => token.id, #token from? purchases.js.coffee?\n # :customer => customer.id, # This will be necessary for subscriptions. See Stripe Docs & Stackoverflow\n :description => desc,\n :application_fee => appfee, #this is amt crowdpublishtv keeps - it includes groupcut since group gets paid some time later\n # :transfer_group => transfergrp\n } ,\n {:stripe_account => sellerstripeaccount.id } #appfee only needed for old way of 1 connected acct per transaction\n )\n # transfer = Stripe::Transfer.create({\n # :amount => (self.authorcut * 100).to_i,\n # :currency => \"usd\",\n # :destination => sellerstripeaccount.id,\n # :source_transaction => charge.id, # stripe attempts transfer when this isn't here, even when transfer_group is\n # :transfer_group => transfergrp #does this mean anything when there is a source transaction?\n # })\n puts \"charge here 20x\" #############\n if self.group_id.present? #this is for when groups affiliate to help sell\n puts \"21x\" #############\n transfer = Stripe::Transfer.create({\n :amount => (self.groupcut * 100).to_i,\n :currency => \"usd\",\n :destination => groupstripeaccount.id,\n :source_transaction => charge.id,\n :transfer_group => transfergrp\n })\n end\n end\n\n puts \"23x\" #############\n save!\n\n rescue Stripe::InvalidRequestError => e\n puts \"Stripe error in model!\"\n logger.error \"Stripe error while creating customer: #{e.message}\"\n errors.add :base, \"There was a problem with your credit card.\"\n false\n\n end",
"def reverse_transfer\n if @status == 'complete' # Transfer Transfer #reverse_transfer it can only reverse executed transfers\n @sender.balance += amount\n @receiver.balance -= amount\n @status = 'reversed'\n end\n end",
"def send_transfer(payload, token = nil)\n url = \"#{PAYMENTS_PATH}/transfers\"\n data = perform_post(url, payload, token)\n data || {}\n end",
"def set_transfer\n @transfer = current_user.transactions.find(params[:id])\n end",
"def set_prepaid\n credit = 0\n postpaid = 0\n end",
"def reverse_transfer\n if self.status == \"complete\"\n self.sender.balance += self.amount\n self.receiver.balance -= self.amount\n self.status = \"reversed\"\n end\n end",
"def withdraw!(amount, destination_account_id, dedupe_id = SecureRandom.uuid)\n data = {\n amount: amount,\n destination_account_id: destination_account_id,\n dedupe_id: dedupe_id,\n }\n\n response = Monzo.client.put(\"/pots/#{@id}/withdraw\", data)\n parsed_response = parse_response(response)\n update_self(parsed_response)\n end",
"def transfer_to_savings funds\n withdraw_checking(funds).deposit_savings(funds)\n return nil #No chaining after this method --subject to change--\n end",
"def execute_transaction\n#each transfer can only happen once\n if valid? && sender.balance > amount && self.status == \"pending\"\n receiver.balance += amount\n sender.balance -= amount\n self.status = \"complete\"\n else\n#rejects a transfer if the sender doesn't have a valid account\n reject_transfer\n end\n end",
"def save_with_payment\n #this will have to change when using cart instead of purchasing each book individually\n #if valid? \n @book = Book.find(self.book_id)\n @purchaser = User.find(self.user_id)\n self.pricesold = @book.price\n self.authorcut = ((@book.price * 80).to_i).to_f/100 #this calc may be different for different products & different currencies. It's an important part of the CrowdPublishTV business model. Perhaps it should be somewhere more prominent\n self.author_id = @book.user_id #do I need to save this in purchase incase bookauthor changes?\n author = User.find(@book.user_id) #but what if purchase consisted of items from several authors\n authoraccount = Stripe::Account.retrieve(author.stripeid) \n\n if(@purchaser.stripe_customer_token) \n customer_id = @purchaser.stripe_customer_token\n customer = Stripe::Customer.retrieve(customer_id)\n #card = customer.sources.create(:source => stripe_card_token) #I think this is only if existing/previous customer wants to enter new card\n else #if valid?\n customer = Stripe::Customer.create(\n :source => stripe_card_token,\n :description => @purchaser.name, # what info do I really want here\n :email => @purchaser.email\n )\n @purchaser.update_attribute(:stripe_customer_token, customer.id)\n end\n card_id = customer.default_source\n cardtoken = Stripe::Token.create(\n {:customer => customer.id, :card => card_id},\n {:stripe_account => authoraccount.id } # id of the connected account\n )\n charge = Stripe::Charge.create( {\n :amount => (@book.price * 100).to_i, #this is the amt charged to the customer's credit card\n :currency => \"usd\",\n# :customer => customer_id,\n :source => cardtoken,\n :description => @book.title, # what info do I really want here \n :application_fee => ((@book.price - self.authorcut)*100).to_i #how much crowdpublishtv keeps: crowdpublishtv is charged a fee by stripe, so must keep more than that fee\n },\n {:stripe_account => authoraccount.id }\n )\n save!\n\n rescue Stripe::InvalidRequestError => e\n logger.error \"Stripe error while creating customer: #{e.message}\"\n errors.add :base, \"There was a problem with your credit card.\"\n false\n \n end",
"def transferir(conta_destino, valor)\n sacar(valor)\n conta_destino.depositar(valor)\n end",
"def publish!(wallet)\n tx = self.sign(wallet)\n tx.commit\n tx.attributes[:id]\n end",
"def transferee=(value)\n @transferee = value\n end",
"def transfer\n\t\t\t\[email protected]\n\t\t\tend",
"def save_with_payment\n if valid? # We did added some validation to make sure user filled in properly ::contact.rb\n # After Stripe get this info, Stripe will do the charging, this method comes from Stripe gem\n # Stripe will return an id after charging\n customer = Stripe::Customer.create(description: email, plan: plan_id, source: stripe_card_token) # Stripe had upgrade their API from card: -> source:\n # Set a property to the user after received the id Stripe returned(stripe will return customer hash)\n # 'self' means the target of this function, in this case is User, and we set a new atribute stripe_customer_token to User. \n self.stripe_customer_token = customer.id # Setting stripe_customer_token to Stripe::customer.id \n save!\n end\n \n end",
"def share_deal(target_email, share)\n @deal = share.deal\n @user = share.user\n @share = share\n mail :to => target_email, \n :tag => \"share\",\n :subject => \"#{@user.best_name} shared a post with you on Qwiqq!\"\n end",
"def transfer(transfer)\n @settings = Setting.get('contacts')\n @transfer = transfer\n\n mail to: @settings.emails, subject: \"Заказ трансфера ##{@transfer.id}\"\n end",
"def pay(contract, usd, details)\n client = Upwork::Api::Client.new(Upwork::Api::Config.new(@config))\n begin\n res = Upwork::Api::Routers::Payments.new(client).submit_bonus(\n @team,\n 'engagement__reference' => contract,\n 'comments' => details,\n 'charge_amount' => usd\n )\n raise res['error']['message'] if res['error']\n res['reference']\n rescue StandardError => e\n @log.error(Backtrace.new(e))\n raise \"Failed to send $#{usd} to UpWork #{contract} with details of #{details.inspect}: #{e.message}\"\n end\n end",
"def send_money_to(receiver, amount, note=nil)\n debits.create!(receiver: receiver, amount: amount, note: note)\n end",
"def transfer\n return false if @source_account_id == @destination_account_id\n return false unless @amount > 0\n return false unless Account.exists?(@source_account_id) &&\n Account.exists?(@destination_account_id)\n return false if AccountService.new(@source_account_id).balance < @amount\n\n create_traders\n end",
"def create\n @payment = Payment.new(payment_params)\n #tells you to find the id in the URL\n @challenge = Challenge.find(params[:challenge_id])\n @host = @challenge.user\n\n @payment.challenge_id = @challenge.id\n #fill in player id when you enter a new player, authenticate above, in purple\n @payment.player_id = current_user.id\n @payment.host_id = @host.id\n @payment.update_attribute(:paid, true)\n \n#stripe credit card payment begins\n Stripe.api_key = ENV[\"STRIPE_API_KEY\"]\n token = params[:stripeToken]\n\n begin\n charge = Stripe::Charge.create(\n :amount => (@challenge.stake * 100).floor,\n :currency => \"usd\",\n :card => token\n )\n flash[:notice] = \"Thanks for ordering!\"\n rescue Stripe::CardError => e\n flash[:danger] = e.message\n end\n \n#stripe bank transfer > insert expression here: if @challengewinner=Y, $ pushes into the user's balance summation of credit card charge amount) #2 challenge stake+challenge stake\n\n transfer = Stripe::Transfer.create(\n :amount => (@challenge.stake * 95).floor,\n :currency => \"usd\",\n :recipient => @host.recipient\n )\n\n#stripe credit card payment begins\n\n#stripe bank transfer > insert expression here: if @challengewinner=Y, $ pushes into the user's balance summation of credit card charge amount) #2 challenge stake+challenge stake\n\n# Set your secret key: remember to change this to your live secret key in production\n# See your keys here https://dashboard.stripe.com/account\n #Stripe.api_key = ENV[\"STRIPE_API_KEY\"]\n #token = params[:stripeToken]\n\n\n \n\n respond_to do |format|\n if @payment.save\n #redirect them to DASHBOARD\n format.html { redirect_to @challenge, notice: 'Payment was successfully created.'}\n format.json { render action: 'show', status: :created, location: @payment }\n else\n format.html { render action: 'new' }\n format.json { render json: @payment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def pay_for_drink(drink)\n @wallet -= drink.price\n end",
"def post(amount, secondary, description, journal=nil)\n journal ||= Journal.new\n journal.description = description\n\n reverse = !(self.debit ^ secondary.debit)\n\n journal.postings << self.postings.build(:amount => amount)\n journal.postings << secondary.postings.build(:amount => (reverse ? -amount : amount))\n journal.save!\n journal\n end",
"def deposit\n end",
"def deposit\n end",
"def run_transfer_of(amount)\n self.balance += amount\n end",
"def pay_slip\n \n end",
"def reverse_transfer\n if self.status == 'complete'\n self.sender.balance += self.amount\n self.receiver.balance -= self.amount\n self.status = 'reversed'\n end\n end",
"def set_backup\n current_user.backup = Farmer.find_by_id(params[:id]).email\n current_user.save\n redirect_to current_user\n end"
] | [
"0.64019454",
"0.6400647",
"0.6313963",
"0.6217827",
"0.6061724",
"0.6060043",
"0.60391766",
"0.6002288",
"0.5983228",
"0.5942406",
"0.5908898",
"0.58977246",
"0.5884997",
"0.58794415",
"0.58462346",
"0.5838864",
"0.5838864",
"0.5833688",
"0.5823008",
"0.58033156",
"0.57929116",
"0.5744255",
"0.5709074",
"0.57075435",
"0.5699253",
"0.5691176",
"0.5673636",
"0.56657875",
"0.5644349",
"0.56344724",
"0.5632056",
"0.5603558",
"0.5583527",
"0.55759573",
"0.55708665",
"0.55598193",
"0.5557642",
"0.5544362",
"0.55176264",
"0.550873",
"0.55025375",
"0.5493306",
"0.54909235",
"0.5487203",
"0.5481254",
"0.5479616",
"0.5468182",
"0.5464328",
"0.5458582",
"0.54485166",
"0.54460186",
"0.5435358",
"0.5427896",
"0.5422725",
"0.541155",
"0.54022723",
"0.5389132",
"0.5386894",
"0.5378863",
"0.5374948",
"0.537418",
"0.5369863",
"0.53668725",
"0.5364835",
"0.5364543",
"0.53632814",
"0.5362907",
"0.53626055",
"0.5362206",
"0.5351264",
"0.53488165",
"0.53476274",
"0.534667",
"0.53466225",
"0.53459966",
"0.53454846",
"0.534301",
"0.53406966",
"0.5339075",
"0.5337029",
"0.5335622",
"0.5335161",
"0.5332988",
"0.53195083",
"0.5318886",
"0.5318794",
"0.530662",
"0.5299672",
"0.52976173",
"0.52905774",
"0.52853596",
"0.52817464",
"0.5276956",
"0.52769244",
"0.5276905",
"0.5276905",
"0.52756375",
"0.52755994",
"0.5273135",
"0.5272093"
] | 0.6965162 | 0 |
Check's the transfer status from stripe api. | def check_status
@booking = Booking.find(params[:booking_id])
@transfer_id = @booking.stripe_transfer_id
tr = Stripe::Transfer.retrieve(@booking.stripe_transfer_id)
if tr[:status] == "paid"
transfer_payment = @booking.update_columns(status: tr[:status])
redirect_to payement_transfers_path
flash[:notice] = "Payment was Transfered."
else
flash[:notice] = "Payment Transfer is Pending."
redirect_to payement_transfers_path
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def status\n @transfer[:status]\n end",
"def check_transaction_status\n data = basic_credentials.merge(\n 'x_trans_key' => @x_trans_key,\n 'x_invoice_num' => invoice_num,\n 'x_type' => (type || 0)\n )\n\n astro_curl(@transtatus_url, data)\n end",
"def is_transfer?\n case params[:is_transfer]\n when '1', 't', 'true', 'on'\n return true\n when '0', 'f', 'false', 'off'\n return false\n else\n return (not transfer_buddy.nil?)\n end\n end",
"def status_transfer\n if status_changed? && status_changed?(from: \"finish\")\n errors.add(:base, \"错误的操作\")\n end\n end",
"def check_transfer(domain)\n run_command :check_transfer, :domain, {\n :domain => domain,\n :key => 'attributes'\n }\n end",
"def status\n if ::Spree::PayoneFrontend::StatusCheck.new(request).valid_request?\n @order = Spree::Order.find_by(payone_hash: params[:param])\n if @order.present? and @order.payone_ref_number.eql? params[:reference]\n last_payment = @order.last_payment\n last_payment_method = @order.last_payment_method\n if last_payment_method.present? and last_payment_method.check_payone_status_param(params[:key])\n unless last_payment.eql?(\"completed\") # do only capture once\n last_payment.send(\"capture!\") if params[:txaction].eql?(\"capture\") or params[:txaction].eql?(\"paid\") or params[:txaction].eql?(\"appointed\")\n end\n render plain: 'TSOK'\n else\n render plain: \"NOTOK\"\n end\n else\n render plain: \"NOTOK\"\n end\n else\n render plain: \"NOTOK\"\n end\n end",
"def received?\r\n self['trans_status']=='99'\r\n end",
"def transaction_status(token)\n payload = { :token => token }\n result = http_json_request(MPower::Setup.direct_mobile_tx_status_base_url,payload)\n\n if result[\"response_code\"] == \"00\"\n @tx_status = result[\"tx_status\"]\n @mobile_invoice_no = result[\"mobile_invoice_no\"]\n @cancel_reason = result[\"cancel_reason\"]\n push_results(result)\n true\n else\n push_results(result)\n false\n end\n end",
"def status\n if params['fraud_status'] == 'pass' || params['credit_card_processed'] == 'Y'\n 'Completed'\n elsif params['fraud_status'] == 'wait'\n 'Pending'\n else\n 'Failed'\n end\n end",
"def update_transfer_status(txaction)\n if transfer_given?\n # make a note of the transfer buddy, if it already has one\n if is_transfer?\n buddy = transfer_buddy || txaction\n buddy = txaction if buddy.account.user != txaction.account.user\n txaction.set_transfer_buddy!(buddy)\n else\n txaction.clear_transfer_buddy!\n end\n end\n end",
"def incomplete\n stripe_status == 'incomplete'\n end",
"def success?\n status( @params['TxId'], @params['amount'] ) == 'success'\n end",
"def transfer_success?(source)\n return source.successful? if source.respond_to?(:successful?)\n source.valid? && source.persisted?\n end",
"def can_transfer?\n return if sender.balance >= amount\n errors.add(:amount, INSUFFICIENT_FUNDS_MESSAGE)\n end",
"def success?\n status( @params['txnid'], @params['amount'] ) == 'success'\n end",
"def transfer_given?\n params.has_key?(:is_transfer) || params.has_key?(:transfer_buddy)\n end",
"def execute_transaction\n#each transfer can only happen once\n if valid? && sender.balance > amount && self.status == \"pending\"\n receiver.balance += amount\n sender.balance -= amount\n self.status = \"complete\"\n else\n#rejects a transfer if the sender doesn't have a valid account\n reject_transfer\n end\n end",
"def success?\n raw_json['PAYMENTSTATUS'] == 'Completed'\n end",
"def sync_stripe_status\n subscription = as_stripe_subscription\n\n update({ stripe_status: subscription.status })\n end",
"def status\n @status ||= if checksum_ok?\n if transaction_id.blank?\n 'invalid'\n else\n transaction_status.downcase\n end\n else\n 'tampered'\n end\n end",
"def success?\n status == 'success'\n end",
"def success?\n status == 'success'\n end",
"def complete?\n self.status == STATUS[:complete] \n #self.status == 1\n end",
"def transfer\n return false if @source_account_id == @destination_account_id\n return false unless @amount > 0\n return false unless Account.exists?(@source_account_id) &&\n Account.exists?(@destination_account_id)\n return false if AccountService.new(@source_account_id).balance < @amount\n\n create_traders\n end",
"def sketch_status\n uri = URI.parse('https://api.sketchfab.com/v2/models/' + @document.sidecars.first.data[\"configured_fields\"][\"spotlight_upload_Sketchfab-uid_tesim\"] + '/status?token=' + API_KEY)\n n = Net::HTTP.new(uri.host, uri.port)\n n.use_ssl = true\n req = Net::HTTP::Get.new(uri.request_uri)\n res = n.start do |http|\n http.request(req)\n end\n if res.body.include? \"PENDING\"\n flash[:alert] = \"The model is in the processing queue. Check back in a bit.\"\n elsif res.body.include? \"PROCESSING\"\n flash[:alert] = \"The model is being processed by sketchfab. Check back in a bit.\"\n #this one is kinda redundant.\n # elsif res.body.include? \"SUCCEEDED\"\n # flash[:success] = \"Uploaded to Sketchfab Successfully\"\n elsif res.body.include? \"FAILED\"\n flash[:error] = \"Sketchfab encountered an error while processing this model: \" + res.body\n end\n end",
"def status(transfer)\n if transfer.empty?\n puts \"No matches found.\".yellow\n else\n puts \"Planned file actions:\".green\n transfer.each { |o, n| puts \"\\t#{o} -> #{n.green}\" }\n end\n end",
"def api_payment_subscription_status\n\n raise \"No subscription Transaction ID\" unless @payment_subscription_txid\n\n url = \"#{@config['api_host']}/1/payments/transactions/#{@payment_subscription_txid}?access_token=#{@oauth_token}\"\n\n log \"Finding subscription info\"\n log_error \"Request: #{url}\" if @debug >= AttApiReporter::DEBUG_INFO\n\n begin\n page = @agent.get(url)\n subscriptionStatus = JSON.parse(page.body)\n log \"Got subscription info\"\n log_error JSON.pretty_generate(subscriptionStatus)\n rescue Exception => e\n log_error e.backtrace\n log_error e.page.body\n return \"FAILED\"\n end\n return \"OK\"\n end",
"def successful?\n status == 'successful'\n end",
"def execute_transaction\n if valid? && sender.balance > amount && self.status == \"pending\"\n sender.balance -= amount\n receiver.balance += amount\n self.status = \"complete\"\n else\n reject_transfer\n end\n\n end",
"def settled_payment?\n SUCCESSFUL_PAYMENT.include?(response['payment_state'])\n end",
"def check_paid_status\n # FIXME: we can't use pluot, as it's too out of date\n # re-implement this with our own Wild Apricot REST wrapper?\n return true\n # api_key = ENV['WILD_APRICOT_API_KEY']\n # aid = 66796\n # # Pluot.api_key = api_key\n # # Pluot.account_id = aid\n # logger.warn(\"e-Mail eq #{self.email}\")\n # begin\n # response = Pluot.contacts.filter(\"e-Mail eq #{self.email}\")\n # rescue Faraday::ConnectionFailed => e\n # print e\n # return false\n # end\n # logger.warn(response)\n # if response.blank?\n # # probably an issue where we were unable to connect with wild apricot at all\n # return true\n # end\n # contact = response[:Contacts]\n # logger.warn(contact)\n # if !contact.blank?\n # contact = contact[0]\n # logger.warn(contact)\n # if contact[:Status] && contact[:Status] == \"Active\"\n # logger.warn(\"active\")\n # return true\n # else\n # logger.warn(\"not active\")\n # return false\n # end\n # else\n # logger.warn(\"no user found\")\n # return false\n # end\n end",
"def query_status(params, path_url = 'transfers', class_type = 'Transfer')\n super\n end",
"def check_user_ownership_and_set_message\n if @source_account && @source_account.user == current_user\n if @destination_account.present?\n @transaction.message = 'Transfer'\n return true\n end\n @transaction.message = 'Withdrawal'\n return true\n end\n\n if @destination_account.user == current_user\n @transaction.message = 'Deposit'\n return true\n end\n\n false\n rescue StandardError\n false\n end",
"def transfer_money\n\n @recipient_details = BankDetail.where(\"user_id =?\", params[:poster_id]).first\n\n @booking = Booking.find(params[:booking_id])\n\n if @recipient_details\n\n @price = @booking.price.to_i\n data = PaymentTransfer.transfer_money_to_poster(@booking,@recipient_details)\n if data.class == Stripe::InvalidRequestError\n redirect_to :back, :notice => \"Stripe error while creating customer: #{data.message}\"\n else\n redirect_to payement_transfers_path\n flash[:notice] = \"Payement was successfully transfered to #{@recipient_details.stripe_card_id_token}. Amount transfer to poster $#{data[0]} and commision is $#{data[1]}\"\n end\n else\n transfer_payment = @booking.update_columns(comment: \"Waiting for poster bank account.\")\n flash[:error] = \"No bank detail added for payment\"\n redirect_to payement_transfers_path\n\n end\n end",
"def transaction_status(uuid)\n get_status(withdraw_status_endpoint,uuid)\n end",
"def transfer_funds\n @organizer = Organizer.find(params[:id])\n @amount = raw_price(params[:amount])\n @current = raw_price(params[:current])\n\n if params[:amount].nil?\n @status = \"danger\"\n @message_status = \"Você não especificou um valor\"\n return\n end\n\n @bank_account_active_id = @organizer.marketplace.bank_account_active.own_id\n if @bank_account_active_id.nil?\n @status = \"danger\"\n @message_status = \"Você não tem nenhuma conta bancária ativa no momento\"\n else\n if @amount <= @current\n bank_transfer_data = {\n \"amount\" => @amount,\n \"transferInstrument\" => {\n \"method\" => \"BANK_ACCOUNT\",\n \"bankAccount\" => {\n \"id\" => @bank_account_active_id,\n }\n }\n }\n response_transfer = RestClient.post(\"#{Rails.application.secrets[:moip_domain]}/transfers\", bank_transfer_data.to_json, :content_type => :json, :accept => :json, :authorization => \"OAuth #{@organizer.marketplace.token}\"){|response, request, result, &block|\n case response.code\n when 401\n @status = \"danger\"\n @message_status = \"Você não está autorizado a realizar esta transação\"\n @response_transfer_json = JSON.load response\n when 400\n @status = \"danger\"\n @message_status = \"Não foi possíel realizar a transferência\"\n @response_transfer_json = JSON.load response\n when 200\n @status = \"danger\"\n @message_status = \"Não foi possível realizar a transferência\"\n @response_transfer_json = JSON.load response\n when 201\n @status = \"success\"\n @message_status = \"Solicitação de transferência realizada com sucesso\"\n @response_transfer_json = JSON.load response\n MarketplaceMailer.transfer(@organizer, friendly_price(@response_transfer_json[\"amount\"]), l(@response_transfer_json[\"updatedAt\"].to_datetime, format: '%d de %B de %Y as %Hh%M')).deliver_now\n else\n @activation_message = \"Não conseguimos resposta do MOIP para a transferência soliticata, verifique os dados novamente.\"\n @activation_status = \"danger\"\n @response_transfer_json = JSON.load response\n end\n }\n else\n @status = \"danger\"\n @message_status = \"Você não tem fundos suficientes para realizar esta transferência\"\n end\n end\n\n end",
"def complete?\n status == \"verified\"\n end",
"def validate_step\n\n r = fetch_eth_ost_balance(true)\n return r unless r.success?\n\n r = super\n return r unless r.success?\n\n if is_client_step_one_complete? && is_client_step_two_complete?\n\n success\n\n elsif is_client_step_one_complete?\n error_with_go_to(\n 'e_tss_sth_1',\n 'token_setup_not_complete',\n GlobalConstant::GoTo.economy_planner_step_two\n )\n else\n error_with_go_to(\n 'e_tss_sth_2',\n 'token_setup_not_complete',\n GlobalConstant::GoTo.economy_planner_step_one\n )\n end\n\n end",
"def check_status(cart)\n if cart.verify == 0\n 'Pending'\n elsif cart.verify == 1\n 'Accept'\n elsif cart.verify == 2\n 'Decline'\n end\nend",
"def execute_transaction\n if valid? && sender.balance > amount && status == \"pending\"\n receiver.balance += amount\n sender.balance -= amount\n self.status = \"complete\"\n else \n reject_transfer\n end\n end",
"def pending?\n status == 'pending'\n end",
"def status\n statuses = []\n transactions.where(action: 'purchase').each do |t|\n statuses << (t.is_refunded ? 'Refunded' : 'Valid')\n end\n if statuses.uniq.length > 1\n 'Partially Refunded'\n else\n (statuses.uniq == ['Refunded']) ? 'Fully Refunded' : 'Valid'\n end\n end",
"def transfer(tx)\n pay_id = get_payment_id(tx.id)\n puts \" the transaction will be transferred here ... for payment id : \" , get_payment_id(tx.id) , \" the listing author is : \" , tx.listing_author_id\n seller_account = razorpay_accounts_api.get(person_id: tx.listing_author_id, community_id: tx.community_id).data\n if seller_account && seller_account[:verification_status] == \"activated\"\n razorpay_api.direct_transfer(community: tx.community_id, payment_id: pay_id, amount: order_total(tx).cents - order_commission(tx).cents, razorpay_account_id: seller_account[:razorpay_account_id])\n else \n raise \"The Seller Account is not verified\"\n end \n payment = {}\n Result::Success.new(payment)\n rescue => exception\n Result::Error.new(exception.message)\n end",
"def payment_success?\n @fields['decision'] == 'ACCEPT'\n end",
"def pending?\n status == \"pending\"\n end",
"def mark_as_transferred\n if @payment.make_transferred!\n render_success_message \"Payment successfully marked as transferred\"\n else\n render_error_model @payment\n end\n end",
"def check_if_alreay_refunded(transaction_id, gs)\n st = gs.session_transactions\n .refund_types\n .find_by(transaction_id: transaction_id)\n { transaction_id: transaction_id, balance: st.wallet_balance } if st\n end",
"def status\n debug { \"status\" }\n verify_response { Remote.get('/status', :api_key => api_key ) }\n end",
"def status\n if params['payment_status'] == \"COMPLETE\"\n \"Completed\"\n else\n \"Failed\"\n end\n end",
"def process_payment_status\n order = Spree::Order.find_by_number(params[:order_id])\n payment_id = order.payments.last.response_code\n \n mollie = Spree::PaymentMethod.find_by_type(\"Spree::Gateway::Mollie\")\n mollie_payment = mollie.provider.payments.get(payment_id)\n \n spree_payment = Spree::Payment.find_by_response_code(payment_id)\n\n # Translate Mollie status to Spree status and safe is to the order\n if mollie_payment.paid?\n spree_payment.complete! unless spree_payment.completed?\n spree_payment.order.next! unless spree_payment.order.complete?\n\n elsif mollie_payment.open? == false\n flash[:error] = t(\"payment.cancelled\", {default: \"Payment cancelled\"})\n spree_payment.failure! unless spree_payment.failed?\n \n else\n spree_payment.pend! unless spree_payment.pending?\n end\n\n redirect_to order.reload.paid? ? order_path(order) : checkout_state_path(:payment)\n end",
"def valid?\n balance > 0 && status == \"open\"\n end",
"def success?\n self.secure? && self.status == \"1\"\n end",
"def transfer_params\n params.require(:transfer).permit(:bank_account_id, :stripe_token, :description, :name, :status)\n end",
"def in_transit?\n status.sent?\n end",
"def success?\n status == \"ok\"\n end",
"def will_transfer(amount, *args)\n do_scheduled_transaction :transfer_out, amount, *args\n end",
"def valid? \n balance > 0 && status == 'open'\n end",
"def reject_transfer\n self.status = \"rejected\"\n \"Transaction rejected. Please check your account balance.\"\n end",
"def reject_transfer\n self.status = \"rejected\"\n \"Transaction rejected. Please check your account balance.\"\n end",
"def reject_transfer\n self.status = \"rejected\"\n \"Transaction rejected. Please check your account balance.\"\n end",
"def payment_status\n payment[\"status\"]\n end",
"def payment_received?\n status == Enums::PaymentStatus::PAYMENT_RECEIVED\n end",
"def create\n @transfer = @bank_account.transfers.new(transfer_params)\n\n begin\n transfer_result = @transfer.initiate_transfer(params[:amount])\n @transfer.status = transfer_result[:status]\n @transfer.stripe_token = transfer_result[:id]\n rescue => e\n @transfer_error = e.message\n end\n\n respond_to do |format|\n if !@transfer_error && @transfer.save\n format.html {\n redirect_to user_bank_account_transfer_path(\n @user, @bank_account, @transfer\n ),\n notice: 'Transfer was successfully created.'\n }\n format.json { render action: 'show', status: :created, location: @transfer }\n else\n format.html { render action: 'new' }\n format.json { render json: @transfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def success?\n status.nil?\n end",
"def success?\n @status == \"APPROVED\"\n end",
"def test_successful_purchase_with_correct_funding_transaction_type\n response = @gateway.purchase(@amount, @credit_card, @options.merge({ funding_transaction: 'SDW_WALLET_TRANSFER' }))\n assert_success response\n assert_equal 'COMPLETED', response.message\n assert_equal 0, response.params['availableToSettle']\n assert_not_nil response.params['authCode']\n assert_match 'SDW_WALLET_TRANSFER', response.params['fundingTransaction']['type']\n end",
"def confirmed?\n self.status >= 0\n end",
"def successful?\n status == \"successful\"\n end",
"def check_status(status)\n case status.to_i\n when 1 # Valid\n true\n when 2 # Rejected\n false\n when 3 # Differed\n false\n when 4 # Test\n false\n else\n false\n end\n end",
"def complete?\n status_code == 'OK'\n end",
"def valid?\n @status == 'open' && @balance > 0\n end",
"def iscompleted?\n status == \"completed\"\n end",
"def ready_to_bill?\n status == READY\n end",
"def sent?\n status == \"sent\"\n end",
"def transferMoneyFromCard\n results1 = postTransaction(@current_user[\"id\"], @current_user[\"id\"], params[:money]) # create initial state\n transact = results1.parsed_response # transact object to get the id in the rest of the process\n if results1.code == 201\n logTransaction(\"Transfer\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"initial\", 0)\n resultsGet = HTTParty.get(\"http://192.168.99.104:3003/credit_card?id=\"+params[:cardId].to_s)\n userA = (resultsGet[\"user_id\"])\n if userA != (@current_user[\"id\"])\n renderError(\"Forbidden\",403,\"current user has no access\")\n return -1\n else\n if (resultsGet[\"amount\"]<(params[:money]).to_i)\n renderError(\"Bad Request\", 400, \"The credit card do not have enough money\")\n else\n actualMoney=checkMoneyUser(userA)\n newMoneyUser=(actualMoney[\"money\"]).to_f + (params[:money]).to_i\n newMoneyCard=resultsGet[\"amount\"].to_i - (params[:money]).to_i\n optionsCd = {\n :body => {\"amount\": newMoneyCard}.to_json,\n :headers => {\n 'Content-Type' => 'application/json',\n 'Authorization' => request.headers['Authorization']\n }\n }\n resultCd = HTTParty.put(\"http://192.168.99.104:3003/credit_cards?id=\"+params[:cardId].to_s, optionsCd)#subtract money from card\n if resultCd.code == 204\n logUpdateCard(params[:cardId], newMoneyCard, 0)\n results2 = updateTransaction(\"pending\", transact[\"id\"])# put pending state\n if results2.code == 204\n logTransaction(\"Transfer\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"pending\", 0)\n else\n ##########ERROR EN UPDATE TRANSACCION (pending)###### Se devuelve el dinero a la tarjeta, state incomplete\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: results4.parsed_response, status: results4.code\n ##########ERROR EN UPDATE TRANSACCION (pending)###### Se devuelve el dinero a la tarjeta, state incomplete\n end\n else\n ##########ERROR EN UPDATE A TARJETA###### Se devuelve el dinero a la tarjeta, state incomplete\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: resultCd.parsed_response, status: resultCd.code\n ##########ERROR EN UPDATE TRANSACCION (pending)###### Se devuelve el dinero a la tarjeta, state incomplete\n end\n resultUs = updateMoney(newMoneyUser, userA.to_s) #add money to user\n if resultUs.code == 204\n logUpdateMoney(userA.to_s, newMoneyUser, 0)\n results3 = updateTransaction(\"complete\", transact[\"id\"])# put complete state\n if results3.code == 204\n logTransaction(\"Transfer\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"complete\", 0)\n subject = \"Transferencia de tarjeta de credito\"\n content = \"Has recibido una transferencia de la cuenta \" + params[:cardId].to_s + \" por valor de $\" + (params[:money]).to_s\n createNotification(@current_user[\"id\"],subject, content, @current_user_notification_key)\n head 201 # transaction created and state complete\n else\n ##########ERROR EN UPDATE TRANSACCION (complete)###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n #le quita al que recibe\n undoUpdateMoney(params[:userid], newMoneyUser.to_f , newMoneyUser.to_f - (params[:money]).to_i)\n #le pone dinero de nuevo a la tarjeta\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: results3.parsed_response, status: results3.code\n ##########ERROR EN UPDATE TRANSACCION (complete)###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n end\n else\n ##########ERROR EN UPDATE MONEY###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n #le quita al que recibe\n undoUpdateMoney(params[:userid], newMoneyUser.to_f , newMoneyUser.to_f - (params[:money]).to_i)\n #le pone dinero de nuevo a la tarjeta\n undoUpdateCard(params[:cardId], newMoneyCard.to_i , newMoneyCard.to_i + (params[:money]).to_i)\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], params[:userid], params[:amount], \"incomplete\", 1)\n end\n render json: resultUs.parsed_response, status: resultUs.code\n ##########ERROR EN UPDATE MONEY###### Se devuelve el dinero a la tarjeta, y se le resta al usuario state incomplete\n end\n end\n end\n else\n resultsError = updateTransaction(\"incomplete\", transact[\"id\"])\n if resultsError.code == 204\n logTransaction(\"Transaction\", transact[\"id\"], @current_user[\"id\"], @current_user[\"id\"], params[:money], \"incomplete\", 1)\n end\n render json: results1.parsed_response, status: results1.code\n end\n end",
"def status_success!()\n @status = TAC_PLUS_ACCT_STATUS_SUCCESS\n end",
"def successful?\n !!get_status_method\n end",
"def valid?\n @status == \"open\" && @balance > 0 \n end",
"def paid?\n initial_status = 0\n false if self.status_code == initial_status\n abort_method = nil\n self.status_name == 'error' ? abort_method=true : abort_method=false if self.status_code != initial_status\n self.status_name == 'charged' ? abort_method=true : abort_method=false if self.status_code != initial_status\n return abort_method unless abort_method.nil?\n\n # Verifying transaction\n transaction = Rents::Transaction.new(rid:remote_id)\n transaction_verified = transaction.verify\n\n # If there is any error it just return not paid (TODO: refactor it!)\n return false if transaction_verified[:error]\n\n # Update it attrs\n self.status_code=transaction_verified[:status][:code]\n self.status_name=transaction_verified[:status][:name]\n self.save\n\n # Prepare it returning\n self.status_name == 'error' ? true : false if self.status_code != initial_status\n self.status_name == 'charged' ? true : false if self.status_code != initial_status\n end",
"def is_successful?\n status_code == '0'\n end",
"def valid_transfer?(id_from, acc_to)\n user_accs = DB[:Account].where(UserID: id_from).all\n user_accs.each do |acc|\n puts(acc[:AcctNo])\n puts(acc_to)\n puts(acc[:AcctNo] == acc_to)\n return true if acc[:AcctNo] == acc_to\n end\n false\n end",
"def converted?\n status[:status] == :done\n end",
"def get_vault_status\n str = Helpers.create_random_string(50)\n @locked = false\n @authorized = true\n @online = true\n _, code = get_json(str)\n if code == 503\n @locked = true\n elsif code == 502 || code == 504\n @online = false\n elsif code < 300 || code == 404\n @locked = false\n elsif code == 401 || code == 403\n @authorized = false\n end\n @online && !@locked && @authorized\n end",
"def success?\n @status && @status.success?\n end",
"def check_status \n return self.status == :open_hotel_block\n end",
"def update_transfer\n return unless $game_player.transfer?\n transfer_player\n end",
"def successful?\n status == :successful\n end",
"def successful?\n status == :successful\n end",
"def status_success?()\n return true if (@status == TAC_PLUS_ACCT_STATUS_SUCCESS)\n return false\n end",
"def check_order_status(id)\n @order = Order.find_by_id(id)\n\n incomplete = 0\n @order.order_items.each do |item|\n if item.ship_status == false\n incomplete += 1\n end\n end\n\n if incomplete == 0\n @order.status = 'complete'\n @order.save\n else\n @order.status = 'paid'\n @order.save\n end\n return @order\n end",
"def transfer_funds\n if self.result != nil && self.result_transfer_id == nil\n if transfer = Transfer.create(\n group_id: self.group_id,\n from_account_id: self.transfer.to_account_id,\n to_account_id: self.transfer.from_account_id,\n amount: self.transfer.amount,\n description: \"Dispute of Transfer #{self.transfer.id} was #{self.result == Dispute::APPROVE ? \"approved\" : \"denied\"}. \\\"#{self.reason}\\\"\",\n user_id: self.current_user_id,\n occurred_on: DateTime.now\n )\n transfer.save!\n update_attribute(:result_transfer_id, transfer.id)\n end\n end\n end",
"def paid?\n status == 'paid'\n end",
"def test_check_purchase_and_credit_not_settled\n assert purchase = @gateway.purchase(@amount, @check, @options)\n assert_success purchase\n assert_equal 'Approved', purchase.message\n assert credit = @gateway.credit(@amount, purchase.authorization, @check, @options)\n assert_failure credit\n assert_equal 'CREDIT CANNOT BE COMPLETED ON A UNSETTLED TRANSACTION', credit.message\n end",
"def check(payment)\n retval\n end",
"def upload_needed\n setting = Device.find_by(id: params[:id])\n if setting.nil?\n render status:404, text: \"Device not found for device_id=\"+params[:id].to_s\n return\n elsif setting.token4write != params[:token]\n render status:404, text: \"Token did not match for device_id=\"+params[:id].to_s\n return\n end\n device_id = params[:id]\n\n f = \"#{BASEDIR}/#{device_id}/upload-needed.status\"\n if File.file?(f) && File.mtime(f) > Time.now - 30.second\n render text: \"Yes\", status: 200\n else\n render text: \"No\", status: 200\n end\n end",
"def returnable?\n AVAILABLE == status\n end",
"def complete?\n status == \"Completed\"\n end",
"def stripe?\n Object.const_defined?('TradoStripeModule') ? true : false\n end",
"def check\n @response = get_fixity_response_from_fedora\n status.match(\"SUCCESS\") ? true : false\n end",
"def pending?\n status == :pending\n end"
] | [
"0.73430914",
"0.6987125",
"0.6714578",
"0.6642082",
"0.6521948",
"0.6447181",
"0.6306103",
"0.6277075",
"0.6261966",
"0.6176709",
"0.61406875",
"0.61015165",
"0.6093577",
"0.6080003",
"0.60792315",
"0.6073574",
"0.60447925",
"0.60395116",
"0.602648",
"0.59554344",
"0.5904854",
"0.58958066",
"0.5895661",
"0.5885543",
"0.5858177",
"0.58564985",
"0.5839114",
"0.58263385",
"0.5823162",
"0.5809436",
"0.57946044",
"0.5791556",
"0.57893294",
"0.5789325",
"0.57862777",
"0.5775386",
"0.5765798",
"0.57633376",
"0.57486695",
"0.5748049",
"0.57409894",
"0.5737784",
"0.57304156",
"0.57273275",
"0.5724346",
"0.57208884",
"0.5720024",
"0.57192826",
"0.5718312",
"0.56905013",
"0.5687548",
"0.5680845",
"0.56805676",
"0.5680219",
"0.5676795",
"0.56741405",
"0.56710136",
"0.5663287",
"0.5663287",
"0.5663287",
"0.5658171",
"0.5654751",
"0.56470454",
"0.5645628",
"0.5637901",
"0.5636341",
"0.5632068",
"0.5631665",
"0.5625386",
"0.5619507",
"0.5619417",
"0.56184256",
"0.56180847",
"0.5611703",
"0.5609702",
"0.56088567",
"0.5604281",
"0.56032395",
"0.56026965",
"0.5600271",
"0.560022",
"0.5595507",
"0.55944544",
"0.5588618",
"0.5577537",
"0.55745137",
"0.55716485",
"0.55716485",
"0.55711204",
"0.556749",
"0.5565291",
"0.55633825",
"0.5560499",
"0.55472946",
"0.5546245",
"0.5545648",
"0.5540048",
"0.553882",
"0.55359757",
"0.5530219"
] | 0.75068206 | 0 |
Respond to a PlugIt ping request. Sends back an empty HTTP 200 response, or the 'data' parameter that was provided by PlugIt. | def ping
data = params[:data] || ''
render json: { data: data }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def ping\n response, body = send_request :get, '', :binary\n true\n end",
"def ping\n get('')\n end",
"def ping\n render json: {\n message: \"OK\",\n time: DateTime.current.strftime(\"%Q\")\n }\n end",
"def ping\n TaxCloud::Responses::Ping.parse request(:ping)\n end",
"def ping\n response = connection.get(get_ping_url)\n if response.success?\n PingResponse.new(response.body)\n end\n end",
"def ping(opts = {})\n data, _status_code, _headers = ping_with_http_info(opts)\n data\n end",
"def get_ping(data)\n end",
"def ping(request)\n if request.message =~ /PING$/i\n request.answer 'PONG'\n end\n end",
"def ping\n return_code, response = send_command(\"ping\")\n return_code == \"200\"\n end",
"def ping(req)\n Lynr.metrics.time('time.render:ping') do\n Rack::Response.new('PONG', 200, headers)\n end\n end",
"def ping_api\n res=api_call('PingAPI')\n if res[:data]==1\n res=true\n else\n res=false\n end\n res\n end",
"def ping!\n send_message [IGNORE, 4, \"ping\"].pack(\"cNA4\")\n end",
"def cmd_noop(param)\n send_response \"200\"\n end",
"def cmdh_ping_req(msg_details)\n @log.debug \"PINGREQ handler\"\n # response back\n send_ping_resp\n end",
"def ping\n if user_matches_authentication?\n response = authenticated_user_response\n else\n response = unauthenticated_user_response\n end\n respond_with response\n end",
"def ping\n client.ping\n end",
"def ping\n raise NotImplementedError\n end",
"def ping\n 'pong'\n end",
"def ping\n send_command(\"ping\")\n end",
"def ping?\n rpc.request Util::MessageCode::PING_REQUEST\n\n return rpc.status\n end",
"def ping_result(ip)\n\tres = \"OK\"\n\tres = \"X\" unless pingable? ip\n\n\tputs \"test #{ip}\" + \".\"*20 + res\nend",
"def perform\n @client.rest_get_with_token('/ping', {}, {})\n end",
"def ping\n check_connection\n @protocol.ping_command\n self\n end",
"def ping\n uri = _parse_uri('/ping')\n headers = _get(uri)\n Ping.new.tap do |model|\n model.status = 'ok'\n model.build = headers['X-Influxdb-Build']\n model.version = headers['X-Influxdb-Version']\n model.message = 'ready for queries and writes'\n end\n rescue StandardError => e\n Ping.new.tap do |model|\n model.status = 'fail'\n model.message = e.message\n end\n end",
"def send_ping\n if @version.version > Bitcoin::Protocol::BIP0031_VERSION\n @latency_ms = LATENCY_MAX\n @ping_nonce = rand(0xffffffff)\n @ping_time = Time.now\n log.debug { \"<< ping (#{@ping_nonce})\" }\n send_data(Protocol.ping_pkt(@ping_nonce))\n else\n # set latency to 5 seconds, terrible but this version should be obsolete now\n @latency_ms = (5*1000) \n log.debug { \"<< ping\" }\n send_data(Protocol.ping_pkt)\n end\n end",
"def ping_request(ping, opts = {})\n data, _status_code, _headers = ping_request_with_http_info(ping, opts)\n data\n end",
"def ping_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TextMagicApi.ping ...'\n end\n # resource path\n local_var_path = '/api/v2/ping'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'PingResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TextMagicApi#ping\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def ping(&blk)\n if block_given?\n websocket.subscribe :ping, &blk\n else\n http.get :ping\n end\n end",
"def ping()\n #This is a stub, used for indexing\n end",
"def ping\n if ActiveRecord::Base.connection.active?\n render text: 'pong'\n else\n render status: 500\n end\n end",
"def ping\n end",
"def ping()\n result = SaResult.new()\n\n if lines[0].chop =~ /(.+)\\/(.+) (.+) (.+)/\n result.response_version = $2\n result.response_code = $3\n result.response_message = $4\n end\n\n return result\n\n end",
"def ping()\n #This is a stub, used for indexing\n end",
"def ping\n result = RhizomePingJob.new(@rhizome).perform_now\n\n if result[:connected]\n flash[:success] = \"Pinged <strong>#{result[:name]}</strong>!<br />\" <<\n \"Here's what I got:<br />\" <<\n \"<pre>#{JSON.pretty_generate(result)}</pre>\"\n else\n flash[:danger] = \"It appears that <strong>#{result[:name]}</strong> is not connected...<br />\" <<\n \"Here's what I know:<br />\" <<\n \"<pre>#{JSON.pretty_generate(result)}</pre>\"\n end\n\n redirect_to rhizomes_url\n end",
"def receive_ping_request(request)\n request.reply(nil)\n end",
"def ping\n return true unless active? && heartbeat_path.present?\n\n resp = http_get(uri: \"#{api_base_url}#{heartbeat_path}\")\n resp.present? && resp.code == 200\n end",
"def ping\n return true unless active && heartbeat_path.present?\n\n resp = http_get(uri: \"#{api_base_url}#{heartbeat_path}\")\n resp.present? && resp.code == 200\n end",
"def ping(data, timeout = 1)\n data = data.clone\n # Pad data to have at least 64 bytes.\n data += \"\\0\" * (64 - data.length) if data.length < 64\n \n ping_packet = @dest_mac + @source_mac + @ether_type + data\n @socket.send ping_packet, 0\n\n response_packet = @source_mac + @dest_mac + @ether_type + data\n response = @socket.recv response_packet.length * 2\n \n response == response_packet\n end",
"def ping(*args)\n get '/invoke/wm.server/ping'\n end",
"def ping\n begin \n @connection = $redis.ping\n rescue => e\n @connection = {status: 500, message: e.message }\n end\n\n respond_to do |format|\n format.json { render json: @connection }\n end\n end",
"def ping\n @status = Status.find(:first)\n respond_to do |format|\n format.html\n format.xml { render :xml => @status }\n end \n end",
"def ping\n with_client do |client|\n client.ping\n end\n end",
"def ping()\n\n ip = Resolv.getaddress(@host)\n puts ('ip: ' + ip.inspect).debug if @debug\n valid = pingecho(ip)\n puts ('valid: ' + valid.inspect).debug if @debug \n \n @results[:ping] = if valid then\n a = [valid]\n 4.times {sleep 0.01; a << pingecho(ip)}\n (a.min * 1000).round(3)\n else\n nil\n end\n\n end",
"def ping()\n # Use the activity client 'client' to invoke the say_hello activity\n pong=client.ping()\n \"Got #{pong}\"\n end",
"def ping\n @conn.ping\n end",
"def ping() path = \"/api/v2/utilities/ping\"\n get(path, {}, AvaTax::VERSION) end",
"def create_ping\n post 'ping'\n end",
"def ping\n sanity_check\n @handle.ping\n end",
"def update_ping\n put 'ping'\n end",
"def ping\n @site = Site.find(params[:id])\n return if !self.authorize?\n \n session[:job_key] = \n ::MiddleMan.new_worker(:class => :ping_worker,\n :args => {:site_id => params[:id]})\n \n # @site.ping!\n if request.xhr?\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.xml { head :ok }\n end\n else\n respond_to do |format|\n format.html do \n render :update do |page|\n page.replace_html 'form', :partial => 'poll'\n end\n end\n format.xml { head :ok }\n end\n end\n \n end",
"def ping(t)\n \n end",
"def test_can_get_ping\n get '/ping'\n assert last_response.ok?\n assert_equal 'PONG', last_response.body\n end",
"def ping\n render json: {logged_in: true, user: current_user.id}\n end",
"def ping(host = @host, options = {})\n super(host, options)\n\n opt1 = (options.key?(:port) ? {:service_check => true, :data_must_match => (options[:port] == 7)} : {})\n opt2 = {\n :service_check => @service_check,\n :timeout => @timeout,\n :bind_host => @bind_host,\n :bind_port => @bind_port,\n :data_must_match => @data_must_match,\n :data => @data,\n :port => @port}\n options = opt1.merge(opt2).merge(options)\n\n @success = false\n udp = UDPSocket.open\n @response = []\n\n if options[:bind_host]\n udp.bind(options[:bind_host], options[:bind_port])\n end\n\n start_time = Time.now\n\n begin\n Timeout.timeout(options[:timeout]) {\n udp.connect(host, options[:port])\n udp.send(options[:data], 0)\n @response = udp.recvfrom(MAX_DATA)\n }\n rescue Errno::ECONNREFUSED, Errno::ECONNRESET => err\n if options[:service_check]\n @exception = err\n else\n @success = true\n end\n rescue Exception => err\n @exception = err\n else\n if @response[0] == options[:data] || !options[:data_must_match]\n @success = true\n end\n ensure\n udp.close if udp\n end\n\n # There is no duration if the ping failed\n @duration = Time.now - start_time if @success\n\n @success\n end",
"def ping(options = {})\n client = extract_client!(options)\n !!client.get(\"/api/system/ping\")\n rescue Error::ConnectionError\n false\n end",
"def make_http_request\n Net::HTTP.get_response('localhost', '/ping', 3000).body\nend",
"def ping(nonce = SecureRandom.hex)\t\n\t\t\tbegin\n\t\t\t\tresponse = RestClient.get(build_url(\"ping\") + \"?echo=#{nonce}\")\n\t\t\t\tresponse = JSON.parse(response)\n\n\t\t\t\tresponse[\"echo\"] == nonce\n\t\t\trescue => e\n\t\t\t\treturn false\n\t\t\tend\n\t\tend",
"def test_ping\n\[email protected](@ping, 0)\n=begin\n\t\tpong = @tt.ping_reply\n\t\tassert_equal(42, pong.length)\n\t\tassert_equal(pong[0, 6], @tt.tap_mac)\n\t\tassert_equal(pong[30, 4], @ping[26, 4])\n\t\tassert_equal(pong[26, 4], @ping[30, 4])\n=end\n\tend",
"def test_ping\n\[email protected](@ping, 0)\n=begin\n\t\tpong = @tt.ping_reply\n\t\tassert_equal(42, pong.length)\n\t\tassert_equal(pong[0, 6], @tt.tap_mac)\n\t\tassert_equal(pong[30, 4], @ping[26, 4])\n\t\tassert_equal(pong[26, 4], @ping[30, 4])\n=end\n\tend",
"def ping() \n \"Pong from #{Socket.gethostname}\"\n end",
"def ping(host = nil, options = {})\n\n super(host, options)\n\n # See https://bugs.ruby-lang.org/issues/8645\n url = host || @host\n if url =~ %r{^//}\n url = \"http:#{url}\"\n elsif url !~ %r{^https?://}\n url = \"url://#{url}\"\n end\n uri = URI.parse(url)\n\n # A port provided here overrides anything provided in constructor\n port = options[:port]\n port ||= uri.port if host\n port ||= @port\n\n timeout = options[:timeout] || @timeout\n\n start_time = Time.now\n\n http_response = do_ping(uri, port, timeout)\n\n if http_response.is_a?(Net::HTTPSuccess)\n set_response(http_response)\n @success = true\n elsif redirect?(http_response) # Check code, HTTPRedirection does not always work\n if @follow_redirect\n @warning = http_response.message\n rlimit = 0\n\n while redirect?(http_response)\n if rlimit >= redirect_limit\n @exception = \"Redirect limit exceeded\"\n break\n end\n redirect = URI.parse(http_response['location'])\n redirect = uri + redirect if redirect.relative?\n http_response = do_ping(redirect, port, timeout)\n rlimit += 1\n end\n\n if http_response.is_a?(Net::HTTPSuccess)\n set_response(http_response)\n @success = true\n else\n @warning = nil\n @exception ||= http_response.message\n end\n\n else\n @exception = http_response.message\n end\n else\n @exception ||= http_response.message\n end\n\n # There is no duration if the ping failed\n @duration = Time.now - start_time if @success\n\n @success\n end",
"def ping\n true\n end",
"def ping; end",
"def ping()\n _params = {}\n return @master.call 'users/ping2', _params\n end",
"def ping(ip)\n @logger.debug(\"ping from #{ip}\")\n \"pong\"\n end",
"def health\n response, success = ::Portus::Health.check\n render json: response, status: success ? :ok : :service_unavailable\n end",
"def ping\n\t\tputs \"Pinging #{@ip} ...\"\n\t\tsystem \"ping #{ip_string}\"\n\tend",
"def test_ping_basic\n @tt.sock.send(@ping, 0)\n pong = @tt.ping_reply\n assert_equal(42, pong.length)\n assert_equal(pong[0, 6], @tt.tap_mac)\n assert_equal(pong[30, 4], @ping[26, 4])\n assert_equal(pong[26, 4], @ping[30, 4])\n end",
"def ping(m=nil)\n @socket << \"PING #{m}\".strip\n end",
"def respond(request, data)\n return unless data\n request[\"result\"] = data\n @lock.synchronize do\n send_data(request.to_json + \"\\x00\")\n end\n end",
"def ping_request_with_http_info(ping, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: OperationalApi.ping_request ...'\n end\n # verify the required parameter 'ping' is set\n if @api_client.config.client_side_validation && ping.nil?\n fail ArgumentError, \"Missing the required parameter 'ping' when calling OperationalApi.ping_request\"\n end\n # resource path\n local_var_path = '/ping'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'text/xml'])\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(ping) \n\n # return_type\n return_type = opts[:return_type] || 'Acknowledgement' \n\n # auth_names\n auth_names = opts[:auth_names] || ['cp-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(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OperationalApi#ping_request\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def ping\n\t\t# MAC address / serial\n\t\tlogger.debug(\"PING called\")\n\n\t\trender_event\n\tend",
"def remote_ping(sender, body)\n _notice \"PING?/PONG! (#{sender})\", :notice\n _remote_control(sender, 'pong',\n @var[:presence][@connection.comm.our_keyhash].join(' '))\nend",
"def cmd_ping argv\n setup argv\n addr = @hash[\"address\"]\n msg run_cmd(\"ping #{addr}\")\n end",
"def reply(data)\n res.json(Satz.serializer.dump(data))\n end",
"def ping?\n response = perform_request\n !!(response =~ Regexp.union(%r(<str name=\"status\">OK</str>), %r(\"status\":\"OK\")))\n end",
"def ping\n t = Time.now\n @response = Net::HTTP.get_response(uri)\n rescue Errno::ECONNREFUSED\n rescue Exception => e\n STDERR.puts \"Error fetching #{@url}: #{e}\"\n ensure\n @time = Time.now-t\n @response\n end",
"def ping!\n @session.ping!\n end",
"def ping?(host = @host, options = {})\n ping(host, options).status_code == 0\n end",
"def ping(data, timeout = 1)\n if data.kind_of? Numeric\n data = \"\\0\" * data\n end\n # Pad data to have at least 64 bytes.\n data += \"\\0\" * (64 - data.length) if data.length < 64\n \n ping_packet = [@dest_mac, @source_mac, @ether_type, data].join\n\n response = nil\n receive_ts = nil\n send_ts = nil\n begin\n Timeout.timeout timeout do\n send_ts = Time.now\n @socket.send ping_packet, 0\n response = @socket.recv ping_packet.length * 2\n receive_ts = Time.now\n end\n rescue Timeout::Error\n response = nil\n end\n return false unless response\n\n response_packet = [@source_mac, @dest_mac, @ether_type, data].join\n response == response_packet ? receive_ts - send_ts :\n [response, response_packet]\n end",
"def ping\n if god?\n tries = 3\n begin\n @server.ping\n rescue Exception => e\n retry if (tries -= 1) > 1\n raise e, \"The server is not available (or you do not have permissions to access it)\"\n end\n end\n end",
"def ping(timeout=nil)\n request = Message::Ping.new(Thread.mailbox)\n send_request request, :request, timeout\n end",
"def on_ping(m)\n post PONG, m[0] ? m[0] : (@prefix ? @prefix.nick : \"\")\n end",
"def respond_with(status_code)\n response.status = status_code\n response.write \"\"\n nil\n end",
"def ping\n if !block_given?\n return @j_del.java_method(:ping, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling ping()\"\n end",
"def ping(server, target = '')\n send_data(\"PING #{server} #{target}\".strip)\n end",
"def receive_ping\n done\n end",
"def ping(response_timeout=2)\n #Initialize ping result as false\n ping_ok = false\n\n begin\n\n #Ping data\n ping_data = \"\\x4\\x1\\x8\"\n\n $test_logger.log \"Ping with #{Common.unpackbytes(ping_data)}\"\n\n #Ping and check terminal status\n ping_res = call_thrift(nil, response_timeout){terminal_echo(ping_data)}\n\n $test_logger.log \"Ping reply='#{Common.unpackbytes(ping_res)}'\"\n\n raise \"Ping response not matched! Expected='#{Common.unpackbytes(ping_data)}', Actual='#{Common.unpackbytes(ping_res)}'\" if ping_res != ping_data\n\n #Set ping result as true\n ping_ok = true\n rescue Exception => ex\n $test_logger.log_e \"Error in ping!\", ex, false\n end\n\n #Return ping result\n ping_ok\n end",
"def onping(&blk); super; end",
"def ping\n @client.peek( name )\n return true\n end",
"def ping\n stats\n true\n rescue Errno::ECONNREFUSED\n false\n end",
"def no_content\n halt 204, \"\"\n end",
"def ping(host = @host, options = {})\n host ||= @host\n super(host, options)\n\n timeout = options[:timeout] || @timeout\n\n pcmd = ['ping']\n @success = false\n @response = ''\n\n case RbConfig::CONFIG['host_os']\n when /linux/i\n pcmd += ['-c', '1', '-W', timeout.to_s, host]\n when /aix/i\n pcmd += ['-c', '1', '-w', timeout.to_s, host]\n when /bsd|osx|mach|darwin/i\n pcmd += ['-c', '1', '-t', timeout.to_s, host]\n when /solaris|sunos/i\n pcmd += [host, timeout.to_s]\n when /hpux/i\n pcmd += [host, '-n1', '-m', timeout.to_s]\n when /win32|windows|msdos|mswin|cygwin|mingw/i\n pcmd += ['-n', '1', '-w', (timeout * 1000).to_i.to_s, host]\n else\n pcmd += [host]\n end\n\n start_time = Time.now\n\n begin\n err = nil\n\n Open3.popen3(*pcmd) do |stdin, stdout, stderr, thread|\n stdin.close\n err = stderr.gets # Can't chomp yet, might be nil\n @response = stdout.read\n if thread\n if thread.value.exitstatus == 0\n @success = true # Success, at least one response.\n if err & err =~ /warning/i\n @warning = err.chomp\n end\n else\n set_exception(err)\n end\n elsif @response =~ /\\D0+% (packet )?loss/\n # Linux / windows loss percentage\n @success = true\n elsif @response =~ /\\D(\\d*[1-9]\\d*% (packet )?loss)/\n @exception = \"#{$1}\"\n else\n set_exception(err)\n @exception ||= 'exitstatus could not be checked and stdout did not contain a recognisable loss percentage'\n end\n end\n rescue Exception => error\n @exception = error.message\n end\n\n # There is no duration if the ping failed\n @duration = @success ? Time.now - start_time : nil\n end",
"def ping\n SAP_LOGGER.debug(\"In #{self.class} ping ...\")\n\t \t return nil unless self.handle\n SAP_LOGGER.debug(\"In #{self.class} handle: #{self.handle} ...\")\n return self.handle.ping()\n\t\tend",
"def handle_ping_message(message)\n # The last part of the PING message is the so-called \"challenge\". The server expects that we reply\n # back with this exact string. Therefore we extract it here.\n challenge = message.split(\" \").last\n\n # We send back an IRC \"PONG\" message with the challenge that came from the server.\n irc_send \"PONG #{challenge}\"\nend",
"def ping(options = Options::Ping::DEFAULT)\n resp = @backend.ping(@name, options.to_backend)\n PingResult.new do |res|\n res.version = resp[:version]\n res.id = resp[:id]\n res.sdk = resp[:sdk]\n resp[:services].each do |type, svcs|\n res.services[type] = svcs.map do |svc|\n PingResult::ServiceInfo.new do |info|\n info.id = svc[:id]\n info.state = svc[:state]\n info.latency = svc[:latency]\n info.remote = svc[:remote]\n info.local = svc[:local]\n info.error = svc[:error]\n end\n end\n end\n end\n end",
"def ping\n @ping = Time.now\n end",
"def on_ping(x)\n end",
"def patch_ping\n patch 'ping'\n end",
"def success\n [200, { 'Content-Type' => 'text/plain'}, ['OK']]\n end"
] | [
"0.6981154",
"0.6865848",
"0.682164",
"0.67855185",
"0.675121",
"0.6656377",
"0.65743685",
"0.6476206",
"0.6386113",
"0.6377683",
"0.6350589",
"0.62773556",
"0.62552214",
"0.6150953",
"0.6144178",
"0.6140828",
"0.60854256",
"0.60702354",
"0.6068855",
"0.60620975",
"0.60294634",
"0.6013404",
"0.60062295",
"0.60015273",
"0.59955055",
"0.59733254",
"0.5952232",
"0.59372723",
"0.59371513",
"0.5909804",
"0.5897417",
"0.5895095",
"0.58876264",
"0.58588225",
"0.5849446",
"0.5846531",
"0.58426267",
"0.5832638",
"0.5826299",
"0.5826209",
"0.5820639",
"0.5798109",
"0.57961446",
"0.57954633",
"0.5786088",
"0.57856333",
"0.5759534",
"0.57576644",
"0.5742671",
"0.5738886",
"0.57382476",
"0.5734724",
"0.57279545",
"0.57130265",
"0.5700439",
"0.56886435",
"0.5686577",
"0.5679048",
"0.5679048",
"0.5649568",
"0.5646603",
"0.5642363",
"0.56355935",
"0.5623245",
"0.561938",
"0.55844873",
"0.5564668",
"0.553656",
"0.5529645",
"0.5521098",
"0.551929",
"0.54805416",
"0.547871",
"0.5468325",
"0.5465441",
"0.54573977",
"0.5438801",
"0.5436498",
"0.5410983",
"0.54074395",
"0.5402593",
"0.54010636",
"0.5388694",
"0.53875154",
"0.538751",
"0.5373814",
"0.53725356",
"0.5371264",
"0.5370978",
"0.53642553",
"0.5353886",
"0.5350487",
"0.5348678",
"0.53485614",
"0.5331194",
"0.5329501",
"0.53281164",
"0.530875",
"0.5307043",
"0.5286344"
] | 0.7434062 | 0 |
Respond with the PlugIt version number. | def version
render json: { result: 'Ok', version: '1', protocol: 'EBUio-PlugIt' }
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def version\n api_execute('/version', :get).body\n end",
"def version\n send_command(:getinfo, 'version')\n reply = read_reply.split('=').last\n read_reply # skip \"250 OK\"\n reply\n end",
"def version\n self.class.get(\"/get/version\")\n end",
"def get_version\n request('getVersion')\n end",
"def version\n v = KJess::Request::Version.new\n r = send_recv( v )\n return r.version if Response::Version === r\n raise KJess::Error, \"Unexpected Response from VERSION command\"\n end",
"def render_version\n render json: { version: BUILD_VERSION }, status: 200\n end",
"def version\n @version\n end",
"def version_number\n @version\n end",
"def version\n VERSION\n end",
"def api_version\n request('getAPIVersion')\n end",
"def api_version\n @version\n end",
"def version\n 1\n end",
"def get_version\n\t\tend",
"def version\n VERSION\n end",
"def version\n puts \"Version 1.1\"\nend",
"def server_version\n request(auth: false, expects: 200)['version']\n rescue => ex\n error { \"Server version exception\" }\n error { ex }\n nil\n end",
"def version\n @version || 0\n end",
"def index\n response = VersionResponse.new( BUILD_VERSION )\n render json: response, :status => 200\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n return @version\n end",
"def version\n fetch('vehicle.version')\n end",
"def version\n puts \"v0.3\"\n end",
"def version_number\n return @version_number\n end",
"def version\n @spec.version\n end",
"def version\n 1\n end",
"def version\n VERSION\n end",
"def version\n VERSION\n end",
"def version\n VERSION\n end",
"def version\n @version ||= '1.0'\n end",
"def http_version\n \"%d.%d\" % [self[:http_major], self[:http_minor]]\n end",
"def get_version()\n\t\tend",
"def ver\n @values.fetch('ver') { \n @values['ver'] = 1\n }\n end",
"def upgrade\n respond_to do |wants|\n wants.json {\n ver = params[:ver]\n soft = SoftVersion.find_new_version_by_ver(ver)\n hash = {}\n if soft and soft.is_a?SoftVersion\n hash[:newversion] = true\n hash[:url] = \"http://#{request.host_with_port}/welcome/download?soft=#{soft.soft_name}&version=#{soft.version}\"\n else\n hash[\"newversion\"] = false\n hash[\"url\"] = \"No new version\"\n end\n render :json => hash.to_json, :layout => false\n }\n end\n\n end",
"def version\n data.version\n end",
"def ver\n @values['ver']\n end",
"def getVersion\r\n\t\t\t\t\treturn @version\r\n\t\t\t\tend",
"def send_version\n version = Bitcoin::Protocol::Version.new({\n :version => 70001,\n :last_block => Toshi::Models::Block.max_height,\n :from => \"127.0.0.1:#{Bitcoin.network[:default_port]}\",\n :to => @host,\n :user_agent => user_agent,\n })\n send_data(version.to_pkt)\n log \">> version: #{version.version}, user_agent: #{version.user_agent}\" if @debug\n end",
"def server_version\n call! :server_version\n end",
"def version\n @sock.cmd(\"String\" => \"version\", \"Match\" => /(SUCCESS:.*\\n|ERROR:.*\\n|END.*\\n)/)\n end",
"def version\n @context[:version]\n end",
"def version\n @version ||= version_hex.to_s(16).chars.entries.join('.')\n end",
"def version\n read_property 'Version'\n end",
"def version\n @version_helper.to_s\n end",
"def version\n @version_helper.to_s\n end",
"def version\n 0\n end",
"def version\n spec.version\n end",
"def version\n @version ||= '1.0'\n end",
"def send_version\n from = \"#{@node.external_ip}:#{@node.config[:listen][1]}\"\n version = Bitcoin::Protocol::Version.new({\n :version => 70001,\n :last_block => @node.store.get_depth,\n :from => from,\n :to => @host,\n :user_agent => \"/bitcoin-ruby:#{Bitcoin::VERSION}/\",\n #:user_agent => \"/Satoshi:0.8.3/\",\n })\n send_data(version.to_pkt)\n log.debug { \"<< version: #{Bitcoin.network[:protocol_version]}\" }\n end",
"def version\n @version ||= data.version\n end",
"def version\n ret = @client.call('Bugzilla.version')\n handle_faults(ret)\n ret['version']\n end",
"def version\n send_command \"--version\"\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def getVersion()\n return \"client \" + CLIENT_VERSION + \", API v2, converter \" + @helper.getConverterVersion()\n end",
"def client_meta_version(version)\n regexp = /^([0-9]+\\.[0-9]+\\.[0-9]+)(\\.?[a-z0-9.-]+)?$/\n match = version.match(regexp)\n return \"#{match[1]}p\" if (match[2])\n\n version\n end",
"def version_number\n \"#{self.major}.#{self.minor}\"\n end",
"def view_version\n @version = params[:version].to_i\n @story = Story.find(params[:id])\n @story = @story.versions[@version].reify\n\n respond_to do |format|\n format.html { render :version }\n format.html { head :no_content }\n end\n end",
"def version\n \"0.2.0\"\n end",
"def version\n self[:version]\n end",
"def api_version\n self.class.get('/api')['api_ver']\n end",
"def version\n endpoint.config.version\n end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version; end",
"def version\n resolved_version\n end",
"def get_api_version\n response = send_api_request(:index)\n response[:returncode] ? response[:version].to_s : \"\"\n end",
"def current_version\n @version\n end",
"def http_version\n @parser.http_version\n end",
"def version\n cmd(COMMANDS[:version], 2)\n end"
] | [
"0.7141543",
"0.7131425",
"0.70228535",
"0.68992054",
"0.6871362",
"0.672572",
"0.668096",
"0.66106164",
"0.6584674",
"0.6513592",
"0.6511722",
"0.65003586",
"0.64943415",
"0.64838755",
"0.64684653",
"0.64619476",
"0.64581126",
"0.6446494",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6430762",
"0.6397469",
"0.63939923",
"0.63692206",
"0.6361291",
"0.63475245",
"0.6339879",
"0.6339879",
"0.6339879",
"0.63367206",
"0.63319683",
"0.6328571",
"0.6316219",
"0.6315131",
"0.6311149",
"0.62935317",
"0.62925994",
"0.62890494",
"0.6279442",
"0.626956",
"0.62639415",
"0.6257235",
"0.6244247",
"0.6244165",
"0.6244165",
"0.62413746",
"0.6239075",
"0.62292796",
"0.62261564",
"0.62162757",
"0.6215841",
"0.62115127",
"0.62071824",
"0.62071824",
"0.62071824",
"0.62071824",
"0.62071824",
"0.62071824",
"0.62071824",
"0.62058896",
"0.62029064",
"0.61861753",
"0.6182833",
"0.61825126",
"0.6181703",
"0.61815083",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.6166229",
"0.615721",
"0.6154875",
"0.6149154",
"0.61443853",
"0.61439234"
] | 0.8408515 | 0 |
GET /feature_models/1 GET /feature_models/1.json | def show
@feature_model = FeatureModel.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render :json => @feature_model }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle_features = @vehicle.features\n end\n @feature = Feature.new\n @features = Feature.all\n @all_features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @features }\n end\n end",
"def show\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature }\n end\n end",
"def index\n @features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @features }\n end\n end",
"def new\n @feature_model = FeatureModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @feature_model }\n end\n end",
"def show\n @gene = Gene.find(params[:gene_id])\n @feature = @gene.features.find(params[:id])\n #@feature = Feature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature }\n end\n end",
"def get_models_for_make_id\n render json: vehicle_service.get_models_for_make_id(params[:make_id])\n end",
"def create\n @feature_model = FeatureModel.new(params[:feature_model])\n\n respond_to do |format|\n if @feature_model.save\n format.html { redirect_to @feature_model, :notice => 'Feature model was successfully created.' }\n format.json { render :json => @feature_model, :status => :created, :location => @feature_model }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @feature_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @feature_requests = FeatureRequest.all\n end",
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def destroy\n @feature_model = FeatureModel.find(params[:id])\n @feature_model.destroy\n\n respond_to do |format|\n format.html { redirect_to feature_models_url }\n format.json { head :no_content }\n end\n end",
"def find_feature\n @feature = Feature.get_by_fid(params[:feature_id]) # Feature.find(params[:feature_id])\n end",
"def show\n @item_feature = ItemFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @item_feature }\n end\n end",
"def index\n @housing_features = HousingFeature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @housing_features }\n end\n end",
"def show\n @housing_feature = HousingFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @housing_feature }\n end\n end",
"def show\n @feature = Feature.find(params[:id])\n # @homepage_features = Feature.homepage_list.published\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature }\n end\n end",
"def get_models_for_make_id_year\n render json: vehicle_service.get_models_for_make_id_year(params[:make_id], params[:make_year])\n end",
"def model\r\n\t\t\t@model ||= json['model']\r\n\t\tend",
"def show\n @model = Model.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @model.to_json(\n :only =>[],\n :methods => [:dg_model_id, :model_make_id, :model_number, :model_description, :model_active, :dg_last_update])}\n end\n end",
"def show\n @phosphosite_feature = PhosphositeFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @phosphosite_feature }\n end\n end",
"def show\n @feature = @feature_category.features.find(params[:id])\n # @feature = Feature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @service_features }\n end\n end",
"def features\n validate_loaded\n resource = FEATURES % { id: @id }\n response = Request.new(client, :get, resource).perform\n response.body[:data]\n end",
"def show\n render json: @key_feature\n end",
"def get_feature\n @feature = Feature.find_by(:id => params[:id])\n @feature ||= Feature.find_by(:slug => params[:id])\n render :status => 404, :json => {status: 404, message: \"entity not found\"} if @feature.nil?\n end",
"def new\n @item_feature = ItemFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_feature }\n end\n end",
"def new\n @housing_feature = HousingFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @housing_feature }\n end\n end",
"def show\n @feature = Feature.find(params[:id].to_i)\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def update\n @feature_model = FeatureModel.find(params[:id])\n\n respond_to do |format|\n if @feature_model.update_attributes(params[:feature_model])\n format.html { redirect_to @feature_model, :notice => 'Feature model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @feature_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @feature = current_user.features.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def show\n render status: 200, json: Training.find(params[:id])\n end",
"def show\n @contractor_feature = ContractorFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contractor_feature }\n end\n end",
"def get_project_model project_id, dataset_id, model_id\n # The get operation is considered idempotent\n execute backoff: true do\n json_txt = service.get_model project_id, dataset_id, model_id, options: { skip_deserialization: true }\n JSON.parse json_txt, symbolize_names: true\n end\n end",
"def show\n @part_three_predict = PartThreePredict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_three_predict }\n end\n end",
"def index\n @featureds = Featured.all\n end",
"def create\n @feature = Feature.find_or_create_by(name: params[:feature][:name])\n @feature.update(deleted_at: nil)\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle.features << @feature unless @feature.in? @vehicle.features\n end\n respond_to do |format|\n if @feature.save\n format.html\n format.json { render json: @feature, status: :created, location: @feature }\n format.js { render 'features/create' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def show\n @feature = Feature.find(params[:id])\n @commentable = @feature\n @comments = @commentable.comments.reverse\n @comment = Comment.new\n @company = Company.find(@feature.company_ids)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @feature }\n end\n end",
"def show\n\n @model = Model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @model }\n end\n end",
"def index\n @models = ClientService.all\n end",
"def index\n @gltf_models = GltfModel.all\n end",
"def index\n respond_with(features)\n end",
"def index\n respond_with(features)\n end",
"def show\n @model = Model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @model }\n end\n end",
"def show\n @model = Model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @model }\n end\n end",
"def show\n @model = Model.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @model }\n end\n end",
"def index\n @car_features = CarFeature.all\n end",
"def index\n @featurenames = Featurename.all\n end",
"def show\n @predicts = Predict.where(params[:matchpick_id])\n @matchpick = Matchpick.find(params[:id])\n \n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @predict }\n end\n end",
"def index\n @featureimgs = Featureimg.all\n end",
"def show\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def model(options={})\n get_location\n # TODO: validate options\n @params[:model] = FEATURE_DEFAULTS[:model].merge(options)\n @params[:model][:generate] = true\n end",
"def index\n @brand = Brand.find(params[:brand_id])\n @models = @brand.models\n\n\n respond_to do |format|\n format.html {redirect_to @brand}\n format.json { render json: @models }\n end\n end",
"def index\r\n @features = Feature.order(:name).page(params[:page]).per(5) #配置kaminari到参数,每页几个数据\r\n @tags = Tag.all\r\n respond_to do |format|\r\n format.html # No_index.html.erb\r\n format.json { render json: @features }\r\n end\r\n\r\n end",
"def index\n limit, offset = Calculator.limit_and_offset(params)\n @key_features = KeyFeature.all.limit(limit).offset(offset).order(\"updated_at DESC\").order(\"created_at DESC\")\n\n render json: @key_features\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def index\n @features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @features }\n end\n end",
"def index\n\t @models = @model.get_many\n\t respond_to do |format|\n\t format.json do \n\t render json: @models.to_json\n\t end\n\t format.html do \n\t \trender :index\n\t end\n\t end\n\tend",
"def index\n @trainmodels = Trainmodel.all\n end",
"def get_feat\n @feat = Feat.find_by(:id => params[:id])\n @feat ||= Feat.find_by(:slug => params[:id])\n render :status => 404, :json => {status: 404, message: \"entity not found\"} if @feat.nil?\n end",
"def new\n @phosphosite_feature = PhosphositeFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phosphosite_feature }\n end\n end",
"def show\n @training = trainings.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training }\n end\n end",
"def show\n @operation = Operation.find(params[:id])\n @model = Model.find(params[:model_id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @operation }\n end\n end",
"def index\n @models = Model.order(:name)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @models }\n end\n end",
"def show\n @my_model = MyModel.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @my_model }\n end\n end",
"def show\n @modelo = Modelo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @modelo }\n end\n end",
"def get_feature(project_id, feature_id)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Get.new(\"/api/feature.json?project_id=#{project_id}&feature_id=#{feature_id}\")\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n @result = false\n return {}\n end\n\n result = JSON.parse(response.body, symbolize_names: true)\n return result\n end",
"def show\n @orf_model = OrfModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @orf_model }\n end\n end",
"def create\n @feature = Feature.new(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to admin_features_path, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_feature\n @feature = Feature.find( params[ :id ])\n end",
"def get_feature(project_id, feature_id)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Get.new(\"/api/feature.json?project_id=#{project_id}&feature_id=#{feature_id}\")\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n @runner.registerInfo(\"/api/feature.json?project_id=#{project_id}&feature_id=#{feature_id}\")\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n @result = false\n return {}\n end\n\n result = JSON.parse(response.body, symbolize_names: true)\n return result\n end",
"def new\n @part_three_predict = PartThreePredict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_three_predict }\n end\n end",
"def first\n @features.first\n end",
"def show\n @training = Training.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training }\n end\n end",
"def index\n @rental = Rental.friendly.find(params[:rental_id])\n @features = Feature.all\n end",
"def get_feature_collection(params)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Post.new('/api/search.json')\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.body = JSON.generate(params)\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n return {}\n end\n\n return JSON.parse(response.body, symbolize_names: true)\n end",
"def index\n hardware = Hardware.all\n render json: hardware.to_json(:except => [:id])\n end",
"def index\n @featuring = Featuring.all\n end",
"def index\n models = Model.all.to_json(:include => {:model_types => {:only => [:name], :methods => [:total_price]}}, :only => [:name]) \n respond_to do |format|\n format.json { render json: {models: JSON.parse(models)} , location: @model_type }\n end\n end",
"def show\n @models = self.class.model_class.find(self.class.ids_from_param(params[:id]))\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @models }\n format.json { render :json => @models }\n end\n end",
"def index\n @feature_groups = FeatureGroup.all\n end",
"def show\n @training_level = TrainingLevel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @training_level }\n end\n end",
"def models(make, year, category)\n make_id = get_object_id make\n category_id = get_object_id category\n response = get_url \"Models/#{make_id}/#{year}/#{category_id}\"\n response_obj = JSON.parse response\n response_obj[\"GetModelsResult\"].map{|r| Models::Model.from_response_hash(r)}\n end",
"def index\n @entities = Entity.find(:all, :limit=>100)\n EntitiesHelper.setModelGraph(\"public/UMLmodel.png\")\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entities }\n end\n end",
"def set_feature\n @feature = @project.features.find(params[:featureId])\n end",
"def new\n @contractor_feature = ContractorFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contractor_feature }\n end\n end",
"def index\n @vendor_features = VendorFeature.all\n end",
"def show\n @body_style_product_feature = BodyStyleProductFeature.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @body_style_product_feature }\n end\n end",
"def new\n @feature = @feature_category.features.build\n # @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def index\n @revenue_models = RevenueModel.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @revenue_models }\n end\n end",
"def show\n @county = Entity.where(id: params[:id]).where(entity_type: 'County').first\n respond_with(@county) do |format|\n format.geojson { render text: @county.to_geojson }\n end\n end",
"def new\n @feature = Feature.new\n @feature.kind = params[:kind] == 'problem' ? 'problem' : 'feature'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def index\n @models = Model.all\n end",
"def index\n @models = Model.all\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def new\n @user = current_user\n @model = Model.find(params[:model_id])\n @operation = Operation.new\n @distributions = @model.distributions\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @operation }\n end\n end",
"def features\n model.instance_variable_get(\"@features\")\n end"
] | [
"0.68911725",
"0.65041167",
"0.6456627",
"0.6454674",
"0.63120306",
"0.6290357",
"0.6254651",
"0.618421",
"0.6112798",
"0.6112798",
"0.60943913",
"0.6072903",
"0.60348964",
"0.6027023",
"0.59812653",
"0.5974228",
"0.5938801",
"0.58880633",
"0.58405876",
"0.58024013",
"0.57975155",
"0.57912856",
"0.577828",
"0.57736987",
"0.57656914",
"0.5752509",
"0.5735267",
"0.57174164",
"0.5710619",
"0.5689584",
"0.567542",
"0.5674083",
"0.56696475",
"0.56671816",
"0.56613266",
"0.5648089",
"0.56455576",
"0.56240064",
"0.5598087",
"0.5593679",
"0.558774",
"0.55833924",
"0.55828667",
"0.5579773",
"0.5579773",
"0.5579773",
"0.5562084",
"0.5557993",
"0.5553463",
"0.5544023",
"0.55401057",
"0.553182",
"0.55317295",
"0.55274653",
"0.5520156",
"0.5517752",
"0.5517752",
"0.5517752",
"0.55020416",
"0.549342",
"0.5489337",
"0.5486862",
"0.54833657",
"0.5476011",
"0.5468337",
"0.5463676",
"0.54610807",
"0.5460712",
"0.54588336",
"0.54545414",
"0.5454275",
"0.5447879",
"0.5446504",
"0.5439806",
"0.5438245",
"0.54379016",
"0.5425761",
"0.54201525",
"0.54052836",
"0.53963596",
"0.5389328",
"0.5388471",
"0.5381138",
"0.53789407",
"0.5371644",
"0.5367712",
"0.5366408",
"0.53647465",
"0.53612506",
"0.5353951",
"0.5342441",
"0.53394383",
"0.533426",
"0.5322953",
"0.5306963",
"0.5306963",
"0.53059924",
"0.53059924",
"0.530214",
"0.53011596"
] | 0.71283925 | 0 |
GET /feature_models/new GET /feature_models/new.json | def new
@feature_model = FeatureModel.new
respond_to do |format|
format.html # new.html.erb
format.json { render :json => @feature_model }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def create\n @feature_model = FeatureModel.new(params[:feature_model])\n\n respond_to do |format|\n if @feature_model.save\n format.html { redirect_to @feature_model, :notice => 'Feature model was successfully created.' }\n format.json { render :json => @feature_model, :status => :created, :location => @feature_model }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @feature_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @feature = current_user.features.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def new\n @item_feature = ItemFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_feature }\n end\n end",
"def new\n @model = Model.new\n\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\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\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\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @housing_feature = HousingFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @housing_feature }\n end\n end",
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def new\n @my_model = MyModel.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_model }\n end\n end",
"def new\n @feature = @feature_category.features.build\n # @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def new\n @contractor_feature = ContractorFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contractor_feature }\n end\n end",
"def new\n @scenario = Scenario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @scenario }\n end\n end",
"def create\n @feature = Feature.new(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to admin_features_path, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @scenario = Scenario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @scenario }\n end\n end",
"def new\n @training = Training.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @training }\n end\n end",
"def create\n @feature = Feature.find_or_create_by(name: params[:feature][:name])\n @feature.update(deleted_at: nil)\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle.features << @feature unless @feature.in? @vehicle.features\n end\n respond_to do |format|\n if @feature.save\n format.html\n format.json { render json: @feature, status: :created, location: @feature }\n format.js { render 'features/create' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def new\n @phosphosite_feature = PhosphositeFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phosphosite_feature }\n end\n end",
"def new\n @thing = Thing.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end",
"def new\n @modelo = Modelo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @modelo }\n end\n end",
"def new\n @part_three_predict = PartThreePredict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_three_predict }\n end\n end",
"def new\n @predict = Predict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @predict }\n end\n end",
"def new\n @foo_model = FooModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foo_model }\n end\n end",
"def new\n @thing = Thing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @thing }\n end\n end",
"def new\n @feature = Feature.new\n @feature.kind = params[:kind] == 'problem' ? 'problem' : 'feature'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature }\n end\n end",
"def new\n @model_association = ModelAssociation.new\n @primary_model = Part.find_by_id(params[:primary_model_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model_association }\n end\n end",
"def new\n @moose = Moose.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @moose }\n end\n end",
"def new\n @dummy = Dummy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy }\n end\n end",
"def new\n @training_level = TrainingLevel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @training_level }\n end\n end",
"def new\n @edited << 'new'\n @expanded << 'new'\n\n respond_to do |format|\n format.html { render template: 'shared/new' }\n format.js { render 'feature' }\n format.json { render json: @feature }\n end\n end",
"def new\n @weight = Weight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weight }\n end\n end",
"def new\n @models = self.class.model_class.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @models }\n end\n end",
"def new\n @label = Label.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @label }\n end\n end",
"def new\n @family = Family.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @family }\n end\n end",
"def new\n @classified = Classified.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @classified }\n end\n end",
"def new\n @test_weight = TestWeight.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @test_weight }\n end\n end",
"def create\n @gltf_model = GltfModel.new(gltf_model_params)\n\n respond_to do |format|\n if @gltf_model.save\n format.html { redirect_to @gltf_model, notice: 'Gltf model was successfully created.' }\n format.json { render :show, status: :created, location: @gltf_model }\n else\n format.html { render :new }\n format.json { render json: @gltf_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @foam = Foam.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foam }\n end\n end",
"def new\n @flavor = Flavor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @flavor }\n end\n end",
"def new\n @what = What.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @what }\n end\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def new\n @vehicle = Vehicle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vehicle }\n end\n end",
"def new\n @attribute = Attribute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attribute }\n end\n end",
"def new\n @layer = Layer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @layer }\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 @experiment = Experiment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def new\n @user = current_user\n @model = Model.find(params[:model_id])\n @operation = Operation.new\n @distributions = @model.distributions\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @operation }\n end\n end",
"def create\n @feature = current_user.features.new(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to @feature, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @chef_mapping = ChefMapping.new\n @source = []\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chef_mapping }\n end\n end",
"def new\n @observation = Observation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end",
"def new\n @observation = Observation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @observation }\n end\n end",
"def new\n @feature_status = FeatureStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feature_status }\n end\n end",
"def new\n @entity = @klass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\n end\n end",
"def new\n @lab = Lab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab }\n end\n end",
"def new\n @lab = Lab.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lab }\n end\n end",
"def new\n add_breadcrumb :new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n end\n end",
"def new\n @attribute = Attribute.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @attribute }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @experiment }\n end\n end",
"def create\n @item_feature = ItemFeature.new(params[:item_feature])\n\n respond_to do |format|\n if @item_feature.save\n format.html { redirect_to @item_feature, notice: 'Item feature was successfully created.' }\n format.json { render json: @item_feature, status: :created, location: @item_feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @gen = Gen.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gen }\n end\n end",
"def new\n @entity = Entity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\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 @specie = Specie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @specie }\n end\n end",
"def new\n @stuff = Stuff.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @stuff }\n end\n end",
"def new\n @have = Have.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @have }\n end\n end",
"def new\n @threshold = Threshold.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @threshold }\n end\n end",
"def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end",
"def new\n @fortune = Fortune.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fortune }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @request }\n end\n end",
"def create\n respond_to do |format|\n if @feature.save\n flash[:notice] = 'Feature was successfully created.'\n @changed << @feature.id\n \n format.html { redirect_to features_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n @edited << 'new'\n @expanded << 'new'\n\n format.html { render action: 'new', template: 'shared/new' }\n format.js { render 'feature' }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @experiment = Experiment.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.json { render json: @experiment }\n end\n end",
"def create\n @gene = Gene.find(params[:gene_id])\n @feature = @gene.features.create(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to @gene, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @obj = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @obj }\n end\n end",
"def new\n @onecolumnmodel = Onecolumnmodel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @onecolumnmodel }\n end\n end",
"def new\n @gene = Gene.find(params[:gene_id])\n @feature = @gene.features.build\n if @remote_user\n @feature.user = @remote_user\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def new\n @kind = Kind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @kind }\n end\n end",
"def new\n @title = t('view.providers.new_title')\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"def new\n @massive_load = MassiveLoad.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @massive_load }\n end\n end",
"def new\n @factoid = Factoid.new\n @tags = []\n Tag.all.each do |t|\n @tags.append(t.name)\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @factoid }\n end\n end",
"def new\n @vehicle_class = VehicleClass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @vehicle_class }\n end\n end",
"def new\n @tag = Tag.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tag }\n end\n end",
"def new\n @fact = fact_type.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @fact }\n end\n end",
"def new\n @t = T.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @t }\n end\n end",
"def new\n @nlp = Nlp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nlp }\n end\n end",
"def new\n @attribute_layer = AttributeLayer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @attribute_layer }\n end\n end",
"def new\r\n\t\t@current_area = 'features'\r\n\t\t@current_menu = 'products'\r\n\r\n\t\t@feature_categories = Array.new\r\n\t\t@feature_static_pages = Array.new\r\n\t\tif params[:save]\r\n\t\t\tparams[:feature][:until] = ffs_parse_date(params[:feature][:until])\r\n\t\t\t@feature = Feature.new(params[:feature])\r\n\t\t\tif @feature.save\r\n\t\t\t\tif params[:category] && params[:category][:id]\r\n\t\t\t\t\tparams[:category][:id].each do |cur_cat|\r\n\t\t\t\t\t\[email protected] << Category.find(cur_cat.to_i)\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\t\t\t\tif params[:static_page] && params[:static_page][:id]\r\n\t\t\t\t\tparams[:static_page][:id].each do |cur_stat|\r\n\t\t\t\t\t\[email protected]_pages << StaticPage.find(cur_stat.to_i)\r\n\t\t\t\t\tend\r\n\t\t\t\tend\r\n\r\n\t\t\t\[email protected]\r\n\t\t\t\tredirect_to(:action => :list) and return false\r\n\t\t\tend\r\n\t\telse\r\n\t\t\t@feature = Feature.new\r\n\r\n\t\t\tif params[:id]\r\n\t\t\t\t@feature[:product_id] = params[:id].to_i\r\n\t\t\tend\r\n\t\tend\r\n\r\n\t\t@products_by_category = Category.all.collect { |c| { :name => c.name, :id => c.id, :products => c.products } }\r\n\tend",
"def new\n @training_content = TrainingContent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @training_content }\n end\n end",
"def new\n @feat = @person.feats.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feat }\n end\n end",
"def new\n @part = Part.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part }\n end\n end",
"def new\n @lab = Lab.find(params[:lab_id])\n @machine = Machine.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @machine }\n end\n end"
] | [
"0.76336366",
"0.76336366",
"0.7387813",
"0.72632056",
"0.72206527",
"0.70854247",
"0.70854247",
"0.70854247",
"0.70854247",
"0.6910392",
"0.68846864",
"0.6854929",
"0.6827115",
"0.6811537",
"0.67846614",
"0.6766844",
"0.6732144",
"0.67289335",
"0.6715952",
"0.6699709",
"0.66995597",
"0.6692922",
"0.6677501",
"0.66731733",
"0.66627395",
"0.66183376",
"0.6593461",
"0.65833837",
"0.6582426",
"0.6571666",
"0.65704626",
"0.6565781",
"0.65606314",
"0.6559498",
"0.6559108",
"0.6556898",
"0.6552317",
"0.65369886",
"0.6516756",
"0.6516433",
"0.65154356",
"0.65100247",
"0.6491676",
"0.6491183",
"0.6491183",
"0.6486391",
"0.6484702",
"0.648378",
"0.6476648",
"0.6476648",
"0.6476248",
"0.6475523",
"0.6472162",
"0.6470001",
"0.6467851",
"0.6467851",
"0.64655024",
"0.6461747",
"0.6453092",
"0.6453092",
"0.64509594",
"0.64506567",
"0.6448599",
"0.6448599",
"0.64482015",
"0.6447649",
"0.64453995",
"0.6440621",
"0.6435639",
"0.6429669",
"0.64291394",
"0.6427808",
"0.64220035",
"0.64216083",
"0.6416543",
"0.6416543",
"0.6416543",
"0.6416543",
"0.6416543",
"0.6415878",
"0.641529",
"0.6410931",
"0.6406863",
"0.6405225",
"0.6404785",
"0.64016193",
"0.6401037",
"0.63976884",
"0.6394287",
"0.63933367",
"0.63930815",
"0.6392631",
"0.6389474",
"0.63867986",
"0.6386043",
"0.63834506",
"0.6380087",
"0.6376341",
"0.6376149",
"0.6375927"
] | 0.79455495 | 0 |
POST /feature_models POST /feature_models.json | def create
@feature_model = FeatureModel.new(params[:feature_model])
respond_to do |format|
if @feature_model.save
format.html { redirect_to @feature_model, :notice => 'Feature model was successfully created.' }
format.json { render :json => @feature_model, :status => :created, :location => @feature_model }
else
format.html { render :action => "new" }
format.json { render :json => @feature_model.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def create\n @feature = Feature.find_or_create_by(name: params[:feature][:name])\n @feature.update(deleted_at: nil)\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle.features << @feature unless @feature.in? @vehicle.features\n end\n respond_to do |format|\n if @feature.save\n format.html\n format.json { render json: @feature, status: :created, location: @feature }\n format.js { render 'features/create' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def create\n @feature = Feature.new(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to admin_features_path, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @note_features = request.parameters['_json'].map do |n|\n note = NoteFeature.new(n)\n note.save\n end\n # @note_features.each(&:save)\n render json: @note_features\n end",
"def create\n @item_feature = ItemFeature.new(params[:item_feature])\n\n respond_to do |format|\n if @item_feature.save\n format.html { redirect_to @item_feature, notice: 'Item feature was successfully created.' }\n format.json { render json: @item_feature, status: :created, location: @item_feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @item_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def train\n training = @prediction.trainedmodels.insert.request_schema.new\n training.id = 'emotion_prediction_id'\n training.storage_data_location = DATA_OBJECT\n result = @client.execute(\n :api_method => @prediction.trainedmodels.insert,\n :headers => {'Content-Type' => 'application/json'},\n :body_object => training\n )\n\n assemble_json_body(result)\n end",
"def create\n @feature = current_user.features.new(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to @feature, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gene = Gene.find(params[:gene_id])\n @feature = @gene.features.create(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to @gene, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rental = Rental.friendly.find(params[:rental_id])\n @feature = @rental.create_feature(feature_params)\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to rental_path(@rental), notice: 'Feature was successfully created.' }\n format.json { render :show, status: :created, location: @feature }\n else\n format.html { render :new }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def feature_params\n params.require(:feature).permit(:name)\n end",
"def feature_params\n params.require(:feature).permit(:name)\n end",
"def feature_params\n if action_name == 'create' then\n params.require( :feature ).permit( :label, :seqno, :feature_category_id,\n :code, :access_level, :control_level,\n :id, :no_workflows )\n else\n params.require( :feature ).permit( :label, :seqno, :feature_category_id )\n end\n end",
"def create\n @phosphosite_feature = PhosphositeFeature.new(params[:phosphosite_feature])\n\n respond_to do |format|\n if @phosphosite_feature.save\n format.html { redirect_to @phosphosite_feature, notice: 'Phosphosite feature was successfully created.' }\n format.json { render json: @phosphosite_feature, status: :created, location: @phosphosite_feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @phosphosite_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_bridge_model(body={}, headers=default_headers)\n @logger.info(\"Adding the \\\"#{body['name']}\\\" Bridge Model and Mappings.\")\n post(\"#{@api_url}/models\", body, headers)\n end",
"def create\n @car_feature = CarFeature.new(car_feature_params)\n\n respond_to do |format|\n if @car_feature.save\n format.html { redirect_to @car_feature, notice: 'Car feature was successfully created.' }\n format.json { render :show, status: :created, location: @car_feature }\n else\n format.html { render :new }\n format.json { render json: @car_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:operation][\"inputs\"] = filter_distribution_ids(params[:operation][\"inputs\"])\n @operation = Operation.new(params[:operation])\n @model = Model.find(params[:model_id])\n respond_to do |format|\n if @operation.save\n if @model\n @operation.dependent.models << @model\n format.html { redirect_to user_model_path(@model.user, @model), notice: 'Operation was successfully created.' }\n else\n format.html { redirect_to root_path, notice: 'Operation was successfully created.' }\n end \n else\n format.html { render action: \"new\" }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @housing_feature = HousingFeature.new(params[:housing_feature])\n\n respond_to do |format|\n if @housing_feature.save\n format.html { redirect_to @housing_feature, notice: 'Housing feature was successfully created.' }\n format.json { render json: @housing_feature, status: :created, location: @housing_feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @housing_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @feature_request = FeatureRequest.new(feature_request_params)\n\n respond_to do |format|\n if @feature_request.save\n format.html { redirect_to @feature_request, notice: 'Feature request was successfully created.' }\n format.json { render action: 'show', status: :created, location: @feature_request }\n else\n format.html { render action: 'new' }\n format.json { render json: @feature_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @feature_model = FeatureModel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @feature_model }\n end\n end",
"def create \n render json: Tuning.create(tuning_params)\n end",
"def model_params\n params.require(:model).permit(:id, :name, :dataset, :snippet, :image, :description, :accuracy, :algorithm, :organization, :size, :api_key, :endpoint,\n inputs_attributes: [:id, :name, :kind, :order, :_destroy],\n outputs_attributes: [:id, :name, :kind, :order, :default_value, :_destroy])\n end",
"def index\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle_features = @vehicle.features\n end\n @feature = Feature.new\n @features = Feature.all\n @all_features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @features }\n end\n end",
"def new_feature_request(folder_id, feature_content, file_name)\n url = URI(\"#{$base_url}/api/projects/#{$project_id}/folders/#{folder_id}/create_from_feature\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Post.new(url)\n request[\"accept\"] = 'application/vnd.api+json; version=1'\n request[\"access-token\"] = $access_token\n request[\"uid\"] = $uid\n request[\"client\"] = $client\n request[\"Content-Type\"] = 'application/json'\n\n data = {\n data: {\n attributes: {\n \"feature\": feature_content\n }\n }\n }\n\n request.body = JSON.generate(data)\n response = http.request(request)\n\n if response.code == 200.to_s\n $created_count = $created_count + 1\n $success_uploaded_count = $success_uploaded_count + 1\n $uploaded_features_list.push(file_name)\n puts \"Feature '#{get_name_feature_from_file(feature_content)}' created.\"\n else\n $fail_uploaded_count = $fail_uploaded_count + 1\n $not_uploaded_features_list.push(file_name)\n end\n\n response.code\nend",
"def create\n p = prediction_params\n\n p[:tags] = [p[:tags]]\n puts \"BLAH\"\n puts p\n @prediction = current_user.predictions.create(p)\n respond_to do |format|\n if @prediction.save\n format.html { redirect_to action: 'index' }\n format.json { render action: 'show', status: :created, location: @prediction }\n else\n format.html { render action: 'new' }\n format.json { render json: @prediction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @contractor_feature = ContractorFeature.new(params[:contractor_feature])\n\n respond_to do |format|\n if @contractor_feature.save\n format.html { redirect_to @contractor_feature, notice: 'Contractor feature was successfully created.' }\n format.json { render json: @contractor_feature, status: :created, location: @contractor_feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contractor_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @key_feature = KeyFeature.new(key_feature_params)\n\n if @key_feature.save\n audit(@key_feature, current_user)\n render json: @key_feature, status: :created\n else\n render json: @key_feature.errors, status: :unprocessable_entity\n end\n end",
"def feature_params\n params.require(:feature).permit(:is_public, :fid, :is_blank, :ancestor_ids, :skip_update, names: [:name, :feature_name_type_id, :language_id, :writing_system_id, :etymology, :feature_name, :is_primary_for_romanization, :ancestor_ids, :skip_update, :feature_id, :position], all_parent_relations: [:perspective_id, :parent_node_id, :child_node_id, :feature_relation_type_id, :ancestor_ids, :skip_update])\n end",
"def feature_params\n params.require(:feature).permit(:bed, :bath, :rent, :available, :dishwasher, :washer_dryer, :hardwood, :deck, :air, :cat, :dog, :bbq, :title, :description, :new_kitchen, :neighbourhood, :rental_id, :year_lease, :sq_fee, :property_type, :furnished, :sq_feet, :deposit)\n end",
"def create\n @featurename = Featurename.new(featurename_params)\n\n respond_to do |format|\n if @featurename.save\n format.html { redirect_to @featurename, notice: 'Featurename was successfully created.' }\n format.json { render :show, status: :created, location: @featurename }\n else\n format.html { render :new }\n format.json { render json: @featurename.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vendor_feature = VendorFeature.new(vendor_feature_params)\n\n respond_to do |format|\n if @vendor_feature.save\n format.html { redirect_to @vendor_feature, notice: 'Vendor feature was successfully created.' }\n format.json { render :show, status: :created, location: @vendor_feature }\n else\n format.html { render :new }\n format.json { render json: @vendor_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def new\n @feature = Feature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def test_scenario1\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"tags\" => [\"mytag\"]}, 'mytag', {\"petal width\" => 0.5}, 'Iris-setosa']]\n\n puts \n puts \"Scenario: Successfully creating a prediction from a multi model\"\n\n data.each do |filename,params,tag,data_input,prediction_result|\n puts \n puts \"Given I create a data source uploading a %s file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I create dataset with local source\"\n [email protected]_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n\n list_of_models = []\n puts \"And I create model with params %s\" % JSON.generate(params)\n [email protected]_model(dataset, params)\n\n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true)\n\n list_of_models << model \n puts \"And I create model with params %s\" % JSON.generate(params)\n [email protected]_model(dataset, params)\n\n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true) \n\n list_of_models << model\n\n puts \"And I create model with params %s\" % JSON.generate(params)\n [email protected]_model(dataset, params)\n\n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true)\n\n list_of_models << model\n\n puts \"And I create a local multi model\"\n local_multimodel = BigML::MultiModel.new(list_of_models, @api)\n\n puts \"When I create a local prediction for <%s>\" % data_input\n prediction = local_multimodel.predict(data_input)\n\n puts \"Then the prediction is <%s>\" % prediction\n assert_equal(prediction, prediction_result)\n\n end\n\n end",
"def create\n @trainmodel = Trainmodel.new(trainmodel_params)\n\n respond_to do |format|\n if @trainmodel.save\n format.html { redirect_to @trainmodel, notice: 'Trainmodel was successfully created.' }\n format.json { render :show, status: :created, location: @trainmodel }\n else\n format.html { render :new }\n format.json { render json: @trainmodel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @privilieges_feature = PriviliegesFeature.new(privilieges_feature_params)\n\n respond_to do |format|\n if @privilieges_feature.save\n format.html { redirect_to @privilieges_feature, notice: 'Privilieges feature was successfully created.' }\n format.json { render :show, status: :created, location: @privilieges_feature }\n else\n format.html { render :new }\n format.json { render json: @privilieges_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @model = @project.models.new(model_params)\n\n respond_to do |format|\n if @model.save\n format.html { redirect_to @model, notice: 'The model was successfully created.' }\n format.json { render :show, status: :created, location: @model }\n else\n format.html { render :new }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n model = params[:model]\n #NOTE: Pay attention how the data is passed as a hash. This is how locomotive expects it. Not obvious.\n # req.set_form_data('content_entry[name]' => data['name'], 'content_entry[summary]' => data['summary'], 'model' => model)\n form_data = {}\n params[:content_entry].each do |key,val|\n form_data[\"content_entry[#{key}]\"] = val\n end\n #data = params[:content_entry]\n\n uri = URI(\"#{@cms_url}/locomotive/api/content_types/#{model}/entries.json?auth_token=#{APP_CONFIG['locomotive']['auth_token']}\")\n\n req = Net::HTTP::Post.new(uri)\n req.set_form_data(form_data)\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|\n http.request(req)\n end\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n render :json => res.body\n else\n # examine response code and generate appropriate error message\n render :json => res.value\n end\n\n end",
"def feature_params\n params.require(:feature).permit(:tittle, :price, :publicationDate, :publicationState, :description, :user_id, :category_id, :image)\n end",
"def create\n @gltf_model = GltfModel.new(gltf_model_params)\n\n respond_to do |format|\n if @gltf_model.save\n format.html { redirect_to @gltf_model, notice: 'Gltf model was successfully created.' }\n format.json { render :show, status: :created, location: @gltf_model }\n else\n format.html { render :new }\n format.json { render json: @gltf_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pfeature = Pfeature.new(pfeature_params)\n\n respond_to do |format|\n if @pfeature.save\n format.html { redirect_to @pfeature, notice: 'Pfeature was successfully created.' }\n format.json { render :show, status: :created, location: @pfeature }\n else\n format.html { render :new }\n format.json { render json: @pfeature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def model(options={})\n get_location\n # TODO: validate options\n @params[:model] = FEATURE_DEFAULTS[:model].merge(options)\n @params[:model][:generate] = true\n end",
"def car_feature_params\n params.require(:car_feature).permit(:name)\n end",
"def create\n @wfeat = Wfeat.new(wfeat_params)\n\n respond_to do |format|\n if @wfeat.save\n format.html { redirect_to @wfeat, notice: 'Wfeat was successfully created.' }\n format.json { render :show, status: :created, location: @wfeat }\n else\n format.html { render :new }\n format.json { render json: @wfeat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @featuring = Featuring.new(featuring_params)\n\n respond_to do |format|\n if @featuring.save\n format.html { redirect_to @featuring, notice: 'Featuring was successfully created.' }\n format.json { render :show, status: :created, location: @featuring }\n else\n format.html { render :new }\n format.json { render json: @featuring.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n if @feature.save\n flash[:notice] = 'Feature was successfully created.'\n @changed << @feature.id\n \n format.html { redirect_to features_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n @edited << 'new'\n @expanded << 'new'\n\n format.html { render action: 'new', template: 'shared/new' }\n format.js { render 'feature' }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @part_three_predict = PartThreePredict.new(params[:part_three_predict])\n\n respond_to do |format|\n if @part_three_predict.save\n format.html { redirect_to @part_three_predict, notice: 'Part three predict was successfully created.' }\n format.json { render json: @part_three_predict, status: :created, location: @part_three_predict }\n else\n format.html { render action: \"new\" }\n format.json { render json: @part_three_predict.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vehicle_model = @vehicle_brand.vehicle_models.build(vehicle_model_params)\n\n respond_to do |format|\n if @vehicle_model.save\n format.html { redirect_to @vehicle_brand, notice: 'Vehicle model was successfully created.' }\n format.json { render action: 'show', status: :created, location: @vehicle_model }\n else\n format.html { render action: 'new' }\n format.json { render json: @vehicle_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @feature_model = FeatureModel.find(params[:id])\n @feature_model.destroy\n\n respond_to do |format|\n format.html { redirect_to feature_models_url }\n format.json { head :no_content }\n end\n end",
"def new\n @phosphosite_feature = PhosphositeFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phosphosite_feature }\n end\n end",
"def create\n models = params[:product][:models_attributes]\n if !models.nil?\n models.each do |model|\n model[1][:characteristics] = sanitize_attributes(model[1][:characteristics])\n end\n end\n clean_params = product_params\n clean_params[:specifications] = sanitize_data(clean_params[:specifications])\n clean_params[:features] = sanitize_data(clean_params[:features])\n clean_params[:attributes_titles] = sanitize_attributes(clean_params[:attributes_titles])\n\n @product = Product.new(clean_params)\n respond_to do |format|\n if @product.save\n format.html { redirect_to [:admin, @product], notice: 'Product was successfully created.' }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'new' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_params\n ActiveModelSerializers::Deserialization.jsonapi_parse(params)\n #params.require(:data).require(:attributes).permit(:name, :state, :feature_id)\n end",
"def create\n @predict = Predict.new(params[:predict])\n\n respond_to do |format|\n if @predict.save\n format.html { redirect_to @predict, notice: 'Predict was successfully created.' }\n format.json { render json: @predict, status: :created, location: @predict }\n else\n format.html { render action: \"new\" }\n format.json { render json: @predict.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @item_feature = ItemFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_feature }\n end\n end",
"def create\n @feature = Feature.new(feature_params)\n\n respond_to do |format|\n if @feature.save\n if @feature.is_active\n deactivate_all_features(@feature.id)\n end\n format.html { redirect_to(@feature, :notice => 'Feature was successfully created.') }\n format.xml { render :xml => @feature, :status => :created, :location => @feature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @feature = Feature.new(params[:feature])\n @feature.user = current_user\n\n respond_to do |format|\n if @feature.save\n if @feature.is_published\n @feature.create_activity :create, owner: current_user\n end\n format.html { redirect_to( \"/admin\", {notice: 'Feature was successfully created.'}) }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def featurename_params\n params.require(:featurename).permit(:attribute)\n end",
"def create \n if handle_data\n @model = Model.new(params[:model])\n @model.content_blob = ContentBlob.new(:tmp_io_object => @tmp_io_object,:url=>@data_url)\n\n @model.policy.set_attributes_with_sharing params[:sharing], @model.projects\n\n update_annotations @model\n experiment_ids = params[:experiment_ids] || []\n respond_to do |format|\n if @model.save\n # update attributions\n Relationship.create_or_update_attributions(@model, params[:attributions])\n \n # update related publications\n Relationship.create_or_update_attributions(@model, params[:related_publication_ids].collect {|i| [\"Publication\", i.split(\",\").first]}, Relationship::RELATED_TO_PUBLICATION) unless params[:related_publication_ids].nil?\n \n #Add creators\n AssetsCreator.add_or_update_creator_list(@model, params[:creators])\n \n flash[:notice] = 'Model was successfully uploaded and saved.'\n format.html { redirect_to model_path(@model) }\n Experiment.find(experiment_ids).each do |experiment|\n if experiment.can_edit?\n experiment.relate(@model)\n end\n end\n deliver_request_publish_approval params[:sharing], @model\n else\n format.html {\n render :action => \"new\"\n }\n end\n end\n end\n \n end",
"def create\n @testing_algorithm = TestingAlgorithm.new(params[:testing_algorithm])\n\n if @testing_algorithm.save\n render json : @testing_algorithm, status : :created, location : @testing_algorithm\n else\n render json : @testing_algorithm.errors, status : :unprocessable_entity\n end\n end",
"def create\n @feature = Feature.new(feature_params)\n ##Le asigno el id del usuario que esta logueado en ese momento\n @feature.publicationDate = Time.now\n @feature.publicationState = 'Pendiente' \n @feature.user = User.find(session[:user_id])\n @feature.totalLikes = 0\n respond_to do |format|\n if @feature.save\n ##Despues de salvado el articulo, le asigno por defecto unos valores\n format.html { redirect_to user_path(current_user)}\n format.json { render :show, status: :created, location: @feature }\n else\n format.html { render :new }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vehicle = Vehicle.new(vehicle_params)\n if @vehicle.save\n render json: { status: 'Vehicle created successfully', vehicle: @vehicle }, status: :created\n else\n render json: { errors: @vehicle.errors.full_messages }, status: :bad_request\n end\n end",
"def post_rest_api(endpoint, data, http)\n rest_api_endpoint = \"/classifier-api/v1/#{endpoint}\"\n\n # Create an HTTP POST request against the specified REST API endpoint\n request = Net::HTTP::Post.new(rest_api_endpoint)\n # Set the Content-Type and data of the HTTP POST request\n request.content_type = \"application/json\"\n request.body = data\n # Submit the request\n response = http.request(request)\n # Return the response bosy (JSON containing the result of the POST operation)\n response.body\nend",
"def create\n @vehicle_submodel = VehicleSubmodel.new(vehicle_submodel_params)\n\n respond_to do |format|\n if @vehicle_submodel.save\n format.html { redirect_to @vehicle_submodel, notice: 'Vehicle submodel was successfully created.' }\n format.json { render :show, status: :created, location: @vehicle_submodel }\n else\n format.html { render :new }\n format.json { render json: @vehicle_submodel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @body_style_product_feature = BodyStyleProductFeature.new(params[:body_style_product_feature])\n\n respond_to do |format|\n if @body_style_product_feature.save\n format.html { redirect_to @body_style_product_feature, notice: 'Body style product feature was successfully created.' }\n format.json { render json: @body_style_product_feature, status: :created, location: @body_style_product_feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @body_style_product_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dish_feature = @store.dish_features.build(dish_feature_params)\n\n respond_to do |format|\n if @dish_feature.save\n format.html { redirect_to store_dish_features_url(@store), notice: 'Dish feature was successfully created.' }\n format.json { render action: 'show', status: :created, location: @dish_feature }\n else\n format.html { render action: 'new' }\n format.json { render json: @dish_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_scenario1\n data = [[File.dirname(__FILE__)+'/data/iris.csv', {\"petal width\" => 0.5}, '000004', 'Iris-setosa']]\n\n puts \n puts \"Scenario: Successfully creating a prediction using a public model\"\n\n data.each do |filename, data_input, objective, prediction_result|\n puts \n puts \"Given I create a data source uploading a %s file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n \n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n\n puts \"And I create dataset with local source\"\n [email protected]_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n\n puts \"And I create model\" \n [email protected]_model(dataset)\n\n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true)\n\n puts \"And I make the model public\"\n model = @api.update_model(model, {'private'=> false, 'white_box' => true})\n\n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_ACCEPTED, model[\"code\"])\n assert_equal(@api.ok(model), true)\n\n puts \"And I check the model status using the model's public url\"\n model = @api.get_model(\"public/%s\" % model[\"resource\"])\n assert_equal(BigML::FINISHED, model[\"object\"][\"status\"][\"code\"]) \n\n puts \"When I create a prediction for <%s>\" % JSON.generate(data_input)\n prediction = @api.create_prediction(model, data_input)\n assert_equal(BigML::HTTP_CREATED, prediction[\"code\"])\n\n puts \"Then the prediction for <%s> is <%s>\" % [objective, prediction_result]\n assert_equal(prediction_result, prediction[\"object\"][\"prediction\"][objective])\n\n puts \"And I make the model private again\"\n model = @api.update_model(model, {'private'=> true, 'white_box' => true})\n assert_equal(BigML::HTTP_ACCEPTED, model[\"code\"])\n \n end\n\n end",
"def create\r\n @scenario = Scenario.new(scenario_params)\r\n @scenario.labels = Scenario.parse_labels(scenario_params[:labels_text], @scenario.project_id)\r\n\r\n respond_to do |format|\r\n if @scenario.save\r\n set_scenarios_grid(issue_id: @scenario.issue_id)\r\n format.html { redirect_to redirect_url, notice: t('activerecord.success.messages.created', model: Scenario.model_name.human) }\r\n format.js\r\n else\r\n format.html { render :new }\r\n format.js { render :new }\r\n end\r\n end\r\n end",
"def create\n @prediction = Prediction.new(prediction_params)\n\n respond_to do |format|\n if @prediction.save\n format.html { redirect_to @prediction, notice: 'Prediction was successfully created.' }\n format.json { render :show, status: :created, location: @prediction }\n else\n format.html { render :new }\n format.json { render json: @prediction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @model = Model.new(params[:model])\n\n respond_to do |format|\n if @model.save\n format.html { redirect_to @model, notice: 'Model was successfully created.' }\n format.json { render json: @model, status: :created, location: @model }\n else\n format.html { render action: \"new\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @model = Model.new(params[:model])\n\n respond_to do |format|\n if @model.save\n format.html { redirect_to @model, notice: 'Model was successfully created.' }\n format.json { render json: @model, status: :created, location: @model }\n else\n format.html { render action: \"new\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def prediction_params\n params.require(:prediction).permit(:body, :expires_at, :resolution_date, :tags, :group_id, :contest_id, :contest_stage_id)\n end",
"def create\n @my_model = MyModel.new(params[:my_model])\n \n respond_to do |format|\n if @my_model.save\n format.html { redirect_to @my_model, notice: 'My model was successfully created.' }\n format.json { render json: @my_model, status: :created, location: @my_model }\n else\n format.html { render action: \"new\" }\n format.json { render json: @my_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @feature = current_user.features.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @feature }\n end\n end",
"def create\n @solution = @idea.solutions.new(feature: params[:toSent]) #@idea.solutions.new(params[:solution])\n\n if @solution.save\n render json: { text: \"success\", id: \"#{@solution.id}\" }\n else\n render json: { text: \"fail\"}\n end\n end",
"def save_feature( args )\n app_name = args.delete( :app_name )\n route_info = args.delete( :route_info )\n environment = args.delete( :environment )\n \n row = { min_field(:app_name) => app_name, min_field(:env) => environment.to_s }\n if route_info\n row[min_field(:controller)] = route_info[:controller]\n row[min_field(:action)] = route_info[:action]\n else\n row[min_field(:context)] = args.delete( :path )\n end\n \n feature = features.find_one( row, :fields => ['_id'] )\n return feature['_id'] if feature\n\n now = args[:created_at]\n row[min_field(:date_id)] = \"%4d%02d%02d\" %[now.year, now.month, now.day]\n \n features.save( row )\n end",
"def create\n @test = Test.create!(test_params)\n\n render json: @test\n end",
"def dish_feature_params\n params.require(:dish_feature).permit(:name, :bei, :rank, :store_id, :image)\n end",
"def create\n @model = ClientService.new(model_params)\n\n respond_to do |format|\n if @model.save\n format.json { render :show, status: :created, location: @model }\n else\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @feature = Feature.new(params[:feature])\n @feature.user = current_user\n @feature.progress = Feature::PROGRESS[0]\n @feature.status = Feature::STATUSES[0]\n @feature.description = replace_for_update(@feature.description)\n\n respond_to do |format|\n if @feature.save\n flash[:notice] = 'Feature was successfully created.'\n format.html { update_user_edit_stats; redirect_to(@feature) }\n format.xml { render :xml => @feature, :status => :created, :location => @feature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def feature_name_params\n params.require(:feature_name).permit(:name, :feature_name_type_id, :language_id, :writing_system_id, :etymology, :feature_name, :is_primary_for_romanization, :ancestor_ids, :skip_update, :feature_id, :position)\n end",
"def new\n @housing_feature = HousingFeature.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @housing_feature }\n end\n end",
"def create\n @classifier = Classifier.new(classifier_params)\n\n respond_to do |format|\n if @classifier.save\n format.html { redirect_to @classifier, notice: 'Classifier was successfully created.' }\n format.json { render :show, status: :created, location: @classifier }\n else\n format.html { render :new }\n format.json { render json: @classifier.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_scenario1\n data = [[File.dirname(__FILE__)+'/data/iris.csv', \n false, \n File.dirname(__FILE__)+'/tmp/model.json']]\n puts\n puts \"Scenario 1: Successfully creating a local model from an exported file\"\n\n data.each do |filename, pmml, exported_file|\n puts\n puts \"Given I create a data source uploading a <%s> file\" % filename\n source = @api.create_source(filename, {'name'=> 'source_test', 'project'=> @project[\"resource\"]})\n\n puts \"And I wait until the source is ready\"\n assert_equal(BigML::HTTP_CREATED, source[\"code\"])\n assert_equal(1, source[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(source), true)\n \n puts \"And the source is in the project\"\n assert_equal(source[\"object\"]['project'], @project[\"resource\"])\n \n puts \"And I create a dataset\"\n [email protected]_dataset(source)\n\n puts \"And I wait until the dataset is ready\"\n assert_equal(BigML::HTTP_CREATED, dataset[\"code\"])\n assert_equal(1, dataset[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(dataset), true)\n \n puts \"And the dataset is in the project\"\n assert_equal(dataset[\"object\"]['project'], @project[\"resource\"])\n \n puts \"An I create a model\"\n [email protected]_model(dataset)\n\n puts \"And I wait until the model is ready\"\n assert_equal(BigML::HTTP_CREATED, model[\"code\"])\n assert_equal(1, model[\"object\"][\"status\"][\"code\"])\n assert_equal(@api.ok(model), true)\n \n puts \"And I export the <%s> model to <%s>\" % [pmml, exported_file]\n @api.export(model[\"resource\"], exported_file)\n \n puts \"When I create a local model from the file <%s>\" % exported_file\n local_model = BigML::Model.new(exported_file, @api)\n \n puts \"Then the model ID and the local model ID match\"\n assert_equal(local_model.resource_id, model[\"resource\"])\n \n end\n end",
"def create\n @trial_model = TrialModel.new(trial_model_params)\n\n respond_to do |format|\n if @trial_model.save\n format.html { redirect_to @trial_model, notice: 'Trial model was successfully created.' }\n format.json { render :show, status: :created, location: @trial_model }\n else\n format.html { render :new }\n format.json { render json: @trial_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_favorite\r\n favorite = RequestFavorite.find(params[:request_id]).request\r\n request = Request.new(user_id: favorite.user_id, service_id: favorite.service_id, description: favorite.description, service_type: favorite.service_type, payment_method: favorite.payment_method, vehicle_type: favorite.vehicle_type, latitud: favorite.latitud, longitud: favorite.longitud, status: '')\r\n if request.save\r\n render json: request\r\n else\r\n render json: {errors: request.errors.full_messages}, status: 422\r\n end\r\n end",
"def new\n @part_three_predict = PartThreePredict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @part_three_predict }\n end\n end",
"def create\n @foo_model = FooModel.new(params[:foo_model])\n\n respond_to do |format|\n if @foo_model.save\n format.html { redirect_to @foo_model, notice: 'Foo model was successfully created.' }\n format.json { render json: @foo_model, status: :created, location: @foo_model }\n else\n format.html { render action: \"new\" }\n format.json { render json: @foo_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def output_params\n params.require(:output).permit(:title, :notes, feature_ids: [])\n end",
"def create\n @model = Model.new(model_params)\n\n respond_to do |format|\n if @model.save\n format.html { redirect_to @model, notice: \"Model was successfully created.\" }\n format.json { render :show, status: :created, location: @model }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @trip_feature = TripFeature.new(params[:trip_feature])\n\n respond_to do |format|\n if @trip_feature.save\n format.html { redirect_to(@trip_feature, :notice => 'TripFeature was successfully created.') }\n format.xml { render :xml => @trip_feature, :status => :created, :location => @trip_feature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @trip_feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def translate_to_svf(object_id,access_token)\n base_64_urn = Base64.strict_encode64(object_id)\n response = RestClient.post(\"#{API_URL}/modelderivative/v2/designdata/job\",\n {\n input: {\n urn: base_64_urn\n },\n output: {\n formats: [\n {\n type: \"svf\",\n views: [\n \"3d\"\n ]\n }\n ]\n }\n }.to_json,\n { Authorization: \"Bearer #{access_token}\", content_type:'application/json' })\n return response\nend",
"def create\n params[:predictions].each do |prediction|\n @prediction = current_user.predictions.new(prediction)\n if @prediction.valid?\n @prediction.save\n end\n end\n redirect_to root_path\n end",
"def note_feature_params\n params.require(:note_feature).permit(:feature_type, :value, :text_idx, :progress_note_id)\n end",
"def new\n @predict = Predict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @predict }\n end\n end",
"def create\n # {\"vcpus\": 1, \"disk\": 1, \"name\": \"test\", \"rxtx_factor\": 1, \"OS-FLV-EXT-DATA:ephemeral\": 1, \"ram\": 512, \"id\": 6, \"swap\": 1}}'\n @flavor = compute.create_flavor(\"rxtx_factor\"=>1,\"OS-FLV-EXT-DATA:ephemeral\"=>params[:ephemeral],:vcpus=>params[:vcpus],:disk=>params[:disk],:name=>params[:name],:ram=>params[:ram],:id=>params[:id],:swap=>params[:swap])\n\n respond_to do |format|\n format.html { redirect_to flavors_path, :notice => 'Flavor was successfully created.' }\n format.json { render :json => @flavor, :status => :created, :location => @flavor }\n end\n end",
"def create\n @criterion = Criterion.new(params[:criterion])\n\n if @criterion.save\n render json: @criterion, status: :created, location: @criterion\n else\n render json: @criterion.errors, status: :unprocessable_entity\n end\n end",
"def create\n feature_params = params[:feature]\n name = feature_params[:name]\n cat = feature_params[:cat]\n weight = feature_params[:weight]\n category = feature_params[:category]\n # continuous feature creation code\n if cat.to_i == 0\n lower = feature_params[:lower]\n upper = feature_params[:upper]\n if Feature.where(name: name).empty?\n a = Feature.create(name: name)\n a.description = feature_params[:description]\n if feature_params[:description].blank?\n a.description = 'Your Own Feature(s) - Continuous'\n a.added_by = current_user.id\n a.company = true if feature_params[:company] == 'true'\n end\n a.active = true\n a.category = feature_params[:category]\n a.unit = feature_params[:unit]\n a.icon = feature_params[:icon]\n a.save!\n DataRange.create(feature_id: a.id, is_categorical: false, lower_bound: lower.to_i, upper_bound: upper.to_i)\n else\n a = Feature.where(name: name).first\n a.description = feature_params[:description]\n if feature_params[:description].blank?\n a.description = 'Your Own Feature(s) - Continuous'\n a.added_by = current_user.id\n a.company = true if feature_params[:company] == 'true'\n end\n a.active = true\n a.category = feature_params[:category]\n a.unit = feature_params[:unit]\n a.icon = feature_params[:icon]\n a.save!\n d = a.data_range\n if !d.nil?\n unless d.categorical_data_options.empty?\n d.categorical_data_options.each(&:destroy!)\n end\n d.lower_bound = lower.to_i\n d.upper_bound = upper.to_i\n d.is_categorical = false\n d.save!\n else\n DataRange.create(feature_id: a.id, is_categorical: false, lower_bound: lower.to_i, upper_bound: upper.to_i)\n end\n end\n else\n puts \"making categorical feature\"\n putsfeature_ params\n opts = feature_params[:opts].split('*')\n if Feature.where(name: name).empty?\n a = Feature.create(name: name)\n a.category = feature_params[:category]\n a.description = feature_params[:description]\n if feature_params[:description].blank?\n a.description = 'Your Own Feature(s) - Categorical'\n a.added_by = current_user.id\n a.company = true if feature_params[:company] == 'true'\n end\n a.active = true\n a.save!\n rng = DataRange.create(feature_id: a.id, is_categorical: true, lower_bound: nil, upper_bound: nil)\n opts.each do |o|\n CategoricalDataOption.create(data_range_id: rng.id, option_value: o)\n end\n else\n a = Feature.where(name: name).first\n a.description = feature_params[:description]\n if feature_params[:description].blank?\n a.description = 'Your Own Feature(s) - Categorical'\n a.added_by = current_user.id\n a.company = true if feature_params[:company] == 'true'\n end\n a.active = true\n a.category = feature_params[:category]\n a.save!\n d = a.data_range\n if !d.nil?\n unless d.categorical_data_options.empty?\n d.categorical_data_options.each(&:destroy!)\n end\n d.lower_bound = nil\n d.upper_bound = nil\n d.is_categorical = true\n d.save!\n else\n d = DataRange.create(feature_id: a.id, is_categorical: true, lower_bound: nil, upper_bound: nil)\n end\n\n feature_params[:opts].split('*').each do |o|\n CategoricalDataOption.create(data_range_id: d.id, option_value: o)\n end\n\n end\n end\n puts 'new feature and weight'\n puts a.id\n puts a.inspect\n redirect_to features_path\n end",
"def create\n @weight_training = WeightTraining.new(weight_training_params)\n\n respond_to do |format|\n if @weight_training.save\n format.html { redirect_to @weight_training, notice: 'Weight training was successfully created.' }\n format.json { render action: 'show', status: :created, location: @weight_training }\n else\n format.html { render action: 'new' }\n format.json { render json: @weight_training.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n ::Classifier.dataset.delete\n\n @classifiers.each do |section, reference_values|\n ::Classifier.create(\n section: section.to_s,\n reference_values: JSON.generate(reference_values)\n )\n end\n end",
"def create\n @device_model = DeviceModel.new(device_model_params)\n\n respond_to do |format|\n if @device_model.save\n format.html { redirect_to @device_model, notice: 'Device model was successfully created.' }\n format.json { render :show, status: :created, location: @device_model }\n else\n format.html { render :new }\n format.json { render json: @device_model.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6664786",
"0.6664786",
"0.64545137",
"0.62453234",
"0.6205945",
"0.61729884",
"0.60795695",
"0.6015084",
"0.5973376",
"0.59376323",
"0.5929749",
"0.5929749",
"0.5925967",
"0.5866978",
"0.5846872",
"0.58350337",
"0.5793282",
"0.5791804",
"0.578431",
"0.577851",
"0.5737486",
"0.57327145",
"0.5718706",
"0.5697235",
"0.5674643",
"0.5660457",
"0.5644304",
"0.5633615",
"0.5631793",
"0.56223136",
"0.5595698",
"0.558478",
"0.558478",
"0.5577015",
"0.5562818",
"0.55479693",
"0.55401015",
"0.5529752",
"0.55258936",
"0.5505553",
"0.54837286",
"0.5480813",
"0.54697156",
"0.54599744",
"0.54266316",
"0.5407436",
"0.54025036",
"0.5399674",
"0.53717947",
"0.5363736",
"0.53588194",
"0.5356179",
"0.5351774",
"0.53463066",
"0.5342269",
"0.5342169",
"0.53299814",
"0.5329242",
"0.5328172",
"0.5325178",
"0.532041",
"0.5301959",
"0.5297512",
"0.5294683",
"0.5294177",
"0.52894855",
"0.5278928",
"0.52542555",
"0.52532643",
"0.52532643",
"0.52464586",
"0.5239588",
"0.52381116",
"0.5237186",
"0.5222519",
"0.5218309",
"0.5210841",
"0.5206062",
"0.5198448",
"0.5184083",
"0.5183969",
"0.5180829",
"0.51798207",
"0.5179719",
"0.51780516",
"0.517667",
"0.5164093",
"0.5158283",
"0.5154388",
"0.5153136",
"0.51495147",
"0.5147248",
"0.5143924",
"0.5143699",
"0.51365125",
"0.51357204",
"0.5135517",
"0.51295936",
"0.51295197",
"0.5119229"
] | 0.7081288 | 0 |
PUT /feature_models/1 PUT /feature_models/1.json | def update
@feature_model = FeatureModel.find(params[:id])
respond_to do |format|
if @feature_model.update_attributes(params[:feature_model])
format.html { redirect_to @feature_model, :notice => 'Feature model was successfully updated.' }
format.json { head :no_content }
else
format.html { render :action => "edit" }
format.json { render :json => @feature_model.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n feature.update_attributes(feature_params)\n\n respond_with(feature)\n end",
"def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n format.html { redirect_to admin_features_path, notice: 'Feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @model = Model.find(params[:id])\n # @model.name = \"test\"\n @model.scale = 1\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @item_feature = ItemFeature.find(params[:id])\n\n respond_to do |format|\n if @item_feature.update_attributes(params[:item_feature])\n format.html { redirect_to @item_feature, notice: 'Item feature was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @item_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @feature_model = FeatureModel.new(params[:feature_model])\n\n respond_to do |format|\n if @feature_model.save\n format.html { redirect_to @feature_model, :notice => 'Feature model was successfully created.' }\n format.json { render :json => @feature_model, :status => :created, :location => @feature_model }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @feature_model.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @feature = Feature.find(params[:id])\n if params[:vehicle_id]\n @method = Vehicle.find(params[:vehicle_id]).toggle_feature(@feature)\n end\n\n respond_to do |format|\n if @feature.update_attributes(feature_params)\n format.json { head :no_content }\n format.js\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @feature = current_user.features.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n format.html { redirect_to @feature, notice: 'Feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @feature_model = FeatureModel.find(params[:id])\n @feature_model.destroy\n\n respond_to do |format|\n format.html { redirect_to feature_models_url }\n format.json { head :no_content }\n end\n end",
"def update\n update_annotations(params[:tag_list], @model)\n update_sharing_policies @model\n update_relationships(@model, params)\n respond_to do |format|\n if @model.update(model_params)\n flash[:notice] = \"#{t('model')} metadata was successfully updated.\"\n format.html { redirect_to model_path(@model) }\n format.json {render json: @model, include: [params[:include]]}\n else\n format.html { render action: 'edit' }\n format.json { render json: json_api_errors(@model), status: :unprocessable_entity }\n end\n end\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def update\n @housing_feature = HousingFeature.find(params[:id])\n\n respond_to do |format|\n if @housing_feature.update_attributes(params[:housing_feature])\n format.html { redirect_to @housing_feature, notice: 'Housing feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @housing_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_feature\n @feature = Feature.find( params[ :id ])\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def set_feature\n @feature = Feature.find(params[:id])\n end",
"def update\n @operation = Operation.find(params[:id])\n params[:operation][\"inputs\"] = filter_distribution_ids(params[:operation][\"inputs\"])\n @model = Model.find(params[:model_id])\n respond_to do |format|\n if @operation.update_attributes(params[:operation])\n format.html { redirect_to user_model_path(@model.user,@model), notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_bridge_model(name, body={}, headers=default_headers)\n @logger.info(\"Updating the \\\"#{name}\\\" Bridge Model.\")\n put(\"#{@api_url}/models/#{encode(name)}\", body, headers)\n end",
"def update_feature(feature_key, attributes)\n features[feature_key].update_attribute(attributes)\n save\n end",
"def update\n @gene = Gene.find(params[:gene_id])\n @feature = @gene.features.find(params[:id])\n params[:feature][:user_id] = @remote_user.id\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n format.html { redirect_to @gene, notice: 'Feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @phosphosite_feature = PhosphositeFeature.find(params[:id])\n\n respond_to do |format|\n if @phosphosite_feature.update_attributes(params[:phosphosite_feature])\n format.html { redirect_to @phosphosite_feature, notice: 'Phosphosite feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @phosphosite_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch_model dataset_id, model_id, patched_model_gapi, etag = nil\n patch_with_backoff = false\n options = { skip_deserialization: true }\n if etag\n options[:header] = { \"If-Match\" => etag }\n # The patch with etag operation is considered idempotent\n patch_with_backoff = true\n end\n execute backoff: patch_with_backoff do\n json_txt = service.patch_model @project, dataset_id, model_id, patched_model_gapi, options: options\n JSON.parse json_txt, symbolize_names: true\n end\n end",
"def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n if @feature.is_published\n @feature.create_activity :update, owner: current_user\n end \n format.html { redirect_to(\"/admin\", {notice: 'Feature was successfully updated.'}) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @feature = Feature.find_or_create_by(name: params[:feature][:name])\n @feature.update(deleted_at: nil)\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle.features << @feature unless @feature.in? @vehicle.features\n end\n respond_to do |format|\n if @feature.save\n format.html\n format.json { render json: @feature, status: :created, location: @feature }\n format.js { render 'features/create' }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n @contractor_feature = ContractorFeature.find(params[:id])\n\n respond_to do |format|\n if @contractor_feature.update_attributes(params[:contractor_feature])\n format.html { redirect_to @contractor_feature, notice: 'Contractor feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contractor_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @car_feature.update(car_feature_params)\n format.html { redirect_to @car_feature, notice: 'Car feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @car_feature }\n else\n format.html { render :edit }\n format.json { render json: @car_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @feature_request.update(feature_request_params)\n format.html { redirect_to @feature_request, notice: 'Feature request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @feature_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_models(json)\n if json.is_a?(Array)\n model_ids = []\n for json_part in json\n model = save_model_with(json_part)\n model_ids << \"#{model.id}\".to_i if model.present?\n end\n where(:id).in model_ids\n else\n model = save_model_with(json)\n return nil if model.blank?\n\n find(\"#{model.id}\".to_i)\n end\n end",
"def update!(**args)\n @endpoint = args[:endpoint] if args.key?(:endpoint)\n @model_display_name = args[:model_display_name] if args.key?(:model_display_name)\n @model_version = args[:model_version] if args.key?(:model_version)\n end",
"def update\n respond_to do |format|\n if @trainmodel.update(trainmodel_params)\n format.html { redirect_to @trainmodel, notice: 'Trainmodel was successfully updated.' }\n format.json { render :show, status: :ok, location: @trainmodel }\n else\n format.html { render :edit }\n format.json { render json: @trainmodel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_feature\n choice = Choice.find(params[:id])\n feature = Feature.find(params[:feature_id])\n question.create_choices_for_feature(current_user, feature)\n choice.update_attribute(:feature, feature)\n redirect_to edit_question_path(question)\n end",
"def update!(**args)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @model_info = args[:model_info] if args.key?(:model_info)\n @self_link = args[:self_link] if args.key?(:self_link)\n @training_status = args[:training_status] if args.key?(:training_status)\n end",
"def update\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n flash[:notice] = 'Feature was successfully updated.'\n @changed << @feature.id\n\n format.html { redirect_to features_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { head :no_content }\n else\n @edited << @feature.id\n @expanded << @feature.id\n\n format.html { render action: 'edit', template: 'shared/edit' }\n format.js { render 'feature' }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @featurename.update(featurename_params)\n format.html { redirect_to @featurename, notice: 'Featurename was successfully updated.' }\n format.json { render :show, status: :ok, location: @featurename }\n else\n format.html { render :edit }\n format.json { render json: @featurename.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @key_feature = KeyFeature.find(params[:id])\n\n if @key_feature.update(key_feature_params)\n audit(@key_feature, current_user)\n head :no_content\n else\n render json: @key_feature.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @required_features = args[:required_features] if args.key?(:required_features)\n end",
"def set_feature\n @feature = @project.features.find(params[:featureId])\n end",
"def set_trainmodel\n @trainmodel = Trainmodel.find(params[:id])\n end",
"def update_feature_request(folder_id, feature_content, file_name)\n url = URI(\"#{$base_url}/api/projects/#{$project_id}/folders/#{folder_id}/update_from_feature\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Patch.new(url)\n request[\"accept\"] = 'application/vnd.api+json; version=1'\n request[\"access-token\"] = $access_token\n request[\"uid\"] = $uid\n request[\"client\"] = $client\n request[\"Content-Type\"] = 'application/json'\n\n data = {\n data: {\n attributes: {\n \"feature\": feature_content\n }\n }\n }\n\n request.body = JSON.generate(data)\n response = http.request(request)\n\n if response.code == 200.to_s\n update_response = JSON.parse(response.read_body)['data']\n puts \"Feature '#{update_response['attributes']['name']}' with '#{update_response['attributes']['scenarios-count']} scenario(s)' updated.\"\n $success_uploaded_count = $success_uploaded_count + 1\n $uploaded_features_list.push(file_name)\n $updated_count = $updated_count + 1\n else\n $fail_uploaded_count = $fail_uploaded_count + 1\n $not_uploaded_features_list.push(file_name)\n end\n\n response.code\nend",
"def update\n # remove protected columns (including a \"link\" to content blob - actual data cannot be updated!)\n if params[:model]\n [:contributor_id, :contributor_type, :original_filename, :content_type, :content_blob_id, :created_at, :updated_at, :last_used_at].each do |column_name|\n params[:model].delete(column_name)\n end\n \n # update 'last_used_at' timestamp on the Model\n params[:model][:last_used_at] = Time.now\n end\n\n update_annotations @model\n publication_params = params[:related_publication_ids].nil?? [] : params[:related_publication_ids].collect { |i| [\"Publication\", i.split(\",\").first]}\n\n @model.attributes = params[:model]\n\n if params[:sharing]\n @model.policy_or_default\n @model.policy.set_attributes_with_sharing params[:sharing], @model.projects\n end\n\n experiment_ids = params[:experiment_ids] || []\n respond_to do |format|\n if @model.save\n\n # update attributions\n Relationship.create_or_update_attributions(@model, params[:attributions])\n \n # update related publications\n Relationship.create_or_update_attributions(@model,publication_params, Relationship::RELATED_TO_PUBLICATION)\n \n #update creators\n AssetsCreator.add_or_update_creator_list(@model, params[:creators])\n \n flash[:notice] = 'Model metadata was successfully updated.'\n format.html { redirect_to model_path(@model) }\n # Update new experiment_asset\n Experiment.find(experiment_ids).each do |experiment|\n if experiment.can_edit?\n experiment.relate(@model)\n end\n end\n #Destroy ExperimentAssets that aren't needed\n experiment_assets = @model.experiment_assets\n experiment_assets.each do |experiment_asset|\n if experiment_asset.experiment.can_edit? and !experiment_ids.include?(experiment_asset.experiment_id.to_s)\n ExperimentAsset.destroy(experiment_asset.id)\n end\n end\n deliver_request_publish_approval params[:sharing], @model\n else\n format.html {\n render :action => \"edit\"\n }\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 respond_to do |format|\n if @model.update(model_params)\n format.json { render :show, status: :ok, location: @model }\n else\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def model(options={})\n get_location\n # TODO: validate options\n @params[:model] = FEATURE_DEFAULTS[:model].merge(options)\n @params[:model][:generate] = true\n end",
"def update!(**args)\n @feature_id = args[:feature_id] if args.key?(:feature_id)\n end",
"def update\n respond_to do |format|\n if @vendor_feature.update(vendor_feature_params)\n format.html { redirect_to @vendor_feature, notice: 'Vendor feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @vendor_feature }\n else\n format.html { render :edit }\n format.json { render json: @vendor_feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_feature_request\n @feature_request = FeatureRequest.find(params[:id])\n end",
"def update\n @model = Model.find(params[:id])\n\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @model = Model.find(params[:id])\n\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @model = Model.find(params[:id])\n\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @trip_feature = TripFeature.find(params[:id])\n\n respond_to do |format|\n if @trip_feature.update_attributes(params[:trip_feature])\n format.html { redirect_to(@trip_feature, :notice => 'TripFeature was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @trip_feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n if params[:vehicle_id]\n @vehicle = Vehicle.find(params[:vehicle_id])\n @vehicle_features = @vehicle.features\n end\n @feature = Feature.new\n @features = Feature.all\n @all_features = Feature.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @features }\n end\n end",
"def update_features(client_id)\n response = self.class.put(\"https://app.klipfolio.com/api/1.0/clients/#{client_id}/features\", basic_auth: @auth, headers: { \"Content-Type\" => \"application/json\" },\n body: {\n features:[{\"name\":\"public_dashboards\",\"enabled\":true},\n {\"name\":\"published_dashboards\",\"enabled\":true},\n {\"name\":\"downloadable_reports\",\"enabled\":true},\n {\"name\":\"scheduled_emails\",\"enabled\":true}]\n }.to_json)\n puts response.body\n puts \"Client's features were updated.\" if response.success?\n end",
"def update\n respond_to do |format|\n if @feature.update(feature_params)\n @feature.update(publicationState: 'Pendiente')\n format.html { redirect_to user_path(current_user) }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_bridge_model_mapping(model_name, mapping_name, body={}, headers=default_headers)\n @logger.info(\"Updating the \\\"#{model_name} - #{mapping_name}\\\" Bridge Model Mapping.\")\n put(\"#{@api_url}/models/#{encode(model_name)}/mappings/#{encode(mapping_name)}\", body, headers)\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def create\n feature = features.create(feature_params)\n\n respond_with(feature)\n end",
"def create\n @feature = Feature.new(params[:feature])\n\n respond_to do |format|\n if @feature.save\n format.html { redirect_to admin_features_path, notice: 'Feature was successfully created.' }\n format.json { render json: @feature, status: :created, location: @feature }\n else\n format.html { render action: \"new\" }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t#find the feature header\n\t\tfeature = FeatureHeader.where(:licserver_id => params[:licserver_id], :name => params[:id]).first\n\n\t\tif feature.nil? then\n\t\t\trender :nothign => true, :status => :not_found\n\t\t\treturn\n\t\telse\n\t\t\t#update the feature\n\t\t\tif params.has_key? :'enforce-uniq' then\n\t\t\t\tfeature.update_attribute(:uniq_users, true)\n\t\t\telse\n\t\t\t\tfeature.update_attribute(:uniq_users, false)\n\t\t\tend\n\t\t\trender :nothing => true, :status => :ok\n\t\tend\n\tend",
"def update\n @<%= model_name %> = <%= upcase_model_name %>.find(params[:id])\n\n respond_to do |format|\n if @<%= model_name %>.update_attributes(params[:model])\n flash[:notice] = '<%= upcase_model_name %> was successfully updated.'\n format.json { render :json=>nil }\n else\n format.json { render :json => @<%= model_name %>.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @featuring.update(featuring_params)\n format.html { redirect_to @featuring, notice: 'Featuring was successfully updated.' }\n format.json { render :show, status: :ok, location: @featuring }\n else\n format.html { render :edit }\n format.json { render json: @featuring.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @feature_status = FeatureStatus.find(params[:id])\n\n respond_to do |format|\n if @feature_status.update_attributes(params[:feature_status])\n flash[:notice] = 'FeatureStatus was successfully updated.'\n format.html { redirect_to(@feature_status) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature_status.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def model_params\n params.require(:model).permit(:id, :name, :dataset, :snippet, :image, :description, :accuracy, :algorithm, :organization, :size, :api_key, :endpoint,\n inputs_attributes: [:id, :name, :kind, :order, :_destroy],\n outputs_attributes: [:id, :name, :kind, :order, :default_value, :_destroy])\n end",
"def update\n @rental = Rental.friendly.find(params[:rental_id])\n \n\n respond_to do |format|\n if @feature.update(feature_params)\n format.html { redirect_to rental_path(@rental), notice: 'Feature was successfully updated.' }\n format.json { render :show, status: :ok, location: @feature }\n else\n format.html { render :edit }\n format.json { render json: @feature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_model_version\n @model_version = ModelVersion.find(params[:id])\n end",
"def update\n @feature = Feature.find(params[:id])\n params[:feature][:description] = replace_for_update(params[:feature][:description])\n\n respond_to do |format|\n if @feature.update_attributes(params[:feature])\n flash[:notice] = 'Feature was successfully updated.'\n if @feature.closed?\n Vote.delete_all([\"feature_id = ?\", @feature.id])\n end\n format.html { update_user_edit_stats; redirect_to(@feature) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def feature_params\n params.require(:feature).permit(:name)\n end",
"def feature_params\n params.require(:feature).permit(:name)\n end",
"def update!(**args)\n @model = args[:model] if args.key?(:model)\n @model_version_id = args[:model_version_id] if args.key?(:model_version_id)\n end",
"def update!(**args)\n @model = args[:model] if args.key?(:model)\n @model_version_id = args[:model_version_id] if args.key?(:model_version_id)\n end",
"def patch_softwarerepository_category_mapper_model_with_http_info(moid, softwarerepository_category_mapper_model, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SoftwarerepositoryApi.patch_softwarerepository_category_mapper_model ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling SoftwarerepositoryApi.patch_softwarerepository_category_mapper_model\"\n end\n # verify the required parameter 'softwarerepository_category_mapper_model' is set\n if @api_client.config.client_side_validation && softwarerepository_category_mapper_model.nil?\n fail ArgumentError, \"Missing the required parameter 'softwarerepository_category_mapper_model' when calling SoftwarerepositoryApi.patch_softwarerepository_category_mapper_model\"\n end\n # resource path\n local_var_path = '/api/v1/softwarerepository/CategoryMapperModels/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(softwarerepository_category_mapper_model)\n\n # return_type\n return_type = opts[:debug_return_type] || 'SoftwarerepositoryCategoryMapperModel'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"SoftwarerepositoryApi.patch_softwarerepository_category_mapper_model\",\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: SoftwarerepositoryApi#patch_softwarerepository_category_mapper_model\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update!(**args)\n @base_model_id = args[:base_model_id] if args.key?(:base_model_id)\n @budget_milli_node_hours = args[:budget_milli_node_hours] if args.key?(:budget_milli_node_hours)\n @disable_early_stopping = args[:disable_early_stopping] if args.key?(:disable_early_stopping)\n @model_type = args[:model_type] if args.key?(:model_type)\n @multi_label = args[:multi_label] if args.key?(:multi_label)\n @tunable_parameter = args[:tunable_parameter] if args.key?(:tunable_parameter)\n @uptrain_base_model_id = args[:uptrain_base_model_id] if args.key?(:uptrain_base_model_id)\n end",
"def update\n @feature = Feature.find(params[:id])\n\n respond_to do |format|\n if @feature.update(feature_params)\n if @feature.is_active\n deactivate_all_features(@feature.id)\n end\n format.html { redirect_to(@feature, :notice => 'Feature was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @deployed_model_id = args[:deployed_model_id] if args.key?(:deployed_model_id)\n @metadata = args[:metadata] if args.key?(:metadata)\n @model = args[:model] if args.key?(:model)\n @model_display_name = args[:model_display_name] if args.key?(:model_display_name)\n @model_version_id = args[:model_version_id] if args.key?(:model_version_id)\n @predictions = args[:predictions] if args.key?(:predictions)\n end",
"def update\n respond_to do |format|\n if @pfeature.update(pfeature_params)\n format.html { redirect_to @pfeature, notice: t('success_update') }\n format.json { render :show, status: :ok, location: @pfeature }\n else\n format.html { render :edit }\n format.json { render json: @pfeature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save_feature( args )\n app_name = args.delete( :app_name )\n route_info = args.delete( :route_info )\n environment = args.delete( :environment )\n \n row = { min_field(:app_name) => app_name, min_field(:env) => environment.to_s }\n if route_info\n row[min_field(:controller)] = route_info[:controller]\n row[min_field(:action)] = route_info[:action]\n else\n row[min_field(:context)] = args.delete( :path )\n end\n \n feature = features.find_one( row, :fields => ['_id'] )\n return feature['_id'] if feature\n\n now = args[:created_at]\n row[min_field(:date_id)] = \"%4d%02d%02d\" %[now.year, now.month, now.day]\n \n features.save( row )\n end",
"def create\n @feature = Feature.new(params[:feature])\n @feature.user = current_user\n @feature.progress = Feature::PROGRESS[0]\n @feature.status = Feature::STATUSES[0]\n @feature.description = replace_for_update(@feature.description)\n\n respond_to do |format|\n if @feature.save\n flash[:notice] = 'Feature was successfully created.'\n format.html { update_user_edit_stats; redirect_to(@feature) }\n format.xml { render :xml => @feature, :status => :created, :location => @feature }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @feature.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @feature = args[:feature] if args.key?(:feature)\n end",
"def set_car_feature\n @car_feature = CarFeature.find(params[:id])\n end",
"def update\n @ontology = SYMPH::Ontology.find(params[:id])\n\n respond_to do |format|\n if @ontology.update_attributes(params[:ontology])\n flash[:notice] = 'Ontology was successfully updated.'\n format.html { redirect_to(ontologies_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @ontology.errors, :status => :unprocessable_entity }\n end\n end\n\t\n end",
"def update!(**args)\n @model = args[:model] if args.key?(:model)\n end",
"def update\n @foo_model = FooModel.find(params[:id])\n\n respond_to do |format|\n if @foo_model.update_attributes(params[:foo_model])\n format.html { redirect_to @foo_model, notice: 'Foo model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foo_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_app_feature_request\n @app_feature_request = AppFeatureRequest.find(params[:id])\n end",
"def update!(**args)\n @features = args[:features] if args.key?(:features)\n end",
"def set_feature_flag\n @feature_flag = FeatureFlag.find(params[:id])\n end",
"def update_softwarerepository_category_mapper_model_with_http_info(moid, softwarerepository_category_mapper_model, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SoftwarerepositoryApi.update_softwarerepository_category_mapper_model ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling SoftwarerepositoryApi.update_softwarerepository_category_mapper_model\"\n end\n # verify the required parameter 'softwarerepository_category_mapper_model' is set\n if @api_client.config.client_side_validation && softwarerepository_category_mapper_model.nil?\n fail ArgumentError, \"Missing the required parameter 'softwarerepository_category_mapper_model' when calling SoftwarerepositoryApi.update_softwarerepository_category_mapper_model\"\n end\n # resource path\n local_var_path = '/api/v1/softwarerepository/CategoryMapperModels/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(softwarerepository_category_mapper_model)\n\n # return_type\n return_type = opts[:debug_return_type] || 'SoftwarerepositoryCategoryMapperModel'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"SoftwarerepositoryApi.update_softwarerepository_category_mapper_model\",\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: SoftwarerepositoryApi#update_softwarerepository_category_mapper_model\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def update\n respond_to do |format|\n if @vehicle_model.update(vehicle_model_params)\n format.html { redirect_to @vehicle_brand, notice: 'Vehicle model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @vehicle_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n if @moose.update_attributes(params[:moose])\n format.html { redirect_to @moose, notice: 'Moose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moose.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @feature_model = FeatureModel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @feature_model }\n end\n end",
"def update(model_data)\n end",
"def update\n @scenario = Scenario.find(params[:id])\n\n respond_to do |format|\n if @scenario.update_attributes(params[:scenario])\n format.html { redirect_to @scenario, notice: 'Scenario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @scenario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ontology.update(ontology_params)\n format.html { redirect_to @ontology, notice: 'Ontology was successfully updated.' }\n format.json { render :show, status: :ok, location: @ontology }\n else\n format.html { render :edit }\n format.json { render json: @ontology.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @auto_model.update(auto_model_params)\n format.html { redirect_to @auto_model, notice: 'Auto model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @auto_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_features(features)\n DressTypeFeature.where(:dress_type_id => id).delete_all\n add_features(features)\n end",
"def update\n @model = Model.find(params[:id])\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to user_model_path(@model.user, @model), notice: 'model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gltf_model.update(gltf_model_params)\n format.html { redirect_to @gltf_model, notice: 'Gltf model was successfully updated.' }\n format.json { render :show, status: :ok, location: @gltf_model }\n else\n format.html { render :edit }\n format.json { render json: @gltf_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @serving = Serving.find(params[:id])\n\n respond_to do |format|\n if @serving.update_attributes(params[:serving])\n format.html { redirect_to @serving, notice: 'Serving was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serving.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @featureimg.update(featureimg_params)\n format.html { redirect_to current_user, notice: 'Feature Image was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @featureimg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @feature_type = args[:feature_type] if args.key?(:feature_type)\n @gconcepts = args[:gconcepts] if args.key?(:gconcepts)\n end",
"def update!(**args)\n @metadata = args[:metadata] if args.key?(:metadata)\n @other_feature_country_code = args[:other_feature_country_code] if args.key?(:other_feature_country_code)\n @other_feature_id = args[:other_feature_id] if args.key?(:other_feature_id)\n @other_feature_name = args[:other_feature_name] if args.key?(:other_feature_name)\n @other_feature_territorial_administrator = args[:other_feature_territorial_administrator] if args.key?(:other_feature_territorial_administrator)\n @other_feature_type = args[:other_feature_type] if args.key?(:other_feature_type)\n @overlap_fraction = args[:overlap_fraction] if args.key?(:overlap_fraction)\n @relation = args[:relation] if args.key?(:relation)\n @relation_is_reversed = args[:relation_is_reversed] if args.key?(:relation_is_reversed)\n @temporary_data = args[:temporary_data] if args.key?(:temporary_data)\n end",
"def update\n respond_to do |format|\n if @pfeature.update(pfeature_params)\n format.html { redirect_to @pfeature, notice: 'Pfeature was successfully updated.' }\n format.json { render :show, status: :ok, location: @pfeature }\n else\n format.html { render :edit }\n format.json { render json: @pfeature.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @dish_feature.update(dish_feature_params)\n format.html { redirect_to store_dish_features_url(@store), notice: 'Dish feature was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dish_feature.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.61656874",
"0.60785335",
"0.60129166",
"0.5987578",
"0.5946932",
"0.59260094",
"0.59238297",
"0.58759475",
"0.58657545",
"0.584658",
"0.5801184",
"0.57697827",
"0.5766134",
"0.5766134",
"0.5766134",
"0.57502174",
"0.5733993",
"0.57091403",
"0.5688624",
"0.56844646",
"0.56683326",
"0.5654809",
"0.5625818",
"0.56202084",
"0.5554013",
"0.55423075",
"0.55280334",
"0.55153555",
"0.55132616",
"0.5510468",
"0.5503906",
"0.5499701",
"0.5499423",
"0.5487939",
"0.54827976",
"0.5481946",
"0.54677826",
"0.5432095",
"0.54135096",
"0.54014385",
"0.5387153",
"0.53669906",
"0.535844",
"0.535548",
"0.535308",
"0.53495765",
"0.53495765",
"0.53495765",
"0.53495735",
"0.5342002",
"0.53350323",
"0.53341466",
"0.53317887",
"0.5312762",
"0.5312762",
"0.5312693",
"0.53046364",
"0.52829194",
"0.5282736",
"0.5280642",
"0.52745414",
"0.52734786",
"0.5271081",
"0.5265691",
"0.526474",
"0.526474",
"0.52639604",
"0.52639604",
"0.52569944",
"0.5252219",
"0.52322924",
"0.52322406",
"0.52012235",
"0.51990026",
"0.51985097",
"0.5195848",
"0.5192745",
"0.5191221",
"0.5184634",
"0.5182849",
"0.5181082",
"0.517499",
"0.51688683",
"0.51679754",
"0.5166994",
"0.5151136",
"0.51509166",
"0.51507294",
"0.5148134",
"0.5145714",
"0.5142492",
"0.5138226",
"0.51368093",
"0.5134943",
"0.51307565",
"0.51293856",
"0.5118318",
"0.51084274",
"0.5102998",
"0.51026374"
] | 0.68288696 | 0 |
DELETE /feature_models/1 DELETE /feature_models/1.json | def destroy
@feature_model = FeatureModel.find(params[:id])
@feature_model.destroy
respond_to do |format|
format.html { redirect_to feature_models_url }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @feature = Feature.find(params[:id])\n @feature.destroy\n\n respond_to do |format|\n format.html { redirect_to features_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @item_feature = ItemFeature.find(params[:id])\n @item_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to item_features_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @feature_request.destroy\n respond_to do |format|\n format.html { redirect_to feature_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n feature.destroy\n\n respond_with(feature)\n end",
"def destroy\n @my_model = MyModel.find(params[:id])\n @my_model.destroy\n \n respond_to do |format|\n format.html { redirect_to my_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @app_feature_request.destroy\n respond_to do |format|\n format.html { redirect_to app_feature_requests_path, notice: 'Feature request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature.destroy\n respond_to do |format|\n format.html { redirect_to features_url, notice: 'Feature was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature = Feature.find(params[:id])\n @feature.destroy\n\n respond_to do |format|\n format.html { redirect_to(features_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feature = current_user.features.find(params[:id])\n @feature.destroy\n\n respond_to do |format|\n format.html { redirect_to features_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contractor_feature = ContractorFeature.find(params[:id])\n @contractor_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to contractor_features_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @housing_feature = HousingFeature.find(params[:id])\n @housing_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to housing_features_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @onecolumnmodel = Onecolumnmodel.find(params[:id])\n @onecolumnmodel.destroy\n\n respond_to do |format|\n format.html { redirect_to onecolumnmodels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gltf_model.destroy\n respond_to do |format|\n format.html { redirect_to gltf_models_url, notice: 'Gltf model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gene = Gene.find(params[:gene_id])\n @feature = @gene.features.find(params[:id])\n @feature.destroy\n\n respond_to do |format|\n format.html { redirect_to @gene, notice: 'Feature was removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature = Feature.find(params[:id])\n @feature.create_activity :destroy, owner: current_user\n @feature.destroy\n\n respond_to do |format|\n format.html { redirect_to({:action => :index}) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @oid_model.destroy\n respond_to do |format|\n format.html { redirect_to oid_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to administration_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to model_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n name = FeatureName.find(params[:id])\n feature = name.feature\n name.destroy\n feature.update_cached_feature_names # took it out of the model to not choke the importer\n redirect_to(:back)\n end",
"def destroy\n @scenario = Scenario.find(params[:id])\n @scenario.destroy\n\n respond_to do |format|\n format.html { redirect_to scenarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @scenario = Scenario.find(params[:id])\n @scenario.destroy\n\n respond_to do |format|\n format.html { redirect_to scenarios_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model.destroy\n respond_to do |format|\n format.html { redirect_to models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @foo_model = FooModel.find(params[:id])\n @foo_model.destroy\n\n respond_to do |format|\n format.html { redirect_to foo_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @phosphosite_feature = PhosphositeFeature.find(params[:id])\n @phosphosite_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to phosphosite_features_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature = Feature.find(params[:id])\n @feature.destroy\n\n respond_to do |format|\n format.html { redirect_to features_url }\n format.json { head :no_content }\n format.js\n end\n end",
"def destroy\n @featureimg.destroy\n respond_to do |format|\n format.html { redirect_to featureimgs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature_status = FeatureStatus.find(params[:id])\n @feature_status.destroy\n\n respond_to do |format|\n format.html { redirect_to(feature_statuses_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dish_feature.destroy\n respond_to do |format|\n format.html { redirect_to store_dish_features_url(@store) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicle_model.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @featuring.destroy\n respond_to do |format|\n format.html { redirect_to featuring_index_url, notice: 'Featuring was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @fakemodel.destroy\n respond_to do |format|\n format.html { redirect_to fakemodels_url, notice: 'Fakemodel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @featurename.destroy\n respond_to do |format|\n format.html { redirect_to featurenames_url, notice: 'Featurename was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @auto_model.destroy\n respond_to do |format|\n format.html { redirect_to auto_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @trainmodel.destroy\n respond_to do |format|\n format.html { redirect_to trainmodels_url, notice: 'Trainmodel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @linear_model.destroy\n respond_to do |format|\n format.html { redirect_to linear_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @trial_model.destroy\n respond_to do |format|\n format.html { redirect_to trial_models_url, notice: 'Trial model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @part_three_predict = PartThreePredict.find(params[:id])\n @part_three_predict.destroy\n\n respond_to do |format|\n format.html { redirect_to part_three_predicts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @feature.destroy\n respond_to do |format|\n format.html { redirect_to user_path(current_user) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @simple_model = SimpleModel.find(params[:id])\n @simple_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(simple_models_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @massive_load = MassiveLoad.find(params[:id])\n @massive_load.destroy\n\n respond_to do |format|\n format.html { redirect_to massive_loads_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @car_feature.destroy\n respond_to do |format|\n format.html { redirect_to car_features_url, notice: 'Car feature was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @sivic_model.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_models_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @appraisal_model.destroy\n respond_to do |format|\n format.html { redirect_to appraisal_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @model.destroy\r\n respond_to do |format|\r\n format.html { redirect_to models_url, notice: 'Model was successfully deleted.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @test_model = TestModel.find(params[:id])\n @test_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(test_models_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @predict = Predict.find(params[:id])\n @predict.destroy\n\n respond_to do |format|\n format.html { redirect_to predicts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test_weight = TestWeight.find(params[:id])\n @test_weight.destroy\n\n respond_to do |format|\n format.html { redirect_to test_weights_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operation = Operation.find(params[:id])\n @model = Model.find(params[:model_id])\n @operation.destroy\n\n respond_to do |format|\n format.html { redirect_to user_model_path(@model.user, @model) }\n format.json { head :no_content }\n end\n end",
"def destroy\n compute.delete_flavor(params[:id])\n \n\n respond_to do |format|\n format.html { redirect_to flavors_path }\n format.json { head :ok }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to(models_url) }\n format.xml { head :ok }\n format.csv { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to(models_url) }\n format.xml { head :ok }\n format.csv { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @lens_model = LensModel.find(params[:id])\n @lens_model.destroy\n\n respond_to do |format|\n format.html { redirect_to(lens_models_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @trip_feature = TripFeature.find(params[:id])\n @trip_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to(trip_features_url) }\n format.xml { head :ok }\n end\n end",
"def delete_model dataset_id, model_id\n execute { service.delete_model @project, dataset_id, model_id }\n end",
"def destroy\n @vendor_feature.destroy\n respond_to do |format|\n format.html { redirect_to vendor_features_url, notice: 'Vendor feature 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 @feature_group.destroy\n respond_to do |format|\n format.html { redirect_to feature_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy_feature\n feature = Feature.find(params[:feature_id], :include => :category)\n feature.remove_node\n redirect_to(features_category_path(feature.category_id)) \n end",
"def destroy\n @forest = Forest.find(params[:id])\n @forest.destroy\n\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prediction.destroy\n respond_to do |format|\n format.html { redirect_to predictions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_model.destroy\n respond_to do |format|\n format.html { redirect_to my_models_url, notice: 'My model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy_feature(feature_key)\n features[feature_key].delete\n save\n end",
"def destroy\n @dark_feature = DarkFeature.find(params[:id])\n @dark_feature.destroy\n\n respond_to do |format|\n format.html { redirect_to(dark_features_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @model.destroy\n respond_to do |format|\n format.html { redirect_to models_url, notice: \"Model was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weight_training.destroy\n respond_to do |format|\n format.html { redirect_to weight_trainings_url }\n format.json { head :no_content }\n end\n end",
"def delete\n ensure_service!\n service.delete_model dataset_id, model_id\n # Set flag for #exists?\n @exists = false\n true\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to models_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @cargapp_model.destroy\n respond_to do |format|\n format.html { redirect_to cargapp_models_url, notice: 'Cargapp model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @train_locomotive.destroy\n respond_to do |format|\n format.html { redirect_to train_locomotives_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @prediction = Prediction.find(params[:id])\n @prediction.destroy\n\n respond_to do |format|\n format.html { redirect_to predictions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hello_model.destroy\n respond_to do |format|\n format.html { redirect_to hello_models_url, notice: 'Hello model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @forest.destroy\n respond_to do |format|\n format.html { redirect_to forests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model.destroy\n \n respond_to do |format|\n format.html { redirect_to(models_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @feature = @feature_category.features.find(params[:id])\n #@feature = Feature.find(params[:id])\n @feature.destroy\n\n respond_to do |format|\n #format.html { redirect_to(features_url) }\n format.html { redirect_to([@feature_category],:notice => 'Feature was successfully destroyed.') }\n # format.html { redirect_to(feature_category_features_path(@feature)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @project = @model.project\n @model.destroy\n respond_to do |format|\n format.html { redirect_back fallback_location: project_models_url(@project), notice: 'The model was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dummy = Dummy.find(params[:id])\n @dummy.destroy\n\n respond_to do |format|\n format.html { redirect_to dummies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @core = Core.find(params[:id])\n @core.destroy\n\n respond_to do |format|\n format.html { redirect_to cores_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pfeature.destroy\n respond_to do |format|\n format.html { redirect_to pfeatures_url, notice: 'Pfeature was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @revenue_model = RevenueModel.find(params[:id])\n @revenue_model.destroy\n\n respond_to do |format|\n format.html { redirect_to revenue_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicle_submodel.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_submodels_url, notice: 'Vehicle submodel was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @user = @model.user\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to user_models_path(@user) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @modelstate.destroy\n respond_to do |format|\n format.html { redirect_to modelstates_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @model = Model.find(params[:id])\n @model.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_models_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @movie_model.destroy\n respond_to do |format|\n format.html { redirect_to movie_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device_model.destroy\n respond_to do |format|\n format.html { redirect_to device_models_url, notice: 'Device model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @battery_model = BatteryModel.find(params[:id])\n @battery_model.destroy\n\n respond_to do |format|\n format.html { redirect_to battery_models_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vehicle = Vehicle.find(params[:id])\n @vehicle.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 @feature.destroy\n\n flash[:notice] = 'Feature was successfully deleted.'\n\n respond_to do |format|\n format.html { redirect_to features_path }\n format.js { render 'shared/index'; flash.discard }\n format.json { head :no_content }\n end\n end",
"def destroy\n @api_version = ApiVersion.find(params[:id])\n @api_version.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_api_versions_url, flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.api_version.one'))} }\n format.json { head :no_content }\n end\n end",
"def destroy\n @models = self.class.model_class.find(params[:id])\n @models.destroy\n\n respond_to do |format|\n format.html { redirect_to(url_for(:action => index)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @modelo = Modelo.find(params[:id])\n @modelo.destroy\n\n respond_to do |format|\n format.html { redirect_to modelos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @visit = Visit.find(params[:id])\n @visit.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @featured.destroy\n respond_to do |format|\n format.html { redirect_to featureds_url, notice: 'Featured was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @featured.destroy\n respond_to do |format|\n format.html { redirect_to featureds_url, notice: 'Featured was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.7299146",
"0.71325123",
"0.7058089",
"0.7013151",
"0.6979955",
"0.6970738",
"0.6966448",
"0.696397",
"0.6955871",
"0.6955348",
"0.6955348",
"0.6955348",
"0.69509375",
"0.69467443",
"0.69367075",
"0.6910246",
"0.6905975",
"0.69051516",
"0.68978006",
"0.6887833",
"0.6869564",
"0.6850355",
"0.6842819",
"0.6842819",
"0.6831342",
"0.6830291",
"0.6825935",
"0.68140405",
"0.67982084",
"0.6771218",
"0.6765032",
"0.67504585",
"0.67467314",
"0.6744966",
"0.67425096",
"0.6738315",
"0.6725502",
"0.67191166",
"0.6695143",
"0.66852695",
"0.667304",
"0.66713256",
"0.6667393",
"0.6664195",
"0.66458935",
"0.66428155",
"0.6629306",
"0.6621001",
"0.66208005",
"0.6584827",
"0.6584598",
"0.6579465",
"0.65756387",
"0.65693593",
"0.6544915",
"0.6544915",
"0.65446144",
"0.6541251",
"0.65375465",
"0.6530973",
"0.65288603",
"0.6528317",
"0.6521237",
"0.6520145",
"0.6506747",
"0.6502005",
"0.6492475",
"0.6488496",
"0.64867723",
"0.64862674",
"0.64775103",
"0.6476235",
"0.6470505",
"0.6464579",
"0.64644814",
"0.64522415",
"0.6450627",
"0.6449598",
"0.64344573",
"0.6431351",
"0.64294785",
"0.64257693",
"0.64187455",
"0.64170474",
"0.6408518",
"0.6403925",
"0.64000946",
"0.63980234",
"0.6397201",
"0.63921916",
"0.63847864",
"0.6380262",
"0.6371414",
"0.63706076",
"0.6364399",
"0.63638353",
"0.6363675",
"0.6363471",
"0.63619334",
"0.63619334"
] | 0.7712323 | 0 |
This is identical to get_sections. Why use different names? Because it expresses the intent. Its possible we will want to return different responses for each in the future. | def get_page
render_page_sections_json
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def sections\n respond_with @page.sections\n end",
"def sections\n respond_with @page.sections\n end",
"def sections\n result = @nsx_client.get(@url_sections)\n result['results']\n end",
"def get_sections_with_http_info(name, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.get_sections ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.get_sections\"\n end\n # resource path\n local_var_path = '/slides/{name}/sections'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'Sections')\n return data, status_code, headers\n end",
"def list_sections\n \n end",
"def create_section_response\n response = Hash.new\n response[:is_searchable] = DocumentPlatform.searchable?\n response[:has_description] = DocumentPlatform.has_description?\n response[:has_metadata] = DocumentPlatform.has_metadata?\n response[:supports_permissions] = DocumentPlatform.supports_permissions?\n response[:sections] = []\n return response\n end",
"def sections\n temp_sections = []\n if @section_ids.count > 0\n @section_ids.each do |section_id|\n temp_sections.push @client.section(@org_id, section_id)\n end\n end\n return temp_sections\n end",
"def sections\n parsed {\n @sections\n }\n end",
"def section_contents\n used_sections = {}\n\n each_method do |method|\n next unless method.display?\n\n used_sections[method.section] = true\n end\n\n # order found sections\n sections = sort_sections.select do |section|\n used_sections[section]\n end\n\n # only the default section is used\n return [] if\n sections.length == 1 and not sections.first.title\n\n sections\n end",
"def sections\n @sections ||= context\n .public_methods\n .grep(/\\A(?!wait_)\\w+_section$\\z/)\n .map { |el| Meta::Section.new(el.to_s.gsub('_section', ''), context) }\n end",
"def section\n return @section if @section\n\n resp = HTTP\n .headers(authorization: \"Bearer #{access_token[:access_token]}\")\n .get(LIST_SECTIONS_ENDPOINT % notebook[:id], params: {\n select: 'id,name',\n filter: \"name eq '#{Config[:section]}'\"\n })\n if resp.code.to_s.start_with? '2'\n json = response_body(resp)\n @section = JSON.parse(json, symbolize_names: true)[:value].first\n end\n return @section\n end",
"def sections(*values)\n values.inject(self) { |res, val| res._sections(val) or fail ArgumentError, \"Unknown value for sections: #{val}\" }\n end",
"def sections(*values)\n values.inject(self) { |res, val| res._sections(val) or fail ArgumentError, \"Unknown value for sections: #{val}\" }\n end",
"def index\n @sections = params[:path].nil? ? Section.all : Section.where(path: params[:path])\n\n respond_to do |format|\n format.html { render html: @sections }\n format.json { render json: @sections }\n end\n end",
"def test_list_by_section\n a_section = sections(:pseudoscientific_claims)\n \n get :list_by_section, :section_name => a_section.name\n assert_response :success\n assert_equal assigns(:title), \"Blog entries for #{a_section.name}\"\n assert_template 'index.rhtml'\n assert_not_nil assigns(:content_nodes)\n \n # Assert the blog posts are being shown.\n assert assigns(:sections).size > 0\n assert_select \"a\", :count => 1, :text => content_nodes(:pigasus_awards).title\n assert_select \"a\", :count => 1, :text => content_nodes(:silent_birth).title\n\n\n # Now using an invalid name.\n get :list_by_section, :section_name => \"bleargh\"\n assert_response :missing\n end",
"def sections\n return @sections\n end",
"def get_sections (subdomain,course_id)\n token = get_token\n courses = get_all_pages(\n token,\n \"https://#{subdomain}.instructure.com/api/v1/courses/#{course_id}/sections\"\n )\n end",
"def sections\n @sections.values\n end",
"def get_sections(request)\n data, _status_code, _headers = get_sections_with_http_info(request)\n request_token if _status_code == 401\n data\n end",
"def set_sections_with_http_info(name, sections, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.set_sections ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.set_sections\"\n end\n # verify the required parameter 'sections' is set\n if @api_client.config.client_side_validation && sections.nil?\n fail ArgumentError, \"Missing the required parameter 'sections' when calling SlidesApi.set_sections\"\n end\n # resource path\n local_var_path = '/slides/{name}/sections'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = @api_client.object_to_http_body(sections)\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'Sections')\n return data, status_code, headers\n end",
"def sections(*args); end",
"def sections(project_id, suite_id)\n get(\"get_sections/#{project_id}&suite_id=#{suite_id}\")\n end",
"def extract_sections(text)\n in_section = false\n sections = []\n text.each_line do |line|\n line = line.chomp\n case line\n # request/response header\n when /^\\** (Request|Response)+/\n in_section = true\n section_name = line\n sections << [section_name, []]\n # some other header\n when /^\\*+/\n in_section = false\n section_name = nil\n else\n if in_section\n sections[-1][-1] << line\n end\n end\n end\n sections\nend",
"def list_sections(opts = {})\n data, _status_code, _headers = list_sections_with_http_info(opts)\n data\n end",
"def sections\n @pages.collect { |p| p.sections }.flatten\n end",
"def get_sections(name, password = nil, folder = nil, storage = nil)\n data, _status_code, _headers = get_sections_with_http_info(name, password, folder, storage)\n data\n end",
"def fetch_section(section)\n if guardian_sections.include? section\n response = $redis.get(\"news_#{section}\")\n if response.nil?\n @section = \"§ion=\" + section.to_s\n base_uri = \"http://content.guardianapis.com/search?order-by=newest&type=article\"\n response = JSON.generate(HTTParty.get(base_uri + @section + \"&api-key=\" + ENV['GUARDIAN_API_KEY'])[\"response\"][\"results\"])\n $redis.set(\"news_#{section}\", response)\n $redis.expire(\"news_#{section}\", 1.hours.to_i)\n end\n @response = JSON.load(response)\n else\n fetch_articles\n end\n end",
"def sections\n @body.xpath('.//a:section', a: NS)\n end",
"def sell_shop_sections (params={})\r\n url = api_url \"/sell/shop/sections\"\r\n req = request_params(params)\r\n\r\n feed_or_retry do\r\n RestClient.get url, req\r\n end \r\n end",
"def create_get_all_sections(section_class, element_name, *find_args)\n method_name = \"get_all_#{element_name}\"\n create_helper_method(method_name, *find_args) do\n define_method(method_name) do |*runtime_args|\n args = merge_args(find_args, runtime_args)\n wait_until_get_not_empty(*args).map do |element|\n section_class.new(self, element)\n end\n end\n end\n end",
"def section_by_name(section_name); end",
"def index\n @form_sections = FormSection.all\n respond_with( @form_sections )\n end",
"def all_sections\n [ header_section ] + sections\n end",
"def list_by_sections\n\n @list_options = Section.find_alpha\n\n if params[:key] then\n @viewing_by = params[:key]\n elsif session[:last_content_list_view] then\n @viewing_by = session[:last_content_list_view]\n else\n @viewing_by = @list_options[0].id\n end\n\n @section = Section.find(:first, :conditions => [\"#{Section.connection.quote_column_name(\"id\")}=?\", @viewing_by])\n if @section == nil then\n\t\t\tredirect_to :action => 'list'\n\t\t\treturn\n end\n\n @title = \"Content List For Section - '#{@section.name}'\"\n\n conditions = nil\n\n session[:last_content_list_view] = @viewing_by\n\n # Paginate that will work with will_paginate...yee!\n per_page = 30\n list = @section.content_nodes\n pager = Paginator.new(list, list.size, per_page, params[:page])\n @content_nodes = WillPaginate::Collection.new(params[:page] || 1, per_page, list.size) do |p|\n p.replace list[pager.current.offset, pager.items_per_page]\n end\n \n render :action => 'list'\n end",
"def index\n @sections = Section.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sections }\n end\n end",
"def sections(ident_only=false, &block)\n return to_enum(:sections, ident_only) if ! block_given?\n @sections.values.each do |sec|\n yield(ident_only ? sec.ident : sec)\n end\n end",
"def default_sections\n [\n Section.new(name: \"summary\", prefix: @options[:summary_prefix], labels: @options[:summary_labels], options: @options, body_only: true),\n Section.new(name: \"breaking\", prefix: @options[:breaking_prefix], labels: @options[:breaking_labels], options: @options),\n Section.new(name: \"enhancements\", prefix: @options[:enhancement_prefix], labels: @options[:enhancement_labels], options: @options),\n Section.new(name: \"bugs\", prefix: @options[:bug_prefix], labels: @options[:bug_labels], options: @options),\n Section.new(name: \"deprecated\", prefix: @options[:deprecated_prefix], labels: @options[:deprecated_labels], options: @options),\n Section.new(name: \"removed\", prefix: @options[:removed_prefix], labels: @options[:removed_labels], options: @options),\n Section.new(name: \"security\", prefix: @options[:security_prefix], labels: @options[:security_labels], options: @options)\n ]\n end",
"def sub_sections(kind)\n {'actions' => [nil, ActionList, @actions],\n 'realtime' => ['optional', MatchList, real_time, @opts, @file],\n 'periodic' => ['optional', MatchList, periodic, @opts, @file]\n }[kind]\n end",
"def sections\n @blocks.inject([]) {|collector, block|\n collector << block if block.is_a?(Section)\n collector\n }\n end",
"def page_sections(name, section_class, identifier, parent = self)\n define_method(name) do\n platform.pages_for(identifier, section_class, parent)\n end\n end",
"def section(name, *args, **options, &block)\n section_class.send(:section, name, *args, **options, &block)\n end",
"def index\n @sections = case current_user.rc\n when 'EA'\n Section.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'IA','EO'\n current_user.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'MOE'\n current_user.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'CR'\n current_user.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n when 'ET'\n current_user.center.sections.includes(:profile).order('profiles.firstname').page(params[:page])\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sections }\n end\n end",
"def get_single_submission_sections(section_id,assignment_id,user_id,include,opts={})\n query_param_keys = [\n :include\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"section_id is required\" if section_id.nil?\n raise \"assignment_id is required\" if assignment_id.nil?\n raise \"user_id is required\" if user_id.nil?\n raise \"include is required\" if include.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :section_id => section_id,\n :assignment_id => assignment_id,\n :user_id => user_id,\n :include => include\n )\n\n # resource path\n path = path_replace(\"/v1/sections/{section_id}/assignments/{assignment_id}/submissions/{user_id}\",\n :section_id => section_id,\n :assignment_id => assignment_id,\n :user_id => user_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"def render_sections(options = {})\n \n # find render key\n render_key = song_key\n render_key = song_key.transpose(options[:modulation]) if options[:modulation]\n if options[:alt_key]\n if options[:alt_key].class == SongKey\n render_key = options[:alt_key]\n else\n render_key = SongKey.KEY( options[:alt_key] )\n end\n end\n \n # should be rendered fully?\n render_full = options[:full] || false\n \n # should all sections be rendered\n render_all_sections = options[:render_all_sections] || false\n \n # should lyrics be forced?\n force_lyrics = options[:force_Lyrics] || false\n \n expanded_structure = structure.map { |s| Song.structure_interpreter(s) }\n \n sections_so_far = Hash.new\n \n return expanded_structure.map do |sec|\n \n section_fingerprint = { :type => sec[:type],\n :variation => sec[:variation],\n :modulation => sec[:modulation],\n :lyric_variation => sec[:lyric_variation] }\n \n if render_all_sections || !sections_so_far.keys.include?(section_fingerprint)\n \n section = sections.all.select { |s| s.type == sec[:type] }.find { |s| s.variation == sec[:variation] }\n \n raise \"There is no section #{sec[:type]} with variation #{sec[:variation]} in this song.\" unless section\n \n section_tag = sec[:render_section_number] ? \" #{sec[:lyric_variation]}\" : \"\"\n title = \"#{section.title}#{section_tag}\"\n \n section_lines = Array.new\n \n section_lines += section.render_lines( :variation => sec[:lyric_variation],\n :modulation => sec[:modulation],\n :full => render_full,\n :force_lyrics => force_lyrics )\n \n section_data = { :title => title,\n :lines => section_lines,\n :instrumental => section_lines[-1][:instrumental],\n :repeats => sec[:repeat],\n :is_repeat => false }\n \n sections_so_far[section_fingerprint] = section_data\n \n next section_data\n \n else\n \n prev_repeat = sections_so_far[section_fingerprint]\n \n next { :title => prev_repeat[:title],\n :instrumental => prev_repeat[:instrumental],\n :repeats => sec[:repeat],\n :is_repeat => true }\n \n end\n end\n \n end",
"def create_sections\n @sections = if @options.configure_sections?\n parse_sections(@options[:configure_sections])\n elsif @options.add_sections?\n default_sections.concat parse_sections(@options[:add_sections])\n else\n default_sections\n end\n nil\n end",
"def sections\n self.entries.select { |e| e.is_a?(ListSection) }\n end",
"def show\n respond_to do |format|\n format.html { render html: @section }\n format.json { render json: @section }\n end\n end",
"def index\n course = Course.find(params[:course_id])\n sections = course.sections.all\n render json: sections.order(:id)\n end",
"def method_missing(m, *args, &block)\n if block || args\n @sections.each do |key, s|\n s.send(m, *args, &block) if s.respond_to?(m)\n end\n end\n end",
"def section\n @section.call\n end",
"def results_for_division(division)\n if division == :all\n @results\n else\n sections = @festival_info.sections(division)\n @results.select { |section, result| sections.include? section }\n end\n end",
"def index\n @sections = Section.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sections }\n end\n end",
"def section(name)\n out \"===== #{name} ==== Begin...\"\n @out_sections = [] unless defined?(@out_sections)\n @out_sections << name\n begin\n yield\n ensure\n @out_sections.pop\n out \"===== #{name} ==== ...End\"\n out\n end\n end",
"def sections=(value)\n @sections = value\n end",
"def section_names(resolve=true)\n resolve_sections if resolve\n @section_names\n end",
"def scubooks\n sections = Section.all\n render json: sections\n end",
"def getEnrollmentsInSection(sid)\r\n\turi = sprintf(\"/api/v1/sections/%d/enrollments?type[]=StudentEnrollment&per_page=999\", sid)\r\n\tenrollments = $canvas.get(uri)\r\n\treturn enrollments\r\nend",
"def getEnrollmentsInSection(sid)\r\n\turi = sprintf(\"/api/v1/sections/%d/enrollments?type[]=StudentEnrollment&per_page=999\", sid)\r\n\tenrollments = $canvas.get(uri)\r\n\treturn enrollments\r\nend",
"def section_by_name(section_name)\n result = nil\n all_sections = sections\n return result unless all_sections\n\n all_sections.each do |section|\n result = section if section['display_name'] == section_name\n end\n result\n end",
"def create_section_with_http_info(name, section_name, slide_index, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.create_section ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.create_section\"\n end\n # verify the required parameter 'section_name' is set\n if @api_client.config.client_side_validation && section_name.nil?\n fail ArgumentError, \"Missing the required parameter 'section_name' when calling SlidesApi.create_section\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.create_section\"\n end\n # resource path\n local_var_path = '/slides/{name}/sections'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n\n # query parameters\n query_params = {}\n query_params[:'sectionName'] = @api_client.prepare_for_query(section_name) unless section_name.nil?\n query_params[:'slideIndex'] = @api_client.prepare_for_query(slide_index) unless slide_index.nil?\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'Sections')\n return data, status_code, headers\n end",
"def sections(form_state = nil)\n if form_state.nil?\n return :general\n else\n case form_state\n when :general\n puts \"Hello world now 1 in perfect method case latest\" \n\t { :title=>'General Info', :next=>:reviewers, :prev=>nil}\n when :coauthors\n {:title=>'Co-Authors', :next=>:reviewers, :prev=>:general}\n when :reviewers\n {:title=>'Reviewers', :next=>:fees, :prev=>:general}\n when :fees\n {:title=>'Fees', :next=>:checklist, :prev=>:reviewers}\n when :checklist\n {:title=>'Checklist', :next=>:nil, :prev=>:fees}\n \n when :review\n {:title=>'Review', :next=>nil, :prev=>:nil}\n end\n end\n end",
"def sections\n @sections ||= @account.sections\n end",
"def partial_html_sections\n unless (@@partial_update_sections)\n @@partial_update_sections = config_resolve_sections.find_all do |section|\n section[:partial_html_api] != false\n end\n end\n @@partial_update_sections\n end",
"def subsections\n return suite.sections.select do |sect|\n sect.parent_id == data.id\n end\n end",
"def calls_sitta options={}, &block\n\n options[:section] ? (section = options[:section]) : (section = \"body\")\n\n options[:name] ? (name = options[:name]) : (name = \"object\")\n\n if section.class.eql?(Array)\n\n section.each do |s|\n calls_sitta_set(s, name, (options[:block] || block))\n end\n\n else\n\n calls_sitta_set(section, name, (options[:block] || block))\n \n end\n\n end",
"def skel_section( path_storage, section_path )\n section_map = {}\n path_storage.all.each do |entry|\n dirs = entry.id.split( '/' )\n while ( dirs.pop; dirs.first )\n section = dirs.join( '/' )\n section_map[ section ] ||= []\n section_map[ section ] << entry\n end\n end\n section_map.each do |section, entries|\n page = Page.new( \"/#{ section }/index\" )\n page.updated = path_storage.last_updated( entries )\n yield :page => page, :entries => entries\n end\n end",
"def course_sections\n ['1', '2']\n end",
"def [](name)\n name = name.to_s\n each_section do |section|\n return section if section.name == name\n end\n nil\n end",
"def section_dyn_vals\n\t\tname_like = params[:q]\n\t\ttype = params[:type]\n\n\t\tsection = Section.find(params[:section_id])\n\t\tif type.eql?('subjects')\n\t\t\t@objects = Subject.by_section(section.id)\n\t\telsif type.eql?('tests')\n\t\t\t@objects = Test.by_section(section.id)\n\t\telsif type.eql?('students')\t\t\t\n\t\t\t@objects = Student.by_section(section.id).name_like(\"%#{params[:q]}%\")\t\t\t\n\t\t\t#Student.where(\"section_id =? and name like ?\", section.id, \"%#{params[:q]}%\")\n\t\tend\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @objects.map(&:attributes) }\n\t\tend\t\n\tend",
"def show\n \n begin\n @section = @account.sections.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n @section = @account.sections.find_by_name(params[:id]) \n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @section }\n end\n end",
"def section; end",
"def get_exam_sections(user_id, course_id, exam_id)\r\n get(Path::USERS_COURSES_EXAMS_SECTIONS % [user_id, course_id, exam_id])\r\n end",
"def send_overview(path)\n response = self.create_section_response\n public_section = DocumentSection.from_path(path, :include => \"Departments\")\n public_section.name = path.split(\"/\")[1]\n response[:sections] << public_section\n return response\n end",
"def sections\n @sections || [:backtrace, :request, :session, :environment]\n end",
"def section(name)\n self[section_index(name)]\n end",
"def method_missing(name, *args, &block)\n ## Note references are cached.\n ## To force a refresh on an already-cached reference,\n ## the method should be called with a single `true` parameter.\n ## (i.e. `#school` vs `#school(true)`)\n\n if @response.is_a? Hash\n ## Allow for acceess to response values via dot notation.\n return @response[name] if @response.key? name\n\n ## Allow for assignment to response values via dot notation.\n return @response.send(:'[]=', name[0...-1], *args, &block) if name.to_s.ends_with? '='\n\n ## Allow for simple access to referenced resources.\n if @client.present?\n @references ||= {}\n reference = @response[\"#{name}_reference\"].link.href rescue nil\n\n if reference.present?\n @references.delete(reference) if args[0] == true\n return @references[reference] ||= @client.get(reference)\n end\n end\n end\n\n ## All other unaccounted-for method calls should be delegated to the response Hash/Array.\n @response.send(name, *args, &block)\n end",
"def multi_page_response\n @multi_page_reponse ||= events_builder.multi_page_response\n rescue => e\n Rails.logger.error(e)\n Array.new\n end",
"def get_section(key)\n return {} unless @config.has_key? key\n\n section = @config[key]\n\n infos = {}\n infos[TITLE] = get_title(section)\n infos[SECTION] = get_unique_values(section)\n infos[SECTION].merge!(get_multiple_values(section))\n\n infos\n end",
"def view_all_sections \n @section = Section.find(:all)\n render_sections_xml(@section)\nend",
"def content_api_has_root_sections(slugs_or_sections)\n content_api_has_root_tags(\"section\", slugs_or_sections)\n end",
"def index\n @sections = @page.sections.sorted\n end",
"def parse_sections(nodes)\n return {} if nodes.blank?\n\n # Keep track of what section we're in\n section = nil\n nodes.each_with_object({}) do |node, out|\n # Set up a fresh NodeSet for the current section if we haven't yet\n out[section] ||= Nokogiri::XML::NodeSet.new(page)\n # These nodes have a content but it are invisible\n node.css('script, style, iframe').each(&:remove)\n\n # Process the node\n if node.name == 'h2' || node['class'] == 'normal_header'\n section = node.xpath('./text()').map(&:content).join.strip\n else\n out[section] << node\n end\n end\n end",
"def subsections\n Section.where(parent_id: id)\n end",
"def sections_for( page )\n titles_for( page ).zip( tables_for( page ) )\n end",
"def sections\n @data.keys\n end",
"def show\n @page = Page.find(params[:id])\n @section = @page.section\n\n respond_to do |format|\n format.html { render :template => 'sections/show' }\n format.xml { render :xml => @page }\n end\n end",
"def section(name)\n sections.find { |el| el.name == name.to_s }\n end",
"def index\n @sections = Section.all\n end",
"def index\n @sections = Section.all\n end",
"def index\n @sections = Section.all\n end",
"def index\n @sections = Section.all\n end",
"def index\n @sections = Section.all\n end",
"def index\n @sections = Section.all\n end",
"def index\n @sections = Section.all\n end",
"def render_rest_response(opts)\n if opts.to_s.downcase == 'getall'\n render_get_all\n elsif opts.to_s.downcase == 'get'\n render_get\n elsif opts.to_s.downcase == 'post'\n render_post\n elsif opts.to_s.downcase == 'put'\n render_put\n elsif opts.to_s.downcase == 'delete'\n render_delete\n elsif opts.to_s.downcase == 'error'\n render_error\n end\n end",
"def index\n # XXX: This is fragile, should be sorting on the block sort order.\n # Or better, there should be a section sort method.\n @sections = Section.order(:block_id)\n end",
"def list_sections_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiServicesFirewallApi.list_sections ...'\n end\n if @api_client.config.client_side_validation && opts[:'enforced_on'] && !['VIF', 'LOGICALROUTER', 'BRIDGEENDPOINT', 'DHCP_SERVICE', 'METADATA_PROXY', 'L2VPN_SESSION', 'NONE'].include?(opts[:'enforced_on'])\n fail ArgumentError, 'invalid value for \"enforced_on\", must be one of VIF, LOGICALROUTER, BRIDGEENDPOINT, DHCP_SERVICE, METADATA_PROXY, L2VPN_SESSION, NONE'\n end\n if @api_client.config.client_side_validation && opts[:'exclude_applied_to_type'] && !['NSGroup', 'LogicalSwitch', 'LogicalRouter', 'LogicalPort'].include?(opts[:'exclude_applied_to_type'])\n fail ArgumentError, 'invalid value for \"exclude_applied_to_type\", must be one of NSGroup, LogicalSwitch, LogicalRouter, LogicalPort'\n end\n if @api_client.config.client_side_validation && opts[:'filter_type'] && !['FILTER', 'SEARCH'].include?(opts[:'filter_type'])\n fail ArgumentError, 'invalid value for \"filter_type\", must be one of FILTER, SEARCH'\n end\n if @api_client.config.client_side_validation && opts[:'include_applied_to_type'] && !['NSGroup', 'LogicalSwitch', 'LogicalRouter', 'LogicalPort'].include?(opts[:'include_applied_to_type'])\n fail ArgumentError, 'invalid value for \"include_applied_to_type\", must be one of NSGroup, LogicalSwitch, LogicalRouter, LogicalPort'\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesFirewallApi.list_sections, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling ManagementPlaneApiServicesFirewallApi.list_sections, must be greater than or equal to 0.'\n end\n\n if @api_client.config.client_side_validation && opts[:'type'] && !['LAYER2', 'LAYER3'].include?(opts[:'type'])\n fail ArgumentError, 'invalid value for \"type\", must be one of LAYER2, LAYER3'\n end\n # resource path\n local_var_path = '/firewall/sections'\n\n # query parameters\n query_params = {}\n query_params[:'applied_tos'] = opts[:'applied_tos'] if !opts[:'applied_tos'].nil?\n query_params[:'context_profiles'] = opts[:'context_profiles'] if !opts[:'context_profiles'].nil?\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'deep_search'] = opts[:'deep_search'] if !opts[:'deep_search'].nil?\n query_params[:'destinations'] = opts[:'destinations'] if !opts[:'destinations'].nil?\n query_params[:'enforced_on'] = opts[:'enforced_on'] if !opts[:'enforced_on'].nil?\n query_params[:'exclude_applied_to_type'] = opts[:'exclude_applied_to_type'] if !opts[:'exclude_applied_to_type'].nil?\n query_params[:'extended_sources'] = opts[:'extended_sources'] if !opts[:'extended_sources'].nil?\n query_params[:'filter_type'] = opts[:'filter_type'] if !opts[:'filter_type'].nil?\n query_params[:'include_applied_to_type'] = opts[:'include_applied_to_type'] if !opts[:'include_applied_to_type'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'locked'] = opts[:'locked'] if !opts[:'locked'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'search_invalid_references'] = opts[:'search_invalid_references'] if !opts[:'search_invalid_references'].nil?\n query_params[:'search_scope'] = opts[:'search_scope'] if !opts[:'search_scope'].nil?\n query_params[:'services'] = opts[:'services'] if !opts[:'services'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n query_params[:'sources'] = opts[:'sources'] if !opts[:'sources'].nil?\n query_params[:'type'] = opts[:'type'] if !opts[:'type'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'FirewallSectionListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiServicesFirewallApi#list_sections\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @sections = Section.find(params[:id])\n end",
"def sections\n reply = @index.byte_num.keys\n if @index.has_queries?\n reply.push('queries')\n end\n reply.map(&:to_sym)\n end",
"def get_section(section_id)\n self.sections.find { |s| s.id == section_id }\n end"
] | [
"0.7123568",
"0.7123568",
"0.69484884",
"0.6750666",
"0.65884846",
"0.65809155",
"0.65092695",
"0.639382",
"0.6341351",
"0.62897414",
"0.6086768",
"0.604964",
"0.604964",
"0.6019376",
"0.60089743",
"0.5979822",
"0.5960345",
"0.5933253",
"0.5923285",
"0.5920057",
"0.58883077",
"0.5874666",
"0.5867179",
"0.58658934",
"0.5803729",
"0.58027565",
"0.5780326",
"0.5775712",
"0.5769741",
"0.5706503",
"0.5682499",
"0.5655989",
"0.5641082",
"0.56344897",
"0.5632304",
"0.56147546",
"0.5611425",
"0.55936766",
"0.5581383",
"0.5568006",
"0.55661935",
"0.5560845",
"0.55442756",
"0.55361176",
"0.55314535",
"0.5511612",
"0.55025387",
"0.5500397",
"0.5467963",
"0.54611725",
"0.5457392",
"0.5453397",
"0.543445",
"0.54098576",
"0.54052556",
"0.5402352",
"0.53880847",
"0.53880847",
"0.5376426",
"0.53661215",
"0.53559583",
"0.53558886",
"0.5354695",
"0.5345533",
"0.53449386",
"0.53411907",
"0.53404796",
"0.5338138",
"0.5323927",
"0.53197116",
"0.5315279",
"0.5314585",
"0.5307874",
"0.5293212",
"0.5279393",
"0.52791774",
"0.5278201",
"0.525979",
"0.52501374",
"0.5248102",
"0.5246321",
"0.5230322",
"0.5228994",
"0.5221351",
"0.52177817",
"0.52113664",
"0.52107424",
"0.52034676",
"0.52034676",
"0.52034676",
"0.52034676",
"0.52034676",
"0.52034676",
"0.52034676",
"0.52005917",
"0.51907116",
"0.51869696",
"0.516693",
"0.51576793",
"0.51522976"
] | 0.5997204 | 15 |
Friend.find_by(firstname:'Anna').first.keywords Friend.find_by(firstname:'Anna').keywords Friend.all_upcoming(14) ... working for all birthdays in the next fortnight | def upcoming?(num)
bday = self.birthday.strftime('%j').to_i
today = Date.today.strftime('%j').to_i
bday += 365 if bday < num+1
return ((bday - today >-1) && (bday - today <= num))
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def born_on_this_day_biographies\n @born_on_this_day ||= begin\n query_date = Date.today\n\n IntervieweeBiography.\n references(oral_history_content: :work).\n where(\"interviewee_biographies.json_attributes -> 'birth' ->> 'date' like '%-#{query_date.strftime(\"%m-%d\")}'\").\n where(oral_history_content: { kithe_models: { published: true}}).\n includes(oral_history_content: { work: :leaf_representative }).\n order(\"random()\").\n limit(3).\n to_a\n end\n end",
"def birthdaysearch\n end",
"def find_someday\n self.all(\n :completed_at => nil, \n :someday => true,\n :order => [:title])\n end",
"def feed\n Micropost.where(\"microposts.user_id in (?) AND location IS NOT NULL AND time IS NOT NULL AND (time > ? OR end_time > ?)\", self.friends, Time.current().beginning_of_day, Time.current().beginning_of_day).joins(\"INNER JOIN participations ON microposts.id = participations.micropost_id\").group(\"microposts.id\").having(\"count(*) > 1\").order(\"time ASC\")\n end",
"def actors_born_today\n date = Time.now.strftime(\"-%m-%d\")\n actors_birthday_query = %{\n PREFIX movie: <http://data.linkedmdb.org/resource/movie/>\n PREFIX dbo: <http://dbpedia.org/ontology/>\n PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>\n\n SELECT ?actorName\n WHERE {\n ?movie movie:actor ?actor .\n ?actor movie:actor_name ?name .\n SERVICE <http://dbpedia.org/sparql> {\n SELECT *\n WHERE {\n ?myActor a dbo:Person.\n ?myActor rdfs:label ?myActorName .\n ?myActor dbo:birthDate ?birthDate .\n FILTER(STR(?myActorName) = ?name)\n FILTER(REGEX(STR(?birthDate), \"#{date}\")).\n }\n }\n }\n }\n end",
"def upcoming_births\n @pregnant_participants = Participant.upcoming_births.select { |participant| participant.known_to_be_pregnant? }.sort_by { |e| e.due_date.to_s }\n end",
"def famous_birthdays\n birthdays = {\n 'Ludwig van Beethoven' => Date.new(1770,12,16),\n 'Dave Brubeck' => Date.new(1920,12,6),\n 'Buddy Holly' => Date.new(1936,9,7),\n 'Keith Richards' => Date.new(1943,12,18)\n }\n end",
"def get_meets\n Meet.where(\"date > ?\", Date.today - 1.year)\n end",
"def get_anniversary_date\n self.friends.partners(:p, :rel).posts(:post).where(receiver: self).where(\"post.message CONTAINS 'of'\").pluck(:rel).map(&:anniversary_date)\n end",
"def all_fav_foods(people)\n fav_foods = []\n for person in people\n fav_foods.concat(person[:favourites][:things_to_eat])\nend\nreturn fav_foods\nend",
"def test_should_find_upcoming_meetings\n meetings = Meeting.upcoming_meetings\n assert meetings.size > 0\n for meeting in meetings\n assert meeting.meets_on > Time.now.to_date\n end\n end",
"def get_by_freeword\n\t\tkey_word = params[:key_word]\n\t\tnext_start = params[:next_start]\n\t\tshops = Hotpepper.search_keyword(key_word, 15, next_start)\n\t\tset_to_results(shops)\n\t\t\n\t\t@key_word = key_word \t\n end",
"def find_followers\n bloodoath_cults = BloodOath.all.select do |bloodoath_instance|\n bloodoath_instance.cult == self \n end\n bloodoath_cults.map do |cult|\n cult.follower \n end\n end",
"def suggested_friends\n \tpeople_may_know_query = \"select r.follower_id, r.followed_id from Relationships r where r.follower_id in (select u1.id from Users u1, Relationships r1 where r1.follower_id = #{self.id} and r1.followed_id = u1.id and r1.friend_status = 'FRIENDS' and not u1.temp or r1.follower_id = u1.id and r1.followed_id = #{self.id} and r1.friend_status = 'FRIENDS') and r.followed_id != #{self.id} and r.followed_id not in (select u1.id from Users u1, Relationships r1 where r1.follower_id = #{self.id} and r1.followed_id = u1.id and r1.friend_status = 'FRIENDS' or r1.follower_id = u1.id and r1.followed_id = #{self.id} and r1.friend_status = 'FRIENDS') and r.friend_status = 'FRIENDS' or r.followed_id in (select u1.id from Users u1, Relationships r1 where r1.follower_id = #{self.id} and r1.followed_id = u1.id and r1.friend_status = 'FRIENDS' or r1.follower_id = u1.id and r1.followed_id = #{self.id} and r1.friend_status = 'FRIENDS') and r.follower_id != #{self.id} and r.follower_id not in (select u1.id from Users u1, Relationships r1 where r1.follower_id = #{self.id} and r1.followed_id = u1.id and r1.friend_status = 'FRIENDS' or r1.follower_id = u1.id and r1.followed_id = #{self.id} and r1.friend_status = 'FRIENDS') and r.friend_status = 'FRIENDS'\"\n \t\n \tpeople_may_know = ActiveRecord::Base.connection.execute(people_may_know_query)\n \tmutual_hash = {}\n \tpeople_may_know.each do |result|\n \t\t#Interface of result {\"follower_id\"=>value, \"followed_id\"=>value}\n \t\tfollower_id = result[\"follower_id\"].to_i\n \t\tfollowed_id = result[\"followed_id\"].to_i\n \t\t\n \t\tif self.friends?(User.find(follower_id)) && self.get_relationship(User.find(followed_id)).nil?\n \t\t\tif mutual_hash[followed_id].nil?\n \t\t\t\tmutual_hash[followed_id] = 1\n \t\t\telsif\n \t\t\t\tmutual_hash[followed_id] += 1\n \t\t\tend\n \t\telse self.friends?(User.find(followed_id)) && self.get_relationship(User.find(follower_id)).nil?\n \t\t\tif mutual_hash[follower_id].nil?\n \t\t\t\tmutual_hash[follower_id] = 1\n \t\t\telsif\n \t\t\t\tmutual_hash[follower_id] += 1\n \t\t\tend\n \t\tend\n \tend\n \tmutual_array = mutual_hash.sort.reverse\n \t\n \tmutual_users = []\n \tmutual_array.each do |keyvalue|\n \t\tmutual_users << User.find(keyvalue[0]) if keyvalue[1] > 1\n \tend\n \t\n \treturn mutual_users\n end",
"def RecentActivity\n @followings = Follwing.where(:kite_id => kites.select(\"id\"), :Type => \"like\").order(\"created_at DESC\").take(5)\n @comments = Comment.where(:kite_id => kites.select(\"id\")).order(\"created_at DESC\").take(5)\n return (@followings + @comments).sort_by(&:created_at)\n end",
"def search\n\tdob=current_user.date_of_birth\n\tstart_date=Date.civil(dob.year+params[:search][:younger].to_i,dob.month,dob.day)\n\tend_date=Date.civil(dob.year-params[:search][:older].to_i,dob.month,dob.day)\n\t@user=User.where([\"(date_of_birth <= ? and date_of_birth>=?)\",start_date,end_date])\n end",
"def leading_star_for_1962_films\n MovieDatabase.execute(<<-SQL)\n SELECT\n m.title, a.name\n FROM\n movie m\n JOIN \n casting c ON m.id = c.movieid\n JOIN\n actor a ON a.id = c.actorid\n WHERE\n m.yr = 1962 AND c.ord = 1\n ORDER BY\n m.title;\nSQL\nend",
"def old_films_and_their_star\n MovieDatabase.execute(<<-SQL)\n SELECT\n movies.title, actors.name AS star\n FROM\n movies\n JOIN actors ON castings.actor_id = actors.id\n JOIN castings ON castings.movie_id = movies.id\n WHERE\n movies.yr >= 1906\n AND\n movies.yr <= 1908\n AND\n castings.ord = 1 \n ORDER BY\n movies.title \nSQL\nend",
"def retrieve_synonyms(country = nil, age_from = nil, age_to = nil, \n gender = nil, education = nil, is_formal = nil)\n return [], {} if !self.approved\n\n keyword_id = self.id\n\n filtered_data = Gamer\n filtered_data = filtered_data\n .filter_by_country(country) unless country.blank?\n filtered_data = filtered_data\n .filter_by_dob(age_from,age_to) unless age_from.blank? || age_to.blank?\n filtered_data = filtered_data\n .filter_by_gender(gender) unless gender.blank?\n filtered_data = filtered_data\n .filter_by_education(education) unless education.blank?\n filtered_data = filtered_data.joins(:synonyms)\n filtered_data = filtered_data\n .where(synonyms: { keyword_id: keyword_id, approved: true })\n\n votes_count = filtered_data.count(group: \"synonyms.id\")\n\n synonym_list = []\n filtered_data.each { |gamer| synonym_list += gamer.synonyms\n .where(keyword_id: keyword_id, approved: true) }\n synonym_list.uniq!\n\n synonym_list = synonym_list\n .reject { |synonym| synonym.is_formal != is_formal } if is_formal != nil\n\n synonym_list = synonym_list.sort_by { |synonym| votes_count[synonym.id] }\n .reverse!\n\n synonyms_with_no_votes = self.synonyms\n .where(synonyms: { approved: true }) - synonym_list\n synonyms_with_no_votes\n .reject! { |synonym| synonym.is_formal != is_formal } unless is_formal == nil\n synonym_list = synonym_list + synonyms_with_no_votes\n\n [synonym_list, votes_count]\n end",
"def all_potential_meetings\n meetings = []\n day_meetings.each do |day|\n @timeline_week_count.times do |wk|\n meetings << (@beginning_of_first_week + wk.weeks).date_of_upcoming(day)\n end\n end\n meetings.sort\n end",
"def follow(user)\n client.search(\"#bonjour_monde\", result_type: \"recent\").take(20).collect.each {|name| client.follow(name.user.screen_name)}\nend",
"def leading_star_for_1962_films\n MovieDatabase.execute(<<-SQL)\n SELECT movies.title, actors.name\n FROM movies\n JOIN castings on movies.id = castings.movie_id\n JOIN actors on actors.id = castings.actor_id\n WHERE movies.yr = 1962 AND castings.ord = 1\n ORDER BY movies.title\nSQL\nend",
"def get_data_words_every_week_social\n\n # Append user string \n data_string = \"-1\"\n data_string = data_string + \"|\" + get_data_words_every_week\n\n # Append friend strings\n #invites.find( :all, :conditions => { :host_user => id } ).each do |invite|\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active )\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + \"-1\" + \"|\" + friend.get_data_words_every_week\n end\n \n end\n\n return data_string\nend",
"def leading_star_for_1943_films\n MovieDatabase.execute(<<-SQL)\n SELECT\n title, name\n FROM\n actors\n JOIN\n castings ON castings.actor_id = actors.id\n JOIN\n movies ON castings.movie_id = movies.id\n WHERE \n yr = 1943 AND ord = 1\n ORDER BY\n name;\n SQL\nend",
"def events_friends_attending\nfriend_uids = self.friends.pluck(:uid)\nevents_attending = Attendance.where(:user_uid => friend_uids)\nevent_id = events_attending.pluck(:event_id)\nreturn Event.where(:id => event_id)\nend",
"def all_foods(people)\n all_foods = []\n for person in people\n all_foods.concat(person[:favourites][:things_to_eat])\n end\n return all_foods\nend",
"def my_followers_mottos \n BloodOath.all.map{|bloodoath|bloodoath.follower.life_motto}\n end",
"def todays_likes\n dayEnd = DateTime.now.beginning_of_day\n dayStart = dayEnd - 1.day\n\n likes.where(\"likes.created_at > ? and likes.created_at < ?\", dayStart, dayEnd)\n end",
"def search\n @query = params[:q]\n @ads = Ad.within(@city, 30)\n @ads = @ads.fulltext_search(@query).group_by { |x| x.created_at.to_date }\n end",
"def search_festival_database(list_festival_name, year)\n # try to find festival's in database for each name\n list_festival_name.each do |festival_name|\n festival = Festival.find_one_by_name_and_year(\n festival_name.tr('-', ' '),\n festival_name, year\n )\n if festival\n @festival = festival\n break\n end\n end\n end",
"def client_tasks_upcoming\n today = Time.zone.now\n self.find_all {|e| (e.completed.nil? or !e.completed) and (e.complete_by >= today and e.complete_by <= (today + 6.days)) }\n end",
"def setup_invites_for_upcoming\n if( @upcoming_near_me.blank? )\n @upcoming_near_me = Invitation.search \"#{@current_city} #{@current_state} #{@current_country}\",:with => {:start_date => Time.now.utc..Time.now.utc.advance(:days => 1000),:is_public => 1,:deactivated => 0}, :without => {:purpose_id => 19}, :order => :id, :sort_mode => :desc\n #~ @upcoming_near_me = LookUp::meetings_for_upcoming_on_user_home(:city => @current_city, :state => @current_state, :country => @current_country) \n @invites_for_map = LookUp::invites_for_map_on_user_home(@upcoming_near_me.map(&:id))\n end\n end",
"def my_followers\n Bloodoath.all.select {|bloodoath| bloodoath.cult == self}\n end",
"def find_people_I_want_to_meet\n find_my_teachers & find_my_students\n end",
"def happy_birthday(kids)\n kids.each { |k, v| puts \"Happy Birthday #{k}! You are now #{v} years old!\" }\nend",
"def famous_birthdays # This example is to illustrate what a hash is\n birthdays = {\n 'Ludwig Van Beethoven' => Date.new(1770, 12, 16),\n 'Dave Brubeck' => Date.new(1920, 12, 6),\n 'Buddy Holly' => Date.new(1936, 9, 7),\n 'Keith Richards' => Date.new(1943, 12, 18) \n }\n end",
"def kent_supporting_actor_films\n MovieDatabase.execute(<<-SQL)\n SELECT \n movies.title,\n actors.name\n FROM\n movies\n INNER JOIN\n castings ON movies.id = castings.movie_id\n INNER JOIN \n actors ON castings.actor_id = actors.id\n WHERE \n actors.name LIKE '% Kent'AND castings.ord != 1\n ORDER BY movies.title;\n SQL\nend",
"def blood_oaths\n BloodOath.all.select do |blood_oath|\n blood_oath.follower == self\n end\n end",
"def feed\n #get all the user_ids the current_user are following\n following_ids = \"SELECT followed_id FROM relationships WHERE follower_id = :user_id\"\n\n #and then get all of the microposts correspoding to those user_ids, including the current_users's\n Micropost.where(\"user_id IN (#{following_ids}) OR user_id = :user_id\", user_id: id)\n end",
"def awake_overnights\n\t\tPerson.find(:all,\n\t\t\t\t\t\t\t\t:conditions => \"people.position = 'Awake Overnight' AND house_id = #{self.id}\", \n\t\t\t\t\t\t\t\t:joins => :houses, \n\t\t\t\t\t\t\t\t:order => \"last_name, first_name ASC\")\n\tend",
"def events_that_are_available_to_me\nevents_i_can_see = []\nevents_i_can_see = events_i_can_see + self.events_friends_attending.pluck(:id)\nevents_i_can_see = events_i_can_see + self.events_friends_created.pluck(:id)\nreturn Event.where(:id => events_i_can_see)\nend",
"def search(live=false)\n doctor = nil\n user = nil\n patient = nil\n date = nil\n\n doctor = \"%\" + params[:doctor_field] + \"%\" if !params[:doctor_field].nil? and params[:doctor_field].length > 0\n user = \"%\" + params[:user_field] + \"%\" if !params[:user_field].nil? and params[:user_field].length > 0\n patient = \"%\" + params[:patient_field] + \"%\" if !params[:patient_field].nil? and params[:patient_field].length > 0\n date = (!params[:Time][:tomorrow].nil? and params[:Time][:tomorrow].length > 0) ? params[:Time][:tomorrow] : Time.tomorrow\n#Learn how to handle Dates in rails' forms\n # date = params[:date_field].nil? ? Date.new. : params[:date_field]\n\n# logger.error \"D: #{doctor}/#{params[:doctor_field]}; U: #{user}/#{params[:user_field]}; P: #{patient}/#{params[:patient_field]}; T: #{date}/#{params[:Time][:now]}\\n\"\n\n tables = ['form_instances']\n tables.push('doctors') unless doctor.nil?\n tables.push('users') unless user.nil?\n tables.push('patients') unless patient.nil?\n\n matches = ['form_instances.status_number=4 AND form_instances.created_at < :date'] #Put the date field in first by default - there will always be a date to search for.\n matches.push('form_instances.doctor_id=doctors.id') unless doctor.nil?\n matches.push('form_instances.user_id=users.id') unless user.nil?\n matches.push('form_instances.patient_id=patients.id') unless patient.nil?\n matches.push('doctors.friendly_name LIKE :doctor') unless doctor.nil?\n matches.push('users.friendly_name LIKE :user') unless user.nil?\n matches.push('(patients.first_name LIKE :patient OR patients.last_name LIKE :patient OR patients.account_number LIKE :patient OR patients.address LIKE :patient)') unless patient.nil?\n\n @form_values = {:Time => {:tomorrow => date}} #put the date field in first by default - there will always be a date to search for.\n @values = {:date => date}\n @form_values.merge!({:doctor_field => params[:doctor_field]}) unless doctor.nil?\n @values.merge!({:doctor => doctor}) unless doctor.nil?\n @form_values.merge!({:user_field => params[:user_field]}) unless user.nil?\n @values.merge!({:user => user}) unless user.nil?\n @form_values.merge!({:patient_field => params[:patient_field]}) unless patient.nil?\n @values.merge!({:patient => patient}) unless patient.nil?\n\n# SELECT form_instances.* FROM form_instances,doctors,users,patients WHERE form_instances.doctor_id=doctors.id AND form_instances.user_id=users.id AND form_instances.patient_id=patients.id AND doctors.friendly_name LIKE :doctor AND users.friendly_name LIKE :user AND (patients.first_name LIKE :patient OR patients.last_name LIKE :patient OR patients.account_number LIKE :patient OR patients.address LIKE :patient)\n\n @result_pages, @results = paginate_by_sql(FormInstance, [\"SELECT form_instances.* FROM \" + tables.join(',') + \" WHERE \" + matches.join(' AND ') + \" ORDER BY form_instances.created_at DESC\", @values], 30, options={})\n @search_entity = @results.length == 1 ? \"Archived Form\" : \"Archived Forms\"\n render :layout => false\n end",
"def get_festivals() \n #Start from 3 days ago since can be in the middle of a festival\n threeDaysAgo = (Time.now - (3*24*60*60)).strftime('%Y-%m-%d')\n #Find relevant events\n events = Event.where(festival: 1).where('date >= ?', threeDaysAgo).order(:date)\n\n #Make hash of hashes that include all necessary info\n festivalDatesArr = {}\n events.each do |event|\n #Need to account for same name different locations\n name = \"#{event.title} #{event.location}\"\n if festivalDatesArr.has_key?(name)\n festivalDatesArr[name]['dates'].push(event.date) \n else\n festName = \"#{event.title} #{event.location}\"\n festivalDatesArr[festName] = {\n 'dates' => [event.date],\n 'id' => event.id,\n 'title' => event.title,\n 'location' => event.location,\n 'ages' => event.ages,\n 'link' => event.ticketLink,\n 'address' => event.address\n }\n end\n end\n return festivalDatesArr\n end",
"def followers\n BloodOath.all.select {|cult| cult.cult == self}\n end",
"def upcoming_events\n events.where(\"date > ?\", Time.now)\n end",
"def feed\n\t\t@goths = Goth.find(:all, :conditions => 'published_at IS NOT NULL', :limit => 10, :order => 'published_at DESC')\n\tend",
"def get_data_words_this_week_social\n\n # Append user string \n data_string = \"-1\"\n data_string = data_string + \"|\" + get_data_words_this_week\n\n # Append friend strings\n #invites.find( :all, :conditions => { :host_user => id } ).each do |invite|\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active)\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + \"-1\" + \"|\" + friend.get_data_words_this_week\n end\n \n end\n\n return data_string\nend",
"def upcoming_meetings(content, opts = {})\n cutoff = opts[:cutoff] || Time.now\n\n doc = Nokogiri::XML(content)\n\n meetings = {}\n\n doc.xpath(\"//item\").each do |item|\n\n # \"Austin City Council - 1/13/2011 10:00 AM\"\n title = item.xpath(\"title\").inner_text\n m = title.match(/(.*) - (.*)/)\n group = m[1]\n meeting_time = Time.strptime(m[2], \"%m/%d/%Y %I:%M %p\")\n\n # Consider only future meetings.\n next unless meeting_time > cutoff\n\n # There are some weird far future meetings in the feed.\n # Cut off stuff more than a year out.\n next if meeting_time > cutoff + (365*24*60*60)\n\n # \"https://austin.siretechnologies.com/sirepub/mtgviewer.aspx?meetid=576&doctype=AGENDA\"\n link = item.xpath(\"link\").inner_text\n m = link.match(/meetid=([\\d]+)/)\n meetid = m[1].to_i\n\n pubdate = Time.parse(item.xpath(\"pubDate\").inner_text)\n\n meetings[meetid] = SireAgenda::Meeting.new(meetid,\n :group => group,\n :meeting_time => meeting_time,\n :last_changed => pubdate,\n :sire => self,\n )\n\n end\n\n meetings\n end",
"def NewKites(time_range)\n return Kite.where(:CreateDate => time_range)\n end",
"def index\n # start_day = DateTime.now.prev_month\n # populars = Like.where(\"created_at > ?\", start_day).group(:feed_id).order(\"count_feed_id desc\").count(:feed_id)\n \n search_start_time = (DateTime.now - 1).utc\n populars = Like.where(\"created_at > ?\", search_start_time).group(:feed_id).order(\"count_feed_id desc\").count(:feed_id)\n \n feed_ids = populars.keys\n # @populars = Feed.find(feed_ids)\n @populars = Feed.where(id: feed_ids).where(\"created_at > ?\", search_start_time)\n end",
"def my\n open_season_ids = Season.is_not_ended.select(:id).map{|s| s.id }\n\n # Why refine? If user tags a meeting out form his affikliation it should be shown\n browsable_season_ids = open_season_ids\n # Refine the list of open seasons:\n #browsable_season_ids = open_season_ids.select{ |season_id|\n # ! current_user.find_team_affiliation_id_from_badges_for( season_id ).nil?\n #} + open_season_ids.select{ |season_id|\n # ! current_user.find_team_affiliation_id_from_team_managers_for( season_id ).nil?\n #}\n #browsable_season_ids.uniq!\n\n # Extract the user-tagged browsable meetings:\n meeting_id_list = Meeting\n .where( \"meetings.season_id IN (?)\", browsable_season_ids )\n .tagged_with( \"u#{ current_user.id }\", on: :tags_by_users )\n .select( :id, :season_id )\n .map{ |meeting| meeting.id }\n\n # If user has an associated swimmer look for team tagged and attended meetings too\n if current_user.has_associated_swimmer?\n # Add also the team-tagged browsable meetings.\n # Find the current, browsable team affiliations that may have tagged the meetings,\n # and, for each, add any tagged meeting found to the list:\n browsable_season_ids\n .map{ |season_id| current_user.find_team_affiliation_id_from_badges_for(season_id) }\n .compact.each do |tagger_team_affiliation_id|\n meeting_id_list += Meeting\n .where( [\"meetings.season_id IN (?)\", browsable_season_ids] )\n .tagged_with( \"ta#{ tagger_team_affiliation_id }\", on: :tags_by_teams )\n .select( :id, :season_id )\n .map{ |meeting| meeting.id }\n end\n\n # .where( [\"meetings.id not in (?) and meetings.season_id IN (?)\", meeting_id_list, browsable_season_ids] )\n\n # Add also any already attended and closed meeting belonging to the browsable\n # seasons: (the relationship w/ swimmer is through MIRs, so the inner join is enough)\n meeting_id_list += current_user.swimmer.meetings\n .where( [\"meetings.season_id IN (?)\", browsable_season_ids] )\n .select( :id, :season_id )\n .map{ |meeting| meeting.id }\n end\n\n# .where( [\"meetings.id not in (?) and meetings.season_id IN (?)\", meeting_id_list, browsable_season_ids] )\n\n @calendarMeetingPicker = CalendarMeetingPicker.new( nil, nil, nil, meeting_id_list.uniq! )\n @calendarDAO = @calendarMeetingPicker.pick_meetings( 'DESC', false, current_user )\n @meetings = @calendarDAO.get_meetings\n\n end",
"def get_my_words\n # Words associated with online harassment\n trigger_words = [\"rape\",\"murder\",\"nigger\",\"slut\",\"whore\",\"bitch\",\"cunt\",\"kill\",\"die\",\"testword\"]\n my_words = Word.where(user_id: self.id)\n my_words.each do |word|\n trigger_words << word.word\n end\n return trigger_words\n end",
"def gettag()\n omnifocus.tags.get.each do |tagg|\n\t tagg.tags.get.each do |t|\n\t\t\t if t.name.get == \"Today\" \n\t\t\t\t return t\n\t\t\t end\n\t\t end \n\n end\n\n end",
"def december_birthdays\n born_in_december = [ ]\n# each method goes through every name in the hash below... why is it able to run if the hash has not yet been defined? \n famous_birthdays.each do |name, date|\n if date.month == 12\n born_in_december << name\n end\n end\n born_in_december\n end",
"def get_data_words_each_week_social\n\n # Append user string \n data_string = \"-1\"\n data_string = data_string + \"|\" + get_data_words_each_week\n\n # Append friend strings\n #invites.find( :all, :conditions => { :host_user => id } ).each do |invite|\n Invite.find( :all, :conditions => { :host_user => id } ).each do |invite|\n \n if( invite.accepted && invite.active )\n #friend = invite.users[0]\n friend = User.find( invite.target_user )\n data_string = data_string + \"|\" + \"-1\" + \"|\" + friend.get_data_words_each_week\n end\n \n end\n \n return data_string\nend",
"def get_possible_meetings( query )\n meetings = MeetingFinder.new( params[:query] ).search()\n meetings.each do |meeting|\n @result << {\n class: 'Meeting',\n id: meeting.id,\n description: meeting.get_scheduled_date_with_verbose_name,\n date: meeting.get_scheduled_date ? meeting.get_scheduled_date : meeting.header_date\n }\n end\n meetings\n end",
"def get_by_freeword\n\t\tkey_word = params[:key_word]\n\t\tnext_start = params[:next_start]\n\t\tshops = Hotpepper.search_keyword(key_word, 15, next_start)\n\t\t@results_available = shops.attributes['results_available']\n\t\t@results_start = shops.attributes['results_start']\n\t\t@results_returned = shops.attributes['results_returned']\n\t\t@next_start = get_next_start\n\n\t\t@shops = shops.attributes['shop']\n\t\t@key_word = key_word \t\n end",
"def get_upcoming\n\t\taction = \"discover/movie\"\n\t\ttoday = Date.today.to_s\n\t\tnext_month = Date.today.advance(:months => 1).to_s\n\t\targument = \"&include_adult=false&primary_release_date.gte=\" + today + \"&primary_release_date.lte=\" + next_month\n\t\tresponse = call_api(action, argument)\n\t\tmovies = process_results(response[\"results\"])\n\tend",
"def last_sick_mention_count\n @range_center = Date.today\n twenty_four_hour_count = Mention.find(:all, :select => \"DATE(mentioned_at) as mentioned_at_date, mentioned_at, substring_index(mentioner, ' (', 1) as mentioner_stripped, mentioner, link, exact_location\", :group => 'mentioner_stripped, mentioned_at_date', :conditions => {:city_id => self.id, :mentioned_at => (\"#{@range_center.year}-#{@range_center.month.to_s.rjust(2, '0')}-#{@range_center.day.to_s.rjust(2, '0')} 00:00\"..\"#{@range_center.year}-#{@range_center.month.to_s.rjust(2, '0')}-#{@range_center.day.to_s.rjust(2, '0')} 23:59\")})\n twenty_four_hour_count.length\n end",
"def my_followers_mottos\n Bloodoath.all.each do |bloodoath|\n if bloodoath.cult == self\n puts bloodoath.follower.life_motto\n end\n end\n end",
"def next_birthday\n Date.distance_to(self.date_of_birth)\n \tend",
"def eighties_b_movies\n # List all the movies from 1980-1989 with scores falling between\n # 3 and 5 (inclusive).\n # Show the id, title, year, and score.\n Movie.select(:id, :title, :yr, :score).where(score: 3..5, yr: 1980..1989)\nend",
"def my_followers\n cult_blood_oaths = BloodOath.all.select {|b_o_instance| b_o_instance.cult == self}\n cult_followers = cult_blood_oaths.map {|b_o_instance| b_o_instance.follower}\n cult_followers.uniq\n end",
"def getUserFriendList(user, usersDatabase)\r\n puts \"#{user.fullName} have #{user.friendList.length} friend(s)\"\r\n user.friendList.each do |friendId|\r\n usersDatabase.each do |user|\r\n if user.id == friendId\r\n puts user.fullName\r\n end\r\n end\r\n end\r\n puts\r\nend",
"def events_friends_created\nfriend_uids = self.friends.pluck(:uid)\nreturn Event.where(:creator_uid => friend_uids)\nend",
"def cults_helper\n Bloodoath.all.select { |bloodoath| bloodoath.follower == self}\n end",
"def in_hot_list\n where(:added_to_hot_list.gte => 4.days.ago.utc)\n end",
"def imported_events\n# ImportedEvent.new.search(summary)\n ImportedEvent.find_by_term_and_date(summary,date)\n end",
"def search(live=false)\n user = nil\n patient = nil\n date = nil\n\n user = \"%\" + params[:user_field] + \"%\" if !params[:user_field].nil? and params[:user_field].length > 0\n patient = \"%\" + params[:patient_field] + \"%\" if !params[:patient_field].nil? and params[:patient_field].length > 0\n date = (!params[:Time][:tomorrow].nil? and params[:Time][:tomorrow].length > 0) ? params[:Time][:tomorrow] : Time.tomorrow\n #Learn how to handle Dates in rails' forms\n # date = params[:date_field].nil? ? Date.new. : params[:date_field]\n\n # logger.error \"D: #{doctor}/#{params[:doctor_field]}; U: #{user}/#{params[:user_field]}; P: #{patient}/#{params[:patient_field]}; T: #{date}/#{params[:Time][:now]}\\n\"\n\n tables = ['form_instances']\n tables.push('users') unless user.nil?\n tables.push('patients') unless patient.nil?\n\n matches = [\"form_instances.doctor_id=:doctor_id AND form_instances.status_number=4 AND form_instances.created_at < :date\"] #Put the date field in first by default - there will always be a date to search for.\n matches.push('form_instances.user_id=users.id') unless user.nil?\n matches.push('form_instances.patient_id=patients.id') unless patient.nil?\n matches.push('users.friendly_name LIKE :user') unless user.nil?\n matches.push('(patients.first_name LIKE :patient OR patients.last_name LIKE :patient OR patients.account_number LIKE :patient OR patients.address LIKE :patient)') unless patient.nil?\n\n @form_values = {:Time => {:tomorrow => date}} #put the date field in first by default - there will always be a date to search for.\n @values = {:date => date, :doctor_id => current_doctor.id}\n @form_values.merge!({:user_field => params[:user_field]}) unless user.nil?\n @values.merge!({:user => user}) unless user.nil?\n @form_values.merge!({:patient_field => params[:patient_field]}) unless patient.nil?\n @values.merge!({:patient => patient}) unless patient.nil?\n\n # SELECT form_instances.* FROM form_instances,doctors,users,patients WHERE form_instances.doctor_id=doctors.id AND form_instances.user_id=users.id AND form_instances.patient_id=patients.id AND doctors.friendly_name LIKE :doctor AND users.friendly_name LIKE :user AND (patients.first_name LIKE :patient OR patients.last_name LIKE :patient OR patients.account_number LIKE :patient OR patients.address LIKE :patient)\n\n @result_pages, @results = paginate_by_sql(FormInstance, [\"SELECT form_instances.* FROM \" + tables.join(',') + \" WHERE \" + matches.join(' AND ') + \" ORDER BY form_instances.created_at DESC\", @values], 30, options={})\n @search_entity = @results.length == 1 ? \"Archived Form\" : \"Archived Forms\"\n render :layout => false\n end",
"def your_birthday_is_on_a_friday_in_the_year(birthday)\n while birthday.friday? == false\n birthday += (60 * 60 * 24 * 365)\n end\n birthday.year\n # rspec was after a year, but the question was asking for a day\n # not the clearest of questions. Should state \"someones\" bday, not\n # the users\nend",
"def user_news_by_date\n end",
"def search_for(term)\n results = Friendship.find_by_sql(query(term))\n\n results.map do |result|\n members = Member.where(id: result.path).order(\"array_position(array[#{result.path.join(',')}]::bigint[], members.id)\")\n members.map(&:full_name).join('->')\n end\n end",
"def search_result\n freelancers = find_all FREELANCERS\n end",
"def show\n your_friend_ids = current_user.friends.established.pluck(:to_id) + # 自分から申請して友だちになったやつ\n User.joins(:friends) # 申請を受け入れて友達になったやつ\n .where(friends: { to_id: current_user.id, establish: true })\n .pluck(:user_id)\n @your_friends = User.where(id: your_friend_ids).order(:name)\n @users_wanting_to_become_friend_with_you = User.joins(:friends)\n .where(friends: { to_id: current_user.id, establish: false })\n .order(:name)\n end",
"def get_all_entries\n @feed_entries = FeedEntry.find(:all, :conditions => { :person_id => self.id}, :order => 'published_at DESC')\n end",
"def getFeaturedPastEvents\n @es = Event.where(private: false).where(\"date < ?\", Date.today).order(date: :desc)\n @f = @es.sort_by{ |e| [e.attendings.count, e.comments.count] }.reverse.take(3)\n return @f\n end",
"def pahths_feed\n # temporary future should have smart way of suggesting pahths for user\n Pahth.all\n end",
"def happy_birthday(birthday_kids)\n # add your code snippet here!\n birthday_kids.each do |kids_name, age|\n puts \"Happy Birthday #{kids_name}! You are now #{age} years old!\"\n end\nend",
"def my_followers_motto\n my_followers.collect {|bloodoath| bloodoath.follower.life_motto}\n end",
"def names_of_people_who_took_french(results_set)\nend",
"def nicknames_in(start_date:, end_date:)\n nicknames.where(updated_at: start_date..end_date).order(:name)\n end",
"def search_meetup(url)\n MeetupScraper::Scraper.fetch_meetup_list(url)\n end",
"def index\n @birthday_parties = BirthdayParty.includes(cake: :item).order(birth_day: :desc)\n .page(params[:page])\n .per(params[:per])\n end",
"def visible_families\n # right now the count is the number of species\n TaxonName.find_by_sql(\n \"SELECT p.*, count(*) as count FROM \n (SELECT * FROM taxon_names t WHERE t.iczn_group = 'family' AND RIGHT(t.name,4) = 'idae') AS p\n LEFT JOIN \n (SELECT id, l, r FROM taxon_names t2 WHERE #{self.sql_for_taxon_names('t2', :public)} AND iczn_group = 'species') AS c \n ON p.l < c.l AND p.r > c.r\n WHERE c.id IS NOT NULL \n GROUP BY p.id ORDER BY name\") \n end",
"def worlize_friends\n User.where(:guid => self.worlize_friend_guids)\n end",
"def blood_oaths\n # First, get all of the blood oaths and then from them, select only the ones that belong to this follower\n BloodOath.all.select { |blood_oath| blood_oath.follower == self }\n end",
"def search_all\n users = User.where([\"name LIKE ?\", \"%#{keywords}%\"])\n end",
"def feed(params = nil)\n #binding.pry\n if (params)\n Micropost.from_users_followed_by(self, search_word: params[:search_word])\n else\n Micropost.from_users_followed_by(self)\n end\n end",
"def upcoming_events\n attended_events.where('date >= :current_date AND accepted',\n current_date: DateTime.now)\n end",
"def fellow_cult_members\n # we want a list of followers, so SELECT is a good tool\n # .any? will return true or false if ANY elements return true for the block\n # .include? will see if an array includes a given element\n Follower.all.select do |follower|\n follower != self && follower.cults.any? do |cult|\n self.cults.include?(cult)\n end\n end\n end",
"def who_is_florence_lawrence\n MovieDatabase.execute(<<-SQL)\n select movie.title, actor.name\n from movie\n join casting on movie.id = casting.movieid\n join actor on casting.actorid = actor.id\n where movie.yr = 1908 and ord = 1\n order by movie.title\n SQL\nend",
"def favorite(client)\n\tensemble = client.search(\"#bonjour_monde\", result_type: \"recent\").take(25)\n#\tensemble.each do |tweet|\n\t\tclient.favorite(ensemble)\n#\tend\nend",
"def show_recent_posts(keyword, hours = 4)\n\tclient = Twitter::REST::Client.new(TWITTER)\n\tputs past = Time.now - (60*60*hours)\n\ttweets = Array.new\n\tclient.search(keyword).each do |tweet|\n\t\tif tweet.created_at >= past\n\t\t\tp tweet.created_at.class.name\n\t\t\ttweets.push timestamp: tweet.created_at, retweet_count: tweet.retweet_count, favorite_count: tweet.favorite_count, url: tweet.uri.to_s, text: tweet.text\n\t\telse\n\t\t\treturn tweets\n\t\tend\n\tend\nend",
"def find_show_buddies(people)\n\n tv_shows = []\n\n for person in people\n tv_shows.push(person[:favourites][:tv_show])\n end\n\n same_show = []\n count = 0\n\n for show in tv_shows\n if tv_shows.count(show) > 1\n same_show.push(count)\n end\n count += 1\n end\n\n show_buddies = []\n\n for index in same_show\n show_buddies.push(people[index][:name])\n end\n\n return show_buddies\nend",
"def future_events\n instances = []\n Event.where(place: self).each do |e|\n instances << e.occurrences.where(date: Date.current..2.weeks.from_now)\n end\n instances.flatten!.sort_by(&:date) unless instances.empty?\n end",
"def friends_activities\n Activity.includes(:user, :intensity, :exercise_unit, :exercise_type).includes(:comments => [:user]).includes(:cheers => [:user]).where(:user_id => [self.friends.ids]).order(date: :desc)\n end",
"def search(date_str)\n doc = get_page_results\n rows = get_todays_rows(doc, date_str)\n # to get the relevant links\n regex = /puppy|pup|Pup|dog|Dog/\n results = filter_links(rows, regex)\nend",
"def feed\n\t\t#pulls all microposts from all the following ids..inefficient\n\t\t#Micropost.where(\"user_id IN (?) OR user_id = ?\", following_ids, id)\n\t\tfollowing_ids = \"SELECT followed_id FROM relationships where follower_id = :user_id\"\n\t\tMicropost.where(\"user_id IN (#{ following_ids}) OR user_id = :user_id\", following_ids: following_ids, user_id: id)\n\tend",
"def tenders_ultimate(start, num, day)\n\nend",
"def your_birthday_is_on_a_friday_in_the_year(birthday)\nend",
"def your_birthday_is_on_a_friday_in_the_year(birthday)\nend"
] | [
"0.6405188",
"0.60113406",
"0.58367825",
"0.57186645",
"0.5659354",
"0.56530124",
"0.5631182",
"0.54510725",
"0.5449537",
"0.5425547",
"0.5408361",
"0.5389542",
"0.5363316",
"0.5349892",
"0.53116506",
"0.5292001",
"0.5291157",
"0.52749234",
"0.52691394",
"0.523764",
"0.5237204",
"0.5228247",
"0.5192633",
"0.5192601",
"0.5191091",
"0.5182882",
"0.517894",
"0.51492953",
"0.51434493",
"0.51408046",
"0.51398414",
"0.513361",
"0.51241606",
"0.5123178",
"0.50964487",
"0.5096161",
"0.5093989",
"0.5091819",
"0.50850856",
"0.50739175",
"0.5069856",
"0.5062435",
"0.50617105",
"0.5052754",
"0.5047859",
"0.50455636",
"0.5044622",
"0.5026149",
"0.50252926",
"0.50243086",
"0.5018131",
"0.50161403",
"0.50130725",
"0.5010857",
"0.5009164",
"0.5008012",
"0.5007269",
"0.5005393",
"0.5000411",
"0.49923292",
"0.49731293",
"0.4965837",
"0.49602365",
"0.49582335",
"0.49575227",
"0.49457806",
"0.49414337",
"0.49401465",
"0.49381706",
"0.4932467",
"0.49240437",
"0.4915908",
"0.49123034",
"0.49120718",
"0.49065816",
"0.4903567",
"0.4902923",
"0.49015856",
"0.49009982",
"0.48961383",
"0.48961043",
"0.48944363",
"0.48941413",
"0.489061",
"0.48904955",
"0.48847324",
"0.4882714",
"0.48817566",
"0.48813623",
"0.48763418",
"0.4868525",
"0.48617446",
"0.48607656",
"0.48600644",
"0.48596734",
"0.48587063",
"0.48582363",
"0.48580024",
"0.48577365",
"0.485618",
"0.485618"
] | 0.0 | -1 |
Instance Methods Get an AttributeDictionary by name. Returns nil if there is none with the given name. | def [](key)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def attribute(name)\n @attributes ||= {}\n @attributes[name]\n end",
"def get_attribute(name)\n return @attrs[name] if attrs.key?(name)\n end",
"def get_attribute(attr_name)\n return nil unless @attributes.key? attr_name\n\n @attributes[attr_name]\n end",
"def attribute(name)\n return attributes[name]\n end",
"def get_attribute(dict_name, key, default_value = nil)\n end",
"def find_attribute_named(name)\n @attributes.find { |m| m.name == name }\n end",
"def [](attr_name)\n attr_name = attr_name.to_sym\n unless @attributes.key?(attr_name)\n raise NameError, \"undefined attribute #{attr_name.inspect}\"\n end\n @attributes[attr_name]\n end",
"def attribute(name)\n attributes[name]\n end",
"def get_attribute(name)\n @attributes[name]\n end",
"def get_attribute(name)\n @attributes[name.to_s]\n end",
"def attribute(name)\n @attributes[name.to_sym]\n end",
"def attribute(name)\n attributes.each { |a| return a if a.property.id == name }\n nil\n end",
"def get(name)\n return {} if name.blank?\n\n all.detect { |a| a[\"name\"] == name }\n end",
"def attribute_dictionary(name, create = false)\n end",
"def attribute_dictionary(name, create = false)\n end",
"def [](name)\n attributes.fetch(name)\n end",
"def read_attribute(attr_name)\n attr_name = attr_name.to_sym\n\n @attributes_cache[attr_name] || @attributes_cache.fetch(attr_name) do\n data = @attributes.fetch(attr_name) do\n # This statement overrides id to return the primary key\n # if it is set to something other than :id\n if attr_name == :id && self.class.primary_key != attr_name\n return read_attribute(self.class.primary_key)\n end\n\n # For some reason hashes return false for key? if the value\n # at that key is nil. It also executes this block for fetch\n # when it really shouldn't. Detect that error here and give\n # back nil for data\n if @attributes.keys.include?(attr_name)\n nil\n else\n # In this case the attribute was truly not found, if we're\n # given a block execute that otherwise return nil\n return block_given? ? yield(attr_name) : nil\n end\n end\n # This sets and returns the typecasted value\n @attributes_cache[attr_name] = self.typecast_attribute_for_read(\n attr_name,\n data\n )\n end\n end",
"def [](name)\n attributes[canonical_name(name)]\n end",
"def [](name)\n attributes[canonical_name(name)]\n end",
"def attribute_get(name)\n \n name = name.to_sym\n \n if properties.has_key?(name)\n properties[name].get(self)\n else\n nil\n end\n \n end",
"def [](key_name)\n read_attribute(key_name)\n rescue MissingAttribute\n nil\n end",
"def attribute_lookup(attribute_name)\n a = nil\n @current_relation.attributes.each do |attribute|\n return attribute if attribute.name == attribute_name\n end\n a\n end",
"def with(name)\r\n @attributes.find { |attr| attr.name == name }\r\n end",
"def whitelisted_attrs_for(assoc_name, attr_hash = whitelisted_attrs)\n if assoc_name.to_s == attr_hash.keys.first.to_s\n return attr_hash.values.first.reject { |v| v.is_a? Hash }\n end\n\n scoped_whitelisted_attrs = attr_hash.values.first\n scoped_whitelisted_attrs.reject { |v|\n !v.is_a? Hash\n }.find { |v|\n whitelisted_attrs_for(assoc_name, v)\n }.try(:values).try(:first)\n end",
"def get_attribute(attribute_name)\n theme_attributes.find_by_attribute_name(attribute_name) ||\n populate_attribute(attribute_name)\n end",
"def [](name)\n @attributes[name]\n end",
"def [](name)\n @attributes[name]\n end",
"def [](name)\n @attributes[name]\n end",
"def method_missing(name, *args, &block)\n @attributes ? @attributes[name.to_s] : nil\n end",
"def [](name)\n key = name.to_s\n if attributes.key?(key)\n attributes[key]\n elsif index = underscored_column_names.index(key)\n attributes[@columns[index].name]\n end\n end",
"def [](attr_name)\n @attributes[attr_name.to_s]\n end",
"def a(name)\n self.attributes[name]\n end",
"def read_attribute name\n @attributes[name.to_s]\n end",
"def get_attribute(name)\n rule_properties_scope = self.attr_grammar_type_to_rule_properties_scope[self.attr_grammar.attr_type]\n if (!(rule_properties_scope.get_attribute(name)).nil?)\n return rule_properties_scope.get_attribute(name)\n end\n if (!(@referenced_rule.attr_return_scope).nil?)\n return @referenced_rule.attr_return_scope.get_attribute(name)\n end\n return nil\n end",
"def attribute?(name)\n @attrs.has_key(name)\n end",
"def read_attribute(attr_name) #:doc:\n if @attributes.keys.include? attr_name\n if column = column_for_attribute(attr_name)\n @attributes[attr_name] = unserializable_attribute?(attr_name, column) ?\n unserialize_attribute(attr_name) : column.type_cast(@attributes[attr_name])\n end\n \n @attributes[attr_name]\n else\n nil\n end\n end",
"def [](attr_name)\n @attributes.fetch_value(attr_name.to_s)\n end",
"def find_attribute_named(name)\n case name\n when /\\A#/ then\n find_attribute name[1..-1], false\n when /\\A::/ then\n find_attribute name[2..-1], true\n else\n @attributes.find { |a| a.name == name }\n end\n end",
"def get(name)\n return {} if name.blank?\n\n all.detect { |a| a[\"name\"].casecmp(name).zero? }\n end",
"def get(name)\n return {} if name.blank?\n\n all.detect { |a| a[\"name\"].casecmp(name).zero? }\n end",
"def get_attribute(name)\n str = name.to_s\n \n # try fetching an instance variable first\n value = instance_variable_get(\"@#{str}\")\n return value unless value.nil?\n \n # not an instance variable -- try fetching from @metadata\n load_metadata unless @metadata_loaded\n value = @metadata[str]\n return value unless value.nil?\n \n # not in metadata under that name -- is there another variant?\n alternate_name = nil\n self.class.md_key_map.each do |md_name, var_name|\n if str == md_name.to_s\n alternate_name = var_name.to_s\n break\n end\n end\n \n # if we couldn't find anything, return nil\n return nil if alternate_name.nil?\n \n # otherwise, try looking in metadata using the alternate name\n # if this doesn't work, we'll just let the method return nil\n @metadata[alternate_name]\n end",
"def [](k)\n raise \"key #{k} should be symbol but #{k.class}\" unless k.is_a?(Symbol)\n return @attributes[k]\n end",
"def has_attribute?(name)\n @attributes.key?(name.to_s)\n end",
"def has_attributes?(dictname)\n self.attribute_dictionary(dictname) != nil\nend",
"def find_attributes(name)\n\t\t\tr=[]\n\t\t\tp=self\n\t\t\twhile(p)\n\t\t\t\tif(p.respond_to?(name))\n\t\t\t\t\tv=p.send(name)\n\t\t\t\t\tr << v if(v)\n\t\t\t\tend\n\t\t\t\tbreak if(!p.respond_to?(\"container\"))\n\t\t\t\tp=p.container\n\t\t\tend\n\t\t\tr\n\t\tend",
"def attribute(name)\n @allowed_attributes[name]\n end",
"def has_attribute?(name)\n attributes.has_key?(name)\n end",
"def has_attributes?(dictname)\n self.attribute_dictionary(dictname) != nil || self.definition.attribute_dictionary(dictname) != nil\nend",
"def attribute(name)\n current_attributes[name]\n end",
"def method_missing(name, *args, &block)\n @attributes[name]\n end",
"def [](attr)\n return nil unless instance_variable_defined?(:@attributes) and @attributes.is_a?(Hash)\n @attributes[attr] or (attr.is_a?(String) ? @attributes[attr.to_sym] : @attributes[attr.to_s])\n end",
"def read_attribute(name)\n fields[name].get(@attributes[name])\n end",
"def attr_info_for(attribute_name)\n @tracked_attrs[attribute_name.to_sym]\n end",
"def get(attribute_name)\n # label, attribute = attribute_name.split('_')\n # self.send(\"#{attribute}s\").first_for(label)\n attributes[attribute_name.to_sym] ||= get_field(attribute_map[attribute_name])\n end",
"def method_missing(name, *args, &block)\n return attributes[name.to_sym] if attributes.include?(name.to_sym)\n return super\n end",
"def attribute(name)\n attributes << name\n\n if !method_defined?(name) || name == :id\n attr_accessor name\n end\n end",
"def find_kapp_attribute_definition(kapp_slug, name, params={}, headers=default_headers)\n @logger.info(\"Finding the \\\"#{name}\\\" Kapp attribute definition in the \\\"#{kapp_slug}\\\" kapp.\")\n get(\"#{@api_url}/kapps/#{kapp_slug}/kappAttributeDefinitions/#{encode(name)}\", params, headers)\n end",
"def [](name, options = {})\n attributes.get(name, options)\n end",
"def get_attribute(name); end",
"def get_attribute(name); end",
"def key?(name)\n ! attributes.detect { |attr| attr.name == name }.nil?\n end",
"def nextTagAttributes(typeName, name)\n\t attrs = Hash.new()\n\t skipSpaces()\n\t c = peekChar()\n\t while !c.nil? && c =~ /[a-zA-Z_:]/ # next legal attrib name char\n\t\tkey = nextName()\n\t\tskipSpaces()\n\t\tif peekMatches?('=')\n\t\t skipChar()\n\t\t skipSpaces()\n\t\t val = nextQuotedLiteral(name)\n\t\t val = normalizeAttributeValue(val)\n\t\telse\n\t\t val = ''\n\t\tend\n\n\t\t# Well-formedness constraint: attribute names may appear\n\t\t# only once.\n\t\tif !attrs[key].nil?\n\t\t str = \"malformed #{typeName} '#{name}': attribute name\" +\n\t\t\t\" '#{key}' appears more than once\"\n\t\t raise ParserError.new(str, self)\n\t\tend\n\n\t\tattrs[key] = val\n\n\t\tskipSpaces()\n\t\tc = peekChar()\n\t end\n\t return attrs\n\tend",
"def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_sym)\n end",
"def [](key)\n a = @attrs_hash[key.intern]\n if a\n a.value\n else\n nil\n end\n end",
"def read_attribute_before_type_cast(attr_name)\n return @attributes[attr_name.to_sym]\n end",
"def [](name)\n name = name.to_sym\n super(name)\n rescue MissingAttributeError\n raise unless self.class.attribute_names.include?(name)\n end",
"def has_attribute?(attr_name)\n attr_name = attr_name.to_s\n attr_name = attribute_aliases[attr_name] || attr_name\n attribute_types.key?(attr_name)\n end",
"def has_attribute?(attr_name)\n attr_name = attr_name.to_s\n attr_name = self.class.attribute_aliases[attr_name] || attr_name\n @attributes.key?(attr_name)\n end",
"def has_attribute (attname)\n\n attname = OpenWFE::symbol_to_name(attname) if attname.is_a?(Symbol)\n\n (@attributes[attname] != nil)\n end",
"def has_attribute?(name)\n attribute_names.include?(name.to_str)\n end",
"def has_attribute?(attr_name)\n @attributes.has_key?(attr_name.to_s)\n end",
"def [](name)\n @_node.hasAttribute(name.to_s) ? @_node.getAttribute(name.to_s) : nil\n end",
"def [](attr_name)\n if self.attribute_names.include?(attr_name)\n read_attribute(attr_name)\n else\n get_custom_attribute(attr_name)\n end\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def attributes_get\n h = {}\n self.class.attributes.each do |a|\n h[a] = attribute_get(a)\n end\n h\n end",
"def read_attribute(attr_name)\n return unless attr_name\n\n attr_name = attr_name.to_s\n methods = self.class.generated_external_attribute_methods\n\n if methods.method_defined?(attr_name)\n if @attributes.has_key?(attr_name) || attr_name == 'id'\n methods.send(attr_name, @attributes[attr_name], @attributes, @attributes_cache, attr_name)\n end\n elsif !self.class.attribute_methods_generated?\n # If we haven't generated the caster methods yet, do that and\n # then try again\n self.class.define_attribute_methods\n read_attribute(attr_name)\n else\n # If we get here, the attribute has no associated DB column, so\n # just return it verbatim.\n @attributes[attr_name]\n end\n end",
"def attribute(name)\n read_attribute(name)\n end",
"def _read_attribute(attr_name, &block) # :nodoc:\n @attributes.fetch_value(attr_name, &block)\n end",
"def find_attribute(name, singleton)\n name = $1 if name =~ /^(.*)=$/\n @attributes.find { |a| a.name == name && a.singleton == singleton }\n end",
"def attribute(name, type_or_options, options = EMPTY_HASH)\n if attributes.key?(name)\n raise(AttributeAlreadyDefinedError, \"Attribute #{name.inspect} already defined\")\n end\n\n build_attribute_info(name, type_or_options, options).tap do |attr_info|\n attributes[name] = attr_info\n end\n end",
"def find_attribute(qualified_name, namespace, name)\n if qname = @qualified_attributes[qualified_name]\n return qname\n end\n names = []\n plural = collection?(qualified_name)\n if plural\n if namespace\n names << \"#{ namespace }_#{ name.pluralize }\"\n end\n names << name.pluralize\n end\n if namespace\n names << \"#{ namespace }_#{ name }\"\n end\n names << name\n names.map { |n| n.underscore }.find do |n|\n @attributes.include? n.underscore\n end\n end",
"def has_attribute?(attr_name)\n attribute_types.key?(attr_name.to_s)\n end",
"def [](name) \n self.attributes[name]\n end",
"def get(key)\n @attrs[key].present? ? @attrs[key] : nil\n end",
"def attribute_present?(name)\n @ldap_entry.attribute_names.include?(name)\n end",
"def get(name)\n lookup(key(name.to_s))\n end",
"def _has_attribute?(attr_name)\n attribute_types.key?(attr_name)\n end",
"def _has_attribute?(attr_name)\n attribute_types.key?(attr_name)\n end",
"def attribute_get(name)\n @attributes[:current][name]\n end",
"def [](name)\n @hash.fetch(name)\n end",
"def read_attribute(key)\n @attributes[key.to_sym]\n end",
"def has_attribute?(attr_name)\n attr_name = attr_name.to_s\n attr_name = self.class.attribute_aliases[attr_name] || attr_name\n attribute_types.key?(attr_name)\n end",
"def has_attribute?(attr_name)\n attr_name = attr_name.to_s\n attr_name = self.class.attribute_aliases[attr_name] || attr_name\n attribute_types.key?(attr_name)\n end",
"def get_hash_val(name)\n\t\tfetch(name) if has_key?(name)\n\tend",
"def find_attribute_of_model_in_hash(hash, model_name, attribute_name)\n\n if model_hash = hash[\"models\"] && hash[\"models\"][model_name]\n\n result = (model_hash[\"attributes\"] || []).find { |name, type| name.reject{ |key, _| key == \"options\"}.to_a.flatten.first == attribute_name } # TODO this will change because the attribute list will become an hash again\n return result.reject{ |key, _| key == \"options\"}.to_a.flatten if result # Remove the options part of the attribute, this will be unnecessary when the yaml structure is changed\n \n elsif namespaces = hash[\"namespaces\"]\n namespaces.each do |namespace, namespace_hash|\n result = find_attribute_of_model_in_hash(namespace_hash, model_name, attribute_name)\n return result unless result.nil?\n end\n end\n \n # Nothing found\n nil\n end",
"def attributes\n # ...\n # debugger\n # f = method_missing(name)\n @attributes ||= {}\n # attributes = Hash.new {|h,k| h[k] = []}\n # @attributes = @colm.map {|colm| attributes[colm]}\n # unless instance_variables(false).include?(f)\n # # print f\n # end\n\n # @attribute ={}\n end",
"def attribute?(name)\n self.attribute_names.include?(name.to_sym)\n end",
"def read_attribute(attr_name)\n attr_name = attr_name.to_s\n if !(value = @attributes[attr_name]).nil?\n if column = column_for_attribute(attr_name)\n if unserializable_attribute?(attr_name, column)\n unserialize_attribute(attr_name)\n elsif [:date, :time, :datetime].include?(column.type) && @attributes_cache.has_key?(attr_name)\n @attributes_cache[attr_name]\n else\n column.type_cast(value)\n end\n else\n value\n end\n else\n nil\n end\n end",
"def findAttribute(attribName)\n if @xmlElement.attributes[attribName] != nil\n return(@xmlElement.attributes[attribName])\n else\n if @parentElem != nil\n return(@parentElem.findAttribute(attribName))\n end\n end\n\n return nil\n end",
"def attribute_with_param(attr_name, param_name)\n attributes = self.attributes[attr_name.downcase]\n found_attributes = attributes.select { |attribute| attribute.params[param_name.downcase] }\n found_attributes.first\n end",
"def has_attribute?( name )\n accessories.each do |acc|\n return true if acc.name == name\n end\n false\n end"
] | [
"0.69395965",
"0.690341",
"0.6644047",
"0.6571137",
"0.6558699",
"0.64813006",
"0.6455924",
"0.6391009",
"0.6351447",
"0.63282675",
"0.63096464",
"0.6278301",
"0.6234817",
"0.6219401",
"0.6219401",
"0.62180954",
"0.6199426",
"0.61604327",
"0.61604327",
"0.6109516",
"0.6109458",
"0.6098004",
"0.60428214",
"0.60068995",
"0.5955079",
"0.5952122",
"0.5952122",
"0.5922654",
"0.5915597",
"0.5866406",
"0.58632857",
"0.5851206",
"0.584949",
"0.5826161",
"0.5823994",
"0.5783819",
"0.5770714",
"0.5735747",
"0.57325053",
"0.57325053",
"0.5709409",
"0.5682909",
"0.56748194",
"0.5658514",
"0.5651249",
"0.5624569",
"0.56096494",
"0.5605928",
"0.5571466",
"0.556988",
"0.5553712",
"0.55454546",
"0.55382407",
"0.5511314",
"0.54922694",
"0.54760313",
"0.54737467",
"0.5470731",
"0.54686195",
"0.54686195",
"0.546445",
"0.5451756",
"0.5407919",
"0.53793234",
"0.53761405",
"0.53714573",
"0.5349486",
"0.53416634",
"0.53368616",
"0.5332011",
"0.53316057",
"0.532213",
"0.53035206",
"0.53007275",
"0.53007275",
"0.52984565",
"0.5298091",
"0.52903265",
"0.5289968",
"0.5286954",
"0.527879",
"0.5259511",
"0.5258504",
"0.5248273",
"0.52433044",
"0.52287465",
"0.52278703",
"0.52278703",
"0.5224574",
"0.5224462",
"0.5223993",
"0.51975024",
"0.51975024",
"0.5186752",
"0.5186396",
"0.5177438",
"0.51753306",
"0.51660943",
"0.5165327",
"0.5163913",
"0.51620007"
] | 0.0 | -1 |
The count method is inherited from the Enumerable mixin module. | def count
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def count\n each.size\n end",
"def count\n each.count\n end",
"def count\n # implement in subclasses\n end",
"def count\n raise NotImplementedError\n end",
"def count; end",
"def count; end",
"def count; end",
"def count\n all.count\n end",
"def count\n self.class.count(self)\n end",
"def count\n to_a.size\n end",
"def count\n to_a.size\n end",
"def count\n @collection.count(Scope.new(@collection, @selector, @opts))\n end",
"def count\n all.size\n end",
"def count\n to_a.size\n end",
"def my_count\n array = self.my_select {|item| yield item}\n array.length\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\r\n items.size\r\n end",
"def count\n @all.size\n end",
"def count\n elements.count\n end",
"def count\n collection.count\n end",
"def count\n\t\t\t\tlist.count\n\t\t\tend",
"def count\n if @count\n if @count.respond_to?(:call)\n @count = @count.call\n else\n @count\n end\n else\n super\n end\n end",
"def count\n @collector.count\n end",
"def count(*_args)\n to_a.size\n end",
"def my_count\n return self unless block_given?\n count = 0\n for i in self\n if yield(i)\n count += 1\n end\n end\n return count\n end",
"def my_count\n return self.to_enum unless block_given?\n counter = 0\n for i in self\n counter +=1 if yield i\n end\n return counter\n end",
"def number_of_elements_in_collection\n # collection here refers to the collection that is set with the initialize method\n # collection() is a private accessor method at the bottom of this class that accesses @collection\n collection.count\n end",
"def count!\n count(nil)\n end",
"def count\n @count || first[N]\n end",
"def count(collection)\n collection.select { |el| yield(el) }.size\nend",
"def count\n count = 0\n each do |data|\n count += 1\n end\n count\n end",
"def my_count\n i = 0\n self.my_each {|x| i += 1}\n i\n end",
"def count(collection)\n counter = 0\n collection.each { |element| counter += 1 if yield(element) }\n counter\nend",
"def count()\n return @i\n end",
"def count(options)\n raise \"Not implemented\"\n end",
"def my_count\n if block_given?\n num = 0\n self.my_each{|item| num += 1 if yield(item)}\n num\n else\n # if no block given return size of array\n self.length\n end\n end",
"def counts\r\n @counts\r\n end",
"def count\n filtered = apply_criteria(@data)\n filtered.count\n end",
"def count\n @item_list.size\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n @count\n end",
"def count\n self.all.count\n end",
"def count\n @rows.count\n end",
"def count\n items.compact.count.to_d\n end",
"def count(opts={})\n all(opts).size\n end",
"def count_items\n @items.size\n end",
"def count\n @count ||= @query.count\n end",
"def count(item)\n item.select { |*args| yield(*args) }.size\nend",
"def length\n each.count\n end",
"def count\n @data.size\n end",
"def count\n self.wordcounts.map(&:count).inject(0, :+)\n end",
"def count\n @count ||= 0\n @count += 1\n end",
"def count\n @count ||= get_count\n end",
"def count_elements\nend",
"def total_count\n @all.size\n end",
"def item_count\n collection.length\n end",
"def count\n # nil is for seq_op => it means the all result go directly to one worker for combine\n @count ||= self.map_partitions('lambda{|iterator| iterator.to_a.size }')\n .aggregate(0, nil, 'lambda{|sum, item| sum + item }')\n end",
"def size\n @count\n end",
"def size\n @count\n end",
"def count!\n if not self.count.nil? then self.count += 1; else self.count = 1; end\n end",
"def count(*args)\n truethy_count = 0\n args.each { |el| truethy_count += 1 if yield(el) }\n truethy_count\nend",
"def size\n it = iterator\n it.size\n end",
"def item_count\n @collection.size\n end",
"def count=(_); end",
"def count\n underlying_array.length\n end",
"def count(*args, &block)\n # puts \"GET COUNT\"\n if block\n run_block = Proc.new do |source|\n count = 0\n source.cur.size.times do |index|\n val = source[index]\n result = block.call(val).cur\n if result == true\n count += 1\n end\n end\n\n count\n end\n\n return ReactiveBlock.new(self, block, run_block)\n else\n @array.count(*args)\n end\n end",
"def item_count\n @collection.count\n end",
"def length; count end",
"def count(list)\n list.length\nend",
"def count\n @count ||= 0\n end",
"def item_count\n @collection.length\n end",
"def my_count(args = nil)\n count = 0\n my_each do |item|\n if block_given?\n count += 1 if yield(item)\n elsif args\n count += 1 if item == args\n else\n count = length\n end\n end\n count\n end",
"def count\n values.inject(0){|m, v| m + v.length}\n end",
"def counts\n count = Hash.new(0)\n self.each{|ele| count[ele] += 1}\n count\n end",
"def count(*rest) end",
"def count(collection)\n block_rtn_true_count = 0\n\n for element in collection\n block_rtn_true_count += 1 if yield element\n end\n\n block_rtn_true_count\nend",
"def count\n return @@all\n end",
"def count(collection)\n block_rtn_true_count = 0\n\n collection.each { |element| block_rtn_true_count += 1 if yield element }\n block_rtn_true_count\nend",
"def count\n @options[:select] = \"COUNT\"\n @options.delete(:attributes_to_get)\n\n response = run\n\n while continue?(response)\n @options[:exclusive_start_key] = response.last_evaluated_key\n response = run(response)\n end\n\n response.count\n end",
"def count\n @cards.count\n end",
"def count(*args)\n arr = [*args]\n counter = 0\n\n arr.each do |el|\n counter += 1 if yield(el)\n end\n\n counter\nend",
"def count\n Driver.client[coll_name].find.count\n end",
"def my_count(arg = nil)\n result = []\n if block_given?\n my_each do |elem|\n result << elem if yield(elem) == true\n end\n end\n\n unless block_given?\n if arg.nil? arg.nil?\n result = self\n else\n my_each do |elem|\n result << elem if elem == arg\n end\n end\n end\n result.size\n end",
"def my_count(val)\n counter = 0\n self.each do |ele|\n if ele == val\n counter += 1\n end\n end\n counter\n end",
"def count\n if @count\n @count - @deleted_entries.cardinality\n else\n determine_count\n end\n end",
"def Count()\n _getproperty(1, [], [])\n end",
"def size\n Integer.new.tap do |count|\n each { |element| count += 1 }\n end\n end",
"def count(chr = nil, start = nil, stop = nil) \n num = 0\n self.each(chr, start, stop) { |entry| num += 1 }\n num\n end",
"def count; @value.size; end",
"def count\n query.count\n end",
"def count\n query.count\n end",
"def count\n @mutex.synchronize { @count }\n end",
"def my_count n = nil\n if block_given?\n truths = 0\n self.my_each {|o| truths += 1 if yield(o)}\n truths\n elsif n.nil?\n self.length\n else\n my_count {|x| x==n}\n end\n end",
"def count(extras = false)\n @count ||= klass.collection.find(selector, process_options).count(extras)\n end",
"def count(query)\n raise \"The class #{self.class.name} must implement the 'count' method.\"\n end"
] | [
"0.7767859",
"0.77471346",
"0.77038735",
"0.7631804",
"0.7525069",
"0.7525069",
"0.7525069",
"0.74714124",
"0.74448335",
"0.7433811",
"0.7433811",
"0.736994",
"0.73684734",
"0.7350836",
"0.7311736",
"0.7309861",
"0.7274849",
"0.7274849",
"0.7274849",
"0.72523123",
"0.7242596",
"0.7214989",
"0.7203037",
"0.7169107",
"0.7160787",
"0.71243006",
"0.7080719",
"0.7075941",
"0.706776",
"0.7018136",
"0.6997332",
"0.69776875",
"0.6976129",
"0.6973969",
"0.697059",
"0.6963937",
"0.69616884",
"0.6952315",
"0.6942919",
"0.6938607",
"0.693478",
"0.69337386",
"0.68934155",
"0.68934155",
"0.68934155",
"0.68489283",
"0.6844138",
"0.68301713",
"0.68299824",
"0.6823826",
"0.6820457",
"0.68126047",
"0.6812321",
"0.6804783",
"0.68010724",
"0.6799304",
"0.67923445",
"0.67849916",
"0.67736053",
"0.67667043",
"0.6755759",
"0.67485565",
"0.67485565",
"0.67483234",
"0.67457104",
"0.6744846",
"0.67348963",
"0.67324156",
"0.6719155",
"0.6717354",
"0.6708376",
"0.6700822",
"0.6699868",
"0.6694553",
"0.6693883",
"0.6692435",
"0.66916555",
"0.66813767",
"0.66769135",
"0.66522896",
"0.66326386",
"0.66268957",
"0.66228396",
"0.6618138",
"0.6598332",
"0.6596398",
"0.65934277",
"0.65897846",
"0.65766823",
"0.6571179",
"0.6564956",
"0.6562792",
"0.6557648",
"0.65550613",
"0.65550613",
"0.6553785",
"0.65491194",
"0.6548246",
"0.6538893"
] | 0.7070175 | 29 |
Only allow a trusted parameter "white list" through. | def user_params
params.require(:user).permit(:id, :name, :email, :password, :username,
:allowance, :supervisor, :employee_status, :school_attending,
:degree_type, :degree_program, :eligibility, :request => [:id,
:amount_requested, :amount_paid, :date_processed, :processing_status,
:notes, :request_approved, :documents_submitted])
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
"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 filtered_parameters; end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\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 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 param_whitelist\n [:rating, :review]\n end",
"def valid_params?; end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitted_params\n declared(params, include_missing: false)\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 filter_parameters; end",
"def filter_parameters; end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def check_params; true; end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def list_params\n params.permit(:name)\n end",
"def check_params\n true\n end",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"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 additional_permitted_params\n []\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"def allow_params_authentication!; 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 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 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 paramunold_params\n params.require(:paramunold).permit!\n end",
"def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"def quote_params\n params.permit!\n end",
"def list_params\n params.permit(:list_name)\n end",
"def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"def all_params; end",
"def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"def user_params\n end",
"def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def permitted_params\n @wfd_edit_parameters\n end",
"def user_params\r\n end",
"def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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 params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"def params_permit\n params.permit(:id)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\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 filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\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 argument_params\n params.require(:argument).permit(:name)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\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 whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"def parameters\n nil\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"def special_device_list_params\n params.require(:special_device_list).permit(:name)\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 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"
] | [
"0.71213365",
"0.70527846",
"0.6947171",
"0.6901663",
"0.67342883",
"0.6717481",
"0.668679",
"0.667654",
"0.6660948",
"0.655484",
"0.6525947",
"0.64567953",
"0.64502525",
"0.6450165",
"0.6446098",
"0.6433068",
"0.64118934",
"0.64118934",
"0.63903046",
"0.6379847",
"0.6379847",
"0.63736796",
"0.63605297",
"0.6353668",
"0.6283826",
"0.6277936",
"0.62436706",
"0.6226217",
"0.62238735",
"0.6222201",
"0.6208754",
"0.62079734",
"0.61760926",
"0.6171337",
"0.6166829",
"0.61594605",
"0.61429733",
"0.6134288",
"0.61210173",
"0.6106998",
"0.6097591",
"0.6074265",
"0.6053252",
"0.6039525",
"0.60342395",
"0.6030413",
"0.6017866",
"0.60174304",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60154676",
"0.60037804",
"0.6003128",
"0.5999996",
"0.5994808",
"0.59938943",
"0.5992965",
"0.59828913",
"0.5982352",
"0.59762347",
"0.5973914",
"0.5968744",
"0.5964729",
"0.5963057",
"0.5963057",
"0.5956878",
"0.5950747",
"0.5950746",
"0.5946173",
"0.59427863",
"0.59293395",
"0.5928864",
"0.5925602",
"0.5923773",
"0.5918309",
"0.5915812",
"0.59130466",
"0.59129673",
"0.5907004",
"0.59047765",
"0.590452",
"0.59017384",
"0.5899288",
"0.58962125",
"0.58959764",
"0.5893933"
] | 0.0 | -1 |
GET /complains Return Complains records, filters accept: city and company | def index
@complains = Complain.all
if params[:city].nil?
params[:city] = ''
end
if params[:company].nil?
params[:company] = ''
end
if params[:city] != '' and params[:company] != ''
result = Complain.where("city = ? AND company = ?", params[:city], params[:company]).size
elsif params[:city] != ''
result = Complain.where("city = ?", params[:city]).size
elsif params[:company] != ''
result = Complain.where("company = ?", params[:company]).size
else
result = Complain.count
end
render json: result
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @company_clients = CompanyClient.where(company: params[:company]).first\n end",
"def index\n @grouped_companies = Company.all.group_by(&:geography) \n @companies = params[:q] ? company_filteration(params[:q],params[:region]) : Company.all\n render layout: \"browse\"\n end",
"def index\n\t\t@companies = []\n if params[:query].nil?\n @products = []\n else\n @products = Product.search params[:query]\n @products.each do |product|\n product.companies.each do |company|\n if [email protected]? company\n @companies << company\n end\n end\n end\n end\n\tend",
"def index\n if params[:company_type]\n @search = @community.companies.where(:company_type => params[:company_type]).search(params[:q])\n else\n @search = @community.companies.search(params[:q])\n end\n @companies = @search.result\n\n @tab_name = \"companies\"\n @page_title = \"Companies\"\n @page_subtitle = \"Loyal Businesses\"\n @page_description = \"\"\n\n add_breadcrumb \"Companies\", companies_path, :title => \"#{@community.name} Companies\"\n end",
"def all_companies_information\n\t\tbegin\n\t url = URI.parse(Rails.application.secrets[:api_endpoints]['onething']['url_company_info'])\n\t\t url_params = {}\n\t\t path = \"#{url.path}?#{url_params.collect { |k,v| \"#{k}=#{CGI::escape(v.to_s)}\"}.join('&')}\"\n\t\t request = Net::HTTP::Get.new(path) \n\t\t response = Net::HTTP.start(url.host, url.port, :use_ssl => false, :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http| \n\t\t http.request(request)\n\t\t end \n\t\t json_data = JSON.parse(response.body) rescue nil\n\t\t if !json_data.present?\n\t\t \treturn {}\n\t\t else\n\t\t return json_data\n\t\t end\n\t rescue => e\n\t \treturn {:message => 'Error in fetchng API data. Please try again.'}\t\n\t end\n\tend",
"def companies\n company_ids = company_affiliations.with_access.map(&:company_id)\n Company.where(:id.in => company_ids)\n end",
"def index\n @companions = Companion.all\n end",
"def cities\n CS.get :us, :ca\n end",
"def index\n @couts = Cout.order(:code)\n @company = Company.find(1)\n end",
"def index\n @companies = ClientCompany.all\n end",
"def companies\n companies = Driver.find(params[:id]).company\n if companies.size == 0\n companies = Array.new\n end\n respond_with companies\n rescue ActiveRecord::RecordNotFound\n respond_with ActiveRecord::RecordNotFound\n end",
"def company_information(params)\n get('company-information',params)\n end",
"def all\n endpoint = 'Companies'\n response = JSON.parse(@client.get(endpoint).body)\n companies = response.key?('Items') ? response['Items'] : []\n companies.map { |attributes| Unleashed::Company.new(@client, attributes) }\n end",
"def index\n if index_params.present?\n @complaints = Complaint.where(status: index_params[:filter], customer_id: current_user.customer_id)\n else\n @complaints = Complaint.all\n end\n render json: @complaints, status: 200\n end",
"def index\n @companies = Company.search(params[:search]).order('updated_at DESC').page(params[:page])\n end",
"def index\n @credit_companies = CreditCompany.all.page(params[:page]).per(10)\n end",
"def companies\n return [] unless basecamp\n @companies ||= basecamp.companies\n end",
"def index\n organizations = if params[:q]\n CclaSignature.search(params[:q])\n else\n Organization.includes(:ccla_signatures)\n end\n\n respond_to do |format|\n format.json do\n render json: organizations.to_json(only: [:id], methods: [:company])\n end\n end\n end",
"def companies\n\t\tEmpresa.all\n\tend",
"def companies\n signed_get(COMPANIES_PATH)\n end",
"def index\n @contacts = CompanyContact.scoped\n\n if params.keys.include? \"company_id\"\n @contacts = @contacts.where(:company_id => params[:company_id]).order('position ASC')\n end\n\n if params.keys.include? \"limit\"\n @contacts = @contacts.limit(params[:limit])\n end\n\n respond_with @contacts\n end",
"def index\n @companies = companies_scope\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def index\n @companies_info = Company.display_information\n end",
"def index\n @companies = Company.all\n #result\n\n if @companies.count>0\n render :json => @companies.to_json(:include =>[:confidenceLevel,:nda,:country,:region,:state,:city,:company_type,:company_investors]), :status=>:ok\n else\n render :json => \"No companies found.\".to_json\n end\n end",
"def show\n @companies = Company.all\n end",
"def index\n @companies = NewCompany.where(user: current_user)\n end",
"def index\n @companies = Company.all\n\n end",
"def index\n @tyc_companies = Tyc::Company.all\n\n @q = Tyc::Company.ransack(params[:q])\n @tyc_companies = @q.result().paginate(:page => params[:page], :per_page => 20)\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n @companies = Company.all\n end",
"def index\n #location = GeoIp.geolocation('99.104.74.184')\n #companies = Company.within(5, :origin => [location[:latitude],location[:longitude]])\n #raise companies.inspect\n @companies = Company.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @companies }\n end\n end",
"def index\n # current_user.companies.\n @incidents = Incident.all\n end",
"def company_search(options = {})\n path = \"/company-search:(companies:(id,name,universal-name,website-url,logo-url,square_logo_url))?keywords=#{CGI.escape(options[:keyword])}&sort=relevance\"\n # binding.pry\n results = get(path, options)\n # binding.pry\n end",
"def index\n\t\t@companies = Company.all\n\tend",
"def index\n\t\t@companies = Company.all\n\tend",
"def contacts\n @contacts = Employee.by_company_id(params[:company_id]).by_search(params[:search]).by_contacts(current_user).paginate :page => params[:page]\n @active_employers = current_user.employers.active_employers.all\n end",
"def get_list_cities\n City.get_all_cities\n end",
"def index\n @invoced_companies = InvocedCompany.all\n end",
"def index\n @customer_companies = CustomerCompany.all\n end",
"def searchByCity\n\t\turl = request.original_url\n\t\t\n\t\tbegin\n\n\t\t\tprms = CGI.parse(URI.parse(url).query)\n\n\n\t\t\tresults = Doctor.where(\"city LIKE ?\", \"%#{prms['city'][0]}%\")\n\n\t\t\trender json: results\n\t\trescue Exception => e\n\t\t\trender json: { errors: \"Some errors\" }, status: 422\n\t\tend\n\tend",
"def fetch_operations\n filter = params[:filter]\n company_id = params[:company_id]\n @operations_by_company = Operation.for_company(filter, company_id)\n end",
"def index\n @company_authorities = CompanyAuthority.all\n\n render json: @company_authorities\n end",
"def byState\n @companies = Company.where(\"state_id = ?\", company_params[:state_id])\n\n render json: @companies\n end",
"def index\n @travel_companions = TravelCompanion.all\n end",
"def index\n @visit_companies = VisitCompany.all\n end",
"def index\n @companies = Company.order(:name).page(params[:page]).per(10)\n end",
"def index\n @companies = Company.all\n if @companies\n render json: {\n companies: @companies\n }\n else\n render json: {\n status: 500,\n errors: ['No companies']\n }\n end\n end",
"def index\n @companies = Company.paginate(page: params[:page]).per_page(10) # pagination (gem 'will_paginate')\n end",
"def companies\n render \"company/companies.json.jbuilder\", status: :ok\n end",
"def index\n @contact_companies = ContactCompany.all\n end",
"def get_information_all_companies()\n\t\tpage = 275\n\t\tbegin\n\t\t\turl = create_url(\"organizations\",\"\",page)\n\t\t\tputs \"Reading #{url}\"\n\t\t\tresult = read_url(url)\n\t\t\t#save_json(result, [\"organizations\"])\n\n\t\t\tadd_organization_info(result,\"name\")\n\t\t\tadd_organization_info(result,\"path\")\n\t\t\t\n\t\t\tnext_url = result['data']['paging']['next_page_url']\n\t\t\tpage = page + 1\n\t\tend while next_url != nil\n\t\tcreate_permalink(@paths)\n\t\tsave_json(\"\", [\"names\", \"paths\", \"permalinks\"])\n\tend",
"def list_compros\n \n @company = Company.find(params[:company_id])\n @pagetitle = \"#{@company.name} - Viaticos\"\n @filters_display = \"block\"\n \n \n if(params[:search] and params[:search] != \"\") \n \n @compros = Compro.where([\"company_id = ? and (detalle LIKE ? OR code LIKE ?)\", @company.id,\"%\" + params[:search] + \"%\", \"%\" + params[:search] + \"%\"]).order('code').paginate(:page => params[:page]) \n else\n @compros = Compro.where(company_id: @company.id).order('fecha DESC').paginate(:page => params[:page])\n end\n \n end",
"def show\n @breadcrumb = 'read'\n @company = Company.find(params[:id])\n @offices = @company.offices.paginate(:page => params[:page], :per_page => per_page).order(:office_code)\n @notifications = @company.company_notifications.paginate(:page => params[:page], :per_page => per_page).order('id')\n @accounts = @company.company_bank_accounts.paginate(:page => params[:page], :per_page => per_page).order(:id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def index\n @account_companies = Account::Company.all\n end",
"def index\n if (params[:city_id])\n @city = City.find(params[:city_id].to_i)\n @oxygen_suppliers = @city.oxygen_suppliers.active_list\n else\n @oxygen_suppliers = OxygenSupplier.active_list\n end\n end",
"def company\n @company ||= research_param(:company) || company_list.first\n end",
"def company_info(company_id, *fields)\n get(\"/organizations/#{company_id}#{field_selector(fields)}\")\n end",
"def index\n @colaboradors = Colaborador.search(params[:search], params[:page])\n end",
"def index\n @compania = Companium.all\n end",
"def index\n if request.format.to_sym == :html\n @companies = Company.page(params[:page]).order(\"LOWER(name)\")\n else\n @companies = Company.all\n end\n respond_with(@companies)\n end",
"def show\n @company = Company.find(params[:id])\n @company_news = CompanyNews.where(company_id: @company.id )\n @vacancies = Vacancy.where(company_id: @company.id)\n @company_contacts = CompanyContact.where(company_id: @company.id)\n @company_comments = CompanyComment.where(company_id: @company.id)\n @company_clients = CompanyClient.where(company_id: @company.id)\n @company_rewiews = CompanyReview.where(company_id: @company.id)\n @company_practices = CompanyPractice.where(company_id: @company.id)\n end",
"def index\r\n @company = Company.find_by(params[:id])\r\n @services = Service.where(company_id: params[:id])\r\n end",
"def index\n @business_companies = Business::Company.all\n end",
"def search\n return nil unless valid?(:search)\n\n success = call_company_service\n errors.add(:company_number, :no_company_search_results) if success && !company_name?\n success\n end",
"def index\n @companies = Company.all.page params[:page]\n end",
"def find_by_name(name, city, state, resource_type)\n begin\n company = Company.new\n r = InfoconnectWrapper.post url,\n {\n :ResourceType => resource_type,\n :CompanyName => name,\n :RequestType => \"Company\",\n :Limit => \"1\",\n :City => city,\n :StateProvince => state\n }, :content_type => :json, :accept => :json\n\n if r[\"MatchCount\"] > 0\n company_to_parse = r[\"Matches\"][\"Companies\"][0]\n company.init(company_to_parse)\n end\n company\n rescue => e\n puts e\n end\n end",
"def index\n @company_informations = CompanyInformation.all\n end",
"def index\n @companies = Company.all\n @cities = City.all\n #render json: @companies\n render json: { :companies => @companies, :cities => @cities }\n end",
"def index\n @production_companies = ProductionCompany.all\n end",
"def index\n @main_companies = MainCompany.all\n end",
"def index\n if params[:company_id].present?\n @company_id = params[:company_id]\n @inspections = Inspection.where(company_id: @company_id)\n else\n @inspections = Inspection.all\n end\n end",
"def index\n\t @contentPageHeading = 'My Companies'\n\t @companies = current_user.companies\n\t @user_companies = UserCompany.where(:user_id => current_user.id)\n\t # @public_companies = Array.new\n\t # for user_company in @user_companies\n\t # \t@public_companies.push(user_company,Company.find(user_company.pc_id))\n\t # end\n\t\t# @public_companies = Company.find(:all, :order => 'name', :conditions => 'id IN (SELECT pc_id FROM user_companies WHERE user_id = '+current_user.id.to_s+')')\n end",
"def call_company_service\n ch_api = CompaniesHouseApi.new\n response = ch_api.company company_number\n parse_response response\n end",
"def index\n if current_user.is_student?\n @companies = Company.where(:reg_status => [2,3])\n respond_with @companies.as_json({:student_id => current_user.id})\n elsif\n respond_with Company.all\n end\n end",
"def list_people\n @nbr = Job.where('company_id = ?', params[:id])\n .distinct\n .pluck(:person_id)\n .count\n params[:q] = {} if params[:q].nil?\n params[:q]['company_id_eq'] = params[:id]\n @q = Job.ransack(params[:q])\n @jobs = @q.result\n .includes(:company, :person)\n .page(pointed_page)\n\n render 'companies/company_people'\n end",
"def company_infos\n repo = CompanyRepository.new\n results = repo.search(query: { match: { sic_code_first: sic_first } })\n CompanyInfo.where(duns_number: results.map(&:duns_number))\n end",
"def companies\n private_companies + major_companies\n end",
"def index\n @intelcompanies = IntelCompany.all\n render json: @intelcompanies.to_json(include: [:intel, :company])\n end",
"def getbyId\n begin\n @company = Company.find(params[:id])\n render :json => @company.to_json(:include =>[:confidenceLevel,:nda,:country,:region,:state,:city,:company_type,:companyInvestors,:classifications,:companyGeos,:companyRevenues,:companyGrowths]), :status=>:ok\n rescue\n render :json=>\"No company found\"\n end\n end",
"def index\n @company_owners = CompanyOwner.all\n end",
"def index\n @cities = City.where(active_status: true, del_status: false)\n end",
"def index\n @page_id = 'companyList'\n @banners = Banner.companies.where('start_at <= ? and end_at >= ?', Time.now, Time.now).where(:language => params[:locale] == 'en' ? [0, 1] : [0, 2])\n @company_classifies = CompanyClassify.design\n @companies = params[:company_classify_id].present? ? Company.joins(:company_classify_relations).where('company_classify_relations.company_classify_id = ?', params[:company_classify_id]).design.allow.human_order : Company.design.allow.human_order\n end",
"def index\n @employees = Employee.all.order(created_at: :desc).group(\"employees.company_id, id\").paginate(page: params[:page], per_page: 15)\n @companies = Company.where(id: @employees.pluck(:company_id).uniq.sort)\n end",
"def index\n\t\tquery = params[:query].presence || '*'\n @materials = Material.search query, aggs: [:section, :cat_1, :cat_2, :cat_3]\n @companies = @materials.map(&:companies).flatten.uniq\n\t\t@aggs = @materials.aggs\n\n\t\t# Needs to be refactored\n\t\tif @companies.map(&:name).include? query\n\t\t\[email protected] do |company|\n\t\t\t\tif company.name = query\n\t\t\t\t\t@companies = [company]\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"def index\n @companies = Company.search(params[:search])\n @companies = @companies.where(suscription: params[:suscription]) if params[:suscription] && %w[0 1].include?(params[:suscription])\n @companies\nend",
"def index\n\t\tif current_user.user_role.code == 'admin'\n\t\t\t@companies = Company.all\n\t\telse\n\t\t\t@companies = current_user.created_companies\n\t\tend\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @companies }\n\t\tend\n\tend",
"def all\n get(\"#{domain}/complaints\")\n end",
"def search_company(name = \"\", limit = 50)\n\t\[email protected]_company(name, limit)\n\tend",
"def index\n @hiring_companies = HiringCompany.all\n end",
"def index\n @companies = Company.all\n @com_info = Company.last\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n end\n end",
"def get_company_by_company_part\n @parts = CompaniesController::CompanyService.get_company_by_company_part(params[:param_part])\n if [email protected]?\n respond_to do |format|\n format.json{ render json: @parts}\n end \n else\n #não foi encontrado as informacoes\n end\n\tend",
"def new\n @company.name = params[:name]\n @companies = []\n @linkedin_companies = []\n \n if ([email protected]?)\n @companies = Company.find_all_by_name(params[:name])\n @linkedin_companies = current_user.linkedin_client.search({:keywords => params[:name]}, \"company\").companies.all\n end\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end",
"def index\n if params[:company_id]\n @service_categories = ServiceCategory.where(:company_id => params[:company_id]).order(:order, :name)\n else\n if current_user.role_id == Role.find_by_name('Super Admin').id\n @service_categories = ServiceCategory.where(company_id: Company.where(owned: false).pluck(:id)).order(:order, :name)\n else\n @service_categories = ServiceCategory.where(:company_id => current_user.company_id).order(:order, :name)\n end\n end\n end",
"def show\n @company = Company.find(params[:id])\n @clients = @company.clients\n @employees = @company.employees\n @drivers = @company.drivers\n @shipments = @company.shipments\n end",
"def index\n manage_filter_state\n if session[:organization] != '0'\n @companies = Company.where(organization_id: session[:organization]).includes(:organization).paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n else\n @companies = Company.includes(:organization).paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @companies }\n format.js\n end\n end",
"def search\n\t\t@query = params[:query]\n\t\t@complaints = Complaint.search @query, :page => params[:page], :per_page => 10\n\tend"
] | [
"0.6654297",
"0.64825964",
"0.647094",
"0.6470258",
"0.644156",
"0.64208543",
"0.6417104",
"0.63997155",
"0.63835734",
"0.63789713",
"0.63546705",
"0.6335696",
"0.6324701",
"0.6323322",
"0.6298138",
"0.6294245",
"0.6277777",
"0.62385666",
"0.6235472",
"0.6224066",
"0.62222993",
"0.62124634",
"0.6208518",
"0.61930376",
"0.61600155",
"0.615021",
"0.61472166",
"0.6140716",
"0.6138859",
"0.6138859",
"0.6138859",
"0.6138859",
"0.6138859",
"0.6138859",
"0.61353725",
"0.6123775",
"0.6117436",
"0.610096",
"0.610096",
"0.6087166",
"0.60865706",
"0.60818297",
"0.6072557",
"0.60681015",
"0.60548913",
"0.6050194",
"0.6049457",
"0.6033444",
"0.60249954",
"0.60207754",
"0.6020673",
"0.60202605",
"0.6011637",
"0.5996308",
"0.59945613",
"0.59877783",
"0.59824413",
"0.5977406",
"0.59756863",
"0.5973913",
"0.5967962",
"0.5960929",
"0.5949308",
"0.5949211",
"0.5946972",
"0.5939956",
"0.593602",
"0.5935934",
"0.59354496",
"0.5927394",
"0.5925823",
"0.59174037",
"0.5909779",
"0.5899064",
"0.58965856",
"0.5891548",
"0.58886397",
"0.58734345",
"0.58689773",
"0.58682466",
"0.58666533",
"0.5859798",
"0.58526516",
"0.585142",
"0.5848591",
"0.5846282",
"0.5844362",
"0.5842389",
"0.5837326",
"0.5837172",
"0.58281183",
"0.5821553",
"0.58181804",
"0.581524",
"0.5811321",
"0.5807915",
"0.5797094",
"0.57931626",
"0.5788673",
"0.5787763"
] | 0.6938855 | 0 |
GET /complains/1 Not implemented def show | def create
@complain = Complain.new(complain_params)
if @complain.save
render json: @complain, status: :created
else
render json: {status: 'ERROR', message: 'Can not add the complain.', data:@complain.err}, status: :unprocessable_entity
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def show\n @cec_complaint = CecComplaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cec_complaint }\n end\n end",
"def show\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complaint }\n end\n end",
"def show\n @comp = Comp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comp }\n end\n end",
"def show\n @compliment = Compliment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compliment }\n end\n end",
"def show\n @complaint = Complaint.find(params[:id])\n\n render json: @complaint\n end",
"def show\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compra }\n end\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compromise }\n end\n end",
"def show\n @comp_info = CompInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comp_info }\n end\n end",
"def index\n @complains = Complain.all\n end",
"def index\n @complains = Complain.all\n end",
"def show\n @collaborator = Collaborator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @collaborator }\n end\n end",
"def show\n @complaint = Complaint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @complaint }\n end\n end",
"def show\n @credito = Credito.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credito }\n end\n end",
"def show\n @condolence = Condolence.find(params[:id])\n @orbituarysite = current_user.orbituarysites.new\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condolence }\n end\n end",
"def show\n #@complaint = Complaint.find(:all,:conditions=>params[:id])\n\t @complaint = Complaint.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @complaint }\n end\n end",
"def show\n @comprobante = Comprobante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comprobante }\n end\n end",
"def index\n @usach_complaint = UsachComplaint.first\n end",
"def show\n @compromise = Compromise.find(params[:id])\n\n render json: @compromise\n end",
"def show\n @companies = Company.all\n end",
"def show\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conductor }\n end\n end",
"def show\n @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conductor }\n end\n end",
"def show\n @ins_company = InsCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ins_company }\n end\n end",
"def show\n @crunch_company = CrunchCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crunch_company }\n end\n end",
"def show\n @collab = Collab.find(params[:id])\n\n respond_to do |format|\n format.html { render :layout => 'collab'}# show.html.erb\n format.json { render json: @collab }\n end\n end",
"def show\n\t begin\n\t\t if params[:id].to_i != 0\n\t\t\t # id given\n\t\t @company = Company.find(params[:id])\n\t\t else\n\t\t\t # name given\n\t\t\t @company = Company.find_by_name(params[:id])\n\t\t end\n\t rescue Exception => e\n\t\t @company = nil\n\t\tend\n\n\t if @company.nil?\n\t\t redirect_to root_path, alert: \"This company does not exist.\"\n\t\t return\n\t end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @colaboration = Colaboration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colaboration }\n end\n end",
"def show\n @admin_collaborator = Admin::Collaborator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_collaborator }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @company = Company.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def index\n @companions = Companion.all\n end",
"def show\n @compra = Compra.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @compra }\n end\n end",
"def show\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coin_set }\n end\n end",
"def show_complaint_by_id\n complaint = Complaint.find(params[:id])\n if complaint\n render json: complaint, methods: [:status]\n else\n render json: {status: \"error\", error_message: \"complaint not found\"}\n end\n end",
"def show\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clue }\n end\n end",
"def show\n @clue = Clue.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clue }\n end\n end",
"def index\n @companies_info = Company.display_information\n end",
"def show\n @clonet = Clonet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clonet }\n end\n end",
"def index\n @complus = Complu.all\n end",
"def show\n render json: Company.find(params[\"id\"])\n end",
"def show\n @crust = Crust.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crust }\n end\n end",
"def show\n @biz_company = BizCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @biz_company }\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 show\n @provider = current_company.providers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @provider }\n end\n end",
"def show\n @crime = Crime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crime }\n end\n end",
"def show\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @credit }\n end\n end",
"def show\n @crate = Crate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @crate }\n end\n end",
"def show\n @company = Company.find(params[:id])\n employees_and_bio_signals\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end",
"def show\n @composition = Composition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @composition }\n end\n end",
"def show\n @company = current_user.companies.find(params[:company_id])\n @report = @company.labors.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @report }\n end\n end",
"def index\n @comps = Comp.all\n end",
"def index\n @comps = Comp.all\n end",
"def show\n @our_coin = OurCoin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @our_coin }\n end\n end",
"def show\n @competitor = Competitor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competitor }\n end\n end",
"def show\n\n @competitions = Competition.all\n @competition = Competition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competition }\n end\n end",
"def index\n @compliments = Compliment.all\n end",
"def show\n @laboratory = Laboratory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laboratory }\n end\n end",
"def show\n @company_account = CompanyAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @company_account }\n end\n end",
"def index\n @complaint_client_satisfactions = ComplaintClientSatisfaction.all\n end",
"def show\n @corporation = Corporation.find(params[:id])\n @page_header = @corporation.name\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @corporation }\n end\n end",
"def show\n @collaborateurs = @aramis_entity.collaborators\n end",
"def index\n @compania = Companium.all\n end",
"def show\r\n @cuentum = Cuentum.find(params[:cuentum_id])\r\n @credit = @cuentum.credits.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @credit }\r\n end\r\n end",
"def show\n @company = Company.find(params[:company_id])\n end",
"def show\n @circulos = @compra.get_deliveries\n\t\t@statuses = @compra.get_statuses\n\n end",
"def show\n @home_page = true\n @solutions = Solution.company_solutions(@solution.company_id)\n @clients = @solution.clients\n end",
"def show\n @compte_bancaire = CompteBancaire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json :@compte_bancaire }\n end\n end",
"def show\n @contribution = Contribution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contribution }\n end\n end",
"def show\n @chain = Chain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @chain }\n end\n end",
"def show\n\t\t@company = Company.find(params[:id])\n\t\tmake_breadcrumbs\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @company }\n\t\tend\n\tend",
"def show\n @part_company = PartCompany.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_company }\n end\n end",
"def index\n @creditors = Creditor.all\n end",
"def show\n @laccount = Laccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @laccount }\n end\n end",
"def show\n @chain = Chain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chain }\n end\n end",
"def show\n @complexity = Complexity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @complexity }\n end\n end",
"def show\n @combinacion = Combinacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @combinacion }\n end\n end",
"def index\n @colaborators = Colaborator.all\n end",
"def show\n @insumolabores = Insumolabore.where(:labor_id => params[:id])\n end",
"def show\n begin\n @complaint = Complaint.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to access invalid action #{params[:id]}\"\n flash[:notice] = \"Invalid action\"\n redirect_to profile_path(current_user.profile_name)\n else\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @complaint }\n end\n end\nend",
"def show\n response_hash = @company.get_company_detail\n respond_to do |format|\n format.html {}\n format.json {render json: {message: response_hash}, status: 200}\n end\n end",
"def show\n\t\t@comprobante_de_compra = ComprobanteDeCompra.find(params[:id])\n\t\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @comprobante_de_compra }\n\t\tend\n\tend",
"def show\n @squishee_cup = SquisheeCup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @squishee_cup }\n end\n end",
"def show\n @contum = Contum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contum }\n end\n end",
"def show\n @complaint = Complaint.new\n end",
"def show\n @evaluable_competency = EvaluableCompetency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @evaluable_competency }\n end\n end",
"def show\n @charge = Charge.find(params[:id])\n @competences = @charge.competences\n @title = \"Cargo\"\n \n end",
"def show\n @competence_center = CompetenceCenter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competence_center }\n end\n end",
"def show\n @carpool = Carpool.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @carpool }\n end\n end",
"def show\n @candidate = Candidate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @candidate }\n end\n end",
"def show\n @commtent1 = Commtent1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commtent1 }\n end\n end",
"def show\n @compra_detalle = CompraDetalle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @compra_detalle }\n end\n end",
"def show\n @candidate_app = CandidateApp.where(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @candidate_app }\n end\n end",
"def show\n @university = University.find(params[:university_id])\n @complaint_type = @university.complaint_types.find(params[:id])\n authorize! :show, @complaint_type, :message => 'Acceso denegado.'\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @complaint_type }\n end\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 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\t\t\t\tcoin = Coin.find(params[:id])\n\t\t\t\trender json: {status: 'Success!', message: 'Loaded Coin', data:coin.render_to_string('index.html')},status: :ok\n\t\t\tend",
"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"
] | [
"0.7184997",
"0.7177292",
"0.7172053",
"0.7143324",
"0.70616573",
"0.70195466",
"0.69102174",
"0.6908695",
"0.68395966",
"0.68395966",
"0.6809302",
"0.6799727",
"0.67880195",
"0.67877024",
"0.67780787",
"0.6719261",
"0.6680013",
"0.66711944",
"0.6609896",
"0.6587719",
"0.6587719",
"0.656435",
"0.6546877",
"0.6545376",
"0.65342754",
"0.65317273",
"0.65180224",
"0.65115917",
"0.65115917",
"0.65115917",
"0.65115917",
"0.65115917",
"0.65115917",
"0.65095997",
"0.65042186",
"0.65032053",
"0.6500348",
"0.6487327",
"0.6487327",
"0.6482854",
"0.64722633",
"0.64633477",
"0.6446646",
"0.6435573",
"0.64335",
"0.6424093",
"0.6418522",
"0.63979274",
"0.63945484",
"0.63945484",
"0.6393457",
"0.6390984",
"0.638912",
"0.6379951",
"0.6375987",
"0.6375987",
"0.6372332",
"0.6368358",
"0.63632095",
"0.6357148",
"0.6353538",
"0.63527596",
"0.6341802",
"0.6339458",
"0.63374597",
"0.63346887",
"0.6327618",
"0.6326926",
"0.6323327",
"0.6321289",
"0.63028",
"0.6299844",
"0.6294684",
"0.6291506",
"0.62909037",
"0.62870616",
"0.6285222",
"0.62822247",
"0.6277559",
"0.6271584",
"0.62711",
"0.6267922",
"0.6265486",
"0.62630713",
"0.62620133",
"0.6255031",
"0.6252634",
"0.6252077",
"0.62506",
"0.6243144",
"0.6240545",
"0.62405413",
"0.6233339",
"0.62268335",
"0.6223949",
"0.62233025",
"0.6222113",
"0.62219673",
"0.6221071",
"0.6220968",
"0.6218415"
] | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_complain
@complain = Complain.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 set_actions\n actions :all\n end",
"def define_action_helpers?; 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 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 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 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 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 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 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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\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",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def duas1(action)\n action.call\n action.call\nend",
"def _handle_action_missing(*args); end"
] | [
"0.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865",
"0.53135896",
"0.52999926",
"0.5297309",
"0.5296569",
"0.5261449",
"0.5247048",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52323204",
"0.52310973",
"0.523081",
"0.5225785",
"0.5219039",
"0.52136266",
"0.5208033",
"0.520763",
"0.5177365",
"0.5175224",
"0.5173357",
"0.5166104",
"0.5162502",
"0.51573396",
"0.5154547",
"0.5153531",
"0.51502854",
"0.51436496",
"0.5142863",
"0.51330835",
"0.5115634",
"0.5115634",
"0.511527",
"0.5109693",
"0.51076853",
"0.5093146",
"0.5090683",
"0.50829846",
"0.50819314",
"0.50670373",
"0.5055505",
"0.5053398",
"0.50504035",
"0.50504035",
"0.5037765",
"0.5027292",
"0.5024484",
"0.50150335",
"0.5014069",
"0.50022113",
"0.5001542",
"0.49981874",
"0.49915564",
"0.49915564",
"0.49880967",
"0.4982312",
"0.49787375",
"0.49786067",
"0.49687737",
"0.49676532",
"0.49602765",
"0.49565676",
"0.49550772",
"0.495342",
"0.49522525",
"0.49463704",
"0.49447197",
"0.49362713",
"0.49328062",
"0.49280638",
"0.49272856",
"0.4927058",
"0.49221697",
"0.4919526",
"0.49185994",
"0.49184805",
"0.49170163",
"0.49168405",
"0.49167764"
] | 0.0 | -1 |
Only allow a trusted parameter "white list" through. | def complain_params
#params.require(:complain).permit(:title, :description, :city, :state, :country, :company)
params.permit(:title, :description, :city, :state, :country, :company)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allowed_params\n ALLOWED_PARAMS\n end",
"def expected_permitted_parameter_names; end",
"def param_whitelist\n [:role, :title]\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def permitted_params\n []\n end",
"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 filtered_parameters; end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\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 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 param_whitelist\n [:rating, :review]\n end",
"def valid_params?; end",
"def permitted_params\n declared(params, include_missing: false)\n end",
"def permitted_params\n declared(params, include_missing: false)\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 filter_parameters; end",
"def filter_parameters; end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def check_params; true; end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def list_params\n params.permit(:name)\n end",
"def check_params\n true\n end",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"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 additional_permitted_params\n []\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"def allow_params_authentication!; 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 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 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 paramunold_params\n params.require(:paramunold).permit!\n end",
"def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"def quote_params\n params.permit!\n end",
"def list_params\n params.permit(:list_name)\n end",
"def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"def all_params; end",
"def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"def user_params\n end",
"def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def params; end",
"def permitted_params\n @wfd_edit_parameters\n end",
"def user_params\r\n end",
"def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"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 params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"def params_permit\n params.permit(:id)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\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 filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\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 argument_params\n params.require(:argument).permit(:name)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\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 whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"def parameters\n nil\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"def special_device_list_params\n params.require(:special_device_list).permit(:name)\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 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"
] | [
"0.71213365",
"0.70527846",
"0.6947171",
"0.6901663",
"0.67342883",
"0.6717481",
"0.668679",
"0.667654",
"0.6660948",
"0.655484",
"0.6525947",
"0.64567953",
"0.64502525",
"0.6450165",
"0.6446098",
"0.6433068",
"0.64118934",
"0.64118934",
"0.63903046",
"0.6379847",
"0.6379847",
"0.63736796",
"0.63605297",
"0.6353668",
"0.6283826",
"0.6277936",
"0.62436706",
"0.6226217",
"0.62238735",
"0.6222201",
"0.6208754",
"0.62079734",
"0.61760926",
"0.6171337",
"0.6166829",
"0.61594605",
"0.61429733",
"0.6134288",
"0.61210173",
"0.6106998",
"0.6097591",
"0.6074265",
"0.6053252",
"0.6039525",
"0.60342395",
"0.6030413",
"0.6017866",
"0.60174304",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60172004",
"0.60154676",
"0.60037804",
"0.6003128",
"0.5999996",
"0.5994808",
"0.59938943",
"0.5992965",
"0.59828913",
"0.5982352",
"0.59762347",
"0.5973914",
"0.5968744",
"0.5964729",
"0.5963057",
"0.5963057",
"0.5956878",
"0.5950747",
"0.5950746",
"0.5946173",
"0.59427863",
"0.59293395",
"0.5928864",
"0.5925602",
"0.5923773",
"0.5918309",
"0.5915812",
"0.59130466",
"0.59129673",
"0.5907004",
"0.59047765",
"0.590452",
"0.59017384",
"0.5899288",
"0.58962125",
"0.58959764",
"0.5893933"
] | 0.0 | -1 |
GET /site_elements GET /site_elements.xml | def index
brand_site_elements = @site_elements.where(brand_id: website.brand_id).order('site_elements.updated_at desc')
@search = brand_site_elements.ransack(params[:q])
if params[:q]
@site_elements = @search.result.order(:name, :version).paginate(page: params[:page], per_page: 50)
else
@site_elements = brand_site_elements.paginate(page: params[:page], per_page: 50)
end
respond_to do |format|
format.html # index.html.erb
format.xml { render xml: @site_elements }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @site_attributes = @site.site_attributes\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_attributes }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @elements = @account.elements\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @elements }\n format.json { render :json => @elements }\n end\n end",
"def index\n @sites = User.find(current_user.id).sites #Site.find(\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @elements = Element.all\n end",
"def index\n @user = self.current_user\n @sites = @user.find_sites(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @sites.to_xml }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @selector_sites = SelectorSite.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @selector_sites }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def index\n @pm_elements = PmElement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pm_elements }\n end\n end",
"def index\n @blocks = @site.blocks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blocks }\n end\n end",
"def show\n @product_site_element = ProductSiteElement.new(site_element_id: @site_element.id)\n @site_element_attachment = SiteElementAttachment.new\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @site_element }\n end\n end",
"def request_elements\n REQUEST_ELEMENTS\n end",
"def show\n @element = @account.elements.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n format.json { render :json => @element }\n end\n end",
"def index\n @websites = Website.find(:all, :order => 'name')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @websites.to_xml }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def index\n @_templates = @site.templates.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @_templates }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/index\" }\n format.xml { render :xml => @sites }\n end\n end",
"def viewable_site_elements\n @viewable_site_elements ||= site_elements.where(id: deduped_site_element_ids, is_document: true)\n end",
"def index\n # seeker_result Site, \"div.site_list\" # , clear_tags: true\n response_service.title = 'Sites'\n smartrender \n end",
"def websites\n self.dig_for_array(\"webSites\")\n end",
"def index\n @pages = []\n website.available_locales.each do |l|\n @pages << {\n url: locale_sitemap_url(locale: l.locale.to_s, format: 'xml'),\n updated_at: 1.day.ago}\n end\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def index\n @sites = Cms::Site.all\n end",
"def index\n authorize Element\n @elements = Element.order(:code).search(params[:search]).page(params[:page])\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def software_site_elements\n @software_site_elements ||= site_elements.where(id: deduped_site_element_ids).where(\"resource_type LIKE '%Software%'\")\n end",
"def show\n @site_attribute = @site.site_attributes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site_attribute }\n end\n end",
"def element(id, params = {})\n get \"elements/#{id}\", {query: params}\n end",
"def show\n @website = Website.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @website.to_xml }\n end\n end",
"def new\n @site_element.show_on_public_site = true\n if params[:products].present?\n @site_element.products = params[:products].split(',').map{|k| Product.find(k)}\n @site_element.is_document = true\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @site_element }\n end\n end",
"def page(site)\n Nokogiri::HTML(RestClient.get(site))\nend",
"def show\n @website = Website.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @website }\n end\n end",
"def show\n @element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def show\n @element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def index\n @sites = Site.all\n end",
"def index\n @sites = Site.all\n end",
"def index\n @sites = Site.all\n end",
"def index\n @sites = Site.all\n end",
"def index\n @sites = Site.all\n end",
"def index\n @sites = Site.all\n end",
"def index\n @products = @site.products.all\n end",
"def feed_elements\n elements.named(definition['feed_elements'])\n end",
"def show\n @site = Site.find(params[:id])\n @user = @site.user\n @project = @site.project\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def get_sites\n\t\ts = get_admin_section \"system.applicationHost/sites\"\n\t IisObjectCollection.new s.Collection, :site, Site, lambda { |site| site.id = s.Collection.Count + 1 }\n end",
"def show\n @elemento = Elemento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @elemento }\n end\n end",
"def show\n @selector_site = SelectorSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @selector_site }\n end\n end",
"def index\n @site_profile_fields = SiteProfileField.find(:all)\n site_profile_page\n site_biz_card\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_profile_fields }\n end\n end",
"def get_sites(site_type=nil)\r\n logger.debug \"Inside Get Sites of AMF controller\"\r\n if site_type.nil?\r\n if params.key?(0) \r\n site_type=params[0]\r\n else\r\n raise \"No site passed because #{params.length} and #{params[0].key?(\"site_type\")} to get_sites #{params.inspect()}\"\r\n end\r\n end\r\n\t\tsite_list=Site.data_sites(site_type)\r\n respond_to do |format|\r\n format.html\r\n format.xml { render :xml => site_list.to_x }\r\n format.amf { \r\n logger.debug \"Returning site_list\"\r\n logger.debug \"Returning #{site_list}\"\r\n render :amf => site_list \r\n }\r\n end\r\n end",
"def show\n #@element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def get_elements(xpath); end",
"def index\n @rooms = Room.find(:all, :conditions => [\"site_id = ?\", params[:site_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rooms }\n end\n end",
"def full_url_for_element element\n \"http://\" + request.env[\"HTTP_HOST\"] + \"/\" + element.page.urlname + \"##{element.name}_#{element.id}\" \n end",
"def list_sites\n r = execute(make_xml('SiteListingRequest'))\n arr = []\n if r.success\n r.res.elements.each('SiteListingResponse/SiteSummary') do |site|\n arr << SiteSummary.new(site.attributes['id'].to_i,\n site.attributes['name'],\n site.attributes['description'],\n site.attributes['riskfactor'].to_f,\n site.attributes['riskscore'].to_f)\n end\n end\n arr\n end",
"def yields_from_sites\n @sites = Yield.all.collect {|x| x.site}.compact.uniq\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def elements\n @resolver.elements\n end",
"def index\n @sitelinks = Sitelink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sitelinks }\n end\n end",
"def find_elements(element_name, response)\n response.body.xpath(\".//x:#{element_name}\", 'x' => response.body.namespace.href)\n end",
"def all_site_details\r\n @nsc.sites\r\n end",
"def index\n headers['Content-Type'] = 'application/xml'\n @routes = website_routes + @opportunity_routes\n @blog_sitemap_route = buttercms_blog_sitemap_url\n end",
"def list_elements(path)\n return @element_list\n end",
"def sites\n request('/web_properties.json').map do |site_data|\n Site.new self, site_data['uid'], site_data['name']\n end\n end",
"def regional_sitelist\n query('txt/wxfcs/regionalforecast/json/sitelist')\n end",
"def index\n @sites = Site.all.order(:created_at)\n\n # @debug = scrape_all\n # @debug = scrape 'http://workingnews.blog117.fc2.com/?xml'\n \n # @spreadsheet = GoogleSpreadsheets::Enhanced::Spreadsheet.find('0ArhV7gTgs6Z8dHlSRUF2SzFXWjlkU1V2d29KR2pkdXc')\n # @worksheet = @spreadsheet.worksheets.find_by(title: 'site_rows')\n # @rows = @worksheet.rows\n # @site_rows = Site.site_rows\n \n # 同期実行\n # Site.sync_with_site_rows\n\n # スクレイピング\n # ApplicationController.helpers.scrape_update\n # ApplicationController.helpers.scrape \"http://alfalfalfa.com/index.rdf\"\n\n respond_to do |format|\n if Rails.env.development?\n format.html { render :html => @sites }\n end\n format.json { render :json => @sites.as_json }\n end\n end",
"def index\n @event_elements = EventElement.all\n end",
"def index\n @links = @panel.links\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end",
"def sites\n result = call(\"Webs\", \"get_web_collection\")\n result.xpath(\"//sp:Web\", NS).map { |web| Site.new(connection, web[\"Url\"].to_s, @depth + 1) }\n end",
"def index\n @list_elements = ListElement.all\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @site }\n format.xml { render :xml => @site }\n end\n end",
"def show\n @microsite = Microsite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @microsite }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/show\" }\n format.xml { render :xml => @site }\n end\n end",
"def websites\n Array(@websites)\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n serialized = []\n Site.all.each do |site|\n attribute = format_site(site)\n serialized.push(attribute)\n end\n render(json:serialized)\n end",
"def index\n @config_elements = ConfigElement.all\n end",
"def index\n @servers = @site.servers\n end",
"def get(url, elem = nil)\n ret = REXML::Document.new(http_get(url))\n if elem\n ary = []\n ret.root.elements.each(\"//#{elem}\") do |e|\n hash = {}\n e.attributes.each { |key, val| hash[key] = val }\n ary << hash\n end\n ret = ary\n end\n ret\n end",
"def index\n @velements = Velement.all\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @sites }\n end\n end",
"def index\n @sites = @organization.sites.order(id: :desc).all\n end",
"def site_list\n @sites = Haiwet::Site.list\n @sites.each.with_index(1) do |site, i|\n puts \"\\n #{i}- #{site.name}\"\n end\n end",
"def index\n @sites = site_list_plus_default\n @site_vars = site_vars\n @_sites = Site.all\n @_site_vars = SiteVar.all\n \n unless params[:_site].blank?\n unless params[:_site] == \"0\"\n @site = Site.find(params[:_site])\n else # a little hackery to get around the fact that our default site can't be looked up\n @site = Site.new\n @site.id = 0\n end\n end\n unless params[:site_var].blank?\n @site_var = SiteVar.find(params[:site_var])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_vars }\n end\n end",
"def index\n #@site_pages = SitePage.all\n end",
"def index\n authorize RegisteredElement\n institution = current_institution\n @elements = RegisteredElement.where(institution: institution).order(:name)\n @unaccounted_prefixes = institution.registered_element_prefixes -\n institution.element_namespaces.map(&:prefix)\n end",
"def elements\n find_by_tag('*')\n end",
"def google_sitemap\n\t\t@urls = []\n\t\t# 1. 305 - Redirected back to the reverse proxy to show old site page.\n\t\tREDIRECTIONS.select {|k,v| v[:action] == 305}.each {|r| @urls.push(r[0])}\n\t\t# 2. All Homepage's (including mainpage)\n\t\tSection.environments().each do |section|\n\t\t\thome = section_homepage_url(section)\n\t\t\t@urls << home if home\n\t\tend\n\t\t# 3. All Pages\n\t\tAsset.find_all_by_resource_type('Page').select {|p| p.published_page?}.each {|p| @urls << site_page_url(p)}\n\n respond_to do |format|\n format.xml\n end\n\tend",
"def show\n @site = Site.find_by(id: params[:id])\n if @site.nil?\n redirect_to action: :index\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def index\n @site=Site.find(params[:site_id])\n end",
"def index\n set_user\n @sites = Site.all\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @sites.to_json }\n end\n end",
"def site_data; end",
"def show\n @project = Project.find(params[:id])\n @sites = @project.spans\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @project }\n end\n end",
"def elements\n begin\n if %w(tags posts).include?(@resource.to_s)\n return parsed_response[@resource.to_s][singular_r_name] || []\n elsif %w(bundles).include?(@resource.to_s)\n return parsed_response[@resource.to_s].empty? ? [] : parsed_response[@resource.to_s].map {|el| el[singular_r_name] } \n end\n rescue NoMethodError => e \n return parsed_response\n end\n end"
] | [
"0.6425705",
"0.6259612",
"0.6259612",
"0.6259612",
"0.6259612",
"0.6259612",
"0.6226994",
"0.6164825",
"0.6164373",
"0.6113549",
"0.604433",
"0.604433",
"0.59716105",
"0.5894841",
"0.58780485",
"0.57920706",
"0.57750475",
"0.57742",
"0.5758718",
"0.5717054",
"0.57089067",
"0.57089067",
"0.57048076",
"0.569575",
"0.56854475",
"0.56330574",
"0.5621171",
"0.5599259",
"0.55950034",
"0.5578154",
"0.5560207",
"0.5543746",
"0.5538404",
"0.55251896",
"0.5520078",
"0.55151075",
"0.55118364",
"0.5492991",
"0.5489427",
"0.5489427",
"0.5482551",
"0.5482551",
"0.5482551",
"0.5482551",
"0.5482551",
"0.5482551",
"0.5475032",
"0.546962",
"0.54680544",
"0.5454534",
"0.5451356",
"0.5449945",
"0.54456574",
"0.5445299",
"0.54440624",
"0.543622",
"0.54276115",
"0.5420161",
"0.54201174",
"0.54161644",
"0.5404984",
"0.53977114",
"0.53891957",
"0.5385044",
"0.53617716",
"0.53541714",
"0.5353517",
"0.5349889",
"0.53496295",
"0.5347176",
"0.53456724",
"0.53287935",
"0.53216267",
"0.53198546",
"0.53171617",
"0.53068984",
"0.530376",
"0.52969074",
"0.52969074",
"0.5294143",
"0.528518",
"0.5282166",
"0.52803564",
"0.5271316",
"0.5265812",
"0.5265812",
"0.5263488",
"0.5256835",
"0.52537423",
"0.5237009",
"0.52363384",
"0.5234613",
"0.52304524",
"0.52263945",
"0.52170503",
"0.520016",
"0.5197903",
"0.5194189",
"0.51938856",
"0.5192624"
] | 0.5355402 | 65 |
GET /site_elements/1 GET /site_elements/1.xml | def show
@product_site_element = ProductSiteElement.new(site_element_id: @site_element.id)
@site_element_attachment = SiteElementAttachment.new
respond_to do |format|
format.html # show.html.erb
format.xml { render xml: @site_element }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @site_attributes = @site.site_attributes\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_attributes }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def index\n @sites = User.find(current_user.id).sites #Site.find(\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def show\n @website = Website.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @website.to_xml }\n end\n end",
"def index\n @user = self.current_user\n @sites = @user.find_sites(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @sites.to_xml }\n end\n end",
"def index\n @selector_sites = SelectorSite.curr_ver.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @selector_sites }\n end\n end",
"def get_xml\n response = @api.request(:get, @location, type: 'xml')\n response.body if response.status == 200\n end",
"def show\n @website = Website.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @website }\n end\n end",
"def index\n @elements = @account.elements\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @elements }\n format.json { render :json => @elements }\n end\n end",
"def show\n @element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def show\n @element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def show\n @element = @account.elements.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n format.json { render :json => @element }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @sites = current_user.sites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sites }\n end\n end",
"def index\n @elements = Element.all\n end",
"def show\n @site_attribute = @site.site_attributes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site_attribute }\n end\n end",
"def index\n @pm_elements = PmElement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pm_elements }\n end\n end",
"def show\n #@element = Element.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def index\n @websites = Website.find(:all, :order => 'name')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @websites.to_xml }\n end\n end",
"def show\n @elemento = Elemento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @elemento }\n end\n end",
"def show\n @selector_site = SelectorSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @selector_site }\n end\n end",
"def index\n @blocks = @site.blocks\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @blocks }\n end\n end",
"def show\n @microsite = Microsite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @microsite }\n end\n end",
"def index\n @_templates = @site.templates.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @_templates }\n end\n end",
"def element(id, params = {})\n get \"elements/#{id}\", {query: params}\n end",
"def index\n @sites = Site.all\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/index\" }\n format.xml { render :xml => @sites }\n end\n end",
"def show\n @site = Site.find(params[:id])\n @user = @site.user\n @project = @site.project\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def index\n # seeker_result Site, \"div.site_list\" # , clear_tags: true\n response_service.title = 'Sites'\n smartrender \n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/show\" }\n format.xml { render :xml => @site }\n end\n end",
"def api_xml(path,method=:get,options={})\n xml_message(amee,\"/data\"+path,method,options)\n end",
"def new\n @site_element.show_on_public_site = true\n if params[:products].present?\n @site_element.products = params[:products].split(',').map{|k| Product.find(k)}\n @site_element.is_document = true\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @site_element }\n end\n end",
"def show\n @site = Site.find_by(id: params[:id])\n if @site.nil?\n redirect_to action: :index\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def full_url_for_element element\n \"http://\" + request.env[\"HTTP_HOST\"] + \"/\" + element.page.urlname + \"##{element.name}_#{element.id}\" \n end",
"def show\n @recycling_site = RecyclingSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @recycling_site }\n end\n end",
"def index\n @sitelinks = Sitelink.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sitelinks }\n end\n end",
"def get_xml(url)\n Nokogiri::XML.parse(get(url), nil, nil, Nokogiri::XML::ParseOptions::STRICT)\n end",
"def index\n headers['Content-Type'] = 'application/xml'\n @routes = website_routes + @opportunity_routes\n @blog_sitemap_route = buttercms_blog_sitemap_url\n end",
"def index\n @pages = []\n website.available_locales.each do |l|\n @pages << {\n url: locale_sitemap_url(locale: l.locale.to_s, format: 'xml'),\n updated_at: 1.day.ago}\n end\n respond_to do |format|\n format.html\n format.xml\n end\n end",
"def show\n @site = Site.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @site }\n format.xml { render :xml => @site }\n end\n end",
"def show\n @site_link = SiteLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site_link }\n end\n end",
"def get_sites(site_type=nil)\r\n logger.debug \"Inside Get Sites of AMF controller\"\r\n if site_type.nil?\r\n if params.key?(0) \r\n site_type=params[0]\r\n else\r\n raise \"No site passed because #{params.length} and #{params[0].key?(\"site_type\")} to get_sites #{params.inspect()}\"\r\n end\r\n end\r\n\t\tsite_list=Site.data_sites(site_type)\r\n respond_to do |format|\r\n format.html\r\n format.xml { render :xml => site_list.to_x }\r\n format.amf { \r\n logger.debug \"Returning site_list\"\r\n logger.debug \"Returning #{site_list}\"\r\n render :amf => site_list \r\n }\r\n end\r\n end",
"def xml(id)\n http.get(\"/nfse/#{id}/xml\") do |response|\n response.headers.fetch(\"Location\") { \"\" }\n end\n end",
"def index\n @rooms = Room.find(:all, :conditions => [\"site_id = ?\", params[:site_id]])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rooms }\n end\n end",
"def page(site)\n Nokogiri::HTML(RestClient.get(site))\nend",
"def show\n @site = Site.find(params[:id], :conditions => ['user_id = ?', current_user.id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def find_elements(element_name, response)\n response.body.xpath(\".//x:#{element_name}\", 'x' => response.body.namespace.href)\n end",
"def rss\n @title = t('titles.news', brand: website.brand_name)\n @description = website.value_for(\"default_meta_tag_description\")\n @news = News.all_for_website(website)\n respond_to do |format|\n format.xml # render rss.xml.builder\n end\n end",
"def show\n @website_use = WebsiteUse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @website_use }\n end\n end",
"def get(url, elem = nil)\n # check last request time, if it was too recent, then wait\n sleep 1.0 if @last_request && (Time.now.to_i - @last_request) < 1\n @last_request = Time.now.to_i\n \n # get result and parse it\n ret = REXML::Document.new(http_get(url))\n \n # if we got something, then parse it\n if elem\n ary = []\n ret.root.elements.each(\"//#{elem}\") do |e|\n hash = {}\n e.attributes.each { |key, val| hash[key] = val }\n ary << hash\n end\n ret = ary\n end\n\n # return result\n ret\n end",
"def index\n @site_profile_fields = SiteProfileField.find(:all)\n site_profile_page\n site_biz_card\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_profile_fields }\n end\n end",
"def show\n @web_info = WebInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @web_info }\n end\n end",
"def get_xml(url, options = {})\n\t\t\t\n\t\t\t# better way of doing this?\n\t\t\t# Map custom keys to the HTTP request values\n\t\t\treqs = {\n\t\t\t\t:character_name => 'n',\n\t\t\t\t:realm => 'r',\n\t\t\t\t:search => 'searchQuery',\n\t\t\t\t:type => 'searchType',\n\t\t\t\t:guild_name => 'n',\n\t\t\t\t:item_id => 'i',\n\t\t\t\t:team_size => 'ts',\n\t\t\t\t:team_name => 't',\n\t\t\t\t:group => 'group'\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\tparams = []\n\t\t\toptions.each do |key, value|\n\t\t\t\tparams << \"#{reqs[key]}=#{u(value)}\" if reqs[key]\n\t\t\tend\n\t\t\t\n\t\t\tquery = '?' + params.join('&') if params.size > 0\n\t\t\t\n\t\t\tbase = self.base_url(options[:locale], options)\n\t\t\tfull_query = base + url + query\n\t\t\t\n\t\t\tputs full_query if options[:debug]\n\t\t\t\n\t\t\tif options[:caching]\n\t\t\t\tresponse = get_cache(full_query, options)\n\t\t\telse\n\t\t\t\tresponse = http_request(full_query, options)\n\t\t\tend\n\t\t\t\t\t\t\n\t\t\tdoc = Hpricot.XML(response)\n\t\t\terrors = doc.search(\"*[@errCode]\")\n\t\t\tif errors.size > 0\nbegin\n\t\t\t\terrors.each do |error|\n\t\t\t\t\traise Wowr::Exceptions::raise_me(error[:errCode], options)\n\t\t\t\tend\nrescue\nend\n\t\t\telsif (doc%'page').nil?\n\t\t\t\traise Wowr::Exceptions::EmptyPage\n\t\t\telse\n\t\t\t\treturn (doc%'page')\n\t\t\tend\n\t\tend",
"def index\n @site=Site.find(params[:site_id])\n end",
"def index\n @links = @panel.links\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end",
"def show\n @pwebsite = Pwebsite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pwebsite }\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def index\n @nodes = Node.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nodes }\n end\n end",
"def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n response.body\r\n end",
"def get_elements(xpath); end",
"def show\n @page = @site.pages.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def index\n @sites = site_list_plus_default\n @site_vars = site_vars\n @_sites = Site.all\n @_site_vars = SiteVar.all\n \n unless params[:_site].blank?\n unless params[:_site] == \"0\"\n @site = Site.find(params[:_site])\n else # a little hackery to get around the fact that our default site can't be looked up\n @site = Site.new\n @site.id = 0\n end\n end\n unless params[:site_var].blank?\n @site_var = SiteVar.find(params[:site_var])\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_vars }\n end\n end",
"def viewable_site_elements\n @viewable_site_elements ||= site_elements.where(id: deduped_site_element_ids, is_document: true)\n end",
"def request_elements\n REQUEST_ELEMENTS\n end",
"def index\n name = @xml.elements['/name'].text\n @sentence = \"Hello #{name} !\"\n render_xml\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def index\n @sites = Site.all.order(:created_at)\n\n # @debug = scrape_all\n # @debug = scrape 'http://workingnews.blog117.fc2.com/?xml'\n \n # @spreadsheet = GoogleSpreadsheets::Enhanced::Spreadsheet.find('0ArhV7gTgs6Z8dHlSRUF2SzFXWjlkU1V2d29KR2pkdXc')\n # @worksheet = @spreadsheet.worksheets.find_by(title: 'site_rows')\n # @rows = @worksheet.rows\n # @site_rows = Site.site_rows\n \n # 同期実行\n # Site.sync_with_site_rows\n\n # スクレイピング\n # ApplicationController.helpers.scrape_update\n # ApplicationController.helpers.scrape \"http://alfalfalfa.com/index.rdf\"\n\n respond_to do |format|\n if Rails.env.development?\n format.html { render :html => @sites }\n end\n format.json { render :json => @sites.as_json }\n end\n end",
"def show\n @project = Project.find(params[:id])\n @sites = @project.spans\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @project }\n end\n end",
"def public_xml\n resource.public_xml\n end",
"def get_listings_xml(url)\n @client.get_content(url)\n end",
"def show\n @site_user_info = SiteUserInfo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site_user_info }\n end\n end",
"def index\n brand_site_elements = @site_elements.where(brand_id: website.brand_id).order('site_elements.updated_at desc')\n @search = brand_site_elements.ransack(params[:q])\n if params[:q]\n @site_elements = @search.result.order(:name, :version).paginate(page: params[:page], per_page: 50)\n else\n @site_elements = brand_site_elements.paginate(page: params[:page], per_page: 50)\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @site_elements }\n end\n end",
"def yields_from_sites\n @sites = Yield.all.collect {|x| x.site}.compact.uniq\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end",
"def index\n @sites = Cms::Site.all\n end",
"def index\n @servers = Server.beating\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @servers }\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.xml { render :xml => @sitio }\n end\n end",
"def show\n @site_var = SiteVar.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @site_var }\n end\n end",
"def software_site_elements\n @software_site_elements ||= site_elements.where(id: deduped_site_element_ids).where(\"resource_type LIKE '%Software%'\")\n end",
"def extract_web_info(report_file, tag, entries)\n entries.each do |e|\n report_file.write(\" <#{tag}>\\n\")\n e.attributes.each_pair do |k,v|\n el = create_xml_element(k,v)\n report_file.write(\" #{el}\\n\")\n end\n\n site = e.web_site\n el = create_xml_element(\"vhost\", site.vhost)\n report_file.write(\" #{el}\\n\")\n\n el = create_xml_element(\"host\", site.service.host.address)\n report_file.write(\" #{el}\\n\")\n\n el = create_xml_element(\"port\", site.service.port)\n report_file.write(\" #{el}\\n\")\n\n el = create_xml_element(\"ssl\", site.service.name == \"https\")\n report_file.write(\" #{el}\\n\")\n\n report_file.write(\" </#{tag}>\\n\")\n end\n report_file.flush\n end",
"def index\n @softwares = Software.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @softwares }\n end\n end",
"def index\n @requests = Request.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @requests }\n end\n end",
"def get(url, elem = nil)\n ret = REXML::Document.new(http_get(url))\n if elem\n ary = []\n ret.root.elements.each(\"//#{elem}\") do |e|\n hash = {}\n e.attributes.each { |key, val| hash[key] = val }\n ary << hash\n end\n ret = ary\n end\n ret\n end",
"def index\n @solicitudes = Solicitud.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @solicitudes }\n end\n end",
"def index\n @settlements = @transaction.settlements.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @settlements }\n end\n end",
"def xml\n @entry ||= open(entry_url).read\n rescue => e\n raise RuntimeError, \"coult not open entry url: #{entry_url} : \\n#{e}\"\n end",
"def index\n @sites = Site.all\n end",
"def index\n @sites = Site.all\n end"
] | [
"0.6393615",
"0.62640053",
"0.62640053",
"0.62640053",
"0.62640053",
"0.62640053",
"0.61647254",
"0.60735124",
"0.60735124",
"0.6057458",
"0.6003926",
"0.59817094",
"0.59798527",
"0.5976412",
"0.5958516",
"0.59091496",
"0.58932716",
"0.58932716",
"0.5887194",
"0.58866256",
"0.58866256",
"0.58593124",
"0.58383197",
"0.5829443",
"0.58271754",
"0.5809091",
"0.5784886",
"0.57480645",
"0.57037085",
"0.568307",
"0.5678418",
"0.567437",
"0.5671894",
"0.5660923",
"0.5639218",
"0.5634653",
"0.56314903",
"0.56167156",
"0.5610438",
"0.5597285",
"0.5550494",
"0.55409986",
"0.55268055",
"0.5513003",
"0.55034876",
"0.5497602",
"0.54890907",
"0.54843694",
"0.54817826",
"0.5459333",
"0.5459305",
"0.54547787",
"0.5451048",
"0.54133826",
"0.5407564",
"0.5379056",
"0.5364241",
"0.5346465",
"0.5346076",
"0.53451115",
"0.53360105",
"0.5333336",
"0.53258944",
"0.53258944",
"0.53180516",
"0.5313401",
"0.5298335",
"0.5297048",
"0.52966005",
"0.52958363",
"0.5290759",
"0.5284539",
"0.5284539",
"0.5284539",
"0.5284539",
"0.5284539",
"0.5284539",
"0.5284539",
"0.5284539",
"0.52791935",
"0.5279022",
"0.52788436",
"0.5270806",
"0.52668685",
"0.5266574",
"0.52645755",
"0.52632374",
"0.525762",
"0.5249665",
"0.5221105",
"0.52187854",
"0.5217455",
"0.5212572",
"0.5205871",
"0.5203115",
"0.52022505",
"0.5201797",
"0.51918066",
"0.5191768",
"0.5191768"
] | 0.6137115 | 7 |
GET /site_elements/new GET /site_elements/new.xml | def new
@site_element.show_on_public_site = true
if params[:products].present?
@site_element.products = params[:products].split(',').map{|k| Product.find(k)}
@site_element.is_document = true
end
respond_to do |format|
format.html # new.html.erb
format.xml { render xml: @site_element }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @website = Website.new params[:website]\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @website }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html { render :template => \"admin_sites/new\" }\n format.xml { render :xml => @site }\n end\n end",
"def new\n @_template = @site.templates.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @_template }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @site }\n format.xml { render :xml => @site }\n end\n end",
"def new\n @element = Element.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def new\n @page = @site.pages.new\n @page.parts << PagePart.new(:name => \"body\")\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n\n @project = Project.find(params[:project_id])\n @site = @project.sites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @selector_site = SelectorSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @selector_site }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @site_link = SiteLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_link }\n end\n end",
"def new\n @elemento = Elemento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @elemento }\n end\n end",
"def new\n @site_attribute = @site.site_attributes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_attribute }\n end\n end",
"def new\n @site_var = SiteVar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_var }\n end\n end",
"def new\n @element = Element.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @element }\n format.json { render :json => @element }\n end\n end",
"def new\n @node = Node.scopied.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @element = Element.new\n @root_category = Category.find(272)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @element }\n end\n end",
"def new\n @recycling_site = RecyclingSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recycling_site }\n end\n end",
"def new\n\t\t@website = Website.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml\t{ render :xml => @website }\n\t\tend\n\tend",
"def new\n @my_sites = current_user.sites.clone\n @site = current_user.sites.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @site = Site.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @pwebsite = Pwebsite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pwebsite }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @system }\n end\n end",
"def new\n @rails_url = RailsUrl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rails_url }\n end\n end",
"def new\n @node = Node.new(:displayed => true)\n @node.template = Template.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @software }\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def new\n @node = Node.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @node }\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(root_url, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @webpage = Webpage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @webpage }\n end\n end",
"def new\n @site = Site.new\n respond_with @site\n end",
"def new\n @webextra = Webextra.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @webextra }\n end\n end",
"def new\n @hostel = Hostel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hostel }\n end\n end",
"def new_site\n \n end",
"def new\n @ep = Ep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ep }\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @web_info = WebInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_info }\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(root_url, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n format.js #new.js.rjs #{render :file => 'sites/new.html.erb'}\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n Changelog.add(@current_user.login, \"Created the site #{@site.name}\")\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @page }\n end\n end",
"def new\n respond_with(@site = Site.new)\n end",
"def new\n @web_location = WebLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @web_location }\n end\n end",
"def new\n @blacklisted_site = BlacklistedSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @blacklisted_site }\n end\n end",
"def new\n @site_user_info = SiteUserInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_user_info }\n end\n end",
"def new\n @title = \"New Networks\"\n @network = Network.new\n @computers = Computer.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @network }\n end\n end",
"def new\n @element = Element.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @element }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |wants|\n wants.html # new.html.erb\n wants.xml { render :xml => @page }\n end\n end",
"def new\n @sitetype = Sitetype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @sitetype }\n end\n end",
"def new\n new_object Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :layout => \"default\" }\n end\n end",
"def new\n @models = self.class.model_class.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @models }\n end\n end",
"def new\n @title = \"New item\"\n @item = ItemTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"def new\n @page = Page.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n #1st you retrieve the customer thanks to params[:customer_id]\n customer = Customer.find(params[:customer_id])\n #2nd you build a new one\n @site = customer.sites.create\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n \n end\n end",
"def new\n @site_banner = SiteBanner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_banner }\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 @site = Site.new\n @site.url = 'http://'\n @site.creator = current_user.name if user_signed_in?\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.js # new.js.erb\n format.json { render json: @site }\n end\n end",
"def new\n @site = Site.new\n\n respond_to do |format|\n format.html { render html: @site, :notice => 'Error: See details below.',\n :flash => { :error => 'Error!' } }\n format.json { render json: @site }\n end\n end",
"def new\n @static_page = StaticPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @static_page }\n end\n end",
"def new\n @static_page = StaticPage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @static_page }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @info = Info.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @info }\n end\n end",
"def new\n @item = Item.factory('local')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item }\n end\n end",
"def new\n @want = Want.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @want }\n end\n end",
"def new\n @rssnew = Rssnews.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @rssnew }\n end\n end",
"def new\n @template = Template.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @template }\n end\n end",
"def new\n @block = @site.blocks.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @block }\n end\n end",
"def new\n @page = current_cms.pages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page }\n end\n end",
"def new\n @latestinfo = Latestinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @latestinfo }\n end\n end",
"def new_rest\n @entry_item = EntryItem.new\n\n respond_to do |format|\n #format.html # new.html.erb\n format.xml { render :xml => @entry_item }\n end\n end",
"def new\n @estagio = Estagio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estagio }\n end\n end",
"def new\n @request = Request.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @scraper = Scraper.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @scraper }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def newX\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end",
"def new\n @request = Request.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @request }\n end\n end"
] | [
"0.7509086",
"0.7509086",
"0.7509086",
"0.7509086",
"0.7509086",
"0.7509086",
"0.7509086",
"0.7509086",
"0.72165865",
"0.7215627",
"0.7187658",
"0.7089282",
"0.7039676",
"0.6967446",
"0.6956999",
"0.6946106",
"0.6940227",
"0.69271636",
"0.68940675",
"0.68838245",
"0.681854",
"0.6810222",
"0.6761571",
"0.6711548",
"0.66845465",
"0.66588485",
"0.6639651",
"0.6634104",
"0.66333115",
"0.6618033",
"0.66115594",
"0.6604876",
"0.660156",
"0.660156",
"0.660156",
"0.660156",
"0.6586874",
"0.65815806",
"0.6576189",
"0.6576189",
"0.65733016",
"0.6564042",
"0.655938",
"0.65285045",
"0.65221095",
"0.6521096",
"0.6507492",
"0.650138",
"0.64789253",
"0.647513",
"0.647513",
"0.647513",
"0.6471569",
"0.6463107",
"0.64482534",
"0.6431568",
"0.64210105",
"0.6402229",
"0.63874817",
"0.6378387",
"0.6371954",
"0.63613534",
"0.6359416",
"0.6357996",
"0.6352924",
"0.63428164",
"0.6338964",
"0.6337499",
"0.6323825",
"0.6323825",
"0.6323825",
"0.6323825",
"0.6323825",
"0.6323825",
"0.6319221",
"0.63191885",
"0.6312295",
"0.63081306",
"0.63074124",
"0.6305575",
"0.62974864",
"0.6293256",
"0.6293256",
"0.6290089",
"0.6290089",
"0.62871134",
"0.6283371",
"0.62751365",
"0.627094",
"0.6267881",
"0.62624764",
"0.62611824",
"0.626007",
"0.6256906",
"0.6256549",
"0.62557113",
"0.62541765",
"0.6252231",
"0.6244027",
"0.6244027"
] | 0.6716113 | 23 |
POST /admin/site_elements/upload Callback after uploading a file directly to S3. Adds the temporary S3 path to the form before creating new software. | def upload
@direct_upload_url = params[:direct_upload_url]
respond_to do |format|
format.js
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def upload\n begin\n @site = Site.find(params[:id])\n rescue\n puts \"Requested site id \" + params[:id] + \" not found\"\n flash[:danger] = \"The requested site does not exist in the system.\"\n redirect_to sites_path \n return\n end\n\n # AWS S3 parameters which will be encoded in the jquery fileupload widget\n # This is important stuff as it is the security part allowing the upload to succeed\n s3_secure = (S3_DEV_PROTOCOL != 'http')\n @s3_direct_post = S3_BUCKET.presigned_post(key: \"uploads/#{SecureRandom.uuid}/${filename}\", success_action_status: 201, acl: :public_read, secure: s3_secure)\n if S3_DEV_HOST\n s3_url = S3_DEV_PROTOCOL + '://' + S3_BUCKET.name() + '.' + S3_DEV_HOST + ':' + S3_DEV_PORT + '/'\n else\n s3_url = @s3_direct_post.url\n end\n @s3_post_data = {url: s3_url, fields: @s3_direct_post.fields.to_json.html_safe, host: @s3_direct_post.url.host}\n end",
"def perform_multipart_upload\n s3o = S3Object.find_by(uri: @params[:s3_object_uri]) || S3Object.new\n s3o.uri = @params[:s3_object_uri]\n s3o.file = @params[:file]\n s3o.bucket = handle_bucket\n s3o.key = @params[:key]\n s3o.content_type = @params[:file].content_type\n s3o.size = File.size(s3o.file.path)\n s3o.md5 = Digest::MD5.file(s3o.file.path).hexdigest\n s3o.save!\n\n [:created, :xml, XmlAdapter.uploaded_object(\"#{@request.host}:#{@request.port}\", s3o)]\n end",
"def upload(bucket, file); end",
"def quick_s3_upload\n end",
"def create\n if params['file'] == nil\n return redirect_to :action => :new\n end\n\n temp_file_path = params['file'].tempfile.path\n inferred_type = infer_type(temp_file_path)\n random_name = SecureRandom.uuid\n\n upload_file(random_name, temp_file_path)\n\n @upload = Upload.new(upload_params)\n @upload['uploadDate'] = Time.now\n @upload['file_extension'] = inferred_type\n @upload['s3_name'] = random_name\n @upload['full_text'] = extract_text(temp_file_path, inferred_type)\n\n if @upload.save\n redirect_to :action => :index, notice: 'Upload was successfully created.'\n else\n render :new\n end\n end",
"def save_file(upload)\n return false if upload.blank?\n name = self.id.to_s + \".\" + upload.original_filename\n\n self.aws_connect()\n \n # store the file to Amazon S3\n AWS::S3::S3Object.store(name, upload, 'assetmngr', :access => :public_read)\n self.filename = name\n self.save\n end",
"def upload_file\n upload_thumb if Rails.configuration.thumbnails_enabled\n file_s3_obj.write(@file.tempfile.open, content_type: @file.content_type)\n end",
"def s3_upload(item)\n filepath = item.zip_file_path\n s3_key = item.s3_path\n s3_path = \"s3://#{s3_bucket}/#{s3_key}\"\n message = \"Uploading: #{filepath} to #{s3_path}\".color(:green)\n message = \"NOOP: #{message}\" if @options[:noop]\n puts message\n return if @options[:noop]\n\n s3.put_object(\n body: IO.read(filepath),\n bucket: s3_bucket,\n key: s3_key,\n )\n end",
"def file_upload\n tmp = params[:configfile]\n file = File.join(\"public\", \"uploads\", params[:configfile].original_filename)\n FileUtils.cp tmp.path, file\n puts \"File uploaded to: public/uploads\"\n # Put up file load success alert?\n redirect_to(\"/dashboard/manage\", :notice => \"File #{params[:configfile].original_filename} uploaded\")\n end",
"def uploaded_file_path\n FileServices::Uploader.perform(@file, upload_path)\n end",
"def upload\n self._create params[:upfile], params[:pictitle]\n end",
"def upload_file\n #TODO\n end",
"def upload(tempfile, filename)\n Rails.logger.debug \" Uploading filename...\"\n s3_path = File.join(self.full_path_prefix, filename)\n AWS::S3::S3Object.store(s3_path, tempfile.open, AWS_CONFIG['s3']['bucket_name'], :access => :public_read) # reopen the tempfile and write directly to S3\n Rails.logger.debug \" ** Uploaded image to S3: #{s3_path}\"\n ensure\n # tempfile.unlink\n end",
"def upload\n secure_silence_logs do\n return bad_request unless params[:file] && params[:title] && current_account\n is_file = params[:file].respond_to?(:path)\n if !is_file && !(URI.parse(params[:file]) rescue nil)\n return bad_request(:error => \"The 'file' parameter must be the contents of a file or a URL.\")\n end\n \n if params[:file_hash] && Document.accessible(current_account, current_organization).exists?(:file_hash=>params[:file_hash])\n return conflict(:error => \"This file is a duplicate of an existing one you have access to.\")\n end\n params[:url] = params[:file] unless is_file\n @response = Document.upload(params, current_account, current_organization).canonical\n render_cross_origin_json\n end\n end",
"def save_tmp_file(upload_hash)\n\n tmp_dir = \"./public/tmp\"\n image = File.binread(upload_hash[\"image\"][:tempfile]) # open image file\n\n f = File.new \"#{tmp_dir}/#{upload_hash[\"image\"][:filename]}\", \"wb\"\n f.write(image)\n f.close if f\n\n puts \"save_tmp_file() - uploaded file saved to temp directory!\"\n url = save_file_to_s3_bucket(\"prototype-jv\", \"#{upload_hash[\"image\"][:filename]}\")\n\nend",
"def upload()\n obj = @mgr.s3res.bucket(@mgr[\"Bucket\"]).object(@s3key)\n @mgr.log(:info,\"Uploading cloudformation stack template #{@stackdef}:#{@filename} to s3://#{@mgr[\"Bucket\"]}/#{@s3key}\")\n template = @mgr.load_template(\"s3\", \"cfnput\")\n @mgr.symbol_keys(template)\n @mgr.resolve_vars(template, :api_template)\n params = template[:api_template]\n params[:body] = @raw\n obj.put(params)\n end",
"def upload\r\n \r\n end",
"def upload\n uploaded_io = params[:file]\n File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|\n file.write(uploaded_io.original_filename) \n end\n end",
"def upload\n end",
"def upload\n end",
"def create\n\n @upload = Upload.new(form_params)\n @upload.user = current_user\n\n add_breadcrumb SystemConfigFieldCustomization.find_by(table_name: 'uploads', action_name: 'new')&.label || \"Upload Template\"\n\n respond_to do |format|\n if @upload.save\n notify_user(:notice, \"File was successfully uploaded.\")\n # create a job to process this file in the background\n create_upload_process_job(@upload)\n\n format.html { redirect_to uploads_url }\n format.json { render :json => @upload, :status => :created, :location => @upload }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @upload.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def upload_to_s3(info, file_name)\n bucket_name = 'techops-tests'\n\n to_json_file(info, file_name)\n\n s3 = Aws::S3::Resource.new(\n region: 'ap-southeast-2',\n access_key_id: $options[:s3_key],\n secret_access_key: $options[:s3_secret]\n )\n\n file = File.basename file_name\n obj = s3.bucket(bucket_name).object(file)\n\n if obj.upload_file(file)\n puts \"Uploaded #{file} to bucket #{bucket_name}\"\n File.delete(file_name)\n else\n puts \"Could not upload #{file} to bucket #{bucket_name}!\"\n end\nend",
"def upload\n\t AWS.config(access_key_id: @access_key, secret_access_key: @access_secret)\n\t s3 = AWS::S3.new \n\t key = File.basename(@zipfile_name)\n\t s3.buckets[@bucket_name].objects[key].write(:file => @zipfile_name)\n\t puts \"Uploading file #{@zipfile_name} to bucket #{@bucket_name}.\"\n\t FileUtils.rm_rf @zipfile_name\n\t end",
"def upload(file)\n # Upload the given file\n AWS::S3::S3Object.store( file,\n open( file ),\n BUCKET,\n :access => :public_read )\n\n # display the URL of the file just uploaded\n puts AWS::S3::S3Object.url_for((file), BUCKET)[/[^?]+/]\nend",
"def call\n validate\n upload_to_s3\n renamed_filename\n end",
"def upload(bucket, key)\n connect_to_s3\n AWS::S3::S3Object.store(key, File.open(temp_file_path, 'r'), bucket, :access => :public_read)\n AWS::S3::S3Object.url_for(key, bucket, :authenticated => false)\n end",
"def upload_bucket\n ::AWS::S3.new( { :secure => false } ).buckets['s3.documentcloud.org']\n end",
"def upload_file(element, file_path)\n puts file_path\n element.send_keys(file_path.tr('/', '\\\\'))\n end",
"def upload\n \tset_up_instances_variable\n \tuploaded_io = @tree.file\n \t@nome_arquivo = Rails.root.join('public', 'uploads', uploaded_io.original_filename)\n \tFile.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|\n \t\tfile.write(uploaded_io.read)\n \tend\n \tler_texto @nome_arquivo\n end",
"def upload_to_s3(s3)\n # do some validity checks\n if uploaded?\n logger.warn \"email #{id} already uploaded\"\n return\n end\n email_file = temp_filename\n raise \"missing raw file (#{email_file}) for email #{id}\" unless File.exist?(email_file)\n\n key = gen_s3_key\n if s3.upload(email_file, key)\n update_attributes(:s3_key => key, :size => File.size(email_file))\n FileUtils.rm email_file # Delete file from disk\n end \n end",
"def upload_simple\r\n \r\n end",
"def upload(file_path)\n file_name = File.basename(file_path)\n object = @bucket.objects[file_name]\n object.write(:file => file_path)\n object.public_url\n end",
"def ensure_upload_configured!(payload)\n return if s3_bucket\n\n raise UPLOAD_MESSAGE.gsub('%<identifier>s', payload.identifier)\n end",
"def upload\n files_saved = 0\n # Build product images from upload\n\t\tparams[:file].each do |i|\n if i[:file_data] && !i[:file_data].blank?\n new_file = UserUpload.init(i[:file_data])\n if new_file.save\n files_saved += 1\n end\n end\n end\n \n flash[:notice] = \"#{files_saved} file(s) uploaded.\"\n \n if params[:modal]\n redirect_to :action => 'image_library' and return\n else\n redirect_to :action => 'index' and return\n end\n end",
"def create\n @vendor_doc = VendorDoc.new(params[:vendor_doc])\n\t#@vendor_doc.document = params[:document]\n # the file itself has already be loaded to S3 by the plupload script,\n # so we only need to save the filename\n\n respond_to do |format|\n if @vdocs_requirement.vendor_docs << @vendor_doc\n flash[:notice] = 'VendorDoc was successfully created.'\n format.html { redirect_to(@vendor_doc) }\n format.xml { render :xml => @vendor_doc, :status => :created, :location => @vendor_doc }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @vendor_doc.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def upload\n uploaded_io = params[:address][:file]\n File.open(Rails.root.join('public', 'uploads', uploaded_io.original_filename), 'wb') do |file|\n file.write(uploaded_io.read)\n end\nend",
"def upload_file( id_object, file_to_upload, folder_on_s3 )\n \n file_name = id_object.to_s + \"-\" + file_to_upload.original_filename.to_s\n path_uploaded_files = Rails.root.join('public','uploaded-files')\n uploaded_file = path_uploaded_files.to_s + \"/\" + file_name\n\n unless Dir.exist?(path_uploaded_files)\n FileUtils.mkdir_p(path_uploaded_files)\n end\n\n File.open(uploaded_file, 'wb') do |file|\n file.write(file_to_upload.read)\n end \n\n file_on_s3 = folder_on_s3 + \"/\" + file_name\n upload_file_to_aws_s3(uploaded_file, file_on_s3)\n\n FileUtils.rm(uploaded_file.to_s)\n\n end",
"def upload\n create_document\n \n render_upload\n end",
"def save_file_to_s3_bucket(file)\n\n bucket = \"prototype-jv\"\n temp_file = \"./public/swap/#{file}\"\n s3_file_path = \"imageuploader/#{file}\"\n\n connect_to_s3()\n s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])\n obj = s3.bucket(bucket).object(s3_file_path)\n\n if obj.exists? # file already exists in bucket\n cleanup_swap_dir(file) # being called by process_photo() in photo_upload, review for Upload to Cloud\n puts \"Image already in bucket!\"\n else\n obj.upload_file(temp_file) # put file in bucket\n cleanup_swap_dir(file) # being called by process_photo() in photo_upload, review for Upload to Cloud\n puts \"Image uploaded to bucket!\"\n end\n\nend",
"def upload_file(file_upload, owner)\n image = MiniMagick::Image.open(file_upload.tempfile.path)\n image.resize \"500x500>\"\n image.format \"jpeg\"\n\n tempfile = Tempfile.new \"item_picture\"\n image.write(tempfile)\n\n owner = \"#{current_user.id}/#{owner}\"\n\n upload = Upload.find_by(owner: owner) || Upload.new(owner: owner)\n\n upload.mime_type = \"image/jpeg\"\n upload.extension = \".jpeg\"\n upload.body = tempfile.read\n\n if upload.save\n StoreUploadToCloudJob.perform_later upload\n\n upload\n end\n end",
"def create_multipart_upload\n self.s3_object||= Upload.get_s3_object(self.object_key)\n self.multipart_upload = s3_object.multipart_upload(\n content_type: params[:type],\n server_side_encryption: S3BrowserMultipart::Engine.\n config.s3_config[:server_side_encryption]\n )\n self.upload_id = self.multipart_upload.upload_id\n Rails.logger.warn \"Created multipart_upload_id: #{self.upload_id} object_key: #{self.object_key}\"\n end",
"def upload local_file_path, storage_file_path, encryption_key: nil\n unless @bucket.file storage_file_path\n @bucket.create_file local_file_path, storage_file_path,\n encryption_key: encryption_key\n end\n end",
"def upload(config={})\n\n\t\tfile_name = config.delete(:file_name)\n\t\tpath_to_s3_folder = config.delete(:path_to_s3_folder)\n\n\t\tif file_name.nil? || file_name.empty?\n\t\t\traise ArgumentError, \"file_names is either empty or contains no values\"\n\t\telsif file_name==''\n\t\t\traise ArgumentError, \"File Names is passed as empty string. Pass appropriate values\"\n\t\tend\n\n\t\tfile_names = Array.new\n\t\tfile_names = file_name if file_name.is_a? Array\n\n\t\tfile_names.push(file_name) if file_name.is_a? String\n\t\tfile_names.each {|file|\n\t\t\t#raise ArgumentError, \"File name does not exist in the main directory\" if File.exists?(file)==false\n\t\t\tfinal_file_path = path_to_s3_folder + file\n\t\t\[email protected][@bucket_name].objects[final_file_path].write(:file => file)\n\t\t\tputs \"#{file} successfully uploaded\"\n\t\t} unless file_names.nil?\n\tend",
"def client_side_multipart_upload\n end",
"def dropbox_upload\n\t\tid = params[:account_id]\n\t\taccount = current_user.dropbox_accounts.find(id)\n\t\tdbsession = DropboxSession.deserialize(account.session)\n\t\tuploaded_io = params[:upload_file]\n\n\t\tclient = DropboxClient.new(dbsession, DROPBOX_APP_MODE)\n\t\tFile.open(Rails.root.join('public', uploaded_io.original_filename), 'wb') do |file|\n\t\t\tfile.write(uploaded_io.read)\n\t\tend\n\n\t\tfile = File.open(Rails.root.join('public', uploaded_io.original_filename), \"r\")\n\t\tclient.put_file( uploaded_io.original_filename, file)\n\n\t\tflash[:success] = 'Yahooo'\n\t\tredirect_to clouds_path\n\tend",
"def upload_file(filename, file_path=\"\")\n frm.file_field(:id=>\"upload\").set(file_path + filename)\n if frm.div(:class=>\"alertMessage\").exist?\n sleep 2\n upload_file(filename)\n end\n end",
"def transfer_and_cleanup\n direct_upload_url_data = DIRECT_UPLOAD_URL_FORMAT.match(self.direct_upload_url)\n s3 = AWS::S3.new\n self.image = URI.parse(URI.escape(self.direct_upload_url))\n self.save\n s3.buckets[Rails.configuration.aws[:bucket]].objects[direct_upload_url_data[:path]].delete\n end",
"def add_uploaded_file(shf_app)\n shf_app.uploaded_files << create(:uploaded_file, actual_file: File.open(UPLOAD_PNG_FILE))\n end",
"def file_upload_wip()\n logger.debug \"\\r\\n\\r\\n!! ------ in upload/file_upload -----\"\n logger.debug params[:datafile].original_filename\n logger.debug params\n logger.debug \"\\r\\n!! ===========================\\r\\n\"\n is_successful = true\n\n if params[:datafile]\n tmp = params[:datafile].tempfile\n file = File.join( \"public/uploads\", params[:datafile].original_filename )\n FileUtils.cp tmp.path, file\n# \n # name = params[:datafile].original_filename\n # directory = \"public/uploads\"\n # path = File.join(directory, name)\n # File.open(path, \"wb\") { |f|\n # f.write( params[:datafile].read )\n # }\n else\n is_successful = false\n end\n\n redirect_to upload_path()\n end",
"def uploadFile(key = \"\")\n key = 0 < key.length ? key : self.dispatched.fileName\n self.bucket.put(key, self.string)\n self.clear\n end",
"def file_upload\n redirect_to wip_path()\n # TODO file_upload_wip\n end",
"def store!\n # Upload the file\n prefix = \"#{Time.now.strftime(\"%Y%m%d%H%M%S\")}\"\n fname = prefix+(@file.respond_to?(:original_filename) ? @file.original_filename : File.basename(@file))\n o = s3_bucket.objects[\"#{asset_path}#{fname}\"]\n o.write(Pathname.new(@file.path), {\n acl: :public_read,\n content_type: MIME::Types.type_for(@file.path).first.to_s\n })\n\n # Set the public_url attribute\n remote_url = o.public_url.to_s\n self.set(public_url: remote_url)\n self.this.update(public_url: remote_url)\n end",
"def upload_file\n if !params['upload_file'].nil?\n file = params['upload_file']\n file_upload(file)\n else\n p \"filename is empty!!!\"\n end\n end",
"def s3_upload( file_name, destination_name )\n #log(\"Uploading #{file_name} to S3 as #{destination_name} ...\")\n #load keys\n json = File.read(S3KEYS)\n ak = JSON.parse(json)\n aws_access_key_id = ak['aws_access_key_id'] \n aws_secret_access_key = ak['aws_secret_access_key']\n\n #establish S3 connection \n s3 = RightAws::S3.new(aws_access_key_id, aws_secret_access_key, {:logger =>Logger.new( File.open( LOG_FILE, 'a' ) )})\n bucket = s3.bucket(IOS_BUILDS_BUCKET)\n #upload file \n file = File.open( file_name )\n bucket.put( destination_name, file ) \nend",
"def upload\n\n #http://www.dropzonejs.com/\n session[:current_folder] = params[:folder_id]\n uploaded_file = params[:file]\n folder = params[:folder_id]\n mixpanel_tab_event(\"My Vault\", \"Upload File\")\n\n # upload file to box from tmp folder\n temp_file = File.open(Rails.root.join('tmp', uploaded_file.original_filename), 'wb')\n begin\n temp_file.write(uploaded_file.read)\n temp_file.close\n box_user = Box.user_client(session[:box_id])\n box_file = box_user.upload_file(temp_file.path, folder)\n\n rescue => ex\n puts ex.message\n ensure\n File.delete(temp_file)\n end\n\n flash[:notice] = \"Successfully Uploaded!\"\n respond_to do |format|\n format.json{ render :json => {} }\n end\n end",
"def upload_file\n filename = Tk::getOpenFile\n begin\n unless filename.empty?\n $file_progress_variable = TkVariable.new\n file = File.open(filename, 'rb')\n name = File.basename(filename)\n # test to see if the file is bigger than 100 MB for multipart upload\n if file.size > PART_SIZE\n input_opts = {\n bucket: $bucket,\n key: name,\n }\n mpu_create_response = $s3.client.create_multipart_upload(input_opts)\n total_parts = file.size.to_f / PART_SIZE\n current_part = 1\n file.each_part do |part|\n $s3.client.upload_part(body: part,\n bucket: $bucket,\n key: name,\n part_number: current_part,\n upload_id: mpu_create_response.upload_id)\n percent_complete = (current_part.to_f / total_parts.to_f) * 100\n percent_complete = 100 if percent_complete > 100\n percent_complete = sprintf('%.2f', percent_complete.to_f)\n puts \"percent complete: #{percent_complete}\"\n current_part += 1\n end\n input_opts = input_opts.merge(upload_id: mpu_create_response.upload_id)\n parts_resp = $s3.client.list_parts(input_opts)\n input_opts = input_opts.merge(multipart_upload: {parts: parts_resp.parts.map do |part|\n { part_number: part.part_number,\n etag: part.etag }\n end })\n $s3.client.complete_multipart_upload(input_opts)\n else\n obj = $s3.bucket($bucket).object(name)\n obj.upload_file(filename)\n file.close\n end\n $bucket_item_window.destroy\n open_bucket\n end\n rescue => e\n Tk.messageBox('type' => 'ok',\n 'icon' => 'error',\n 'title' => 'Cannot Open File',\n 'message' => \"Cannot Open File #{e}\")\n end\n end",
"def multipart_upload\n end",
"def construct_form_html(hidden_fields, bucket, secure = true, html_options = {}, &block)\n # now build the html for the form\n form_tag(secure == false ? \"http://#{bucket}.s3.amazonaws.com\" : \"https://#{bucket}.s3.amazonaws.com\", build_form_options(html_options)) do\n hidden_fields.map do |name, value|\n hidden_field_tag(name, value)\n end.join.html_safe + \"\n <!-- The fileupload-buttonbar contains buttons to add/delete files and start/cancel the upload --> \n <div class='row fileupload-buttonbar'>\n <div class='col-lg-7'>\n <span class='btn btn-success fileinput-button'>\n <i class='glyphicon glyphicon-plus'></i>\n <span>Add files...</span>\n \".html_safe +\n file_field_tag(:file, :multiple => true) + \"\n </span>\n <button type='submit' class='btn btn-primary start'>\n <i class='glyphicon glyphicon-upload'></i>\n <span>Start upload</span>\n </button>\n <button type='reset' class='btn btn-warning cancel'>\n <i class='glyphicon glyphicon-ban-circle'></i>\n <span>Cancel upload</span>\n </button>\n <button type='button' class='btn btn-danger delete'>\n <i class='glyphicon glyphicon-trash'></i>\n <span>Delete</span>\n </button>\n <input type='checkbox' class='toggle'></input>\n <!-- The loading indicator is shown during file processing -->\n\t <span class='fileupload-loading'></span>\n </div>\n <!-- The global progress information -->\n <div class='col-lg-5 fileupload-progress fade'>\n <!-- The global progress bar -->\n <div class='progress progress-striped active' role='progressbar' aria-valuemin='0' aria-valuemax='100'>\n <div class='progress-bar progress-bar-success' style='width: 0%;'></div>\n </div>\n <!-- The extended global progress information -->\n <div class='progress-extended'> </div>\n </div>\n </div>\n <!-- The table listing the files available for upload/download -->\n <table role='presentation' class='table table-striped' id='upload_files'>\n <tbody class='files'></tbody>\n </table>\".html_safe + (block ? capture(&block) : '')\n end\n end",
"def upload\n do_upload(self.class.upload_class)\n end",
"def upload_file_url\n \"file://#{upload_full_path}\"\n end",
"def upload(resource, filename)\n _validate_presence_of resource, filename\n\n response = Github::S3Uploader.new(resource, filename).send\n response.body\n end",
"def uploaded\n Rails.logger.debug \"*** post S3 hook called\"\n if EncodingStrategy == 'cloud'\n encode\n elsif EncodingStrategy == 'transcode'\n transcode\n end\n end",
"def create_upload_request\n call(:post, upload_path)\n end",
"def create\n puts \"#{params[:attachment]}\"\n raise \"#{params[:attachment]}\"\n @temp_upload = Prototype.new(params[:attachment])\n\n @upload = Prototype.where(:upload_file_name => @temp_upload.upload_file_name).first\n\n if @upload.nil?\n @upload = Prototype.create(params[:attachment])\n else\n if @upload.upload_file_size.nil?\n @upload.upload_file_size = @temp_upload.upload_file_size\n else\n @upload.upload_file_size += @temp_upload.upload_file_size\n end\n end\n\n p = params[:attachment]\n name = p[:attachment].original_filename\n directory = \"uploads\"\n\n path = File.join(directory, name.gsub(\" \",\"_\"))\n puts(path)\n File.open(path, \"ab\") { |f| f.write(p[:attachment].read) }\n\n respond_to do |format|\n if @upload.save\n format.html {\n render :json => [@upload.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: {files: [@upload.to_jq_upload]}, status: :created, location: @upload }\n else\n format.html { render action: \"new\" }\n format.json { render json: @upload.errors, status: :unprocessable_entity }\n end\n end\n end",
"def after # load back file from S3 and process it\n handle_after(Folio::S3::CreateFileJob)\n end",
"def upload_file\n \n # remember the filename\n tempfile = params[\"file_to_upload\"]\n \n # wenn ich keinen string bekommen habe und auch ueberhaupt was ankam (kein tag_edit)\n unless tempfile.nil?\n \n # if just a string arrived\n if tempfile.instance_of?(String)\n flash[:notice] = \"please select a valid file\"\n redirect_to :action => \"index\"\n \n # when a file arrived\n elsif tempfile.instance_of?(Tempfile)\n \n # delete file if too big\n if File.size?(tempfile) > MAX_FILESIZE\n File.delete(tempfile.local_path)\n flash[:notice] = \"File too large (maximal 10 MB allowed)\"\n redirect_to :action => \"index\"\n\n # if it is a valid mp3\n else\n # save variable for view\n @original_name = tempfile.original_filename\n # read id3 information\n @tag = ID3Lib::Tag.new(tempfile.local_path)\n # copy the file to the upload directory\n FileUtils.copy(params[:file_to_upload].local_path, tmp_filename)\n logger.info(\"new file from #{current_user.login} copied to : #{tmp_filename}\")\n\n flash[:notice] = \"File Uploaded\"\n end\n end\n else\n \n # hier komme ich hin, wenn nichts hochgeladen wurde, sondern der tag editiert\n \n if params[\"original_name\"].nil?\n flash[:notice] = \"No File selected (depp)\"\n redirect_to :action => \"index\"\n else \n @original_name = params[\"original_name\"]\n @tag = ID3Lib::Tag.new(tmp_filename)\n end\n end\n end",
"def tag_and_upload(file, date = Date.current, s3_resource, bucketname,\n storage_class: DEFAULT_STORAGE_CLASS)\n date_tags = Backup.aws_date_tags(date)\n prefix = Backup.s3_backup_bucket_full_prefix(date)\n obj = s3_resource.bucket(bucketname).object(prefix + File.basename(file))\n obj.upload_file(file.path, { tagging: date_tags, storage_class: storage_class })\n end",
"def uploadS3(name, file, prefz)\n return [false, \"S3 misconfigured\"] if prefz[:user].empty? && prefz[:host].empty? && prefz[:path].empty? && prefz[:url].empty? && prefz[:pass].empty?\n s3 = AFAmazonS3Client.alloc.initWithAccessKeyID(prefz[:user].strip, secret: prefz[:pass].strip)\n puts \"#{prefz[:user].strip.inspect} #{prefz[:pass].strip.inspect}\"\n bucket, path = prefz[:path].gsub(/^\\//, '').split('/', 2)\n s3.bucket = bucket\n NSLog(\"S3 bucket #{bucket}\")\n url = path.nil? ? \"https://#{prefz[:host]}/#{bucket}/\" : \"https://#{prefz[:host]}/#{bucket}/#{path}/#{name}\"\n NSLog(\"S3 destinationPath #{url}\")\n params = { \"Content-Type\" => \"image/png\", \"acl\" => \"public-read\" }\n s3.postObjectWithFile(file, destinationPath: \"/\", parameters: params,\n progress: lambda do |bytesWritten, totalBytesWritten, totalBytesExpectedToWrite|\n stats = (totalBytesWritten / (totalBytesExpectedToWrite * 1.0) * 100)\n NSLog(\"S3: #{file} uploaded #{stats}\")\n end,\n success: lambda do |response|\n NSLog(\"S3: #{file} uploaded successfully.\")\n uploadSuccess(url + \"/#{name}\")\n end,\n failure: lambda do |error|\n NSLog(\"S3: #{file} upload error: #{error.localizedDescription}\")\n uploadFailure(\"S3 Error: #{error.localizedDescription}\")\n end\n )\n nil\n end",
"def adm_upload_selected\n if params[:upload].nil?\n flash.now[:error]='Es wäre schon gut, vor dem Upload eine Datei auszuwählen'\n else\n fpath=params[:upload].tempfile\n fbasename=File.basename(params[:upload].original_filename)\n # tempf=File.open(fpath,'r:BOM|UTF-8')\n FileUtils.cp fpath, AMP_DIR+'/'+fbasename # Throws exception if it fails\n # tempf.close\n File.unlink(fpath) # Throws exception if it fails\n # Put information on it into DB.\n # Only adds to DB if not exists yet, otherwise old entry is kept\n added_info=Userpage.new_page_with_default(fbasename)\n if added_info.kind_of?(Array)\n if added_info.length == 0\n flash.now[:info]=\"Neue Version von #{fbasename} gespeichert.\"\n else\n flash.now[:error]=\"Fehler beim Speichern in die Datenbank: \"+added_info.to_sentence\n end\n else\n flash.now[:info]=\"Datei #{fbasename} gespeichert.\"\n end\n end\n prepare_admin_home_data\n render admin_pages_home_path\n end",
"def upload_file_to_aws(file_to_upload, content_type)\n\tputs \"Uploading file: \" + file_to_upload + \" to aws\"\n\tresponse = request_put(file_to_upload, content_type)\n\tputs response\nend",
"def upload_file\n file = google_session.upload_from_file(file_params[:file].tempfile,\n file_params[:file].original_filename)\n collection.add(file)\n google_session.root_collection.remove(file)\n render json: 'Upload Successful'\n end",
"def save_file_to_s3_bucket(bucket, file)\n\n image_path = \"./public/tmp/#{file}\"\n connect_to_s3()\n s3 = Aws::S3::Resource.new(region: ENV['AWS_REGION'])\n obj = s3.bucket(bucket).object(file)\n\n if obj.exists?\n cleanup_tmp_file(file)\n puts \"File #{file} already exists in the bucket.\"\n url = generate_url(bucket, file)\n else\n obj.upload_file(image_path)\n cleanup_tmp_file(file)\n puts \"Uploaded file (#{file}) to bucket (#{bucket}).\"\n url = generate_url(bucket, file)\n end\n\nend",
"def s3_upload_policy_document(s3_bucket)\r\n\r\n if s3_bucket == \"ted_kennedy_image\" || s3_bucket == \"production_images_1\" #for forms uploading images\r\n\r\n logger.info \"in image bucket, bucketis= \"+s3_bucket.to_s\r\n\r\n\t\t\tBase64.encode64(\r\n\t\t\t\t\t\t {\r\n\t\t\t\t\t\t\texpiration: 30.minutes.from_now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z'),\r\n\t\t\t\t\t\t\tconditions: [\r\n\t\t\t\t\t\t\t\t\t{ bucket: s3_bucket },\r\n\t\t\t\t\t\t\t\t\t{ acl: 'public-read' },\r\n\t\t\t\t\t\t\t\t\t[\"starts-with\", \"$key\", \"\"],\r\n\t\t\t\t\t\t\t\t\t[\"starts-with\", \"$Content-Type\", \"image\"],\r\n\t\t\t\t\t\t\t\t\t[\"content-length-range\", 0, 1048576],\r\n\t\t\t\t\t\t\t\t\t[\"starts-with\", \"$x-amz-meta-my-file-name\", \"\"],\r\n\t\t\t\t\t\t\t\t\t{ success_action_status: '201' }\r\n\t\t\t\t\t\t\t]\r\n\t\t\t\t\t}.to_json\r\n\t\t\t).gsub(/\\n|\\r/, '')\r\n\r\n\t\telse #for forms loading attachments\r\n\t\t\tBase64.encode64(\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t\texpiration: 30.minutes.from_now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z'),\r\n\t\t\t\t\t\t\tconditions: [\r\n\t\t\t\t\t\t\t\t\t{ bucket: s3_bucket },\r\n\t\t\t\t\t\t\t\t\t{ acl: 'public-read' },\r\n\t\t\t\t\t\t\t\t\t[\"starts-with\", \"$key\", \"\"],\r\n\t\t\t\t\t\t\t\t\t[\"starts-with\", \"$Content-Disposition\", \"\"],\r\n\t\t\t\t\t\t\t\t\t[\"content-length-range\", 0, 104857600],\r\n\t\t\t\t\t\t\t\t\t[\"starts-with\", \"$x-amz-meta-my-file-name\", \"\"],\r\n [\"starts-with\", \"$Content-Type\", \"\"],\r\n\t\t\t\t\t\t\t\t\t{ success_action_status: '201' }\r\n\t\t\t\t\t\t\t]\r\n\t\t\t\t\t}.to_json\r\n\t\t\t).gsub(/\\n|\\r/, '')\r\n\r\n\t end\r\n\r\n\tend",
"def upload!()\n file_number = 0\n\n total_files = @files.length\n\n @files.each do |file|\n file_number += 1\n\n print \"\\rUploading... [#{file_number}/#{total_files}]\"\n\n next if File.directory? file\n\n # Get the path relative to containing directory\n path = file.gsub(/^#{@folder_path}\\//, '')\n\n options = { :acl => \"authenticated-read\" }\n\n if MIME::Types.type_for(file).count > 0\n options[:content_type] = MIME::Types.type_for(file).first.to_str\n end\n\n @s3_bucket.object(path).upload_file(file, options)\n end\n\n puts \"\\rUpload complete!\".ljust 80\n end",
"def upload_file(file)\n key_name = @prefix.dup\n key_name << File.basename(file)\n @right_s3_interface.put(@bucket, key_name , File.read(file) ) \n end",
"def upload(&block)\n @source.files.each do |key, file|\n object = @target.files.create({\n :key => key,\n :body => file,\n :public => true,\n :cache_control => 'max-age=0' # Disable cache on S3 so that future sharts are visible if folks web browsers.\n })\n block.call file, object\n end\n end",
"def uploaded_file=(file); write_attribute(:uploaded_file, file); end",
"def file_upload_to_field(file_path)\n control = @field.all(:css, 'input[type=\"file\"]').first[:id]\n upload_file(control, file_path)\n end",
"def on_put(path)\n local_path = DocumentFile::DOC_FILE_PATH + File.dirname(path)\n filename = File.basename(path)\n data = I3.server.receive_object\n \n if data.respond_to? :temp_file\n temp_file_path = File.join(UploadedFile::TEMP_FOLDER, data.temp_file)\n unless File.exists? temp_file_path\n I3.server.send_object I3::NotFoundException.new(:message => \"Could not find temp file.\")\n end #unless\n \n begin\n temp_file = File.new(temp_file_path)\n response = UploadedFile.save_as(filename, temp_file, local_path, true)\n I3.server.send_object response\n\n rescue I3::SecurityException\n log.warn \"User #{acct.account_name} tried to upload a file to '#{path}' and was denied.\"\n I3.server.send_object $!\n\n rescue\n log.warn \"User #{acct.account_name} failed to save file '#{File.join(path, filename)}'\" + \n \" (#{$!.message})\"\n I3.server.send_object I3::ServerException.new(\n :title => \"Could not save file\", \n :message => $!.message )\n end #begin\n \n end #if\n end",
"def upload(upload_to = nil)\n upload_task(upload_to).invoke\n end",
"def commit_file\n if @upload.public? && @upload.file_type.public? && @upload.address.blank? && (@upload.creating? || @upload.failed?)\n BlockchainCommitJob.perform_later(@upload.id)\n end\n end",
"def upload\n @active_link = \"upload\"\n @post = generate_post(session_obj, {:is_upload=>true})\n render :new\n end",
"def create_uploaded_file\n Hyrax::UploadedFile.create(user: @user, file: local_file)\n end",
"def upload_file\n @site_mapping = SiteMapping.new\n @site_mapping.parent_id = params[:site_mapping_id]\n \n @chunk = Chunk.new\n @chunk_version = ChunkVersion.new\n \n render :update do |page|\n page.replace_html 'content', :partial => 'upload'\n page.show 'content'\n end\n end",
"def upload_job_script(file_path, bucket_resource)\n File.open(file_path) do |file|\n bucket_resource.client.put_object({\n body: file,\n bucket: bucket_resource.name,\n key: file_path\n })\n end\n rescue Aws::S3::Errors::S3UploadFailedError => e\n @logger.error(\"S3 could not upload job script: \\n#{e.message}\")\n raise\n end",
"def upload_file\n full_path = file_path.join(file_name)\n File.open(full_path, 'wb') do |file|\n file.write(@file.read)\n end\n\n full_path.sub(Rails.root.to_s, '')\n end",
"def upload\n to_png_file do |png_path|\n File.open(png_path, 'rb') do |file|\n S3.put_object bucket: Giffy::Configuration.aws.bucket, key: key, body: file\n end\n S3.put_object_acl acl: 'public-read', bucket: Giffy::Configuration.aws.bucket, key: key\n end\n end",
"def upload\n to_png_file do |png_path|\n File.open(png_path, 'rb') do |file|\n S3.put_object bucket: Giffy::Configuration.aws.bucket, key: key, body: file\n end\n S3.put_object_acl acl: 'public-read', bucket: Giffy::Configuration.aws.bucket, key: key\n end\n end",
"def perform\n upload_file\n end",
"def background_upload(report, message)\n job = load_job(report[:job_id])\n if job\n job.status = \"Uploading\"\n job.save!\n job.background_s3_upload\n end\n message.delete\n end",
"def aws_call\n s3_object = AMAZON_S3_CLIENT.bucket(bucket_name).object(renamed_filename)\n s3_object.upload_file(\n file,\n metadata: file_metadata,\n content_type: 'text/csv'\n )\n end",
"def upload(opts = {})\n options = {\n var: \"upload_#{@@upload_counter}\"\n }\n @@upload_counter += 1\n @parts.push(upload: options.merge(opts))\n end",
"def create\n new_uploads = create_upload_params\n new_uploads[:user_id] = current_or_guest_user.id\n\n @upload = Upload.new(new_uploads)\n\n if @upload.save\n flash[:success] = 'File Upload Successfully!'\n else\n flash[:danger] = 'An error occurred. Please try again!'\n flash[:error] = t(@upload.errors.full_messages.to_sentence)\n end\n redirect_to root_path\n end",
"def upload_to_s3\n log_action('Uploading file to AWS')\n return true if aws_call\n\n raise CsvUploadFailureException, I18n.t('csv.errors.base')\n rescue Aws::S3::Errors::ServiceError => e\n log_error e\n raise CsvUploadFailureException, I18n.t('csv.errors.base')\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 upload(file, someone)\n end",
"def upload\n\t@uploaded_doc = { :workbook => RubyXL::Parser.new } \t\n#\t@uploaded_io = params[:file]\n end",
"def upload_full_path\n @upload_full_path ||= File.join(@upload_file_path, name)\n end",
"def upload_file=(file_name)\n self.file_field(:id=>\"multifile_upload\").set(File.expand_path(File.dirname(__FILE__)) + \"/../../data/sakai-oae/\" + file_name)\n end",
"def upload\n uploaded_io = params[:user][:photo_data]\n filename = uploaded_io.original_filename\n\n filepath = Rails.root.join( 'public', \n 'uploads', \n filename )\n\n # Note that this will create a new file \"filename\" but it\n # can NOT create a new folder, so you must already\n # have a folder of that name \"public/uploads\" available.\n\n File.open(filepath, 'wb') do |file|\n # Note that we're using the `read` method\n file.write(uploaded_io.read)\n end\n end",
"def add_file(filename)\n step('I visit the new file page')\n fill_in(\"file_label\", with: filename)\n attach_file('file_file', filename)\n fill_in('file_description', with: sample_file_description(filename))\n click_link_or_button('Upload File')\n wait_for_ajax_complete\nend"
] | [
"0.7294369",
"0.64944804",
"0.64936656",
"0.64917964",
"0.6475339",
"0.64223",
"0.6394724",
"0.6348916",
"0.631876",
"0.6312243",
"0.63013184",
"0.630014",
"0.6153277",
"0.6142666",
"0.61151445",
"0.6114971",
"0.61024547",
"0.60958064",
"0.60757005",
"0.60757005",
"0.6065514",
"0.60449743",
"0.60335404",
"0.6014316",
"0.59744686",
"0.5958432",
"0.5947334",
"0.59460413",
"0.593655",
"0.59347045",
"0.59249467",
"0.590092",
"0.58897096",
"0.5885911",
"0.58821994",
"0.58773214",
"0.5868218",
"0.5861426",
"0.5859711",
"0.584984",
"0.5835866",
"0.5834251",
"0.5827936",
"0.5827651",
"0.5817238",
"0.58108675",
"0.580272",
"0.57723564",
"0.5769656",
"0.57671905",
"0.57670456",
"0.5765781",
"0.5758773",
"0.5751978",
"0.57389134",
"0.5721477",
"0.571717",
"0.56948656",
"0.5694225",
"0.56851244",
"0.56708086",
"0.5660649",
"0.56408715",
"0.5621282",
"0.5621143",
"0.56178844",
"0.5615036",
"0.56092745",
"0.5606079",
"0.56037927",
"0.55776054",
"0.5576254",
"0.5572682",
"0.5570934",
"0.5570583",
"0.5558778",
"0.555316",
"0.554915",
"0.5544918",
"0.5543033",
"0.5541702",
"0.5541009",
"0.55303574",
"0.5508691",
"0.550115",
"0.54969764",
"0.54963785",
"0.54963785",
"0.5495441",
"0.5493119",
"0.5491937",
"0.54880387",
"0.54817533",
"0.547575",
"0.54736847",
"0.54687077",
"0.5467939",
"0.5465935",
"0.5462927",
"0.5462732",
"0.5457476"
] | 0.0 | -1 |
POST /site_elements POST /site_elements.xml | def create
@site_element.brand_id = website.brand_id
respond_to do |format|
if @site_element.save
if @site_element.replaces_element.present?
old_element = SiteElement.find(@site_element.replaces_element)
if old_element.version.blank?
old_element.update(version: "A")
end
if @site_element.versions_to_delete.present?
SiteElement.where(id: @site_element.versions_to_delete).destroy_all
end
end
format.html {
if params[:return_to]
return_to = URI.parse(params[:return_to]).path
redirect_to(return_to, notice: "Resource was successfully uploaded.")
else
redirect_to([:admin, @site_element], notice: 'Resource was successfully created. IMPORTANT: this has been acting up lately. Wait 5 seconds, then refresh this page. Then the links below will be correct.')
end
}
format.xml { render xml: @site_element, status: :created, location: @site_element }
website.add_log(user: current_user, action: "Uploaded a site element: #{@site_element.long_name}")
else
format.html { render action: "new" }
format.xml { render xml: @site_element.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n\n params[:elements].values.each do |elem|\n puts 'el', elem\n elem_to_save = Element.create (elem)\n @design.elements << elem_to_save\n end\n\n\n respond_to do |format|\n if @design.id\n format.html { redirect_to edit_design_path(@design), notice: 'Design was successfully created.' }\n format.json { render :json => @design}\n else\n format.html { render :new }\n format.json { render json: @design.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def site_params\n params.require(:site).permit(:name, :site_template_id,\n {user_ids: []}, site_routes_attributes: [:id, :host, :path], site_settings_attributes: [:id, :value, :name, :image])\n end",
"def create_trial_sites_from_xml(trial_xml)\n sites = []\n trial_xml.xpath(\"//location\").each do |site|\n status = site.at(\"status\").text if site.at(\"status\")\n country = site.at(\"country\").text if site.at(\"country\")\n if status == \"Recruiting\" && (country == \"United States\" || country == \"Canada\")\n new_site = Site.new\n new_site.name = site.at(\"name\").text if site.at(\"name\")\n new_site.city = site.at(\"city\").text if site.at(\"city\")\n new_site.state = site.at(\"state\").text if site.at(\"state\")\n new_site.zip = site.at(\"zip\").text if site.at(\"zip\")\n new_site.country = country\n new_site.status = status\n new_site.contact_name = site.at(\"contact/last_name\").text if site.at(\"contact/last_name\")\n new_site.contact_phone = site.at(\"contact/phone\").text if site.at(\"contact/phone\")\n new_site.contact_phone_ext = site.at(\"contact/phone_ext\").text if site.at(\"contact/phone_ext\")\n new_site.contact_email = site.at(\"contact/email\").text if site.at(\"contact/email\")\n new_site.investigator_name = site.at(\"investigator/last_name\").text if site.at(\"investigator/last_name\")\n new_site.investigator_role = site.at(\"investigator/role\").text if site.at(\"investigator/role\")\n lat_long = find_lat_long({ zip: new_site.zip, city: new_site.city, state: new_site.state, country: new_site.country })\n new_site.latitude = lat_long[0]\n new_site.longitude = lat_long[1]\n new_site.save\n sites << new_site\n end\n end\n sites\nend",
"def post_elements\n programme_id = params[:programme][:id]\n ProgrammeElement.destroy_all ['programme_id = ?', programme_id ]\n logger.info(\"programme=#{programme_id}\");\n logger.info(params.inspect);\n \n pelist = params[:programme_elements]\n # Add in the new items. From params return if OK. \n index=0;\n while ( pelist[index.to_s] )\n cn=pelist[index.to_s][:column_name]\n unless cn.blank?\n pe=ProgrammeElement.new( pelist[index.to_s] )\n pe.programme_id = programme_id\n pe.position = index\n # pe.column_name = cn # assigned in the new above !!\n pe.save!\n end\n index += 1;\n end\n redirect_to :action => 'show', :id => programme_id\n end",
"def add_site(n, site_name)\n site = Site.new(name: site_name, org_type: 'city', status: 'active')\n lat, lng = Geocoder.coordinates(@zip_xpath[n].text)\n site.contacts.build(city: @city_xpath[n].text, state: @state_xpath[n].text,\n zip: @zip_xpath[n].text, country: @country_xpath[n].text, lat: lat, lng: lng)\n site.save ? site.id : nil\n end",
"def create\n @site = Site.new(site_params.reject {|k,v|k==\"trade_items\"})\n respond_to do |format|\n if @site.save\n create_trade_items(@site, site_params[:trade_items])\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"def element_params\n params.require(:element).permit(:element_type, :content)\n end",
"def element_params\n params.require(:element).permit(:element_type, :post_id, :position)\n end",
"def webapp_params\n params.require(:webapp).permit(:name, :element)\n end",
"def save_uniq_sites_xml(file)\n\t\tputs \"Save unique sites information into XML file: #{file}\\nThis may take a long while as it go through lengthy self correctness check, please be patient ...\"\n\t\tprime_sites=get_prim_uniq_sites\n\t\tbuilder = Nokogiri::XML::Builder.new do |xml|\n\t\t\txml.root {\n\t\t\t\txml.websites {\n\t\t\t\t\tprime_sites.each do |key|\n\t\t\t\t\t\tnext if key.nil?\n\t\t\t\t\t\tsite=key.strip\n\t\t\t\t\t\traise \"Unknown site: #{site}. You may need to add it into the site store first. Execute the following shell command before trying again: \\n\\twmap #{site}\\n\" unless @known_sites.key?(site)\n\t\t\t\t\t\txml.site {\n\t\t\t\t\t\t\txml.name site\n\t\t\t\t\t\t\txml.ip_ @known_sites[site]['ip']\n\t\t\t\t\t\t\txml.port_ @known_sites[site]['port']\n\t\t\t\t\t\t\txml.status_ @known_sites[site]['status']\n\t\t\t\t\t\t\txml.server_ @known_sites[site]['server']\n\t\t\t\t\t\t\txml.fingerprint_ @known_sites[site]['md5']\n\t\t\t\t\t\t\txml.redirection_ @known_sites[site]['redirection']\n\t\t\t\t\t\t\txml.responsecode_ @known_sites[site]['code']\n\t\t\t\t\t\t\txml.timestamp_ @known_sites[site]['timestamp']\n\t\t\t\t\t\t}\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t}\n\t\tend\n\t\tputs builder.to_xml if @verbose\n\t\tf=File.new(file,'w')\n\t\tf.write(builder.to_xml)\n\t\tf.close\n\t\tputs \"Done!\"\n\t\treturn true\n\trescue => ee\n\t\tputs \"Exception on method #{__method__}: #{ee}\"\n\t\treturn false\n\tend",
"def create\n @site_attribute = @site.site_attributes.build params[:site_attribute]\n\n respond_to do |format|\n if @site_attribute.save\n format.html { redirect_to([@site, @site_attribute], :notice => 'SiteAttribute was successfully created.') }\n format.xml { render :xml => @site_attribute, :status => :created, :location => @site_attribute }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site_attribute.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @element = Element.new(element_params)\n @element.save\n respond_with @element\n end",
"def create\n @page_element = @page.page_elements.build(page_element_params)\n\n respond_to do |format|\n if @page_element.save\n format.html { redirect_to council_page_page_elements_path(@council), notice: 'Elementet skapades.' }\n format.json { render action: 'show', status: :created, location: @page_element }\n else\n format.html { render action: 'new' }\n format.json { render json: @page_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_site(params = {})\n site_name.set params['site_name']\n client_division_site_number.set params['client_division_site_number']\n site_number.set params['site_number']\n address_1.set params['address_1']\n address_2.set params['address_2'] if params['address_2']\n zip_code.set params['zip_code']\n city.set params['city']\n country.select(params['country'], match: :first)\n sleep 2 # Wait for the state to be active #TODO: find a way to remove this sleep ~MD\n state.select(params['state']) unless state.disabled?\n study_env.select(params['study_env'])\n pi_email.set params['pi_email']\n pi_first_name.set(params['pi_first_name'])\n pi_last_name.set(params['pi_last_name'])\n pi_role.select(params['pi_role'])\n add_site_submit.click\n sleep 10 # Wait to create a site\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @site_element.show_on_public_site = true\n if params[:products].present?\n @site_element.products = params[:products].split(',').map{|k| Product.find(k)}\n @site_element.is_document = true\n end\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @site_element }\n end\n end",
"def save(element)\n elementHash = element.to_hash\n parameter = { basic_auth: @auth,\n body: elementHash.to_json,\n headers: { 'Content-Type' => 'application/json; charset=utf-8
' } }\n save_response = self.class.post('/elements', parameter)\n if save_response.success?\n Element.new(save_response.parsed_response)\n else\n puts \"Could not save element: #{save_response.headers['x-errordescription']}\"\n end\n end",
"def site_payload\n {'site' => {'posts' => @posts}}\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(root_url, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:name, :subdomain, :owner_id, :trade_items)\n end",
"def site_params\n params.require(:site).permit(:uuid, :name, :domain, :user_prefix, :site_category_id, :color, :side, :position, :title_online,\n :title_offline, :collect_stats, :show_online, :show_offline, :auto_open, :btn_title_online, :btn_title_offline,\n :auto_open_timeout, :sales_interval_day, :sales_welcome_message, :offline_welcome_message, :enabled)\n end",
"def add_element_to_section(section,type,data)\n url = @base + \"/api/v1/elements.json\"\n params = {\"item\"=>{\"element_type\"=> type, \"data\"=>data, \"container_type\"=>\"ExperimentProcedure\", \"container_id\"=>section[\"id\"], \"field_name\"=>section[\"section_type\"]},token: @token}\n response = JSON.parse(RestClient.post(url,params))\nend",
"def new_element\n # collect element data\n class_key = params[:classKey]\n element = keytechAPI.element_handler.new_element(class_key)\n\n # Layout holds all controls to fill\n layout = getLayout(class_key)\n errors = []\n layout.controls.each do |control|\n # Labels are the only control type a element can not use for data\n next unless control.controlType != 'LABEL'\n\n key = control.attributeName\n value = params[control.attributeName]\n\n unless control.isNullable\n if value.blank?\n errors.push \"Feld '#{control.displayname}' darf nicht leer sein. \"\n end\n end\n\n element.keyValueList[key] = value\n end\n\n unless errors.empty?\n logger.error \"Errors occured: #{errors.inspect}\"\n flash[:warning] = errors\n return redirect_back(fallback_location: root_path)\n end\n\n saved_element = keytechAPI.element_handler.save(element)\n # Save ok? If not create a warning and rebuild\n logger.info \"New element saved: #{saved_element.key}\"\n if saved_element.blank?\n logger.warn('Could not save element')\n flash[:warning] = 'Konnte Element nicht anlegen.'\n redirect_back(fallback_location: root_path)\n else\n flash[:info] = 'Element wurde angelegt.'\n redirect_to show_element_path(id: saved_element.key)\n end\n end",
"def add_element_to_section(section,type,data)\n url = @base + \"elements.json\"\n params = {\"item\"=>{\"element_type\"=> type, \"data\"=>data, \"container_type\"=>\"ExperimentProcedure\", \"container_id\"=>section[\"id\"], \"field_name\"=>section[\"section_type\"]},token: @token}\n response = JSON.parse(RestClient.post(url,params))\nend",
"def seo_submit\n for search_engine in ::Pingr::SUPPORTED_SEARCH_ENGINES\n ::Pingr::Request.new(search_engine, pages_url(format: :xml)).ping\n end\n \n redirect_to({:action => :index}, {:notice => '<strong>Yay!</strong> Sitemap XML has been submitted to all supported search engines!'.html_safe})\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:web, :title, :description, :kw, :category_id, :facebook,:t,\n locations_attributes: [:id,:name,:island,:city,:street,:lat,:long,:_destroy])\n\n end",
"def site_params\n params.require(:site).permit(:site, :location, :contacts, :email, :installed, :FSE, :PQandTraining, :FAS, :TrainedOn, :SxSerialNumber, :MappingTool, :RGQSN, :RgqSoftware, :SAReporter, :AssayPackage, :NGS, :NGSassay, :NGSSXSN, :ST401i, :ST401e, :SQ301, :SQSuite, :SQreporter, :NGSInstall, :NGSFSE, :NGSPQandTraining, :FAS, :Notes)\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @element = Element.new(params[:element])\n\n respond_to do |format|\n if @element.save\n format.html { redirect_to(@element, :notice => 'Element was successfully created.') }\n format.xml { render :xml => @element, :status => :created, :location => @element }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @element.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n\t params.require(:site).permit(:name, :description, :longitude, :latitude, :images, images_attachments_attributes: [:id, :_destroy])\n end",
"def site_params\n params.require(:site).permit(:user_id, :template_id, :short_title, :title, :description, :domain, :status, :is_published)\n end",
"def create\n respond_to do |format|\n if @site = Site.find(entity_id_from_params(:site))\n current_user.account.sites << @site\n format.html { redirect_to root_path, notice: \"The site #{@site.name} @ #{@site.companies.last.name} was successfully added.\" }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(root_url, :notice => 'Site was successfully created.') }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n @design.elements.destroy_all\n\n params[:elements].values.each_with_index do |elem,i|\n puts elem\n # if @design = Design.find_or_create_by(id: @design_id, name: params[:name], user: @current_user)\n elem_to_save = Element.create (elem)\n @design.elements << elem_to_save\n end\n\n\n respond_to do |format|\n if @design.id\n format.html { redirect_to edit_design_path(@design), notice: 'Design was successfully created.' }\n format.json { render :json => @design}\n else\n format.html { render :new }\n format.json { render json: @design.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @elemento = Elemento.new(params[:elemento])\n\n respond_to do |format|\n if @elemento.save\n flash[:notice] = 'Elemento was successfully created.'\n format.html { redirect_to(@elemento) }\n format.xml { render :xml => @elemento, :status => :created, :location => @elemento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @elemento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n @site.user_id = current_user.id\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully added to your permissions list.'\n format.html { redirect_to(user_site_url(:id => @site, :user_id => current_user.id)) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:name, :url, :rss, :active, :category_id)\n end",
"def create\n @site = Xmt::Press::Site.new(site_params)\n respond_to do |format|\n if @site.save\n format.html { redirect_to xmt_press_sites_url, notice: '站点创建成功.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @element = Element.new(params[:element])\n @element.account = @account\n respond_to do |format|\n if @element.save\n format.html { redirect_to(@element, :notice => 'Element was successfully created.') }\n format.xml { render :xml => @element, :status => :created, :location => @element }\n format.json { render :json => @element, :status => :created, :location =>@element }\n else\n logger.warn(\"CREATING new element failed this these errors: #{@element.errors.full_messages.to_sentence}\")\n format.html { render :action => \"new\", :error => @element.errors.full_messages.to_sentence }\n format.xml { render :xml => @element.errors, :status => :unprocessable_entity }\n format.json { render :json => @element.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:name, :address, :contact, :phone, :email, :customer_id, customers_attributes: [:name, :id])\n end",
"def index\n @site_attributes = @site.site_attributes\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @site_attributes }\n end\n end",
"def save_site params\n SiteProcessor.new(self).save_site(params)\n end",
"def create_site(params={name:random_string})\n\t\tnew_site = site[:new]\n\t\tparams[:site] = params[:name]\n\t\tnew_site[:params].merge!(params)\n\t\tnew_site[:params][:address] = append_ftp_value(new_site[:params][:address],new_site[:params][:ftp_type])\n\t\tpost(new_site)\n\tend",
"def post_nodes_with_root\n serialize_service.post_nodes_serialized\n end",
"def site_params\n params.require(:site).permit(:user_id, :member_id, :template_id, :short_title, :title, :description, :domain, :is_publiched, :is_comment_show, :updated_by, :note, :typo)\n end",
"def site_params\n params.require(:site).permit(:domain, :name, :organization_id, setting_attributes: [\n :id,\n :comment_display_created_at,\n :comment_repeatable\n ])\n end",
"def site_params\n params.require(:site).permit(:name, :url, :description)\n end",
"def new\n @site_attribute = @site.site_attributes.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @site_attribute }\n end\n end",
"def site_params\n params.require(:site).permit(:address, :city, :county, :loc_page, :loc_longitude, :loc_latitude, :apn, :tombrobox, :fault_id)\n end",
"def saveSite()\n\t\tr = @connection.execute('<SiteSaveRequest session-id=\"' + @connection.session_id + '\">' + getSiteXML() + ' </SiteSaveRequest>')\n\t\tif (r.success)\n\t\t\t@site_id = r.attributes['site-id']\n\t\t\t@site_config._set_site_id(@site_id)\n\t\t\t@site_config.scanConfig._set_configID(@site_id)\n\t\t\t@site_config.scanConfig._set_name(@site_id)\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend",
"def element_params\n params.require(:element).permit(:tag, :process_order, :product_type_id, :drying_method_id, :previous_color, :ex_tag, :lot, :first_item, :last_item)\n end",
"def create\n authorize Element\n @element = Element.new(element_params)\n\n respond_to do |format|\n if @element.save\n format.html { redirect_to @element, notice: 'Element je bil uspešno dodan.' }\n format.json { render :show, status: :created, location: @element }\n else\n format.html { render :new }\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(site_params)\n @site.user_id = current_user.id\n\n if params[:site][:size_ids].present?\n sizesgroup = Size.find params[:site][:size_ids]\n @site.sizes = sizesgroup\n end\n\n respond_to do |format|\n if @site.save\n format.json { render :index, status: :created, location: @site }\n\t\t#format.json { head :no_content }\n\t\tformat.js\n else\n format.json { render json: @site.errors, status: :unprocessable_entity }\n\t\tformat.js { render 'shared/errors' }\n end\n end\n end",
"def site_params\n params.require(:xmt_press_site).permit!\n end",
"def postEntityWebsite( entity_id, website_url, display_url, website_description, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['website_url'] = website_url\n params['display_url'] = display_url\n params['website_description'] = website_description\n params['gen_id'] = gen_id\n return doCurl(\"post\",\"/entity/website\",params)\n end",
"def create\n params[:site][:virtualhost] = nil if params[:site][:virtualhost] =~ /^\\s*$/\n @site = current_user.sites.build(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:name, :address, :districs, :city, :postalcode, :user_id, :Long, :Lat)\n end",
"def post(xmldoc)\n headers = {'Content-Type' => 'text/xml'}\n check_response( @httpcli.post(@endpoint, xmldoc, headers) )\n end",
"def create\n @element = @article.elements.build(element_params)\n \n if @element.save\n notice = nil\n else\n notice = @element.errors.full_messages.join(\". \") << \".\"\n end\n redirect_to edit_article_path(@article), notice: notice\n end",
"def create\n @site = Site.new(params[:site])\n @site.user = self.current_user \n \n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n format.html { redirect_to site_url(@site) }\n format.xml { head :created, :location => site_url(@site) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors.to_xml }\n end\n end\n end",
"def create\n @site = @organization.sites.new(site_params)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to after_create_path, notice: 'Site was successfully created.' }\n format.json { render :show, status: :created, location: @site }\n else\n format.html { render :new }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @institution = @navigation_context.institution\n return unless authorize_resource(@institution, CREATE_INSTITUTION_SITE)\n @site = @institution.sites.new(site_params(true))\n @sites = check_access(@institution.sites, READ_SITE)\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to sites_path, notice: I18n.t('sites.create.success') }\n format.json { render action: 'show', status: :created, location: @site }\n else\n format.html { render action: 'new' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_site_save\n active_submit.click\n end",
"def post(uri, xml)\r\n req = Net::HTTP::Post.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to(@site, :notice => 'Site was successfully created.') }\n format.json { render :json => @site, :status => :created, :location => @site }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def element_params\n params.require(:element).permit(Element.allowable_params)\n end",
"def create\n @selector_site = SelectorSite.new(params[:selector_site])\n\n respond_to do |format|\n if @selector_site.save\n flash[:notice] = 'SelectorSite was successfully created.'\n format.html { redirect_to(@selector_site) }\n format.xml { render :xml => @selector_site, :status => :created, :location => @selector_site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @selector_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:groom_name, :bride_name, :about_groom, :about_bride, :wedding_date, :photographer, :event_planner, :groom_image, :bride_image, wedding_location_attributes: [:id, :event_type, :date, :from, :to, :venue, :_destroy])\n end",
"def site_params\n params.require(:site).permit(:title, :domain, :referral)\n end",
"def site_params\n params.require(:site).permit(:name, :url)\n end",
"def create\n @element = Element.new(params[:element])\n\n respond_to do |format|\n if @element.save\n format.html { redirect_to @element, notice: 'Element was successfully created.' }\n format.json { render json: @element, status: :created, location: @element }\n else\n format.html { render action: \"new\" }\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def elemento_params\n params.require(:elemento).permit( :nombre, :codigo_interno, :codigo_contable, :descripcion, :tipo_elemento_id, :estado_id)\n end",
"def create\n @site = current_user.sites.create(params[:site])\n respond_to do |format|\n if @site.save\n format.html { flash_and_redirect(\"successfully saved!\", sites_url) }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def site_params\n params.require(:site).permit(:url,:pseudo)\n end",
"def execute(site)\n section_name = @directory.delete('_')\n section_data = {}\n if (@schema_file)\n xsd = Nokogiri::XML::Schema(File.read(File.join(site.dir, @directory, @schema_file)))\n end\n Dir[File.join(site.dir, @directory, '*.xml')].each do |file|\n doc = Nokogiri::XML(File.read(file))\n # Validate the xml document against the schema\n if (xsd)\n errors = xsd.validate(doc)\n unless errors.empty?\n errors.each do |error|\n $LOG.info error\n end\n raise \"XML Validation errors (see above) for file #{file}\"\n end\n end\n\n section_data[File.basename(file, '.xml')] = doc\n end\n site.send(\"#{section_name}=\", section_data)\n end",
"def create\n #1st you retrieve the customer thanks to params[:customer_id]\n customer = Customer.find(params[:customer_id])\n #2nd you create the site with arguments in params[:site]\n @site = customer.sites.create(params[:site_id])\n\n\n respond_to do |format|\n if @site.save\n #1st argument of redirect_to is an array, in order to build the correct route to the nested resource site\n format.html { redirect_to([@site.customer, @site], :notice => 'Please fill in the details below') }\n #the key :location is associated to an array in order to build the correct route to the nested resource site\n format.xml { render :xml => @site, :status => :created, :location => [@site.customer, @site] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n flash[:notice] = 'Site was successfully created.'\n Changelog.add(@current_user.login, \"Created the site #{@site.name}\")\n format.html { redirect_to(@site) }\n format.xml { render :xml => @site, :status => :created, :location => @site }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def body_site_params\n params.require(:body_site).permit(:identifier, :name, :region)\n end",
"def post_xml(url, ls_data)\n uri = URI.parse(url)\n request = Net::HTTP::Post.new(uri.request_uri, HEADER_XML)\n request.body = ls_data\n request.basic_auth(@nsx_user, @nsx_password)\n response = Net::HTTP.start(uri.host, uri.port, :use_ssl => true,\n :verify_mode => OpenSSL::SSL::VERIFY_NONE) do |https|\n https.request(request)\n end\n return response.body if check_response(response, 201)\n end",
"def create\n @elemento = Elemento.new(elemento_params)\n\n respond_to do |format|\n if @elemento.save\n format.html { redirect_to @elemento, notice: 'Elemento fue creado con exito.' }\n format.json { render :show, status: :created, location: @elemento }\n else\n format.html { render :new }\n format.json { render json: @elemento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n raise ArgumentError, \"Site already exists in Piwik, call 'update' instead\" unless new?\n raise ArgumentError, \"Name can not be blank\" if name.blank?\n raise ArgumentError, \"Main URL can not be blank\" if main_url.blank?\n xml = call('SitesManager.addSite', :siteName => name, :urls => main_url)\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n @id = result.to_i\n @created_at = Time.current\n id && id > 0 ? true : false\n end",
"def create\n section_type_ids = params[:site_type].delete(\"section_type_ids\")\n @site_type = SiteType.new(params[:site_type])\n @site_type.section_type_ids = section_type_ids\n\n respond_to do |format|\n if @site_type.save\n format.html { redirect_to @site_type, notice: 'Site type was successfully created.' }\n format.json { render json: @site_type, status: :created, location: @site_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n doc = Nokogiri::XML(request.body.read)\n cvNode = doc.xpath('elwak/checklisten_vorlage')\n cv = ChecklistenVorlage.new({\n objekt_id: cvNode.xpath('objekt_id').text.to_s, \n bezeichner: cvNode.xpath('bezeichner').text.to_s, \n version: cvNode.xpath('version').text.to_s.to_i, \n inaktiv: cvNode.xpath('inaktiv').text.to_s.to_bool \n })\n cv.save\n\n cvNode.xpath('checklisten_eintrags/checklisten_eintrag').each do |ceNode|\n ce = ChecklistenEintrag.new({\n checklisten_vorlage_id: cv.id,\n bezeichner: ceNode.xpath('bezeichner').text.to_s,\n was: ceNode.xpath('was').text.to_s,\n wann: ceNode.xpath('wann').text.to_s,\n typ: ceNode.xpath('typ').text.to_s.to_i,\n position: ceNode.xpath('position').text.to_s.to_i\n })\n ce.save\n end\n\n respond_to do |format|\n format.xml {render :xml => '<?xml version=\"1.0\" encoding=\"UTF-8\"?><success />'}\n end\n end",
"def create\n @site = Site.new(site_params)\n @site.user_id = current_user.id if current_user\n @site.member_id = current_member.id if current_member\n @site.typo = ['personal', 'business'].delete(params[:typo].to_s.downcase) || 'personal'\n\n respond_to do |format|\n if @site.save!\n if params[:typo] == 'business'\n @site.site_payment.price = ENV[\"PRICE_BUSINESS\"]\n @site.site_payment.save!\n end\n if @site.template.property == 'free'\n @site.set_free\n end\n #build site_page via template_page\n Templates::Page.where(template_id: @site.template_id).order(\"position ASC\").each do |temp_page|\n @site.site_pages.create(\n site_id: @site.id, \n template_page_id: temp_page.id,\n title: temp_page.title)\n end\n #add a comment\n SiteComment.create(site_id: @site.id, name: '维斗喜帖', content: '小维斗来过,提前送上一声祝福~')\n \n #send notice to admin\n # if Rails.env == 'production'\n # SmsSendWorker.perform_async(ENV['ADMIN_PHONE'].split('|').join(','), \"#{@site.user.try(:email) || @site.member.try(:auth_id)}创建了应用:#{get_site_url(@site)}\")\n # end\n #redirect\n format.html { redirect_to site_site_steps_path(@site), notice: t('notice.site.created') }\n format.json { render action: 'show', status: :created, location: @site }\n else\n format.html { render action: 'new' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #render text: site_params.merge(user_id: current_user.id) and return\n\n @site = Site.new(site_params)\n\n respond_to do |format|\n if @site.save\n #build site_page via template_page\n Template::Page.where(template_id: @site.template_id).order(\"sort_id ASC\").each do |temp_page|\n @site.site_pages.create(user_id: current_user.id, \n site_id: @site.id, \n template_page_id: temp_page.id,\n short_title: get_short_title(@site),\n title: temp_page.title)\n end\n format.html { redirect_to edit_site_page_url(@site.site_pages.first), notice: 'Site was successfully created.' }\n format.json { render action: 'show', status: :created, location: @site }\n else\n format.html { render action: 'new' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_create_post_via_API_XML\r\n get \"/logout\"\r\n post \"/forum_posts.xml\", :api_key=>'testapikey',\r\n :forum_post => {:title=>'API Test Post',\r\n :body=>'Test Post desc',\r\n :user_id=>1}\r\n assert_response :created\r\n end",
"def site_params\n params.require(:site).permit(:name)\n end",
"def autogenerate_elements\n elements_already_on_page = elements.available.pluck(:name)\n elements = definition[\"autogenerate\"]\n if elements.present?\n elements.each do |element|\n next if elements_already_on_page.include?(element)\n Element.create_from_scratch(attributes_for_element_name(element))\n end\n end\n end",
"def site_params\n params.require(:site).permit(:original_url, :short_url, :visits)\n end",
"def element_params\n\n params.require(:element).permit(:folio_id, :title, :description, :citation, :image, :document, :image_content_type, :document_content_type, :audio, :audio_content_type, :element_link, :font)\n end",
"def save_to_sites\n if Site.where(:id => self.site_id).count == 0\n p self\n return\n end\n STDERR.puts \"save_to_sites: Site: #{site}\"\n site_dir = Rails.root.join(\"sites\", site.name)\n unless Dir.exists? site_dir\n Dir.mkdir site_dir\n end\n payload_dir = site_dir.join(self.name)\n unless Dir.exists? payload_dir\n Dir.mkdir payload_dir\n end\n STDERR.puts \"Writing: #{payload_dir}\"\n File.open(payload_dir.join(\"client_script.rb\"), \"wb\") do |f|\n f.write self.client_script\n end \n File.open(payload_dir.join(\"data_generator.rb\"), \"wb\") do |f|\n f.write self.data_generator\n end \n end",
"def postEntityAdvertiserUpsell( entity_id, tags, locations, extra_tags, extra_locations, is_national, language, reseller_ref, reseller_agent_id, publisher_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['tags'] = tags\n params['locations'] = locations\n params['extra_tags'] = extra_tags\n params['extra_locations'] = extra_locations\n params['is_national'] = is_national\n params['language'] = language\n params['reseller_ref'] = reseller_ref\n params['reseller_agent_id'] = reseller_agent_id\n params['publisher_id'] = publisher_id\n return doCurl(\"post\",\"/entity/advertiser/upsell\",params)\n end",
"def site_params\n params.require(:site).permit(:published, :title, :link,\n :image, :image_cache, :remove_image, :position, {order: [:id, :position]})\n end",
"def create\n @site = current_user.sites.build(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to root_url(subdomain: @site.subdomain), notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_xml_64(xml=:example_response)\n post \"/auth/saml/callback\", {'SAMLResponse' => load_xml_64(xml)}\nend",
"def create\n\t\t@private_site = PrivateSite.new(private_site_params)\n\t\t@private_site.user = current_user\n respond_to do |format|\n if @private_site.save\n\t\t\t\tparams[:private_site][:floor_plans].reject! { |c| c.empty? }.each do |floor_plan|\n\t\t\t\t\t@private_site.floor_plans << FloorPlan.find(floor_plan)\n\t\t\t\tend\n\t\t\t\tparams[:private_site][:galleries].reject! { |c| c.empty? }.each do |gallery|\n\t\t\t\t\t@private_site.galleries << Gallery.find(gallery)\n\t\t\t\tend\n\t\t\t\tparams[:private_site][:private_videos].reject! { |c| c.empty? }.each do |p_video|\n\t\t\t\t\t@private_site.private_videos << PrivateVideo.find(p_video)\n\t\t\t\tend\n\n\t\t\t\tparams[:private_site][:si_details].reject! { |c| c.empty? }.each do |update|\n\t\t\t\t\tupdate_parsed = update.split(\"-\")\n\t\t\t\t\tsi = SiteItem.new\n\t\t\t\t\tsi.private_site = @private_site\n\t\t\t\t\tsi.si_detail = true\n\t\t\t\t\tif update_parsed[0] == \"g\"\n\t\t\t\t\t\tsi.si_item = Gallery.find(update_parsed[1])\n\t\t\t\t\telsif update_parsed[0] == \"p\"\n\t\t\t\t\t\tsi.si_item = Article.find(update_parsed[1])\n\t\t\t\t\tend\n\t\t\t\t\tsi.save\n\t\t\t\tend\n\t\t\t\tparams[:private_site][:si_updates].reject! { |c| c.empty? }.each do |update|\n\t\t\t\t\tupdate_parsed = update.split(\"-\")\n\t\t\t\t\tsi = SiteItem.new\n\t\t\t\t\tsi.private_site = @private_site\n\t\t\t\t\tsi.si_update = true\n\t\t\t\t\tif update_parsed[0] == \"g\"\n\t\t\t\t\t\tsi.si_item = Gallery.find(update_parsed[1])\n\t\t\t\t\telsif update_parsed[0] == \"v\"\n\t\t\t\t\t\tsi.si_item = PrivateVideo.find(update_parsed[1])\n\t\t\t\t\telsif update_parsed[0] == \"p\"\n\t\t\t\t\t\tsi.si_item = Article.find(update_parsed[1])\n\t\t\t\t\tend\n\t\t\t\t\tsi.save\n\t\t\t\tend\n\n format.html { redirect_to admin_private_sites_dashboard_path, notice: 'Site was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"def create\n @site = Site.new(params[:site])\n\n respond_to do |format|\n if @site.save\n format.html { redirect_to @site, notice: 'Site was successfully created.' }\n format.json { render json: @site, status: :created, location: @site }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6018734",
"0.5545079",
"0.55372304",
"0.5512491",
"0.54776126",
"0.5454577",
"0.5418566",
"0.53900224",
"0.53596574",
"0.5355668",
"0.5292906",
"0.5282853",
"0.5263238",
"0.5260097",
"0.5246631",
"0.5240756",
"0.5223541",
"0.52134025",
"0.52102023",
"0.5204118",
"0.5193504",
"0.5185871",
"0.51694214",
"0.51636046",
"0.51491195",
"0.51482314",
"0.51482314",
"0.51482314",
"0.51443946",
"0.5137022",
"0.5128541",
"0.51148003",
"0.5111136",
"0.51082516",
"0.5106866",
"0.51054645",
"0.50950366",
"0.5091295",
"0.5090855",
"0.5086814",
"0.5083262",
"0.5076563",
"0.50660515",
"0.5064756",
"0.5059233",
"0.5058101",
"0.50478095",
"0.5028607",
"0.50259036",
"0.50243956",
"0.50230783",
"0.50193506",
"0.5002853",
"0.50016266",
"0.50013644",
"0.4987625",
"0.4986886",
"0.49719605",
"0.49687794",
"0.49595588",
"0.49578232",
"0.4949735",
"0.49475986",
"0.4913815",
"0.4913624",
"0.491124",
"0.49047002",
"0.49016124",
"0.4900846",
"0.49002597",
"0.48983392",
"0.48947546",
"0.48931116",
"0.4889013",
"0.48783448",
"0.48718482",
"0.48658744",
"0.48558256",
"0.48466116",
"0.48466074",
"0.4843267",
"0.4820778",
"0.4820165",
"0.48163038",
"0.48136353",
"0.4810219",
"0.48099002",
"0.48023742",
"0.47959647",
"0.479163",
"0.4791161",
"0.47881782",
"0.47868904",
"0.47866726",
"0.47802335",
"0.47785172",
"0.47752032",
"0.4772654",
"0.47685155",
"0.47661555"
] | 0.54389364 | 6 |
PUT /site_elements/1 PUT /site_elements/1.xml | def update
other_versions = @site_element.other_versions
respond_to do |format|
if @site_element.update(site_element_params)
other_versions.each{|element| element.catchup_with_latest_version(@site_element)}
format.html {
if params[:return_to]
return_to = URI.parse(params[:return_to]).path
redirect_to(return_to, notice: "Resource was successfully updated.")
else
redirect_to([:admin, @site_element], notice: 'Resource was successfully updated. It may take a few seconds to process and transfer the file to the right place.')
end
}
format.xml { head :ok }
website.add_log(user: current_user, action: "Updated a site element: #{@site_element.long_name}")
else
format.html { render action: "edit" }
format.xml { render xml: @site_element.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n connection.put(element_path, to_xml)\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def put(uri, xml)\r\n req = Net::HTTP::Put.new(uri)\r\n req[\"content-type\"] = \"application/xml\"\r\n req.body = xml\r\n request(req)\r\n end",
"def update\n @site = Site.first\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(root_url, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put_update(options = {})\n options[:id] ||= @website.id\n options[:website] ||= @attributes\n\n put :update,options\n end",
"def update\n \n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n Changelog.add(@current_user.login, \"Updated the #{@site.name} site\")\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site_attribute = @site.site_attributes.find(params[:id])\n\n respond_to do |format|\n if @site_attribute.update_attributes(params[:site_attribute])\n format.html { redirect_to([@site, @site_attribute], :notice => 'SiteAttribute was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site_attribute.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @element = @account.elements.find(params[:id])\n\n respond_to do |format|\n if @element.update_attributes(params[:element])\n format.html { redirect_to(@element, :notice => 'Element was successfully updated.') }\n format.xml { head :ok }\n format.json { head :ok }\n else\n logger.warn(\"UPDATING new element failed this these errors: #{@element.errors.full_messages.to_sentence}\")\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @element.errors, :status => :unprocessable_entity }\n format.json { render :json => @element.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(element)\n elementHash = element.to_hash\n parameter = { basic_auth: @auth,\n body: elementHash.to_json,\n headers: { 'Content-Type' => 'application/json; charset=utf-8
' } }\n save_response = self.class.put(\"/elements/#{element.key}\", parameter)\n if save_response.success?\n Element.new(save_response.parsed_response)\n else\n puts \"Could not save element: #{save_response.headers['x-errordescription']}\"\n end\n end",
"def update\n @site = Site.first\n @site.icon = nil if params[:delete_icon]\n @site.wordmark = nil if params[:delete_wordmark]\n\n respond_to do |format|\n if @site.update_attributes(site_params)\n format.html { redirect_to(root_url, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n raise UnknownSite, \"Site not existent in Piwik yet, call 'save' first\" if new?\n raise ArgumentError, \"Name can not be blank\" if name.blank?\n raise ArgumentError, \"Main URL can not be blank\" if main_url.blank?\n xml = call('SitesManager.updateSite', :idSite => id, :siteName => name, :urls => main_url)\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n result['success'] ? true : false\n end",
"def update\n @element.update_attributes(element_params)\n respond_with @element\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.json { head :ok }\n format.xml { head :ok }\n else\n format.html { render :action => '#edit' }\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(id_from_params)\n\n respond_to do |format|\n current_user.account.sites.delete(@site)\n current_user.account.sites << @site\n if current_user.account.sites.exists? @site\n format.html { redirect_to root_path, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"new\" }\n format.json { render json: @site.errors.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find_by_site(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params.reject {|k,v|k==\"trade_items\"})\n TradeItem.where(site_id: @site.id).destroy_all\n create_trade_items(@site, site_params[:trade_items])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @element = Element.find(params[:id])\n\n respond_to do |format|\n if @element.update_attributes(params[:element])\n format.html { redirect_to(@element, :notice => 'Element was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @element.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, :notice => 'Site was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\", :layout=>\"site\"}\n format.json { render :json => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n @site.logo = params[:logo]\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to(@site, :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n format.js\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # returning connection.put(element_path(prefix_options), to_xml, self.class.headers) do |response|\n returning connection.put(element_path(prefix_options), to_ssj, self.class.headers) do |response|\n load_attributes_from_response(response)\n end\n end",
"def update\n params[:site][:virtualhost] = nil if params[:site][:virtualhost] =~ /^\\s*$/\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @elemento = Elemento.find(params[:id])\n\n respond_to do |format|\n if @elemento.update_attributes(params[:elemento])\n flash[:notice] = 'Elemento was successfully updated.'\n format.html { redirect_to(@elemento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @elemento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id], :conditions => ['user_id = ?', current_user.id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to(user_site_url(:id => @site, :user_id => current_user.id)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = current_user.sites.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @site_element.brand_id = website.brand_id\n respond_to do |format|\n if @site_element.save\n if @site_element.replaces_element.present?\n old_element = SiteElement.find(@site_element.replaces_element)\n if old_element.version.blank?\n old_element.update(version: \"A\")\n end\n if @site_element.versions_to_delete.present?\n SiteElement.where(id: @site_element.versions_to_delete).destroy_all\n end\n end\n format.html {\n if params[:return_to]\n return_to = URI.parse(params[:return_to]).path\n redirect_to(return_to, notice: \"Resource was successfully uploaded.\")\n else\n redirect_to([:admin, @site_element], notice: 'Resource was successfully created. IMPORTANT: this has been acting up lately. Wait 5 seconds, then refresh this page. Then the links below will be correct.')\n end\n }\n format.xml { render xml: @site_element, status: :created, location: @site_element }\n website.add_log(user: current_user, action: \"Uploaded a site element: #{@site_element.long_name}\")\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @site_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = current_user.sites.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { flash_and_redirect(\"successfully updated!\", sites_url) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #retrieve the site thanks to params[:id]\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update(site_params)\n #1st argument of redirect_to is an array, in order to build the correct route to the nested resource site\n format.html { redirect_to([@site.customer, @site], :notice => 'Site was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n \n return if !self.authorize?\n \n respond_to do |format|\n if @site.update_attributes(params[:site])\n flash[:notice] = 'Site was successfully updated.'\n format.html { redirect_to site_url(@site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @site.errors.to_xml }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n redirect_to \"/sites\" and return\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @selector_site = SelectorSite.find(params[:id])\n\n respond_to do |format|\n if @selector_site.update_attributes(params[:selector_site])\n flash[:notice] = 'SelectorSite was successfully updated.'\n format.html { redirect_to(@selector_site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @selector_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html { redirect_to site_path(@site), notice: 'Site was successfully updated.' }\n # format.html { redirect_to project_site_path(@site.project, @site), notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { flash.now[:error] = \"Error: See details below.\"\n render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize!(@site)\n\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to site_site_steps_path(@site), notice: t('notice.site.updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n respond_to do |format|\n if @site.update(params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render json: { result: :ok, notice: 'changes saved succesfully', site: @site } }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n @design.elements.destroy_all\n\n params[:elements].values.each_with_index do |elem,i|\n puts elem\n # if @design = Design.find_or_create_by(id: @design_id, name: params[:name], user: @current_user)\n elem_to_save = Element.create (elem)\n @design.elements << elem_to_save\n end\n\n\n respond_to do |format|\n if @design.id\n format.html { redirect_to edit_design_path(@design), notice: 'Design was successfully created.' }\n format.json { render :json => @design}\n else\n format.html { render :new }\n format.json { render json: @design.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to xmt_press_sites_url, notice: '站点更新成功.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_xml\n self.xml= dumpRouteAsXml\n self.save\n end",
"def update\n @orbituarysite = Orbituarysite.find(params[:id])\n\n respond_to do |format|\n if @orbituarysite.update_attributes(params[:orbituarysite])\n format.html { redirect_to @orbituarysite, notice: 'Orbituarysite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @orbituarysite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n\n respond_to do |format|\n if @site.update_attributes(params[:site])\n format.html {redirect_to sites_url, flash[:info]='Site was successfully updated.' }\n format.js { flash[:info]='Site was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find(params[:id])\n flash[:notice] = \"Site was successfully updated.\" if @site.update_attributes(params[:site])\n respond_with(@site)\n end",
"def test_put_expenses_1_xml\n @parameters = {:expense => {:description => 'NewDescription'}}\n if ActiveRecord::VERSION::MAJOR < 4\n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/expenses/1.xml',\n {:expense => {:description => 'NewDescription'}},\n {:success_code => :ok})\n end\n\n assert_no_difference('Expense.count') do\n put '/expenses/1.xml', @parameters, credentials('admin')\n end\n\n expense = Expense.find(1)\n assert_equal \"NewDescription\", expense.description\n end",
"def update\n institution = @site.institution\n redirect_options = {}\n\n return unless authorize_resource(@site, UPDATE_SITE)\n\n @can_move = has_access?(institution, CREATE_INSTITUTION_SITE)\n\n respond_to do |format|\n update_or_save = false\n\n if site_params(@can_move).has_key?(:parent_id) && site_params(@can_move)[:parent_id].to_i != @site.parent_id\n new_site = institution.sites.new(site_params(true))\n begin\n Site.transaction do\n new_site.save!\n @site.devices.each do |device|\n device.site = new_site\n device.save!\n end\n @site.devices.clear\n\n @site.destroy\n update_or_save = true\n redirect_options = { context: new_site.uuid } if @navigation_context.entity.uuid == @site.uuid\n end\n rescue => e\n update_or_save = false\n # propagate errors from site to be created to original site\n new_site.errors.each do |k, m|\n @site.errors.add(k, m)\n end\n # mimic that attributes have been edited in the original site\n @site.assign_attributes(site_params)\n end\n else\n update_or_save = @site.update(site_params)\n end\n\n if update_or_save\n format.html { redirect_to sites_path(redirect_options), notice: I18n.t('sites.update.success') }\n format.json { head :no_content }\n else\n @sites = check_access(institution.sites, READ_SITE) if @can_move\n\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @element = Element.find(params[:id])\n\n respond_to do |format|\n if @element.update_attributes(params[:element])\n format.html { redirect_to @element, notice: 'Element was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @sitetype = Sitetype.find(params[:id])\n\n respond_to do |format|\n if @sitetype.update_attributes(params[:sitetype])\n flash[:notice] = 'Sitetype was successfully updated.'\n format.html { redirect_to(@sitetype) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitetype.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 authorize Element\n respond_to do |format|\n if @element.update(element_params)\n format.html { redirect_to @element, notice: 'Element je bil uspešno posodobljen.' }\n format.json { render :show, status: :ok, location: @element }\n else\n format.html { render :edit }\n format.json { render json: @element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def execute(site)\n section_name = @directory.delete('_')\n section_data = {}\n if (@schema_file)\n xsd = Nokogiri::XML::Schema(File.read(File.join(site.dir, @directory, @schema_file)))\n end\n Dir[File.join(site.dir, @directory, '*.xml')].each do |file|\n doc = Nokogiri::XML(File.read(file))\n # Validate the xml document against the schema\n if (xsd)\n errors = xsd.validate(doc)\n unless errors.empty?\n errors.each do |error|\n $LOG.info error\n end\n raise \"XML Validation errors (see above) for file #{file}\"\n end\n end\n\n section_data[File.basename(file, '.xml')] = doc\n end\n site.send(\"#{section_name}=\", section_data)\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: t('.flash_updated') }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site.user_id = current_user.id\n\tif params[:site][:size_ids].present?\n\t sizesgroup = Size.find params[:site][:size_ids]\n\t @site.sizes = sizesgroup\n\tend\n\t\n\trespond_to do |format|\n\t\t# We use an atomic transaction so that we can rollback\n\t\t# the update if anything goes wrong.\n\t\tSite.transaction do\n\t\t if @site.update(site_params)\n\t\t\t# Avoid passing a nil value to `attach` since it'll raise\n\t\t\t# a 'Blob must exist' validation error.\n\t\t\tif params[:site][:images]\n\t\t\t # As of today, we cannot attach an\n\t\t\t # associated file without saving. It'll always\n\t\t\t # call `create!`. This might change soon.\n\t\t\t @site.images.attach(params[:site][:images])\n\t\t\tend\n\t\t\t\n\t\t\tformat.json { render :show, status: :ok, location: @site }\n\t\t\t#format.json { head :no_content }\n\t\t\tformat.js\n\t\t else\n\t\t\tformat.json { render json: @site.errors, status: :unprocessable_entity }\n\t\t\tformat.js { render 'shared/errors' }\n\t\t end\n\t\tend\n end\n end",
"def rest_update(uri, method: Net::HTTP::Put)\n request = Net::HTTP::Get.new uri\n request.add_field(\"Accept\",\"application/xml\")\n auth_admin(request)\n \n Net::HTTP.start(uri.host, uri.port) do |http|\n response = http.request request\n response.value\n\n doc = REXML::Document.new response.body\n \n doc = strip_class_attributes(yield doc)\n \n request2 = method.new uri\n request2.content_type = 'application/xml'\n auth_admin(request2)\n\n request2.body=doc.to_s\n \n response2 = http.request request2\n response.value\n\n end\n \nend",
"def write\n if self.site.persisted?\n self.check_locales! unless self.force? # requirements\n\n if self.force?\n self.update_site\n end\n else\n self.create_site\n end\n end",
"def update\n @site = Site.find params[:id]\n return unless authorize_resource(@site, UPDATE_SITE)\n\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to sites_path, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @microsite = Microsite.find(params[:id])\n @microsites = Microsite.where(\"id != ?\",@microsite.id)\n @categories = Category.all\n respond_to do |format|\n if @microsite.update_attributes(params[:microsite])\n format.html { redirect_to admins_microsite_path(@microsite, :notice => 'Microsite was successfully updated.') }\n format.xml { head :ok }\n else\n build_microsite(@microsite)\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @microsite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n puts \"==========\"\n #puts params.require(:site).permit(:name, :url, :description)\n puts params[:url]\n puts params[:name]\n puts \"==========\"\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @website = Website.find(params[:id])\n\n respond_to do |format|\n if @website.update_attributes(params[:website])\n flash[:notice] = 'Website was successfully updated.'\n format.html { redirect_to(@website) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @website.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to after_update_path, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to sites_path, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to sites_url, notice: 'Site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_update_project_via_API_XML\r\n get \"/logout\"\r\n put \"/projects/1.xml\", :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response 401\r\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to edit_site_path(@site), notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site.user_id = current_user.id\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to @site, notice: 'Site was successfully updated.' }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @watch_site = WatchSite.find(params[:id])\n\n respond_to do |format|\n if @watch_site.update_attributes(params[:watch_site])\n format.html { redirect_to @watch_site, notice: 'Watch site was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watch_site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # TODO: see if mass-assigning gleaning_attributes works in Rails 5\n gleanings = params[:site].delete :gleaning_attributes\n if update_and_decorate\n if @site.errors.empty?\n @site.gleaning_attributes = gleanings\n respond_to do |format|\n format.html { redirect_to @site, notice: \"Site #{@site.name} was successfully updated.\" }\n format.json {\n flash[:popup] = \"#{@site.name} updated\"\n render :update\n }\n end\n return\n end\n end\n if @site\n resource_errors_to_flash @site\n else\n flash[:alert] = 'Couldn\\'t fetch site'\n end\n smartrender :action => :edit\n end",
"def update\n @site_type = SiteType.find(params[:id])\n\n respond_to do |format|\n section_type_ids = params[:site_type].delete(\"section_type_ids\")\n if @site_type.update_attributes(params[:site_type]) && @site_type.section_type_ids = section_type_ids\n format.html { redirect_to @site_type, notice: 'Site type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @site_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @supplysite = Supplysite.find(params[:id])\n\n respond_to do |format|\n if @supplysite.update_attributes(params[:supplysite])\n format.html { redirect_to @supplysite, notice: 'Angebotsort wurde erfolgreich aktualisiert.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @supplysite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @recycling_site = RecyclingSite.find(params[:id])\n\n respond_to do |format|\n if @recycling_site.update_attributes(params[:recycling_site])\n flash[:notice] = 'RecyclingSite was successfully updated.'\n format.html { redirect_to(@recycling_site) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @recycling_site.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_site_structure.update(admin_site_structure_params)\n format.html { redirect_to @admin_site_structure, notice: 'Site structure was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_site_structure }\n else\n format.html { render :edit }\n format.json { render json: @admin_site_structure.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to user_path(@user), notice: \"サイト[#{@site.name}]を編集しました\" }\n format.json { render :show, status: :ok, location: @site }\n else\n format.html { render :edit }\n format.json { render json: @site.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_update_link_via_API_XML\r\n get \"/logout\"\r\n put \"/links/1.xml\", :link => {:user_id => 1,\r\n :title => 'API Link 1',\r\n :url => 'http://www.api.com'}\r\n assert_response 401\r\n end",
"def update\n replace_entry \"word/document.xml\", doc.serialize(:save_with => 0)\n end",
"def update\n respond_to do |format|\n if @microsite.update(microsite_params)\n format.html { redirect_to @microsite, notice: 'Microsite was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @microsite }\n else\n format.html { render action: 'edit' }\n format.json { render json: @microsite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n check_page_element(params) do |page_element|\n page_element.\n update_attributes(:data => page_element.class.params_to_data(params),\n :id_str => params[\"idStr\"] || page_element.id_str)\n end\n end",
"def update!(**args)\n @site = args[:site] if args.key?(:site)\n end",
"def update\n @service = Service.find(params[:id])\n system_site_map = SystemSiteMap.where( :parameter => params[:id] ).first\n \n package_content\n \n respond_to do |format|\n if @service.update_attributes(params[:service])\n system_site_map.update_attributes(:title => @service.title)\n format.html { redirect_to({:action=>:show}, notice: t(\"helpers.notice.update\")) }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n run_callbacks :update do\n connection.put(element_path(prefix_options), encode_changes, self.class.headers).tap do |response|\n load_attributes_from_response(response)\n end\n end\n end",
"def update\n DOCUMENT_PATHS.each do |attr_name, path|\n if path.match(/\\*/)\n instance_variable_get(\"@#{attr_name}\").each do |simple_file_name, contents|\n replace_entry(\"word/#{simple_file_name}.xml\", contents.serialize(save_with: 0))\n end\n else\n xml_document = instance_variable_get(\"@#{attr_name}\")\n replace_entry path, xml_document.serialize(save_with: 0) if xml_document\n end\n end\n end",
"def update\n @website = Website.find(params[:id])\n\n respond_to do |format|\n if @website.update_attributes(params[:website])\n flash[:notice] = 'Website was successfully updated.'\n format.html { redirect_to admin_websites_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @website.errors.to_xml }\n end\n end\n end",
"def update_space_webapi(slug, body, headers=default_headers)\n @logger.info(\"Updating the \\\"#{slug}\\\" Web API on the Space.\")\n put(\"#{@api_url}/webApis/#{slug}\", body, headers)\n end",
"def update\n @subsite = Subsite.find(params[:id])\n\n respond_to do |format|\n if @subsite.update_attributes(params[:subsite])\n format.html { redirect_to @subsite, notice: 'Subsite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @subsite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def update\n @home_element = HomeElement.find(params[:id])\n\n respond_to do |format|\n if @home_element.update_attributes(params[:home_element])\n format.html { redirect_to @home_element, notice: 'Home element was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @home_element.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @site = Site.find_by_id( @site.id)\n if @site.nil? || @site.site_layout.nil?\n respond_to do |format|\n @themes = Layout::Theme.load.sort {|a,b| a.order <=> b.order }\n @selected_theme = @themes.find_by_name(@site.site_layout.theme)\n \n flash[:notice] = I18n.t(\"not_found\", :scope => TRANSLATION_SCOPE)\n format.html { \n render :action => \"index\" }\n format.xml { render :xml => @site.errors, \n :status => :unprocessable_entity }\n return\n end\n end\n # 属性設定\n# @site.user_id = current_user.id\n @site.site_layout.attributes = params[:site_layout]\n @site.user = current_user\n\n respond_to do |format|\n # 変更されていれば、履歴を作成\n if @site.site_layout.save(:validate => true)\n format.html { redirect_to(index_url, \n :notice => I18n.t(\"updated\", :scope => TRANSLATION_SCOPE))}\n format.xml { head :ok }\n else\n @themes = Layout::Theme.load\n @selected_theme = @themes.find_by_name(@site.site_layout.theme)\n format.html { render :action => \"index\" }\n format.xml { render :xml => @site.errors, \n :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @parsed_site = ParsedSite.find(params[:id])\n\n if @parsed_site.update(parsed_site_params)\n head :no_content\n else\n render json: @parsed_site.errors, status: :unprocessable_entity\n end\n end",
"def update\n do_load_resource\n get_project_if_exists\n do_authorize_instance\n\n @original_site_name = @site.name\n\n respond_to do |format|\n if @site.update(site_params)\n format.html { redirect_to [@project, @site], notice: 'Site was successfully updated.' }\n format.json { respond_show }\n else\n format.html do\n render action: 'edit'\n end\n format.json { respond_change_fail }\n end\n end\n end",
"def update\n @node_rack = @object\n\n respond_to do |format|\n if @node_rack.update_attributes(params[:node_rack])\n flash[:notice] = 'NodeRack was successfully updated.'\n format.html { redirect_to node_rack_url(@node_rack) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @node_rack.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n begin\n @element.update!(registered_element_params)\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @element.errors.any? ? @element : e },\n status: :bad_request\n else\n toast!(title: \"Element updated\",\n message: \"The element \\\"#{@element.name}\\\" has been updated.\")\n render \"shared/reload\"\n end\n end"
] | [
"0.6661964",
"0.63001144",
"0.6149885",
"0.6112012",
"0.60718286",
"0.60718286",
"0.6035054",
"0.60276175",
"0.60276175",
"0.60276175",
"0.60276175",
"0.59439754",
"0.5907783",
"0.58831424",
"0.58492404",
"0.5845436",
"0.58279246",
"0.5770019",
"0.5762629",
"0.5756456",
"0.5738597",
"0.57114923",
"0.56860685",
"0.5684344",
"0.56774116",
"0.567215",
"0.56678575",
"0.5667268",
"0.5666753",
"0.5662959",
"0.56432277",
"0.56329316",
"0.5624579",
"0.5614156",
"0.5607684",
"0.55805415",
"0.5560022",
"0.55489117",
"0.55387336",
"0.55350727",
"0.5525246",
"0.54974",
"0.5488538",
"0.547529",
"0.54195505",
"0.5416921",
"0.54164064",
"0.54114",
"0.54038405",
"0.53989893",
"0.5398365",
"0.5397528",
"0.5392781",
"0.53564817",
"0.5339544",
"0.5336942",
"0.533347",
"0.5322321",
"0.5322321",
"0.5319708",
"0.5319708",
"0.5317268",
"0.531229",
"0.5308021",
"0.5300933",
"0.52948767",
"0.52879435",
"0.5285531",
"0.52827406",
"0.52743113",
"0.52729714",
"0.52667505",
"0.5235031",
"0.52273726",
"0.5224736",
"0.52118725",
"0.51961696",
"0.5192865",
"0.5192531",
"0.51871353",
"0.5183185",
"0.5171183",
"0.51595616",
"0.51547724",
"0.51500535",
"0.5147509",
"0.5145344",
"0.51393825",
"0.51375216",
"0.5135533",
"0.51351064",
"0.5133939",
"0.5126979",
"0.5125457",
"0.51252586",
"0.5120966",
"0.5112728",
"0.5111311",
"0.5109664",
"0.51043904"
] | 0.6034205 | 7 |
DELETE /site_elements/1 DELETE /site_elements/1.xml | def destroy
@site_element.destroy
respond_to do |format|
format.html {
if params[:return_to]
return_to = URI.parse(params[:return_to]).path
redirect_to(return_to, notice: "#{@site_element.long_name} was successfully deleted.")
else
redirect_to(admin_site_elements_url)
end
}
format.xml { head :ok }
end
website.add_log(user: current_user, action: "Deleted a site element: #{@site_element.long_name}")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def delete(connection)\n r = connection.execute(%(<SiteDeleteRequest session-id=\"#{connection.session_id}\" site-id=\"#{@id}\"/>))\n r.success\n end",
"def destroy\n @site_attribute = @site.site_attributes.find(params[:id])\n @site_attribute.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_site_attributes_url(@site)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def delete_all(xpath); end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n \n if @site.uninstall(@site) == true \n puts \"\\n\\n\\n----------- DESTROYED -----------\\n\\n\\n\"\n puts \"SITE = #{@site.name}\"\n @site.destroy\n @site.save\n \n respond_to do |format|\n format.html { redirect_to(sites_url, :notice => \"Your site was successfully deleted.\") }\n format.xml { head :ok }\n end\n else\n redirect_to(@site, :warning => \"Remove site incomplete!. Please contact administrator.\")\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n # retrieve the site thanks to params[:id]\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n sf = @site.site_files.find params[:id]\n sf.destroy\n\n flash[:notice] = \"#{sf.path} has been deleted.\"\n respond_to do |format|\n format.html { redirect_to(site_site_files_path(@site)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n raise UnknownSite, \"Site not existent in Piwik yet, call 'save' first\" if new?\n xml = call('SitesManager.deleteSite', :idSite => id)\n result = XmlSimple.xml_in(xml, {'ForceArray' => false})\n freeze\n result['success'] ? true : false\n end",
"def remove\n @site = Site.find(params[:id])\n @study.sites.delete(@site)\n\n respond_to do |format|\n format.xml { head :ok }\n format.js\n end\n end",
"def delete(element_key)\n parameter = { basic_auth: @auth }\n response = self.class.delete(\"/elements/#{element_key}\", parameter)\n unless response.success?\n puts \"Could not save element: #{response.headers['x-errordescription']}\"\n end\n response\n end",
"def deleteSite _args\n \"deleteSite _args;\" \n end",
"def destroy\n Site.delete_all \"sitename = 'lost+found'\" \n super\n end",
"def delete_site(site_id)\n r = execute(make_xml('SiteDeleteRequest', { 'site-id' => site_id }))\n r.success\n end",
"def destroy\n @element = Element.find(params[:id])\n @element.destroy\n\n respond_to do |format|\n format.html { redirect_to(elements_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @element = Element.find(params[:id])\n @element.destroy\n\n respond_to do |format|\n format.html { redirect_to(elements_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @elemento = Elemento.find(params[:id])\n @elemento.destroy\n\n respond_to do |format|\n format.html { redirect_to(elementos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n if @site.columns.size > 0\n flash[:error] = \"该站点存在多个栏目,不能删除\"\n else\n delete_file(@site.logo_file) if [email protected]_file.blank?\n @site.destroy\n end\n\n respond_to do |format|\n format.html { redirect_to cms.sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"def destroy\n @selector_site = SelectorSite.find(params[:id])\n @selector_site.destroy\n\n respond_to do |format|\n format.html { redirect_to(selector_sites_url) }\n format.xml { head :ok }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @recycling_site = RecyclingSite.find(params[:id])\n @recycling_site.destroy\n\n respond_to do |format|\n format.html { redirect_to(recycling_sites_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @parsed_site.destroy\n\n head :no_content\n end",
"def cleanup\n\tsh 'del /F /Q .\\_site\\*'\n\t# sh 'rm -rf ./_site'\nend",
"def delete\n delete_from_server single_url\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { \n flash[:notice] = 'Site was successfully removed.'\n if current_user.admin? \n redirect_to admin_path\n else\n redirect_to(sites_url)\n end\n }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @website = Website.find(params[:id])\n @website.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_websites_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @website = Website.find(params[:id])\n @website.destroy\n\n respond_to do |format|\n format.html { redirect_to(websites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy\n @microsite = Microsite.find(params[:id])\n @microsite.destroy\n\n respond_to do |format|\n format.html { redirect_to(admins_microsites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site.destroy\n redirect_to admin_sites_url, notice: t('admin.destroy.success')\n end",
"def destroy\n @site = Site.find(params[:id], :conditions => ['user_id = ?', current_user.id])\n @site.destroy\n\n flash[:notice] = 'Site was successfully removed from your permissions list.'\n\n respond_to do |format|\n format.html { redirect_to(user_sites_url(:user_id => current_user.id)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site_link = SiteLink.find(params[:id])\n @site_link.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_links_url) }\n format.xml { head :ok }\n end\n end",
"def delete_element(element); end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to xmt_press_sites_url, notice: '站点删除成功.' }\n format.json { head :no_content }\n end\n end",
"def deleteEntityWebsite( 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/website\",params)\n end",
"def delete; rest_delete(link('self')); end",
"def delete; rest_delete(link('self')); end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def destroy\n #[email protected]\n m_site = MSite.find(params[:id].to_i)\n m_site.del_flg = 1\n m_site.save\n\n respond_to do |format|\n format.html { redirect_to '/m_sites', notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @website.destroy\n respond_to do |format|\n format.html { redirect_to(contact_info_admin_websites_url) }\n format.xml { head :ok }\n end\n add_log(user: current_user, action: \"Deleted website: #{@website.url}\")\n end",
"def destroy\n @site_banner = SiteBanner.find(params[:id])\n @site_banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_banners_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @element = @account.elements.find(params[:id])\n @element.destroy\n respond_to do |format|\n format.html { redirect_to(elements_url, :notice => 'Element was sucessfully destroyed.') }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find_by_site(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def unlink_site\n FileUtils.rm_rf(self.absolute_path) if File.exists?(self.absolute_path)\n end",
"def delete\n client.delete(\"/#{id}\")\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 @site = Site.find(params[:id])\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :ok }\n end\n end",
"def delete(element); end",
"def delete_element(xpath)\n if NOKOGIRI\n @xml.xpath(xpath.to_s).remove\n else\n @xml.delete_element(xpath.to_s)\n end\n end",
"def cmd_delete argv\n setup argv\n e = @hash['element']\n response = @api.delete(e)\n msg response\n return response\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to(sites_url) }\n format.xml { head :ok }\n format.js\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def delete\n self.class.delete self.href\n end",
"def deletinfo\n SiteInfo.find(params[:id]).destroy\n redirect_to \"/admin\"\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to sites_url }\n format.json { head :no_content }\n end\n end",
"def file_delete(file)\n\t\tputs \"Delete entries to the local site store from file: #{file}\" if @verbose\n\t\traise \"File non-exist. Please check your file path and name again: #{file}\" unless File.exist?(file)\n\t\tsites=file_2_list(file)\n\t\tchanges=Array.new\n\t\tchanges=bulk_delete(sites) unless sites.nil? or sites.empty?\n\trescue => ee\n\t\tputs \"Exception on method file_delete: #{ee} for file: #{file}\" if @verbose\n\tend",
"def destroy\n @website = Website.find(params[:id])\n @website.destroy\n\n head :no_content\n end",
"def destroy\n @site = Site.find(params[:id])\n \n return if !self.authorize?\n \n @site.destroy\n \n respond_to do |format|\n format.html { redirect_to sites_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = Site.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_path, notice: 'Site was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sitelink = Sitelink.find(params[:id])\n @sitelink.destroy\n\n respond_to do |format|\n format.html { redirect_to(sitelinks_url) }\n format.xml { head :ok }\n end\n end",
"def delete(path)\n root.delete(path)\n end",
"def delete(id)\r\n connection.delete(\"/#{@doctype}[@ino:id=#{id}]\")\r\n end",
"def destroy\n @storeloc = Storeloc.find(params[:id])\n @storeloc.itemlocs.each do |loc|\n loc.destroy\n end\n\n @storeloc.destroy\n\n respond_to do |format|\n format.html { redirect_to(storelocs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n run_callbacks :destroy do\n connection.delete(element_path, encode, self.class.headers)\n end\n end",
"def destroy\n @element = Element.find(params[:id])\n @element.destroy\n\n respond_to do |format|\n format.html { redirect_to elements_url }\n format.json { head :ok }\n end\n end",
"def destroy\n return unless authorize_resource(@site, DELETE_SITE)\n\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to sites_path, notice: I18n.t('sites.destroy.success') }\n format.json { head :no_content }\n end\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end",
"def delete!\n\t\t\tClient.delete @root\n\t\tend",
"def destroy\n @site = Site.find(id_from_params)\n\n respond_to do |format|\n if current_user.account.sites.delete(@site)\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @related_content = RelatedContent.find(params[:id])\n @related_content.destroy\n dirname = \"#{RelatedContent::UPLOAD_DIR}/#{@related_content.id}\"\n FileUtils.rm_rf dirname\t\n redirect_to @related_content.node\t \n\nend",
"def destroy\n @config_xml = ConfigXml.find(params[:id])\n @config_xml.destroy\n\n respond_to do |format|\n format.html { redirect_to(config_xmls_url) }\n format.xml { head :ok }\n end\n rescue ActiveRecord::RecordNotFound => e\n prevent_access(e)\n end",
"def destroy\n @page = @site.pages.find(params[:id])\n @page.destroy\n\n respond_to do |format|\n format.html { redirect_to(@parent_page ? admin_site_page_children_url(@site, @parent_page) : admin_site_pages_url(@site)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site.destroy\n respond_to do |format|\n format.html { redirect_to user_path(@user), notice: \"サイト[#{@site.name}]を削除しました\" }\n format.json { head :no_content }\n end\n end",
"def destroy \n Link.connection.execute(\"delete from links where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(links_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @block = @site.blocks.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site = current_user.sites.find(params[:id])\n @site.destroy\n\n respond_to do |format|\n format.html { flash_and_redirect(\"successfully deleted\", sites_url) }\n format.json { head :ok }\n end\n end",
"def destroy\n @site_user_info = SiteUserInfo.find(params[:id])\n @site_user_info.destroy\n\n respond_to do |format|\n format.html { redirect_to(site_user_infos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @site.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_sites_url, notice: 'Site was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.6698817",
"0.6629366",
"0.6550205",
"0.6543918",
"0.65353584",
"0.65353584",
"0.65353584",
"0.65353584",
"0.65353584",
"0.65353584",
"0.65353584",
"0.65353584",
"0.65216714",
"0.65147686",
"0.6456623",
"0.6435682",
"0.6422348",
"0.6351971",
"0.63177294",
"0.6302821",
"0.62866724",
"0.6280583",
"0.6257587",
"0.6257587",
"0.6241465",
"0.6233545",
"0.6216697",
"0.6214167",
"0.619761",
"0.61921555",
"0.61902857",
"0.6172313",
"0.61182994",
"0.61105067",
"0.61088794",
"0.609705",
"0.607656",
"0.60652196",
"0.6057734",
"0.6048511",
"0.60284185",
"0.6015644",
"0.60140496",
"0.5987832",
"0.5986871",
"0.5978757",
"0.59705037",
"0.59705037",
"0.5968158",
"0.59422046",
"0.5940714",
"0.5910985",
"0.5909658",
"0.58979946",
"0.58930147",
"0.5892578",
"0.58923393",
"0.58627397",
"0.5862542",
"0.5860629",
"0.5858198",
"0.5849972",
"0.58456063",
"0.5839187",
"0.5839187",
"0.5839187",
"0.5839187",
"0.5839187",
"0.5814279",
"0.581413",
"0.5810816",
"0.5807257",
"0.5807257",
"0.5807257",
"0.5807257",
"0.5807257",
"0.58049256",
"0.57946926",
"0.5792716",
"0.57873535",
"0.577913",
"0.5774472",
"0.57650995",
"0.5759011",
"0.5748027",
"0.57373613",
"0.5734486",
"0.57251585",
"0.5720878",
"0.57190126",
"0.5717168",
"0.57117873",
"0.57074374",
"0.5685878",
"0.5682773",
"0.5675833",
"0.56693244",
"0.5669024",
"0.5659062",
"0.56539965"
] | 0.66200876 | 2 |
Since the Game class is essentially the game engine, most user actions are still here but there is a lot of room for rebuilding. Below you can see we're calling a method within $hero. It's probably going to have a separate class full of user actions alone at some point but for now, it is what it is. This is really the start of the algorithm responsible for generating new rooms. If rooms weren't drawn as you attempt to enter them, the algorithm could be kept separate from the move method. I like this way better because it means that later, if we count the number of unexplored exits, we could then change the algorithm to force additional open doors that way you're guarenteed to always have new exits available. | def move_disambig(direction)
@north_cmds = ["n", "up", "north"]
@east_cmds = ["e", "right", "east"]
@west_cmds = ["w", "left", "west"]
@south_cmds = ["s", "down", "south"]
xy = $hero.location.xy.split(", ")
x = xy[0].to_i
y = xy[1].to_i
if @north_cmds.include?(direction)
if $hero.location.exits.include?("north")
check_room("north", x, (y + 1))
move("north")
else
puts "There is no exit to the north!"
end
elsif @east_cmds.include?(direction)
if $hero.location.exits.include?("east")
check_room("east", (x + 1), y)
move("east")
else
puts "There is no exit to the east!"
end
elsif @west_cmds.include?(direction)
if $hero.location.exits.include?("west")
check_room("west", (x - 1), y)
move("west")
else
puts "There is no exit to the west!"
end
elsif @south_cmds.include?(direction)
if $hero.location.exits.include?("south")
check_room("south", x, (y - 1))
move("south")
else
puts "There is no exit to the south!"
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def move_hero\n #get next square\n next_x = @cur_x + DIRECTION[@hero_direction][0]\n next_y = @cur_y + DIRECTION[@hero_direction][1]\n next_x = 0 if next_x < 0\n next_x = 14 if next_x > 14\n next_y = 0 if next_y < 0\n next_y = 14 if next_y > 14\n #look at new square in room\n next_square = @room[next_x][next_y]\n draw_map(next_x,next_y)\n #don't move onto it if next square is an object that can't be walked over\n if next_square == CHAR_FLOOR || next_square == CHAR_IN || next_square == CHAR_OUT ||\n next_square == CHAR_TRAP || next_square == CHAR_SAFE\n #walked into trap, keep on trap unless strong and lucky\n if @room[@cur_x][@cur_y] == CHAR_TRAP &&\n @stats[:strength] <= (@orig_stats[:strength] * 0.8) &&\n @stats[:luck] <= Random.rand(15)\n next_x = @cur_x\n next_y = @cur_y\n end\n #increase health on any move\n @stats[:strength] += (@stats[:vitality] / 200.0) if @stats[:strength] < @orig_stats[:strength]\n #move the character\n if next_x != @cur_x || next_y != @cur_y\n draw_map(@cur_x, @cur_y)\n @cur_x = next_x\n @cur_y = next_y\n draw_map(@cur_x, @cur_y)\n end\n #if on exit door then decend to next level if have enough experience\n if next_square == CHAR_OUT\n load_dungeon_file(@current_level+1)\n end\n end\n #cause damage if walked into wall\n if next_square == CHAR_WALL\n @stats[:strength] -= 0.3\n end\n\n #dead\n end",
"def create_game2(state, substate, money, life, fights, respect)\n\n game = GameController.new(money,life,fights,respect)\n\n\n########################################################################################################################################\n##Room 7\n\n move = Move.new(0, \"Para entrar dirigete al norte\" , \n Proc.new{|room, game| game.go_state(40) ; \"Estas entrando\"} , nil,nil, nil)\n room1 = Room.new(7,\"Despiertas en un lugar lugubre, lo unico que alcanzas a ver es un letrero que dice Bienvenido a Ecatepec\")\n room1.state = move\n room1.add_state(move)\n game.set_state(7, room1)\n\n########################################################################################################################################\n##Room 40\n room40 = Room.new(40,\"Comienzas a caminar, huele a drogas en el aire\")\n move = Move.new(0, \"Te espantas así que tienes dos opciones: ir al sur para huir, o entrar a una tienda que encuentras abierta al este\" , \n nil , Proc.new{|room, game| game.go_state(7) ; \"Has Huido\"} , Proc.new{|room, game| game.go_state(29) ; game.respect+=5; \"Entraste a la tienda, tu respeto aumentó\"} , nil)\n room40.state = move\n room40.add_state(move)\n game.set_state(40, room40)\n\n\n\n########################################################################################################################################\n##Room 29\n room29 = Room.new(29,\"La tienda tiene rastros de que hubo una pelea aqui\")\n coin1 = CoinFlipper.new(0,\"Tira una moneda para probar tu suerte\", \n Proc.new{|room, game| room.go_sub(1); \"Encontraste una cartera\"} , \n Proc.new{|room, game| room.go_sub(2); \"Alguien te ha retado\"})\n coin2 = CoinFlipper.new(1,\"Tira una moneda para probar tu suerte\", \n Proc.new{|room, game| game.money += 200; room.go_sub(4); \"Encontraste 200 varos\"} , \n Proc.new{|room, game| room.go_sub(2); \"Alguien viene\"}) \n fight1 = Fight.new(2, \"La Britney te ha retado a unos navajasos, puedes huir si le das 50 varos o puedes pelear con ella\" , \n Proc.new{|room, game| room.go_sub(3); \"Estas entrando a la pelea...\"} , \n Proc.new{|room, game| \n if game.money >= 50 \n game.money -=50\n game.respect -=5\n room.go_sub(4)\n \"Has huido, tu respeto baja\"\n else \n \"No puedes huir\"\n end\n })\n coin3 = CoinFlipper.new(3,\"Tira una moneda para probar tu suerte en la pelea\", \n Proc.new{|room, game| room.go_sub(4); game.respect +=15 ; game.fights += 1; \"Has derrotado a la Britney, tu respeto aumenta\"} , \n Proc.new{|room, game| room.go_sub(4); game.life-=15; \"La britney te ha derrotado y tu vida baja 15 puntos\"})\n move = Move.new(4, \"Para salir de la tienda ve al norte , para ir a otro lado y probar tu suerte ve al este.\" , \n Proc.new{|room, game| game.go_state(40) ; \"Sales de la tienda\"} , nil, Proc.new{|room, game| game.go_state(6) ; \"Entras al este\"}, nil)\n\n room29.state= coin1\n room29.add_state(coin1).add_state(coin2).add_state(fight1).add_state(coin3).add_state(move)\n game.set_state(29, room29)\n\n########################################################################################################################################\n##Room 6\n\n room6 = Room.new(6,\"Sales a una avenida principal con forma de L, ves a drogadictos tirados en el piso pidiendo dinero.\")\n coin1 = CoinFlipper.new(0,\"Hay un sonido repentino, giras. Tira una moneda\", \n Proc.new{|room, game| game.go_state(43); \"Te diriges al oeste\"} , \n Proc.new{|room, game| room.go_sub(1); \"Solo hay una ventana\"})\n move = Move.new(1, \"Si quieres asomarte ve al este si quieres seguir por la calle ve al norte \" , \n Proc.new{|room, game| game.go_state(29) ; \"Sigues por la calle\"} , nil, Proc.new{|room, game| game.go_state(28) ; \"Decides asomarte\"}, nil)\n room6.state = coin1\n room6.add_state(coin1).add_state(move)\n game.set_state(6, room6)\n\n########################################################################################################################################\n##Room 28\n\n\n room28 = Room.new(28,\"Alcanzas a ver un Mercado artesanal a la distancia, intentas ver que hay y encuentras la puerta a un edificio que parece tener un teléfono\")\n move = Move.new(0, \"Ve hacia el este\" , \n nil, nil, Proc.new{|room, game| game.go_state(6) ; \"Te diriges al este\"}, nil)\n room28.state = move\n room28.add_state(move)\n game.set_state(28, room28)\n\n\n########################################################################################################################################\n##Room 43\n room43 = Room.new(43, \"El barrio esta cada vez más lugubre\")\n coin1 = CoinFlipper.new(0,\"El lider de los metalicos llamado “El brayan” te reta a unos navajazos a muerte, tira una moneda\", \n Proc.new{|room, game| room.go_sub(1); \"El Brayan ha intentado picarte pero lo esquivaste\"} , \n Proc.new{|room, game| game.go_state(36); game.respect= 0; game.life -= 30; \"El Brayan te ha soltado un navajazo mortal y se ha ido. Has perdido todo tu respeto y tu vida baja 30 puntos\"})\n coin2 = CoinFlipper.new(1,\"La pelea sigue, tira otra moneda para probar tu suerte\", \n Proc.new{|room, game| room.go_sub(2); game.respect+=100; game.fights+=1; \"Esquivaste otro najajazo y lograste vencerlo, tu respeto aumenta considerablemente\"} , \n Proc.new{|room, game| game.go_state(36); game.respect= 0; game.money = 0; game.life -= 30; \"El Brayan te derrotó con una patada mortal. Has perdido todo tu respeto y dinero, tu vida baja 30 puntos\"})\n coin3 = CoinFlipper.new(2,\"El brayan soltó una mona de guayaba, la tomas, tira una moneda\", \n Proc.new{|room, game| game.go_state(36); game.life = 100; \"La mona tiene grandes poderes curativos, tu vida está al máximo\"} , \n Proc.new{|room, game| game.go_state(36); game.life -= 5; \"La mona tiene malos efectos, tu vida baja\"})\n room43.state = coin1\n room43.add_state(coin1).add_state(coin2).add_state(coin3)\n game.set_state(43, room43)\n\n\n########################################################################################################################################\n##Room 36\n room36 = Room.new(36, \"Sigues caminando por la calle, ves una Fuente en donde varias personas se estan bañando\")\n coin1 = CoinFlipper.new(0,\"Tira una moneda\", \n Proc.new{|room, game| game.go_state(41); \"Ahora te diriges al norte\"} , \n Proc.new{|room, game| game.go_state(15); \"Ahora te dirijes al sur\"})\n room36.state = coin1\n room36.add_state(coin1)\n game.set_state(36, room36);\n \n\n\n########################################################################################################################################\n##Room 41\n room41 = Room.new(41, \"Dejas la fuente atras y descubres una calle llena de cholos\")\n coin1 = CoinFlipper.new(0,\"Tira una moneda para decidir a que cholo dirigirte\", \n Proc.new{|room, game| room.go_sub(1); game.respect+=20; \"Le has caido bien al cholo, se ponen a bailar cholocumbia y tu respeto aumenta\"} , \n Proc.new{|room, game| room.go_sub(1); game.life-=15; \"El cholo te ha mordido y tu vida baja 15 puntos\"})\n move = Move.new(1, \"Dirigete al sur\" , \n nil , Proc.new{|room, game| game.go_state(35) ; \"Caminas hacia el sur\"} ,nil, nil)\n #35\n room41.state = coin1\n room41.add_state(coin1).add_state(move)\n game.set_state(41, room41)\n\n########################################################################################################################################\n##Room 15\n\n room15 = Room.new(15, \"En la misma calle descubres una gasolinera\")\n move = Move.new(0, \"Si quieres explorar la gasolinera ve hacia el norte. Si quieres huir ve hacia el sur\" , \n Proc.new{|room, game| game.go_state(12) ; \"Caminas hacia el norte para explorar\"} , Proc.new{|room, game| game.go_state(24) ; \"Caminas hacia el sur\"} ,nil, nil)\n room15.state = move\n room15.add_state(move)\n game.set_state(15, room15)\n\n########################################################################################################################################\n##Room 12\n\n room12 = Room.new(12, \"Entras al edificio de la gasolinera lentamente, huele a mona de guayaba\")\n coin1 = CoinFlipper.new(0,\"Has encontrado una mochila, puede contener buenas cosas. Prueba tu suerte tirando una moneda\", \n Proc.new{|room, game| game.go_state(42); game.respect+=3; \"Has encontrado una navaja legendaria, tu respeto incrementará\"} , \n Proc.new{|room, game| game.go_state(42); game.life-=3; \"La mochila contenía jeringas usadas, te picas con una de ellas y tu vida baja. Escapas de ese lugar por el sur\"})\n\n room12.state = coin1\n room12.add_state(coin1)\n game.set_state(12, room12)\n\n########################################################################################################################################\n##Room 24 \n room24 = Room.new(24, \"Este lugar es totalmente diferente a todos los demás, un hermoso y limpio jardín en donde descansar\")\n move = Move.new(0, \"Por lugar para descansar, tu vida subiera a 90 puntos cuando decidas salirte. camina hacia el Sur\" , \n nil , Proc.new{|room, game| game.go_state(42); game.life=90; \"Caminas hacia el sur\"} ,nil, nil)\n\n room24.state= move\n room24.add_state(move)\n game.set_state(24, room24)\n\n########################################################################################################################################\n##Room 35\n\n room35 = Room.new(35, \"Llegas al cuarto principal de la bodega, ahi se encuentra el jardin “magico” lleno de droga\")\n coin1 = CoinFlipper.new(0,\"Hay un obstaculo en el camino, tira una moneda para probar tu suerte\", \n Proc.new{|room, game| game.go_state(8); \"Te haz tropezado y causado un alboroto en la otra sala\"} , \n Proc.new{|room, game| game.go_state(9); \"Has pasado el obstaculo y ahora sales de la sala\"})\n room35.state = coin1\n room35.add_state(coin1)\n game.set_state(35, room35)\n\n########################################################################################################################################\n##Room 42\n\nroom42 = Room.new(42, \"Has llegado al zócalo de Ecatepec, el lugar esta muy concurrido y hay diferentes calles y una casa que llama mucho la atención \")\n move = Move.new(0, \"Para observar lo que hay dentro de la casa, camina hacia el Sur. \n Si quieres dirigirte al estacionamiento ve hacia el Este. \n Camina hacia el Norte si deseas ir a la calle de enfrente, o al Oeste para la calle de a lado \",\n Proc.new{|room, game| game.go_state(9); \"Vas en camino hacia la calle que sigue\"},\n Proc.new{|room, game| game.go_state(26); \"Caminas hacia la casa extraña\"},\n Proc.new{|room, game| game.go_state(13); \"Te acercas al estacionamiento\"},\n Proc.new{|room, game| game.go_state(38); \"Vas camino a la calle de a lado\"} )\n room42.state = move\n room42.add_state(move)\n game.set_state(42, room42)\n\n########################################################################################################################################\n##Room 8\nroom8 = Room.new(8, \"Estas en la sala especialde la bodega, aqui todos parecen sospechosos\")\ncoin1 = CoinFlipper.new(0, \"Un chaca llamado “El aletz” te ataca con un picahielo. Tira una moneda para ver que pasa\",\n Proc.new{|room, game| game.go_state(43); game.life-=15; \"El aletz te ha clavado, tu vida baja y escapas del lugar\"},\n Proc.new{|room, game| game.go_state(43); game.respect+=20; \"Has derrotado al aletz, y sales inmediatamente de la sala\"})\nroom8.state = coin1\nroom8.add_state(coin1);\ngame.set_state(8, room8)\n\n########################################################################################################################################\n##Room 9\n\nroom9 = Room.new(9, \"Sigues en la gran bodega y encuentras varias cajas\")\nmove = Move.new(0, \"Tienes la opción de seguir en la pbodega por el Este, o salir por el Sur\",\n nil ,\n Proc.new{|room, game| game.go_state(41); \"Estas saliendo del lugar\"},\n Proc.new{|room, game| game.go_state(8); \"Te adentras más a la bodega\"}, nil)\nroom9.state = move\nroom9.add_state(move)\ngame.set_state(9, room9)\n\n\n########################################################################################################################################\n##Room 13\n\n room13 = Room.new(13, \"Te encuentras en un estacionamiento bastante oscuro y con poco carros, el olor a gasolina emana de todos lados\")\n coin1 = CoinFlipper.new(0, \"Un viene viene con un flow violento te ataca. Tira una moneda para ver si puedes vencerlo\",\n Proc.new{|room, game| game.go_state(42); game.respect+=10; \"Le has vencido y tu respeto aumenta\"},\n Proc.new{|room, game| game.go_state(42); game.life-=10; \"El viene viene te ha derrotado, tu vida baja 10 puntos \"})\n room13.state = coin1\n room13.add_state(coin1)\n game.set_state(13, room13)\n\n\n########################################################################################################################################\n##Room 26\n\n room26 = Room.new(26, \"La casa es bastante extraña y hay unos sujetos con cara de pocos amigos\")\n fight1 = Fight.new(0, \"Para pasar de ahi tienes dos opciones, huir y dales 100 varos a los sujetos o pelear con ellos\",\n Proc.new{|room, game| game.go_state(42); game.life -=20 ; game.respect+=50; \"Los sujetos te atacan con todas sus armas y pierdes mucha vida\"},\n Proc.new{|room, game| game.go_state(42); game.money-=100 ; \"Le pagas su moche a todos y te vas\"})\n room26.state = fight1\n room26.add_state(fight1)\n game.set_state(26, room26)\n\n########################################################################################################################################\n##Room 38\n \n room38 = Room.new(38, \"Esta parece ser una avenida principal, hay mucho trasporte publico por aquí\")\n coin1 = CoinFlipper.new(0, \"A lo lejos encuentras el TrasnporTEC, tira una moneda para ver si lo alcanzas\",\n Proc.new{|room, game| game.go_state(14); \"Lo has alcanzado, estas salvado\"},\n Proc.new{|room, game| game.go_state(6); \"Lastima, te ha dejado el camión y ahora estas perdido\"})\n room38.state = coin1\n room38.add_state(coin1)\n game.set_state(38, room38)\n\n########################################################################################################################################\n##Room 14\n\n room14 = Room.new(14, \"Lo has logado, sobreviviste a Ecatepec. Ahora estas comodamente en el camión camino a tu nueva aventura en los examenes finales, Buena suerte\")\n move = Move.new(0, \"Disfruta tu camino al Tec\" ,\n Proc.new{\"Relajate, para qué te mueves? Todo esta bien\"},\n Proc.new{\"Relajate, para qué te mueves? Todo esta bien\"},\n Proc.new{\"Relajate, para qué te mueves? Todo esta bien\"},\n Proc.new{\"Relajate, para qué te mueves? Todo esta bien\"})\n room14.state = move\n room14.add_state(move)\n game.set_state(14, room14)\n\n\n\n\n\n game.go_state(state)\n game.state.go_sub(substate)\n game\n\nend",
"def run\n #Load the Hero File\n load_hero_file\n #Load dungeon at top level\n load_dungeon_file(@current_level)\n #display the hero's starting spot\n clear_message_box\n #get input either an action or a movement.\n while true\n update_screen\n key = @ui.instr\n case key\n when 'B','b' #turn left\n @hero_direction = POS_TURN.rotate!(-1)[0]\n when 'N','n' #turn right\n @hero_direction = POS_TURN.rotate!(1)[0]\n when 'M','m' #move ahead\n move_hero\n when 'A','a' #attack\n hero_attack if @monster_detected\n when 'C','c' #cast\n if @stats[:aura] > 0 && [email protected]?\n cast_spell\n else\n @ui.place_text('FIZZZZ....'.ljust(20),1,2,DungeonOfDoom::C_BLACK_ON_YELLOW)\n @ui.place_text(MSG_NOTHING.ljust(20),1,3,DungeonOfDoom::C_BLACK_ON_YELLOW)\n end\n when 'G','g' #get\n get_object\n when 'P','p' #potion\n drink_potion\n when 'R','r' #reveal\n light_room\n when 'S','s' #save?\n #not implemented yet\n when 'Q','q' #quit\n if ask_question('DO YOU REALLY WANT', 'TO QUIT? (Y/N)') == 'Y'\n break\n else\n clear_message_box\n end\n else\n #do nothing\n end\n #automated game elements\n\n #monster detected\n monster_attack if @monster_detected\n #hero died\n if @stats[:strength] <= 0\n game_over\n break\n end\n #hero gets idol!\n if @idol_found\n win_game\n break\n end\n end\n end",
"def hero; end",
"def hero; end",
"def hero; end",
"def hero; end",
"def hero; end",
"def get_object\n next_x = @cur_x + DIRECTION[@hero_direction][0]\n next_y = @cur_y + DIRECTION[@hero_direction][1]\n return if next_x < 0 || next_x > 14 || next_y < 0 || next_y > 14\n #look at new square in room\n next_square = @room[next_x][next_y]\n if next_square == CHAR_POTION || next_square == CHAR_CHEST || next_square == CHAR_IDOL\n @room[next_x][next_y] = CHAR_FLOOR\n draw_map(next_x,next_y)\n @potions += 1 if next_square == CHAR_POTION\n @treasure += 1 if next_square == CHAR_CHEST\n @idol_found = true if next_square == CHAR_IDOL\n @stats[:experience] += 0.25\n end\n end",
"def monster_attack\n #set up monster distance and next move\n distance_x = @mon_x - @cur_x\n distance_y = @mon_y - @cur_y\n sign_x = distance_x <=> 0\n sign_y = distance_y <=> 0\n new_x = @mon_x-(1*sign_x)\n new_y = @mon_y-(1*sign_y)\n next_square = @room[new_x][new_y]\n #move monster closer to hero unless blocked or next to hero\n if next_square == CHAR_FLOOR && (distance_x.abs > 1 || distance_y.abs > 1)\n @room[@mon_x][@mon_y] = CHAR_FLOOR\n draw_map(@mon_x, @mon_y)\n @mon_x, @mon_y = new_x, new_y\n @room[@mon_x][@mon_y] = @mon_type\n draw_map(@mon_x, @mon_y)\n end\n #hit hero if close enough and hero not on saftey square\n if (distance_x.abs <= 1 && distance_y.abs <= 1) && @room[@cur_x][@cur_y] != CHAR_SAFE\n hit = @mon_attack * 1.5\n #hit if not dodged\n skill = @stats[:luck]+@stats[:agility]\n clear_message_box\n if Random.rand(skill+(@mon_attack*3)) > skill\n @ui.place_text(MSG_DAMGAGE.ljust(20),1,2)\n damage = hit / (2+@defence)\n @stats[:strength] -= damage\n @stats[:vitality] -= damage/10\n #see if hit weapon\n if Random.rand(7) == @mon_attack #1 in 7 chance of loosing item\n item_found = false\n until item_found\n #get a random item, keep trying until found on hero\n object = ['2 HAND SWORD', 'BROADSWORD', 'SHORTSWORD', 'AXE', 'MACE', 'FLAIL', 'DAGGER', 'GAUNTLET',\n 'HEAVY ARMOUR', 'CHAIN ARMOUR'].rotate(Random.rand(10)+1).first\n item = @objects.find { |obj| obj[:name]==object }\n if item\n if object == 'HEAVY ARMOUR' || object == 'CHAIN ARMOUR'\n @defence -= item[:power]\n else\n @attack -= item[:power]\n end\n @ui.place_text(\"#{object}!!\".ljust(20), 1, 3)\n @objects.delete(item)\n item_found = true\n end\n end\n end\n else\n @ui.place_text(MSG_MMISS.ljust(20),1,2)\n end\n sleep 0.5 #slow everything down\n end\n end",
"def hero_win\n puts \"#{monster.name} defeated! You gain #{monster.experience} experience.\"\n hero.update(experience: hero.experience + monster.experience)\n reward\n end",
"def moves\n\n end",
"def moves\n end",
"def game; end",
"def game; end",
"def game; end",
"def game; end",
"def game; end",
"def game; end",
"def game; end",
"def fight_scene\n\tjason = PowerRanger.new(\"Jason\", \"Red\")\n\ttommy = PowerRanger.new(\"tommy\", \"Green\")\n\tjon = Person.new(\"Jon\")\n\thoward = Person.new(\"Howard\")\n\tevilGuy_a = EvilNinja.new(\"Evil Guy 1\")\n\tevilGuy_b = EvilNinja.new(\"Evil Guy 2\")\n\n\tputs \"Two innocent bystanders are attacked by evil ninjas.\"\n\tjon.scream\n\thoward.scream\n\tjon.run\n\thoward.drink_coffee\n\thoward.run\n\n\tputs \"The Power Rangers arrive!\"\n\tjason.punch(evilGuy_a)\n\ttommy.punch(evilGuy_b)\n\tjason.rest(2)\n\ttommy.drink_coffee\n\n\tputs \"The Evil Ninjas fight back.\"\n\tevilGuy_a.punch(tommy)\n\tevilGuy_b.punch(tommy)\n\tevilGuy_a.cause_mayhem(jason)\n\n\tputs \"The Power Rangers try Megazord\"\n\tjason.use_megazord(evilGuy_a)\n\tevilGuy_a.punch(jason)\n\n\tputs \"Cmon Tommy!\"\n\ttommy.use_megazord(evilGuy_a)\n\ttommy.drink_coffee(10)\n\ttommy.use_megazord(evilGuy_b)\n\n\tputs \"Did the Power Rangers save the day?\"\n\n\tninja_array = [evilGuy_a, evilGuy_b]\n\twin = \"yes\"\n\n\tninja_array.each do |ninja|\n\t\t# p ninja.show_caffeine_level\n\t\tif ninja.caffeine_level > 0\n\t\t\twin = \"no\"\n\t\tend\n\tend\n\n\tif win == \"yes\"\n\t\tputs \"Yes!\"\n\telse\n\t\tputs \"No :(.\"\n\tend\n\nend",
"def legal_moves\n # Fill this in\n end",
"def move(direction) \n # Exit map check\n if direction == 'up' && @pos_y == 2 && @pos_x == 1\n ProfBirchHome.new(@player, 'top').begin\n # If interacting with Prof Birch Child in first time instance, do a speech & animation\n elsif @player.profbirchhomeupstairs == 'first' \n if (direction == 'up' && @pos_y == 8 && @pos_x == 3) || (direction == 'right' && @pos_y ==7 && @pos_x == 2) || (direction == 'left' && @pos_x == 2 && @pos_y == 9)\n slowly(\"POKEMON fully restored!\\nItems ready, and... Huh?\")\n reset_map\n slowly(\"Huh? Who... Who are you?\")\n reset_map\n slowly(\"... ... ... ... ... ... ... ...\\n... ... ... ... ... ... ... ...\")\n reset_map\n slowly(\"Oh, you're #{ @player.name }.\\nSo your move was today.\")\n reset_map\n slowly(\"Um... I'm #{ @player.other_name }.\\nGlad to meet you!\")\n reset_map\n slowly(\"I...\\nI have this dream of becoming friends\")\n slowly(\"with POKEMON all over the world.\")\n reset_map\n slowly(\"I... I heard about you, #{ @player.name }, from\\nmy dad, PROF. BIRCH.\")\n reset_map\n slowly(\"I was hoping that you would be nice,\\n#{ @player.name }, and that we could be friends.\")\n reset_map\n slowly(\"On, this is silly, isn't it?\\nI... I've just met you, #{ @player.name }.\")\n reset_map\n slowly(\"Eheheh...\")\n reset_map\n slowly(\"Oh, no! I forgot!\")\n reset_map\n slowly(\"I was supposed to go help Dad catch\\nsome wild POKEMON!\")\n reset_map\n slowly(\"#{ @player.name }, I'll catch you later!\")\n @map[2][8] = 'S'\n if @pos_y != 7\n print_map\n @map[2][7] = 'other_icon'\n reset_map 0.5\n @map[2][7] = 'S'\n @map[2][6] = 'other_icon'\n reset_map 0.5\n else\n @map[3][8] = 'other_icon'\n reset_map 0.5\n @map[3][8] = 'S'\n @map[3][7] = 'other_icon'\n reset_map 0.5\n @map[3][7] = 'S'\n @map[3][6] = 'other_icon'\n reset_map 0.5\n @map[3][6] = 'S'\n @map[2][6] = 'other_icon'\n reset_map 0.5\n end\n @map[2][6] = 'S'\n @map[2][5] = 'other_icon'\n reset_map 0.5\n @map[2][5] = 'S'\n @map[2][4] = 'other_icon'\n reset_map 0.5\n @map[2][4] = 'S'\n @map[2][3] = 'other_icon'\n reset_map 0.5\n @map[2][3] = 'S'\n @map[2][2] = 'other_icon'\n reset_map 0.5\n @map[2][2] = 'S'\n @map[1][2] = 'other_icon'\n reset_map 0.5\n @map[1][2] = 'S'\n reset_map 0.5\n @player.profbirchhomeupstairs = 'second'\n @player.littleroot = 'third'\n end\n end\n super\n end",
"def make_move(left,top)\n # get destination selected\n dest = get_clicked_box(left,top)\n # try to make the move on the board; @game.user_move returns false if move is not allowed\n if @game.user_move(@selected_piece, dest)\n # move the piece on the GUI boars\n move_piece(@selected_piece,dest)\n de_highlight(@selected_piece)\n deselect_piece\n # switch player turn after the move\n @game.switch_turn\n else\n # if move not allowed deselect and de highlight the piece\n de_highlight(@selected_piece)\n deselect_piece\n end\nend",
"def runner\n # code runner here\n welcome\n initial_round\n hit?\n display_card_total\nend_game\n\nend",
"def runner\n # code runner here\n welcome\n existinghand = initial_round\n while existinghand <=21 do\n existinghand = hit? (existinghand)\n display_card_total(existinghand)\n end\nend_game (existinghand)\nend",
"def move\n \n end",
"def move\n \n end",
"def runner\n # code runner here\n welcome\n initial_round\n hit?\n display_card_total\n end_game\nend",
"def hero_battle_sequence(hero, villain)\n Battle.start_a_battle(hero, villain)\n battle = Battle.all.last\n hero_hp = hero.hp\n villain_hp = villain.hp\n while villain.hp > 0 && hero.hp > 0 do\n attack(hero, villain)\n line\n puts \"The hero's health is #{hero.hp}\"\n puts \"The villain's health is #{villain.hp}\"\n end\n #if villain and hero looses battle, hero dies and villain gets sent to insane asylum\n if villain.hp <= 0 && hero.hp <= 0\n battle.villain_lost(villain)\n line\n puts \"'Today, we lost a great hero. #{hero.name}, or as many of you knew them as #{hero.alter_ego}, was one of the best of us. It is a sad day for #{battle.location}'\"\n line\n battle.hero_lost(hero)\n battle.update(hero_win: false)\n villain.update(hp: villain_hp)\n line\n puts \"'Darn foiled again, but you'll never end me!' said #{villain.name} as they were lead to the asylum.\"\n puts \"GAME OVER\"\n line\n elsif villain.hp <=0 \n battle.villain_lost(villain)\n battle.update(hero_win: true)\n hero.update(hp: hero_hp)\n villain.update(hp: villain_hp)\n line\n puts \"#{hero.alter_ego} has won the battle\"\n puts \"'Darn foiled again, but you'll never end me!' said #{villain.name} as they were lead to the asylum.\"\n line\n battle.destruction\n hero_main_menu(hero)\n #destroys the hero, the hero lost and died \n elsif hero.hp <= 0\n puts \"#{villain.alter_ego} has won the battle\"\n puts \"'Today, we lost a great hero. #{hero.name}, or as many of you knew them as #{hero.alter_ego}, was one of the best of us. It is a sad day for #{battle.location}'\"\n puts \"GAME OVER\"\n line\n battle.hero_lost(hero)\n battle.update(hero_win: false)\n villain.update(hp: villain_hp)\n end\n end",
"def action(environment)\n @total_moves += 1\n current_cell = environment.state[location[:y]][location[:x]]\n\n if randomized_actions\n self.send(actions.sample, environment)\n else\n case current_cell[0] # customer_waiting\n when 0\n # Reflex Agent is limited - it will move right to left\n # without some randomization or state to tell it to explore up/down\n return move_right(environment) if can_move_right?(environment)\n return move_left(environment) if can_move_left?(environment)\n return move_up(environment) if can_move_up?(environment)\n return move_down(environment) if can_move_down?(environment)\n when 1\n serve_customer(environment)\n end\n end\n end",
"def start_game\n new_game = Game.new\n\n return statuses('You did not press 1') if welcome == false\n\n new_game.set_players\n\n # maximum number of moves a player can make\n\n gameon = true\n\n while gameon\n new_game.new_board.clear_board\n maximum_moves = 9\n loop do\n statuses('Let the game begin') if maximum_moves == 9\n\n current_player = ''\n\n # displays current board state\n display_board(new_game.new_board.my_board)\n\n if maximum_moves.even?\n # signifies first players turn to play in loop thus ensuring each loops per player\n current_player_id = new_game.player1.player_id\n current_player = new_game.player1.player_name\n else\n current_player_id = new_game.player2.player_id\n current_player = new_game.player2.player_name\n end\n\n position = enter_position(current_player, current_player_id)\n new_game.new_board.input_position(position, current_player_id)\n\n # checks for true in results\n if new_game.new_board.results\n display_board(new_game.new_board.my_board)\n statuses(\"#{current_player} has won\")\n break\n end\n\n statuses('The game is a draw') if maximum_moves == 1\n\n break if maximum_moves == 1\n\n maximum_moves -= 1\n end\n statuses('Press N to start a new game or any key to quit ')\n choice = gets.chomp.downcase\n gameon = choice == 'n'\n end\nend",
"def start_game \n ask_player_for_move(@current_player)\n determine_winner\n end",
"def move; end",
"def move; end",
"def runner\n # code runner here\n welcome\n player_hand = initial_round\n until player_hand > 21\n player_hand = hit?(player_hand)\n end\n display_card_total(player_hand)\n end_game(player_hand)\nend",
"def run_round( \n combatant0move = user_select_move(combatants[0]), # By default, the user chooses a move by input\n combatant1move = @combatants[1].random_move) # and the computer selects randomly\n \n return if @outcome == :quit\n\n # Decide who will go first by comparing the speed of the moves\n # Human character has a tiny speed advantage to avoid a draw situation\n \n # Player first\n if combatant0move.speed + @player_0_speed_advantage > combatant1move.speed \n first_move = combatant0move\n first_mover = @combatants[0]\n second_move = combatant1move\n second_mover = @combatants[1]\n # Computer first\n else \n first_move = combatant1move\n first_mover = @combatants[1]\n second_move = combatant0move\n second_mover = @combatants[0]\n end\n\n # Fight! \n first_move.use(first_mover, second_mover)\n update_outcome\n\n # Check the move didn't end the battle (exhaust HP) before continuing\n return unless outcome == :ongoing\n \n second_move.use(second_mover, first_mover)\n update_outcome\n end",
"def winning_move\n simulate_move(@player_num)\n end",
"def move(board)\nend",
"def runner # code runner here\nwelcome \nhand = initial_round\nuntil hand>21 do\n hand = hit?(hand)\n display_card_total(hand)\nend\nend_game(hand)\nend",
"def runner\n welcome\n game = initial_round\n until game > 21 do\n game = hit?(game)\n display_card_total(game)\n end\nend_game(game)\nend",
"def knight_moves(start_case, target_case)\r\n knight = Knight.new\r\n board = Board.new\r\n\r\n board.moves(knight, start_case, target_case)\r\nend",
"def move()\n if @direction == \"up\"\n move_up()\n elsif @direction == \"down\"\n move_down()\n else\n #check if anyone is on current floor- which way do majority want to go from here?\n @direction = people_on_current_floor()\n if @direction == \"up\" #were more ppl on this floor wanting to go up\n move_up()\n elsif @direction == \"down\"\n move_down()\n else #no one on this floor, decide direction based on pending rqsts above and below...\n decide_direction()\n end\n end\n end",
"def runner\n welcome\n arg = initial_round\n until arg > 21\n arg = hit?(arg)\n display_card_total(arg)\nend\nend_game(arg)\nend",
"def possible_hero(king_loc, player, board)\r\n threat = offending_player(king_loc, player, board)[0]\r\n threat_loc = offending_player(king_loc, player, board)[1]\r\n attack_path = threat.calculate_path(threat_loc, king_loc)\r\n destroy_threat = []\r\n move_in_path = []\r\n board.each_with_index do |row, i|\r\n row.each_index do |j| \r\n piece = board[i][j]\r\n if !piece.nil? and piece.color == player and [i, j] != king_loc\r\n if piece.color == player\r\n destroy_threat << [i, j] if piece.valid_move([i,j], threat_loc, board)\r\n end\r\n attack_path.each do |block|\r\n if board[block[0]][block[1]].nil? \r\n move_in_path << [[i, j], block] if piece.valid_move([i,j], block, board)\r\n else\r\n move_in_path << [[i, j], block] if piece.valid_move([i,j], block, board) && board[block[0]][block[1]].color != player\r\n end\r\n end\r\n end \r\n end\r\n end \r\n possible_boards = []\r\n destroy_threat.each do |hero|\r\n possible_boards << temporary_board(hero, threat_loc)\r\n end\r\n move_in_path.each do |hero|\r\n possible_boards << temporary_board(hero[0], hero[1]) \r\n end\r\n checks = []\r\n possible_boards.each do |test_board|\r\n checks << in_check(player, test_board)\r\n end \r\n return true if checks.include? false\r\n return false\r\n end",
"def gameflow\n \n end",
"def runner\n welcome \n player = initial_round \n until player > 21 do\n player = hit?(player)\n display_card_total(player)\n end\nend_game(player)\nend",
"def game\r\n setup_castle\r\n setup_stats\r\n print \"WHAT IS YOUR NAME, EXPLORER? \"\r\n $name = gets.strip\r\n status(\"GREETING\")\r\n activity = \"\"\r\n monster_at_room = 0\r\n while $roomnumber != 0 and $roomnumber != 11 and $strength>0\r\n if (get_room_stuff(6)<0)\r\n monster_at_room = 1\r\n else\r\n monster_at_room = 0\r\n end\r\n\r\n if $roomnumber == 9\r\n room_9\r\n else\r\n if activity == \"ROOM\" or activity == \"I\"\r\n status(activity)\r\n else\r\n status(\"\")\r\n end\r\n\r\n print(\"WHAT DO YOU WANT TO DO? \")\r\n if monster_at_room != 0\r\n f_or_fl = errorHandler(gets.strip.to_s)\r\n if f_or_fl == \"F\" or f_or_fl == \"R\"\r\n activity = send(f_or_fl.to_sym) \r\n else\r\n puts(\"YOU MUST FIGHT OR RUN, NOTHING ELSE\")\r\n end\r\n else\r\n activity = send(errorHandler(gets.strip.to_s).to_sym) \r\n end\r\n puts(\"\\n\")\r\n asterSick\r\n puts(\"\\n\")\r\n end\r\n end\r\n if $strength<=0\r\n puts \"YOU HAVE DIED.........\"\r\n score_method\r\n end\r\n\r\n if $roomnumber == 11\r\n puts (\"YOU'VE DONE IT!!\")\r\n sleep(1)\r\n puts(\"\\nTHAT WAS THE EXIT FROM THE CASTLE\")\r\n sleep(1)\r\n puts(\"\\nYOU HAVE SUCCEEDED,#{$name}!\")\r\n sleep(1)\r\n puts(\"\\nYOU MANAGED TO GET OUT OF THE CASTLE\")\r\n sleep(1)\r\n puts(\"\\nWELL DONE!\\n\")\r\n sleep(1) \r\n score_method\r\n end\r\nend",
"def start_a_game\n jeopardy_board\n play_game\nend",
"def runner\n welcome\n total = initial_round\n\n until total >= 21 do\n total = hit?(total)\n end\n end_game(total)\n \n \n \nend",
"def turn\n\n # calculates new amount of resources using the production function\n # world.production accepts a resources hash and returns a newly\n # calculated resource hash based on production\n @resources = @world.production(@resources)\n p @resources\n\n #do_event # ========= TODO ========= #\n\n # part 2 of every turn\n UiHandler.print_world(@world)\n UiHandler.print_turn_message\n\n # Asks the user for a tile to do his action on\n decision = UiHandler.get_decision()\n\n until (@world.valid?(decision) || decision == '')\n UiHandler.print_error(UiHandler::NO_TILE)\n UiHandler.print_turn_message\n decision = UiHandler.get_decision()\n end\n\n unless decision == ''\n tile = @world.get_tile decision # returns the tile at decision\n\n # checks for legality of move on tiles using tile.accepts? and tile.check_cost\n until tile.accepts?(decision)\n break if decision == ''\n UiHandler.print_tile_options(tile)\n decision = UiHandler.get_decision()\n if (!tile.accepts?(decision))\n UiHandler.print_error(UiHandler::INVALID)\n elsif (!tile.check_cost(decision, @resources))\n decision = nil\n UiHandler.print_error(UiHandler::RESOURCES)\n end\n end\n\n if decision != ''\n price = GameData.get_price(decision)\n @resources = reduce(price)\n @world.advance(tile, decision)\n end\n end\n\n # Clears the screen\n UiHandler.clear_messages()\n end",
"def move\n\n end",
"def runner\n welcome\n total = initial_round\n while(total <= 21) do\n total = hit?(total)\n end\n end_game(total)\nend",
"def living_move\n simulate_move(opponent)\n end",
"def runner\n welcome\n hand = initial_round\n until hand > 21\n new_hand = hit?(hand)\n display_card_total(new_hand)\n hand = new_hand\n end\n end_game(hand)\nend",
"def battle\n # Runden auf 0 setzen, continue auf true (Für die Schleife)\n round = 0\n continue = true\n victory = false\n # Bilde Arrays mit allen nötigen Werten für den Kampf\n turn_fleet = build_array(@attacker, @attacker_fleet)\n target_fleet = build_array(@defender, @defender_fleet)\n emp_phase(@attacker)\n emp_phase(@defender)\n # Angreifer beginnt\n turn_user = @attacker\n target_user = @defender\n while (round < 1000 && continue ) do\n round = round + 1\n if target_user == @defender\n @fight_shield = @defender_shield\n else\n @fight_shield = @attacker_shield\n end\n # Damit alle Gruppen in einer Runde nur auf das Schild feuern können\n shield = @fight_shield\n # Für die Ausgabe der Runden-Berichte\n turn_fleet.each do |fleet|\n # Nur Einheiten mit Anzahl > 0 und Schaden > 0 können kämpfen\n if fleet[1] > 0 && fleet[2] > 0 \n # Bestimme Ziel anhand von id.\n # -2 ist Miss\n # -1 ist Schild\n target = hit(target_fleet, turn_user)\n if(target==-1)\n mult = 1\n # Falls Ionenwaffe, wird Schaden an Schild erhöht\n if fleet[3] == 2\n mult = DamageType.find(fleet[3]).shield_mult\n end\n damage = fleet[2] * mult\n # Abzug des Schilds. Übernahme erst bei nächster Runde\n @fight_shield = @fight_shield - damage\n else\n mult = 1\n # Falls Laserwaffe, wird Schaden an Hülle erhöht\n # TABELLE DAMAGETYPE EINFÜGEN\n if (fleet[3] == 1)\n mult = DamageType.find(fleet[3]).shell_mult\n end \n if fleet[3] == 3 and !fleet[6]\n mult = DamageType.find(fleet[3]).station_mult\n end\n if fleet[3] == 4 and fleet[0] == @plattform_id\n mult = DamageType.find(fleet[3]).plattform_mult\n end \n # Bestimme welche Einheit getroffen wurde\n victim = target_fleet[target]\n # Schadensberechnung\n damage = fleet[2] * mult\n # Berechne neue HP\n hit_points = victim[-2]\n victim[-2] = hit_points-damage\n # Berechne Anzahl und Schaden neu\n update_ship_group(victim, target_user)\n end\n end \n end\n # Füge Runden-Bericht ein\n # Testet, ob Spieler noch Truppen besitzt\n if (defeat(target_fleet))\n continue = false\n if turn_user == @attacker\n victory = true \n end\n else\n # Falls Schild unter 0, wird er auf 0 gesetzt\n if @fight_shield < 0\n @fight_shield = 0\n end\n # Kampf-Schild für nächste Runde\n if target_user == @attacker\n @attacker_shield = @fight_shield\n else\n @defender_shield = @fight_shield\n end\n # Tausche Rolle des Angreifers aus\n tmp_fleet = turn_fleet\n tmp_user = turn_user\n turn_fleet = target_fleet\n turn_user = target_user\n target_fleet = tmp_fleet\n target_user = tmp_user\n end\n # Füge alle Runden-Berichte hinzu\n end\n if continue\n @report << \"Unentschieden! \"\n @report << \"Es konnte kein Sieger ermittelt werden \"\n else \n @report << \"Die Flotte von #{target_user.username} unterlag. \"\n @report << \" #{turn_user.username} war siegreich! \"\n end\n # Generiere Verlustrechnung\n attacker_fleet_ary = []\n defender_fleet_ary = []\n if turn_user == @attacker\n lost_report(turn_fleet, @attacker) \n lost_report(target_fleet, @defender) \n attacker_fleet_ary = turn_fleet\n defender_fleet_ary = target_fleet\n else\n lost_report(target_fleet, @attacker) \n lost_report(turn_fleet, @defender) \n\n attacker_fleet_ary = target_fleet\n defender_fleet_ary = turn_fleet\n end\n update_fighting_fleet(@attacker_fleet, attacker_fleet_ary)\n update_fighting_fleet(@defender_fleet, defender_fleet_ary)\n ary = [@attacker_fleet, @defender_fleet] \n return [@report, @spy_report]\n end",
"def runner\n welcome\n first_hand = initial_round\n until first_hand >= 21\n first_hand = hit?(first_hand)\n display_card_total(first_hand)\n end\n end_game(first_hand)\nend",
"def moving!\n end",
"def runner\n welcome\n hand = initial_round\n while hand < 21\n updated_hand = hit?(hand)\n display_card_total(updated_hand)\n hand = updated_hand\n end\n end_game(updated_hand)\nend",
"def runner\n welcome\n tot = initial_round\n until tot > 21\n \t tot = hit?(tot)\n end\nend_game(tot)\n\nend",
"def update_screen\n #ensure immediate squars around hero can be seen\n light_room(false) #but don't use torch\n #draw hero\n @ui.place_text(DungeonOfDoom::CHAR_PLAYER[@hero_direction], @cur_x+2, @cur_y+6, DungeonOfDoom::C_WHITE_ON_RED)\n #draw stats\n @ui.set_colour(DungeonOfDoom::C_WHITE_ON_RED)\n @ui.place_text(@stats[:strength].round.to_s.ljust(4),17,7)\n @ui.place_text(@stats[:vitality].round.to_s.ljust(4),17,10)\n @ui.place_text(@stats[:aura].round.to_s.ljust(4),17,13)\n @ui.place_text(POS_STR[@hero_direction],17,16)\n @ui.place_text(@stats[:experience].floor.to_s.ljust(4),17,19)\n @ui.place_text(@attack.to_s.ljust(3),2,22)\n @ui.place_text(@spells.values.inject(0){|power,total| total+=power}.to_s.ljust(3),6,22)\n @ui.place_text(@torch_power.to_s.ljust(3),13,22)\n @ui.place_text(@potions.to_s.ljust(3),17,22)\n end",
"def turn\n puts display\n # User shooting at NPC board.\n user_shot_location = user_shot_turn\n @npc.board.board_hash[user_shot_location].fire_upon\n # NPC shooting at user board.\n npc_shot_location = npc_shot_turn\n @user_board.board_hash[npc_shot_location].fire_upon\n # Print the results of combat.\n print results(user_shot_location, npc_shot_location)\n end",
"def determine_moves(loc)\n\n piece = @spaces[loc]\n\n moveset = []\n attackset = []\n new_moves = []\n\n x = loc[0]\n y = loc[1]\n\n enemy_king_checked = false\n\n\n case piece.type\n\n when \"pawn\"\n\n if piece.color == \"white\"\n\n new_moves << [x, y+1]\n new_moves << [x,y+2] if y == 1\n\n if @spaces[new_moves[0]].nil?\n\n moveset << new_moves[0]\n moveset << new_moves[1] if y == 1\n\n end\n\n atk_moves = [[x+1, y+1], [x-1, y+1]]\n atk_moves.each do |move|\n attackset << move if @spaces[move].nil?.! and @spaces[move].color == \"black\"\n if @spaces[move].nil?.!\n enemy_king_checked = true if @spaces[move].color == \"black\" and @spaces[move].type == \"king\"\n end\n end\n \n\n elsif piece.color == \"black\"\n\n new_moves = [[x, y-1]]\n new_moves << [x,y-2] if y == 6\n\n if @spaces[new_moves[0]].nil?\n\n moveset << new_moves[0]\n moveset << new_moves[1] if loc[1] == 6\n\n end\n\n atk_moves = [[x+1, y-1], [x-1, y-1]]\n atk_moves.each do |move|\n attackset << move if @spaces[move].nil?.! and @spaces[move].color == \"white\"\n if @spaces[move].nil?.!\n enemy_king_checked = true if @spaces[move].color == \"white\" and @spaces[move].type == \"king\"\n end\n end\n end\n\n @spaces[loc].moveset = moveset\n @spaces[loc].attackset = attackset\n \n\n when \"rook\"\n\n runner(loc, :north)\n runner(loc, :east)\n runner(loc, :south)\n runner(loc, :west)\n\n when \"knight\"\n\n possible_directions =\n [ [x+1, y+2],\n [x+1, y-2],\n [x-1, y+2],\n [x-1, y-2],\n [x+2, y+1],\n [x+2, y-1],\n [x-2, y+1],\n [x-2, y-1] ]\n\n moveset = possible_directions.select do |d|\n (d[0].between?(0,7) & d[1].between?(0,7)) and @spaces[d].nil?\n end\n\n attackset = possible_directions.select do |d|\n (d[0].between?(0,7) & d[1].between?(0,7)) and (@spaces[d].nil?.! and @spaces[d].color != @spaces[loc].color)\n end\n\n @spaces[loc].moveset = moveset\n @spaces[loc].attackset = attackset\n\n\n when \"bishop\"\n\n runner(loc, :northeast)\n runner(loc, :southeast)\n runner(loc, :northwest)\n runner(loc, :southwest)\n\n\n when \"queen\"\n\n runner(loc, :north)\n runner(loc, :northeast)\n runner(loc, :east)\n runner(loc, :southeast)\n runner(loc, :south)\n runner(loc, :southwest)\n runner(loc, :west)\n runner(loc, :northwest)\n\n\n when \"king\"\n\n runner(loc, :north, 1)\n runner(loc, :northeast, 1)\n runner(loc, :east, 1)\n runner(loc, :southeast, 1)\n runner(loc, :south, 1)\n runner(loc, :southwest, 1)\n runner(loc, :west, 1)\n runner(loc, :northwest, 1)\n\n end\n\n\n end",
"def game_over\n #some end game conditions\nend",
"def runner\n welcome\n deal_card\n display_card_total\n prompt_user\n get_user_input\nend_game\ninitial_round\nhit\ninvalid_command\nend",
"def runner\n # code runner here\n welcome\n card = initial_round\n card = hit?(card)\n if card > 21\n end_game(card)\n end\n display_card_total(card)\n\n\nend",
"def update\r\n\r\n # Left-Arrow button pressed\r\n if $window.button_down?(Gosu::KbLeft) then\r\n\r\n # Sanity check, make sure this can grab the needed tile\r\n if ![1,2].include?(get_tile_info(@player.get_x,\r\n @player.get_y,\r\n :left)) then\r\n\r\n # Call the move_left function\r\n @player.move_left\r\n\r\n end\r\n end\r\n\r\n # Right-Arrow button pressed\r\n if $window.button_down?(Gosu::KbRight) then\r\n\r\n # Sanity check, make sure this can grab the needed tile\r\n if ![1,2].include?(get_tile_info(@player.get_x,\r\n @player.get_y,\r\n :right)) then\r\n\r\n # Call the move_right function\r\n @player.move_right\r\n\r\n end \r\n end\r\n\r\n # Update the player object\r\n @player.update\r\n\r\n # Functionalize the list of entities\r\n @entities.each{|en| \r\n en.update\r\n\r\n # Compare the player coords with the entity coords, in the event\r\n # the player has reached an item / entity location\r\n dist = Gosu::distance(@player.get_x,\r\n @player.get_y(:center),\r\n en.get_x,\r\n en.get_y)\r\n\r\n # Player closely approaches an entity...\r\n if dist < 20 then\r\n\r\n # get_score() returns a -1 in the event of invulnerability\r\n if en.get_score < 0 then\r\n @player.invulnerable\r\n @entities.delete(en)\r\n\r\n # Otherwise add this to the score and remove the item from\r\n # the map\r\n else\r\n @score += en.get_score\r\n @entities.delete(en)\r\n end\r\n end\r\n }\r\n\r\n # Handle the player falling when the down sprite is being used\r\n if [0,2,4].include?(get_tile_info(@player.get_x, @player.get_y,:down)) then\r\n\r\n # Call the fall() routine\r\n @player.fall \r\n\r\n # Handle the player respawn event\r\n if get_tile_info(@player.get_x, @player.get_y,:down) == 4 then\r\n @player.respawn\r\n end\r\n\r\n # Otherwise the the acceleration back to 0, since the player has\r\n # safely hit the ground\r\n else\r\n @player.reset_acceleration\r\n end\r\n\r\n # While jumping, move the player upwards\r\n while ![0,2].include?(get_tile_info(@player.get_x,\r\n @player.get_y - 1,\r\n :down)) do\r\n\r\n # Call the move_up() function\r\n @player.move_up\r\n end\r\n\r\n # Check if the player is current jumping\r\n if @player.is_jumping? then\r\n\r\n # Determine if the up sprite is being used\r\n if get_tile_info(@player.get_x, @player.get_y,:up) != 0 then\r\n\r\n # In which case, reset the jump event, since it has\r\n # already occurred\r\n @player.reset_jump\r\n end\r\n end\r\n\r\n # Check if the player is \"down and facing right\"\r\n if get_tile_info(@player.get_x, @player.get_y,:down) == 5 then\r\n @player.slide_left\r\n\r\n # Check if the player is \"down and facing left\"\r\n elsif get_tile_info(@player.get_x, @player.get_y,:down) == 6 then\r\n @player.slide_right\r\n end\r\n\r\n # Check if the player is inside of a hidden location\r\n if in_hidden_entrance then\r\n\r\n # Initialize the hidden tiles array\r\n @hidden_tiles = []\r\n\r\n # Cycle thru the y coords ...\r\n for y in 0...@level[1].size\r\n\r\n # ... and the x coords\r\n for x in 0...@level[1][y].size\r\n\r\n # Set the current X / Y coords\r\n curx = (x * 16) + 8\r\n cury = (y * 16) + 8\r\n\r\n # Determine the distance between the player and the\r\n # current location\r\n dist = Gosu::distance(@player.get_x,\r\n @player.get_y(:center),\r\n curx,\r\n cury)\r\n\r\n # Append the current location to the hidden tiles array\r\n if dist < 32 then\r\n @hidden_tiles << [x,y]\r\n end\r\n end\r\n end\r\n\r\n # Empty the hidden tiles array since the player is not in a hidden\r\n # location\r\n else\r\n @hidden_tiles = []\r\n end\r\n\r\n # Set the camera coords\r\n @camera_x = [[@player.get_x - 320, 0].max,\r\n @level[0][0].size * 16 - 640].min\r\n\r\n @camera_y = [[@player.get_y - 240, 0].max,\r\n @level[0].size * 16 - 480].min\r\n end",
"def update\n\n # Check if the player is colliding with a deadly tile. If so: Lose!\n if Position.collide?(@active_tile, @player)\n timer = Time.new\n until Time.now - timer > 3\n @player.move(:none)\n end\n Game.lose_level\n Game.lose_life\n new_level\n end\n\n # Periodically activate a deadly tile in order of decreasing rarity\n if @player.direction != :none\n if Time.now - @enemy_timer > Settings.enemy_spawn_rate\n eligable_tiles = []\n Grid.tiles.each do |tile|\n if [email protected]?(tile.contents) &&\n tile.is_deadly == false &&\n tile.contents != :empty &&\n tile.contents != \" \"\n eligable_tiles << tile.contents\n end\n end\n @enemy_tile = Grid.characters.detect{|tile| eligable_tiles.include? (tile)}\n Grid.tiles.each do |tile|\n tile.is_deadly = true if tile.contents == @enemy_tile\n end\n @enemy_timer = Time.new\n end\n end\n\n # Align the player's position to the closest tile on the grid\n if Position.within_bounds?(@player)\n @player.x, @player.y = @player.x.round_to(Settings.tile_size), @player.y.round_to(Settings.tile_size)\n end\n\n # Wrap the player around the screen if they reach the edge\n Position.wrap(@player)\n\n # Respond to Keypresses\n if button_down? KbEscape\n close\n puts \"You reached level #{Game.current_level}. Goodbye!\"\n exit\n end\n Moving.parts.each {|part| part.move :none if button_down? KbSpace}\n @player.move(:left) if button_down?(KbLeft) && Position.within_bounds?(@player) && (@player.direction != :right)\n @player.move(:right) if button_down?(KbRight) && Position.within_bounds?(@player) && (@player.direction != :left)\n @player.move(:up) if button_down?(KbUp) && Position.within_bounds?(@player) && (@player.direction != :down)\n @player.move(:down) if button_down?(KbDown) && Position.within_bounds?(@player) && (@player.direction != :up)\n\n # Move all the movable objects in the game\n @player.move(@player.direction)\n Moving.all_move\n \n # Update the player's location on the grid\n if Position.within_bounds?(@player)\n @active_tile = Grid.tiles\n .find {|tile| tile.x == @player.x\n .round_to(Settings.tile_size) && tile.y == @player.y\n .round_to(Settings.tile_size)}\n end\n\n # Have the invisible spacer tile track the player's position\n @head.x, @head.y, @head.direction = @player.path.last[0], @player.path.last[1], @player.path.last[2] \n \n # Update all the tail sections so the previous location of the section in front\n # becomes their current location\n Moving.parts.each_with_index do |section, index|\n section.path << [section.x.round_to(Settings.tile_size), section.y.round_to(Settings.tile_size), section.direction]\n leader = Moving.parts[index-1].path.last if index > 0\n section.x, section.y, section.direction = leader[0], leader[1], leader[2] if index > 0\n section.path.drop(1) if section.path.size > @message.size + 1\n end\n \n # If the player moves over a target tile create a new tail section\n if @active_tile.is_edible\n lastpath = Moving.parts.last.path.last\n image = Image.from_text(@active_tile.contents, Settings.tile_size, options={font: Settings.font, bold: true})\n Tail.new(lastpath[0], lastpath[1], lastpath[2], image)\n @completed << @active_tile.contents.to_s\n Grid.subtract_character(@active_tile.contents)\n @active_tile.contents = :empty\n @target = @target.drop(1)\n Grid.tiles.each {|tile| tile.is_edible = false}\n end\n\n # Set the target letter\n Grid.tiles.each {|tile| tile.is_edible = true if tile.contents == @target[0]}\n\n # Check if the player has collected all the target letters and in the case that\n # they have, check if they have arrived at the mailbox. If so: Level up!\n if @message.join(\"\") == @completed\n if @active_tile.y.between?(Settings.margin_bottom + Settings.tile_size / 2, Settings.margin_bottom + Settings.tile_size * 2) &&\n @active_tile.x.between?(Settings.margin_left, Settings.margin_left + Settings.tile_size)\n @player.move(:none)\n sleep 2\n Game.add_life\n new_level\n end\n end\n end",
"def move(direction)\n movements = @game.current_room_model.movement\n monster = @game.current_room_model.monster\n\n if direction == :north and not movements.north\n return \"No exit that way\"\n elsif direction == :south and not movements.south\n return \"There is no exit south\"\n elsif direction == :east and not movements.east\n return \"You cannot go in that direction\"\n elsif direction == :west and not movements.west\n return \"You cannot move through solid stone\"\n elsif direction == :up and not movements.up\n return \"You cannot go up this floor\"\n elsif direction == :down and not movements.down\n return \"You cannot go down this floor\"\n end\n\n return \"Monster shouts: YOU SHALL NOT PASS!!\" if monster && rand < 0.1\n\n @game.current_room = movements.send(direction)\n @game.player.tally += 1\n @game.player.strength -= 5\n\n if @game.player.strength < 1\n @game.state = DeadState.new @game\n else\n @game.state = WinnerState.new(@game) if @game.current_room == \"Exit\"\n end\n\n \"You moved to another room...\"\n end",
"def conduct\n # last_move = nil\n # winner = nil\n # until winner = (@cur_board.game_over? last_move) do\n # print_state\n\n # Handle different move-getting methods depending on turns\n # Actually mostly just handle board stuff\n\n # Actually both of them can just keep hitting try_move until it validates as being the right turn\n\n # last_move = move_piece\n \n # @turn = Board::opponent_of @turn\n # @turn_count += 1\n # end\n\n # until @game_over do\n # move_piece\n # end\n\n # end_game\n end",
"def new_game\n set_player\n\n if human_player?\n start_message(:welcome)\n\n set_grid\n puts\n set_bombs\n\n else #non-human\n start_message(:robot_game)\n @robot = Robot.new()\n @grid_size = @robot.grid_size\n @num_bombs = @robot.num_bombs\n end\n @play_again = true\nend",
"def updateGameState\n\t\tnextGameState = super\n\t\tif @enemyCounter == 0\n\t\t\t@nextGameState = Battle.new(self, @hero, @screen)\n\t\t\treset\n\t\t\tresetEnemyCounter\n\t\tend\n\t\treturn nextGameState\n\tend",
"def runner\n # code runner here\n welcome\n total = initial_round\n until total > 21\n total = hit?(total)\n display_card_total(total)\nend\nend_game(total)\nend",
"def runner\r\n welcome\r\n total = initial_round\r\n until total > 21\r\n total = hit?(total)\r\n display_card_total(total)\r\n end\r\n end_game(total)\r\nend",
"def hospitalRoom(player)#, hospital_room)\n puts \"---- HOSPITAL ROOM ----:\"\n puts \"You look around and notice that the room is in disarray. It's very quiet. You see a barred WINDOW on your RIGHT and STRAIGHT ahead is a DOOR that leads to the hallway...\n\n [commands: look, take, use, inventory, etc]\n \"\n\n item = Axe.new(\"Axe\")\n\n while choice = gets.chomp().downcase\n case choice\n when (\"door\" || \"straight\")\n #hospital_hallway = Room.new(\"HOSPITAL HALLWAY\", items = [], enemies = [])\n hospitalHallway(player)#, hospital_hallway)\n break\n when (\"window\" || \"right\")\n puts \"You look out the window. The town looks very quiet...\"\n when \"look\"\n puts \"You see that the EKG machines are not on. It appears that the power is out...\"\n if(!player.inventory.include?(item))\n puts \"...laying next to the machine is an AXE...\"\n else\n puts \"...the Axe has been picked up\"\n end\n when \"take\"\n puts \"take what? (take + [item])\"\n when (\"take \" + item.class.name.downcase)\n if(!player.inventory.include?(item))\n player.addItem(item)\n puts \"You picked up the \" + item.item_name\n else\n puts \"You already have the Axe.\"\n end\n when \"inventory\"\n player.viewInventory\n else\n puts \"The command doesn't make sense\"\n end\n end\n\nend",
"def runner\r\n welcome \r\n total = initial_round #tricky too \r\n until total > 21\r\n total = hit?(total) #tricky part \r\n display_card_total(total)\r\n \r\n end\r\nend_game(total)\r\nend",
"def runner\r\n welcome\r\n num = initial_round\r\n numAfter = hit?(num)\r\n display_card_total(numAfter)\r\n end_game(numAfter)\r\nend",
"def villain_battle_sequence(hero, villain)\n Battle.start_a_battle(hero, villain)\n battle = Battle.all.last\n hero_hp = hero.hp\n villain_hp = villain.hp\n while villain.hp > 0 && hero.hp > 0 do\n attack(hero, villain)\n line\n puts \"The hero's health is #{hero.hp}\"\n puts \"The villain's health is #{villain.hp}\"\n end\n #if villain and hero looses battle, hero dies and villain gets sent to insane asylum\n if villain.hp <= 0 && hero.hp <= 0\n battle.villain_lost(villain)\n line\n puts \"'Today, we lost a great hero. #{hero.name}, or as many of you knew them as #{hero.alter_ego}, was one of the best of us. It is a sad day for #{battle.location}'\"\n battle.hero_lost(hero)\n battle.update(hero_win: false)\n villain.update(hp: villain_hp)\n line\n puts \"'Darn foiled again, but you'll never end me!' said #{villain.name} as they were lead to the asylum.\"\n puts \"GAME OVER\"\n line\n elsif villain.hp <=0 \n battle.villain_lost(villain)\n battle.update(hero_win: true)\n hero.update(hp: hero_hp)\n villain.update(hp: villain_hp)\n line\n puts \"#{hero.alter_ego} has won the battle\"\n puts \"'Darn foiled again, but you'll never end me!' said #{villain.name} as they were lead to the asylum.\"\n puts \"GAME OVER\"\n line\n #destroys the hero, the hero lost and died, sends villain to the main menu\n elsif hero.hp <= 0\n line\n puts \"#{villain.alter_ego} has won the battle\"\n puts \"'Today, we lost a great hero. #{hero.name}, or as many of you knew them as #{hero.alter_ego}, was one of the best of us. It is a sad day for #{battle.location}'\"\n line\n battle.hero_lost(hero)\n battle.update(hero_win: false)\n villain.update(hp: villain_hp)\n battle.destruction\n villain_main_menu(villain)\n end\n end",
"def make_move\n roll = @sampler.sample\n @player_position = new_position(roll)\n @moves += 1\n\n # Update winning state if the player has finished the game\n @game_over = @player_position >= @squares\n end",
"def runner\n total = initial_round\n welcome\n while total < 21\n hit?(total)\n total += deal_card\n display_card_total(total)\nend_game(total)\nend\nend",
"def update\n super\n $game_chrono.update\n @window_gameDescription.update() unless @window_gameDescription == nil\n @inPauseMode = false\n #sleep(0.5)\n if @spriteGem1 != nil && @spriteGem1.moving && @spriteCursor1 != nil && @spriteGem2 != nil && @spriteCursor2 != nil \n update_switch2Gem()\n elsif( @spriteGems != nil ) #&& @spriteGems[6].moving )\n#~ for y in 0...BOARD_MAX_Y\n#~ #@spriteGems[y].update\n#~ # if( isUpdating == false )\n#~ # sleep(2)\n#~ # end\n#~ end\n end\n if( @isHeroAttacking == true && @HeroAttackZone != nil )\n \n if ( @HeroAttackZone.update )\n @inPauseMode = true \n #@HeroAttackZone.doAnimation( 1, false )\n # @HeroAttackZone.start_animation($data_animations[1], false)\n else\n @inPauseMode = false \n @HeroAttackZone = nil\n end \n end\n \n end",
"def runner\n welcome\n userHand = initial_round\n until userHand > 21\n userHand = hit?(userHand)\n display_card_total(userHand)\n end\n end_game(userHand)\nend",
"def main\n rounds = Game.start\n game = Game.new(rounds)\n roshambo = Roshambo.new(game)\n Roshambo.play(roshambo)\nend",
"def move\n fetch('games.street_fighter.moves')\n end",
"def make_move\n\n\n candidates = []\n surface_level.each do |pos|\n\n row, col = pos\n\n # if placing this tile leads the ai to win then thats good\n score = evaluate_position_as @ai, row, col, @ai.win_conditions[0], 2\n\n # if placing tile, enables the player to place a tile above us and win, then bad\n score += evaluate_position_as @player, row + 1, col, @player.win_conditions[0], -1\n @board.data[row][col] = nil\n\n if row + 1 != @row\n @board.data[row + 1][col] = nil\n end\n\n # if player places this position and enables him to win, dont let him.\n score += evaluate_position_as @player, row, col, @player.win_conditions[0], 0.8\n @board.data[row][col] = nil\n\n\n # if ai places at this tile and causes player to win, dont palce it there\n score += evaluate_position_as @ai, row, col, @player.win_conditions[0], -2\n\n # if player plays it there and causes him to get close to win conditon, dont palce it there\n score += evaluate_position_as @player, row, col, @player.win_conditions[0][1..-1], 0.3\n @board.data[row][col] = nil\n\n\n score += evaluate_position_as @player, row, col, @player.win_conditions[0][0..-2], 0.3\n @board.data[row][col] = nil\n\n candidates << [row, col, score]\n\n end\n\n # signals that it cannot make a move, the ai\n if candidates == []\n return -1\n end\n\n # sort by best candidate\n sorted = candidates.sort {|a,b| b[2] <=> a[2]}\n\n return select_candidate sorted\n\n end",
"def runner\n welcome\n total = initial_round\n until total > 21\n total = hit(total)\n display_card_total(total)\n end\n end_game(total)\nend",
"def updateKeys\n\t\tif [email protected]?\n\t\t\tkey = @keysPressed.pop\n\t\t\tinitX = @initPosX + @hero.sprite.posx / SQUARE_SIZE \n\t\t\tinitY = @initPosY + @hero.sprite.posy / SQUARE_SIZE \n\t\t\tdirection = 0\n\t\t\tcase key.to_s\n\t\t\twhen \"u\"\n\t\t\t\tdirection = \"right\"\n\t\t\t\tcheckX = initX + SCREEN_CENTER_X / SQUARE_SIZE + 1 \n\t\t\t\tcheckY = initY + SCREEN_CENTER_Y / SQUARE_SIZE \n\t\t\twhen \"o\"\n\t\t\t\tdirection = \"left\"\n\t\t\t\tcheckX = initX + SCREEN_CENTER_X / SQUARE_SIZE - 1 \n\t\t\t\tcheckY = initY + SCREEN_CENTER_Y / SQUARE_SIZE \n\t\t\twhen \"e\" \n\t\t\t\tdirection = \"down\"\n\t\t\t\tcheckX = initX + SCREEN_CENTER_X / SQUARE_SIZE \n\t\t\t\tcheckY = initY + SCREEN_CENTER_Y / SQUARE_SIZE + 1 \n\t\t\twhen \"period\"\n\t\t\t\tdirection = \"up\"\n\t\t\t\tcheckX = initX + SCREEN_CENTER_X / SQUARE_SIZE \n\t\t\t\tcheckY = initY + SCREEN_CENTER_Y / SQUARE_SIZE - 1 \n\t\t\twhen \"t\"\n\t\t\t\tif @keyIdle\n\t\t\t\t\t@nextGameState = Menu.new(@screen, self) \n\t\t\t\tend\n\t\t\tend\n\t\t\tif direction != 0\n\t\t\t\tmove = true\n\t\t\t\ttile = @background[checkY][checkX]\n\t\t\t\[email protected] { |noMove|\n\t\t\t\t\tif tile == noMove\n\t\t\t\t\t\tmove = false\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\tmovement(direction, key, move)\n\t\t\tend\n\t\tend\n\tend",
"def go_up(the_maze, floor, position, steps)\r\n if can_go_up?(the_maze, floor, position)\r\n the_maze = the_maze.set(floor, the_maze[floor].set(position, \"m\"))\r\n walk_maze(the_maze, floor - 1, position, steps.push([floor, position]))\r\n else\r\n return Hamster.vector\r\n end\r\nend",
"def step\n if @game_over\n game_over!\n @event_handler.update\n else\n # background for playing field and hud\n @screen.fill :black\n @screen.fill [50,50,50], Rect.new(Configuration.screen[:hud_rect])\n\n @event_handler.update\n @hud.update @clock.framerate.ceil, @round, @enemies.length, @money, @lives+1, @round_timer\n\n update_timer\n restock_enemies! if @restock_enemies > 0\n\n @the_path.draw @screen # Draw the enemy path.\n @enemies.draw @screen # Draw the enemies.\n @towers.draw @screen # Draw all set towers.\n @grid_highlighter.draw @screen # Draw the nifty semi-transparent highlighter below the mouse.\n @hud.draw @screen # draw the HUD\n end\n\n @screen.update() # Refresh the screen.\n end",
"def npc_shot_turn\n @npc.computer_shoot(@user_board)\n end",
"def botTurn\n # check if we can win with one move or need to block\n if positions = winOrBlock?(currentPlayer) || positions = winOrBlock?( (currentPlayer == 'X')? 'O' : 'X')\n takeLastSpot(positions)\n \n # check if there is a chance for bot to create a fork, or block oponent from making fork \n elsif forks = possibleFork?(currentPlayer) || forks = possibleFork?((currentPlayer == 'X')? 'O' : 'X')\n \n \n if forks.size == 1\n # find the most common index and move there\n commonElement = forks.max_by {|i| forks.count(i)}\n move(commonElement, currentPlayer)\n else\n # more than one fork possible,\n # find optimal block point, move there\n move(blockPoint(forks), currentPlayer)\n end\n \n # take the center if its available\n elsif !position_taken?(4)\n move(4, currentPlayer)\n \n # take an opposite corner from the oponent. If not available, take any corner\n elsif corner = cornerMove\n move(corner, currentPlayer)\n \n # play in a middle square on any of the sides \n else\n SIDE_MIDDLE.each do |position|\n if !position_taken?(position)\n move(position, currentPlayer)\n break\n end\n end\n end\n puts \"#{(currentPlayer == 'X')? 'O': 'X'}'s move: \"\n displayBoard\n end",
"def update_movement\n #p \"Unit Z = #{self.z}\"\n # Skip if the unit is carrying out movement\n if !@running\n # If there is a hidden unit at the next spot, prompt TRAP and stop processing\n if @move_route.size > 0\n case @directions[0]\n when 2 #down\n @h_unit = $game_map.get_unit(@unit.x, @unit.y+1) if ($game_map.get_unit(@unit.x, @unit.y+1).is_a?(Unit) and $game_map.get_unit(@unit.x, @unit.y+1).army != @unit.army)\n when 4 #left\n @h_unit = $game_map.get_unit(@unit.x-1, @unit.y) if ($game_map.get_unit(@unit.x-1, @unit.y).is_a?(Unit) and $game_map.get_unit(@unit.x-1, @unit.y).army != @unit.army)\n when 6 #right\n @h_unit = $game_map.get_unit(@unit.x+1, @unit.y) if ($game_map.get_unit(@unit.x+1, @unit.y).is_a?(Unit) and $game_map.get_unit(@unit.x+1, @unit.y).army != @unit.army)\n when 8 #up\n @h_unit = $game_map.get_unit(@unit.x, @unit.y-1) if ($game_map.get_unit(@unit.x, @unit.y-1).is_a?(Unit) and $game_map.get_unit(@unit.x, @unit.y-1).army != @unit.army)\n end\n end\n # The unit's direction unless there is a hidden unit at the next spot\n @dir = (@h_unit.nil? and !@move_route[0].nil? ? @directions.shift : 0)\n # Reduce unit's fuel based on terrain cost unless it encountered hidden unit\n # OR if route is a series of integers\n if @dir != 0 && @move_route[0].is_a?(MoveTile)\n @unit.fuel -= @move_route.shift.cost\n end\n \n @counter = 1\n case @dir\n when 2 then @real_y += 16\n when 4 then @real_x -= 16\n when 6 then @real_x += 16\n when 8 then @real_y -= 16\n else # when zero (TRAP or not moving)\n @counter = 7\n end\n @running = true\n else\n # Move the sprite to its destination slowly (4 frames per tile)\n @counter += 1\n case @dir\n when 2 then @real_y += 16\n when 4 then @real_x -= 16\n when 6 then @real_x += 16\n when 8 then @real_y -= 16\n end\n # Change the unit's (x,y) values since it reached the tile\n if @counter == 8\n @running = false\n case @dir\n when 2 then @unit.y+=1\n when 4 then @unit.x-=1\n when 6 then @unit.x+=1\n when 8 then @unit.y-=1\n end\n # Slide the cursor with the unit\n unless @unit.loaded or (@dir == 0 and @h_unit.nil?)\n #$game_player.slide_to(@unit.x, @unit.y)\n $game_player.add_move_action(@unit.x, @unit.y, nil,0,nil,true)\n #$game_player.x = @unit.x\n #$game_player.y = @unit.y\n #$game_player.real_x = @unit.x * 128\n #$game_player.real_y = @unit.y * 128\n end\n \n # When done moving the unit or encounter hidden unit\n if @move_route.size == 0 or !@h_unit.nil?\n # Play TRAP animation if hidden unit\n @h_unit.sprite.play_animation('trap') unless @h_unit.nil?\n @unit.trap = (!@h_unit.nil?)\n # Fade the movement SE\n #Audio.bgs_fade(300)\n Audio.bgs_stop\n # Turn off flags\n @is_moving = false\n $spriteset.unit_moving = false\n # Unload the unit\n @unit.loaded = false if @unit.loaded\n # Update the FOW\n $spriteset.update_fow\n end\n end # if @counter != 4\n end # end of if !@running\n end",
"def execute_game\n board_dimensions = construct_board\n board_width = board_dimensions[0]\n board_height = board_dimensions[1]\n new_game = Game.new\n new_game.set_board(board_width,board_height)\n new_commands = Commands.new\n active_commands = new_commands.user_commands\n # Iterates through the active_commands array.\n # Executes each commands if certain condition is met.\n active_commands.each do |command| \n if command.include?(:position_x) && command.include?(:position_y) && command.include?(:position_f)\n @command_X = command[:position_x].to_i\n @command_Y = command[:position_y].to_i\n @command_F = command[:position_f]\n new_game.get_command_X(@command_X)\n new_game.get_command_Y(@command_Y)\n new_game.get_command_F(@command_F)\n new_game.set_place_Command()\n end\n if command.include?(:user_move) \n @command_move = command[:user_move]\n new_game.get_command_move_N(@command_move)\n end\n if command.include?(:user_left) \n @command_left = command[:user_left]\n new_game.get_command_Left(@command_left)\n end\n if command.include?(:user_right) \n @command_right = command[:user_right]\n new_game.get_command_Right(@command_right)\n end\n if command.include?(:request_report) \n @command_report = command[:request_report]\n new_game.display_report(@command_report)\n end \n end\n active_commands = []\n play_again\nend",
"def runner\n\n welcome\n total = initial_round\n\n until total > 21\n total = hit?(total)\n display_card_total(total)\n end\n\n end_game(total)\n \nend",
"def calc args\n\n # Since velocity is the change in position, the change in x increases by dx. Same with y and dy.\n args.state.player.x += args.state.player.dx\n args.state.player.y += args.state.player.dy\n\n # Since acceleration is the change in velocity, the change in y (dy) increases every frame\n args.state.player.dy += args.state.gravity\n\n # player's y position is either current y position or y position of top of\n # bridge, whichever has a greater value\n # ensures that the player never goes below the bridge\n args.state.player.y = args.state.player.y.greater(args.state.bridge_top)\n\n # player's x position is either the current x position or 0, whichever has a greater value\n # ensures that the player doesn't go too far left (out of the screen's scope)\n args.state.player.x = args.state.player.x.greater(0)\n\n # player is not falling if it is located on the top of the bridge\n args.state.player.falling = false if args.state.player.y == args.state.bridge_top\n args.state.player.rect = [args.state.player.x, args.state.player.y, args.state.player.h, args.state.player.w] # sets definition for player\n\n args.state.enemy.x += args.state.enemy.dx # velocity; change in x increases by dx\n args.state.enemy.y += args.state.enemy.dy # same with y and dy\n\n # ensures that the enemy never goes below the bridge\n args.state.enemy.y = args.state.enemy.y.greater(args.state.bridge_top)\n\n # ensures that the enemy never goes too far left (outside the screen's scope)\n args.state.enemy.x = args.state.enemy.x.greater(0)\n\n # objects that go up must come down because of gravity\n args.state.enemy.dy += args.state.gravity\n\n args.state.enemy.y = args.state.enemy.y.greater(args.state.bridge_top)\n\n #sets definition of enemy\n args.state.enemy.rect = [args.state.enemy.x, args.state.enemy.y, args.state.enemy.h, args.state.enemy.w]\n\n if args.state.enemy.y == args.state.bridge_top # if enemy is located on the top of the bridge\n args.state.enemy.dy = 0 # there is no change in y\n end\n\n # if 60 frames have passed and the enemy is not moving vertically\n if args.state.tick_count.mod_zero?(args.state.enemy_jump_interval) && args.state.enemy.dy == 0\n args.state.enemy.dy = args.state.enemy_jump_power # the enemy jumps up\n end\n\n # if 40 frames have passed or 5 frames have passed since the game ended\n if args.state.tick_count.mod_zero?(args.state.hammer_throw_interval) || args.state.game_over_at.elapsed_time == 5\n # rand will return a number greater than or equal to 0 and less than given variable's value (since max is excluded)\n # that is why we're adding 1, to include the max possibility\n volley_dx = (rand(args.state.hammer_launch_power_default) + 1) * -1 # horizontal movement (follow order of operations)\n\n # if the horizontal distance between the player and enemy is less than 128 pixels\n if (args.state.player.x - args.state.enemy.x).abs < 128\n # the change in x won't be that great since the enemy and player are closer to each other\n volley_dx = (rand(args.state.hammer_launch_power_near) + 1) * -1\n end\n\n # if the horizontal distance between the player and enemy is greater than 300 pixels\n if (args.state.player.x - args.state.enemy.x).abs > 300\n # change in x will be more drastic since player and enemy are so far apart\n volley_dx = (rand(args.state.hammer_launch_power_far) + 1) * -1 # more drastic change\n end\n\n (rand(args.state.max_hammers_per_volley) + 1).map_with_index do |i|\n args.state.enemy.hammer_queue << { # stores hammer values in a hash\n x: args.state.enemy.x,\n w: args.state.hammer_size,\n h: args.state.hammer_size,\n dx: volley_dx, # change in horizontal position\n # multiplication operator takes precedence over addition operator\n throw_at: args.state.tick_count + i * args.state.gap_between_hammers\n }\n end\n end\n\n # add elements from hammer_queue collection to the hammers collection by\n # finding all hammers that were thrown before the current frame (have already been thrown)\n args.state.enemy.hammers += args.state.enemy.hammer_queue.find_all do |h|\n h[:throw_at] < args.state.tick_count\n end\n\n args.state.enemy.hammers.each do |h| # sets values for all hammers in collection\n h[:y] ||= args.state.enemy.y + 130\n h[:dy] ||= args.state.hammer_upward_launch_power\n h[:dy] += args.state.gravity # acceleration is change in gravity\n h[:x] += h[:dx] # incremented by change in position\n h[:y] += h[:dy]\n h[:rect] = [h[:x], h[:y], h[:w], h[:h]] # sets definition of hammer's rect\n end\n\n # reject hammers that have been thrown before current frame (have already been thrown)\n args.state.enemy.hammer_queue = args.state.enemy.hammer_queue.reject do |h|\n h[:throw_at] < args.state.tick_count\n end\n\n # any hammers with a y position less than 0 are rejected from the hammers collection\n # since they have gone too far down (outside the scope's screen)\n args.state.enemy.hammers = args.state.enemy.hammers.reject { |h| h[:y] < 0 }\n\n # if there are any hammers that intersect with (or hit) the player,\n # the reset_player method is called (so the game can start over)\n if args.state.enemy.hammers.any? { |h| h[:rect].intersect_rect?(args.state.player.rect) }\n reset_player args\n end\n\n # if the enemy's rect intersects with (or hits) the player,\n # the reset_player method is called (so the game can start over)\n if args.state.enemy.rect.intersect_rect? args.state.player.rect\n reset_player args\n end\nend",
"def react!\n @started_at = Time.now\n EM.next_tick do \n\tEM.add_periodic_timer(TICK_INTERVAL) do\n\t @last_tick ||= 0\n\t # puts \"==== tick! last one was #{Time.now - @last_tick} ago\"\n\t @last_tick = Time.now\n\n\t # moves = @next_moves\n\t removals = @scheduled_removals.dup\n\n\t removals.each do |entity|\n\t entity_group = @entities.detect { |es| es.include?(entity) }\n\n\t if entity_group\n\t sockets.values.each do |s|\n\t\tdata = {depth: @entities.index(entity_group), entity_id: entity.guid }\n\t\ttransmit 'removal', data, s\n\t end\n\t end\n\n\t puts \">>>> DELETING ENTITY\"\n\t entity_group.delete(entity) if entity_group\n\t @scheduled_removals.delete(entity)\n\n\t # recompute all fovs? (seems like we could at least limit to heroes on this level, but should really be a question of asking the heroes if the object is visible)\n\t # timing of this could also be problematic\n\n\t heroes.each { |h| h.build_fov_map }\n\t end\n\n\t # step!\n\t @heroes.each { |h| h.update }\n\n\t @next_moves.each do |entity, direction|\n\t if move(entity, direction)\n\t # entity.recompute_fov if entity.is_a?(Hero)\n\t # end\n\t # end\n\n\t # moves.each do |entity, _|\n\t sockets.values.each do |s|\n\t\tif entity.is_a?(Roguecraft::Hero)\n\t\t message_data = entity.attributes.merge({\n\t\t visible: entity.now_visible,\n\t\t invisible: entity.now_invisible\n\t\t })\n\t\t puts \"=== currently visible: #{entity.now_visible.inspect}\"\n\t\t transmit 'move', message_data, s\n\t\tend\n\t end\n\t end\n\t end\n\n\t @next_moves = {}\n\tend\n end\n end",
"def runner\n\n\n\twelcome\n\tcard_total = initial_round\n\tuntil card_total > 21\n\t\tcard_total = hit?(card_total)\n\t\tdisplay_card_total(card_total)\n\tend\n\n\tend_game(card_total)\n end",
"def runner\n welcome\n total = initial_round\n until total > 21\n total = hit?(total)\n display_card_total(total)\nend\nend_game(total)\n\nend",
"def runner\n welcome\n final_hand = initial_round\n until final_hand > 21\n final_hand = hit?(final_hand)\n display_card_total(final_hand)\n end\n end_game(final_hand)\nend",
"def play_game\r\n\r\n player = \"X\" #Make Player X the default player for each\r\n #new game\r\n \r\n noOfMoves = 0 #Reset the value of the variable used to\r\n #keep track of the total number of moves\r\n #made in a game\r\n\r\n #Clear out the game board to get it ready for a new game\r\n clear_game_board\r\n\r\n loop do #Loop forever\r\n\r\n Console_Screen.cls #Clear the display area\r\n \r\n #Call on the method that displays the game board and\r\n #collects player moves\r\n square = display_game_board(player)\r\n \r\n #Assign the selected game board square to the player\r\n #that selected it\r\n $A1 = player if square == \"A1\" \r\n $A2 = player if square == \"A2\" \r\n $A3 = player if square == \"A3\" \r\n $B1 = player if square == \"B1\" \r\n $B2 = player if square == \"B2\" \r\n $B3 = player if square == \"B3\" \r\n $C1 = player if square == \"C1\" \r\n $C2 = player if square == \"C2\" \r\n $C3 = player if square == \"C3\" \r\n\r\n #Keep count of the total number of moves that have\r\n #been made\r\n noOfMoves += 1\r\n\r\n #Call on the method that is responsible for \r\n #determining if the game has been won\r\n winner = check_results(player)\r\n \r\n #See is player X has won\r\n if winner == \"X\" then\r\n #Call on the method that displays the game final\r\n #results\r\n display_game_results(\"Player X Wins!\")\r\n #Keep count of the total number of wins that $xWins has\r\n $xWins += 1\r\n break #Terminate the execution of the loop\r\n end\r\n \r\n #See if player O has won\r\n if winner == \"O\" then\r\n #Call on the method that displays the game final\r\n #results\r\n display_game_results(\"Player O Wins!\")\r\n #Keep count of the total number of wins that $oWins has\r\n $oWins += 1\r\n break #Terminate the execution of the loop\r\n end \r\n \r\n #See if the game has ended in a tie\r\n if noOfMoves == 9 then\r\n #Call on the method that displays the game final\r\n #results\r\n display_game_results(\"Tie\")\r\n break #Terminate the execution of the loop\r\n end\r\n \r\n #If the game has not ended, switch player turns and\r\n #keep playing\r\n if player == \"X\" then\r\n player = \"O\"\r\n else\r\n player = \"X\"\r\n end\r\n \r\n end\r\n \r\n end",
"def runner\n welcome\n hand = initial_round\n until hand > 21 do \n hand = hit?(hand)\n display_card_total(hand)\n end\n end_game(hand)\nend"
] | [
"0.77033126",
"0.6870024",
"0.6719482",
"0.6605058",
"0.6605058",
"0.6605058",
"0.6605058",
"0.6605058",
"0.6432848",
"0.63517225",
"0.6291838",
"0.62804276",
"0.6243273",
"0.62425417",
"0.62425417",
"0.62425417",
"0.62425417",
"0.62425417",
"0.62419415",
"0.62419415",
"0.6223831",
"0.61736137",
"0.61727166",
"0.61660874",
"0.613595",
"0.6115363",
"0.6095709",
"0.6095709",
"0.60845816",
"0.6048447",
"0.6031278",
"0.6027722",
"0.60095024",
"0.60088134",
"0.60088134",
"0.6006375",
"0.6001623",
"0.598385",
"0.5966051",
"0.59644395",
"0.5964386",
"0.596179",
"0.59438545",
"0.5935613",
"0.59292626",
"0.5919621",
"0.59189004",
"0.5918776",
"0.591076",
"0.59094185",
"0.5909298",
"0.59085274",
"0.5905467",
"0.5904813",
"0.5900826",
"0.59002554",
"0.58807486",
"0.5879619",
"0.5863465",
"0.5857225",
"0.5856666",
"0.58528715",
"0.5848532",
"0.5847792",
"0.58442336",
"0.58416206",
"0.5827408",
"0.5826793",
"0.5824549",
"0.5820065",
"0.5818275",
"0.58152044",
"0.58130544",
"0.5811959",
"0.58069235",
"0.5800658",
"0.5795505",
"0.5790793",
"0.5790359",
"0.57873225",
"0.5783779",
"0.57755864",
"0.5766057",
"0.575946",
"0.57577777",
"0.5754745",
"0.5754666",
"0.5753218",
"0.57519275",
"0.57500476",
"0.5749232",
"0.5747148",
"0.5736147",
"0.5736089",
"0.5736035",
"0.5734355",
"0.5734299",
"0.57317924",
"0.57303435",
"0.57286775",
"0.57273334"
] | 0.0 | -1 |
This is effectively the end of the procedural generation algorithm. | def move(direction)
north = ["n", "up", "north"]
east = ["e", "right", "east"]
west = ["w", "left", "west"]
south = ["s", "down", "south"]
if north.include?(direction)
direction == "north"
elsif east.include?(direction)
direction == "east"
elsif west.include?(direction)
direction == "west"
elsif south.include?(direction)
direction == south
end
if $hero.location.exits.has_key?(direction)
newroom = $hero.location.exits[direction]
$hero.location = newroom
$hero.xy = newroom.xy
else
puts "You cannot travel #{direction}. The path does not lead there."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def generate; end",
"def generate; end",
"def generate_comprehensive\n\n end",
"def initial_generate\n \n end",
"def generate\n end",
"def generate\n end",
"def next_generation!\n @grid = next_generation\n end",
"def generate_next\n session[:solution] == nil && generate\n\n session[:marker] += NPREVIEWS\n\n if session[:marker] >= session[:solution].length\n session[:marker] = 0\n end\n\n session[:solution] && load_sections\n end",
"def process\n self.generate\n end",
"def generate\n populate\n @parlour.send(@mode)\n end",
"def gen_washing\r\r\n end",
"def generate\n conflict? ? self.next : normalized\n end",
"def generate\n throw \"override me before innocent kittens are hurt!\"\n end",
"def generate\n raise NotImplementedError\n end",
"def generate\n raise NotImplementedError\n end",
"def bulk_generate\n\n end",
"def new_generation\n # Incrementiamo il contatore di generazioni, per motivi di\n # studio e statistica, e poi generiamo una roulette propor-\n # zionale al fitness. \n # NOTA: non si può chiamare new_generation se non è stato\n # prima eseguito un test sul fitness.\n @current_generation += 1\n roulette = Roulette.new(@fitness_pool)\n \n # Ottenuta la roulette possiamo farla girare in modo da\n # estrarre coppie di cromosomi da riprodurre\n # Il loop viene eseguito popolazione / 2 volte perché ogni\n # accoppiamento produce due figli.\n # Esistono versioni alternative che da ogni accoppiamento\n # fanno nascere un solo figlio. \n new_population = []\n (@population.size / 2).times do\n mother = @population[roulette.extract]\n father = @population[roulette.extract]\n \n # Inseriamo i figli nella nuova popolazione\n Chromosome.mated_pair(mother, father).each do |chromosome|\n new_population << chromosome\n end\n end\n \n # Il vecchio lascia il posto al nuovo - è la legge della vita\n @population = new_population\n end",
"def generate!\n generator.invoke_all\n end",
"def next_gen\n @grid.calc_new_generation\n @generation += 1\n @current_gen_same_as_prev = @grid.current_gen_same_as_prev\n end",
"def generate\n raise \"must implement\"\n end",
"def step_generation\n @generation += 1\n @nature.step_generation\n end",
"def generate\n super\n end",
"def probers; end",
"def generate\n generations = 0\n loop do\n print\n sleep(0.5)\n newGeneration\n generations += 1\n p \"Number of generations: #{generations} [Ctrl-C to exit]\"\n end\n end",
"def generate_next\n @block.call(@so_far)\n end",
"def move_to_next_generation\n @x.times{ |r|\n @y.times{|c| \n @mat[r][c].step_generation\n }\n } \n end",
"def generate()\n\t\t\t@out = []\n\t\t\t@context = []\n\n\t\t\ttrim_nil_lines\n\n\t\t\[email protected]_with_index do |line, i|\n\t\t\t\twrite_with_context(line.line, line.context, next_context(i))\n\t\t\tend\n\t\t\twrite_with_context(nil, [], [])\n\t\t\treturn @out.join\n\t\tend",
"def generators; end",
"def generators; end",
"def generate\n # Refill the population with children from the mating pool\n @population.each_index do |i|\n partner_a = @mating_pool[rand(0...@mating_pool.size)]\n partner_b = @mating_pool[rand(0...@mating_pool.size)]\n child = partner_a.crossover(partner_b)\n child.mutate(@mutation_rate)\n @population[i] = child\n end\n @generations += 1\n end",
"def generate\n # Refill the population with children from the mating pool\n @population.each_index do |i|\n partner_a = @mating_pool[rand(0...@mating_pool.size)]\n partner_b = @mating_pool[rand(0...@mating_pool.size)]\n child = partner_a.crossover(partner_b)\n child.mutate(@mutation_rate)\n @population[i] = child\n end\n @generations += 1\n end",
"def generateOres\r\n #For each tier populate the grid with that tier's ore.\r\n (0..@tiers-1).each do |tier|\r\n #Number of ores for the tier.\r\n oreCount = (@baseChance * (@nextTierChance**tier) * @rows * @columns).to_i #Calculates the number of ores for the tier based on the base chance and next tier chance.\r\n @oreTotal[tier] = oreCount\r\n @oreRemaining[tier] = oreCount\r\n @oreRemainingPara[tier].clear { para(@ore[tier].to_s + \" \" + @oreName[tier].to_s + \" \", strong(\"x\" + @oreRemaining[tier].to_s), @style_orecount) } #Displays the remaining number of ores for the tier.\r\n @tierExp[tier] = oreCount * (2**tier) #Calculates the total experience aquired by mining all of the tier's ore.\r\n\r\n count = 0 #Number of ores added so far.\r\n #Randomly selects a cell on the grid to populate the ore with.\r\n while count < oreCount\r\n x = rand(@rows) #Selects a random row.\r\n y = rand(@columns) #Selects a random column.\r\n if (@tile[y][x].tier == 0) #Checks if the tile is empty.\r\n @tile[y][x].tier = tier + 1 #Applies the tier to the tile.\r\n count+=1 #New ore has been added.\r\n end\r\n end\r\n end\r\nend",
"def generate_gcode_plasma\r\n # if PSUpgrader.upgrade\r\n # UI.messagebox(\"GCode generation has been aborted due to the upgrade\")\r\n # return\r\n # end\r\n\r\n # swarfer: need these so that all aMill calls are given the right numbers, aMill should be unaware of defaults\r\n # by doing this we can have Z0 on the table surface, or at top of material\r\n @tabletop = PhlatScript.tabletop?\r\n\r\n if @tabletop\r\n @safeHeight = PhlatScript.materialThickness + PhlatScript.safeTravel.to_f\r\n @materialTop = PhlatScript.materialThickness\r\n # ZL = material thickness(MT)\r\n # cut = ZL - (cutfactor * MT)\r\n # safe = ZL+SH {- safe height is safe margin above material\r\n @zL = PhlatScript.materialThickness\r\n else\r\n @safeHeight = PhlatScript.safeTravel.to_f\r\n @materialTop = 0\r\n @zL = 0\r\n # Mat Zero : ZL = 0\r\n # cut = ZL - (cf * MT)\r\n # safe = ZL + SH {- safeheight is mt + some safety margin\r\n end\r\n @rampangle = PhlatScript.rampangle.to_f\r\n @must_ramp = PhlatScript.mustramp?\r\n\r\n puts(\" safeheight '#{@safeHeight.to_mm}'\\n\")\r\n puts(\" materialTop '#{@materialTop.to_mm}'\\n\")\r\n puts(\" ZL '#{@zL.to_mm}'\\n\")\r\n puts(\" tabletop '#{@tabletop}'\\n\")\r\n puts(\" rampangle '#{@rampangle}'\\n\") if @must_ramp\r\n\r\n @g_save_point = Geom::Point3d.new(0, 0, 0)\r\n model = Sketchup.active_model\r\n if enter_file_dialog(model)\r\n # first get the material thickness from the model dictionary\r\n material_thickness = PhlatScript.materialThickness\r\n if material_thickness\r\n\r\n begin\r\n output_directory_name = model.get_attribute Dict_name, Dict_output_directory_name, $phoptions.default_directory_name\r\n output_file_name = model.get_attribute Dict_name, Dict_output_file_name, $phoptions.default_file_name\r\n # @current_bit_diameter = model.get_attribute Dict_name, Dict_bit_diameter, Default_bit_diameter\r\n @current_bit_diameter = PhlatScript.bitDiameter\r\n\r\n # TODO: check for existing / on the end of output_directory_name\r\n absolute_File_name = output_directory_name + output_file_name\r\n\r\n safe_array = P.get_safe_array\r\n min_x = 0.0\r\n min_y = 0.0\r\n max_x = safe_array[2]\r\n max_y = safe_array[3]\r\n safe_area_points = P.get_safe_area_point3d_array\r\n\r\n min_max_array = [min_x, max_x, min_y, max_y, $phoptions.min_z, $phoptions.max_z]\r\n # aMill = CNCMill.new(nil, nil, absolute_File_name, min_max_array)\r\n aMill = PhlatMill.new(absolute_File_name, min_max_array)\r\n\r\n aMill.set_bit_diam(@current_bit_diameter)\r\n aMill.set_retract_depth(@safeHeight, @tabletop) # tell amill the retract height, for table zero ops\r\n\r\n # puts(\"starting aMill absolute_File_name=\"+absolute_File_name)\r\n ext = if @tabletop\r\n 'Z ZERO IS TABLETOP'\r\n else\r\n '-'\r\n end\r\n aMill.job_start(@optimize, @debug, ext)\r\n # puts \"amill jobstart done\"\r\n loop_root = LoopNodeFromEntities(Sketchup.active_model.active_entities, aMill, material_thickness)\r\n loop_root.sort\r\n millLoopNode(aMill, loop_root, material_thickness)\r\n\r\n # puts(\"done milling\")\r\n if PhlatScript.UseOutfeed?\r\n aMill.retract(@safeHeight)\r\n aMill.cncPrintC('Outfeed')\r\n aMill.move(PhlatScript.safeWidth * 0.75, 0)\r\n else\r\n if PhlatScript.UseEndPosition?\r\n height = if $phoptions.use_home_height?\r\n $phoptions.default_home_height\r\n else\r\n @safeHeight\r\n end\r\n aMill.retract(@safeHeight) # forces cmd_rapid\r\n aMill.cncPrintC('EndPosition')\r\n aMill.move(PhlatScript.end_x, PhlatScript.end_y, height, 100, 'G0')\r\n else\r\n # retracts the milling head and and then moves it home.\r\n # This prevents accidental milling\r\n # through your work piece when moving home.\r\n aMill.home\r\n end\r\n end\r\n if PhlatScript.useOverheadGantry?\r\n # if ($phoptions.use_home_height? != nil)\r\n if $phoptions.use_home_height?\r\n aMill.retract($phoptions.default_home_height)\r\n end\r\n # end\r\n end\r\n\r\n # puts(\"finishing up\")\r\n aMill.job_finish # output housekeeping code\r\n rescue\r\n UI.messagebox 'GcodeUtil.generate_gcode failed; Error:' + $ERROR_INFO\r\n end\r\n else\r\n UI.messagebox(PhlatScript.getString('You must define the material thickness.'))\r\n end\r\n end\r\n end",
"def generator\n printf(\"%-10s %s\\n\",\"generator:\", \"generating.. (*hdls, *bmm, *scr, *prj)\")\n exitcode = 1\n FileUtils.rm_r Dir.glob(\"#{TMPDIR}/hdl/*.vhd\")\n FileUtils.rm_r Dir.glob(\"#{TMPDIR}/synthesis/*.vhd\")\n File.symlink(\"../pcores\", \"#{TMPDIR}/pcores\") unless File.symlink?(\"#{TMPDIR}/pcores\")\n pipe = IO.popen(\"platgen -od #{TMPDIR}/ -p xc4vfx100ff1152-10 -lang vhdl ../system.mhs\", \"r+\")\n # pipe = IO.popen(\"platgen -p xc4vfx12ff668-10 system.mhs\", \"r+\")\n pipe.each do |line|\n # puts line\n # do not synthesize\n if line =~ /Running XST synthesis/\n exitcode = 0\n Process.kill 'TERM', pipe.pid\n break\n end\n end\n unless exitcode == 0\n p \"# Error with platgen - check platgen.log\"\n exit\n end\n\n # he generated files under $PROJECT/TMPDIR/{hdl,synthesis}\n # copy them to $PROJECT/hdl/ under certain conditions (size differs & or abstence)\n FileUtils.mkdir('hdl') unless File.directory? 'hdl'\n FileUtils.mkdir('synthesis') unless File.directory? 'synthesis'\n FileUtils.mkdir_p(BMM_RESULTSDIR) unless File.directory? BMM_RESULTSDIR # output directory\n\n # move_files_if(\"#{TMPDIR}/hdl/*.vhd\")\n move_files_if(\"#{TMPDIR}/implementation/#{TOPLEVEL}.bmm\", BMM_RESULTSDIR)\n move_files_if(\"#{TMPDIR}/synthesis/*.scr\" )\n move_files_if(\"#{TMPDIR}/synthesis/*.prj\")\n Find.find(\"#{TMPDIR}/hdl\") do |path|\n move_files_if(path) if File.file? path\n end\n\n # move logfiles to scratch\n FileUtils.mkdir_p(GEN_SCRATCHDIR) unless File.directory? GEN_SCRATCHDIR\n [\"platgen.log\", \"platgen.opt\", \"#{TMPDIR}/clock_generator*.log\"].each { |t|\n FileUtils.mv(t, \"#{GEN_SCRATCHDIR}/\") if File.file? t\n }\n\n # change timestamps\n\nend",
"def create_generation\n old_persons = Array.new(@all_persons)\n clear_world\n unless old_persons.empty?\n best_person = highest_fitness(old_persons)\n best_person.reset_energy_level\n @all_persons.push(best_person) unless best_person.nil?\n while @all_persons.size < @total_people and !old_persons.empty?\n if old_persons.size >= 10\n sample_size = 10\n elsif old_persons.size >= 5\n sample_size = 5\n else\n sample_size = 3\n end\n sample_one = old_persons.sample(sample_size)\n sample_two = old_persons.sample(sample_size)\n\n parent_one = highest_fitness(sample_one)\n parent_two = highest_fitness(sample_two)\n\n old_persons.delete_if { |x| x == parent_one or x == parent_two }\n (0..1).each do\n coords = get_empty_coords\n new_person = Person.new(coords[0], coords[1], @x_size, @y_size, parent_one.get_chromosome, parent_two.get_chromosome)\n @all_persons.push(new_person)\n end\n end\n end\n @generation += 1\n end",
"def generated\n end",
"def generate\n map(&:generate)\n end",
"def generate_data!\n start_dir = Dir.pwd\n \n Dir.chdir tool_path\n system \"./generate -pc #{product_factor} -fn #{filename} -fc\"\n ensure\n Dir.chdir start_dir\n end",
"def generate\n save\n end",
"def projection_generator\r\n if @population_density >= 200\r\n @number_of_deaths = (@population * 0.4).floor\r\n @speed += 0.5\r\n elsif @population_density >= 150\r\n @number_of_deaths = (@population * 0.3).floor\r\n @speed += 1\r\n elsif @population_density >= 100\r\n @number_of_deaths = (@population * 0.2).floor\r\n @speed += 1.5\r\n elsif @population_density >= 50\r\n @number_of_deaths = (@population * 0.1).floor\r\n @speed += 2\r\n else\r\n @number_of_deaths = (@population * 0.05).floor\r\n @speed += 2.5\r\n end\r\n end",
"def generate\n if language_id && excercise_type\n prepare_text\n self.generated = case excercise_type\n when 1 then prepare_fill_gaps\n when 2 then text\n end\n end\n end",
"def eval_generate\n return [] unless self.recurse?\n\n recurse\n #recurse.reject do |resource|\n # catalog.resource(:file, resource[:path])\n #end.each do |child|\n # catalog.add_resource child\n # catalog.relationship_graph.add_edge self, child\n #end\n end",
"def generate(startSym, theSeed,\n countProds=FALSE, doAnalysis=FALSE, forceSeed=FALSE)\n\n # Check the obvious errors and get set up. The interesting variables are\n # top - the root of the generated tree.\n # work - Array of tree nodes yet to expanded.\n # analysis - the record of what happened.\n #\n # The analysis vector is a list of ad hoc records, themselves arrays. The\n # members of the array are the generated frontier left of the replaced\n # non-terminal, the remaining frontier right of the replacement, and the\n # replacement rule which also provides the replacement symbol.\n #\n # :left => left side before replacement.\n # :right => items left to replace.\n # :rule => the rule doing the replacement.\n\n raise \"Symbol |#{startSym.name}| not non-terminal\" unless isNT?(startSym)\n theSeed = theSeed*configuration.value(:seed).to_i unless forceSeed\n srand theSeed\n\n # Each tree node contains private \"metadata\" that describes the\n # relationships between various names (and other things?) used in this \n # specific generated probe. Only one object is created and it is passed \n # around and modified by all the tree nodes as they are generated and\n # represented.\n #\n # The object itself is a hash (as a kind of poor man's record). The current\n # fields are\n # :columns => ?\n # :tables => tables mentioned in the FROM clause and so eligible for \n # use as part of column names.\n # :tableAliases => table aliases created in the FROM clause and so\n # eligible for use elsewhere.\n # :queryNames => query names generated in some clauses and used\n # elsewhere.\n\n pd = {#:columns => [], \n #:tables => [],\n #:tableAliases => [],\n #:queryNames => [],\n #:columnAliases => [],\n #:views => [],\n #:materializedViews => [] }\n\t }\n\n @metadata.clearSymbolTable\n # @metadata.addSymbolTable # if @metadata.symtab.empty?\t# This *if* condition is a TEMPORARY patch because it appears that @metadata gets reused for entire probeset\n\n prodCounts = Hash.new(0)\n\n # Now create the top tree node, put it in the worklist, and do whatever\n # analysis seems desirable.\n\n top = GramTree.new(startSym, pd, self.method(:defaultRepresent),\n nil)\n work = [ top ]\n analysisTR = TextRect.new if doAnalysis\n\n # Begin a typical working loop. So long as there is something left in the\n # work list, process it. Notice that order doesn't matter because the\n # nodes are already hooked properly into their parents and are just waiting\n # their own expansion in turn.\n \n until work.empty? do\n\n # Only do a replacement if we have a nonterminal. But get the analysis\n # done if needed.\n\n theNode = work.shift\n theSym = theNode.sym\n next unless isNT?(theSym)\n\n # Find a replacement rule for this non-terminal. The return value is a\n # *Hash* { :rule => GramRule, :repProc => repProc, :genProc => genProc }.\n # If there are procedures for the rule, tell the tree node about it.\n\n theHash = randomRule(theSym)\n theNode.changeRepProc(theHash[:repProc]) unless theHash[:repProc].nil?\n theNode.changeGenProc(theHash[:genProc]) unless theHash[:genProc].nil?\n theNode.generate\n prodCounts[theHash[:ruleName]] += 1 if countProds\n\n # For each symbol on the right hand side of the rule, add a new tree \n # node and attach it to the parent. Also, push it onto the working list\n # for its own later expansion. Everybody gets the default representation\n # until they prove better.\n\n subWork = []\n \n theHash[:rule].rhs.each do |s|\n\n newNode = GramTree.new(s, pd, self.method(:defaultRepresent), nil)\n theNode.addChild newNode\n subWork.push(newNode)\n\n end\n\n work = subWork.concat(work)\n\n if doAnalysis\n analysisTR.below! \"Rule: #{theHash[:rule].to_s}\"\n analysisTR.below! TextRect.new(top.frontier).fold(90).lPad(' ')\n analysisTR.below! ' '\n end\n\n end\n\n # Now find the text representation. If the representation goes wrong, the\n # exception will be caught and the special 'generator died' statement\n # created.\n\n begin\n theText = top.represent(self)\n success = :T\n reason = 'OK'\n rescue SyntaxError => excp\n theText = 'select null from dual where 1 = 0'\n success = :F\n reason = excp.message\n end\n\n { :start => startSym, \n :seed => theSeed,\n :analysis => analysisTR,\n :text => '/*%d*/ %s' % [ theSeed, theText ],\n :success => success,\n :reason => reason,\n :prodCounts => prodCounts\n }\n\n end",
"def generate(*args)\n raise \"Method 'generate' not implemented for #{self.class.name}\"\n end",
"def generate_prev\n session[:solution] == nil && generate\n \n session[:marker] -= NPREVIEWS\n\n if session[:marker] < 0\n if session[:solution].length.remainder(NPREVIEWS) == 0\n session[:marker] = session[:solution].length - NPREVIEWS\n else\n session[:marker] = session[:solution].length - session[:solution].length.remainder(NPREVIEWS)\n end\n end\n\n session[:solution] && load_sections\n end",
"def generate()\n traverse(@root)\n @un_arr.traverseUnions if @@union_flag\n @un_arr.traverseArrays if @@dyn_array_flag\n write_to_file\n end",
"def run\n generate_initial_population() #Generate initial population \n\n (1..@max_generation).each do |generation_number|\n puts \"\\nGeneration #{generation_number}\"\n\n fitness_range = get_fitness_range(@population)\n\n next if fitness_range.max == fitness_range.min\n\n @population.sort!()\n\n selected_to_breed = selection() # Evaluates current population \n\n offsprings = reproduction(selected_to_breed) # Generate the population for this new generation\n\n replace_worst_ranked(offsprings)\n\n puts to_s()\n\n mutate()\n\n increment_age()\n end\n\n #return best_chromosome()\n return @population.sort { |a, b| b.fitness <=> a.fitness}\n end",
"def step\r\n crossover\r\n mutation\r\n # Compute selection order based on energy\r\n p = @population.map{ |i| [i, i[:energy] * (1 - @selection + rand * @selection) ] }\r\n # Select next generation: fitter individuals (lower energy number)\r\n # will be selected with higher propability \r\n @population = p.sort{ |a,b| a[1] <=> b[1] }[0..@size].map{|i, o| i}\r\n end",
"def processor; end",
"def gen(i, n, stopval)\r\n m = n + i + 1\r\n if (factor2(m) < stopval)\r\n gen(i+1, m, stopval)\r\n else\r\n print(\"i: \",i,\" m: \",m,\" stop: \",stopval)\r\n end\r\n \r\nend",
"def create_generations\n @generations.each do |g|\n create_generation(g) unless Generation.find_by(name: g['name'])\n end\n end",
"def generate(size_x, size_y)\n @size_x = size_x\n @data = Array.new(size_x * size_y, 0)\n first_iteration = true\n\n number_of_passes.times do\n drops = create_drops\n\n # initial drop position is at the center of the map\n drop_point_x, drop_point_y = size_x / 2, size_y / 2\n\n drops.each do |drop|\n # drop particles\n drop.each { |particle| particle.drop(@data, drop_point_x, drop_point_y, size_x) }\n\n # move drop point for next drop\n if first_iteration\n drop_point_x = rand(size_x - 8) + 4 # make sure that particles\n drop_point_y = rand(size_y - 8) + 4 # aren't created near the edges\n else\n drop_point_x = rand(size_x / 2) + size_x / 4\n drop_point_y = rand(size_y / 2) + size_y / 4\n end\n end\n\n first_iteration = false\n change_variables_for_next_pass\n end\n\n @data\n end",
"def prepare \n # initialize start values, prepare first generation\n begin\n self.start_values = IterativeLearning.build_condition(condition.start_values[\"each_chain\"], self)\n first_generation.prepare(self.start_values)\n rescue StandardError => e\n first_generation.prepare(condition.start_values)\n self.start_values = []\n end\n # initialize target values, if present\n begin\n self.target_values = IterativeLearning.build_condition(condition.target_values[\"each_chain\"], self)\n rescue StandardError\n self.target_values = []\n end\n self.save!\n end",
"def generate_output(graph,outputs,namedOutputs)\r\n \r\n puts \"--- OUTPUT --------\" \r\n \r\n\r\n#------------------- aggiungo le risorse -------------------------\r\n # ciclo gli output per identificare nuove risorse IO\r\n outputs.each_with_index do |inline,i|\r\n fields = inline.split(',') \r\n found_job = fields[0].split('(').last\r\n io_resource = \"IO_\" + fields[1].chomp(')')\r\n \r\n #Se non é giá stata creata, aggiungo la risorsa al set a al grafo\r\n unless @InOut.include? io_resource\r\n graph.add_node(\"\\\"\" + io_resource + \"\\\"\",\"is_resourceIO\")\r\n puts \"aggiunta risorsa IO: \" + io_resource\r\n @InOut << io_resource\r\n end \r\n end\r\n \r\n#--------------------- aggiungo gli output ---------------------------- \r\n @Jobs.each do |current_job| \r\n # per ogni job ciclo i propri output\r\n outputs.each_with_index do |inline,i|\r\n \r\n fields = inline.split(',')\r\n found_job = fields[0].split('(').last\r\n io_resource = \"IO_\" + fields[1].chomp(')')\r\n\r\n # se il job da analizzare é uguale a quello letto => lo analizzo\r\n if current_job == found_job \r\n \r\n #aggiungo il nodo di output e il collegamento con la risorse IO \r\n output_name = found_job + \".\" + \"OUTPUT_\" + fields[1].chomp(')') \r\n \r\n graph.add_node(\"\\\"\" + output_name + \"\\\"\",\"is_output\")\r\n puts \"aggiunto output: \" + output_name\r\n \r\n graph.add_link(output_name,io_resource,\"\")\r\n puts \"aggiunto link: \" + \"\\\"\" + output_name + \"\\\"\" + \"->\" + io_resource\r\n \r\n # chiudo i nodi pendenti ( job per job) \r\n Close_ALL_pending_links(graph,current_job,output_name) \r\n end\r\n \r\n #------------------------- aggiungo i file name--------------------------------------------------------- \r\n # ci filename nomi customizzati\r\n unless namedOutputs.size == 0\r\n namedOutputs.each do |nameline| \r\n \r\n fields_nameline = nameline.split(',') \r\n if current_job == fields_nameline[0].split('(').last\r\n namedOutput = \"FILE_\" + fields[1].chomp(')') + \"File_\" + fields_nameline[1].chomp(')')\r\n \r\n graph.add_node(\"\\\"\" + namedOutput + \"\\\"\",\"is_file\")\r\n puts \"aggiunto output: \" + namedOutput\r\n \r\n graph.add_link(io_resource,namedOutput,\"\")\r\n puts \"aggiunto link: \" + \"\\\"\" + io_resource + \"\\\"\" + \"->\" + namedOutput \r\n end\r\n end \r\n end\r\n \r\n \r\n end #do outputs \r\n end # do jobs\r\n \r\n \r\n end",
"def generate_full required_depth \n generate( [:cyclic], required_depth )\n end",
"def generate\n generate_header\n generate_content\n #not_dirty\n end",
"def solve\n @time = Time.new\n for j in 0..@generations\n new_generation = Array.new\n @selection.init(@population)\n \n for i in 0..(@population_size/2)-1\n children = @reproduction.reproduce(@selection.select,@selection.select,@mutation)\n \n son = children[0]\n daughter = children[1]\n \n if son.fitness > @best_fitness\n @best_fitness = son.fitness\n @best_configuration = son.configuration.conf\n end\n \n if daughter.fitness > @best_fitness\n @best_fitness = daughter.fitness\n @best_configuration = daughter.configuration.conf\n end\n \n new_generation.push(son)\n new_generation.push(daughter)\n \n end\n \n @population = new_generation\n \n end\n @time = Time.new - @time\n end",
"def generate\n # Vælg et tilfældigt koordinat til at starte med.\n random_start = [@prng.rand(@width),@prng.rand(@height)]\n \n # Opret en stak og læg det tilfældige koordinat på stakken.\n stack = Array.new\n stack.push random_start\n until stack.empty?\n # Tag koordinaterne fra det øverste element på stakken.\n x,y = stack.last\n # Marker cellen som besøgt.\n @grid[y][x].visited = true\n # Gem alle cellens nabo-celler.\n neighbors = Array.new\n neighbors.push [x, y-1] unless y-1 < 0 # Nord\n neighbors.push [x+1, y] unless x+1 >= @width # Øst\n neighbors.push [x, y+1] unless y+1 >= @height # Syd\n neighbors.push [x-1, y] unless x-1 < 0 # Vest\n # Sorter de naboer fra der allerede er blevet besøgt af algoritmen.\n neighbors.delete_if {|x, y| @grid[y][x].visited }\n # tjek om der er nogle ubesøgte naboer.\n if neighbors.any?\n # Vælg en tilfældig ubesøgt nabo.\n random_neighbor = neighbors.sample(random:@prng)\n # Forbind denne celle med den tilfældige nabo.\n connect stack.last, random_neighbor\n # Læg den tilfældige nabo øverst på stakken.\n stack.push random_neighbor\n else\n # Hvis der ingen naboer er, så tager den en celle af stakken.\n stack.pop\n end\n end\n end",
"def next()\n \n end",
"def next()\n \n end",
"def generateConcreteCharges\r\n\t #For each charge factories asscociated with retail plans, generate concrete charge and total them\r\n\t self.retail_plan.charge_factories.each do |charge_factory| \r\n\t generated_concrete_charges = charge_factory.specific.concreteCharge(self)\r\n\t #Put each generated_concrete_charge to GeneratedInvoice\r\n\t generated_concrete_charges.each do |generated_concrete_charge|\t \t\r\n\t\t self.concrete_charges << generated_concrete_charge\r\n\t\t self.total += generated_concrete_charge.amount\r\n\t end\r\n\t end\r\n\tend",
"def generate\n session[:generator_error] = nil\n semester = Semester.find(params[:id]);\n courses = semester.cis_courses\n\n # decide whether we should try to generate\n nsections = 0\n ncourses = courses.length\n courses.each do |c| \n cis_semester = c.cis_semesters.find(:first, :conditions => ['year = ? AND semester = ?', semester.year, semester.semester])\n sections = cis_semester && cis_semester.cis_sections && cis_semester.cis_sections.sort {|a, b| a.name <=> b.name}\n if sections == nil then next end\n nsections += sections.length\n end\n score = nsections\n\n # disable generation if it looks like we're going to spin too long\n if score > 120\n session[:solution] = nil\n session[:marker] = 0\n # flash error here\n session[:generator_error] = 'Generator disabled (schedule appears to be too complicated for server-side generation, click here to close).'\n return\n end\n\n root = And.new\n\n\n courses.each do |c|\n cis_semester = c.cis_semesters.find(:first, :conditions => ['year = ? AND semester = ?', semester.year, semester.semester])\n sections = cis_semester && cis_semester.cis_sections && cis_semester.cis_sections.sort {|a, b| a.name <=> b.name}\n if !sections || sections.length == 0 then next end\n\n if sections[0].name.length == 0\n orob = Or.new\n sections.each do |s|\n orob.add_child Leaf.new(s)\n end\n root.add_child orob\n\n elsif sections[0].name.length == 1\n orob = Or.new\n andob = And.new\n mark = sections[0].name[0]\n\n sections.each do |s|\n if s.name[0] != mark\n mark = s.name[0]\n orob.add_child andob\n andob = And.new\n end\n andob.add_child Leaf.new(s)\n end\n\n orob.add_child andob\n root.add_child orob\n\n else # length 2 or 3\n \n l1or = Or.new\n l2and = And.new\n l3or = Or.new\n\n mark0 = sections[0].name[0]\n mark1 = sections[0].name[1]\n\n sections.each do |s|\n\n if s.name[0] != mark0\n mark0 = s.name[0]\n mark1 = s.name[1]\n l2and.add_child l3or\n l1or.add_child l2and\n l3or = Or.new\n l2and = And.new\n elsif s.name[1] != mark1\n mark1 = s.name[1]\n if s.name.length == 3\n l2and.add_child l3or\n l3or = Or.new\n end\n end\n l3or.add_child Leaf.new(s)\n end\n\n l2and.add_child l3or\n l1or.add_child l2and\n root.add_child l1or\n end\n\n end\n\n session[:solution] = root.solve.collect { |opset| opset.option_set }\n session[:marker] = 0\n end",
"def new_generation\n neighbors_alive = 0\n new_generation = initiate_grid\n insert_to_temp\n @width.times do |x|\n @height.times do |y|\n neighbors_alive = get_neighbors_alive(x+1,y+1)\n apply_rules(x, y, neighbors_alive, new_generation)\n end\n end\n @generation += 1\n update_generation(new_generation)\n end",
"def kid_generator=(_arg0); end",
"def kid_generator=(_arg0); end",
"def gen\n until @output_history.empty? || @history_continuations.key?( @output_history )\n @output_history.shift\n end\n # history contunuation counters table\n contunuations = @history_continuations[ @output_history ]\n # number of all possible continuations\n r = contunuations.values.inject(0){ |sum, val| val+sum }\n # select random continuation (key from hash)\n r, item = rand(r), nil\n contunuations.each{ |key, val|\n if (r -= val) < 0\n # add item to output history\n @output_history << ( item = key )\n break\n end\n }\n item\n end",
"def eval_generate\n new_resources = []\n updated_resources = []\n\n configuration.each do |type, resources|\n fail \"The 'type' should be the name of the Puppet type and not be empty! Got: #{type.inspect}\" unless type and not type.empty?\n fail \"The 'resources' should be a hash with the override Puppet resources! Got: #{resources.inspect}\" unless resources.is_a? Hash\n next unless type_enabled? type\n debug \"Processing type: #{type}\"\n resources.each do |title, parameters|\n fail \"The 'title' should be the title of the Puppet resource nd should not be empty! Got: #{title.inspect}\" unless title and not title.empty?\n fail \"The 'parameters' should be a hash of the resource parameters! Got: #{parameters.inspect}\" unless parameters.is_a? Hash\n next unless title_enabled? title\n debug \"Processing resource: #{type}[#{title}]\"\n parameters = defaults_for(type).merge parameters\n\n if resource_present? type, title\n debug \"#{type.capitalize}[#{title}] was found in the catalog, updating it!\"\n updated_resources << update_resource(type, title, parameters)\n else\n if type_create? type or title_create? title\n debug \"#{type.capitalize}[#{title}] was not found in the catalog, creating it!\"\n new_resources << create_resource(type, title, parameters)\n else\n debug \"#{type.capitalize}[#{title}] was not found in the catalog, skipping it!\"\n next\n end\n end\n\n end\n end\n update_relationship_graph(updated_resources + new_resources)\n\n new_resources\n end",
"def generate_random_hypothesis( size )\n hypothesis = Hypothesis.new\n size.times do\n hypothesis << generate_random_rule\n end\n hypothesis\nend",
"def generate_random_hypothesis( size )\n hypothesis = Hypothesis.new\n size.times do\n hypothesis << generate_random_rule\n end\n hypothesis\nend",
"def run\n calculate_ideal_subject_distribution\n\n #p \"population size >>>>>> \" + @population_size.to_s\n #p \"max generations >>>>>> \" + @max_generation.to_s\n\n result = {}\n best_chromosomes = []\n generate_initial_population #Generate initial population \n @max_generation.times do |g|\n\n selected_to_breed = selection #Evaluates current population \n\n offsprings = reproduction selected_to_breed #Generate the population for this new generation\n\n replace_worst_ranked offsprings\n\n #Sort the chromosomes again by fitness after offsprings\n #being merged\n @population.sort! { |a, b| b.fitness <=> a.fitness}\n\n # fs = @population.collect {|x| x.fitness }\n # File.open(\"fitnesses.txt\", \"a\") do |f|\n # f.puts \"generation (#{fs.size}) #{g.to_s} = \" + fs.join(\", \")\n # end\n\n best_chromosomes << @population[0]\n end\n result[:chromosomes] = best_chromosomes\n result[:population_size] = @population_size\n result[:generations] = @max_generation\n return result\n end",
"def execute\n @generation = 0\n output_hash = { best_fit: nil, gen_of_best_fit: 0, func_evals_of_best_fit: 0,\n relative_error: nil, optimal_func_val: nil }\n begin\n init_population\n p 'population initialized'\n select_taguchi_array\n p \"the selected taguchi array is L#{@taguchi_array.size}\"\n while @generation < @max_generation\n selected_indexes = roulette_select\n cross_individuals selected_indexes\n generate_offspring_by_taguchi_method\n mutate_individuals\n select_next_generation\n if (@generation % 50).zero?\n p \"Generation: #{@generation}- Fitness: #{@chromosomes.first.fitness}\"\n end\n update_output_hash output_hash\n break if has_stopping_criterion_been_met? output_hash[:best_fit]\n @generation += 1\n end\n relative_error = (((output_hash[:best_fit] + 1) / (@optimal_func_val + 1)) - 1).abs\n output_hash[:relative_error] = relative_error\n output_hash[:optimal_func_val] = @optimal_func_val\n rescue StandardError => e\n p e.message\n p e.backtrace.inspect\n end\n p output_hash\n output_hash\n end",
"def next_generation\n\n @alive_count = 0\n @dead_count = 0\n neighbors_board = ConwaysGame.create_neighbor_board(@board)\n @board.length.times do |row|\n @board[row].length.times do |col|\n num_neighbors = neighbors_board[row][col]\n\n if @board[row][col] == 1\n # if num_neighbors < 2 || num_neighbors > 3\n # A cell should die if it's # of neighbors does not correspond to the amount needed to stay alive\n if !@stay_alive_count.include?(num_neighbors)\n @board[row][col] = 0\n #Updates alive and dead count\n @dead_count += 1\n else\n @alive_count += 1\n end\n\n elsif @board[row][col] == 0\n # if num_neighbors == 3\n if @revive_count.include?(num_neighbors)\n @board[row][col] = 1\n #Updates alive and dead count\n @alive_count += 1\n else\n @dead_count += 1\n end\n\n end\n end\n end\n #we just want it to mutate the board now\n # return (@board)\n #\n\n end",
"def insert_new_generation\n (0...@new_generation.size).each do |i|\n evaluate_chromosome @new_generation[i]\n j = rand [email protected]\n @chromosomes.delete_at j\n @chromosomes << @new_generation[i]\n end\n @mating_pool.clear\n @new_generation.clear\n end",
"def generateLoop2\n for i in 1...10 do #do optional\n puts i\n end\n end",
"def produce!\n $log.debug \"Producing goods for the city #{@name}...\"\n self.production.each_pair do |good, pr|\n if good == Food\n # kill unit from hunger\n if pr.effective + @warehouse[Food] < 0\n victim = residents.sample\n @nation.kill! victim\n $ui.messages << _('A %s has died of hunger in %s.') % [victim.description, @name]\n next\n # create a new unit\n elsif pr.effective + @warehouse[Food] > @warehouse.max_size\n unit = @nation.create_unit!(Peasant, @x, @y)\n $ui.messages << _('A new unit was born in %s!') % @name\n @warehouse[Food] -= @warehouse.max_size\n end\n end\n\n # store/take from warehouse\n if pr.effective > 0\n @warehouse.store(good, pr.effective)\n elsif pr.effective < 0\n @warehouse.load(good, pr.effective.abs)\n end\n end\n end",
"def generate_graph\n end",
"def generate\n instance_eval( &LeftBishop )\n instance_eval( &RightBishop )\n instance_eval( &LeftRook )\n instance_eval( &SoleKing )\n instance_eval( &RightRook )\n instance_eval( &SoleQueen )\n rescue ExhaustedError\n end",
"def generate_all(load_file)\n data = JSON.parse(File.open(\"#{load_file}\", \"r\").read) # Parse the json into an array\n deck_1_number_wins = 0.0\n deck_2_number_wins = 0.0 \n deck_1_win_rate = 0.0\n deck_2_win_rate = 0.0\n total_win_rate = 0.0\n deck_1_win_turn = 0.0\n deck_2_win_turn = 0.0\n total_win_turn = 0.0\n deck_1_win_damage = 0.0\n deck_2_win_damage = 0.0\n total_win_damage = 0.0\n winner_hp = 0.0\n looser_hp = 0.0\n winner_cid = 0.0 # cards in deck\n looser_cid = 0.0 # cards in deck\n total_cid = 0.0 # cards in deck\n winner_cih = 0.0 # cards in hand\n looser_cih = 0.0 # cards in hand\n total_cih = 0.0 # cards in hand\n \n # Get the total number of times each player won\n data.each do |item|\n if item['random_winner'] == 'Deck_1' \n deck_1_number_wins = deck_1_number_wins +1\n deck_1_win_turn = deck_1_win_turn + item['random_win_turn']\n total_win_turn = total_win_turn + item['random_win_turn']\n deck_1_win_damage = deck_1_win_damage + item['damge_dealt_on_final_turn']\n total_win_damage = total_win_damage + item['damge_dealt_on_final_turn']\n else\n deck_2_number_wins = deck_2_number_wins +1\n deck_2_win_turn = deck_2_win_turn + item['random_win_turn']\n total_win_turn = total_win_turn + item['random_win_turn']\n deck_2_win_damage = deck_2_win_damage + item['damge_dealt_on_final_turn']\n total_win_damage = total_win_damage + item['damge_dealt_on_final_turn']\n end\n winner_hp = winner_hp + item['winners_hp']\n looser_hp = looser_hp + item['losers_starting_hp']\n winner_cid = winner_cid + item['winner_cards_in_deck']\n looser_cid = looser_cid + item['looser_cards_in_deck']\n total_cid = total_cid + winner_cid + looser_cid\n winner_cih = winner_cid + item['winner_cards_in_hand']\n looser_cih = looser_cid + item['looser_cards_in_hand']\n total_cih = total_cid + winner_cid + looser_cid\n end\n \n # Calculate win % and convert that number to a float\n deck_1_win_rate = deck_1_number_wins/data.size.to_f * 100\n deck_2_win_rate = deck_2_number_wins/data.size.to_f * 100\n \n puts \"Deck 1 wins #{deck_1_number_wins}/#{data.size} which is #{deck_1_win_rate}%\"\n puts \"Deck 2 wins #{deck_2_number_wins}/#{data.size} which is #{deck_2_win_rate}%\" \n\n # Calculate win turn and convert that number to a float\n deck_1_avg_win_turn = deck_1_win_turn/deck_1_number_wins.to_f\n deck_2_avg_win_turn = deck_2_win_turn/deck_2_number_wins.to_f\n total_win_turn = total_win_turn/data.size.to_f\n\n puts \"Deck 1 on avgerage wins on turn #{deck_1_avg_win_turn}\"\n puts \"Deck 2 on avgerage wins on turn #{deck_2_avg_win_turn}\"\n puts \"On avgerage the game ends on turn #{total_win_turn}\" \n \n # Calculate win damage and convert that number to a float\n deck_1_avg_win_damage = deck_1_win_damage/deck_1_number_wins.to_f\n deck_2_avg_win_damage = deck_2_win_damage/deck_2_number_wins.to_f\n total_win_damage = total_win_damage/data.size.to_f\n\n puts \"Deck 1 on avgerage wins by dealing #{deck_1_avg_win_damage}\"\n puts \"Deck 2 on avgerage wins by dealing #{deck_2_avg_win_damage}\"\n puts \"On avgerage the game ends by dealing #{total_win_damage}\"\n \n # Calculate average hp and convert that number to a float\n winner_hp = winner_hp/data.size.to_f\n looser_hp = looser_hp/data.size.to_f\n\n puts \"On avgerage the winner has #{winner_hp} hp on the final turn\"\n puts \"On avgerage the looser has #{looser_hp} hp at the start of the final turn\"\n\n # Calculate average cards in deck and convert that number to a float\n winner_cid = winner_cid/data.size.to_f\n looser_cid = looser_cid/data.size.to_f\n total_cid = total_cid/data.size.to_f\n\n puts \"On avgerage the winner has #{winner_cid} cards in deck on the final turn\"\n puts \"On avgerage the looser has #{looser_cid} cards in deck on the final turn\"\n puts \"On avgerage the a player has #{total_cid} cards in deck on the final turn\"\n\n # Calculate average cards in hand and convert that number to a float\n winner_cih = winner_cih/data.size.to_f\n looser_cih = looser_cih/data.size.to_f\n total_cih = total_cih/data.size.to_f\n\n puts \"On avgerage the winner has #{winner_cih} cards in hand on the final turn\"\n puts \"On avgerage the looser has #{looser_cih} cards in hand on the final turn\"\n puts \"On avgerage the a player has #{total_cih} cards in hand on the final turn\"\n end",
"def generate(name); end",
"def kid_generator; end",
"def kid_generator; end",
"def kid_generator; end",
"def gen_square(square, index_arr, index)\n # generates a magic square\n\n count = 0;\n\n # while loop\n while count < square.length do\n # counter\n if index_arr[count] == 0\n # assign index to array\n square[count] = index\n index_arr[count] = 1\n\n # check if index < 9\n if index < 9\n # call function\n gen_square(square, index_arr, index + 1)\n elsif is_magic(square) == true\n # call print function\n print_square(square)\n end\n\n index_arr[count] = 0\n end\n count += 1\n end\nend",
"def generate_grow required_depth \n generate( [:cyclic, :terminating], required_depth )\n end",
"def start_composition\n current_solution = generate_initial_solution\n calculate_weight(current_solution)\n args = create_arguments(current_solution)\n result_array = start_simulated_annealing(args)\n \n solution_cost = result_array[result_array.length-3].to_f\n width_grow = result_array[result_array.length-2].to_i\n height_grow = result_array[result_array.length-1].to_i\n if(width_grow!=0 or height_grow !=0)\n enlarge_white_space(width_grow, height_grow)\n end\n times_to_try = 3\n \n while solution_cost > 1.0 and times_to_try>0 \n if values_bits[Constants::V_Type_of_BG]<=4.5\n reduce_font_size\n end\n \n current_solution = generate_initial_solution\n calculate_weight(current_solution)\n \n args = create_arguments(current_solution)\n result_array = start_simulated_annealing(args)\n \n solution_cost = result_array[result_array.length-3 ].to_f\n \n times_to_try -= 1\n end\n\n loop_n = (result_array.length - 2)/3 \n \n loop_n.times do |n|\n @groups[n].x_pos = result_array[0+n*3].to_i;\n @groups[n].y_pos = result_array[1+n*3].to_i;\n @groups[n].alignment = result_array[2+n*3].to_i==0 ? 'right' : 'left';\n end\n\n if values_bits[Constants::V_Type_of_BG] > 4.5\n cut_white_space_edges\n end\n\n @groups.length.times do |n|\n @groups[n].process_texts_position(@width)\n end\n \n end",
"def maybe_generate\n return if @generated\n puts \"\\nGenerating byte_code image\" if Rake.verbose\n # image=[] # TBR?\n @memloc=0\n [email protected]{|v| v.definitions}.flatten.reject{|d| d.primitive?}\n def_list.each do |d|\n begin\n code=[]\n cdef=MFCompiledDefinition.new\n cdef.location=@memloc\n cdef.definition=d\n cdef.flags=(cdef.definition.definer == \"SYNTAX:\" ? 1 : 0)\n @compiled_definitions << cdef # adding here already although body may be empty\n # determine code size beforehand to get offset for data segment of definition\n defsize=d.code.body.map{|w| element_size(w)}.reduce(:+) +1 # final qend\n @data=[]\n @data_counter=@memloc+defsize # initialize data segment counter\n puts \"compiling definition for #{d.name}\" if Rake.verbose == true\n d.code.body.each do |word|\n word_bytecode(word,code)\n end\n code << prim(:qend)\n puts \"#{d.name} is at #{@memloc}\" if Rake.verbose == true\n @memloc += (defsize + @data.length)\n cdef.code=code+@data\n rescue\n puts \"failed to compile definition:\"\n puts \"ERROR:#{d.err_loc}: #{d.see}\"\n raise\n end\n end\n @size=@memloc\n puts \"total bytecode size: #{@memloc}\" if Rake.verbose\n puts \"memory map:\" if Rake.verbose == true\n @compiled_definitions.each do |d|\n puts \"@#{d.location}: #{d.definition.name} #{d.definition.primitive? ? 'prim' : '' }\"\n print d.code\n puts \";\" if d.code\n end if Rake.verbose == true\n print ISET.keys.map{ |name| [name,prim(name)] },\"\\n\" if Rake.verbose == true\n # need to actually generate the dictionary here, and do a second pass substituting all wrapped words\n calculate_dict_entries\n # replace all placeholders with dictionary offsets\n @compiled_definitions.each do |cdef|\n cdef.code.each_with_index do |w,i|\n case w\n when Array\n if w[0] == :dict_address\n puts \"replacing placeholder in '#{cdef.definition.name}'\" if Rake.verbose == true\n addr = @dict_positions[w[1]]\n raise \"cannot get address of word '#{w[1]}'\" unless addr\n cdef.code[i,cell_width]=int_bytes(addr,cell_width)\n elsif w[0] == :deferred\n # CAVEAT: this here works by looking up the definition by name! for\n # non-unique naming case, there must be a different way to get from the deferred definition to the actual definition\n puts \"replacing deffered definition in '#{cdef.definition.name}'\" if Rake.verbose == true\n actual_def = (@compiled_definitions.find{|cdef|\n # puts \"checking #{cdef.definition.name}(#{cdef.definition.object_id}) against #{w[1].name}(#{w[1].object_id})\"\n cdef.definition.name==w[1].name})\n raise \"no actual definition found for deferred definition\" unless actual_def\n cdef.code[i,2]=int_bytes(actual_def.location,2)\n else\n raise \"dunno what to do with #{w}\"\n end\n end\n end\n end\n check_locations\n @generated = true\n # @compiled_definitions.map{|d| d.code}.flatten\n end",
"def do_generate(save_registers, state, badchars)\n # Reset the state in case it was passed in.\n state.reset\n\n # Set the bad character list\n state.badchars = badchars if (badchars)\n\n # Consume any registers that should be saved.\n save_registers.each { |reg|\n state.consume_regnum(reg)\n } if (save_registers)\n\n # Build the linear list of blocks that will be processed. This\n # list is built in a dynamic fashion based on block dependencies.\n # The list that is returned is an Array of which each element is a two\n # member array, the first element being the LogicalBlock instance that\n # the permutation came from and the second being an instance of the\n # Permutation class associated with the selected permutation.\n block_list = generate_block_list(state)\n\n # Transition into the second phase which enables offset_of and regnum_of\n # calls to return real values.\n state.first_phase = false\n\n # Now that every block has been assigned an offset, generate the\n # buffer block by block, assigning registers as necessary.\n block_list.each { |b|\n\n # Generate the next permutation and append it to the buffer.\n begin\n state.buffer += b[1].to_s\n # If an invalid register exception is raised, try to consume a random\n # register from the register's associated architecture register\n # number set.\n rescue InvalidRegisterError => e\n e.reg.regnum = state.consume_regnum_from_set(e.reg.class.regnum_set)\n retry\n end\n\n # Remove any of the registers that have been clobbered by this block\n # from the list of consumed register numbers so that they can be used\n # in the future.\n b[0].each_clobbers { |reg|\n begin\n state.defecate_regnum(reg.regnum)\n\n reg.regnum = nil\n rescue InvalidRegisterError\n end\n }\n\n }\n\n # Finally, return the buffer that has been created.\n state.buffer\n end",
"def reproduction\n # Refill the population with children from the mating pool\n @population.each_index do |i|\n # Sping the wheel of fortune to pick two parents\n m = rand(@mating_pool.size).to_i\n d = rand(@mating_pool.size).to_i\n # Pick two parents\n mom = @mating_pool[m]\n dad = @mating_pool[d]\n # Get their genes\n momgenes = mom.dna\n dadgenes = dad.dna\n # Mate their genes\n child = momgenes.crossover(dadgenes)\n # Mutate their genes\n child.mutate(@mutation_rate)\n # Fill the new population with the new child\n location = Vec2D.new(width / 2, height + 20)\n @population[i] = Rocket.new(location, child)\n end\n @generations += 1\n end",
"def generateSequence \n\t\tsequenceArr = Array.new # new the length of parameters array and the 0 is used for record\n\t sequenceArr[0] = @maxparam\n\t \ttemparameterlen = @parameters.paramsArr.length \n \t\t#because the firsrameters.paramsArr[i].paramname\n \t\t#temparameter is the maxparameter so we just generate the rest parameters' sequence \n\t\t index = 1\n \t\twhile index < temparameterlen do\n \t\t\t#generate the randnum\n \t\t #\tchars = (0..temparameterlen-1).to_a\n #\ttemrandnum = chars[rand(chars.size)]\n \t\t temrandnum = randchar(0,temparameterlen-1)\n \t\t\tif temrandnum != @maxparam \t \n \t\t\t\tj = 1\n \t\t\t\tisexist = false\n \t\t\t\twhile j < index #check whether the temrandnum is already generated\n \t\t\t\t\tif sequenceArr[j]==temrandnum\n \t\t\t\t\t isexist = true\n break\n \t\t\t\t\tend \t\t\t\t\t\n \t\t\t\t\tj+=1\n \t\t\t\tend\n \t\t\t\tif !isexist \n \t\t\t\t\t sequenceArr[index] = temrandnum\n \t\t\t\t\t\tindex +=1 \t\t\t\t\t\n \t\t\t\tend\t\n \t\t\tend\n \t\tend\t\n\t\t return sequenceArr \n end",
"def create_mesh_cartisian_combos(optIndex) \n\n if ( optIndex == $gOptionList.count ) \n \n generated_file = gen_choice_file($gChoiceFileSet) \n \n $gGenChoiceFileList.push generated_file\n \n # Save the name of the archetype that matches this choice file for invoking \n # with substitute.h2k.\n \n # \"! Opt-Archetype\" - choice disabled because prm copies the h2k file into the run directory.\n $gArchetypeHash[generated_file] = $gChoiceFileSet[\"!Opt-Archetype\"] \n \n $gLocationHash[generated_file] = $gChoiceFileSet[\"Opt-Location\"] \n $gRulesetHash[generated_file] = $gChoiceFileSet[\"Opt-Ruleset\"] \n \n else \n \n case optIndex\n when -3 \n \n $gLocations.each do |location|\n \n $gChoiceFileSet[\"Opt-Location\"] = location \n \n create_mesh_cartisian_combos(optIndex+1) \n \n end \n \n when -2 \n \n $gArchetypes.each do |archentry|\n \n \n $Folder = $gArchetypeDir \n # Allow wildcards; expand list! \n \n $ArchetypeFiles = Dir[\"#{$Folder}/#{archentry}\"] \n \n $ArchetypeFiles.each do |h2kpath|\n \n $h2kfile = File.basename(h2kpath)\n \n $gChoiceFileSet[\"!Opt-Archetype\"] = $h2kfile \n \n create_mesh_cartisian_combos(optIndex+1) \n \n end \n \n end \n \n \n when -1 \n \n $gRulesets.each do |ruleset|\n \n $gChoiceFileSet[\"Opt-Ruleset\"] = ruleset \n \n create_mesh_cartisian_combos(optIndex+1) \n \n \n end #$gOptionList $gRulesets.each do |ruleset|\n \n \n else \n \n attribute = $gOptionList[optIndex]\n choices = $gRunUpgrades[attribute]\n \n choices.each do | choice | \n \n $gChoiceFileSet[attribute] = choice \n # Recursive call for next step in order. \n create_mesh_cartisian_combos(optIndex+1) \n end \n \n end \n \n end \n \nend",
"def generate(*args)\n @app.log << \"generate #{args.inspect[1..-2]}\"\n @app.generator(*args).generate\nend",
"def generate(out, indent)\n @statements.each {|s| s.generate(out, indent + 1)}\n end",
"def line_generate(length, word_collection, trans_table, prior_prob, bg_trans_table)\n\t\tresult = \"\"\n\t\tresult_arr = Array.new\n\t\tprev = \"\"\n\t\t\tbanned_words = ['of', 'and', 'or', 'for', 'the', 'a', 'to'];\n\n\t\tfor i in 1..length\n\t\t\tif i == 1 then\n\t\t\t\tword = select_word(\"\", prior_prob, bg_trans_table)\n\t\t\telse\n\t\t\t\tif !trans_table.key?(prev) then\n\t\t\t\t\tword = word_collection.to_a.sample\n\t\t\t\telse\n\t\t\t\t\tword = select_word(prev, trans_table[prev], bg_trans_table)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif word.nil? then\n\t\t\t\tbreak\n\t\t\tend\n\t\t\tif word == 'i' then word = 'I' end\n\t\t\tif prev.include?(\".\") then\n\t\t\t\tword = word.capitalize\n\t\t\tend\n\t\t\t#puts \"----------\"\n\t\t\t#puts i\n\t\t\t#puts \"-----------\"\n\t\t\t#puts word\n\t\t\tresult = result + \" \" + word.to_s\n\t\t\tresult_arr.push(word)\n\t\t\tprev = word\n\t\t\tnext\n\t\tend\n\n\t\tif banned_words.include?(prev.downcase) then\n\t\t\tresult.slice!(prev)\n\t\t\tif result_arr.length == 1 then\n\t\t\t\treturn line_generate(length, word_collection, trans_table, prior_prob, bg_trans_table)\n\t\t\tend\n\t\tend\n\n\t\treturn result\n\tend",
"def create_empty\n EadGenerator.generate_empty\n end",
"def santa_generator\r\n# Santa arrays\r\nsantas = []\r\nsanta_genders = [\"male\", \"female\", \"agender\", \"intersex\", \"N/A\", \"gender fluid\", \"bigender\", \"XXY\", \"XXX\", \"neuter\"]\r\nsanta_ethnicities = [\"Caucasian\", \"Latina\", \"Asian\", \"Unicorn\", \"N/A\", \"Black\", \"Middle-Eastern\", \"Native American\", \"Aboriginal\", \"Alien\"]\r\n\r\n#santa_genders.length.times do |i|\r\n#\tsantas << Santa.new(santa_genders[i], santa_genders[i])\r\n#end\r\n\r\ncount = 0\r\nwhile count < 100\r\n\tsantas << Santa.new(santa_genders[rand(10)], santa_ethnicities[rand(10)])\r\n\tcount += 1\r\nend\r\n\r\nsantas.each {|i|\r\n\ti.age = rand(141)\r\n\tputs \"Santa #{count} is #{i.gender}, #{i.ethnicity}, and #{i.age} years old.\"\r\n}\r\n\r\nend",
"def probe_ship_gen(probe_count, probe_array)\n text = \"\"\n probe_count.times.with_index do |v|\n temp = (\"a\"..\"zz\").to_a[v]\n text += \"var author_probe_#{temp} = new Ship({\n material: new THREE.SpriteMaterial({map: probe_texture, color: 0xffffff, fog: true}),\n dis_at_end: true,\n name: \\\"author_probe_#{temp}\\\"\n});\nscene.add(author_probe_#{temp}.spr);\nauthor_probe_#{temp}.spr.visible = false;\nprobes[probes.length] = author_probe_#{temp};\nauthor_probe_#{temp}.spr.scale.set(2,2,2);\\n\\n\"\n probe_array.push(\"author_probe_#{temp}\")\n end\n return text\nend",
"def pre_loop; end",
"def generate\n add_intro\n add_blood_pressure_intro\n add_blood_pressure_list\n add_blood_pressure_outro\n add_medications_intro\n add_medications_list\n add_about\n\n @pdf\n end",
"def generate( type, *args )\n puts \"==> generate >#{type}< - with #{args.size} part(s) #{args.inspect}\"\n\n character = @chars[ type ]\n\n img = nil ## (by default) auto-derive width x height dimension from first image\n\n character.each_with_index do |(part_key, part),i|\n num = args[i]\n\n ## todo/check - double check if part required set to false - why? why not?\n next if num == 0 ## note: skip part if index is 0!!!\n\n attributes = if part.is_a?( Hash )\n part[:attributes]\n else ## assume array - \"inline\" compact attribute format\n part\n end\n\n attribute = attributes[ num-1 ] ## note: num starts counting at 1 (sub 1 for zero-based array index)\n raise ArgumentError, \"no >#{part_key}< part found for index #{num}; sorry\" if attribute.nil?\n\n print \"#{i} #{part_key} => #{num}\"\n print \" - #{attribute[:name]}\" if attribute.is_a?( Hash ) && attribute.has_key?( :name )\n print \"\\n\"\n\n\n img_part = if attribute.is_a?( Integer ) ## assume filename with num (as .png)\n path = \"#{@rootdir}/#{type}/#{part_key}/#{part_key}#{num}.png\"\n img_part = Image.read( path )\n elsif attribute.is_a?( Hash )\n if attribute.has_key?( :design )\n path = \"#{@rootdir}/#{attribute[:design]}.txt\"\n txt = File.open( path, 'r:utf-8') {|f| f.read }\n img_part = Image.parse( txt, colors: attribute[:colors] )\n else ## assume for now has key :path\n path = \"#{@rootdir}/#{attribute[:path]}.png\"\n img_part = Image.read( path )\n end\n else\n puts \"!! ERROR:\"\n pp part\n raise ArgumentError, \"unknown part data type; expected Integer|Hash\"\n end\n ## note: if (very) first part - auto-create empty image with size/dimensions from part\n img = Image.new( img_part.width, img_part.height ) if i==0\n img.compose!( img_part )\n end\n\n img\nend",
"def computermove_gen\n\t\t@comp_position\n\n\t\t@compmove = @possiblemoves.sample \n\t\n\n \tend",
"def generate_tables\n create_characters\n create_kiosks\n create_traps\n create_buttons\n end"
] | [
"0.71253425",
"0.71253425",
"0.6752383",
"0.6721537",
"0.6599887",
"0.646767",
"0.63345635",
"0.6245772",
"0.61636496",
"0.61009806",
"0.60397184",
"0.60297495",
"0.6022243",
"0.6008249",
"0.600814",
"0.5975753",
"0.5955988",
"0.59552217",
"0.59434843",
"0.5936511",
"0.5904448",
"0.589483",
"0.58534956",
"0.58076775",
"0.57885754",
"0.57831764",
"0.5775918",
"0.5743204",
"0.5743204",
"0.57407224",
"0.57407224",
"0.5736127",
"0.57349753",
"0.57271695",
"0.57052964",
"0.56719476",
"0.5656851",
"0.56280905",
"0.55988896",
"0.55712146",
"0.55494404",
"0.55334437",
"0.55217755",
"0.5510963",
"0.55103767",
"0.5502789",
"0.5490939",
"0.5490389",
"0.5464596",
"0.54642206",
"0.5457279",
"0.5455669",
"0.5440071",
"0.5437361",
"0.5425788",
"0.5385808",
"0.5381207",
"0.53754604",
"0.53610027",
"0.53610027",
"0.53551304",
"0.5350914",
"0.53463364",
"0.53293675",
"0.53293675",
"0.53279114",
"0.5316352",
"0.53038347",
"0.53038347",
"0.52934676",
"0.52923423",
"0.52849984",
"0.5282297",
"0.525777",
"0.5256943",
"0.5253403",
"0.5247844",
"0.5246675",
"0.5244306",
"0.52411747",
"0.52411747",
"0.52411747",
"0.5240427",
"0.5234125",
"0.52268964",
"0.5222827",
"0.52169526",
"0.52162075",
"0.52136487",
"0.5213271",
"0.52070934",
"0.5204282",
"0.5202667",
"0.52007204",
"0.52000475",
"0.51979655",
"0.51947105",
"0.5193207",
"0.51914555",
"0.5190933",
"0.51904273"
] | 0.0 | -1 |
Word disambiguation begins by evaluating word1. In some cases that's all that's needed. If word2 is consided relevant word2 is evaluated as well. Right now, for commands like "look" word2 could be anything so look around is functionally the same as look. The various cmd arrays contain all valid synonymns for a given command. This way new synonymns can be added with minimal effort. Currently word2 evaluations happen within the elsif structure of evaluating word1 it may be worth reworking this in future. Word1_disambig > word2_disambig. However, this hasn't been done now as generally evaluations of word2 branch off based on word1. That is to say dump pot has a word2 value of pot but we can only evaluate it within the context of drop_cmds. At present its more orderly to have everything in one place. In future calling seperate methods such as drop_cmds_disambig might be a way of branching with maintaining readability. | def word_disambig(word1, word2, word3, word4, word5)
go_cmds = ["go", "walk", "run", "move", "travel", "skip", "g", "m"]
fast_move_cmds = ["n", "s", "e", "w"]
look_cmds = ["look", "see", "l"]
get_cmds = ["grab", "get", "take"]
drop_cmds = ["drop", "leave", "dump"]
status_cmds = ["status", "s", "health", "hp", "xp", "check", "level"]
inv_cmds = ["inv", "i", "inventory", "loot", "stuff", "gear"]
quit_cmds = ["q", "quit", "exit", "end"]
use_cmds = ["use"]
attack_cmds = ["attack", "hit"]
@all_cmds << go_cmds
@all_cmds << (look_cmds + get_cmds + drop_cmds)
if go_cmds.include?(word1)
if $hero.location.monsters.size != 0
puts 'Your enemies are blocking the exit'
else
move_disambig(word2)
looking
end
elsif word1 == 'help'
puts 'some commands:
go [direction]
get [thing]
get [type] [thing] Example: get ! scroll
use [type] [thing] Example: use orange bottle
inv - display inventory
attack [type]
drop [thing]
look - gives information about the room/what you can see
status - displays information about your hp etc.
q - quits the game'
# Some developer commands commented out in case they are needed again later
#elsif word1 == "ah"
# $hero.heal(30)
#elsif word1 == "gen"
# $hero.location.item_gen
#elsif word1 == "boom"
# def boom
# $hero.location.monsters.each do |mob|
# mob.wound(10)
# dead = mob.defeated?
# if dead == true
# $hero.location.monsters.delete_at($hero.location.monsters.index(mob))
# end
# end
# end
# boom
# boom
# boom
#elsif word1 == 'god'
# $hero.hp = 100
elsif fast_move_cmds.include?(word1)
move_disambig(word1)
looking
elsif look_cmds.include?(word1)
looking
elsif get_cmds.include?(word1)
getting
elsif drop_cmds.include?(word1)
dropping
elsif status_cmds.include?(word1)
$hero.status_check
elsif inv_cmds.include?(word1)
$hero.inv_check
elsif quit_cmds.include?(word1)
puts "Thanks for playing!"
exit
elsif use_cmds.include?(word1)
using
elsif attack_cmds.include?(word1)
attacking
else
puts "I do not recognize that command. Please try again."
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def looper(word1, word2)\n\t\tputs word1\n\t\t@word1 = word1.split(\"\") \n\t\t@word2 = word2.split(\"\")\n\n\t\tuntil @word1 == @word2 do \n\n\t\t\[email protected]_with_index do |let, index|\n\t\t\t\tif let == @word2[index]\n\t\t\t\telse \n\t\t\t\t\ttemp = @word1.clone\n\t\t\t\t\ttemp[index] = @word2[index]\n\t\t\t\t\ttemp = temp.join(\"\")\n\t\t\t\t\tif @dictionary.exists?(temp) \n\t\t\t\t\t\tputs temp\n\t\t\t\t\t\ttemp = temp.split(\"\")\n\t\t\t\t\t\t@word1=temp\n\t\t\t\t\tend\n\t\t\t\tend \n\t\t\tend\n\t\tend\n\tend",
"def adv\n @words1 = Word.all.sample(1)[0].word\n @words2 = Word.all.sample(1)[0].word\n end",
"def correct(word)\n if @dictionary.has_key?(word)\n return [word]\n end\n \n dist1_replacements = known(edits1(word))\n if dist1_replacements.length != 0\n \treturn dist1_replacements.sort_by{|value| @dictionary[value]}.reverse\n end\n \n dist2_replacements = known_edits2(word)\n if dist2_replacements.length != 0\n \treturn dist2_replacements.sort_by{|value| @dictionary[value]}.reverse\n end\n return nil\n end",
"def known_edits2 (word)\n # get every possible distance - 2 edit of the input word. Return those that are in the dictionary.\n words1 = edits1(word)\n words2 = []\n words1.each do |w|\n words2.concat(edits1(w))\n end\n return known(words2.uniq)\n end",
"def known_edits2 (word)\n dist2 = []\n edits1(word).each do |s|\n dist2 += edits1(s)\n end\n return known(dist2.to_set.to_a)\n end",
"def check_for_definitions\n @words.each do |word|\n @lemma ? lemma = \" - #{@lemmas[word]}\" : lemma = \"\"\n\n # Strip characters - mimics trimWordLowerCase in texts.js\n regex = /[\\u200B-\\u200D\\uFEFF\\u00A0]/\n word.gsub!(regex, \"\")\n regex = /^[.,!¡?¿:;\\/|\\\\'\"“”‘’‚„«»‹›()\\[\\]\\-_]+|[.,!¡?¿:;\\/|\\\\'\"“”‘’‚„«»‹›()\\[\\]\\-_]+$/\n word.gsub!(regex, \"\")\n \n next if word.length == 0\n \n # Convert to lowercase\n word = word.mb_chars.downcase.to_s\n current_word = word\n \n while word.length > 0 do\n if Match.find_by_word_and_text_id(word, @text)\n break\n else\n if word.length == 1\n @missing.push(\"#{current_word}#{lemma}\")\n break\n else\n if word.last == \"*\"\n word.chomp!(\"*\") # Remove wildcard character, if present\n word = word[0..-2] # Remove last character\n end\n word << \"*\" # Add wildcard character\n end\n end\n end\n end\n end",
"def correct word\n known [word] or known(variation_words word) or [word]\n end",
"def correct(word)\n if (known([word]).count>0)\n return known([word])\n elsif (known(edits1(word)).count>0)\n return known(edits1(word))\n elsif (known_edits2(word).count>0)\n return known_edits2(word)\n else\n return nil\n end\n\n end",
"def unite_words\n _, a_rest, a_word = %r{^(.* )?(\\w+)$}.match(a.text).to_a # a ends with word character\n _, b_word, b_rest = %r{^(\\w+\\s*)(.* )?$}.match(b.text).to_a # b starts with word character\n\n if a_word && b_word\n if a_word.length > b_word.length\n shift_backward(b_word)\n else\n shift_forward(a_word)\n end\n end\n end",
"def synonym(existing_word, *synonyms)\n existing_word = existing_word.to_s\n raise \"'#{existing_word}' is not in the vocabulary\" if type(existing_word).nil?\n reduced_form = reduce(existing_word)\n [synonyms].flatten.each do |syn|\n syn = syn.to_s\n existing_definition = @type_map[syn]\n if existing_definition.nil?\n @type_map[syn] = reduced_form\n elsif existing_definition != reduced_form\n raise \"'#{syn}' is already defined and is incompatible as a synonym of #{existing_word}\"\n end\n end\n end",
"def corrections\n #For each word to be looked at\n $words.each do |word_array|\n #If the word is misspelled attempt corrections\n possible_matches = Array.new\n if word_array[1] == false\n #Sets word to the actual word, instead of array pair\n word = word_array[0]\n # Get lexicon searching vars\n first_char = word[0]\n len = word.length\n\n ##Find words with similar letters\n #Saves the length of the word for eaiser access\n size = word.length\n #Iterates over words with matching starting letter and length +- 1\n $lexicon[first_char][len].each do |word_compare|\n possible_matches << word_compare[0]\n end\n\n # only check shorter words if length is greater than 1\n if len > 1\n $lexicon[first_char][len-1].each do |word_compare|\n possible_matches << word_compare[0]\n end\n end\n\n $lexicon[first_char][len+1].each do |word_compare|\n possible_matches << word_compare[0]\n end\n\n #Iterate over the possible matches, taking the match with the highest percentage\n #Hash to hold similarity\n similarity = Hash.new(0.0)\n possible_matches.each do |word_to_compare|\n similarity[word_to_compare] = match_percentage word, word_to_compare\n end\n\n best_match = ''\n similarity.each do |match|\n if match[1] > similarity[best_match]\n best_match = match[0]\n end\n end\n $correction[word] = best_match\n end\n end\nend",
"def words(message, command = nil)\n reply = at_nick.downcase\n command = command.downcase if command\n message.split.reject {|word| word.downcase == reply || word.downcase == command }\n end",
"def lookup_specific(words)\n words = @delimiter_handler.split_path(words.first) if words.size == 1\n load_for_prefix(words)\n tool = @mutex.synchronize { get_tool_data(words, false)&.cur_definition }\n finish_definitions_in_tree(words) if tool\n tool\n end",
"def wordplay(string1, string2)\n str1_hash = {}\n str2_hash = {}\n position_hash = {}\n\n # save string1 into an hash\n string1.split('').each do |ch|\n if str1_hash[ch]\n str1_hash[ch] += 1\n else\n str1_hash[ch] = 1\n end\n end\n\n # save string2 into an hash\n string2.split('').each do |ch|\n if str2_hash[ch]\n str2_hash[ch] += 1\n else\n str2_hash[ch] = 1\n end\n end\n\n # check if each character of string2 can be found in string1\n # and if there are enough characters to make string2\n str2_hash.each do |key, value|\n if !str1_hash.key?(key)\n return false\n elsif str1_hash[key] < value\n return false\n end\n end\n\n # save the position of the characters found in string1\n # i = 0\n # while i < string1.length\n # position_hash[string1[i]] = i unless position_hash[string1[i]]\n # i += 1\n # end\n i = 0\n while i < string1.length\n if !position_hash.key?(string1[i])\n position_hash[string1[i]] = i\n end\n i += 1\n end\n\n # save the indices needed to create string2\n i = 0\n str2_arr = []\n while i < string2.length\n str2_arr << position_hash[string2[i]]\n i += 1\n end\n\n str2_arr\nend",
"def move_disambig(direction)\n\t\t\t@north_cmds = [\"n\", \"up\", \"north\"]\n\t\t\t@east_cmds = [\"e\", \"right\", \"east\"]\n\t\t\t@west_cmds = [\"w\", \"left\", \"west\"]\n\t\t\t@south_cmds = [\"s\", \"down\", \"south\"]\n\n\t\t\t\t\txy = $hero.location.xy.split(\", \")\n\t\t\t\t\tx = xy[0].to_i\n\t\t\t\t\ty = xy[1].to_i\n\t\t\t\tif @north_cmds.include?(direction)\n\t\t\t\t\tif $hero.location.exits.include?(\"north\")\n\t\t\t\t\t\tcheck_room(\"north\", x, (y + 1))\n\t\t\t\t\t\tmove(\"north\")\n\t\t\t\t\telse\n\t\t\t\t\t\tputs \"There is no exit to the north!\"\n\t\t\t\t\tend\n\t\t\t\telsif @east_cmds.include?(direction)\n\t\t\t\t\tif $hero.location.exits.include?(\"east\")\n\t\t\t\t\t\tcheck_room(\"east\", (x + 1), y)\n\t\t\t\t\t\tmove(\"east\")\n\t\t\t\t\telse\n\t\t\t\t\t\tputs \"There is no exit to the east!\"\n\t\t\t\t\tend\n\t\t\t\telsif @west_cmds.include?(direction)\n\t\t\t\t\tif $hero.location.exits.include?(\"west\")\n\t\t\t\t\t\tcheck_room(\"west\", (x - 1), y)\n\t\t\t\t\t\tmove(\"west\")\n\t\t\t\t\telse\n\t\t\t\t\t\tputs \"There is no exit to the west!\"\n\t\t\t\t\tend\n\t\t\t\telsif @south_cmds.include?(direction)\n\t\t\t\t\tif $hero.location.exits.include?(\"south\")\n\t\t\t\t\t\tcheck_room(\"south\", x, (y - 1))\n\t\t\t\t\t\tmove(\"south\")\n\t\t\t\t\telse \n\t\t\t\t\t\tputs \"There is no exit to the south!\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\tend",
"def shortest(word1, word2)\n word1_indices = @hash[word1]\n word2_indices = @hash[word2]\n\n dis = @size\n i, j = 0, 0\n while word1_indices[i] && word2_indices[j]\n dis = [dis, (word1_indices[i] - word2_indices[j]).abs].min\n if word1_indices[i] < word2_indices[j]\n i += 1\n else\n j += 1\n end\n end\n\n return dis\n end",
"def disambiguate_san(possibilities)\n if move.disambiguation\n possibilities.select { |p| board.position_for(p).match(move.disambiguation) }\n else\n possibilities\nend\n end",
"def pair_words(word1, word2, options = { context: [] })\n\n # Loop through all nouns in context array (if any)\n # and add a normal pair by default as well\n i = -1\n\n # First word shouldn't have a trailing special char (remember, it's the PAIR that has a suffix, not each word!)\n word1 = word1.gsub(/([^a-zA-Z'\\/\\s\\d-]+)/,'')\n\n question_mark = 0\n comma = 0\n period = 0\n exclamation_mark = 0\n\n # Check our second word for special characters, increment our values in the database, and strip them away\n # Only check these if we know there's a special character\n # in our string!\n if word2 =~ /\\W$/\n\n # First check if its a question\n if word2 =~ /.+(\\?)/\n question_mark = 1\n puts \"Updated #{word2} with +1 questionmark suffix\"\n # if not, check if there's an exclamationmark\n elsif word2 =~ /.+(!)/\n exclamation_mark = 1\n puts \"Updated #{word2} with +1 exclamation suffix\"\n # no semicolon? Check for a dot!\n elsif word2 =~ /.+(\\.)/\n period = 1\n puts \"Updated #{word2} with +1 period suffix\"\n # Final try, check for a comma (most common)\n elsif word2 =~ /.+([;|,])/\n comma = 1\n puts \"Updated #{word2} with +1 comma suffix\"\n end\n if word2 !~ /https?:\\/\\/[\\S]+/ and word2 =~ /\\W/\n word2 = word2.gsub(/([^a-zA-Z'\\/\\s\\d-]+)/,'')\n end\n end\n\n if word2 !~ /https?:\\/\\/[\\S]+/ and word2 =~ /\\W/\n word2 = word2.gsub(/([^a-zA-Z'\\/\\s\\d-]+)/,'')\n end\n\n # The first thing we need to do is add our words if they dont exist:\n get_pair_data = \"SELECT * FROM pairs WHERE word_id = (SELECT id FROM words WHERE word = ?) AND pair_id = (SELECT id FROM words WHERE word = ?) LIMIT 1;\"\n\n # Add our words if they dont exist, using our prepared statement\n @add_words.execute(word1)\n @add_words.execute(word2)\n\n puts \"I have %s contexts to iterate through after adding vanilla pair of #{word1} and #{word2}\" % options[:context].count\n\n begin\n puts \"ITERATION #{i}\"\n # First thing we need to do is insert our pair if it doesnt exist, without context, and update it if it already exists (+1 on comma/questionmark/etc if one is included)\n if i < 0\n\n # Get previous data for this pair\n r = @db.get_first_row(get_pair_data,word1,word2)\n\n unless r == nil\n comma += r['comma_suffix'].to_i\n period += r['period_suffix'].to_i\n question_mark += r['question_suffix'].to_i\n exclamation_mark += r['exclamation_suffix'].to_i\n occurance = r['occurance'].to_i\n occurance += 1\n end\n\n @add_pair.execute(word1,word2,word1,word2,occurance,comma,period,question_mark,exclamation_mark)\n\n # Afterwards, we need to add each context noun to our noun table, and link it to the created pair\n else\n @add_context.execute(options[:context][i],word1,word2,options[:context][i],word1,word2)\n end\n\n i += 1\n end while i < options[:context].count\n\n end",
"def shortest(word1, word2)\n \n end",
"def resolve_word(name)\n @vm.log(:verbose, \"resolve_word(#{name})\")\n nm = canonical(name)\n if @dict[nm].nil?\n need(nm, true)\n resolve_references do |token|\n @vm.log(:verbose, \" compiling resolved token #{token}\")\n compile_word(@dict[token])\n end\n end\n nm\n end",
"def infer_word_pins word, context_pin, locals\n return [] if word.empty?\n return infer_self(context_pin) if word == 'self'\n lvars = locals.select{|pin| pin.name == word}\n return resolve_word_types(lvars, locals) unless lvars.empty?\n return api_map.get_global_variable_pins.select{|pin| pin.name == word} if word.start_with?('$')\n namespace, scope = extract_namespace_and_scope_from_pin(context_pin)\n return api_map.get_class_variable_pins(namespace).select{|pin| pin.name == word} if word.start_with?('@@')\n return api_map.get_instance_variable_pins(namespace, scope).select{|pin| pin.name == word} if word.start_with?('@')\n return api_map.pins.select{|pin| word_matches_context?(word, namespace, scope, pin)} if variable_name?(word)\n result = []\n cparts = namespace.split('::')\n until cparts.empty?\n break unless result.empty?\n cur = cparts.join('::')\n result.concat api_map.get_path_suggestions(\"#{cur}::#{word}\")\n cparts.pop\n end\n result.concat api_map.get_path_suggestions(word) if result.empty?\n # result.concat api_map.get_methods(namespace, scope: scope, visibility: [:public, :private, :protected]).select{|pin| pin.name == word} unless word.include?('::')\n result.concat api_map.get_method_stack(namespace, word, scope: scope) unless word.include?('::')\n result.concat api_map.get_constants('', namespace).select{|pin| pin.name == word} if result.empty?\n resolve_word_types(result, locals)\n end",
"def short_long_short(word1, word2)\n\n\tlongest = word1.size <=> word2.size\n\n\tif longest == 1\n\t\t\"#{word2}#{word1}#{word2}\"\n\t\telsif longest == -1\n\t\t\"#{word1}#{word2}#{word1}\"\n\tend\t\nend",
"def find_chain(word1, word2)\n\t\t word1_array = split_word(word1)\n\t\t word2_array = split_word(word2)\n\n\t\t \tindex = 0\n\n\t\t\t word1_array.cycle { |letter|\n\t\t\t \tletter_copy = word1[index]\n\t\t\t \t#p index\n\t\t\t \tword1[index] = word2[index]\n\t\t\t \tp word1\n\t\t\t \tif @dictionary.exists?(word1)\n\t\t\t \t\tp \"exists\"\n\t\t\t \t\tif word1 == word2\n\t\t\t \t\t\tputs \"MATCH\"\n\t\t\t \t\t\tbreak;\n\t\t\t \t\tend\n\t\t\t\telse\n\t\t\t\t\tp \"does NOT exist\"\n\t\t\t\t\tword1[index] = letter_copy\n\t\t\t \tend\n\t\t\t \tp index\n\t\t\t if index >= word1_array.length-1\n\t\t\t \tindex = 0\n\t\t\t else\n\t\t\t \tindex += 1\n\t\t\t end\n\n\t\t\t }\n end",
"def known_edits2 (word)\n # get every possible distance - 2 edit of the input word. Return those that are in the dictionary.\n end",
"def transform_word(dictionary, word1, word2)\n path = []\n\n edges = graphify_dictionary(dictionary)\n\n exhausted_words = []\n\n # entries in the priority queue are of the form: {word: 'cat', distance: 0, previous_word: <word>}\n priority_queue = [nil]\n priority_queue << {word: word1, distance: 0, previous_word: nil}\n\n until priority_queue.length == 1\n current_word_info = extract_from_p_queue(priority_queue)\n current_word = current_word_info[:word]\n current_distance = current_word_info[:distance]\n\n adjacent_words = edges[current_word]\n\n for k in (0...adjacent_words.length) do\n if adjacent_words[k] == word2\n path.unshift(current_word, word2)\n previous_word = current_word_info[:previous_word]\n\n while previous_word\n path.unshift(previous_word)\n previous_word = exhausted_words.find{|word_info| word_info[:word] == previous_word}[:previous_word]\n end\n\n return path\n end\n\n if exhausted_words.map{|word_info| word_info[:word]}.include?(adjacent_words[k])\n next\n end\n\n if priority_queue[1..-1].map{|word_info| word_info[:word]}.include?(adjacent_words[k])\n adjacent_word_info = priority_queue[1..-1].find {|word_info| word_info[:word] = adjacent_words[k]}\n\n if adjacent_word_info[:distance] > current_distance + 1\n adjacent_word_index = priority_queue.index(adjacent_word_info)\n priority_queue[adjacent_word_index] = {word: adjacent_word_info[:word], distance: current_distance + 1, previous_word: current_word}\n percolate_up_by_distance(priority_queue, adjacent_word_index)\n end\n else\n insert_into_p_queue(priority_queue, {word: adjacent_words[k], distance: current_distance + 1, previous_word: current_word})\n end\n end\n\n exhausted_words << current_word_info\n end\n\n path\nend",
"def second_anagram?(word1, word2)\n w1_copy = word1.dup\n w2_copy = word2.dup\n w1_copy.each_char do |ch1|\n w2_copy.each_char do |ch2|\n if ch1 == ch2\n w1_copy[w1_copy.index(ch1)] = \"\"\n w2_copy[w2_copy.index(ch2)] = \"\"\n end\n end\n end\n w1_copy.empty? && w2_copy.empty?\nend",
"def min_distance(word1, word2)\n dp = Array.new(word1.size + 1) { Array.new(word2.size + 1) }\n \n for i in 0...dp.size\n dp[i][0] = i \n end\n for j in 0...dp[0].size\n dp[0][j] = j\n end\n \n for i in 1...dp.size\n for j in 1...dp[0].size\n if word1[i - 1] == word2[j - 1]\n dp[i][j] = dp[i-1][j-1]\n else\n dp[i][j] = [\n dp[i - 1][j],\n dp[i][j - 1],\n dp[i - 1][j - 1],\n ].min + 1\n end\n end\n end\n \n dp[-1][-1]\nend",
"def play_rules_orig\n <<~'HOWTOPLAY'\n The word to guess is represented by a row of dashes,\n representing each letter of the word.\n In most variants, proper nouns, such as names, places, and brands,\n are not allowed.\n Slang words, sometimes referred to as informal or shortened words,\n are also not allowed.\n If the guessing player suggests a letter which occurs in the word,\n the other player writes it in all its correct positions.\n If the suggested letter does not occur in the word,\n the other player draws one element of a hanged man stick figure\n as a tally mark.\n\n The player guessing the word may, at any time, attempt to guess\n the whole word.\n If the word is correct, the game is over and the guesser wins.\n Otherwise, the other player may choose to penalize the guesser by\n adding an element to the diagram.\n On the other hand, if the other player makes enough incorrect guesses\n to allow his opponent to complete the diagram, the game is also over,\n this time with the guesser losing.\n However, the guesser can also win by guessing all the letters that\n appear in the word, thereby completing the word, before the diagram\n is completed.\n HOWTOPLAY\n end",
"def checking_dictionary_for_word_match\n @prefix = @str[@i_last_real_word...@i]\n \n if valid_word?(@prefix)\n if @skip_counter > 0\n @skip_counter -= 1\n else\n @words[i] = @prefix\n @i_last_real_word = @i\n end\n end\n end",
"def min_distance(word1, word2)\n edit = Array.new(word1.size + 1) {\n Array.new(word2.size + 1)\n }\n \n (0..word1.size).each { |i|\n edit[i][0] = i\n }\n\n (0..word2.size).each { |i|\n edit[0][i] = i\n }\n\n (1..word1.size).each { |i|\n (1..word2.size).each { |j|\n if word1[i - 1] == word2[j - 1]\n edit[i][j] = edit[i - 1][j - 1]\n else\n edit[i][j] = 1 + [edit[i - 1][j] || 0, edit[i][j - 1] || 0, edit[i - 1][j - 1] || 0].min\n end\n }\n }\n\n edit[word1.size][word2.size]\nend",
"def shortest(word1, word2)\n ans = @M\n for i in @d[word1]\n for j in @d[word2]\n ans = [ans, (i-j).abs].min\n end\n end\n return ans\n end",
"def moves(words)\n # words is an array of words/letters on the board e.g. [\"RATE\",\"ENCOUNTERED\",\"T\"]\n # Returns all possible moves\n words = words.collect{|word|word.upcase}\n\n moves = _moves([],words)\n\n # Apply the no-substring rule\n moves.delete_if do |move|\n reject = false\n move[1].each do |from_word|\n if ((from_word.size > 1) && (move[0].index(from_word) != nil)) then\n reject = true\n end\n end\n reject\n end\n\n return moves\n end",
"def mispelled_words\n Spellchecker.check(@text, LANG).reject do |word|\n word[:correct]\n end\n end",
"def spell_check\n #Temp has to get around iterating blocking hash editing\n temp_hash = Hash.new\n #For each word hash pair\n $words.each do |word|\n #Sets values for lexicon reading\n first_char = word[0][0]\n len = word[0].length\n\n #Searches lexicon for match, default is false\n match = false\n #For each word in the lexicon with the same first and second characters checks for equality\n $lexicon[first_char][len].each do |check|\n #If the words are the same sets spelling to true, or correct and breaks out of loop\n if check[0] == word[0]\n match = true\n break;\n end\n end\n #Sets temp hash to proper values, to be reassigned to word hash after full iterations\n temp_hash[word[0]] = match\n end\n #Sets words hash with proper values\n temp_hash.each do |temp|\n $words[temp[0]] = temp[1]\n end\nend",
"def dedupe(words)\n words.select do |word|\n word.downcase != @word.downcase \n end\n end",
"def suggest(word, leave_erroneous=false)\n res = spellcheck(word).at(0)\n return word unless res\n case res.type\n when :ok\n return word\n when :miss, :guess\n return res.guesses.at(0)\n when :none\n return leave_erroneous ? word : ''\n else\n return ''\n end\n end",
"def determine_word_of_god(god_data)\n\tcase god_data\n\twhen 1\n\t\t:yes\n\twhen 2\n\t\t:no\n\telse\n\t\t:unknown\n\tend\nend",
"def char_check(word_1, word_2, template_length)\n matches = [] # array for containing matching characters from word_2 ('char')\n $iterator = 0\n # Character loop\n word_1.each do |char_1|\n sample = char_1\n word_2.each do |char_2|\n if (sample == char_2)\n matches.push(char_2)\n word_2.delete_at($iterator)\n $iterator += 1\n else\n $iterator += 1\n end\n end\n end\n # Check that the number of matches implies an anagram\n matches.length == template_length ? true : false\nend",
"def second_anagram?(word1, word2)\n return false if word1.length != word2.length\n word1.chars.each do |char1|\n word2.chars.each do |char2|\n if char1 == char2\n word1 = delete_char(word1, char1)\n word2 = delete_char(word2, char1)\n end\n end\n end\n\n word1.empty? && word2.empty?\nend",
"def spell(syllables)\n return syllables if self.noortho\n s = syllables.chars\n word = ''\n s.each do |syllable|\n if self.cortho[syllable]\n word << self.cortho[syllable]\n elsif self.vortho[syllable]\n word << self.vortho[syllable]\n elsif Glossa::DEFAULT_ORTHO[syllable]\n word << Glossa::DEFAULT_ORTHO[syllable]\n else\n word << syllable\n end\n end\n word\n end",
"def boardSolver2(index1, index2, prefix1)\n @possible_directions.each do |x,y|\n #making sure that the movement doesn't take you off the board\n if (0..3) === (x + index1) && (0..3) === (y + index2) \n prefix = prefix1 + @board[x + index1][y + index2]\n if find_prefix(prefix) == true\n @prefix[prefix] = \"#{x + index1}-#{y + index2}\"\n end\n end \n end\n prefixArray = []\n indexes = []\n @prefix.each do |pre, index|\n indexes << index\n prefixArray << pre\n end\n\n i = 0\n while i < prefixArray.length\n index = indexes[i].split(\"-\")\n if is_word(prefixArray[i]) == true\n @words << prefixArray[i]\n end\n @prefix = {}\n #if there were prefixes that can become words, it will continue going\n boardSolver2(index[0].to_i, index[1].to_i, prefixArray[i])\n i += 1\n end\nend",
"def test_compare_string_overlap_defs\n v1 = Vertex.new(\"speech\", 2, 1, 0, 0, 1, \"NN\")\n v2 = Vertex.new(\"delivering\", 2, 1, 0, 0, 1, \"VB\")\n assert_equal(1, instance.compare_strings(v1, v2, speller))#no POS is considered for hypernyms and hyponyms\n end",
"def test_mixed_pronouns\n assert_equal(\"you gave me life\",\n WordPlay.switch_pronouns(\"i gave you life\"))\n\n assert_equal(\"i am not what you are\",\n WordPlay.switch_pronouns(\"you are not what i am\"))\n end",
"def match(words)\n words.select {|word| word.split(\"\").sort == @word.split(\"\").sort}\n end",
"def words\n @words ||= (\n word_suggestions = []\n spellcheck = self.response[:spellcheck]\n if spellcheck && spellcheck[:suggestions]\n suggestions = spellcheck[:suggestions]\n unless suggestions.nil?\n # suggestions is an array: \n # (query term)\n # (hash of term info and term suggestion) \n # ...\n # (query term)\n # (hash of term info and term suggestion) \n # 'correctlySpelled'\n # true/false\n # collation\n # (suggestion for collation)\n i_stop = suggestions.index(\"correctlySpelled\")\n # step through array in 2s to get info for each term\n 0.step(i_stop-1, 2) do |i| \n term = suggestions[i]\n term_info = suggestions[i+1]\n # term_info is a hash:\n # numFound =>\n # startOffset =>\n # endOffset =>\n # origFreq =>\n # suggestion => { frequency =>, word => }\n origFreq = term_info['origFreq']\n suggFreq = term_info['suggestion']['frequency'] \n word_suggestions << term_info['suggestion']['word'] if suggFreq > origFreq\n end\n end\n end\n word_suggestions.uniq\n )\n end",
"def synonyms\n @synonyms ||= {\n /^awesome$/i => %w[great excellent cool awesome splendid],\n /^okay$/i => %w[okay great alright],\n /^hello$/i => %w[hello hi greetings],\n /^yes$/i => %w[yes affirmative definitely correct certainly],\n /^no$/i => %w[no negative incorrect false],\n /^update$/i => %w[update change modify revise alter edit adjust],\n /^updated$/i => %w[updated changed modified revised altered edited adjusted],\n /^add$/i => %w[add create],\n /^added$/i => %w[added created],\n /^what|how$/i => %w[how what]\n }\n end",
"def mutation?(base_word, mutation)\n\n word1_array = base_word.downcase.split(\"\")\n word2_array = mutation.downcase.split(\"\")\n\n word2_array.each do |letter|\n if word1_array.include?(letter)\n @result = true\n else\n @result = false\n end \n end\n @result\nend",
"def mutation(array)\n p first_word = array[0].downcase.chars.sort.join(\" \")\n p second_word = array[1].downcase.chars.sort.join(\" \")\n p first_word.include?(second_word) ? true: false\nend",
"def align_all_words\n 0.upto(word_list.length-1) do |i|\n 0.upto(i-1) do |j|\n w1 = self[i]\n w2 = self[j]\n if (w1.meaning & w2.meaning).empty?\n LOGGER.debug(\"Skipping alignment for\\n\" +\n \"#{w1}\\n#{w2}\\nbecause they share no meaning\")\n next\n end\n @alignment_table.add(Alignment.new(w1, w2), i, j)\n end\n end\n end",
"def save_unmatched_words # :nodoc:\n tokens = phrase_without_matches.split(' ')\n unmatched_db = Corpus.new(\"unmatched-#{program_name}.db\")\n tokens.each do |token|\n if !complex_token_matches?(token) # token was not transformed earlier\n @to_match << token\n unmatched_db[token] = @processor.original_text\n end\n end\n unmatched_db.close\n end",
"def better_ana?(word1, word2)\n word1.each_char do |char|\n j = word2.index(char)\n \n return false if j == nil\n word2.delete!(word2[j])\n end\n return word2.empty?\nend",
"def tag_alias_for_word_pattern(query)\n query = Tag.parse_query(query)\n aliases = consequent_aliases.sort_by { |ca| [ca.antecedent_name.size, ca.antecedent_name] }\n\n aliases.find do |tag_alias|\n name_matches = Tag.includes_all_words?(name, query)\n antecedent_matches = Tag.includes_all_words?(tag_alias.antecedent_name, query)\n\n antecedent_matches && !name_matches\n end\n end",
"def variation_words word\n ( deletions(word) + transpositions(word) + replacements(word) + insertions(word) ).uniq\n end",
"def check(words:)\n dictionary = Set.new([\"hello\", \"my\", \"name\", \"is\", \"orange\"])\n corrected = []\n words.each do | word |\n dictionary.include?(word) ? corrected.push(word) : corrected.push(\"~#{word}~\")\n end\n corrected\nend",
"def find_concatenated(word)\n [].tap { |a| probe_words(0, word, a) }\n end",
"def min_distance(word1, word2)\n dp = Array.new(word1.size + 1) { Array.new(word2.size + 1) }\n\n # increment values in 1st row and col\n (0...dp.size).each do |i|\n dp[i][0] = i\n end\n (0...dp[0].size).each do |j|\n dp[0][j] = j\n end\n\n (1...dp.size).each do |i|\n (1...dp[0].size).each do |j|\n dp[i][j] = if word1[i - 1] == word2[j - 1]\n # if chars are same, value will be from diagonal upward\n dp[i - 1][j - 1]\n else\n [\n dp[i - 1][j - 1],\n dp[i][j - 1],\n dp[i - 1][j]\n ].min + 1\n end\n end\n end\n dp[-1][-1]\nend",
"def reanalyze_words(morpheme_hypotheses)\n # Create a table of morpheme hypotheses indexed by word.\n word_table = {}\n morpheme_hypotheses.each do |hyp|\n # TODO Check for overlapping morpheme ranges with asserts.\n if not word_table.has_key?(hyp.original_word)\n word_table[hyp.original_word] = []\n end\n word_table[hyp.original_word] <<= hyp\n end\n # Insert the new morphemes into the phonetic components of the original\n # words.\n changed_word_indexes = []\n word_table.each do |word, hyps|\n # Don't insert a morpheme at the same location more than once.\n hyps.uniq!\n # Sort the morphemes in reverse order. That way inserting the first\n # one doesn't change the offsets of the subsequent ones.\n hyps = hyps.sort_by {|hyp| -hyp.original_word_offsets[0] }\n # Insert the new morphemes into the specified positions in the words'\n # phonetic components. Make the changes to the word stored in this\n # analysis' word list so that we may maintain multiple independent\n # analyses.\n hyps.each do |hyp|\n source_index, dest_index = @alignment_table.indexes[hyp.alignment]\n word_index = case hyp.word\n when :source\n source_index\n when :dest\n dest_index\n else\n raise RuntimeError.new(\"Invalid word value #{word}\")\n end\n original_word = word_list[word_index]\n from, to = hyp.original_word_offsets\n LOGGER.debug(\"Insert #{hyp.morpheme} into \" +\n \"#{original_word.transcription}[#{from}..#{to}]\")\n original_word.phonetic_component[from..to] = hyp.morpheme\n changed_word_indexes << word_index\n end\n end\n # Delete alignments involving words that changed.\n changed_word_indexes.uniq!\n changed_word_indexes.each { |index| @alignment_table.delete(index) }\n # Rerun alignments for the words that changed.\n changed_word_indexes.each do |word_index|\n # The alignments are done so that source words always have larger\n # indexes than dest words.\n 0.upto(word_index - 1) do |dest_index|\n source_word = self[word_index]\n dest_word = self[dest_index]\n alignment = Alignment.new(source_word, dest_word)\n @alignment_table.add(alignment, word_index, dest_index)\n end\n (word_index + 1).upto(word_list.length - 1) do |source_index|\n source_word = self[source_index]\n dest_word = self[word_index]\n alignment = Alignment.new(source_word, dest_word)\n @alignment_table.add(alignment, source_index, word_index)\n end\n end\n end",
"def if_dangler_situation\n if(@i == @len) && !valid_word?(@prefix)\n @last_word_index = @words.keys.sort.last\n @words.delete(@last_word_index)\n end\n end",
"def lookup_synsets( word, *args )\n\t\tdataset = WordNet::Synset.filter( :words => WordNet::Word.filter(lemma: word.to_s) )\n\t\tself.log.debug \"Looking up synsets for %p\" % [ word.to_s ]\n\n\t\t# Add filters to the dataset for each argument\n\t\targs.each do |arg|\n\t\t\tself.log.debug \" constraint arg: %p\" % [ arg ]\n\t\t\tcase arg\n\n\t\t\twhen Integer\n\t\t\t\tself.log.debug \" limiting to sense %d\" % [ arg ]\n\t\t\t\tdataset = dataset.limit( 1, arg-1 )\n\n\t\t\twhen Range\n\t\t\t\tself.log.debug \" limiting to range of senses: %p\" % [ arg ]\n\t\t\t\tdataset = dataset.limit( arg.end - arg.begin, arg.begin - 1 )\n\n\t\t\twhen Regexp\n\t\t\t\tself.log.debug \" filter: definition =~ %p\" % [ arg ]\n\t\t\t\tdataset = dataset.filter( definition: arg )\n\n\t\t\twhen Symbol, String\n\t\t\t\t# Lexical domain, e.g., \"verb.motion\"\n\t\t\t\tif domain = WordNet::Synset.lexdomains[ arg.to_s ]\n\t\t\t\t\tself.log.debug \" filter: lex domain: %s (%d)\" % [ arg, domain[:lexdomainid] ]\n\t\t\t\t\tdataset = dataset.filter( lexdomainid: domain[:lexdomainid] )\n\n\t\t\t\t# Part of speech symbol, e.g., \"v\"\n\t\t\t\telsif WordNet::Synset.postype_table.key?( arg.to_sym )\n\t\t\t\t\tself.log.debug \" filter: part of speech: %s\" % [ arg ]\n\t\t\t\t\tdataset = dataset.filter( pos: arg.to_s )\n\n\t\t\t\t# Part of speech name, e.g., \"verb\"\n\t\t\t\telsif pos = WordNet::Synset.postypes[ arg.to_s ]\n\t\t\t\t\tself.log.debug \" filter: part of speech: %s\" % [ pos.to_s ]\n\t\t\t\t\tdataset = dataset.filter( pos: pos.to_s )\n\n\t\t\t\t# Assume it's a definition match\n\t\t\t\telse\n\t\t\t\t\tpattern = \"%%%s%%\" % [ arg ]\n\t\t\t\t\tself.log.debug \" filter: definition LIKE %p\" % [ pattern ]\n\t\t\t\t\tdataset = dataset.filter { :definition.like(pattern) }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\treturn dataset.all\n\tend",
"def play\n if (test)\n # next four lines just to see if there was no chain between the words\n test_list = build_chain\n test_list.delete(@word1)\n test_list.delete(@word2)\n if (distance(@word1, @word2) > 1 and test_list.empty?)\n puts \"Error: No chain between words\"\n else\n puts build_chain\n end\n end\n end",
"def match(array_possible_anagrams)\n matching_words=[]\n word_broken=self.word.split(\"\").sort\n array_possible_anagrams.each do |possible_match|\n #possible_match=possible.word\n possible_match_broken=possible_match.split(\"\").sort\n if possible_match_broken == word_broken\n matching_words << possible_match\n else\n end #end of if\n end #end of do\n matching_words\n end",
"def check(word)\n\t\tresult = find_word(word)\n\t\treturn \"NO SUGGESTION\" if result.empty?\n\t\t# if the word is in the results, just return it\n\t\treturn word if result.include? word\n\t\tmatches = result.grep(/^#{word}$/i)\n\t\t# if the word is there with swapped caps, return that\n\t\treturn matches.first if matches.size > 0\n\t\t# else return the first one\n\t\t# FIXME: simple selection of a \"good\" match. must improve it!\n\t\tresult.first\n\tend",
"def second_anagram?(word1, word2)\n return true if (word1.empty?) && (word2.empty?)\n return false if ((word1.empty?) && (!word2.empty?)) || ((!word1.empty?) && (word2.empty?)) \n letter_1 = word1[0]\n letter_1_idx = word2.index(letter_1) \n\n return false if (letter_1_idx.nil?)\n word1 = word1.delete(letter_1)\n word2 = word2.delete(word2[letter_1_idx])\n second_anagram?(word1, word2)\n\nend",
"def disambiguate_discovered_check(possibilities)\n DIRECTIONS.each do |attacking_piece, directions|\n attacking_piece = attacking_piece.upcase if move.black?\n\n directions.each do |dir|\n piece, square = first_piece(king_position, dir)\n next unless piece == move.piece && possibilities.include?(square)\n\n piece, = first_piece(square, dir)\n possibilities.reject! { |p| p == square } if piece == attacking_piece\n end\n end\n\n possibilities\n end",
"def compare(word1, word2)\n bigram_compare(bigramate(word1), bigramate(word2))\n end",
"def words_of_same_length(word)\n\treturn $words[word.length]\nend",
"def find_solution(first_word, second_word)\n\tif first_word.length != second_word.length\n\t\treturn \"bad input, words must be the same length\"\n\tend\n\n\tcurrent_word = first_word\n\t$chain << first_word\n\n\twhile true\n\t\tpossible = words_1_letter_diff(current_word)\n\t\tpossible = possible - $seen\n\t\tif possible.include?(second_word)\n\t\t\treturn $chain << second_word\n\t\tend\n\n\t\tif possible != []\n\t\t\t$chain << possible.last\n\t\t\t$seen << possible.last\n\t\t\tcurrent_word = $chain.last\n\t\telse\n\t\t\tbacktrack()\n\t\t\tcurrent_word = $chain.last\n\t\tend\n\n\t\tif $chain == []\n\t\t\treturn \"impossible\"\n\t\tend\n\n\t\tif $chain.last == second_word\n\t\t\treturn $chain\n\t\tend\n\tend\nend",
"def _compare_cmds(cmds2)\n c1 = Set.new(@cmds)\n c2 = Set.new(cmds2)\n # Compare the commands and return the difference as an array of strings\n c1.difference(c2).to_a\n end",
"def delegate_word(node)\n\tFile.open(\"input.txt\", \"r\").each_line do |l|\n\t\tline = l.downcase[0..-2].split(\"\")\n\t\t#For adding\n\t\tif(node.word.length + 1) == line.length\n\t\t\tcompare_words(node, line)\n\t\tend\n\t\t#For removing\n\t\tif(node.word.length - 1) == line.length\n\t\t\tcompare_words(node, line)\n\t\tend\n\t\t#For substiting\n\t\t#Checking to make sure they are the same length\n\t\tif node.word.length == line.length\n\t\t\tcompare_words(node, line)\n\t\tend\n\tend\nend",
"def spell_out word6\n word6.downcase.split(\"\").join(\"-\")\nend",
"def get_word_ladder(start_word, end_word)\n # FILL ME IN\n return ['dog', 'cat']\n end",
"def []( word, *args )\n\t\tif word.is_a?( Integer )\n\t\t\t# :TODO: Assumes Synset IDs are all >= 100_000_000\n\t\t\tif word.to_s.length > 8\n\t\t\t\treturn WordNet::Synset[ word ]\n\t\t\telse\n\t\t\t\treturn WordNet::Word[ word ]\n\t\t\tend\n\t\telse\n\t\t\treturn self.lookup_synsets( word, 1, *args ).first\n\t\tend\n\tend",
"def combine(str1, str2)\n # Create an array which we will read the final outputs from\n output = []\n\n # Run processor for word 1 and push result to output\n output.push(processor(str1, 1))\n\n # Run processor for word 2 and push result to output\n output.push(processor(str2, 2))\n\n # Join the partial words together to form the wombinations\n wombination1 = (output[0][0] + output [1][0])\n wombination2 = (output[0][1] + output [1][1])\n\n # If the words are the same, then just return one of them...\n if wombination1 == wombination2\n puts wombination1\n\n # otherwise return both as an array\n else\n puts [wombination1, wombination2]\n\n end\nend",
"def word_string_short(word)\n \"#{word.morphword} #{word.input}->#{word.output}\"\n end",
"def proximate(p1, p2, distance, search_phrase_1, search_phrase_2)\n if p1 && p2\n\n # Short circuit if the both terms have been found and the distance is Infinity\n return true if distance.equal?(Float::INFINITY)\n\n word_distance = p1 < p2 ? p2 - (p1 + search_phrase_1.split(' ').size - 1) : p1 - (p2 + search_phrase_2.split(' ').size - 1)\n return word_distance <= distance\n end\n false\n end",
"def next_words_for(word) \n if word.nil? or word.empty?\n generator_names \n else\n name_of_last_generator_inverse = word[-1].swapcase\n generator_names.find_all{|name| name != name_of_last_generator_inverse }.map{|name| word + name }\n end\n end",
"def lookup(word)\r\n @word.each do |h|\r\n if h[:Word] == word.to_s\r\n return h[:Definition]\r\n end\r\n end\r\n end",
"def neighbors_by_substitution(word)\n word.split_around_each_char.lazy\n .flat_map do |prefix, char_to_substitute, suffix|\n get(prefix).lazy\n .reject do |substitution_possibility, _|\n substitution_possibility == char_to_substitute\n end\n .select do |_, substitution_possibility_subtree|\n # I'd usually use #try here but the instructions specify that I\n # can't include ant ActiveSupport functions.\n substitution_possibility_subtree &&\n substitution_possibility_subtree.contains?(suffix)\n end\n .map do |substitution_possibility, _|\n prefix + substitution_possibility + suffix\n end\n end\n end",
"def is_anagram word1, word2\n \tpermute = permute_word(word1)\n \tpermute.each do |w|\n \t puts w.join\n \t if w.join.eql?(word2)\n \t \treturn true\n \t end\n \tend\n \treturn false\n end",
"def second_anagram(word1, word2)\n return false unless word1.length == word2.length\n word1_arr = word1.split(\"\")\n characters = word2.chars\n\n word1_arr.each do |letter1|\n idx = characters.find_index(letter1)\n characters.delete_at(idx) unless idx.nil?\n\n end\n characters.empty?\nend",
"def second_anagram?(str_1, str_2)\n return false if str_1.length != str_2.length \n word_1 = str_1.chars\n word_2 = str_2.chars\n word_1.each_with_index do |char, idx| #\n idx_2 = word_2.find_index(char) \n if !idx_2.nil? #\n word_2.delete_at(idx_2) #m\n end\n end\n word_2.empty? #m\nend",
"def show\n\t\tresults = Spellchecker.check(params[:id]).first # Spellchecker gem spec http://rubydoc.info/gems/spellchecker/0.1.5/frames \n\t\tresults.delete(:original) # original word is not part of the api spec\n\t\t\n\t\tif results[:correct]\n\t\t\trespond_with(results) # They got it right. Nothing more to be done.\n\t\t\treturn\n\t\tend\n\t\t\n\t\tunless @user = User.find_by_id(params[:user_id])\n\t\t\trespond_with(results) # No one is logged in. Return the results.\n\t\t\treturn\n\t\tend\n\t\t\n\t\tunless @custom_word = @user.custom_words.find_by_word(params[:id])\n\t\t\trespond_with(results) # This is a new word. Return the results.\n\t\t\treturn\n\t\tend\n\t\t\n\t\tif @custom_word.correct\n\t\t\trespond_with( {:correct => false} )\n\t\telse\n\t\t\trespond_with( {:correct => false, :suggestions => @custom_word.top_corrections.concat( results[:suggestions] ).uniq[0..2] })\n\t\tend\n\tend",
"def is_friend(word1, word2)\n\n # Get the difference in length of the words\n difference = (word1.length - word2.length).abs\n \n #If the difference is greater than 1, then the words can't be friends. \n if difference > 1\n return false\n\n # If they are the same word, they can't be friends.\n elsif word1 == word2\n return false\n\n # If the difference in length is 1 or 0 they could potentially be friends.\n elsif difference == 1 or difference == 0\n\n # Boolean to tell if the words are the same length or not\n same_length = (difference == 0)\n\n # Determines which word is longer, and stores it in the appropriate place.\n # If they are the same length, word1 will be the \"longer\" word\n longer_word = (word1.length > word2.length ? word1 : word2)\n shorter_word = (word1.length > word2.length ? word2 : word1)\n\n # Loop through each letter to compare them, with the maximum index being the length of the longer word\n (0..longer_word.length).each do |i|\n # if the letters are the same, move on\n if word1[i] == word2[i]\n next\n\n # If they aren't the same, then they are at least one letter off. \n # Now check to see if they are more than one letter off. \n else\n # If the mismatched words are the same length, the remainder of each word must match for them to be friends. \n if same_length\n word1_remainder = word1[i+1...word1.length]\n word2_remainder = word2[i+1...word2.length]\n\n if word1_remainder == word2_remainder\n return true\n else\n return false\n end\n\n # If the mismatched words are not the same length, then the remainder of the longer word \n # must match the remainder of the shorter word including the letter where the mismatch occured.\n else\n longer_word_remainder = longer_word[i+1...longer_word.length]\n # Note that the beginning index for the shorter word is `i` instead of `i+1`.\n shorter_word_remainder = shorter_word[i...shorter_word.length]\n\n if longer_word_remainder == shorter_word_remainder\n return true\n else\n return false\n end\n end\n end\n end\n end\n\n # This should never be hit, but if it does, return that the two words are not friends. \n return false\nend",
"def flip_words(word, idx) # :nodoc:\n return word if excluded?(idx)\n bumper = Bumper.new(idx, words.size, reverse?)\n bumper.bump while excluded?(bumper.value)\n words[bumper.value].match(consonants).to_s + word.match(vowels).to_s\n end",
"def match(w_array)\n w_array.delete_if {|w| w.split(\"\").sort != word.split(\"\").sort}\n end",
"def in_a_word\n WORDS[self]\n end",
"def bank_valid_word_match(yes)\n if yes == true\n array1 << @word\n else nil\n end\n end",
"def simplification_rules_for_disjunction\n if is_formula_or_formula?\n copy @left_sentence\n update\n elsif is_formula_or_not_formula?\n @left_sentence, @right_sentence, @operator = nil,nil,nil\n update(Constant::VALUES[:up])\n elsif is_formula_or_up?\n @left_sentence, @right_sentence, @operator = nil,nil,nil\n update(Constant::VALUES[:up])\n elsif is_formula_or_bottom?\n if @left_sentence.is_constant?\n copy @right_sentence\n else\n copy @left_sentence\n end\n update\n end\n end",
"def analyze_name(tool_class, words)\n loader = tool_class.instance_variable_get(:@__loader)\n subtool_words = tool_class.instance_variable_get(:@__words).dup\n next_remaining = tool_class.instance_variable_get(:@__remaining_words)\n loader.split_path(words).each do |word|\n word = word.to_s\n subtool_words << word\n next_remaining = Loader.next_remaining_words(next_remaining, word)\n end\n [subtool_words, next_remaining]\n end",
"def lookup_word(word)\n h = self.lookup_entry(word)\n [ h[:pronounce], h[:meaning] ]\n end",
"def match(words_array)\n words_array.select do |element|\n element.split(\"\").sort == @word.split(\"\").sort\n\n end\n end",
"def correct(word)\n end",
"def word_overlap?(item)\n first_array = self.clean_description.split.declutter\n second_array = item.clean_description.split.declutter\n\n first_array.percentage_similarity_to(second_array) > 85 ? \"Too much word overlap\" : false\n end",
"def second_anagram?(word_1, word_2) #O(n^2)\n matching_word = word_2.split(\"\")\n\n word_1.each_char do |ele|\n if matching_word.index(ele) #evaluating the conditional\n matching_word.delete_at(matching_word.index(ele)) #n many times, do this\n end\n end\n\n matching_word.empty? #constant O(1)\nend",
"def translate_word word\n # Don't translate short words\n return word if word.size == 1\n\n # Handle specific words\n dictionary = {\n 'AWESOME' => 'ERSUM',\n 'BANANA' => 'BERNERNER',\n 'BAYOU' => 'BERU',\n 'FAVORITE' => 'FRAVRIT',\n 'FAVOURITE' => 'FRAVRIT',\n 'GOOSEBUMPS' => 'GERSBERMS',\n 'LONG' => 'LERNG',\n 'MY' => 'MAH',\n 'THE' => 'DA',\n 'THEY' => 'DEY',\n 'WE\\'RE' => 'WER',\n 'YOU' => 'U',\n 'YOU\\'RE' => 'YER',\n\n 'awesome' => 'ersum',\n 'banana' => 'bernerner',\n 'bayou' => 'beru',\n 'favorite' => 'fravrit',\n 'favourite' => 'fravrit',\n 'goosebumps' => 'gersberms',\n 'long' => 'lerng',\n 'my' => 'mah',\n 'the' => 'da',\n 'they' => 'dey',\n 'we\\'re' => 'wer',\n 'you' => 'u',\n 'you\\'re' => 'yer',\n\n 'Awesome' => 'Ersum',\n 'Banana' => 'Bernerner',\n 'Bayou' => 'Beru',\n 'Favorite' => 'Fravrit',\n 'Favourite' => 'Fravrit',\n 'Goosebumps' => 'Gersberms',\n 'Long' => 'Lerng',\n 'My' => 'Mah',\n 'The' => 'Da',\n 'They' => 'Dey',\n 'We\\'re' => 'Wer',\n 'You' => 'U',\n 'You\\'re' => 'Yer',\n }\n\n return dictionary[word] if dictionary.key? word\n \n # Before translating, keep a reference of the original word\n original_word = \"\"\n original_word << word\n\n word.upcase!\n\n # Drop vowel from end of words. Keep it for short words, like \"WE\"\n word.sub!(/[AEIOU]$/, '') if original_word.size > 2\n\n # Reduce duplicate letters\n word.gsub!(/[^\\w]|(.)(?=\\1)/, '')\n\n # Reduce adjacent vowels to one\n word.gsub!(/[AEIOUY]{2,}/, 'E') # TODO: Keep Y as first letter\n\n # DOWN -> DERN\n word.gsub!(/OW/, 'ER')\n\n # PANCAKES -> PERNKERKS\n word.gsub!(/AKES/, 'ERKS')\n\n # The mean and potatoes: replace vowels with ER\n word.gsub!(/[AEIOUY]/, 'ER') # TODO: Keep Y as first letter\n\n # OH -> ER\n word.gsub!(/ERH/, 'ER')\n\n #MY -> MAH\n word.gsub!(/MER/, 'MAH')\n\n #FALLING -> FERLIN\n word.gsub!('ERNG', 'IN')\n\n #POOPED -> PERPERD -> PERPED\n word.gsub!('ERPERD', 'ERPED')\n\n #MEME -> MAHM -> MERM\n word.gsub!('MAHM', 'MERM')\n\n # Keep Y as first character\n # YES -> ERS -> YERS\n word = 'Y' + word if original_word[0] == 'Y'\n\n # Reduce duplicate letters\n word.gsub!(/[^\\w]|(.)(?=\\1)/, '')\n\n # YELLOW -> YERLER -> YERLO\n if original_word.end_with?('LOW') && word.end_with?('LER')\n word.sub!(/LER$/, 'LO')\n end\n\n # Resolve case\n return word.downcase if original_word[0] >= 'a' and original_word[0] <= 'z' and original_word[-1] >= 'a' and original_word[-1] <= 'z'\n return word[0] + word[1..-1].downcase if original_word[0] >= 'A' and original_word[0] <= 'Z' and original_word[-1] >= 'a' and original_word[-1] <= 'z'\n\n return word\n\nend",
"def find_replacement_translations(locale, variant_words, translations)\n pp \"Processing #{locale} strings\"\n unchanged = []\n to_be_replaced = []\n variant_words.each do |dict|\n current = dict[:source]\n origin = dict[:origin]\n replacement = dict[:target]\n # keeping a tally of how many will not change due to both current\n # and replacement being the same\n if current == replacement\n unchanged << { current: current, replacement: replacement }\n next\n end\n if current == '--'\n t = translations.where('copy LIKE ?', \"%#{origin}%\")\n puts \"#{t.count} strings found in #{locale} for #{origin}\"\n else\n t = translations.where('copy LIKE ?', \"%#{current}%\")\n puts \"#{t.count} strings found in #{locale} for #{current}\"\n end\n # t = translations.where(source_copy: source)\n # count = t.count\n # t = t.concat(fuzzy_match)\n unless (t.nil? or t.empty?) && current[0] != replacement[0]\n # pp \"#{current[0]} matched #{replacement[0]}\"\n t.each do |row|\n # exact match with word boundaries around the word\n # this will prevent words being part of ids/classes\n # and it will also prevent words like \"Unenroll\"\n # it's looking for \"enroll\"\n unless row.copy.match(/#{current}\\b/)\n next\n end\n if current[0] == replacement[0]\n pp \"#{current} will be replaced with #{replacement}\"\n end\n rep = {\n locale: locale,\n source: row.source_copy,\n current: row.copy,\n replacement: row.copy && row.copy.gsub(current, replacement),\n id: row.id,\n word: replacement,\n }\n if rep[:current] != rep[:replacement]\n puts \"Current and replacmeent match: #{rep[:current]} == #{rep[:replacement]}\"\n begin\n if rep[:replacement].strip_html_tags == rep[:replacement]\n to_be_replaced << rep\n else\n pp \"Stripped #{rep[:replacement]} and didn't add to list\"\n end\n end\n end\n end\n end\n end\n puts \"Ignoring: #{unchanged.size} strings\"\n puts \"Changing: #{to_be_replaced.size} strings\"\n to_be_replaced\nend",
"def run_diff(a, b)\n\t\t\ta = \"\" if a == nil\n\t\t\tb = \"\" if b == nil\n\t\t\n\t\t\t@a = a\n\t\t\t@b = b\n\t\t\n\t\t\t# run the initial word-based diff\n\t\t\t@worddiff = WordDiff.new(a, b)\n\t\t\n\t\t\tawords = @worddiff.a_words\n\t\t\tbwords = @worddiff.b_words\n\t\t\twdiff = @worddiff.differences\n\t\t\n\t\t\t#\n\t\t\t# now run through all the words in the longest\n\t\t\t# of the sentences, and for words that differ\n\t\t\t# run a character based diff and calculate the differing\n\t\t\t# characters actual position within the sentences\n\t\t\t#\n\t\t\tmax = awords.length\n\t\t\tmax = bwords.length if bwords.length > awords.length\n\t\t\n\t\t\tstr = \"\"\n\t\t\n\t\t\tfor i in 0..max-1\n\t\t\n\t\t\t\tif wdiff.include?(i)\n\t\t\t\t\tdiff_by_char(awords[i], bwords[i]).each do |chardiff|\n\t\t\t\t\t\[email protected](chardiff + str.length)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\n\t\t\t\tstr << \" #{bwords[i]}\"\n\t\t\tend\n\n\t\t\t# return void\t\t\n\t\t\treturn\n\t\tend",
"def word_substituter (tweet=\"some thing need to be shorten, like two too\")\n tweet= tweet.strip\n temp_a = tweet.split(\" \")\n words_can_b_sh = dictionary.keys\n #puts words_can_b_sh\n temp = \"\"\n# puts temp_a\n temp_a.each do |word|\n if words_can_b_sh.include?(word.downcase)\n temp << dictionary[word.downcase]\n else\n temp << word\n end\n temp << \" \"\n end\n temp.strip\nend",
"def second_anagram?(word1, word2)\n split1, split2 = word1.chars, word2.chars\n\n idx = 0\n while idx < split1.length\n split2.each_with_index do |el2, idx2|\n if el2 == split1[idx]\n split1.delete_at(idx)\n split2.delete_at(idx2)\n idx = -1\n break\n end\n end\n idx += 1\n end\n return false unless split1.empty? && split2.empty?\n true\nend",
"def reply(word: :message)\n # DelayInfomationExtractor\n if word.include?('電車')\n DelayInfomationExtractor.new.search_for_delaying_railway(word)\n\n # elsif\n\n # UserLocalAPI\n else\n word = refine_msg(msg: word)\n call_user_local_api(msg: word)\n end\n end"
] | [
"0.6331387",
"0.5828699",
"0.57423717",
"0.5671364",
"0.561302",
"0.5585133",
"0.55316657",
"0.54644555",
"0.5412722",
"0.5390442",
"0.53889626",
"0.53293914",
"0.53241116",
"0.53124285",
"0.5222425",
"0.5187185",
"0.5153052",
"0.5151803",
"0.51428175",
"0.5120926",
"0.5097328",
"0.5078298",
"0.5057637",
"0.5037792",
"0.503293",
"0.50324935",
"0.50299084",
"0.5020523",
"0.49756753",
"0.49568474",
"0.49481204",
"0.4939698",
"0.49386775",
"0.49296093",
"0.49262723",
"0.49224007",
"0.4912784",
"0.49042463",
"0.4901702",
"0.48981184",
"0.48927847",
"0.48916253",
"0.48893467",
"0.4872288",
"0.48682335",
"0.48530322",
"0.48441947",
"0.48411518",
"0.48350653",
"0.48238653",
"0.48185894",
"0.481522",
"0.48104483",
"0.47986913",
"0.47933823",
"0.47906008",
"0.47886387",
"0.4787587",
"0.47843784",
"0.47708791",
"0.47700816",
"0.4763991",
"0.47428933",
"0.4738746",
"0.47132915",
"0.47085646",
"0.47051004",
"0.470483",
"0.47038272",
"0.4699362",
"0.4697202",
"0.469173",
"0.4689605",
"0.46890038",
"0.46836898",
"0.4675323",
"0.467352",
"0.4672467",
"0.46710205",
"0.46676567",
"0.4667465",
"0.46667483",
"0.46440095",
"0.46404544",
"0.4621925",
"0.4617355",
"0.46142283",
"0.4606443",
"0.46039233",
"0.45974562",
"0.45969185",
"0.45955914",
"0.45911506",
"0.45887786",
"0.45863214",
"0.45830005",
"0.45816645",
"0.4578785",
"0.45761386",
"0.45753437"
] | 0.7428701 | 0 |
GET /admin/room_devices GET /admin/room_devices.json | def index
@admin_room_devices = Admin::RoomDevice.search(params[:search]).where(user: current_user).paginate(:page => params[:page])
@export = Admin::RoomDevice.all
respond_to do |format|
format.html
format.json
format.xlsx {
response.headers['Content-Disposition'] = 'attachment; filename="Room_Devices.xlsx"'
}
format.js { render :layout => false }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"def get_all_device_info\n # @device = Device.where(\"user_id = ?\",current_user[:id])\n # render json: @device\n @devices = User.get_all_user_devices(current_user[:id])\n render json: @devices\n end",
"def set_admin_room_device\n @admin_room_device = Admin::RoomDevice.find(params[:id])\n end",
"def get_rooms\n # DO NOT DELETE. Condition used for load testing\n @user_id = (params.has_key? :user_id) ? params[:user_id] : session[:user_id]\n @room_ids = Member.where(user_id: @user_id).pluck(:room_id)\n\n @rooms = Room.find(@room_ids)\n #render json: @rooms\n \n @roomList = []\n #@rooms.each { |room|\n for room in @rooms do\n #@room = Room.find_by(id: room_id)\n temp = {}\n temp.store(\"room_id\",room.id)\n temp.store(\"room_name\", room.name) \n temp.store(\"room_token\", room.token)\n @roomList.push(temp)\n end\n render json: {rooms: @roomList}, status: 200\n end",
"def index\n @devices = @user.devices\n end",
"def device_list\n @devices = Device.all\n end",
"def index\n @devices = current_user.devices\n end",
"def devices\n @devices\n end",
"def index\n @admin_devices = AdminDevice.all\n end",
"def index\n @devices = Device.where(:user_id, auth_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devices }\n end\n end",
"def index\n @devices = current_user.devices\n end",
"def devices\n response = get('/listDevices')\n devices = []\n response.body['devices'].each do |d|\n devices << Device.from_json(d, @token, @logger)\n end\n devices\n end",
"def index\n @devices = Device.all\n render json: @devices\n end",
"def set_room\n @room = current_user.rooms.find(params[:id])\n @devices_log = @room.devices.last\n end",
"def query_device_management\n @devices = query(\"select * from device_management \")\n end",
"def list_zr_devices_with_http_info(room_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RoomsApi.list_zr_devices ...'\n end\n # verify the required parameter 'room_id' is set\n if @api_client.config.client_side_validation && room_id.nil?\n fail ArgumentError, \"Missing the required parameter 'room_id' when calling RoomsApi.list_zr_devices\"\n end\n # resource path\n local_var_path = '/rooms/{roomId}/devices'.sub('{' + 'roomId' + '}', room_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'InlineResponse20081')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoomsApi#list_zr_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n\t\t@rooms = Room.order(updated_at: :desc)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @rooms }\n\t\tend\n\tend",
"def devices\n return @devices\n end",
"def devices; end",
"def create\n @type = params[:actionType]\n @admin_room_device = Admin::RoomDevice.new(admin_room_device_params)\n @admin_room_device.user = current_user\n respond_to do |format|\n if @admin_room_device.save\n @admin_room_devices = Admin::RoomDevice.where(user: current_user).paginate(:page => params[:page])\n format.html { redirect_to @admin_room_device, notice: 'Room device was successfully created.' }\n format.json { render :show, status: :created, location: @admin_room_device }\n format.js { render :layout => false }\n else\n format.html { render :new }\n format.json { render json: @admin_room_device.errors, status: :unprocessable_entity }\n format.js { render :layout => false }\n end\n end\n end",
"def get_rooms \n json_rooms = IO.popen(\"curl -u #{@config['campfire_config']['API_KEY']}:X #{@config['campfire_config']['URL']}/presence.json\") \n parsed_rooms = JSON.parse(json_rooms.readlines.first)[\"rooms\"]\n rooms = parsed_rooms.collect {|room| [room[\"name\"],room[\"id\"]]} \nend",
"def index\n @rooms = Room.all\n respond_to do | format |\n format.html\n format.json\n end\n \n end",
"def devices\r\n DevicesController.instance\r\n end",
"def show\n @room = current_user.rooms.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room.to_hash_with_users(current_user).to_json }\n end\n end",
"def show\n json_response(@device)\n end",
"def index\n rooms = Room.includes(:problems, :registrations, :users, :owner)\n if params[:name]\n render json: rooms.where(name: params[:name])\n else\n render json: rooms\n end\n end",
"def list_devices(multi)\n\t\t\tmulti = $redis.get_multi_id multi\n\t\t\tif $redis.knows_multi? multi\n\t\t\t\tputs \"=== Sensors ===\"\n\t\t\t\t$redis.list(:sensor, multi).sort.each do |pin, conf|\n\t\t\t\t\ts = \"#{pin} : #{conf[:name]} #{conf[:profile]}\"\n\t\t\t\t\ts << \" - Period : #{conf[:period]}\" if conf[:period]\n\t\t\t\t\tputs s\n\t\t\t\tend\n\t\t\t\tputs \"=== Actuators ===\"\n\t\t\t\t$redis.list(:actuator, multi).sort.each do |pin, conf|\n\t\t\t\t\ts = \"#{pin} : #{conf[:name]} #{conf[:profile]}\"\n\t\t\t\t\ts << \" - Period : #{conf[:period]}\" if conf[:period]\n\t\t\t\t\tputs s\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tputs \"The multiplexer doesn't exist\"\n\t\t\tend\n\t\tend",
"def show\n\t\trender json: @room_user\n\tend",
"def live_look\n ids = params[:device_ids].split(',')\n if ids.empty?\n flash[:warning] = \"Please select at least one vehicle to view on the map.\"\n redirect_to devices_path\n return\n end\n\n @devices = current_user.devices\n @device_ids = params[:device_ids]\n\n respond_to do |format|\n format.html\n format.json {\n render :json => @devices.to_json(\n :methods => [:color, :connected],\n :include => {\n :position => {\n :methods => :time_of_day\n } \n }\n )\n }\n end\n end",
"def admin_room_device_params\n params.require(:admin_room_device).permit(:user_id, :room_id, :name, :amount, :status, :description)\n end",
"def devices=(value)\n @devices = value\n end",
"def index\n if current_user\n if current_user.is_admin?\n @devices = Device.all\n else\n @devices = Device.where(:user_id => current_user.id)\n end\n else\n redirect_to login_url, :notice => \"Please login to manage your devices\"\n end\n end",
"def initialize\n @credentials = Authenticate.get_credentials\n @db = CouchRest.database(\"http://#{@credentials[\"user\"]}:#{@credentials[\"password\"]}@localhost:5984/rooms\")\n @rooms = {}\n @db.get(\"_design/room\").\n view(\"all_rooms\")['rows'].map{|x| x['value']}.each do |room|\n id = room['_id']\n @rooms[id] = {}\n @rooms[id]['_id'] = id\n @rooms[id]['room'] = room\n devices = @db.get('_design/room').view('devices_for_room', {:key => id})['rows'].map{|x| x['value']}\n @rooms[id]['sources'] = @db.get('_design/cmdr_web').view('sources', {:key => id})['rows'].map{|x| x['value']}\n @rooms[id]['actions'] = @db.get('_design/cmdr_web').view('actions', {:key => id})['rows'].map{|x| x['value']}\n @rooms[id]['room_name'] = room['attributes']['name']\n devs = {}\n DEVICES.each do |r,_|\n devs[r] = room['attributes'][r]\n end\n @rooms[id]['devices'] = devs\n @rooms[id]['devices_by_id'] = {}\n @rooms[id]['device_record_by_resource'] = {}\n devs.each do |k,v|\n d = devices.find {|d| d['attributes']['name'] == v}\n if d\n @rooms[id]['devices_by_id'][d['_id']] ||= []\n @rooms[id]['devices_by_id'][d['_id']] << k\n end\n @rooms[id]['device_record_by_resource'][k] = d\n end\n end\n end",
"def show\n @rooms = { \n items: Room.all, \n }\n if room = Room.find_by(id: params[:id])\n response_data = {\n room: room,\n messages: module_get_messages(room)\n }\n status= :ok\n else \n status= :unprocessable_entity\n end\n\n #puts \"#######################\"\n #puts @room.as_json(:include => @messages)\n #puts Room.includes(:messages.limit(2)).find(params[:id] || 1).as_json(:include => :messages)\n\n respond_to do |format|\n format.html\n format.json { render json: response_data, status: status }\n end\n end",
"def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room_config }\n end\n end",
"def device_id\n 'bedroom'\n end",
"def get_all_rooms(params = {})\n res = call_api(:method => :get, :uri => @api_base.merge(\"room\"), :query_params => params)\n return unless res.successful?\n Rooms.new(res.data)\n end",
"def server_devices_list\n if !ccl_active? or (session[:usertype] != \"admin\" and ccl_active?)\n dont_be_so_smart\n redirect_to :controller => \"callc\", :action => \"main\" and return false\n end\n @page_title = _('Server_devices')\n @page_icon = 'server.png'\n @help_link = \"http://wiki.kolmisoft.com/index.php/Multi_Server_support\"\n # ip_auth + server_devices.server_id is null + server_devices.server_id is not that server + not server device(which were created with server creation)\n @devices = Device.select(\"devices.*,server_devices.server_id AS serv_id\").joins(\"LEFT JOIN server_devices ON (server_devices.device_id = devices.id AND server_devices.server_id = #{params[:id].to_i}) LEFT JOIN users ON (users.id = devices.user_id)\").where(\"(host != 'dynamic' OR device_type != 'SIP') AND users.owner_id = #{current_user.id} AND server_devices.server_id is null AND user_id != -1 AND name not like 'mor_server_%'\").order(\"extension ASC\").all\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @tddbc_room = Tddbc::Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tddbc_room }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def index\n if authorise(request)\n auth_token = request.headers['Authorization1'].split(' ').last\n req = GetRoomsRequest.new(auth_token)\n serv = RoomServices.new\n resp = serv.get_rooms(req)\n render json: { status: resp.success, message: resp.message, data: resp.data }, status: :ok\n else\n render json: { status: false, message: 'Unauthorized' }, status: 401\n end\n end",
"def show\n @rooms = Room.all\n end",
"def index\n @q = apply_scopes(Device).all.search(params[:q])\n @devices = @q.result(distinct: true).page(params[:page])\n\n respond_with(@devices)\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def devices\n url = \"me/player/devices\"\n response = RSpotify.resolve_auth_request(@id, url)\n\n return response if RSpotify.raw_response\n response['devices'].map { |i| Device.new i }\n end",
"def devices\n\texecute(\"devices\").split(\"\\n\")[1..-1]\nend",
"def my_notes\n device = params.permit(:device_id)\n render json: GeoNote.where(device_id: device[:device_id]).all\n end",
"def index\n @rooms = current_user.rooms.all\n end",
"def index\n ota_rooms = Array.new\n if params[:room].nil? && params[:ota].nil?\n # 自分の施設情報だけを返す\n\n current_user.ota.select do |otum|\n otum.provider == 'default'\n end.each do |otum|\n ota_rooms.concat(otum.ota_rooms)\n end\n elsif params[:ota].nil?\n room = Room.find_by(id: params[:room].to_i)\n # 部屋IDが存在しない場合\n if room.nil?\n response = {\n status: 'NotFound',\n message: 'room not found'\n }\n return render json: response, status: 404\n end\n # 権限がない場合\n if current_user.id != room.user.id\n response = {\n status: 'NotFound',\n message: 'room not found'\n }\n return render json: response, status: 404\n end\n ota_rooms.concat(room.ota_rooms)\n elsif params[:room].nil?\n otum = Otum.find_by(id: params[:ota].to_i)\n # OTA IDが存在しない場合\n if otum.nil?\n response = {\n status: 'NotFound',\n message: 'ota not found'\n }\n return render json: response, status: 404\n end\n # 権限がない場合\n if current_user.id != otum.user.id\n response = {\n status: 'NotFound',\n message: 'ota not found'\n }\n return render json: response, status: 404\n end\n ota_rooms.concat(otum.ota_rooms)\n else\n # facility=[facility_id]\n facility = Facility.find_by(id: params[:facility].to_i)\n # 施設IDが存在しない場合\n if facility.nil?\n response = {\n status: 'NotFound',\n message: 'ota_rooms not found'\n }\n return render json: response, status: 404\n end\n # ユーザーの施設IDでない場合\n if facility.user_id != current_user.id\n response = {\n status: 'NotFound',\n message: 'ota_rooms not found'\n }\n return render json: response, status: 404\n end\n ota_rooms.concat(facility.ota_rooms)\n end\n\n render json: {\n status: 'Success',\n message: '',\n ota_rooms: ota_rooms.as_json(except: [\n :created_at,\n :updated_at\n ])\n }, status: 200\n end",
"def show\n\t\t@user=User.find(params[:user_id])\n \t@[email protected](params[:room_id])\n \t\t@device= @room.devices.find(params[:device_device_id])\n \t\t@note = @device.notes.find(params[:id])\n \trender json: @note if stale?(@note)\n\tend",
"def room_list\n @roomtype = DetailRoom.all_types\n @time = Room.all_times\n @day_list = Room.all_days\n if session[:admin] == nil\n redirect_to rooms_path\n end\n @admin = session[:admin]\n @rooms = {} \n @roomtype.each do |type|\n @rooms[type] = DetailRoom.find_all_by_room_type(type)\n end \n end",
"def index\n @user = User.find(params[:user_id])\n @rooms = @user.rooms.all\n render json: @rooms if stale?(etag: @rooms.all, last_modified: @rooms.maximum(:updated_at))\n end",
"def index\n @rooms = Room.all.map do |rm|\n Room.cleanFetch(rm, current_user)\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n render '/api/rooms/show'\n end",
"def destroy\n @admin_room_device.destroy\n respond_to do |format|\n format.html { redirect_to admin_room_devices_url, notice: 'Room device was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n end",
"def index\n @kind_rooms = KindRoom.all\n end",
"def index\n @hostel_rooms = HostelRoom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hostel_rooms }\n end\n end",
"def list_rooms\n @rooms.each do |room_name, cap| \n puts \"#{room_name} #{cap.available_space()}\"\n end\n end",
"def rooms_list\n\t\t\[email protected] {|room| \"Room: #{room.id}\"}.join(\", \")\n\t\tend",
"def index\n# @devices = Device.all\n end",
"def show\n @device = Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def show\n @device = Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def show\n @device = Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def index\n @branch_rooms = Room.get_all_rooms(params[:branch_id])\n \n render json: @branch_rooms\n end",
"def show\n # @mydevice = Mydevice.find(params[:id])\n\t@user = User.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mydevice }\n end\n end",
"def list_all_rooms\n return @rooms\n end",
"def graph_room_list()\n return MicrosoftGraph::Places::GraphRoomList::GraphRoomListRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @restrooms = Restroom.all\n end",
"def list_zr_devices(room_id, opts = {})\n data, _status_code, _headers = list_zr_devices_with_http_info(room_id, opts)\n data\n end",
"def list\n all.each { |device| puts(device.pretty_name) }\n end",
"def show\n @restroom = Restroom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restroom }\n end\n end",
"def index\n @rooms = Room.all\n room_list = []\n @rooms.each do |room|\n room_list << room.to_hash_with_users(current_user)\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: room_list.to_json}\n end\n end",
"def index\n @room_users = RoomUser.all\n end",
"def index\n @room_configs = RoomConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @room_configs }\n end\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n @rooms = Room.all\n end",
"def index\n case current_type\n when 'owner'\n @rooms = owner_rooms\n when 'access'\n @rooms = access_rooms\n else\n @rooms = public_rooms\n end\n end",
"def show\n room = PublicRoom.find_by_escape_room_id(params[:id])\n if room.nil?\n render json: { success: false, message: 'Room needs to be public' }, status: :bad_request\n return\n end\n room_serv = RoomServices.new\n req_vertex = GetVerticesRequest.new(params[:id])\n res_vertex = room_serv.get_vertices(req_vertex)\n req_room_images = GetRoomImagesRequest.new(params[:id])\n res_room_images = room_serv.room_images(req_room_images)\n render json: { success_vertex: res_room_images.success, message_vertex: res_vertex.message,\n data_vertex: res_vertex.data, success_room_images: res_room_images.success,\n message_room_images: res_room_images.message,\n data_room_images: res_room_images.data }, status: :ok\n rescue StandardError\n render json: { success: false, message: 'Error internally' }, status: 500\n end",
"def update\n @type = params[:actionType]\n\n respond_to do |format|\n if @admin_room_device.update(admin_room_device_params)\n @admin_room_devices = Admin::RoomDevice.where(user: current_user).paginate(:page => params[:page])\n format.html { redirect_to @admin_room_device, notice: 'Room device was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_room_device }\n format.js { render :layout => false }\n else\n format.html { render :edit }\n format.json { render json: @admin_room_device.errors, status: :unprocessable_entity }\n format.js { render :layout => false }\n end\n end\n end",
"def find \n @user = User.find(params[:user_id])\n @room = @user.rooms.where(:name => params[:name])\n render json: @room if stale?(etag: @room.all, last_modified: @room.maximum(:updated_at))\n end",
"def get_devices option\n where_clause = []\n\n option.each do |key, value|\n key = key.to_s\n case key\n when 'vendor_name'\n vendor = get_vendor :name => value\n next unless vendor['id']\n\n where_clause << \"vendor_id = #{vendor['id']}\"\n when 'vendor_code'\n vendor = get_vendor :code => value\n next unless vendor['id']\n\n where_clause << \"vendor_id = #{vendor['id']}\"\n when 'code'\n where_clause << \"code = #{hex_or_int(value)}\"\n when 'name'\n where_clause << \"name = '#{value}'\"\n end\n end\n\n @handle.execute \"SELECT * from devices WHERE #{where_clause.join(\" and \")}\"\n end",
"def get_network_sm_devices(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/sm/devices'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_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 'fields' => options['fields'],\r\n 'wifiMacs' => options['wifi_macs'],\r\n 'serials' => options['serials'],\r\n 'ids' => options['ids'],\r\n 'scope' => options['scope'],\r\n 'batchSize' => options['batch_size'],\r\n 'batchToken' => options['batch_token']\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 create\n @room = TmuAdmin::Room.new(room_params)\n\n if @room.save\n render :json => {}\n else\n error_messages = @room.errors.full_messages.collect { |error_message| \"<li>\" + error_message + \"</li>\" }\n\n render :json => {:errorMsg => \"<ul>\" + error_messages.join(\"\") + \"</ul>\"}\n end\n end"
] | [
"0.7055636",
"0.69208777",
"0.66435844",
"0.6616356",
"0.6575139",
"0.6558546",
"0.64773583",
"0.64282244",
"0.64228237",
"0.6367818",
"0.6360648",
"0.6355462",
"0.6344811",
"0.6292977",
"0.62433046",
"0.62253916",
"0.6188025",
"0.6160841",
"0.6159646",
"0.6159098",
"0.61433285",
"0.61322486",
"0.6122883",
"0.61202526",
"0.6108524",
"0.6094377",
"0.60882473",
"0.6077313",
"0.60772777",
"0.60332537",
"0.60208297",
"0.6019173",
"0.60177475",
"0.6011309",
"0.6005294",
"0.59733206",
"0.5969605",
"0.59214365",
"0.5917838",
"0.5910769",
"0.5909921",
"0.5909921",
"0.5909921",
"0.59098303",
"0.59026134",
"0.588578",
"0.5877662",
"0.5876421",
"0.5873232",
"0.5873232",
"0.5873232",
"0.5873232",
"0.5873232",
"0.58532554",
"0.58481133",
"0.5844186",
"0.58356655",
"0.5831964",
"0.58288133",
"0.58269566",
"0.5806946",
"0.5791268",
"0.5789725",
"0.57709026",
"0.57676345",
"0.5760025",
"0.5756759",
"0.57526946",
"0.5746693",
"0.574013",
"0.574013",
"0.574013",
"0.57362247",
"0.57356",
"0.5733818",
"0.5724569",
"0.57158",
"0.5710677",
"0.570806",
"0.570167",
"0.5688096",
"0.5685989",
"0.5679682",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56704074",
"0.56661385",
"0.56657493",
"0.5662145",
"0.56600225",
"0.5658626",
"0.5657377",
"0.56551236"
] | 0.0 | -1 |
GET /admin/room_devices/1 GET /admin/room_devices/1.json | def show
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_admin_room_device\n @admin_room_device = Admin::RoomDevice.find(params[:id])\n end",
"def get_all_device_info\n # @device = Device.where(\"user_id = ?\",current_user[:id])\n # render json: @device\n @devices = User.get_all_user_devices(current_user[:id])\n render json: @devices\n end",
"def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"def index\n @devices = @user.devices\n end",
"def set_room\n @room = current_user.rooms.find(params[:id])\n @devices_log = @room.devices.last\n end",
"def show\n json_response(@device)\n end",
"def index\n @devices = Device.where(:user_id, auth_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devices }\n end\n end",
"def index\n @devices = current_user.devices\n end",
"def index\n @devices = Device.all\n render json: @devices\n end",
"def get_rooms\n # DO NOT DELETE. Condition used for load testing\n @user_id = (params.has_key? :user_id) ? params[:user_id] : session[:user_id]\n @room_ids = Member.where(user_id: @user_id).pluck(:room_id)\n\n @rooms = Room.find(@room_ids)\n #render json: @rooms\n \n @roomList = []\n #@rooms.each { |room|\n for room in @rooms do\n #@room = Room.find_by(id: room_id)\n temp = {}\n temp.store(\"room_id\",room.id)\n temp.store(\"room_name\", room.name) \n temp.store(\"room_token\", room.token)\n @roomList.push(temp)\n end\n render json: {rooms: @roomList}, status: 200\n end",
"def index\n @devices = current_user.devices\n end",
"def index\n @admin_devices = AdminDevice.all\n end",
"def create\n @type = params[:actionType]\n @admin_room_device = Admin::RoomDevice.new(admin_room_device_params)\n @admin_room_device.user = current_user\n respond_to do |format|\n if @admin_room_device.save\n @admin_room_devices = Admin::RoomDevice.where(user: current_user).paginate(:page => params[:page])\n format.html { redirect_to @admin_room_device, notice: 'Room device was successfully created.' }\n format.json { render :show, status: :created, location: @admin_room_device }\n format.js { render :layout => false }\n else\n format.html { render :new }\n format.json { render json: @admin_room_device.errors, status: :unprocessable_entity }\n format.js { render :layout => false }\n end\n end\n end",
"def device_list\n @devices = Device.all\n end",
"def device_id\n 'bedroom'\n end",
"def show\n @room = current_user.rooms.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room.to_hash_with_users(current_user).to_json }\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n\t\trender json: @room_user\n\tend",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @room = Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room }\n end\n end",
"def show\n @tddbc_room = Tddbc::Room.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tddbc_room }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @room_config }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def show\n @device = Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def show\n @device = Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def show\n @device = Device.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device }\n end\n end",
"def show\n @rooms = { \n items: Room.all, \n }\n if room = Room.find_by(id: params[:id])\n response_data = {\n room: room,\n messages: module_get_messages(room)\n }\n status= :ok\n else \n status= :unprocessable_entity\n end\n\n #puts \"#######################\"\n #puts @room.as_json(:include => @messages)\n #puts Room.includes(:messages.limit(2)).find(params[:id] || 1).as_json(:include => :messages)\n\n respond_to do |format|\n format.html\n format.json { render json: response_data, status: status }\n end\n end",
"def show\n\t\t@user=User.find(params[:user_id])\n \t@[email protected](params[:room_id])\n \t\t@device= @room.devices.find(params[:device_device_id])\n \t\t@note = @device.notes.find(params[:id])\n \trender json: @note if stale?(@note)\n\tend",
"def get_rooms \n json_rooms = IO.popen(\"curl -u #{@config['campfire_config']['API_KEY']}:X #{@config['campfire_config']['URL']}/presence.json\") \n parsed_rooms = JSON.parse(json_rooms.readlines.first)[\"rooms\"]\n rooms = parsed_rooms.collect {|room| [room[\"name\"],room[\"id\"]]} \nend",
"def show\n @room = Room.find(params[:id])\n\n render '/api/rooms/show'\n end",
"def index\n @rooms = Room.all\n respond_to do | format |\n format.html\n format.json\n end\n \n end",
"def index\n rooms = Room.includes(:problems, :registrations, :users, :owner)\n if params[:name]\n render json: rooms.where(name: params[:name])\n else\n render json: rooms\n end\n end",
"def show\n @restroom = Restroom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restroom }\n end\n end",
"def devices\r\n DevicesController.instance\r\n end",
"def show\n # @mydevice = Mydevice.find(params[:id])\n\t@user = User.find(params[:id])\n\t\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mydevice }\n end\n end",
"def query_device_management\n @devices = query(\"select * from device_management \")\n end",
"def list_zr_devices_with_http_info(room_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: RoomsApi.list_zr_devices ...'\n end\n # verify the required parameter 'room_id' is set\n if @api_client.config.client_side_validation && room_id.nil?\n fail ArgumentError, \"Missing the required parameter 'room_id' when calling RoomsApi.list_zr_devices\"\n end\n # resource path\n local_var_path = '/rooms/{roomId}/devices'.sub('{' + 'roomId' + '}', room_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'application/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json', 'multipart/form-data'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'InlineResponse20081')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: RoomsApi#list_zr_devices\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def initialize\n @credentials = Authenticate.get_credentials\n @db = CouchRest.database(\"http://#{@credentials[\"user\"]}:#{@credentials[\"password\"]}@localhost:5984/rooms\")\n @rooms = {}\n @db.get(\"_design/room\").\n view(\"all_rooms\")['rows'].map{|x| x['value']}.each do |room|\n id = room['_id']\n @rooms[id] = {}\n @rooms[id]['_id'] = id\n @rooms[id]['room'] = room\n devices = @db.get('_design/room').view('devices_for_room', {:key => id})['rows'].map{|x| x['value']}\n @rooms[id]['sources'] = @db.get('_design/cmdr_web').view('sources', {:key => id})['rows'].map{|x| x['value']}\n @rooms[id]['actions'] = @db.get('_design/cmdr_web').view('actions', {:key => id})['rows'].map{|x| x['value']}\n @rooms[id]['room_name'] = room['attributes']['name']\n devs = {}\n DEVICES.each do |r,_|\n devs[r] = room['attributes'][r]\n end\n @rooms[id]['devices'] = devs\n @rooms[id]['devices_by_id'] = {}\n @rooms[id]['device_record_by_resource'] = {}\n devs.each do |k,v|\n d = devices.find {|d| d['attributes']['name'] == v}\n if d\n @rooms[id]['devices_by_id'][d['_id']] ||= []\n @rooms[id]['devices_by_id'][d['_id']] << k\n end\n @rooms[id]['device_record_by_resource'][k] = d\n end\n end\n end",
"def index\n\t\t@rooms = Room.order(updated_at: :desc)\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render json: @rooms }\n\t\tend\n\tend",
"def devices\n @devices\n end",
"def get_device\n p \"------------------------->>>>>>>>>>>>>>>>>>>>>.. #{params[:devise_id]}\"\n @device = Mobdevise.where(:devise_id => params[:devise_id]).first\n # @device = Mobdevise.find_by_devise_id(params[:device_id])\n end",
"def devices; end",
"def live_look\n ids = params[:device_ids].split(',')\n if ids.empty?\n flash[:warning] = \"Please select at least one vehicle to view on the map.\"\n redirect_to devices_path\n return\n end\n\n @devices = current_user.devices\n @device_ids = params[:device_ids]\n\n respond_to do |format|\n format.html\n format.json {\n render :json => @devices.to_json(\n :methods => [:color, :connected],\n :include => {\n :position => {\n :methods => :time_of_day\n } \n }\n )\n }\n end\n end",
"def list_devices(multi)\n\t\t\tmulti = $redis.get_multi_id multi\n\t\t\tif $redis.knows_multi? multi\n\t\t\t\tputs \"=== Sensors ===\"\n\t\t\t\t$redis.list(:sensor, multi).sort.each do |pin, conf|\n\t\t\t\t\ts = \"#{pin} : #{conf[:name]} #{conf[:profile]}\"\n\t\t\t\t\ts << \" - Period : #{conf[:period]}\" if conf[:period]\n\t\t\t\t\tputs s\n\t\t\t\tend\n\t\t\t\tputs \"=== Actuators ===\"\n\t\t\t\t$redis.list(:actuator, multi).sort.each do |pin, conf|\n\t\t\t\t\ts = \"#{pin} : #{conf[:name]} #{conf[:profile]}\"\n\t\t\t\t\ts << \" - Period : #{conf[:period]}\" if conf[:period]\n\t\t\t\t\tputs s\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tputs \"The multiplexer doesn't exist\"\n\t\t\tend\n\t\tend",
"def index\n @rooms = Room.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rooms }\n end\n end",
"def show\n @pdevice = Pdevice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pdevice }\n end\n end",
"def admin_room_device_params\n params.require(:admin_room_device).permit(:user_id, :room_id, :name, :amount, :status, :description)\n end",
"def show\n respond_to do |format|\n if @room\n format.html { render :show }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :error, status: @error[:status] }\n format.json { render json: {error: @error[:message]}, status: @error[:status] }\n end\n end\n end",
"def my_notes\n device = params.permit(:device_id)\n render json: GeoNote.where(device_id: device[:device_id]).all\n end",
"def show\n @gcm_device = GcmDevice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gcm_device }\n end\n end",
"def show\n room = PublicRoom.find_by_escape_room_id(params[:id])\n if room.nil?\n render json: { success: false, message: 'Room needs to be public' }, status: :bad_request\n return\n end\n room_serv = RoomServices.new\n req_vertex = GetVerticesRequest.new(params[:id])\n res_vertex = room_serv.get_vertices(req_vertex)\n req_room_images = GetRoomImagesRequest.new(params[:id])\n res_room_images = room_serv.room_images(req_room_images)\n render json: { success_vertex: res_room_images.success, message_vertex: res_vertex.message,\n data_vertex: res_vertex.data, success_room_images: res_room_images.success,\n message_room_images: res_room_images.message,\n data_room_images: res_room_images.data }, status: :ok\n rescue StandardError\n render json: { success: false, message: 'Error internally' }, status: 500\n end",
"def find_device\n @device = Device.find(params[:device_id])\n end",
"def show\n @user=User.find(params[:user_id])\n @[email protected](params[:id])\n render json: @room if stale?(@room)\n end",
"def show\n @hostel_room = HostelRoom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hostel_room }\n end\n end",
"def new\n if current_user.admin?\n @device = Device.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @device }\n end\n else\n redirect_to unauthorized_path\n end\n end",
"def show\r\n @device = Device.find_by_id(params[:id])\r\n\r\n if @device.nil?\r\n @devices = Device.all\r\n flash[:alert] = \"Your device was not found!\"\r\n render \"index\"\r\n else\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @device }\r\n end\r\n end\r\n\r\n end",
"def show\n @device = Device.find(params[:id])\n end",
"def index\n if current_user\n if current_user.is_admin?\n @devices = Device.all\n else\n @devices = Device.where(:user_id => current_user.id)\n end\n else\n redirect_to login_url, :notice => \"Please login to manage your devices\"\n end\n end",
"def show\n @device_user = DeviceUser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device_user }\n end\n end",
"def find \n @user = User.find(params[:user_id])\n @room = @user.rooms.where(:name => params[:name])\n render json: @room if stale?(etag: @room.all, last_modified: @room.maximum(:updated_at))\n end",
"def show\n @lab_device = LabDevice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_device }\n end\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def index\n @devices = Device.all\n end",
"def devices\n response = get('/listDevices')\n devices = []\n response.body['devices'].each do |d|\n devices << Device.from_json(d, @token, @logger)\n end\n devices\n end",
"def get_room_mate\n \tif !params[:room_mate_id].blank?\n \t\t@user = User.find_by_id params[:room_mate_id]\n \t\tif [email protected]?\n \t\t\trender :json => {:success => true, :message => \"Room mate found\", :user => @user}, :status => 200\n \t\telse\n \t\t\trender :json => {:success => false, :message => \"Room mate not found\"}, :status => :not_acceptable\n \t\tend\n\t\tend \t\n end",
"def server_devices_list\n if !ccl_active? or (session[:usertype] != \"admin\" and ccl_active?)\n dont_be_so_smart\n redirect_to :controller => \"callc\", :action => \"main\" and return false\n end\n @page_title = _('Server_devices')\n @page_icon = 'server.png'\n @help_link = \"http://wiki.kolmisoft.com/index.php/Multi_Server_support\"\n # ip_auth + server_devices.server_id is null + server_devices.server_id is not that server + not server device(which were created with server creation)\n @devices = Device.select(\"devices.*,server_devices.server_id AS serv_id\").joins(\"LEFT JOIN server_devices ON (server_devices.device_id = devices.id AND server_devices.server_id = #{params[:id].to_i}) LEFT JOIN users ON (users.id = devices.user_id)\").where(\"(host != 'dynamic' OR device_type != 'SIP') AND users.owner_id = #{current_user.id} AND server_devices.server_id is null AND user_id != -1 AND name not like 'mor_server_%'\").order(\"extension ASC\").all\n end",
"def index\n# @devices = Device.all\n end",
"def show\n @roombot = Roombot.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @roombot }\n end\n end",
"def update\n @type = params[:actionType]\n\n respond_to do |format|\n if @admin_room_device.update(admin_room_device_params)\n @admin_room_devices = Admin::RoomDevice.where(user: current_user).paginate(:page => params[:page])\n format.html { redirect_to @admin_room_device, notice: 'Room device was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_room_device }\n format.js { render :layout => false }\n else\n format.html { render :edit }\n format.json { render json: @admin_room_device.errors, status: :unprocessable_entity }\n format.js { render :layout => false }\n end\n end\n end",
"def devices\n return @devices\n end",
"def get_room(params)\n room_id = self.room_id || params.delete(:room_id)\n raise ArgumentError.new(\"room_id required\") unless room_id\n res = call_api(:method => :get, :uri => @api_base.merge(\"room/#{room_id}\"), :query_params => params)\n return unless res.successful?\n Room::Detail.new(res.data)\n end",
"def index\n ota_rooms = Array.new\n if params[:room].nil? && params[:ota].nil?\n # 自分の施設情報だけを返す\n\n current_user.ota.select do |otum|\n otum.provider == 'default'\n end.each do |otum|\n ota_rooms.concat(otum.ota_rooms)\n end\n elsif params[:ota].nil?\n room = Room.find_by(id: params[:room].to_i)\n # 部屋IDが存在しない場合\n if room.nil?\n response = {\n status: 'NotFound',\n message: 'room not found'\n }\n return render json: response, status: 404\n end\n # 権限がない場合\n if current_user.id != room.user.id\n response = {\n status: 'NotFound',\n message: 'room not found'\n }\n return render json: response, status: 404\n end\n ota_rooms.concat(room.ota_rooms)\n elsif params[:room].nil?\n otum = Otum.find_by(id: params[:ota].to_i)\n # OTA IDが存在しない場合\n if otum.nil?\n response = {\n status: 'NotFound',\n message: 'ota not found'\n }\n return render json: response, status: 404\n end\n # 権限がない場合\n if current_user.id != otum.user.id\n response = {\n status: 'NotFound',\n message: 'ota not found'\n }\n return render json: response, status: 404\n end\n ota_rooms.concat(otum.ota_rooms)\n else\n # facility=[facility_id]\n facility = Facility.find_by(id: params[:facility].to_i)\n # 施設IDが存在しない場合\n if facility.nil?\n response = {\n status: 'NotFound',\n message: 'ota_rooms not found'\n }\n return render json: response, status: 404\n end\n # ユーザーの施設IDでない場合\n if facility.user_id != current_user.id\n response = {\n status: 'NotFound',\n message: 'ota_rooms not found'\n }\n return render json: response, status: 404\n end\n ota_rooms.concat(facility.ota_rooms)\n end\n\n render json: {\n status: 'Success',\n message: '',\n ota_rooms: ota_rooms.as_json(except: [\n :created_at,\n :updated_at\n ])\n }, status: 200\n end",
"def index\n @user = User.find(params[:user_id])\n @rooms = @user.rooms.all\n render json: @rooms if stale?(etag: @rooms.all, last_modified: @rooms.maximum(:updated_at))\n end",
"def destroy\n @admin_room_device.destroy\n respond_to do |format|\n format.html { redirect_to admin_room_devices_url, notice: 'Room device was successfully destroyed.' }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n end",
"def show\n @serverroom = Serverroom.find(params[:id])\n @serverrack = Serverrack.new\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serverroom }\n end\n end",
"def index\n if authorise(request)\n auth_token = request.headers['Authorization1'].split(' ').last\n req = GetRoomsRequest.new(auth_token)\n serv = RoomServices.new\n resp = serv.get_rooms(req)\n render json: { status: resp.success, message: resp.message, data: resp.data }, status: :ok\n else\n render json: { status: false, message: 'Unauthorized' }, status: 401\n end\n end",
"def get_device( id_or_uid)\n \n # try to find with device id\n @device = Device.where(\"id = ? OR uid= ?\", id_or_uid.to_i, id_or_uid).take\n \n \n rescue ActiveRecord::RecordNotFound\n render json: {:message => \"Device not found\", :code => 404} , :status => :not_found\n return false\n \n end",
"def room_descriptions_method\r\n my_port = 8081\r\n htttproomnumber = $roomnumber\r\n roomsNtext = \"/#{htttproomnumber}\"\r\n rooms_message = \"/rooms#{roomsNtext}\"\r\n url = URI.parse(\"http://localhost:#{my_port}#{rooms_message}\")\r\n req = Net::HTTP::Get.new(url.to_s)\r\n res = Net::HTTP.start(url.host, url.port){|http|\r\n http.request(req)\r\n }\r\n my_json = JSON.parse(res.body) \r\n return my_json[\"room\"].to_s\r\nend",
"def show\n if params[:id]\n current_user # initialize @current_user\n\n @room = {\n \t:name => params[:id],\n \t:url => RTCHelper::getRoomURL(params[:id]),\n \t:token => RTCHelper::getAuthToken(params[:id], @current_user)\n }\n else\n #\n # if there is no room, we really wanted to go to /rooms/index\n #\n redirect_to :action => 'index'\n end\n end",
"def show\n\t\t\t#check params device_code\n\t\t\tunless params[:device_code].blank? or params[:regId_code].blank?\n\t\t\t\t#check device exits\n\t\t\t\t@device = Device.find_by(code: params[:device_code])\n\t\t\t\t#neu co\n\t\t\t\tif @device\n\t\t\t\t\tif @device.status == false\n\t\t\t\t\t\t\t#render status =002\n\t\t\t\t\t\t\trender json:{status: 0, message:\"Device not used\",details:{name_device:@device.name,notification: 1,info:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddress:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttour_name:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlat:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlng:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdevice_id:@device.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tif @device.reg_id.blank?\n\t\t\t\t\t\t\[email protected](reg_id:params[:regId_code])\n\t\t\t\t\t\t\t#check status\n\t\t\t\t\t\t\t# if don't joined tour\n\t\t\t\t\t\t\t#joined tour\n\t\t\t\t\t\t\t@tourguide = Tourguide.find_by(device_id:@device.id)\n\t\t\t\t\t\t\t# @tourguide_info = @tourguide\n\t\t\t\t\t\t\t# @tourguide_info[:abc] = @device.lat\n\t\t\t\t\t\t\t# @tourguide[:lng] = @device.lng\n\t\t\t\t\t\t\tif @tourguide #tourguide\n\t\t\t\t\t\t\t\t#render tourguide info\n\t\t\t\t\t\t\t\t\trender json:{ \n\t\t\t\t\t\t\t\t\t\t\t\t\tstatus:0,message: \"Success\",details:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup: 1,name_device: @device.name,notification:2,info:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid:@tourguide[:id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname:@tourguide[:name],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddress:@tourguide[:address],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttour_name:@tourguide.tours.first.name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\timages:\"http://\"+request.host_with_port+\"/assets/images_tourguide/\"[email protected],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlat:@device.lat == nil ? \"\" : @device.lat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlng:@device.lng == nil ? \"\" : @device.lng,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone:@tourguide[:phone],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdevice_id:@device.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse#traveller\n\t\t\t\t\t\t\t\t# render json:{url:request.host_with_port}\n\t\t\t\t\t\t\t\t#get traveller info\n\t\t\t\t\t\t\t\t@traveller = Traveller.find_by(device_id:@device.id)\n\t\t\t\t\t\t\t\t#render traveller info\n\t\t\t\t\t\t\t\trender json:{ \n\t\t\t\t\t\t\t\t\t\t\t\tstatus:0,message: \"Success\",details:{\n\t\t\t\t\t\t\t\t\t\t\t\t\tgroup: 0,name_device: @device.name,notification:2,info:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid:@traveller[:id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tname:@traveller[:name],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taddress:@traveller[:address],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttour_name:@traveller.tours.first.name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timages:\"http://\"+request.host_with_port+\"/assets/images_travellers/\"[email protected],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlat:@device.lat == nil ? \"\" : @device.lat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlng:@device.lng == nil ? \"\" : @device.lng,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone:@traveller[:phone],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdevice_id:@device.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telsif @device.reg_id != params[:regId_code]\n\t\t\t\t\t\t\trender json:{ status: 103, message:\"RegId invalid \"}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t#joined tour\n\t\t\t\t\t\t\t@tourguide = Tourguide.find_by(device_id:@device.id)\n\t\t\t\t\t\t\t# @tourguide_info = @tourguide\n\t\t\t\t\t\t\t# @tourguide_info[:abc] = @device.lat\n\t\t\t\t\t\t\t# @tourguide[:lng] = @device.lng\n\t\t\t\t\t\t\tunless @tourguide == nil #tourguide\n\t\t\t\t\t\t\t\t#render tourguide info\n\t\t\t\t\t\t\t\t\trender json:{ \n\t\t\t\t\t\t\t\t\t\t\t\t\tstatus:0,message: \"Success\",details:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup: 1,name_device: @device.name,notification:2,info:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid:@tourguide[:id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname:@tourguide[:name],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddress:@tourguide[:address],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttour_name:@tourguide.tours.first.name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\timages:\"http://\"+request.host_with_port+\"/assets/images_tourguide/\"[email protected],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlat:@device.lat == nil ? \"\" : @device.lat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlng:@device.lng == nil ? \"\" : @device.lng,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone:@tourguide[:phone],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdevice_id:@device.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse#traveller\n\t\t\t\t\t\t\t\t# render json:{url:request.host_with_port}\n\t\t\t\t\t\t\t\t#get traveller info\n\t\t\t\t\t\t\t\t@traveller = Traveller.find_by(device_id:@device.id)\n\t\t\t\t\t\t\t\t#render traveller info\n\t\t\t\t\t\t\t\trender json:{ \n\t\t\t\t\t\t\t\t\t\t\t\tstatus:0,message: \"Success\",details:{\n\t\t\t\t\t\t\t\t\t\t\t\t\tgroup: 0,name_device: @device.name,notification:2,info:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tid:@traveller[:id],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tname:@traveller[:name],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\taddress:@traveller[:address],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttour_name:@traveller.tours.first.name,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\timages:\"http://\"+request.host_with_port+\"/assets/images_travellers/\"[email protected],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlat:@device.lat == nil ? \"\" : @device.lat,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlng:@device.lng == nil ? \"\" : @device.lng,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone:@traveller[:phone],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tdevice_id:@device.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\telse #don't already system\n\t\t\t\t\t\t#render status = 001\n\t\t\t\t\t\trender json:{status:0,message:\"Device not already in system\",details:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tgroup: \"\",name_device:\"\",notification:0,info:{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tid:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\taddress:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttour_name:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlat:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlng:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tphone:\"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdevice_id:\"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\tend\n\t\t\telse\n\t\t\t\trender json:{status: 104, message:\"Not found information device code or regID code\"}\n\t\t\tend\n\t\tend",
"def device\r\n logger.info(\"UserController::device:---#{params}\")\r\n end",
"def show\n @request = Request.find(params[:id])\n\n if current_user.admin?\n @available_rooms = get_available_rooms @request\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @request }\n end\n end",
"def show\n @room = Room.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @room }\n format.js {}\n end\n end",
"def show\n @room = Room.find(params[:id])\n end",
"def show\n @room = Room.find(params[:id])\n end",
"def new\n @device = Device.new :name => params[:name], :deviceid => params[:deviceid]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @device }\n end\n end",
"def index\n @hostel_rooms = HostelRoom.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hostel_rooms }\n end\n end",
"def show\n @device = Device.find(params[:device_id])\n @job = @device.jobs.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @job }\n end\n end",
"def show\n @rooms = Room.all\n end",
"def devices=(value)\n @devices = value\n end",
"def index\n @branch_rooms = Room.get_all_rooms(params[:branch_id])\n \n render json: @branch_rooms\n end",
"def index\n @restrooms = Restroom.all\n end",
"def index\n @q = apply_scopes(Device).all.search(params[:q])\n @devices = @q.result(distinct: true).page(params[:page])\n\n respond_with(@devices)\n end",
"def index\n @room_configs = RoomConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @room_configs }\n end\n end",
"def new\n @mydevice = Mydevice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mydevice }\n end\n end",
"def show\n @room = Room.includes(:owner).find(params.require(:id))\n if @room\n success(body: @room, options: { include: [:owner] })\n else\n not_found\n end\n end",
"def show\n buildingId = params[:id]\n @room = Room.where(building_id: buildingId)\n end"
] | [
"0.6824344",
"0.6804012",
"0.6803329",
"0.65179455",
"0.6457647",
"0.64439625",
"0.6427771",
"0.6396508",
"0.63806874",
"0.637307",
"0.6329829",
"0.63195837",
"0.62772506",
"0.6271403",
"0.6269527",
"0.6245627",
"0.62361383",
"0.6235783",
"0.6235311",
"0.6235311",
"0.6235311",
"0.6233423",
"0.62320924",
"0.6225886",
"0.62164867",
"0.62164867",
"0.62164867",
"0.62085676",
"0.618125",
"0.61700684",
"0.6143218",
"0.6132294",
"0.6121216",
"0.6120001",
"0.611911",
"0.6116011",
"0.61122036",
"0.6094738",
"0.6078582",
"0.6072512",
"0.6072068",
"0.60200715",
"0.60190725",
"0.6007811",
"0.5991353",
"0.5987318",
"0.5968828",
"0.5965067",
"0.594149",
"0.5940636",
"0.59252524",
"0.5909787",
"0.59025824",
"0.59024084",
"0.58954483",
"0.589241",
"0.5890604",
"0.5888706",
"0.58869934",
"0.5883772",
"0.5879534",
"0.5868821",
"0.5863848",
"0.5863848",
"0.5863848",
"0.5863848",
"0.5863848",
"0.584031",
"0.58300376",
"0.5821595",
"0.5820144",
"0.5816815",
"0.5815896",
"0.58010304",
"0.58007836",
"0.5798687",
"0.57932234",
"0.57886434",
"0.5787527",
"0.5783744",
"0.5758577",
"0.5758552",
"0.57433146",
"0.57428414",
"0.5741435",
"0.5741239",
"0.5735342",
"0.5734619",
"0.5734619",
"0.57335925",
"0.5722482",
"0.5719427",
"0.57101697",
"0.57080114",
"0.5705455",
"0.57019025",
"0.56892675",
"0.5688671",
"0.5683438",
"0.5670231",
"0.5666369"
] | 0.0 | -1 |
POST /admin/room_devices POST /admin/room_devices.json | def create
@type = params[:actionType]
@admin_room_device = Admin::RoomDevice.new(admin_room_device_params)
@admin_room_device.user = current_user
respond_to do |format|
if @admin_room_device.save
@admin_room_devices = Admin::RoomDevice.where(user: current_user).paginate(:page => params[:page])
format.html { redirect_to @admin_room_device, notice: 'Room device was successfully created.' }
format.json { render :show, status: :created, location: @admin_room_device }
format.js { render :layout => false }
else
format.html { render :new }
format.json { render json: @admin_room_device.errors, status: :unprocessable_entity }
format.js { render :layout => false }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin_room_device_params\n params.require(:admin_room_device).permit(:user_id, :room_id, :name, :amount, :status, :description)\n end",
"def add_device(serial)\n res = @client.post(\"#{path}/devices\", nil, { serial: serial }, \"Content-Type\" => \"application/json\")\n\n ::M2X::Client::Device.new(@client, res.json) if res.success?\n end",
"def create\n @room = TmuAdmin::Room.new(room_params)\n\n if @room.save\n render :json => {}\n else\n error_messages = @room.errors.full_messages.collect { |error_message| \"<li>\" + error_message + \"</li>\" }\n\n render :json => {:errorMsg => \"<ul>\" + error_messages.join(\"\") + \"</ul>\"}\n end\n end",
"def add_device(serial)\n res = @client.post(\"#{path}/devices\", nil, { serial: serial }, \"Content-Type\" => \"application/json\")\n Device.new(@client, res.json) if res.success?\n end",
"def create\n @admin_device = AdminDevice.new(admin_device_params)\n\n respond_to do |format|\n if @admin_device.save\n format.html { redirect_to @admin_device, notice: 'Admin device was successfully created.' }\n format.json { render :show, status: :created, location: @admin_device }\n else\n format.html { render :new }\n format.json { render json: @admin_device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_device_params\n params.require(:admin_device).permit(:serial)\n end",
"def set_admin_room_device\n @admin_room_device = Admin::RoomDevice.find(params[:id])\n end",
"def create\n @device = @user.devices.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to user_devices_path(@user), notice: 'Device was successfully added.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.permit([:name, :uuid, :token])\n end",
"def device_params\n params.require(:device).permit(:name, :details, :category_id, :location, :status)\n end",
"def create\n @room = Room.new(room_params)\n @room.admin_id = current_user.id\n @room.users.push(current_user)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: \"Room was successfully created.\" }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_room = Room.new(admin_room_params)\n @room_detail = @admin_room.room_detail\n\n respond_to do |format|\n if @admin_room.save\n format.html { redirect_to @admin_room, notice: 'Room was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_room }\n else\n format.html { render action: 'new' }\n format.json { render json: @admin_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def register\n @device = Device.create(devices_params)\n if @device.valid?\n render json: @device, status: :created\n else\n render json: { error: 'failed to register device' }, status: :internal_server_error\n end\n end",
"def device_params\n params.require(:device).permit(\n :patient_id,\n :platform,\n :token\n )\n end",
"def create\n @room = Room.new(params[:room])\n\n if @room.save\n render :json => @room, :status => :created, :location => @room\n else\n render :json => @room.errors, :status => :unprocessable_entity\n end\n end",
"def device_params\n params.require(:device).permit!\n end",
"def create\n @device = Device.create!(device_params)\n json_response(@device, :created)\n end",
"def create\n @user=User.find(params[:user_id])\n @room = @user.rooms.create(room_params)\n if @room.save\n render json: @room, status: :created\n else\n render json: @room.errors, status: :unprocessable_entity\n end\n end",
"def create\n @room = Room.new(room_params)\n @room.name = \"Room \" [email protected]\n @room.admin_id = current_admin.id\n respond_to do |format|\n if @room.save\n format.html { redirect_to rooms_path , notice: 'Room was successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:tele, :pawprint, :name, :email, :secret_key )\n end",
"def register_device\n user = User.find(params[:user_id])\n\n user.devices.find_or_create_by(token: params[:token], os: params[:os])\n\n head :ok\n end",
"def register\n physical_entity = {name: @name, description: @description, location:@location}\n virtual_entity = {uuid: nil}\n body = {body: {device: {name: @name, \n description: @description, \n model_name: @model, \n location: @location,\n physical_entity_attributes: physical_entity,\n virtual_entity_attributes: virtual_entity}}}\n response = self.class.post(API+'/devices', body)\n @uuid = response['uuid']\n end",
"def create_device\n phone = Phone.where('uuid=?', params[:device_uuid]).first\n if phone\n phone.token = params[:regId]\n phone.save\n else\n if params[:is_android] == \"true\"\n p = Phone.create(:is_android => true, :uuid => params[:device_uuid] , :token => params[:regId])\n else\n p = Phone.create(:is_android => false, :uuid => params[:device_uuid] , :token => params[:regId])\n end\n end\n render :status=>200, :json=>{:success=>\"1\", :message=>\"Success\"}\n end",
"def set_room\n @room = current_user.rooms.find(params[:id])\n @devices_log = @room.devices.last\n end",
"def device_params\n params.require(:device).permit(:imei, :serial_num, :model_id)\n end",
"def create\n @device = Device.first\n if @device == nil\n @device = Device.new(device_params)\n @device.save!\n end\n render json: {\"device\": @device}, status: :created\n end",
"def create\n @device = Device.new(device_params)\n @device.user = current_user\n if @device.save\n render json: @device\n end\n end",
"def devices=(value)\n @devices = value\n end",
"def device_params\n params.require(:device).permit(:name, :beacon_id, :device_type)\n end",
"def register\n device = Device.create(device_params)\n if device.valid? \n render json: device, status: 200\n else \n render json: {\"error\": device.errors.full_messages}, status: 500\n end\n end",
"def device_params\n params.require(:device).permit(:device_id)\n end",
"def create\n @device = Device.new(device_params)\n\n # write device to database\n if @device.save\n redirect_to devices_path, :notice => 'Gerät erfolgreich erstellt.'\n else\n render 'new'\n end\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to devices_path, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.fetch(:device, {}).permit(:name, :model, :device_id, :place, :latitude, :longitude)\n end",
"def device_id\n 'bedroom'\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.json { render 'show', status: :created }\n else\n format.json { render json: {errors: @device.errors}, status: :unprocessable_entity }\n end\n end\n end",
"def create\n p = admin_room_params\n p[:building_id] = params[:building_id]\n @admin_room = Room.new(p)\n\n respond_to do |format|\n if @admin_room.save\n format.html { redirect_to [:admin, @admin_room.building], notice: 'Room was successfully created.' }\n # format.json { render :show, status: :created, location: @admin_room.building }\n else\n format.html { render :new }\n # format.json { render json: @admin_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:latitude, :longitude, :serial, :status, :imei)\n end",
"def register\n puts \"register\"\n ApiBase.client.put(\"/device/#{self.id}\", self.to_json)\n end",
"def room_params\n format params.require(:room).permit(:room, :platform)\n end",
"def device_params\n params.require(:device).permit(:name)\n end",
"def device(name, params = {})\n Celluloid::Logger.info \"Registering device '#{name}'...\"\n self.device_types ||= []\n self.device_types << {:name => name}.merge(params)\n end",
"def create\n @device = Device.new params[:device]\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render json: @device, status: :created, location: @device }\n else\n format.html { render action: \"new\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def room_params\n params.require(:room).permit(:name, :ubication, :location_id, :noise, :sockets, :availability)\n end",
"def create\n @room = current_user.rooms.create({name: params[:room][:name],\n max_user: params[:room][:max_user],\n host_id: current_user.id,\n salvo: params[:room][:salvo],\n occupancy: 1\n })\n @room.set_user_status(current_user, USER_STATUS[:join])\n @room.status = ROOM_STATUS[:open]\n # Broadcast a message\n channel = \"server_channel\"\n respond_message = {\n message: \"a room created\",\n }\n\n self.broadcast_message_to_channel(channel, :room_created, respond_message)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render json: @room.to_hash_with_users(current_user).to_json, status: :created, location: @room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def device_params\n params.require(:device).permit(:name, :device_type, :location, :public_ip, :private_ip)\n end",
"def ota_room_params\n params.require(:ota_room).permit(:uid, :status, :ota_id, :room_id)\n end",
"def devices(params={})\n res = @client.get(\"#{path}/devices\", params)\n\n res.json[\"devices\"].map{ |atts| ::M2X::Client::Device.new(@client, atts) } if res.success?\n end",
"def create\n\t\t@user=User.find(params[:user_id])\n\t\t@room = @user.rooms.find(params[:room_id])\n\t\t@device = @room.devices.find(params[:device_device_id])\n \t\t@note = @device.notes.create(note_params)\n \t\[email protected]_id= @device.user_id\n \t\[email protected]_id = @device.room_id\n \tif @note.save\n \t\trender json: @note, status: :created\n \telse\n \t\trender json: @note.errors, status: :unprocessable_entity\n \tend\n\tend",
"def create\n @device = Device.new(device_params)\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(params = {})\n rest_request(:post, \"#{self.class.base_url}api/v2/devices\", payload: query_params.merge(params))\n true\n end",
"def create\n @device = Device.new(params[:device])\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render json: @device, status: :created, location: @device }\n else\n format.html { render action: \"new\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:name, :sn, :model, :coordinate, :address, :floor, :power, :powerstatu, :repottime, :status, :imsi, :timestamp, :swver, :hwver)\n end",
"def create\n @device = Device.new(device_params)\n @device.uuid = SecureRandom.uuid\n\n respond_to do |format|\n if @device.save\n flash[:notice] = \"Device created successfully\"\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n flash[:notice] = \"Shop creation unsuccessful\"\n format.html { render :new }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:name, :long_name, :carrier, :os, :version)\n end",
"def create\n \n filteredParams = params.require(:room).permit(:name, :owner_id, :privacy, :password)\n\n if filteredParams[\"privacy\"] && filteredParams[\"privacy\"] == \"on\"\n filteredParams[\"privacy\"] = \"private\"\n else\n filteredParams[\"privacy\"] = \"public\"\n end \n\n if filteredParams[\"name\"].empty?\n res_with_error(\"Invalid parameters\", :bad_request)\n return (false)\n end\n if filteredParams[\"privacy\"] == \"private\"\n if filteredParams[\"password\"].empty?\n res_with_error(\"None empty password required if the room is private\", :bad_request)\n return (false)\n else\n roomPassword = BCrypt::Password.create filteredParams[\"password\"]\n filteredParams[\"password\"] = roomPassword\n end\n end\n\n if !filteredParams[\"name\"] || filteredParams[\"name\"].length == 0 || filteredParams[\"name\"].blank?\n res_with_error(\"Empty Room Name\", :bad_request)\n return (false)\n elsif filteredParams[\"name\"] && filteredParams[\"name\"].length > 42\n res_with_error(\"Room name too long\", :bad_request)\n return (false)\n end\n\n @room = Room.create(filteredParams)\n if @room && !current_user.rooms_as_admin.include?(@room)\n @rla = RoomLinkAdmin.new(room: @room, user: current_user)\n @rla.save\n end\n \n respond_to do |format|\n if @room.save\n ActionCable.server.broadcast \"room_channel\", type: \"rooms\", description: \"create\", user: current_user\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: {alert: \"Name already taken\"}, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:mac_address, :ipv4, :ipv6, :kind, :last_seen, :extra, :given_name)\n end",
"def parseDeviceData(doc, params)\n \n dev_type = (doc.find_first('//xmpp2rest/user/device/dev_type')) ? doc.find_first('//xmpp2rest/user/device/dev_type').content : nil\n password = (doc.find_first('//xmpp2rest/user/device/password')) ? doc.find_first('//xmpp2rest/user/device/password').content : nil\n \n if not dev_type or not password\n raise Exception.new(\"Missing elements data for creating new device!\")\n end \n \n params.merge!({:dev_type => dev_type})\n params.merge!({:password => password})\n \n return params\n end",
"def device_params\n params.require(:device).permit(:owner, :name, :device_type, :location, :public_ip, :private_ip, :device_note, :addons, :general_status, :general_reloaded, :osname, :osram, :osprocessor, :detail)\n end",
"def create\n @mydevice = Mydevice.new(params[:mydevice])\n\n respond_to do |format|\n if @mydevice.save\n format.html { redirect_to @mydevice, notice: 'Mydevice was successfully created.' }\n format.json { render json: @mydevice, status: :created, location: @mydevice }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mydevice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:name, :venue_id, :enter, :leave)\n end",
"def create\n @device = Device.new(device_params)\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render action: 'show', status: :created, location: @device }\n else\n format.html { render action: 'new' }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def room_params\n params.require(:room).permit(:room_no, :size, :lib_name, :status)\n end",
"def create\n @room = current_user.rooms.new(room_params)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.permit(:macaddress, :nickname, :description, :user_id, :stolen, :secret_key, :format)\n end",
"def create\n param = room_params\n \n roomtype=Roomtype.new\n roomtype.AC=param[:AC]\n roomtype.beds=param[:beds].to_i\n param.delete(\"AC\")\n param.delete(\"beds\")\n @room = current_hotel.rooms.build(param)\n respond_to do |format|\n if @room.save\n [email protected]\n roomtype.save\n format.html { redirect_to @room, notice: \"Room was successfully created.\" }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_create_params\n params.require(:device).permit(:name, :device_type_id, :primary_member_id, :os_version, :wifi_mac, :build_version, :product_name, :model_name, :mac_address)\n end",
"def create\n if current_user.utype == \"admin\"\n @room = Room.new(room_params)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room }\n flash[:success] ='Room was successfully created.'\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to unauthorized_url\n end\n end",
"def room_params\n params.require(:room).permit(:name, :topic, :admin_id)\n end",
"def create\n @device = Device.new(:userid => current_user.id, :deviceid => params[:device][:deviceid], :hiveid => params[:device][:hiveid], \n :state => params[:device][:state], :version => params[:device][:version], :details => params[:device][:details])\n# @device = Device.new(params[:device])\n\n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render json: @device, status: :created, location: @device }\n else\n format.html { render action: \"new\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @room = Room.new(params[:room])\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render json: @room, status: :created, location: @room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @room = Room.new(params[:room])\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render json: @room, status: :created, location: @room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params.require(:device).permit(:User_id, :Register_id)\n end",
"def device_params\n params.require(:device).permit(:user_id, :token, :app_id, :locale, :inactivated_at, :banner, :badge, :sound, :app_name, :app_version, :os_name, :os_version, :device_name, :device_version)\n end",
"def create\r\n @device = Device.new(params[:device])\r\n\r\n respond_to do |format|\r\n if @device.save\r\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\r\n format.json { render json: @device, status: :created, location: @device }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @device.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def device_params\n params.permit(:name)\n end",
"def create\n @tddbc_room = Tddbc::Room.new(params[:tddbc_room])\n\n respond_to do |format|\n if @tddbc_room.save\n format.html { redirect_to @tddbc_room, notice: 'Room was successfully created.' }\n format.json { render json: @tddbc_room, status: :created, location: @tddbc_room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tddbc_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def terminal_device_params\n params.require(:terminal_device).permit(:name)\n end",
"def create\n @device = Device.where(user_id: auth_user.id, push_token: params[:device][:push_token] ).first if params[:device] && params[:device][:push_token].present?\n @device ||= Device.new(params[:device])\n @device.user_id = auth_user.id\n \n respond_to do |format|\n if @device.save\n format.html { redirect_to @device, notice: 'Device was successfully created.' }\n format.json { render json: { device: @device.as_json, success: true } }\n else\n flash[:error] = @device.errors.values.join('. ')\n puts \" Errors: #{@device.errors.keys}\"\n\n format.html { render action: \"new\" }\n format.json { render json: make_json_status_hash(false) }\n end\n end\n end",
"def create\n add_breadcrumb \"Merchants\", epsadmin_merchants_path\n add_breadcrumb \"#{@merchant.first_name}\", epsadmin_merchant_path(@merchant.merchant_uniq_id)\n add_breadcrumb \"Devices\",epsadmin_merchant_devices_path(@merchant.merchant_uniq_id)\n @epsadmin_device = Device.new(device_params)\n @epsadmin_device.modifier_id=current_user.id\n @epsadmin_device.device_make = params[:device_make]\n #Generation of terminal id\n @epsadmin_device.terminal_id = rand.to_s[2..5] + params[:device][:merchant_id].first(2)\n #End\n dev=Device.not_in(:device_status=>\"deactivated\").map(&:device_serial_number)\n\n if (params[:device_make] == \"Falcon Plus\" && params[:device][:bank_mmid] != \"\") || (params[:device_make] == \"Leopard\" && params[:device][:pg_merchant_id] != \"\" && params[:device][:pg_key] != \"\" && params[:device][:pg_sat] != \"\" && params[:device][:tablet_serial_number] != \"\")\n if !(dev.include?(params[:device][:device_serial_number]))\n respond_to do |format|\n if @epsadmin_device.save\n format.html { redirect_to epsadmin_merchant_devices_path, notice: 'Device was successfully created.' }\n format.json { render json: epsadmin_merchant_devices_path, status: :created, location: @epsadmin_device }\n else\n format.html { render action: \"new\" }\n format.json { render json: @epsadmin_device.errors, status: :unprocessable_entity }\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n @epsadmin_device.errors.add(:device_serial_number, 'is already allocated to some device')\n end\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n @epsadmin_device.errors.add(:base, 'All the fields in Bank Details section must be filled')\n end\n end\n\n end",
"def create\n puts params\n @device = Device.where(phone_number: params[:phone_number]).first \n respond_to do |format|\n if @device.nil?\n format.json { render json: {message: \"Sorry, the submited device is not registered\"}, status: :ok }\n elsif @device.register_device(current_user)\n @device.alias_name = params[:alias_name]\n @device.save\n format.json { render json: {message: \"The submited device was registered succesfully\"}, status: :ok }\n else\n format.json { render json: {message: \"Sorry, the Device has already been registered\"}, status: :ok }\n end\n end\n end",
"def user_device_params\n params.require(:user_device).permit(:username, :device_id)\n end",
"def admin_room_params\n params.require(:room).permit(:title, :code)\n end",
"def create\n @room = Room.new(room_params)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @room = Room.new(room_params)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @room = Room.new(room_params)\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render :show, status: :created, location: @room }\n else\n format.html { render :new }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def device_params\n params[:device]\n end",
"def create\n device = current_user.owned_devices.create!(params_attributes)\n flash[:success] = 'Successfully created device'\n render_response(\n redirect_path: devices_path(category: :owned)\n )\n end",
"def room_params\n params.require(:room).permit(:owner_id, :name, {:user_ids => [] })\n\n end",
"def register_device(device)\n if !(user.blank?) then \n respond_to do |format|\n if device.save then \n format.html { redirect_to device, notice: 'device was successfully created.' }\n format.json { render :show, status: :created, location: @device }\n else\n format.html { render :new }\n format.json { render json: device.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n config_opentok\n session = @opentok.create_session request.remote_addr\n params[:room][:sessionId] = session.session_id\n \n @room = Room.new(params[:room])\n\n respond_to do |format|\n if @room.save\n format.html { redirect_to @room, notice: 'Room was successfully created.' }\n format.json { render json: @room, status: :created, location: @room }\n else\n format.html { render action: \"new\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t@room = Room.new(room_params) \n\n\t\trespond_to do |format|\n\t\t\tif @room.save\n\t\t\t\tformat.html { redirect_to @room, notice: 'Room was successfully created.' }\n\t\t\t\tformat.json { render json: @room, status: :created}\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @room.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def create\n @room = Room.new(room_params)\n\n if @room.save\n redirect_to admin_rooms_path, notice: 'Room was successfully created.'\n else\n render new\n end\n end",
"def users_room_params\n params.require(:users_room).permit(:user_id, :rooms_id)\n end",
"def devices_params\n params.require(:device).permit(:phone_number, :carrier)\n end",
"def device_params\n params.require(:device).permit(:installation_id, :push_token)\n end"
] | [
"0.68013006",
"0.65333265",
"0.65138197",
"0.6447971",
"0.6410266",
"0.63944453",
"0.63839567",
"0.6297241",
"0.62708104",
"0.62531793",
"0.6242928",
"0.62335235",
"0.61935604",
"0.6179409",
"0.6148227",
"0.6144942",
"0.61443746",
"0.61279184",
"0.6111285",
"0.61031413",
"0.6091705",
"0.6090243",
"0.60862374",
"0.6083791",
"0.6081486",
"0.60486746",
"0.6026708",
"0.60263014",
"0.6020326",
"0.601751",
"0.6011993",
"0.6008368",
"0.60005295",
"0.5997968",
"0.5994382",
"0.598956",
"0.59754264",
"0.5957355",
"0.59487486",
"0.5941374",
"0.5936315",
"0.59334725",
"0.5930829",
"0.5929661",
"0.59156173",
"0.59120667",
"0.5911917",
"0.5904952",
"0.588858",
"0.588489",
"0.58808553",
"0.58808553",
"0.58808553",
"0.58808553",
"0.58805496",
"0.58650494",
"0.58629185",
"0.5845587",
"0.58421177",
"0.58190733",
"0.5814146",
"0.5813142",
"0.5809166",
"0.5800684",
"0.5794903",
"0.57941806",
"0.578696",
"0.57845974",
"0.57572645",
"0.5756758",
"0.5737899",
"0.5737692",
"0.5726993",
"0.5723244",
"0.5721791",
"0.5721791",
"0.5721385",
"0.5717992",
"0.57179123",
"0.5711678",
"0.57050794",
"0.57009864",
"0.56973183",
"0.569376",
"0.56866944",
"0.56826574",
"0.568223",
"0.56817716",
"0.56817716",
"0.56817716",
"0.5677656",
"0.56752545",
"0.5667251",
"0.56607914",
"0.56527436",
"0.56514114",
"0.5647557",
"0.5643252",
"0.5637728",
"0.5631779"
] | 0.6945448 | 0 |
PATCH/PUT /admin/room_devices/1 PATCH/PUT /admin/room_devices/1.json | def update
@type = params[:actionType]
respond_to do |format|
if @admin_room_device.update(admin_room_device_params)
@admin_room_devices = Admin::RoomDevice.where(user: current_user).paginate(:page => params[:page])
format.html { redirect_to @admin_room_device, notice: 'Room device was successfully updated.' }
format.json { render :show, status: :ok, location: @admin_room_device }
format.js { render :layout => false }
else
format.html { render :edit }
format.json { render json: @admin_room_device.errors, status: :unprocessable_entity }
format.js { render :layout => false }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n if @room.update(room_params)\n render json: @room, status: :ok, serializer: RoomSerializer\n else\n render json: @room.errors, status: :unprocessable_entity\n end\n end",
"def update\n @room = Room.find(params[:id])\n\n if @room.update_attributes(params[:room])\n head :ok\n else\n render :json => @room.errors, :status => :unprocessable_entity \n end\n end",
"def update\n respond_to do |format|\n if @admin_room.update(admin_room_params)\n format.html { redirect_to admin_rooms_path, notice: 'Room was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @admin_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_device.update(admin_device_params)\n format.html { redirect_to @admin_device, notice: 'Admin device was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_device }\n else\n format.html { render :edit }\n format.json { render json: @admin_device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.json { head :no_content }\n else\n format.json { render json: {errors: @device.errors}, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device.update(device_params)\n head :no_content\n end",
"def update\n if @room.update(room_params)\n head :no_content\n else\n render json: @room.errors, status: :unprocessable_entity\n end\n end",
"def update\n @restroom = Restroom.find(params[:id])\n authorize @restroom\n\n respond_to do |format|\n if @restroom.update_attributes(params[:restroom])\n format.html { redirect_to @restroom, notice: 'Restroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_admin_room_device\n @admin_room_device = Admin::RoomDevice.find(params[:id])\n end",
"def update\n @restroom = Restroom.find(params[:id])\n authorize! :update, @restroom\n\n respond_to do |format|\n if @restroom.update_attributes(params[:restroom])\n format.html { redirect_to @restroom, notice: 'Restroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @restroom = Restroom.find(params[:id])\n authorize! :update, @restroom\n\n respond_to do |format|\n if @restroom.update_attributes(params[:restroom])\n format.html { redirect_to @restroom, notice: 'Restroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @restroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @restroom.update(restroom_params)\n format.html { redirect_to @restroom, notice: 'Restroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update_attributes(params[:room])\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_room.update(admin_room_params)\n format.html { redirect_to [:admin, @admin_room.building], notice: 'Room was successfully updated.' }\n # format.json { render :show, status: :ok, location: @admin_room }\n else\n format.html { render :edit }\n # format.json { render json: @admin_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.json { render :show, status: :ok, location: @device }\n else\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @room = Room.find(params[:id])\n\n respond_to do |format|\n if @room.update_attributes(params[:room])\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @room = Room.find(params[:id])\n\n respond_to do |format|\n if @room.update_attributes(params[:room])\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # respond_to do |format|\n # if @device.update(device_params)\n # format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n # format.json { render :show, status: :ok, location: @device }\n # else\n # format.html { render :edit }\n # format.json { render json: @device.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def update\n\t\t#params[:device][:asset_ids] ||= []\n\t\tparams[:device][:register_ids] ||= []\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n flash[:notice] = 'Device was successfully updated.'\n format.html { redirect_to(@device) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @device.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @device.user == current_user or current_user.is_admin?\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render action: 'show', status: :ok, location: @device }\n else\n format.html { render action: 'edit' }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to devices_url, :notice => 'Access denied! You can update your device only'\n end\n end",
"def update\n @serverroom = Serverroom.find(params[:id])\n\n respond_to do |format|\n if @serverroom.update_attributes(params[:serverroom])\n format.html { redirect_to @serverroom, notice: 'Serverroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @serverroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # Filter only those valid to be updated\n updated_attributes = {}\n updated_attributes[:name] = params[:room][:name]\n updated_attributes[:max_user] = params[:room][:max_user]\n @room = current_user.rooms.find(params[:id])\n\n respond_to do |format|\n if @room.update_attributes(updated_attributes)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render json: @room.to_hash_with_users(current_user).to_json }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @room.update(room_params_update)\n format.html { redirect_to @room, :flash => { success: 'Room was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @device_name = args[:device_name] if args.key?(:device_name)\n @device_types = args[:device_types] if args.key?(:device_types)\n @effective_arg_span_length = args[:effective_arg_span_length] if args.key?(:effective_arg_span_length)\n @has_ambiguous_resolutions = args[:has_ambiguous_resolutions] if args.key?(:has_ambiguous_resolutions)\n @has_resolved_device_id = args[:has_resolved_device_id] if args.key?(:has_resolved_device_id)\n @room_name = args[:room_name] if args.key?(:room_name)\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to devices_path, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @request_room.update(request_room_params)\n format.html { redirect_to @request_room, notice: 'Request room was successfully updated.' }\n format.json { render :show, status: :ok, location: @request_room }\n else\n format.html { render :edit }\n format.json { render json: @request_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: t('default.room.updated') }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @error, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device = Device.find(params[:id])\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device = Device.find(params[:id])\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device = Device.find(params[:id])\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device = Device.find(params[:id])\n\n respond_to do |format|\n if @device.update_attributes(params[:device])\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to rooms_path, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @device.update(device_params)\n respond_with(@device, location: devices_url, notice: 'Device was successfully updated.')\n else\n respond_with(@devices)\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_room_metadata(company, room_id, params = {})\n $LOG.i \"running \" + __method__.to_s\n @client.put '/messages/v3/' + company + '/rooms/' + room_id, params\n end",
"def update\n respond_to do |format|\n if @room.update_attributes(room_params)\n format.html { redirect_to room_path(@room.slug), notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n concat_phone_numbers params[:guest]\n @tablet_guest = Tablet::Guest.find(params[:id])\n\n respond_to do |format|\n if @tablet_guest.update_attributes(params[:guest])\n format.json { render :json => @tablet_guest }\n else\n format.json { render :json => @tablet_guest.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device_model.update(device_model_params)\n format.html { redirect_to @device_model, notice: 'Device model was successfully updated.' }\n format.json { render :show, status: :ok, location: @device_model }\n else\n format.html { render :edit }\n format.json { render json: @device_model.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: \"Room was successfully updated.\" }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n puts @device.inspect\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :index, status: :ok, location: @device }\n else\n format.html { render :index }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n find_detail\n \n @device.attributes = params[:device]\n @device_type=DeviceType.find_by_name(params[:device][:device_type]).table\n @device_detail.attributes = params[@device_type]\n unless [@device, @device_detail].map(&:valid?).include?(false)\n @device.update_attributes!(params[:device])\n @device_detail.update_attributes!(params[@device_type])\n flash[:notice] = '设备参数修改成功!'\n redirect_to(@device)\n else\n @provider=Provider.find(:all)\n render :action => \"edit\"\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params)\n format.html { redirect_to @device, notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def admin_room_device_params\n params.require(:admin_room_device).permit(:user_id, :room_id, :name, :amount, :status, :description)\n end",
"def update\n respond_to do |format|\n if @room_config.update(room_config_params)\n format.html { redirect_to @room_config, notice: 'Room config was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @room_config.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n @device = Device.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @device.update_attributes(params[:device])\r\n format.html { redirect_to @device, notice: 'Device 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: @device.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @room = Room.find(params[:id])\n respond_to do |format|\n if @room.update_attributes(params[:room])\n format.html { redirect_to staff_path(@room.id), notice: 'Room was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: staff_path(@room.id).errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kind_room.update(kind_room_params)\n format.html { redirect_to @kind_room, notice: 'Kind room was successfully updated.' }\n format.json { render :show, status: :ok, location: @kind_room }\n else\n format.html { render :edit }\n format.json { render json: @kind_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device_status.update(admin_device_status_params)\n format.html { redirect_to admin_device_status_path(@device_status), notice: 'Device Status was successfully updated.' }\n format.json { render :show, status: :ok, location: @device_status }\n else\n format.html { render :edit }\n format.json { render json: @device_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @tddbc_room = Tddbc::Room.find(params[:id])\n\n respond_to do |format|\n if @tddbc_room.update_attributes(params[:tddbc_room])\n format.html { redirect_to @tddbc_room, notice: 'Room was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tddbc_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @device.update(device_params) &&\n format.html { redirect_to user_devices_path(@user), notice: 'Device was successfully updated.' }\n format.json { render :show, status: :ok, location: @device }\n else\n format.html { render :edit }\n format.json { render json: @device.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @telecom_room = TelecomRoom.find(params[:id])\n\n respond_to do |format|\n if @telecom_room.update_attributes(params[:telecom_room])\n format.html { redirect_to(@telecom_room, :notice => 'TelecomRoom was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @telecom_room.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @device_type = args[:device_type] if args.key?(:device_type)\n @id = args[:id] if args.key?(:id)\n end",
"def update!(**args)\n @device_type = args[:device_type] if args.key?(:device_type)\n @id = args[:id] if args.key?(:id)\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to rooms_path, notice: \"Sala '\" + @room.name + \"' atualizada com sucesso!\" }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @device = args[:device] if args.key?(:device)\n end",
"def update\n\t\trespond_to do |format|\n\t\t\tif @room.update(room_params)\n\t\t\t\tformat.html { redirect_to @room, notice: 'Room was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @room }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @room.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n @mydevice = Mydevice.find(params[:id])\n\n respond_to do |format|\n if @mydevice.update_attributes(params[:mydevice])\n format.html { redirect_to @mydevice, notice: 'Mydevice was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mydevice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @device_id = args[:device_id] if args.key?(:device_id)\n end",
"def update\n @hostel_room = HostelRoom.find(params[:id])\n\n respond_to do |format|\n if @hostel_room.update_attributes(params[:hostel_room])\n format.html { redirect_to @hostel_room, notice: 'Hostel room was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hostel_room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n p '~~~update~~~'\n p user_params\n\n if @user.update(user_params)\n render json: @user.to_json(include: :rooms), status: :ok\n else\n render json: {error: @user.errors.full_messages.first}, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to @room, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit, alert: 'Что-то пошло не так' }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_room\n\t@room_options = {}\n\t@room_options[\"data\"] = {}\n\trooms = Room.where(\"building_id = ?\",params[:building_id])\n\tif rooms.length == 0\n\t\t@room_options[\"data\"][\"\"] = \"\"\n\telse\n\t\trooms.each {|room|\n\t\t\t@room_options[\"data\"][room.id.to_s] = room.room_name\n\t\t}\n\tend\n\t@room_options[\"select_id\"] = \"#room_select_\" + params[:course_id]\n\tcourse_assignment = get_course_assignment(params[:course_id])\n\troom_id = course_assignment.room_id.to_s\n\tif room_id != nil\n\t\t@room_options[\"selected_val\"] = room_id\n\telse\n\t\t@room_options[\"selected_val\"] = \"\"\n\tend\n\trespond_to do |format|\n\t\tformat.json {render json: @room_options}\n\tend\n end",
"def update\n @roombot = Roombot.find(params[:id])\n\n respond_to do |format|\n if @roombot.update_attributes(params[:roombot])\n format.html { redirect_to @roombot, notice: 'Roombot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @roombot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @device_name = args[:device_name] if args.key?(:device_name)\n @device_type = args[:device_type] if args.key?(:device_type)\n end",
"def update\n\n filteredParams = params.require(:room).permit(:name, :privacy, :password, :id)\n @room = Room.find(filteredParams[\"id\"]) rescue nil\n\n if filteredParams[\"privacy\"] && filteredParams[\"privacy\"] == \"on\"\n filteredParams[\"privacy\"] = \"private\"\n else\n filteredParams[\"privacy\"] = \"public\"\n end \n\n # if ![\"\", \"public\", \"private\"].include?(filteredParams[\"privacy\"])\n # res_with_error(\"Privacy field must be either empty, public or private\", :bad_request)\n # return (false)\n # end\n\n if filteredParams[\"privacy\"] == \"private\"\n if filteredParams[\"password\"].empty?\n res_with_error(\"None empty password required if the room is private\", :bad_request)\n return (false)\n else\n roomPassword = BCrypt::Password.create filteredParams[\"password\"]\n filteredParams[\"password\"] = roomPassword\n end\n end\n\n if filteredParams[\"privacy\"] == \"public\"\n filteredParams[\"password\"] = \"\"\n end\n\n filteredParams.each do |key, value|\n if (value == \"\" && (filteredParams[\"privacy\"] != \"public\" && key != \"password\"))\n filteredParams.delete(key)\n end\n end\n\n if !filteredParams[\"name\"] || filteredParams[\"name\"].length == 0 || filteredParams[\"name\"].blank?\n res_with_error(\"Empty Room Name\", :bad_request)\n return (false)\n end\n\n if @room == nil\n res_with_error(\"Unknown Room\", :bad_request)\n return (false)\n end\n \n respond_to do |format|\n if @room.update(filteredParams)\n\n ActionCable.server.broadcast \"room_channel\", type: \"rooms\", description: \"update\", user: current_user\n format.html { redirect_to :index, notice: 'Room was successfully updated.' }\n format.json { render :index, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @roomtable.update(roomtable_params)\n format.html { redirect_to @roomtable, notice: 'Roomtable was successfully updated.' }\n format.json { render :show, status: :ok, location: @roomtable }\n else\n format.html { render :edit }\n format.json { render json: @roomtable.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @device_assignment = DeviceAssignment.find(params[:id])\n @locations = Location.order(\"location_name ASC\")\n @patients = Patient.order(\"last_name ASC\")\n @devices = Device.order(\"serial_number ASC\")\n\n respond_to do |format|\n if @device_assignment.update_attributes(params[:device_assignment])\n format.html { redirect_to @device_assignment, notice: 'Device assignment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @device_assignment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n current_admin_user\n @tablet = Tablet.find(params[:id])\n\n respond_to do |format|\n if @tablet.update_attributes(params[:tablet])\n format.html { redirect_to @tablet, notice: 'Tablet was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tablet.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @room.update(room_params)\n format.html { redirect_to hotelprofile_path, notice: 'Room was successfully updated.' }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n params.permit!\n @it_device = ItDevice.find(params[:id])\n\n respond_to do |format|\n if @it_device.update_attributes(params[:it_device])\n format.html { redirect_to(@it_device, :notice => 'It device was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @it_device.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @room.update(room_params)\n redirect_to admin_rooms_path, notice: 'Room was successfully updated.'\n else\n render :edit\n end\n end",
"def update\n @room = Room.find(params[:id])\n\n respond_to do |format|\n if @room.update_attributes(params[:room])\n format.html { redirect_to(@room, :notice => 'Room was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @room.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @my_room = MyRoom.find(params[:my_room_id])\n respond_to do |format|\n if @my_rack.update(my_rack_params)\n format.html { redirect_to my_room_my_rack_path(@my_room, @my_rack), notice: 'Стелаж успешно обновлен.' }\n format.json { render :show, status: :ok, location: @my_rack }\n else\n format.html { render :edit }\n format.json { render json: @my_rack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize room\n\n if room_params[:public]\n authorize room, :create_public?\n end\n\n respond_to do |format|\n if room.update(room_params)\n format.html { redirect_to room, notice: I18n.t('rooms.successfully_updated') }\n format.json { render :show, status: :ok, location: room }\n else\n format.html { render :edit }\n format.json { render json: room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @room_plant.update(room_plant_params)\n render :show, status: :ok, location: @room_plant\n else\n render json: @room_plant.errors, status: :unprocessable_entity\n end\n end",
"def update!(**args)\n @device_id = args[:device_id] if args.key?(:device_id)\n @type = args[:type] if args.key?(:type)\n end",
"def update!(**args)\n @device_id = args[:device_id] if args.key?(:device_id)\n @type = args[:type] if args.key?(:type)\n end",
"def update\n respond_to do |format|\n if @room_information.update(room_information_params)\n format.html { redirect_to @room_information, notice: 'Room information was successfully updated.' }\n format.json { render :show, status: :ok, location: @room_information }\n else\n format.html { render :edit }\n format.json { render json: @room_information.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n param=room_params\n actype=param[:AC]\n bedcount=param[:beds]\n param.delete(\"AC\")\n param.delete(\"beds\")\n @room=Room.find_by(roomid:param[:roomid])\n respond_to do |format|\n if @room.update(param)\n [email protected]\n roomtype.update(AC:actype,beds:bedcount)\n format.html { redirect_to @room, notice: \"Room was successfully updated.\" }\n format.json { render :show, status: :ok, location: @room }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @room.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @hotel_room = HotelRoom.find(params[:id])\n\n respond_to do |format|\n if @hotel_room.update_attributes(params[:hotel_room])\n format.html { redirect_to @hotel_room, notice: 'Hotel room was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hotel_room.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.66058797",
"0.657957",
"0.65770304",
"0.64990175",
"0.6466597",
"0.64520633",
"0.64374566",
"0.64282745",
"0.6401146",
"0.6389431",
"0.6389431",
"0.63757783",
"0.63544065",
"0.6347033",
"0.62893766",
"0.62862444",
"0.62844026",
"0.6280558",
"0.6261252",
"0.6234525",
"0.6230403",
"0.6225139",
"0.6215298",
"0.61936986",
"0.6187837",
"0.6169943",
"0.6169273",
"0.6160284",
"0.6149464",
"0.6142956",
"0.61343646",
"0.6127748",
"0.6127748",
"0.6127748",
"0.61117345",
"0.61055666",
"0.6094085",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.6091754",
"0.60914403",
"0.6090724",
"0.60841364",
"0.60839975",
"0.6082726",
"0.60691965",
"0.6053388",
"0.6050966",
"0.6050966",
"0.6050966",
"0.6050966",
"0.6050966",
"0.6050966",
"0.6050966",
"0.6049243",
"0.60410774",
"0.6040962",
"0.60394263",
"0.60231364",
"0.6015568",
"0.6006107",
"0.59969234",
"0.5995186",
"0.59555155",
"0.5944712",
"0.5944712",
"0.5943213",
"0.5941786",
"0.5940977",
"0.5932879",
"0.5929168",
"0.5928391",
"0.5923217",
"0.59199226",
"0.5917186",
"0.59011954",
"0.5899082",
"0.58929646",
"0.5887644",
"0.5874952",
"0.58734334",
"0.5870786",
"0.5868828",
"0.58565634",
"0.5824975",
"0.5822478",
"0.5822388",
"0.581741",
"0.5814091",
"0.5814091",
"0.5810785",
"0.5809221",
"0.58058745"
] | 0.6414516 | 8 |
DELETE /admin/room_devices/1 DELETE /admin/room_devices/1.json | def destroy
@admin_room_device.destroy
respond_to do |format|
format.html { redirect_to admin_room_devices_url, notice: 'Room device was successfully destroyed.' }
format.json { head :no_content }
format.js { render :layout => false }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @device.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :ok }\n end\n end",
"def destroy\n# @device.destroy\n# respond_to do |format|\n# format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n# format.json { head :no_content }\n# end\n# end\n\n# private\n# # Use callbacks to share common setup or constraints between actions.\n# def set_device\n# @device = Device.find(params[:id])\n# end\n\n# # Never trust parameters from the scary internet, only allow the white list through.\n# def device_params\n# params.require(:device).permit(:user_agent, :endpoint, :p256dh, :auth, :user_id)\n end",
"def destroy\n @mydevice = Mydevice.find(params[:id])\n @mydevice.destroy\n\n respond_to do |format|\n format.html { redirect_to mydevices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_room.destroy\n respond_to do |format|\n format.html { redirect_to admin_rooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @device = Device.find(params[:id])\r\n @device.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to devices_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n head :no_content\n end",
"def destroy\n if !Device.where(admin_device_id: params[:id]).exists?\n @admin_device.destroy\n respond_to do |format|\n format.html { redirect_to admin_devices_url, notice: 'Admin device was successfully destroyed.' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to admin_devices_url, notice: 'Admin device is associated to a user.' }\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @device.user_id = nil\n @device.save\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to user_devices_url, notice: 'Device was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n if @device.user == current_user or current_user.is_admin?\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url }\n format.json { head :no_content }\n end\n else\n redirect_to devices_url, :notice => 'Access denied! You can delete your device only'\n end\n end",
"def destroy\n @restroom.destroy\n respond_to do |format|\n format.html { redirect_to restrooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\t\t@user=User.find(params[:user_id])\n \t@[email protected](params[:room_id])\n \t@device= @room.devices.find(params[:device_device_id])\n \t@note = @device.notes.find(params[:id])\n \[email protected]\n \thead :no_content\n\tend",
"def destroy\n @lab_device = LabDevice.find(params[:id])\n @lab_device.destroy\n\n respond_to do |format|\n format.html { redirect_to lab_devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id]) #根据设备id值查找设备\n @[email protected]\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @room = Room.find(params[:id])\n @room.destroy\n\n head :ok \n end",
"def delete_device(id)\n delete(\"/devices/#{id}\")\n end",
"def destroy\n begin\n @device.destroy\n rescue\n end\n respond_to do |format|\n format.html { redirect_to devices_url, notice: 'Device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @my_room = MyRoom.find(params[:my_room_id])\n @my_rack.destroy\n respond_to do |format|\n format.html { redirect_to @my_room, notice: 'Стелаж успешно удален.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @tddbc_room = Tddbc::Room.find(params[:id])\n @tddbc_room.destroy\n\n respond_to do |format|\n format.html { redirect_to tddbc_rooms_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @restroom = Restroom.find(params[:id])\n authorize @restroom\n @restroom.destroy\n respond_to do |format|\n format.html { redirect_to restrooms_path, notice: 'Restroom deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device_status.destroy\n respond_to do |format|\n format.html { redirect_to admin_device_statuses_url, notice: 'Device Status was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_room.destroy\n respond_to do |format|\n format.html { redirect_to admin_building_path(params[:building_id]), notice: 'Room was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @serverroom = Serverroom.find(params[:id])\n @serverroom.destroy\n\n respond_to do |format|\n format.html { redirect_to serverrooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @pdevice = Pdevice.find(params[:id])\n @pdevice.destroy\n\n respond_to do |format|\n format.html { redirect_to pdevices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device_model.destroy\n respond_to do |format|\n format.html { redirect_to device_models_url, notice: 'Device model was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin.destroy\n\n render json: { operation: 'OK' }, status: :ok\n end",
"def destroy\n @api_v1_user_device_info.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_user_device_infos_url, notice: 'User device info was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rubidevice.destroy\n respond_to do |format|\n format.html { redirect_to rubidevices_url, notice: 'Rubidevice was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device.destroy\n\n respond_to do |format|\n format.html { redirect_to(devices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @restroom = Restroom.find(params[:id])\n @restroom.destroy\n authorize! :destroy, @restroom\n\n respond_to do |format|\n format.html { redirect_to restrooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @restroom = Restroom.find(params[:id])\n @restroom.destroy\n authorize! :destroy, @restroom\n\n respond_to do |format|\n format.html { redirect_to restrooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room = Room.find(params[:id])\n @room.destroy\n\n respond_to do |format|\n format.html { redirect_to rooms_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room = Room.find(params[:id])\n @room.destroy\n\n respond_to do |format|\n format.html { redirect_to rooms_url }\n format.json { head :no_content }\n end\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 destroy\n @room = Room.find(params[:id])\n @room.destroy\n\n respond_to do |format|\n format.html { redirect_to rooms_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @device.destroy\n respond_with(@device, location: devices_url, notice: 'Device was successfully destroyed')\n end",
"def destroy\n @device_user = DeviceUser.find(params[:id])\n @device_user.destroy\n\n respond_to do |format|\n format.html { redirect_to device_users_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @special_device_list.destroy\n respond_to do |format|\n format.html { redirect_to special_device_lists_url, notice: 'Special device list was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room = current_user.rooms.find(params[:id])\n @room.destroy\n\n respond_to do |format|\n format.html { redirect_to rooms_url }\n format.json { head :no_content }\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 @it_device = ItDevice.find(params[:id])\n @it_device.destroy\n\n respond_to do |format|\n format.html { redirect_to(it_devices_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @roombot = Roombot.find(params[:id])\n @roombot.destroy\n\n respond_to do |format|\n format.html { redirect_to roombots_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin = Admin.find(params[:id])\n @admin.destroy\n\n render json: {:ok => true}\n end",
"def destroy\n @room.destroy\n\n respond_to do |format|\n format.html { redirect_to rooms_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @gcm_device = GcmDevice.find(params[:id])\n @gcm_device.destroy\n\n respond_to do |format|\n format.html { redirect_to gcm_devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n room = Room.find(params[:id])\n if room.destroy\n head :no_content\n return\n else\n response_data = {\n txt: ['削除できませんでした!'],\n }\n render json: response_data, status: :unprocessable_entity\n end\n end",
"def destroy\n @epsadmin_device = Device.where(:terminal_id => params[:terminal_id]).first\n if @epsadmin_device.device_status == \"pending\"\n @epsadmin_device.destroy\n respond_to do |format|\n format.html { redirect_to epsadmin_merchant_devices_path, notice: 'Device was successfully deleted' }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to epsadmin_merchant_device_path, notice: 'Device status must be in pending state to delte/remove it'}\n format.json { head :no_content }\n end\n end\n end",
"def destroy\n @mobile = Mobile.find(params[:id])\n @mobile.destroy\n\n respond_to do |format|\n format.html { redirect_to mobiles_url }\n format.json { head :ok }\n end\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @device = Device.find(params[:id])\n @device.destroy\n flash[:notice] = 'Device was successfully deleted.'\n redirect_to \"/index\"\n\n end",
"def destroy\n @hostel_room = HostelRoom.find(params[:id])\n @hostel_room.destroy\n\n respond_to do |format|\n format.html { redirect_to hostel_rooms_url }\n format.json { head :ok }\n end\n end",
"def destroy\n current_admin_user\n @tablet = Tablet.find(params[:id])\n @tablet.destroy\n\n respond_to do |format|\n format.html { redirect_to tablets_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device = Device.find(params[:id])\n name = @device.name\n @venue = @device.venue\n @device.destroy\n update_total_counter(@venue.id)\n respond_to do |format|\n format.html { redirect_to venues_url, notice: \"Se ha borrado el acceso '#{name}'.\" }\n # format.html { redirect_to @venue, notice: 'device was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room.destroy\n respond_to do |format|\n format.html { redirect_to @room.floor, notice: t('flash.room.delete') }\n format.json { head :no_content }\n end\n end",
"def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"def delete\n request(:delete)\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 destroy\n @device_type.destroy\n respond_to do |format|\n format.html { redirect_to device_types_url(protocol: redirect_protocol), notice: 'Device type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n filteredParams = params.require(:room).permit(:room_id)\n @room = Room.find(filteredParams[\"room_id\"]) rescue nil\n if !@room\n res_with_error(\"Unknown room\", :bad_request)\n return (false)\n end \n @room.members.destroy_all\n @room.admins.destroy_all\n @room.room_messages.destroy_all\n RoomMute.where(room: @room).destroy_all\n RoomBan.where(room: @room).destroy_all\n @room.destroy\n respond_to do |format|\n ActionCable.server.broadcast \"room_channel\", type: \"rooms\", description: \"Room Destroyed\", user: current_user\n format.html { redirect_to :index, notice: 'Room was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @devicetype.destroy\n respond_to do |format|\n format.html { redirect_to devicetypes_url, notice: 'Devicetype was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @telecom_room = TelecomRoom.find(params[:id])\n @telecom_room.destroy\n\n respond_to do |format|\n format.html { redirect_to(telecom_rooms_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @room = Room.find(params[:id])\n @room.destroy\n\n respond_to do |format|\n format.html { redirect_to staffs_path, notice: 'Room was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room = Room.find(params[:id])\n @room.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 @room.destroy\n respond_to do |format|\n format.html { redirect_to crew_rooms_path, notice: 'Quarto foi apagado com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def delete\n api(\"Delete\")\n end",
"def destroy\n @device_sub_content.destroy\n respond_to do |format|\n format.html { redirect_to device_sub_contents_url, notice: 'Device sub content was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def remove_device(device_id)\n @client.delete(\"#{ path }/devices/#{ device_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 destroy\n @switch_room.destroy\n respond_to do |format|\n format.html { redirect_to switch_rooms_url, notice: 'Switch room was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @av_device.destroy\n respond_to do |format|\n format.html { redirect_to av_devices_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @roomtable.destroy\n respond_to do |format|\n format.html { redirect_to roomtables_url, notice: 'Roomtable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room.destroy\n respond_to do |format|\n format.html { redirect_to admin_rooms_path(id: @room.hotel.id), notice: 'Room was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user = User.find(params[:user_id])\n @room = @user.room.find(params[:id])\n @room.destroy\n head :no_content\n end",
"def destroy\n @admin_hardware_type.destroy\n respond_to do |format|\n format.html { redirect_to admin_hardware_types_url, notice: 'Hardware type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dns_device_assoc = DnsDeviceAssoc.find(params[:id])\n @dns_device_assoc.destroy\n\n respond_to do |format|\n format.html { redirect_to dns_device_assocs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @smartphone.destroy\n respond_to do |format|\n format.html { redirect_to smartphones_url, notice: 'Smartphone was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @room.destroy\n respond_to do |format|\n format.html { redirect_to location_path(@room.location), notice: 'La Sala ha sido eliminada correctamente!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @device_registration.destroy\n respond_to do |format|\n format.html { redirect_to device_registrations_url, notice: 'Device registration was successfully destroyed.' }\n format.json { head :no_content }\n end\n end"
] | [
"0.73066974",
"0.7136805",
"0.7121086",
"0.7120843",
"0.7120843",
"0.7120843",
"0.7120239",
"0.7078767",
"0.70566076",
"0.7044856",
"0.7040752",
"0.6968132",
"0.69659233",
"0.6945928",
"0.69250214",
"0.6924495",
"0.6897003",
"0.6892201",
"0.6865773",
"0.6865364",
"0.6865364",
"0.6865364",
"0.6865364",
"0.6865364",
"0.6865364",
"0.6865364",
"0.6865364",
"0.6865364",
"0.68180496",
"0.6768141",
"0.6767634",
"0.6747884",
"0.6738254",
"0.67284566",
"0.6726261",
"0.6706566",
"0.66960734",
"0.6688993",
"0.6688856",
"0.66779715",
"0.6669888",
"0.6669888",
"0.66638327",
"0.66513366",
"0.66398674",
"0.6639593",
"0.66387933",
"0.66362715",
"0.6633579",
"0.6633579",
"0.66325665",
"0.6632284",
"0.6629204",
"0.6620854",
"0.6619368",
"0.6589281",
"0.65702975",
"0.6563327",
"0.6560004",
"0.6552844",
"0.655201",
"0.6544729",
"0.6535385",
"0.65180725",
"0.65057456",
"0.65031093",
"0.650079",
"0.6499817",
"0.64992154",
"0.64989376",
"0.64978176",
"0.6493274",
"0.64930767",
"0.6485748",
"0.6483564",
"0.6476506",
"0.64658093",
"0.6461998",
"0.6455343",
"0.6451934",
"0.64515615",
"0.6447639",
"0.6433995",
"0.6427404",
"0.64211655",
"0.6413823",
"0.640501",
"0.640501",
"0.640501",
"0.640501",
"0.639651",
"0.6393486",
"0.6393",
"0.6391831",
"0.63907695",
"0.6388303",
"0.63838667",
"0.6380789",
"0.6373737",
"0.63723165"
] | 0.7288625 | 1 |
Use callbacks to share common setup or constraints between actions. | def set_admin_room_device
@admin_room_device = Admin::RoomDevice.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 set_actions\n actions :all\n end",
"def define_action_helpers?; 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 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 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 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 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 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 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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\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",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def duas1(action)\n action.call\n action.call\nend",
"def _handle_action_missing(*args); end"
] | [
"0.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865",
"0.53135896",
"0.52999926",
"0.5297309",
"0.5296569",
"0.5261449",
"0.5247048",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52323204",
"0.52310973",
"0.523081",
"0.5225785",
"0.5219039",
"0.52136266",
"0.5208033",
"0.520763",
"0.5177365",
"0.5175224",
"0.5173357",
"0.5166104",
"0.5162502",
"0.51573396",
"0.5154547",
"0.5153531",
"0.51502854",
"0.51436496",
"0.5142863",
"0.51330835",
"0.5115634",
"0.5115634",
"0.511527",
"0.5109693",
"0.51076853",
"0.5093146",
"0.5090683",
"0.50829846",
"0.50819314",
"0.50670373",
"0.5055505",
"0.5053398",
"0.50504035",
"0.50504035",
"0.5037765",
"0.5027292",
"0.5024484",
"0.50150335",
"0.5014069",
"0.50022113",
"0.5001542",
"0.49981874",
"0.49915564",
"0.49915564",
"0.49880967",
"0.4982312",
"0.49787375",
"0.49786067",
"0.49687737",
"0.49676532",
"0.49602765",
"0.49565676",
"0.49550772",
"0.495342",
"0.49522525",
"0.49463704",
"0.49447197",
"0.49362713",
"0.49328062",
"0.49280638",
"0.49272856",
"0.4927058",
"0.49221697",
"0.4919526",
"0.49185994",
"0.49184805",
"0.49170163",
"0.49168405",
"0.49167764"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def admin_room_device_params
params.require(:admin_room_device).permit(:user_id, :room_id, :name, :amount, :status, :description)
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 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 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 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 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 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.69792545",
"0.6781151",
"0.67419964",
"0.674013",
"0.6734356",
"0.6591046",
"0.6502396",
"0.6496313",
"0.6480641",
"0.6477825",
"0.64565",
"0.6438387",
"0.63791263",
"0.63740575",
"0.6364131",
"0.63192815",
"0.62991166",
"0.62978333",
"0.6292148",
"0.6290449",
"0.6290076",
"0.62894756",
"0.6283177",
"0.6242471",
"0.62382483",
"0.6217549",
"0.6214457",
"0.6209053",
"0.6193042",
"0.6177802",
"0.6174604",
"0.61714715",
"0.6161512",
"0.6151757",
"0.6150663",
"0.61461",
"0.61213595",
"0.611406",
"0.6106206",
"0.6105114",
"0.6089039",
"0.6081015",
"0.6071004",
"0.60620916",
"0.6019971",
"0.601788",
"0.6011056",
"0.6010898",
"0.6005122",
"0.6005122",
"0.6001556",
"0.6001049",
"0.59943926",
"0.5992201",
"0.59909594",
"0.5990628",
"0.5980841",
"0.59669393",
"0.59589154",
"0.5958826",
"0.5957911",
"0.5957385",
"0.5953072",
"0.59526145",
"0.5943361",
"0.59386164",
"0.59375334",
"0.59375334",
"0.5933856",
"0.59292704",
"0.59254247",
"0.5924164",
"0.59167904",
"0.59088355",
"0.5907542",
"0.59064597",
"0.5906243",
"0.5898226",
"0.589687",
"0.5896091",
"0.5894501",
"0.5894289",
"0.5891739",
"0.58860534",
"0.5882406",
"0.587974",
"0.58738774",
"0.5869024",
"0.58679986",
"0.5867561",
"0.5865932",
"0.5864461",
"0.58639693",
"0.58617616",
"0.5861436",
"0.5860451",
"0.58602303",
"0.5854586",
"0.58537364",
"0.5850427",
"0.5850199"
] | 0.0 | -1 |
Use callbacks to share common setup or constraints between actions. | def set_answer
@answer = Answer.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 answer_params
params.require(:answer).permit(:content)
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 valid_params_request?; 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 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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def active_code_params\n params[:active_code].permit\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 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 valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\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 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 url_params\n params[:url].permit(:full)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\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.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894",
"0.6289475",
"0.62831545",
"0.6242381",
"0.6240358",
"0.6217451",
"0.6214354",
"0.62098235",
"0.61918235",
"0.6177287",
"0.61755854",
"0.61712915",
"0.61620486",
"0.6151379",
"0.61510575",
"0.6145169",
"0.61207956",
"0.6115647",
"0.6107701",
"0.61030304",
"0.60909295",
"0.60797",
"0.60701567",
"0.6062068",
"0.60203075",
"0.60167485",
"0.60125494",
"0.6009718",
"0.6007027",
"0.6007027",
"0.6000283",
"0.59990394",
"0.5996995",
"0.59915864",
"0.59914654",
"0.59912056",
"0.5979621",
"0.596686",
"0.5959418",
"0.59585625",
"0.59583765",
"0.5958032",
"0.5952298",
"0.5951678",
"0.5941885",
"0.59378815",
"0.59376645",
"0.59376645",
"0.5933908",
"0.59302104",
"0.5924862",
"0.5923981",
"0.59165645",
"0.5909916",
"0.590986",
"0.5908378",
"0.5904956",
"0.5897421",
"0.58970135",
"0.5894611",
"0.5893914",
"0.58927566",
"0.5891277",
"0.5885355",
"0.58825094",
"0.58783555",
"0.58728755",
"0.58686864",
"0.5867015",
"0.58660764",
"0.58659357",
"0.5864526",
"0.58634263",
"0.5861585",
"0.5861255",
"0.5858771",
"0.58579147",
"0.5854071",
"0.5853147",
"0.58498794",
"0.58492327"
] | 0.0 | -1 |
arg [Object] arg.chat or arg itself will be used | def set_chat_data(arg, data)
chat = arg.respond_to?(:chat) ? arg.chat : arg
barrymore_chats_data[chat] = chat_data(arg).merge(data).freeze
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commandChat _obj, _args\n \"_obj commandChat _args;\" \n end",
"def customChat _obj, _args\n \"_obj customChat _args;\" \n end",
"def sideChat _obj, _args\n \"_obj sideChat _args;\" \n end",
"def showChat _args\n \"showChat _args;\" \n end",
"def systemChat _args\n \"systemChat _args;\" \n end",
"def globalChat _obj, _args\n \"_obj globalChat _args;\" \n end",
"def vehicleChat _obj, _args\n \"_obj vehicleChat _args;\" \n end",
"def chat_data(arg)\n chat = arg.respond_to?(:chat) ? arg.chat : arg\n barrymore_chats_data[chat] ||= {}.freeze\n end",
"def chat\n @_chat || payload && payload['chat']\n end",
"def groupChat _obj, _args\n \"_obj groupChat _args;\" \n end",
"def hipchat=(arg)\n raise ArgumentError, \"hipchat expected a string, not a #{arg.class}\" unless arg.is_a?(String)\n @hipchat = arg\n end",
"def chat\n @_chat ||=\n if payload\n if payload.is_a?(Hash)\n payload['chat'] || payload['message'] && payload['message']['chat']\n else\n payload.try(:chat) || payload.try(:message).try!(:chat)\n end\n end\n end",
"def chat=(value)\n @chat = value\n end",
"def handle_chat(msg, message)\n @user = msg.actor\n #raise \"#{self.class.name} doesn't implement `handle_chat`!\"\n end",
"def mech=(_arg0); end",
"def mech=(_arg0); end",
"def chat_params\n params[:chat]\n end",
"def parseCommand(cmnd,arg)\n event=Event::RECV_CMND\n \n case(cmnd)\n when \"PASS\"\n event+=Event::CMND_PASS\n when \"NICK\"\n #\n # for madoka feed-back\n #\n if((@args[0].nil?)&&([email protected]?))\n @args=[@to]\n else\n @to=@args[0]\n end\n event+=Event::CMND_NICK\n when \"USER\"\n event+=Event::CMND_USER\n when \"SERVER\"\n event+=Event::CMND_SERVER\n when \"OPER\"\n event+=Event::CMND_OPER\n when \"QUIT\"\n event+=Event::CMND_QUIT\n when \"SQUIT\"\n event+=Event::CMND_SQUIT\n when \"JOIN\"\n #\n # for madoka feed-back\n #\n if((@args[0].nil?)&&([email protected]?))\n @args=[@to]\n else\n @to=@args[0]\n end\n event+=Event::CMND_JOIN\n when \"PART\"\n event+=Event::CMND_PART\n when \"MODE\"\n event+=Event::CMND_MODE\n when \"TOPIC\"\n event+=Event::CMND_TOPIC\n when \"NAMES\"\n event+=Event::CMND_NAMES\n when \"LIST\"\n event+=Event::CMND_LIST\n when \"INVITE\"\n event+=Event::CMND_INVITE\n when \"KICK\"\n event+=Event::CMND_KICK\n when \"VERSION\"\n event+=Event::CMND_VERSION\n when \"STATAS\"\n event+=Event::CMND_STATAS\n when \"LINK\"\n event+=Event::CMND_LINK\n when \"TIME\"\n event+=Event::CMND_TIME\n when \"CONNECT\"\n event+=Event::CMND_CONNECT\n when \"TRACE\"\n event+=Event::CMND_TRACE\n when \"ADMIN\"\n event+=Event::CMND_ADMIN\n when \"INFO\"\n event+=Event::CMND_INFO\n when \"PRIVMSG\"\n begin\n if(args[0][0]==1)\n @ctcpQuery=true\n @cmndstr=\"CTCP_QUERY\"\n parseCtcp(event+Event::CMND_CTCP_QUERY,arg.join(\" \"))\n return\n end\n rescue NameError\n end\n event+=Event::CMND_PRIVMSG\n when \"NOTICE\"\n begin\n if(args[0][0]==1)\n @ctcpAnswer=true\n @cmndstr=\"CTCP_ANSWER\"\n parseCtcp(event+Event::CMND_CTCP_ANSWER,args.join(\" \"))\n return\n end\n rescue NameError\n end\n event+=Event::CMND_NOTICE\n when \"WHO\"\n event+=Event::CMND_WHO\n when \"WHOIS\"\n event+=Event::CMND_WHOIS\n when \"WHOWAS\"\n event+=Event::CMND_WHOWAS\n when \"KILL\"\n event+=Event::CMND_KILL\n when \"PING\"\n event+=Event::CMND_PING\n when \"PONG\"\n event+=Event::CMND_PONG\n when \"ERROR\"\n event+=Event::CMND_ERROR\n when \"AWAY\"\n event+=Event::CMND_AWAY\n when \"REHASH\"\n event+=Event::CMND_REHASH\n when \"RESTART\"\n event+=Event::CMND_RESTART\n when \"SUMMON\"\n event+=Event::CMND_SUMMON\n when \"USERS\"\n event+=Event::CMND_USERS\n when \"WALLOPS\"\n event+=Event::CMND_WALLOPS\n when \"USERHOST\"\n event+=Event::CMND_USERHOST\n when \"ISON\"\n event+=Event::CMND_ISON\n end\n \n @command=event\n end",
"def arg; end",
"def can_chat_with(user)\n\n end",
"def cmdarg; end",
"def cmdarg; end",
"def cmdarg; end",
"def initialize(*args)\n # Error when attributes not exists!\n fail ::ArgumentError if args.empty?\n\n # Parse options and arguments\n # Arguments can be simple message!\n @options = ChattyCrow.extract_options!(args)\n @arguments = args\n\n # Symbolize keys in options for validations\n ChattyCrow.symbolize_keys!(@options)\n\n # Create flatten arguments for (skype/android/sms.. requests)\n @arguments_flatten = args.join(', ') if args.any?\n\n # Recipients\n @contacts = ChattyCrow.wrap(@options.delete(:contacts)).compact\n\n # Time and location - validate!\n if @time = @options.delete(:time)\n { start: Fixnum, end: Fixnum }.each do |key, klass|\n unless @time[key].is_a?(klass)\n fail ::ArgumentError, \"#{key} must be instance of #{klass}\"\n end\n end\n end\n\n if @location = @options.delete(:location)\n { latitude: Float, longitude: Float, range: Fixnum }.each do |key, klass|\n unless @location[key].is_a?(klass)\n fail ::ArgumentError, \"#{key} must be instance of #{klass}\"\n end\n end\n end\n\n # Channel\n @channel = @options.delete(:channel)\n\n # Token\n @token = @options.delete(:token)\n end",
"def chat(data)\n # uid of the intended recipient\n # only the intended recipient will be able to decrypt\n to = data['to'].to_s\n\n if ConnectedList.include?(to)\n relay_message(to, data)\n else\n intended_recipient_not_found(to)\n end\n end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def PO110=(arg)",
"def name\n :chat\n end",
"def event_incoming_chat(client, msg)\nend",
"def process_command(id, cmd, args)\n chat, user = self.get_contact(id) unless id == 0 # get chat information\n if id == 0 then # transport commands \n case cmd\n when '/login' then @telegram.set_authentication_phone_number(args[0], PERMISSIONS[:login]).then{@session[:login] = args[0]} unless @session[:login] # sign in\n when '/logout' then @telegram.log_out().then{@cache[:chats].each_key do |chat| @xmpp.send_presence(@jid, chat, :unsubscribed); @session[:login] = nil end} # sign out\n when '/code' then @telegram.check_authentication_code(args[0]) # check auth code \n when '/password' then @telegram.check_authentication_password(args[0]) # chech auth password\n when '/setusername' then @telegram.set_username(args[0] || '') # set @username\n when '/setname' then @telegram.set_name(args[0] || '', args[1] || '') # set My Name\n when '/setbio' then @telegram.set_bio(args[0] || '') # set About\n when '/setpassword' then @telegram.set_password((args[1] ? args[0] : ''), args[1]) # set password\n when '/config' then @xmpp.send_message(@jid, nil, args[1] ? \"%s set to %s\" % [args[0], @session.store(args[0].to_sym, args[1])] : @session.map{|attr| \"%s is set to %s\" % attr}.join(\"\\n\")) \n when '/help' then @xmpp.send_message(@jid, nil, HELP_GATE_CMD)\n end\n return true # stop executing \n else # chat commands\n case cmd\n when '/d' then @telegram.delete_messages(chat.id, self.get_lastmessages(chat.id, nil, @me.id, args[0]||1).map(&:id), true) # delete message\n when '/s' then @telegram.edit_message_text(chat.id, self.get_lastmessages(chat.id, nil, @me.id, 1).first.id, nil, self.process_outgoing_message(nil, args.join(' '))) # edit message\n when '/add' then @telegram.search_public_chat(args[0]).then{|chat| @xmpp.send_presence(@jid, chat.id, :subscribe)}.wait # add @contact \n when '/join' then @telegram.join_chat_by_invite_link(args[0]) # join https://t.me/publichat\n when '/supergroup' then @telegram.create_new_supergroup_chat(args[0], false, args[1..-1].join(' '), nil) # create new supergroup \n when '/channel' then @telegram.create_new_supergroup_chat(args[0], true, args[1..-1].join(' '), nil) # create new channel \n when '/secret' then @telegram.create_new_secret_chat(chat.id) # create secret chat with current user\n when '/group' then @telegram.create_new_basic_group_chat(chat.id, args[0]) # create group chat with current user \n when '/block' then @telegram.block_user(chat.id) # blacklists current user\n when '/unblock' then @telegram.unblock_user(chat.id) # unblacklists current user \n when '/members' then @telegram.search_chat_members(chat.id, args[0], 9999, TD::Types::ChatMembersFilter::Members.new).then{|m| @xmpp.send_message(@jid, chat.id, (m.members.map do |u| \"%s | role: %s\" % [self.format_contact(u.user_id), u.status.class] end).join(\"\\n\")) } # chat members\n when '/invite' then @telegram.add_chat_member(chat.id, self.get_contact(args[0]).first.id, 100) # invite @username to current groupchat \n when '/link' then @telegram.generate_chat_invite_link(chat.id).then{|link| @xmpp.send_message(@jid, chat.id, link.invite_link)} # get link to current chat\n when '/kick' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Left.new()) # kick @username \n when '/mute' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Restricted.new(is_member: true, restricted_until_date: self.format_bantime(args[0]), permissions: PERMISSIONS[:readonly])) # mute @username [n hours]\n when '/unmute' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Restricted.new(is_member: true, restricted_until_date: 0, permissions: PERMISSIONS[:member])) # unmute @username \n when '/ban' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Banned.new(banned_until_date: self.format_bantime(args[0]))) # ban @username [n hours]\n when '/unban' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Member.new()) # unban @username \n when '/promote' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Administrator.new(custom_title: args[0].to_s, **PERMISSIONS[:admin])) # promote @username to admin \n when '/leave' then @telegram.leave_chat(chat.id).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)} # leave current chat \n when '/leave!' then @telegram.delete_supergroup(chat.type.supergroup_id).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)}.rescue{|e| puts e.to_s} # leave current chat (for owners) \n when '/ttl' then @telegram.send_chat_set_ttl_message(chat.type.secret_chat_id, args[0].to_i) # close secret chat \n when '/close' then @telegram.close_secret_chat(chat.type.secret_chat_id).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)} # close secret chat \n when '/delete' then @telegram.delete_chat_history(chat.id, true, true).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)} # delete current chat \n when '/search' then @telegram.get_messages(chat.id, self.get_lastmessages(chat.id, args[0], 0, args[1]||100).map(&:id)).value.messages.reverse.each{|msg| @xmpp.send_message(@jid, chat.id, self.format_message(chat.id,msg,false))} # message search\n when '/help' then @xmpp.send_message(@jid, id, HELP_CHAT_CMD)\n else return # continue\n end\n return true # stop\n end\n end",
"def message=(_arg0); end",
"def message=(_arg0); end",
"def PO109=(arg)",
"def chat_params\n params.fetch(:chat, {})\n end",
"def remote_chat(sender, room, msg)\n add_msg \"<#{room || 'unknown'}> #{sender}: #{msg}\"\n end",
"def personal_chat(message) \n puts \"This is a Personal Chat\" \n puts message \n end",
"def set_chat\n @chat = Chat.get_one(params[:app_token], params[:number])\n end",
"def arg(arg)\n self[arg]\n end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def whiny=(_arg0); end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def PO102=(arg)",
"def PO104=(arg)",
"def chat\n return @chat\n end",
"def PO106=(arg)",
"def react_to *args; end",
"def PO108=(arg)",
"def sendChatMessage(a_to, a_text)\n\t\tp 'JabberClient.sendChatMessage'\n\tend",
"def update!(**args)\n @chat_id = args[:chat_id] if args.key?(:chat_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def update!(**args)\n @chat_id = args[:chat_id] if args.key?(:chat_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def message\n @_args.first\n end",
"def PO105=(arg)",
"def PO101=(arg)",
"def set_chat\n @chat = @application.chats.find_by!(number: params[:id])\n end",
"def PO111=(arg)",
"def PO115=(arg)",
"def chat\n @title = \"Conversacion\"\n @chats = GetChatsForPreviaGroup.call(@previa_group)\n @messages = GetMessagesForChat.call(Chat.find(params[:chat]))\n end",
"def PO113=(arg)",
"def args(*) end",
"def PO103=(arg)",
"def command_name=(_arg0); end",
"def group_chat(message) \n puts \"This is a Public Group\"\n puts message \n # secure_chat(\"This is confidential\")\n personal_chat(\"hi how are you\") \n end",
"def execute actor, target=[nil]\n def himher thing\n multiple = thing.count > 1 \n\n if multiple \n return \"them\"\n end\n\n case thing[0]\n when Player then \"him\"\n when ItemFacade then \"it\"\n else \"\"\n end\n end\n room_msg, self_msg, vict_msg = @ofound.dup, @found.dup, @tfound.dup\n\n\n if target.include?(actor) # if they're the same person then it's an auto\n target = [actor]\n room_msg = @oauto.dup\n self_msg = @auto.dup\n vict_msg = nil\n elsif target[0] == nil\n room_msg = @onoarg.dup\n self_msg = @noarg.dup\n vict_msg = nil\n end\n room_msg.gsub!(\"$n\", \"<%=other.peek(actor)%>\")\n room_msg.gsub!(\"$N\", \"<%=other.peek(if arg[0].include?(other) then arg[0]-[other]+['You'] else arg[0] end)%>\")\n room_msg.gsub!(\"$m\", himher([actor]))\n room_msg.gsub!(\"$M\", himher(target))\n\n self_msg.gsub!(\"$M\", himher(target))\n self_msg.gsub!(\"$m\", himher([actor]))\n if target\n self_msg.gsub!(\"$N\", actor.peek(target))\n end\n actor.view(\"#G\"+self_msg+\"#n\" + ENDL)\n \n room_msg.untaint\n if target[0]\n if target.count > 1 \n actor.in_room.display([:visual, \"other.can_see?(actor) || other.can_see?(arg[0])\"], actor, [actor], \"#G\"+room_msg+\"#n\", target)\n else\n actor.in_room.display([:visual, \"other.can_see?(actor) || other.can_see?(arg[0])\"], actor, [actor, *target], \"#G\"+room_msg+\"#n\", target)\n target.each do |one_targ|\n vm = vict_msg.dup\n vm.gsub!(\"$n\", one_targ.peek(actor))\n one_targ.view(\"#G\"+vm+ \"#n\" + ENDL)\n end\n end\n else\n puts room_msg\n actor.in_room.display([:visual, \"other.can_see?(actor)\"], actor, [actor], \"#G\"+room_msg+\"#n\", \"\")\n end\n end"
] | [
"0.73856723",
"0.7379979",
"0.7129483",
"0.70662385",
"0.70342577",
"0.6993293",
"0.692255",
"0.686182",
"0.6624803",
"0.6546691",
"0.6513313",
"0.6496912",
"0.63492715",
"0.5971953",
"0.59363776",
"0.59363776",
"0.5921681",
"0.58564126",
"0.5841593",
"0.5804696",
"0.5792677",
"0.5792677",
"0.5792677",
"0.5786073",
"0.5775524",
"0.577232",
"0.577232",
"0.577232",
"0.57653534",
"0.57629454",
"0.568868",
"0.56769145",
"0.56572556",
"0.56572556",
"0.56124914",
"0.55936664",
"0.5584892",
"0.5572989",
"0.55717945",
"0.55532044",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.5549818",
"0.55460787",
"0.55456537",
"0.5543772",
"0.5541938",
"0.55308825",
"0.55153406",
"0.5513557",
"0.5506578",
"0.5497434",
"0.54887116",
"0.54887116",
"0.54840827",
"0.54840827",
"0.54840827",
"0.54840827",
"0.54840827",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54836774",
"0.54633224",
"0.5461731",
"0.54487",
"0.5441272",
"0.5435734",
"0.5424341",
"0.54243016",
"0.53997517",
"0.53949296",
"0.5393425",
"0.53845924",
"0.5384047",
"0.53818786"
] | 0.6439061 | 12 |
arg [Object] arg.chat or arg itself will be used | def chat_data(arg)
chat = arg.respond_to?(:chat) ? arg.chat : arg
barrymore_chats_data[chat] ||= {}.freeze
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def commandChat _obj, _args\n \"_obj commandChat _args;\" \n end",
"def customChat _obj, _args\n \"_obj customChat _args;\" \n end",
"def sideChat _obj, _args\n \"_obj sideChat _args;\" \n end",
"def showChat _args\n \"showChat _args;\" \n end",
"def systemChat _args\n \"systemChat _args;\" \n end",
"def globalChat _obj, _args\n \"_obj globalChat _args;\" \n end",
"def vehicleChat _obj, _args\n \"_obj vehicleChat _args;\" \n end",
"def chat\n @_chat || payload && payload['chat']\n end",
"def groupChat _obj, _args\n \"_obj groupChat _args;\" \n end",
"def hipchat=(arg)\n raise ArgumentError, \"hipchat expected a string, not a #{arg.class}\" unless arg.is_a?(String)\n @hipchat = arg\n end",
"def chat\n @_chat ||=\n if payload\n if payload.is_a?(Hash)\n payload['chat'] || payload['message'] && payload['message']['chat']\n else\n payload.try(:chat) || payload.try(:message).try!(:chat)\n end\n end\n end",
"def set_chat_data(arg, data)\n chat = arg.respond_to?(:chat) ? arg.chat : arg\n barrymore_chats_data[chat] = chat_data(arg).merge(data).freeze\n end",
"def chat=(value)\n @chat = value\n end",
"def handle_chat(msg, message)\n @user = msg.actor\n #raise \"#{self.class.name} doesn't implement `handle_chat`!\"\n end",
"def mech=(_arg0); end",
"def mech=(_arg0); end",
"def chat_params\n params[:chat]\n end",
"def parseCommand(cmnd,arg)\n event=Event::RECV_CMND\n \n case(cmnd)\n when \"PASS\"\n event+=Event::CMND_PASS\n when \"NICK\"\n #\n # for madoka feed-back\n #\n if((@args[0].nil?)&&([email protected]?))\n @args=[@to]\n else\n @to=@args[0]\n end\n event+=Event::CMND_NICK\n when \"USER\"\n event+=Event::CMND_USER\n when \"SERVER\"\n event+=Event::CMND_SERVER\n when \"OPER\"\n event+=Event::CMND_OPER\n when \"QUIT\"\n event+=Event::CMND_QUIT\n when \"SQUIT\"\n event+=Event::CMND_SQUIT\n when \"JOIN\"\n #\n # for madoka feed-back\n #\n if((@args[0].nil?)&&([email protected]?))\n @args=[@to]\n else\n @to=@args[0]\n end\n event+=Event::CMND_JOIN\n when \"PART\"\n event+=Event::CMND_PART\n when \"MODE\"\n event+=Event::CMND_MODE\n when \"TOPIC\"\n event+=Event::CMND_TOPIC\n when \"NAMES\"\n event+=Event::CMND_NAMES\n when \"LIST\"\n event+=Event::CMND_LIST\n when \"INVITE\"\n event+=Event::CMND_INVITE\n when \"KICK\"\n event+=Event::CMND_KICK\n when \"VERSION\"\n event+=Event::CMND_VERSION\n when \"STATAS\"\n event+=Event::CMND_STATAS\n when \"LINK\"\n event+=Event::CMND_LINK\n when \"TIME\"\n event+=Event::CMND_TIME\n when \"CONNECT\"\n event+=Event::CMND_CONNECT\n when \"TRACE\"\n event+=Event::CMND_TRACE\n when \"ADMIN\"\n event+=Event::CMND_ADMIN\n when \"INFO\"\n event+=Event::CMND_INFO\n when \"PRIVMSG\"\n begin\n if(args[0][0]==1)\n @ctcpQuery=true\n @cmndstr=\"CTCP_QUERY\"\n parseCtcp(event+Event::CMND_CTCP_QUERY,arg.join(\" \"))\n return\n end\n rescue NameError\n end\n event+=Event::CMND_PRIVMSG\n when \"NOTICE\"\n begin\n if(args[0][0]==1)\n @ctcpAnswer=true\n @cmndstr=\"CTCP_ANSWER\"\n parseCtcp(event+Event::CMND_CTCP_ANSWER,args.join(\" \"))\n return\n end\n rescue NameError\n end\n event+=Event::CMND_NOTICE\n when \"WHO\"\n event+=Event::CMND_WHO\n when \"WHOIS\"\n event+=Event::CMND_WHOIS\n when \"WHOWAS\"\n event+=Event::CMND_WHOWAS\n when \"KILL\"\n event+=Event::CMND_KILL\n when \"PING\"\n event+=Event::CMND_PING\n when \"PONG\"\n event+=Event::CMND_PONG\n when \"ERROR\"\n event+=Event::CMND_ERROR\n when \"AWAY\"\n event+=Event::CMND_AWAY\n when \"REHASH\"\n event+=Event::CMND_REHASH\n when \"RESTART\"\n event+=Event::CMND_RESTART\n when \"SUMMON\"\n event+=Event::CMND_SUMMON\n when \"USERS\"\n event+=Event::CMND_USERS\n when \"WALLOPS\"\n event+=Event::CMND_WALLOPS\n when \"USERHOST\"\n event+=Event::CMND_USERHOST\n when \"ISON\"\n event+=Event::CMND_ISON\n end\n \n @command=event\n end",
"def arg; end",
"def can_chat_with(user)\n\n end",
"def cmdarg; end",
"def cmdarg; end",
"def cmdarg; end",
"def initialize(*args)\n # Error when attributes not exists!\n fail ::ArgumentError if args.empty?\n\n # Parse options and arguments\n # Arguments can be simple message!\n @options = ChattyCrow.extract_options!(args)\n @arguments = args\n\n # Symbolize keys in options for validations\n ChattyCrow.symbolize_keys!(@options)\n\n # Create flatten arguments for (skype/android/sms.. requests)\n @arguments_flatten = args.join(', ') if args.any?\n\n # Recipients\n @contacts = ChattyCrow.wrap(@options.delete(:contacts)).compact\n\n # Time and location - validate!\n if @time = @options.delete(:time)\n { start: Fixnum, end: Fixnum }.each do |key, klass|\n unless @time[key].is_a?(klass)\n fail ::ArgumentError, \"#{key} must be instance of #{klass}\"\n end\n end\n end\n\n if @location = @options.delete(:location)\n { latitude: Float, longitude: Float, range: Fixnum }.each do |key, klass|\n unless @location[key].is_a?(klass)\n fail ::ArgumentError, \"#{key} must be instance of #{klass}\"\n end\n end\n end\n\n # Channel\n @channel = @options.delete(:channel)\n\n # Token\n @token = @options.delete(:token)\n end",
"def chat(data)\n # uid of the intended recipient\n # only the intended recipient will be able to decrypt\n to = data['to'].to_s\n\n if ConnectedList.include?(to)\n relay_message(to, data)\n else\n intended_recipient_not_found(to)\n end\n end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def cmdarg=(_arg0); end",
"def name\n :chat\n end",
"def PO110=(arg)",
"def event_incoming_chat(client, msg)\nend",
"def process_command(id, cmd, args)\n chat, user = self.get_contact(id) unless id == 0 # get chat information\n if id == 0 then # transport commands \n case cmd\n when '/login' then @telegram.set_authentication_phone_number(args[0], PERMISSIONS[:login]).then{@session[:login] = args[0]} unless @session[:login] # sign in\n when '/logout' then @telegram.log_out().then{@cache[:chats].each_key do |chat| @xmpp.send_presence(@jid, chat, :unsubscribed); @session[:login] = nil end} # sign out\n when '/code' then @telegram.check_authentication_code(args[0]) # check auth code \n when '/password' then @telegram.check_authentication_password(args[0]) # chech auth password\n when '/setusername' then @telegram.set_username(args[0] || '') # set @username\n when '/setname' then @telegram.set_name(args[0] || '', args[1] || '') # set My Name\n when '/setbio' then @telegram.set_bio(args[0] || '') # set About\n when '/setpassword' then @telegram.set_password((args[1] ? args[0] : ''), args[1]) # set password\n when '/config' then @xmpp.send_message(@jid, nil, args[1] ? \"%s set to %s\" % [args[0], @session.store(args[0].to_sym, args[1])] : @session.map{|attr| \"%s is set to %s\" % attr}.join(\"\\n\")) \n when '/help' then @xmpp.send_message(@jid, nil, HELP_GATE_CMD)\n end\n return true # stop executing \n else # chat commands\n case cmd\n when '/d' then @telegram.delete_messages(chat.id, self.get_lastmessages(chat.id, nil, @me.id, args[0]||1).map(&:id), true) # delete message\n when '/s' then @telegram.edit_message_text(chat.id, self.get_lastmessages(chat.id, nil, @me.id, 1).first.id, nil, self.process_outgoing_message(nil, args.join(' '))) # edit message\n when '/add' then @telegram.search_public_chat(args[0]).then{|chat| @xmpp.send_presence(@jid, chat.id, :subscribe)}.wait # add @contact \n when '/join' then @telegram.join_chat_by_invite_link(args[0]) # join https://t.me/publichat\n when '/supergroup' then @telegram.create_new_supergroup_chat(args[0], false, args[1..-1].join(' '), nil) # create new supergroup \n when '/channel' then @telegram.create_new_supergroup_chat(args[0], true, args[1..-1].join(' '), nil) # create new channel \n when '/secret' then @telegram.create_new_secret_chat(chat.id) # create secret chat with current user\n when '/group' then @telegram.create_new_basic_group_chat(chat.id, args[0]) # create group chat with current user \n when '/block' then @telegram.block_user(chat.id) # blacklists current user\n when '/unblock' then @telegram.unblock_user(chat.id) # unblacklists current user \n when '/members' then @telegram.search_chat_members(chat.id, args[0], 9999, TD::Types::ChatMembersFilter::Members.new).then{|m| @xmpp.send_message(@jid, chat.id, (m.members.map do |u| \"%s | role: %s\" % [self.format_contact(u.user_id), u.status.class] end).join(\"\\n\")) } # chat members\n when '/invite' then @telegram.add_chat_member(chat.id, self.get_contact(args[0]).first.id, 100) # invite @username to current groupchat \n when '/link' then @telegram.generate_chat_invite_link(chat.id).then{|link| @xmpp.send_message(@jid, chat.id, link.invite_link)} # get link to current chat\n when '/kick' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Left.new()) # kick @username \n when '/mute' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Restricted.new(is_member: true, restricted_until_date: self.format_bantime(args[0]), permissions: PERMISSIONS[:readonly])) # mute @username [n hours]\n when '/unmute' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Restricted.new(is_member: true, restricted_until_date: 0, permissions: PERMISSIONS[:member])) # unmute @username \n when '/ban' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Banned.new(banned_until_date: self.format_bantime(args[0]))) # ban @username [n hours]\n when '/unban' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Member.new()) # unban @username \n when '/promote' then @telegram.set_chat_member_status(chat.id, self.get_contact(args[0]).first.id, TD::Types::ChatMemberStatus::Administrator.new(custom_title: args[0].to_s, **PERMISSIONS[:admin])) # promote @username to admin \n when '/leave' then @telegram.leave_chat(chat.id).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)} # leave current chat \n when '/leave!' then @telegram.delete_supergroup(chat.type.supergroup_id).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)}.rescue{|e| puts e.to_s} # leave current chat (for owners) \n when '/ttl' then @telegram.send_chat_set_ttl_message(chat.type.secret_chat_id, args[0].to_i) # close secret chat \n when '/close' then @telegram.close_secret_chat(chat.type.secret_chat_id).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)} # close secret chat \n when '/delete' then @telegram.delete_chat_history(chat.id, true, true).then{@xmpp.send_presence(@jid, chat.id, :unsubscribed)} # delete current chat \n when '/search' then @telegram.get_messages(chat.id, self.get_lastmessages(chat.id, args[0], 0, args[1]||100).map(&:id)).value.messages.reverse.each{|msg| @xmpp.send_message(@jid, chat.id, self.format_message(chat.id,msg,false))} # message search\n when '/help' then @xmpp.send_message(@jid, id, HELP_CHAT_CMD)\n else return # continue\n end\n return true # stop\n end\n end",
"def message=(_arg0); end",
"def message=(_arg0); end",
"def PO109=(arg)",
"def chat_params\n params.fetch(:chat, {})\n end",
"def remote_chat(sender, room, msg)\n add_msg \"<#{room || 'unknown'}> #{sender}: #{msg}\"\n end",
"def personal_chat(message) \n puts \"This is a Personal Chat\" \n puts message \n end",
"def set_chat\n @chat = Chat.get_one(params[:app_token], params[:number])\n end",
"def arg(arg)\n self[arg]\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def args; end",
"def whiny=(_arg0); end",
"def PO102=(arg)",
"def PO104=(arg)",
"def chat\n return @chat\n end",
"def PO106=(arg)",
"def react_to *args; end",
"def PO108=(arg)",
"def sendChatMessage(a_to, a_text)\n\t\tp 'JabberClient.sendChatMessage'\n\tend",
"def update!(**args)\n @chat_id = args[:chat_id] if args.key?(:chat_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def update!(**args)\n @chat_id = args[:chat_id] if args.key?(:chat_id)\n @member_type = args[:member_type] if args.key?(:member_type)\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def set_chat\n @chat = Chat.find(params[:id])\n end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def args=(_arg0); end",
"def message\n @_args.first\n end",
"def PO105=(arg)",
"def PO101=(arg)",
"def set_chat\n @chat = @application.chats.find_by!(number: params[:id])\n end",
"def PO111=(arg)",
"def chat\n @title = \"Conversacion\"\n @chats = GetChatsForPreviaGroup.call(@previa_group)\n @messages = GetMessagesForChat.call(Chat.find(params[:chat]))\n end",
"def PO115=(arg)",
"def PO113=(arg)",
"def PO103=(arg)",
"def args(*) end",
"def group_chat(message) \n puts \"This is a Public Group\"\n puts message \n # secure_chat(\"This is confidential\")\n personal_chat(\"hi how are you\") \n end",
"def command_name=(_arg0); end",
"def execute actor, target=[nil]\n def himher thing\n multiple = thing.count > 1 \n\n if multiple \n return \"them\"\n end\n\n case thing[0]\n when Player then \"him\"\n when ItemFacade then \"it\"\n else \"\"\n end\n end\n room_msg, self_msg, vict_msg = @ofound.dup, @found.dup, @tfound.dup\n\n\n if target.include?(actor) # if they're the same person then it's an auto\n target = [actor]\n room_msg = @oauto.dup\n self_msg = @auto.dup\n vict_msg = nil\n elsif target[0] == nil\n room_msg = @onoarg.dup\n self_msg = @noarg.dup\n vict_msg = nil\n end\n room_msg.gsub!(\"$n\", \"<%=other.peek(actor)%>\")\n room_msg.gsub!(\"$N\", \"<%=other.peek(if arg[0].include?(other) then arg[0]-[other]+['You'] else arg[0] end)%>\")\n room_msg.gsub!(\"$m\", himher([actor]))\n room_msg.gsub!(\"$M\", himher(target))\n\n self_msg.gsub!(\"$M\", himher(target))\n self_msg.gsub!(\"$m\", himher([actor]))\n if target\n self_msg.gsub!(\"$N\", actor.peek(target))\n end\n actor.view(\"#G\"+self_msg+\"#n\" + ENDL)\n \n room_msg.untaint\n if target[0]\n if target.count > 1 \n actor.in_room.display([:visual, \"other.can_see?(actor) || other.can_see?(arg[0])\"], actor, [actor], \"#G\"+room_msg+\"#n\", target)\n else\n actor.in_room.display([:visual, \"other.can_see?(actor) || other.can_see?(arg[0])\"], actor, [actor, *target], \"#G\"+room_msg+\"#n\", target)\n target.each do |one_targ|\n vm = vict_msg.dup\n vm.gsub!(\"$n\", one_targ.peek(actor))\n one_targ.view(\"#G\"+vm+ \"#n\" + ENDL)\n end\n end\n else\n puts room_msg\n actor.in_room.display([:visual, \"other.can_see?(actor)\"], actor, [actor], \"#G\"+room_msg+\"#n\", \"\")\n end\n end"
] | [
"0.7384772",
"0.7379535",
"0.71282536",
"0.7066178",
"0.7034402",
"0.6992283",
"0.6921875",
"0.6626611",
"0.654665",
"0.6514601",
"0.64996123",
"0.6441368",
"0.6352319",
"0.5974734",
"0.59321684",
"0.59321684",
"0.5924808",
"0.5855691",
"0.58369803",
"0.58068097",
"0.5788788",
"0.5788788",
"0.5788788",
"0.5786008",
"0.57784706",
"0.57680357",
"0.57680357",
"0.57680357",
"0.57635313",
"0.57628083",
"0.56896985",
"0.5677148",
"0.5654418",
"0.5654418",
"0.5609722",
"0.55972475",
"0.5587648",
"0.5574124",
"0.55740374",
"0.5550508",
"0.55482006",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.55451334",
"0.5541234",
"0.5540952",
"0.55388826",
"0.55314285",
"0.5512921",
"0.5511036",
"0.5503991",
"0.54988563",
"0.5489786",
"0.5489786",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5486542",
"0.5479399",
"0.5479399",
"0.5479399",
"0.5479399",
"0.5479399",
"0.5461286",
"0.54587466",
"0.544562",
"0.54440093",
"0.54333425",
"0.5426838",
"0.5421723",
"0.5397127",
"0.5390675",
"0.5390482",
"0.5385049",
"0.5381128",
"0.53803086"
] | 0.6863538 | 7 |
GET /events/1 GET /events/1.xml | def show
@event = Event.find(params[:id])
respond_to do |format|
format.html {}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def calendar_event(event_id)\n record \"/calendar_events/#{event_id}.xml\", :method => :get\n end",
"def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end",
"def index\n @events = Event.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def show\n @simple_event = SimpleEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @simple_event }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html \n format.xml { render :xml => @event }\n end\n end",
"def index\n respond_to do |format|\n format.html do\n load_html_events\n end\n format.xml do\n load_data_events\n render :xml => @events\n end\n format.json do\n load_data_events\n render :json => @events\n end\n end\n end",
"def index\n if params[:eid]\n @event = Event.find( params[:eid])\n else\n @event = Event.new\n # @event.start_on = Date.new(2015,1,1)\n end\n prepare_variable_for_index_template\n\n respond_to do |format|\n format.html\n format.xml {\n render :xml => @events.to_xml\n }\n format.json {\n render :json => @events.to_json\n }\n format.atom {\n @feed_title = \"My event list\"\n }\n end\n end",
"def events *args\n Xmlstats::Endpoints::Events.fetch *args\n end",
"def index\n @events = Event.find_upcoming(5).reverse\n @title = 'Tulevat tapahtumat'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => events }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @event.to_xml }\n end\n end",
"def show\n @event = IndrelEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @event }\n end\n end",
"def start_list\n unless params[:version] == '2.0.3'\n raise ActionController::RoutingError.new('Not Found')\n end\n\t\t\n @event = Event.find(params[:id])\n respond_to do |format|\n format.xml { render :layout => false }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end",
"def index\n @events = Event.find(:all, :order => 'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def event_info(event_id, event_type = 'sr:match')\n get(\"sports/en/sport_events/#{event_type}:#{event_id}/timeline.xml\")\n end",
"def index\n @events = Event.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n format.json { render :json=>@events } \n end\n end",
"def calendar_events(calendar_id)\n records \"/calendars/#{calendar_id}/calendar_events.xml\", :method => :get\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html\n format.json\n format.rss { render :layout => false }\n end\n end",
"def show\n respond_to do |format|\n format.html { render_template } # show.html.erb\n format.xml { render xml: @event }\n end\n end",
"def event(event, options = {})\n get \"events/#{event}\", options\n end",
"def index\n #@events = Event.all\n @events = Event.page(params[:page]).per(20)\n\n if params[:eid]\n @event = Event.find( params[:eid] )\n else\n @event = Event.new\n\n end\n\n prepare_variable_for_index_template\n\n respond_to do |format|\n format.html\n format.xml { render :xml => @events.to_xml }\n format.json { render :json => @events.to_json }\n format.atom { @feed_title = \"My event list\" } # index.atom.builder\n end\n end",
"def show\r\n @event = Event.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @event }\r\n end\r\n end",
"def show\n load_data\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend",
"def index\n\t@events = @calendar.events(:order => 'created_at ASC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n format.json { render :json => @event }\n end\n end",
"def get(event_id)\n @client.request \"events/#{event_id}\"\n end",
"def events\n @landmark = Landmark.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @landmark.events.to_json(:only => Event::EVENT_INDEX_FIELDS) }\n format.xml { render xml: @landmark.events.to_xml(:root => 'events', :only => Event::EVENT_INDEX_FIELDS) }\n end\n end",
"def event(id, options = {})\n get \"events/#{id}\", options\n end",
"def show\n @evento = Evento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evento }\n end\n end",
"def show\n @evento = Evento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evento }\n end\n end",
"def show\n @evento = Evento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @evento }\n end\n end",
"def show\n @custom_event = CustomEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @custom_event }\n end\n end",
"def events(param = nil)\n request = new_request Net::HTTP::Report do |request|\n request.body = CalendarQuery.new.event(param).to_xml\n end\n response = perform_request request\n \n events = []\n \n body = Nokogiri::XML.parse(response.body)\n namespaces = { 'dav' => \"DAV:\", 'caldav' => 'urn:ietf:params:xml:ns:caldav' }\n \n body.search(\"./dav:multistatus/dav:response\", namespaces).each do |element|\n calendar_data = element.search(\"./dav:propstat/dav:prop/caldav:calendar-data\", namespaces)\n calendar = Icalendar::Parser.new(calendar_data.text).parse.first\n calendar.events.each do |event|\n event.caldav = {\n :etag => element.search(\"dav:propstat/dav:prop/dav:getetag\", namespaces).text, \n :href => element.search(\"dav:href\", namespaces).text\n }\n events += calendar.events\n end\n end\n \n events\n end",
"def show\n @client_event = ClientEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @client_event }\n end\n end",
"def index\n respond_with(@events)\n end",
"def index\n\t\t#@events = Event.all\n\t\t#params是一個hash key:value#\n\t\t@events = Event.page(params[:page]).per(5)\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.xml { render :xml => @events.to_xml }\n\t\t\tformat.json { render :json => @events.to_json }\n\t\t\tformat.atom { @feed_title = \"My event list\" } #index.atom.builder\n \t\tend\n\tend",
"def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end",
"def index\n @events = current_cfp_user.person.events.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def show\n#\t\t@event = Event.find(params[:id])\n\t\t@page_title = @event.name\n\t\trespond_to do |format|\n\t\t\tformat.html { @page_title = @event.name } # show.html.erb\n\t\t\tformat.xml # template: show.xml.builder\t\n\t\t\tformat.json { \n\t\t\t\t#manual list\n\t\t\t\trender :json => { id: @event.id, name: @event.name, created_time: @event.created_at }.to_json \n\t\t\t}\n\t\tend\n\tend",
"def events(service, url, args)\n events = []\n ret = service.send_request(GData4Ruby::Request.new(:get, url, nil, nil, args))\n REXML::Document.new(ret.body).root.elements.each(\"entry\"){}.map do |entry|\n entry = GData4Ruby::Utils.add_namespaces(entry)\n e = GCal4Ruby::Event.new(service)\n if e.load(entry.to_s)\n events << e\n end\n end\n return events\nend",
"def index\n number = request.query_parameters.first[1].to_i\n respond_with Event.where(date_time: Date.current..(Date.current + number.days))\n end",
"def index\n @eventos = Evento.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eventos }\n end\n end",
"def entry_list\n unless params[:version] == '3.0'\n raise ActionController::RoutingError.new('Not Found')\n end\n\t\t\n @event = Event.find(params[:id])\n respond_to do |format|\n format.xml { render :layout => false }\n end\n end",
"def details\n get(\"v1/event/#{@id}\")\n end",
"def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end",
"def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def show\n @event_type = EventType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @event_type }\n end\n end",
"def show\n @calendar_event = CalendarEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @calendar_event }\n end\n end",
"def events(project_id, options = {})\n get \"projects/#{project_id}/events\", options\n end",
"def show\n @eventtime = Eventtime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @eventtime }\n end\n end",
"def index\n @events = Event.getRecords(params[:page])\n end",
"def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end",
"def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def index\n @events = Event.find(:all)\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def show\n @event_meta = EventMeta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event_meta }\n end\n end",
"def events(dbname, &block)\n # can't use RestClient.get b/c of :block_response\n RestClient::Request.execute(:method => :get,\n :url => root_url('events', @storage, dbname),\n :headers => {:accept => \"text/event-stream\"},\n :block_response => block, &HANDLE_RESPONSE)\n end",
"def get_event_list ( year )\n get_api_resource \"#{@@api_base_url}events/#{year}\"\n end",
"def index\n if params[:month]\n month = Date::parse(params[:month])\n conditions = ['begins_at between ? and ?', month, (month+1.month-1.day)]\n else\n if not granted_for? 'events'\n conditions = ['begins_at >= ?', Date::today() ]\n else\n conditions = ['1 = 1' ]\n end\n end\n \n \n \n @events = Event.find(:all, :conditions => conditions, :order => \"begins_at\" )\n if @events.length < 1\n flash[:error] = _('Sorry, no events found')\n end\n\n respond_to do |format|\n format.html \n format.rss \n format.xml { render :xml => @events }\n end\n end",
"def index\n @event = Event.find(params[:event_id])\n\n end",
"def index\n @eventuals = Eventual.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @eventuals }\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: @events }\n end\n end",
"def index\n @events = getUpcomingEvents()\n \n @page_title = \"Events\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def show\n @events = fetch_events\n end",
"def events\n\n @events = Event.where(:enabled => true).includes(:performances)\n @events = @events.where(\"performances.starts_at >= ?\", Time::parse(params[:start])) if params[:start]\n @events = @events.where(\"performances.starts_at <= ?\", Time::parse(params[:end])) if params[:end]\n @events = @events.tagged_with_all(params[:tag]) if params[:tag]\n @events = @events.where(:id => params[:id]) if params[:id] \n respond_to do |format|\n format.xml { render :xml => @events.to_xml( :skip_types => true, :include => ( :performances if params[:include_performances] ) ) }\n end\n \n end",
"def index\n user = self.current_user && User.find_by_id(self.current_user.id)\n @events = nil\n if user\n @events = user.events \n else\n @events = Event.find(:all)\n end\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"def show\n @eventual = Eventual.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @eventual }\n end\n end",
"def index\n @upcoming_events = Event.upcoming\n @past_events = Event.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @event_types = EventType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @event_types }\n end\n end",
"def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not Found\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"def index\n @events = Event.available.page(params[:page])\n end",
"def show\n @event = current_cfp_user.person.events.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def rss\n @events = Post.find(:all, {:conditions=> \"status=public\"},:order => \"id DESC\")\n render :layout => false\n headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"def events\n collection(\"events\")\n end",
"def new\n @simple_event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @simple_event }\n end\n end"
] | [
"0.74074787",
"0.73822564",
"0.72317415",
"0.71266216",
"0.7051357",
"0.70203346",
"0.7014016",
"0.7014016",
"0.7014016",
"0.7014016",
"0.6992188",
"0.69583654",
"0.6933569",
"0.6924838",
"0.6916713",
"0.689496",
"0.68806356",
"0.6879873",
"0.6858128",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.6853787",
"0.68521184",
"0.6797267",
"0.6795163",
"0.6791629",
"0.6777041",
"0.6744187",
"0.67438024",
"0.6743675",
"0.6743431",
"0.6739156",
"0.6712349",
"0.67004216",
"0.6675239",
"0.66576326",
"0.6636281",
"0.66116786",
"0.660687",
"0.6603178",
"0.6603178",
"0.6603178",
"0.66018593",
"0.65739167",
"0.65701014",
"0.65688354",
"0.6551039",
"0.655003",
"0.65476346",
"0.65381193",
"0.6534422",
"0.65315694",
"0.6528436",
"0.6524421",
"0.6483778",
"0.64832103",
"0.64827996",
"0.64827996",
"0.6456879",
"0.6455363",
"0.6449908",
"0.64494",
"0.6436843",
"0.64355236",
"0.64343375",
"0.6424233",
"0.64239264",
"0.6422422",
"0.63974214",
"0.63827795",
"0.63725084",
"0.6369971",
"0.63435566",
"0.6335634",
"0.63350683",
"0.6319909",
"0.6315173",
"0.63135374",
"0.6313455",
"0.63116544",
"0.63086253",
"0.6301665",
"0.62953013",
"0.6294033",
"0.62714475",
"0.62644356"
] | 0.0 | -1 |
GET /events/new GET /events/new.xml | def new
@event = Event.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @event }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n setup_variables\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.new_default\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @event }\n end\n end",
"def new\n @event = Event.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @simple_event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @simple_event }\n end\n end",
"def new\n @event = Event.new\n @title = 'New Event'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = IndrelEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @event }\n end\n end",
"def new\n @event = Event.new\n @page_title = \"Add an Event\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.new\n setup_accounts\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.find(params[:event_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eventtime }\n end\n end",
"def new\n @evento = Evento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @evento }\n end\n end",
"def new\n @custom_event = CustomEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @custom_event }\n end\n end",
"def new\n @event_type = EventType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @event_type }\n end\n end",
"def new_rest\n @page_usage_event = PageUsageEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_usage_event }\n end\n end",
"def new\n @event = Event.new\n @page_title=\"Add Race\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n\n # render :action => 'new'\n end",
"def new\n @event = Event.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @event }\n end\n end",
"def new\n @event_meta = EventMeta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event_meta }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @create_event = CreateEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @create_event }\n end\n end",
"def new\n # @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = Event.new\n @event.time = Time.now\n \n @page_title = \"New Event\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event_event = Event::Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_event }\n end\n end",
"def new\n @calendar_event = CalendarEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @calendar_event }\n end\n end",
"def new\n @organisation = Organisation.find(params[:organisation_id])\n @event = Event.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.new\n @event.event_dates.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @eventual = Eventual.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eventual }\n end\n end",
"def new\n\t\t@event = Event.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @event }\n\t\tend\n\tend",
"def new\n @event = Event.new(:time_slots => @conference.default_timeslots)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event = Event.new\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n end\n end",
"def new\n @event_request = EventRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_request }\n end\n end",
"def new\n @myevent = Myevent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @myevent }\n end\n end",
"def new\n @hike_event = HikeEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hike_event }\n end\n end",
"def new\n @current_event = CurrentEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @current_event }\n end\n end",
"def new\n @event = @current_account.events.new(Event.defaults) # TODO, set this account-wid\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @event = current_user.events.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @evento = Evento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evento }\n end\n end",
"def new\n @event = current_user.events.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @event }\n format.js # return the HTML block for use by the AJAX new.js.erb\n end\n end",
"def new\n @events_by_year = EventsByYear.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @events_by_year }\n end\n end",
"def new\n @pharmacy_events = PharmacyEvents.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pharmacy_events }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @velocity_event = VelocityEvent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @velocity_event }\n end\n end",
"def new\n @events_tag = EventsTag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @events_tag }\n end\n end",
"def new\n @client_event = ClientEvent.new\n @event = Event.find(params[:id])\n @clients = Client.all\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @client_event }\n end\n end",
"def new\n assign_new_event\n\n respond_to do |format|\n format.html { render :edit }\n format.js { render(:update) { |page| page.redirect_to(action: :new, event: event_params) } }\n end\n end",
"def new\n @events_translation = EventsTranslation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @events_translation }\n end\n end",
"def new\n @event = Event.new(event_type: params[:event_type])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event }\n end\n end",
"def new\n @events = Event.find(:all, :conditions => [\"user_id = ?\", self.current_user.id])\n @ticket = Ticket.new\n @ticket.event_id = params[:ticket][:event_id]\n\n respond_to do |format|\n if @events.length >= 1\n format.html # new.html.erb\n format.xml { render :xml => @ticket }\n else\n format.html { redirect_to new_event_path()}\n end\n end \n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end"
] | [
"0.7961696",
"0.7921109",
"0.7867247",
"0.7857972",
"0.78549564",
"0.78541255",
"0.78407097",
"0.7750453",
"0.77215594",
"0.7641453",
"0.7637763",
"0.7487815",
"0.74306935",
"0.7382315",
"0.73636585",
"0.73075145",
"0.7307211",
"0.7268604",
"0.72594714",
"0.72589314",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7257251",
"0.7245518",
"0.7227174",
"0.7207357",
"0.7199961",
"0.7199391",
"0.71647817",
"0.7075859",
"0.70641977",
"0.7056406",
"0.7056047",
"0.7047212",
"0.70329505",
"0.7003557",
"0.6946042",
"0.6941953",
"0.6935209",
"0.6926443",
"0.6903971",
"0.6901349",
"0.6880741",
"0.687849",
"0.68725765",
"0.68660194",
"0.68651336",
"0.68592256",
"0.68284243",
"0.6806762",
"0.6806479",
"0.67954224",
"0.6791698",
"0.6791698",
"0.6791698",
"0.6791698"
] | 0.785546 | 16 |
POST /events POST /events.xml | def create
# save file with _id
# want to get an id then save the file
# so we need to get the filename, save the record with the filename
# then save the file with the right filename with _id
@file = params[:event][:picture_location]
params[:event][:picture_location] = nil
@event = Event.new(params[:event])
respond_to do |format|
if @event.save
@event.save_file(@file)
flash[:notice] = 'Event was successfully created.'
format.html { redirect_to(@event) }
format.xml { render :xml => @event, :status => :created, :location => @event }
else
format.html { render :action => "new" }
format.xml { render :xml => @event.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n Rails.logger.debug(\"Received event #{params[:event]}\")\n head :ok\n end",
"def create_event event, data={}\n data[:event] = event\n post '/event', data\n end",
"def save_event(event)\n method = (event.id == nil || event.id == '') ? :post : :put\n query_string = (method == :put) ? \"/#{event.id}\" : ''\n @connection.send(Addressable::URI.parse(events_url + query_string), method, event.to_xml)\n end",
"def create\n megam_rest.post_event(to_hash)\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n EventAddedNotifier.created(@event).deliver\n format.html { redirect_to(@event, :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_events\n end",
"def create\n setup_variables\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(admin_event_path(@event)) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n if @event.save\n render json: @event, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to(@event, :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to(@event, :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to(@event, :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to(@event, :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n puts params[:event]\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to(@event, :notice => 'Event was successfully created.') }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = IndrelEvent.new(indrel_event_params)\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to(@event) }\n format.xml { render xml: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def record_event(params = {})\n self.class.get('/event/record', params)\n end",
"def create\r\n @event = Event.new(event_params)\r\n convert_timezone @event\r\n event_type_status @event\r\n if @event.save_without_exception\r\n update_theme @event\r\n add_event_categories @event\r\n add_event_location @event\r\n create_group_guest_list @event\r\n add_photos @event\r\n # Create Groups and contacts through CSV\r\n contacts_imports\r\n render json: SuccessResponse.new(\r\n code: 200, message: 'Event Created.', location: '/events/List?id=' + @event.id.to_s, eventID: @event.id\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new, adapter: :json, status: :unprocessable_entity\r\n end\r\n end",
"def save\n event = params\n # This assumes that all keys exists. Yay no error handling...\n toSave = Event.new(update_type: event[:event],\n start_time: event[:payload][:event][:start_time_pretty],\n end_time: event[:payload][:event][:end_time_pretty],\n location: event[:payload][:event][:location],\n invitee_name: event[:payload][:invitee][:name],\n duration: event[:payload][:event_type][:duration],\n event_kind: event[:payload][:event_type][:kind])\n toSave.save\n render json: {}, status: 200\n end",
"def create\n event = Event.new(event_params)\n event.save!\n render json: event\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.json { render :show, status: :created, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.json { render :show, status: :created, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Events::Event.new(event_params)\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, :notice => 'Event was successfully created.' }\n format.json { render :json => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event]) \n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n format.xml do\n render :xml => \"<result>sucess</result>\", :status => :created \n end\n\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n respond_to do |format|\n if @event.save\n track_activity @event\n format.html { redirect_to :back, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n after_event_created_mail @event\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n if @event.save\n head :created\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n params[:event] = convert_datetimes( params[:event] )\n @event = @current_account.events.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event_event = Event::Event.new(params[:event_event])\n\n respond_to do |format|\n if @event_event.save\n format.html { redirect_to @event_event, notice: 'Event was successfully created.' }\n format.json { render json: @event_event, status: :created, location: @event_event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # TODO: this is a bit too hackish, and deals too much with handling attributes\n # -> move to model\n\n attrs = params[:event]\n attrs['location'] = Location.find_by_id_or_build_by_name(attrs['location'],\n attrs['location_id'])\n attrs['date'] = EuropeanDate.to_iso(attrs['date'])\n # attr location already contains loc, so we omit loc_id\n @event = Event.new(attrs.reject { |k,v| k == 'location_id' })\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Tapahtuma luotu.'\n format.html { redirect_to events_path }\n # format.xml { render :xml => ... }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to \"/#{@event.url}\" }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n result = Event::CreateEvent.perform(event_context)\n\n respond_to do |format|\n if result.success?\n @event = result.event\n format.json { render action: 'show', status: :created }\n else\n format.json { render json: { :errors => result.errors.full_messages }, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, :notice => 'Event was successfully created.' }\n format.json { render :json => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create_rest\n @page_usage_event = PageUsageEvent.new(params[:page_usage_event])\n\n respond_to do |format|\n if @page_usage_event.save\n flash[:notice] = 'PageUsageEvent was successfully created.'\n format.html { redirect_to(@page_usage_event) }\n format.xml { render :xml => @page_usage_event, :status => :created, :location => @page_usage_event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @page_usage_event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: events_path(@event) }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @evento = Evento.new(params[:evento])\n\n respond_to do |format|\n if @evento.save\n flash[:notice] = 'Evento was successfully created.'\n format.html { redirect_to(@evento) }\n format.xml { render :xml => @evento, :status => :created, :location => @evento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @evento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'El evento fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: \"You're event has been received. Once approved it will be included in the next mailing.\" }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n flash[:notice] = 'Event was successfully created.'\n format.html { redirect_to([:admin, :canada, @event]) }\n format.xml { render :xml => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: t(:event_created) }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: \"Event #{@event} was successfully created.\" }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, success: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n if @event.save\n render :show, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, flash: {success: 'Event was successfully created.'} }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n if @event.save\n \tdata = { data: @event, status: :created, message: \"Event was successfully created.\" }\n render :json => data\n else\n \tdata = { data: @event.errors, status: :unprocessable_entity }\n render :json => data\n end\n end",
"def create\r\n @event = Event.new(event_params)\r\n @event.save\r\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Aula cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: \"Event was successfully created.\" }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: \"Event was successfully created.\" }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n flash[:success] = \"Event was successfully created.\"\n format.html { redirect_to @event }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, event: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = @member.events.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: '创建成功' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: { message: @event.errors }, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n @event.url = BASE_URL + @event.name.gsub(' ', '_')\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to new_event_path, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to action: :index, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.6938859",
"0.6832928",
"0.6629996",
"0.6572941",
"0.65628463",
"0.64595443",
"0.644994",
"0.6432171",
"0.64178646",
"0.64178646",
"0.64178646",
"0.64178646",
"0.6415361",
"0.6409476",
"0.6409476",
"0.6409476",
"0.6409476",
"0.6409476",
"0.637794",
"0.6374196",
"0.633384",
"0.6307433",
"0.63063586",
"0.6299404",
"0.62923956",
"0.62923956",
"0.62886095",
"0.62618375",
"0.6257976",
"0.6241782",
"0.62316203",
"0.6231454",
"0.6212256",
"0.6200595",
"0.61951303",
"0.6194776",
"0.6176754",
"0.6176712",
"0.6174857",
"0.6172675",
"0.61664474",
"0.61655915",
"0.61570466",
"0.61376786",
"0.61376786",
"0.6134283",
"0.61309135",
"0.612782",
"0.6122845",
"0.61193013",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.6114203",
"0.61126834",
"0.61082745",
"0.6106766",
"0.6104844",
"0.6103146",
"0.6103146",
"0.61015546",
"0.60985756",
"0.60910577",
"0.60899395",
"0.6089661",
"0.6079662",
"0.60780895",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915",
"0.60738915"
] | 0.0 | -1 |
PUT /events/1 PUT /events/1.xml | def update
@event = Event.find(params[:id])
if params[:event][:picture_location].kind_of? ActionController::UploadedStringIO
@file = params[:event][:picture_location]
File.open("#{RAILS_ROOT}/public/events/#{@file.original_filename}", "wb"){|f| f.write @file.read}
params[:event][:picture_location] = "/events/#{@file.original_filename}"
else
params[:event][:picture_location] = @event.picture_location
end
respond_to do |format|
if @event.update_attributes(params[:event])
flash[:notice] = 'Event was successfully updated.'
format.html { redirect_to(@event) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @event.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def save_event(event)\n method = (event.id == nil || event.id == '') ? :post : :put\n query_string = (method == :put) ? \"/#{event.id}\" : ''\n @connection.send(Addressable::URI.parse(events_url + query_string), method, event.to_xml)\n end",
"def put_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tputs do_the_put_call( url: api_url, user: @user, json: args[:json] )\nend",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to(edit_event_path(@event), :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n setup_variables\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(admin_event_path(@event)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(event_params)\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n update_event_data\n format.html { redirect_to(@event, :notice => 'Event was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\tif @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n @event = Event.find(params[:id])\n#TODO fazer o update event via jquery, retornando rjs\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(tasks_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n \n @event = @current_user.events.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n flash[:notice] = 'Event was successfully updated.'\n format.html { redirect_to(:root) }\n format.xml { head :ok }\n else\n format.html { render(:event => \"edit\") }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\t @events = Event.find(:all)\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html {\n\n flash[:notice] = 'Event was successfully updated.'\n redirect_to \"/admin/events/2010/4\"\n \n }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\r\n @event.update(event_params)\r\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n if @event.update(params[:event])\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n @event = Event.using(:shard_one).find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n\n\n\n end",
"def update\n if @event.update(event_params)\n render json: @event, status: 201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update_rest\n @page_usage_event = PageUsageEvent.find(params[:id])\n\n respond_to do |format|\n if @page_usage_event.update_attributes(params[:page_usage_event])\n flash[:notice] = 'PageUsageEvent was successfully updated.'\n format.html { redirect_to(@page_usage_event) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @page_usage_event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to([:admin, @event], notice: 'Event was successfully updated.') }\n format.xml { head :ok }\n website.add_log(user: current_user, action: \"Updated event: #{@event.name}\")\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event.update(event_params)\n end",
"def update\n respond_to do |format|\n if @event.update Fenix::Store::Converter::Flattener.event params[:event]\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event.update(event_params) \n end",
"def update\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n if @event_event.update_attributes(params[:event_event])\n format.html { redirect_to @event_event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n \n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t(:event_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"def update\n # @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @event.update(event_params)\n render :show, status: :ok, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @event.update(event_params)\n render :show, status: :ok, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render json: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event_meta = EventMeta.find(params[:id])\n\n respond_to do |format|\n if @event_meta.update_attributes(params[:event_meta])\n flash[:notice] = 'EventMeta was successfully updated.'\n format.html { redirect_to(@event_meta) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event_meta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @event.update(event_params)\n\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @event.update(event_params(params))\n render json: @event, status: 200\n else\n render :json => @event.errors, :status => 422\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n if @event.update(event_params)\n render :show, status: :ok, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n @event.update(status: \"Pending\")\n else\n @reopen = true\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.html { render :show }\n end\n end\n end",
"def update\n @evento = Evento.find(params[:id])\n respond_to do |format|\n if @evento.update_attributes(params[:evento])\n flash[:notice] = 'Evento was successfully updated.'\n format.html { redirect_to(@evento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if @event.update(event_params)\n render json: { location: format_event(@event) }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n @event.save!\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event}\n flash[:success] = \"Event was successfully updated.\"\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @axis_event.update(axis_event_params)\n format.html { redirect_to @axis_event, notice: 'Axis event was successfully updated.' }\n format.json { render :show, status: :ok, location: @axis_event }\n else\n format.html { render :edit }\n format.json { render json: @axis_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, flash: {success: 'Event was successfully created.'} }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @create_event = CreateEvent.find(params[:id])\n\n respond_to do |format|\n if @create_event.update_attributes(params[:create_event])\n format.html { redirect_to @create_event, notice: 'Create event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @create_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html {redirect_to events_path }\n format.xml { head :ok }\n\t\t\t\tformat.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @event.errors, :status => :unprocessable_entity }\n\t\t\t\tformat.js\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { redirect_to @event }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @evento = Evento.find(params[:id])\n\n respond_to do |format|\n if @evento.update_attributes(params[:evento])\n format.html { redirect_to(@evento, :notice => 'Evento was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @evento = Evento.find(params[:id])\n\n respond_to do |format|\n if @evento.update_attributes(params[:evento])\n format.html { redirect_to(@evento, :notice => t('cambio')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n # @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n debugger\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n @event.tags.clear()\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to '/', notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html do\n gflash :notice\n redirect_to @event\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end"
] | [
"0.68006223",
"0.66227084",
"0.6586422",
"0.6582029",
"0.6582029",
"0.6582029",
"0.6582029",
"0.6582029",
"0.6582029",
"0.6582029",
"0.6538628",
"0.6528396",
"0.6528396",
"0.6528396",
"0.6528396",
"0.6504651",
"0.64950335",
"0.64886147",
"0.6481964",
"0.6477629",
"0.6464071",
"0.6452036",
"0.6444751",
"0.64445305",
"0.64273465",
"0.64273465",
"0.6421036",
"0.6408289",
"0.63956994",
"0.6383137",
"0.6383137",
"0.6382263",
"0.6376763",
"0.6366921",
"0.6360658",
"0.63419574",
"0.6332709",
"0.63224745",
"0.6297658",
"0.62903327",
"0.62903327",
"0.6281635",
"0.6271169",
"0.62595165",
"0.62544787",
"0.6250515",
"0.6247461",
"0.6247461",
"0.6247461",
"0.6240219",
"0.62338644",
"0.62286377",
"0.6223936",
"0.6221245",
"0.62210834",
"0.6216093",
"0.62095135",
"0.6206554",
"0.6206554",
"0.6206554",
"0.6206554",
"0.6206554",
"0.6206554",
"0.6206554",
"0.6206554",
"0.6201804",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.6199105",
"0.619516",
"0.6184536",
"0.61808336",
"0.6179439",
"0.61708736",
"0.61653763",
"0.6162454",
"0.61577106",
"0.61559707",
"0.61469",
"0.6140562",
"0.6140562",
"0.6140562",
"0.6140562",
"0.6140562"
] | 0.0 | -1 |
DELETE /events/1 DELETE /events/1.xml | def destroy
@event = Event.find(params[:id])
@event.destroy
respond_to do |format|
format.html { redirect_to(events_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event.destroy\n respond_to do | format |\n format.html { redirect_to events_path }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(tasks_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @evento = Evento.find(params[:id])\n @evento.destroy\n\n respond_to do |format|\n format.html { redirect_to(eventos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @evento = Evento.find(params[:id])\n @evento.destroy\n\n respond_to do |format|\n format.html { redirect_to(eventos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = IndrelEvent.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(indrel_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\t\tics_for_all #########\n respond_to do |format|\n\t\t\tformat.html { redirect_to(:back) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to(admin_events_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted event: #{@event.name}\")\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_canada_events_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @custom_event = CustomEvent.find(params[:id])\n @custom_event.destroy\n\n respond_to do |format|\n format.html { redirect_to(custom_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @client_event = ClientEvent.find(params[:id])\n @client_event.destroy\n\n respond_to do |format|\n format.html { redirect_to(client_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(my_races_path) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = @current_user.events.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(events_url) }\n format.xml { head :ok }\n end\n end",
"def delete_event\r\n event = Event.find_by(id: params[:eventid].to_i)\r\n if event.present?\r\n event.update(status: 3)\r\n lt_update_event_status event, 'archived'\r\n render json: SuccessResponse.new(\r\n code: 200,\r\n message: 'Event Deleted.'\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new(\r\n code: 404,\r\n message: 'Event not found!'\r\n ), adapter: :json, status: :not_found\r\n end\r\n\r\n end",
"def delete_event(event)\n @connection.send(Addressable::URI.parse(events_url + \"/#{event.id}\"), :delete)\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n render :nothing => true, :status => 200, :content_type => 'text/plain'\n end",
"def destroy\n @event = Event.find(params[:id])\n @events = Event.where(event_id: params[:id])\n @events.each.destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n load_data\n @event.destroy\n clear_zend_cache\n\n respond_to do |format|\n format.html { redirect_to(category_events_url(category)) }\n format.xml { head :ok }\n end\n end",
"def destroy_rest\n @page_usage_event = PageUsageEvent.find(params[:id])\n @page_usage_event.destroy\n\n respond_to do |format|\n format.html { redirect_to(page_usage_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n head :no_content\n end",
"def destroy\n @eventtime = Eventtime.find(params[:id])\n @eventtime.destroy\n\n respond_to do |format|\n format.html { redirect_to(eventtimes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\r\n @event = Event.find(params[:id])\r\n #@event.destroy\r\n @event.update_attribute(\"is_deleted\", true)\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(events_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @event = Event.find(params[:id])\n #@event.update_attribute(:deleted, true)\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n\n head :no_content\n end",
"def destroy\n @event.destroy\n\n head :no_content\n end",
"def destroy\n @event.destroy\n\n head :no_content\n end",
"def delete(id)\n wf_event_id?(id)\n api.delete(id)\n end",
"def destroy\n @event = Event.find(params[:id])\n group = @event.group\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to group }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event_type = EventType.find(params[:id])\n @event_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(event_types_url) }\n format.xml { head :ok }\n end\n end",
"def delete_event\n if params[:id]\n @e = Evento.find(params[:id]).destroy\n end\n render :json => msj = { :status => true, :message => 'ok'}\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n end",
"def destroy\n @event_event = Event::Event.find(params[:id])\n @event_event.destroy\n\n respond_to do |format|\n format.html { redirect_to event_events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @calevent = Calevent.find(params[:id])\n @calevent.destroy\n\n respond_to do |format|\n format.html { redirect_to calevents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(events_url) }\n format.fbml { redirect_to(events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event.destroy\n \n head :no_content\n end",
"def destroy\n @event_meta = EventMeta.find(params[:id])\n @event_meta.destroy\n\n respond_to do |format|\n format.html { redirect_to(event_metas_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to(lesson_url(@lesson)) }\n format.xml { head :ok }\n end\n end",
"def destroy\n event = Event.find(params[:id])\n event.destroy!\n end",
"def destroy\n @velocity_event = VelocityEvent.find(params[:id])\n @velocity_event.destroy\n\n respond_to do |format|\n format.html { redirect_to(velocity_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = @rsvp.event\n @rsvp.destroy\n\n respond_to do |format|\n format.html { redirect_to(@event) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n # @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n #1st you retrieve the user thanks to params[:user_id]\r\n user = User.find(params[:user_id])\r\n #2nd you retrieve the event thanks to params[:id]\r\n @event = user.events.find(params[:id])\r\n @event.destroy\r\n respond_to do |format|\r\n #1st argument reference the path /users/:user_id/events/\r\n format.html { redirect_to(user_events_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"def destroy\n @calendar_event = CalendarEvent.find(params[:id])\n @calendar_event.destroy\n\n respond_to do |format|\n format.html { redirect_to(calendar_events_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n \n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def delete_event(event)\n notifications = \"sendNotifications=#{event.send_notifications?}\"\n send_events_request(\"/#{event.id}?#{notifications}\", :delete)\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'データが削除されました。' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end"
] | [
"0.71272403",
"0.71019286",
"0.7034015",
"0.7034015",
"0.7018114",
"0.6961932",
"0.6954058",
"0.6954058",
"0.6908071",
"0.688388",
"0.6860901",
"0.6859833",
"0.68565935",
"0.68509364",
"0.67942625",
"0.6784313",
"0.67591745",
"0.6756506",
"0.67406136",
"0.67341024",
"0.67226344",
"0.6714841",
"0.6702414",
"0.6698774",
"0.6689706",
"0.66704595",
"0.66540253",
"0.66494834",
"0.6644854",
"0.6644854",
"0.6644854",
"0.6644208",
"0.6638412",
"0.6637615",
"0.66162705",
"0.6613869",
"0.6613869",
"0.66126376",
"0.6612111",
"0.66049534",
"0.65942",
"0.6584981",
"0.6571824",
"0.6563542",
"0.65423876",
"0.6539795",
"0.6539605",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536339",
"0.6536035",
"0.65291417",
"0.65271115",
"0.6514739",
"0.65055573",
"0.6503681",
"0.6497475",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735",
"0.64959735"
] | 0.7095852 | 22 |
If user_one_id is always smaller than user_two_id, we always know how to look up the relationships for a given combination of users | def user_one_has_smaller_id
if user_one_id.to_i > user_two_id.to_i
self.errors.add(:user_one_id, :user_one_id_larger, "user_one_id must be the smaller than user_two_id.")
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def make_relationships\n users = User.all\n user = users.first\n\n following = users[1..50] # all of the other users our first user should be following.\n followers = users[3..40] # all of the users that are following our first user.\n\n following.each { |followed| user.follow!(followed) }\n followers.each { |follower| follower.follow!(user) }\nend",
"def relationship(user) # \n return :self if user.id == id # TODO will I use this value?\n friendship_association = Friendship.where(\"(initiator_id = :own_id AND recipient_id = :other_id) OR (initiator_id = :other_id AND recipient_id = :own_id)\", own_id: id, other_id: user.id)\n if friendship_association.empty?\n return nil\n else\n friendship_association.first\n end\n end",
"def friendship_relation(user_2)\n Friendship.where(user_id: [self.id,user_2.id], friend_id: [self.id,user_2.id]).first\n end",
"def related?(user)\n [from_user_id, to_user_id].include?(user&.id)\n end",
"def get_relationship(other_user)\n\tif other_user.present?\n\t\tRelationship.where(\"follower_id = :follower_id and followed_id = :followed_id or follower_id = :followed_id and followed_id = :follower_id\", {follower_id: other_user.id, followed_id: self.id})[0]\n\tend\n end",
"def get_relationship user_id\n url = API + \"users/#{user_id}/relationship?access_token=\" + @access_token\n get(url)\n end",
"def mutual_relationships\n Relationship.find_by_sql([\"SELECT * from relationships t1 INNER JOIN relationships t2 ON (t1.follower_id = t2.followable_id) WHERE t1.follower_id = ? AND t1.id < t2.id AND t1.followable_type = 'User'\", self.id])\n end",
"def other_user(user_id)\n if user_1_id == user_id\n user_2_id\n else\n user_1_id\n end\n end",
"def find_relationship(other_user)\n requested_friend = Relationship.where(requester_id: self.id).where(receiver_id: other_user.id)\n requested_friend.any? ? requested_friend : Relationship.where(requester_id: other_user.id).where(receiver_id: self.id)\n end",
"def relation(user)\n traversal = self.both(:bobfather).depth(:all).unique(:node_path).eval_paths { |path| (path.end_node[:fbid] == user[:fbid]) ? :include_and_continue : :exclude_and_continue }\n # self.both(:bobfather).depth(:all).filter{|path| path.end_node.rel?(:recommend, :incoming)}.\n # each{|node| puts node[:name]}\n \n #traversal = self.both(:bobfather).depth(:all).unique(:node_path).eval_paths { |path| puts path.end_node ; puts path.end_node.id ; :include_and_continue }\n # traversal = self.both(:bobfather).depth(:all).unique(:node_path).eval_paths { |path| :include_and_continue }\n # traversal = u1.both(:bobfather).depth(:all).unique(:node_path).eval_paths { |path| :include_and_continue }\n return traversal\n end",
"def friend_of(user)\n user1.id == user.id ? user2 : user1\n end",
"def friends(user)\n user_friends = \"SELECT users.*\n from users\n INNER JOIN relationships\n ON relationships.follower_id = #{user.id}\n UNION\n SELECT users.*\n from users\n INNER JOIN relationships\n ON relationships.followed_id = #{user.id}\"\n User.find_by_sql(user_friends)\n end",
"def social_distance_to user_id\n\n fake_test_data = {\n 1 => [5,6],\n 5 => [1],\n 6 => [1,7,8],\n 7 => [6],\n 8 => [6, 9, 12],\n 9 => [8],\n 12 => [13, 8],\n 13 => [12,14],\n 14 => [13]\n }\n\n start_id = 1\n end_id = user_id\n\n get_vertices = lambda { |x|\n fake_test_data[x] || []\n }\n\n a = start_id\n b = end_id\n marked = Set.new # keep track of checked vertices\n depth_a = get_vertices.call a\n depth_b = get_vertices.call b\n # check for distance=1 here, next checks will be for a common vertex in-between\n return 1 if b.in? depth_a\n distance = 2\n next_depth_a = []\n next_depth_b = []\n while depth_a.size > 0 && depth_b.size > 0\n # first check for even distances\n return distance if (depth_a & depth_b).size > 0\n distance += 1\n # get full front on next depth (all connected vertices of all vertices on this depth)\n depth_a.each do |aa|\n unless aa.in? marked\n next_depth_a += get_vertices.call aa\n marked.add(aa)\n end\n end\n # ... same for the other end\n depth_b.each do |bb|\n unless bb.in? marked\n next_depth_b += get_vertices.call bb\n marked.add(bb)\n end\n end\n depth_a = next_depth_a\n # second check with only one front moved forward (otherwise we might \"jump over\" the common vertex)\n return distance if (depth_a & depth_b).size > 0\n distance += 1\n depth_b = next_depth_b\n next_depth_a = next_depth_b = []\n end\nend",
"def befriended_with(other_user)\n sql_stmt = '(user_id = :first_id OR friend_id = :first_id)\n AND (user_id = :second_id OR friend_id = :second_id)\n AND (:first_id != :second_id)\n AND confirmed = :confirmed'\n Friendship.where(sql_stmt, first_id: self.id, second_id: other_user.id, confirmed: true).exists?\n end",
"def validate_users\n if user2_id <= user1_id\n errors.add(:user2_id, 'user2 id must be greater than user1 id')\n elsif user1_id != requester_id && user2_id != requester_id\n errors.add(:requester_id, 'requester cannot be a third person')\n end\n end",
"def involved_people\n involved_people_ids.collect{|user_id| User.find(user_id)}\n end",
"def user_relationship\n if request.xhr?\n organization_id = params[\"organization_id\"]\n per_page = params[:iDisplayLength] || Settings.per_page\n page = params[:iDisplayStart] ? ((params[:iDisplayStart].to_i/per_page.to_i) + 1) : 1\n params[:iSortCol_0] = 1 if params[:iSortCol_0].blank?\n sort_field = SORT_MAP_RELATIONSHIP[params[:iSortCol_0].to_i]\n # @users = User.get_all_users_except_id(current_user.id, page, per_page, params[:sSearch], sort_field + \" \" + params[:sSortDir_0],organization_id)\n @users = User.get_user_to_relationship(page, per_page, params[:sSearch], sort_field + \" \" + params[:sSortDir_0])\n render :json => @users\n return\n end\n end",
"def related_concept_ids(db, *ids)\n ids = ids.flatten\n other_ids = db[:mappings].where(concept_2_id: ids).where{Sequel.function(:lower, :relationship_id) =~ 'is_a'}.select_map(:concept_1_id)\n other_ids + ids\n end",
"def relationship(user)\n if self == user\n :self\n elsif sent_requests.find_by(requestee_id: user.id)\n :requestee\n elsif friend_requests.find_by(requester_id: user.id)\n :requester\n elsif friendships.find_by(friend_id: user.id)\n :friend\n end\n end",
"def lacticate_users(user1,user2)\n # PostgresUser.lacticate_users(user1,user2)\n lacticate_pg_users(user1,user2)\n end",
"def relationship(user)\n Following.where(:follower_id => self, :followed_id => user).first.try(:relationship)||\"none\"\n end",
"def friends\n @user ||= auth_user\n friends = ::User.search_users_in_circle(@user).results\n following_user_ids = ::Stores::Following.where(user_id: @user.id).collect(&:follower_user_id) # others following user\n followings = ::Stores::Following.where(follower_user_id: @user.id).includes(:user).order('last_traded_at desc, id desc') # user following others, already ordered newest to oldest\n followed_user_ids = Set.new # for excluding the non-followers\n both_side_followers = []\n one_side_followers = []\n bound = :circle\n user_ids_to_exclude = []\n auth_user.boundaries.group_by(&:type).each do|btype, blist|\n case btype\n when 'Users::ChildCircleOption'\n case blist.first.content_keyword\n when 'GRADE_ONLY'\n bound = :grade\n when 'CLASS_ONLY'\n bound = :class\n end\n when 'Users::UserBlock'\n user_ids_to_exclude = user_ids_to_exclude + ::Users::Boundary.extract_content_values_from_list(blist)\n end\n end\n followings.each do|following|\n user = following.user\n is_mutual = following_user_ids.include?(following.user_id) # y is also following user\n user.is_follower = true\n user.is_mutual_friend = is_mutual\n if is_mutual\n both_side_followers << user.as_more_json({}, auth_user.id)\n else\n if bound.eql? :circle and ::Schools::SchoolGroup.grades_around(auth_user.grade).include?(user.grade)\n one_side_followers << user.as_more_json({}, auth_user.id)\n elsif bound.eql? :grade and auth_user.grade.eql?(user.grade)\n one_side_followers << user.as_more_json({}, auth_user.id)\n elsif bound.eql? :class and auth_user.teacher.eql? user.teacher\n one_side_followers << user.as_more_json({}, auth_user.id)\n end\n end\n logger.debug \" | %20s | %1s | %10d\" % [user.user_name, is_mutual ? 'B' : 's', following.id]\n followed_user_ids << following.user_id\n end\n non_followers = friends.find_all {|friend| !followed_user_ids.include?(friend.id) }.sort{|x,y| y.id <=> x.id } # newest registered friends\n logger.debug \"-------- #{both_side_followers.size} both side, #{one_side_followers.size} one side, #{non_followers.size} non-followers\"\n @friends = both_side_followers + one_side_followers + non_followers.as_json\n #if they're blocked, remove them regardless.\n result = @friends.map do |friend|\n if not user_ids_to_exclude.include?(friend['id'])\n friend\n else\n nil\n end\n end\n result = result.compact\n respond_to do|format|\n format.json { render json:{ success: true, users: result} }\n format.html\n end\n end",
"def friends # I dont' understand associations well enough....\n User.find_by_sql(\"select * from users join networks on networks.user_id='#{self.id}' where users.id=networks.friend_id order by id desc\")\n end",
"def followed_users_and_me\n followed_users + [id]\n end",
"def involved_people\n # [self.user, self.answerers, self.commenters].flatten.uniq\n [self.user].flatten.uniq\n end",
"def get_related_users(query='', results=10, start=0)\r\n get_related('Users',query, results, start)\r\n end",
"def possible_friends\n User.all - self.requesters - self.requestees-self.friends-User.where(id:self.id)\n end",
"def chain_to(user)\n return [] unless twitter = user && user.identity(:twitter)\n return [] unless chain = Bountybase::Graph.chain(self.id, twitter.user_id)\n \n chain.map(&:attributes).pluck(\"identifier\")\n end",
"def user_ids_following_from(users)\n existing_friend_following = Follow.select(\"following_id\").where(:follower_type => 'User', :follower_id => self[:id], :following_type => 'User', :following_id => users)\n existing_friend_following.to_a.inject({}) do |hash, follow|\n hash[follow[\"following_id\"]] = follow\n hash\n end\n end",
"def focused_by_user_clause_if_set(relation)\n if uuid = params[:uuid]\n return relation if uuid.blank?\n\n user = User.find_by_uuid(uuid)\n relation.where(user_id: user.id)\n else\n relation\n end\n end",
"def graph(twit1, twit2)\n twit1_id = info(twit1)['id']\n twit1_friends = friends(twit1)\n twit2_id = info(twit2)['id']\n twit2_followers = followers(twit2)\n # Start assuming there are no connections\n graph = { 1 => [], 2 => [], 3 => [] }\n \n if twit2_followers.include?(twit1_id)\n graph[1] = [[twit1_id, twit2_id]]\n end\n \n return graph unless graph[1].empty?\n \n # Check second degree: Are there friends of twit1 who are followers of twit2? \n # Get an array of all connections.\n for friend in (twit1_friends & twit2_followers)\n graph[2] << [twit1_id, friend, twit2_id]\n end\n return graph unless graph[2].empty?\n \n # Check the 3rd degree: This is where we really burn through API calls.\n # We need to check friends of friends, or the followers of followers,\n # which ever is fewer to save API hits\n if twit1_friends.length < twit2_followers.length\n for friend in twit1_friends\n friends_of_friend = friends(friend)\n deg3 = friends_of_friend & twit2_followers\n # Add a connection for each friend of a friend who is a follower of twit2\n for fof in deg3\n graph[3] << [twit1_id, friend, fof, twit2_id]\n end\n end\n else\n for follower in twit2_followers\n followers_of_follower = followers(follower)\n deg3 = twit1_friends & followers_of_follower\n # Add a connection for each follower of a follower who is a friend of twit1\n for fof in deg3\n graph[3] << [twit1_id, fof, follower, twit2_id]\n end rescue pp \"Can't get followers for #{follower}: #{info(follower)}\"\n end\n end\n return graph\n end",
"def friendship_with(_user_id)\n UserFriendRelationship.between(id, _user_id)\n end",
"def following?(other_user)\n relationships.find_by(followed_id: other_user.id)\n end",
"def primary_records\n return following_relationships if is_following?\n\n follower_relationships\n end",
"def generate_person_and_task_relations(relations)\n relations.each_pair { |person_id, values|\n values.each { |task_id|\n @db_base.map_task_to_person(person_id, task_id)\n }\n }\n end",
"def get_followings(user1)\n $redis2.fetch(\"followings/#{user1.cache_key}\") do\n ids = Follow.where(user: user1).pluck(:following_id)\n User.where(id: ids)\n end\n end",
"def find_my_students \n User.joins(learnables: {skill: {teachables: :user}}).where(\"users_relationships.id = ? and users.id != ?\", id, id).distinct\n end",
"def get_user_relationships_info\n id = params[\"id\"]\n error_list = []\n status = 1\n json_response = {}\n user = User.find_by(id: id)\n\n if user.nil?\n error_list.append(\"Error: The specified user doesn't exist.\")\n status = -1\n else\n json_response[\"relationships\"] = user.get_relationship_json_data\n end\n\n if status == -1\n json_response[\"errors\"] = error_list\n end\n\n json_response[\"status\"] = status\n\n # Format the json_response into proper JSON and respond with it\n json_response = json_response.to_json\n\n respond_to do |format|\n format.json { render json: json_response }\n end\n end",
"def assignable_people\n assignable_people_ids.collect{|user_id| User.find(user_id)}\n end",
"def friendlist(user)\n User.find_by_sql(\n \"SELECT\n friend_interests_users.user_id as id,\n count(common_interests.id) as num_common_interests\n FROM\n users as me\n left join interests_users as my_interests_users on my_interests_users.user_id = me.id\n left join interests as common_interests on my_interests_users.interest_id = common_interests.id\n left join interests_users as friend_interests_users on common_interests.id = friend_interests_users.interest_id\n WHERE\n friend_interests_users.user_id <> #{user.id} and\n me.id = #{user.id}\n GROUP BY\n friend_interests_users.user_id\n ORDER BY\n num_common_interests desc;\"\n )\n end",
"def following?(other_user)\n following.include?(other_user)\n # relationships.find_by(followed_id: other_user.id) \n end",
"def make_friendship!(other_user)\n relationship.create!(friend_id: other_user.id)\n other_user.relationship.create!(friend_id: self.id)\n return true\n end",
"def friend_request(other_user)\n\tif other_user.present?\n\t\trelationship = get_relationship(other_user)\n\t\t\n\t\tif !relationship\n\t\t\trelationships.create(followed_id: other_user.id, friend_status: 'PENDING', follow1: false, follow2: false)\n\t\tend\n\tend\n end",
"def following?(other_user)\n relationships.find_by(followed_id: other_user.id)\n end",
"def following?(other_user)\n active_relationships.find_by(followed_id: other_user.id)\nend",
"def create\n relationship = Relationship.between(current_user.id, params[:user_two_id]).first\n unless relationship\n current_user.add_friend(User.find(params[:user_two_id]))\n relationship = Relationship.between(current_user.id, params[:user_two_id]).first\n relationship.status = 1\n relationship.save\n end\n friend = User.find_friend(current_user, relationship)\n redirect_to friendlist_path\n end",
"def following?(other_user)\n relationships.find_by(followed_id: other_user.id)\n end",
"def user_associations(users)\n x = []\n users.each do |u|\n puts \" collecting #{u.login}'s records\"\n\n ## PSEUDS will dump the actual user record and the user's preferences\n ## so they don't need to be dumped here.\n PSEUDS << u.pseuds\n\n # the roles are all dumped separately, so just dump the association here\n x << u.roles_users\n\n x << u.profile unless MULTI # profile's may have sensitive information that isn't visible\n\n TAGS << u.fandoms if u.tag_wrangler\n\n x << u.skins\n\n u.readings.find_in_batches(:batch_size => NTH) do |readings|\n x << readings.last\n WORKS << readings.last.work if MULTI\n end\n\n u.inbox_comments.find_in_batches(:batch_size => NTH) do |batch|\n inbox_comment = batch.last\n x << inbox_comment\n x << inbox_comment.feedback_comment\n commentable = inbox_comment.feedback_comment.ultimate_parent\n if MULTI\n if commentable.is_a?(Work)\n WORKS << commentable\n elsif commentable.is_a?(Tag)\n TAGS << commentable\n else\n x << commentable\n end\n end\n PSEUDS << inbox_comment.feedback_comment.pseud\n commentable = inbox_comment.feedback_comment.ultimate_parent\n WORKS << commentable if (MULTI && commentable.is_a?(Work))\n end\n\n # most of the associations are actually through the pseuds\n u.pseuds.each do |p|\n p.comments.find_in_batches(:batch_size => NTH) do |comments|\n comment = comments.last\n x << comment\n if MULTI\n commentable = comment.ultimate_parent\n if commentable.is_a?(Work)\n WORKS << commentable\n elsif commentable.is_a?(Tag)\n TAGS << commentable\n elsif commentable\n x << commentable\n end\n end\n end\n p.bookmarks.each do |bookmark|\n if !bookmark.private? || !MULTI\n x << bookmark\n x << bookmark.taggings\n TAGS << bookmark.tags\n if MULTI\n bookmarkable = bookmark.bookmarkable\n if bookmarkable.is_a?(Work)\n WORKS << bookmarkable\n elsif bookmarkable.is_a?(Series)\n x << bookmarkable\n bookmarkable.works.each {|w| WORKS << w}\n elsif bookmarkable.is_a?(ExternalWork)\n x << bookmarkable\n x << bookmarkable.taggings\n TAGS << bookmarkable.tags\n end\n end\n end\n end\n x << p.creatorships\n p.creatorships.map(&:creation).each do |item|\n if item.is_a?(Work)\n if item.posted? || !MULTI\n WORKS << item\n x << item.related_works\n item.related_works.each do |parent|\n if parent.is_a? Work\n WORKS << parent\n else\n x << parent\n end\n end\n x << item.parent_work_relationships\n item.children.each {|w| WORKS << w}\n end\n elsif item.is_a?(Chapter)\n # chapters get pulled in from works\n elsif item.is_a?(Series)\n x << item\n end\n end\n x << p.collections\n p.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 end\n end\n x.flatten.compact.uniq\nend",
"def make_decision ( user, new_input_list, rel_type)\n #first get the list of countries relate to each user by the type\n country_by_relation = \"\"\n if rel_type == 1 #lives_in\n #use the following\n country_by_relation = user.query_as(:s).match('s-[rel1:`lives_in`]->n2').pluck(:n2)\n elsif rel_type == 2 #has been to\n country_by_relation = user.query_as(:s).match('s-[rel1:`has_been_to`]->n2').pluck(:n2)\n elsif rel_type == 3 #wants to go to\n country_by_relation = user.query_as(:s).match('s-[rel1:`wants_to_go_to`]->n2').pluck(:n2)\n end\n\n #list of countries to create the relationship with\n list_to_create = Array.new\n #list of countries to delete the relationship with\n\n country_by_relation = country_by_relation.to_a\n new_input_list.each do |target_country| #runs through the list\n ret = is_in_country_nodes(target_country, country_by_relation)\n if ret.nil? #ret is not set, meaning the country in the current index of the search list does not exist, we add it\n ret = create_if_not_found(target_country) #create the country if does not exist else get the country\n list_to_create << ret\n end\n end \n\n if !country_by_relation.nil?\n delete_relationship(user, country_by_relation, rel_type)\n end\n\n if !list_to_create.nil?\n add_relationship(user, list_to_create, rel_type)\n end\n return user\n end",
"def followings_who_reposted(user)\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n repost_ids = \"SELECT user_id FROM reposts\n WHERE micropost_id = :micropost_id\"\n User.where(\"id IN (#{following_ids})\n AND id IN (#{repost_ids})\", user_id: user.id, micropost_id: id)\n end",
"def which_profile(other_user)\n #Currently runs two database queries to return the viewable profile of the other...can it be done faster/more efficiently?\n return self.next_closest_profile(self.which_ring(other_user))\n\n # if other_user == self\n # return this_profile(1)\n # elsif is_mutual_friend?(other_user) == true \n # friendship_ring = self.which_ring(other_user)\n # return this_profile(friendship_ring)\n # else\n # return self.profiles.find_by_ring(self.preference.rings)\n # end\n end",
"def get_relation(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/relations/#{args[:relation]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend",
"def common_friends_with(user)\n self.friends & user.friends\n end",
"def common_friends_with(user)\n self.friends & user.friends\n end",
"def siblings\n #user = User.find_by_id(:user_id)\n \t#user = absence.user\n user.absences.where('id != ?', id || -1)\n end",
"def facebook_neighbors_ids(depth = 2)\n result = facebook_friends_ids\n next_level = result\n while depth > 1\n next_level = FriendRelation.facebook.by_source_user(next_level).pluck(:target_user_id) +\n FriendRelation.facebook.by_target_user(next_level).pluck(:source_user_id)\n result += next_level\n depth -= 1\n end\n result - [self.external_user_id]\n end",
"def friend_data(other_user)\n \tUser.find_by(id: other_user.user_id)\n end",
"def friends\n # receivers = Friendship.where(:receiver_id => self.id).map(&:requester_id)\n # requesters = Friendship.where(:requester_id => self.id).map(&:receiver_id)\n # friends = receivers + requesters\n # User.where(:id => friends.uniq)\n friendship_ids = Friendship.where(\"receiver_id = :id or requester_id = :id\", id: id).pluck(:requester_id, :receiver_id).flatten.uniq\n # binding.pry\n User.except(id).where(:id => friendship_ids)\n # User.joins(:friendships).where(friendships: {:receiver_id => id})\n end",
"def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Song.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Activity.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"def find_common_users(item1, item2, list = @users)\n #list.collect { |u| u if u.has_item? item1.id and u.has_item? item2.id }.compact\n #list.collect { |u| u if u.list.items[item1.id] and u.list.items[item2.id] }.compact\n common = []\n list.each_value do |u|\n common << u if u.has_item? item1.id and u.has_item? item2.id\n end\n common\n end",
"def possible_friends\n ids = (friendships.map{ |fs| fs.friend_id } +\n inverse_friendships.map{ |fs| fs.user_id }).compact\n User.where.not(id: ids) - [self]\n end",
"def passengers\n relationships = self.relationships.where(\"relationships.user_id <> ? AND relationships\n.is_driving = false\", self.user_id)\n return nil if relationships.nil? # no passengers\n\n passengers = []\n\n relationships.each do |r|\n passengers.append(r.user)\n end\n passengers\n end",
"def followee?(other_user)\n followee_relationships.include?(other_user)\n end",
"def related_groups_users\n [].tap do |related_users|\n all_groups.each do |group|\n related_users << group.all_users.reject { |group_user| group_user == self }\n end\n end.flatten.uniq\n end",
"def similarity(user1, user2)\n user1Hash = @allUsersHash[user1]\n user2Hash = @allUsersHash[user2]\n return \"ERROR: USER ID #{user1} is not in the database\" if user1Hash.empty?\n return \"ERROR: USER ID #{user2} is not in the database\" if user2Hash.empty?\n find_similarity(user1Hash, user2Hash)\n end",
"def get_relation user, contact_id\n follows = user.follows_me?(contact_id)\n following = user.following?(contact_id)\n\n if follows and following\n return \"<->\"\n elsif follows and !following\n return \"<-\"\n elsif !follows and following\n return \"->\"\n end\n end",
"def friendship_finder(user_2)\n Friendship.where(user_id: [self.id, user_2.id], friend_id: [self.id, user_2.id]).first\n end",
"def index\n if session[:user] != nil\n if (User.where(name: session[:user]).first).role != 0 \n me = User.where(name: session[:user]).first\n @relations = Relation.where('user1_id = ? OR user2_id = ?', me, me)\n else\n @relations = Relation.all\n end\n end\n end",
"def feed\n # Post.where(\"user_id IN (?) OR user_id = ?\", following_ids, id)\n\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Post.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"def index\n unless params[:user_id].blank?\n @user_relationships = UserRelationship.where(follower_id: params[:user_id])\n else\n @user_relationships = UserRelationship.all\n end\n end",
"def make_friends_with(other_user)\n if (self != other_user) && !self.friends.include?(other_user)\n self.friendships.create!(friend: other_user)\n other_user.friendships.create!(friend: self)\n end\n end",
"def getUserFriendList(user, usersDatabase)\r\n puts \"#{user.fullName} have #{user.friendList.length} friend(s)\"\r\n user.friendList.each do |friendId|\r\n usersDatabase.each do |user|\r\n if user.id == friendId\r\n puts user.fullName\r\n end\r\n end\r\n end\r\n puts\r\nend",
"def check_relationships\n \n if params[:entity_id] and params[:id]\n render :json => report_errors(nil,\"Relation[#{params[:id]}] does not belong to Entity[#{params[:entity_id]}]\")[0],\n :status => 400 and return false if !related_to_each_other?(:entity => params[:entity_id], :relation => params[:id])\n end\n \n if params[:database_id] and params[:entity_id]\n render :json => report_errors(nil,\"Entity[#{params[:entity_id]}] does not belongs to Database[#{params[:database_id]}]\")[0],\n :status => 400 and return false if !related_to_each_other?(:database => params[:database_id], :entity => params[:entity_id])\n end\n \n begin\n belongs_to_user?(session['user'], \n :entity => params[:entity_id],\n :relation => params[:id])\n rescue MadbException => e\n render :json => report_errors(nil, e)[0], :status => 400 and return false\n end\n \n # In all other cases, its ok\n return true;\n \n end",
"def feed\n following_ids = \"SELECT followed_id FROM relationships\n WHERE follower_id = :user_id\"\n Status.where(\"user_id IN (#{following_ids})\n OR user_id = :user_id\", user_id: id)\n end",
"def relationship(*args)\n options = args.extract_options!\n if options[:raise_on_multiple]\n rels = relationships.take(2)\n raise _(\"Multiple relationships found\") if rels.length > 1\n rels.first\n else\n relationships.first\n end\n end",
"def friendable_users\n User.all.where.not('id IN (?)', [id] + friends.ids +\n friend_requests_sent.pending.pluck(:receiver_id) + friend_requests_received.pending.pluck(:sender_id))\n end",
"def unique_ties\n var = self.user1.ties.map do |tie| # mapping the current Tie being instantiated's user 1 and their existing ties' user ID\n [tie.user1_id, tie.user2_id] # ...into an array e.g. [[1,2][1,3][3,1][1,4]]\n end\n var.each do |tie| # iterate through that array\n if tie.sort == [self.user1_id, self.user2_id].sort # and checking if any existing ties match the instantiated tie | the .sort normalises the data e.g. [2,1] = [1,2]\n errors.add(:base, \"Tie already exist\") # if it exists, it will give an error\n end\n end\n end",
"def friends_suggestion(friends_of_friends = false)\n\t\t#sql query for the requested and accepted friendships ID's using the user id\n\t\tactive_ids = \"SELECT friend_pasive_id FROM relationships WHERE friend_active_id = :user_id AND accepted = true\"\n\t\t#sql query for the received and accepted friendships ID's using the user id\n\t\tpasive_ids = \"SELECT friend_active_id FROM relationships WHERE friend_pasive_id = :user_id AND accepted = true\"\n\t\t#not answered friendship request\n\t\tfriend_requests_ids = \"SELECT friend_active_id FROM relationships WHERE friend_pasive_id = :user_id AND accepted = false\"\n\t\t#sql query for the id's of the pasive friends from the user's id friends\n\t\tfriends_pasive_friends_ids =\"SELECT friend_pasive_id FROM relationships WHERE friend_active_id IN (#{active_ids}) OR friend_active_id IN (#{pasive_ids})\"\n\t\t#sql query for the id's of the active friends from the user's id friends\n\t\tfriends_active_friends_ids =\"SELECT friend_active_id FROM relationships WHERE friend_pasive_id IN (#{active_ids}) OR friend_pasive_id IN (#{pasive_ids})\"\t\t\n\t\t\n\t\tif friends_of_friends\n\t\t\tusers_query = \"NOT (id IN (#{active_ids}) OR id IN (#{pasive_ids})) AND (id IN (#{friends_pasive_friends_ids}) OR id IN (#{friends_active_friends_ids}) ) AND (id <> :user_id ) \"\n\t\t\t\n\t\telse\n\t\t\tusers_query = \"NOT (id IN (#{active_ids}) OR id IN (#{pasive_ids}) OR id IN (#{friend_requests_ids})) AND NOT (id IN (#{friends_pasive_friends_ids}) OR id IN (#{friends_active_friends_ids}) ) AND (id <> :user_id ) \"\n\t\t\n\t\tend\n\t\treturn User.where(\"#{users_query}\", user_id: self.id).distinct.includes( avatar_attachment: :blob)\n\tend",
"def test_foreign_in\n first_users = [\n User.objects.filter(zone: [@cangas_de_onis, @cantabria]).order_by(created_at: :ASC)[0],\n User.objects.filter(zone_id__in: [@cangas_de_onis, @cantabria]).order_by(created_at: :ASC)[0],\n User.objects.filter(zone__in: [@cangas_de_onis, @cantabria]).order_by(created_at: :ASC)[0],\n User.objects.filter(zone: [@cangas_de_onis.id, @cantabria.id]).order_by(created_at: :ASC)[0],\n User.objects.filter(zone__in: [@cangas_de_onis.id, @cantabria.id]).order_by(created_at: :ASC)[0],\n ]\n different_user_ids = Set.new(first_users.map(&:id))\n assert_equal 1, different_user_ids.length\n end",
"def following?(other_user)\n relationships.find_by_followed_id(other_user.id)\n end",
"def following?(other_user)\n relationships.find_by_followed_id(other_user.id)\n end",
"def following?(other_user)\n relationships.find_by_followed_id(other_user.id)\n end",
"def following?(other_user)\n relationships.find_by_followed_id(other_user.id)\n end",
"def following?(other_user)\n relationships.find_by_followed_id(other_user.id)\n end",
"def add_relationship ( user , country_list, rel_type )\n country_list.each do |country_node|\n rel_instance = get_rel_instance rel_type\n rel_instance.from_node = user\n rel_instance.to_node = country_node\n rel_instance.save\n end\n end",
"def involved_people_ids\n (\n [self.scrum_master_id.to_s, self.product_owner_id.to_s] + self.team_member_ids + self.stakeholder_ids\n ).select {|u_id| !u_id.blank?}\n end",
"def facebook_neighbors(depth = 2)\n User.where(:external_user_id => facebook_neighbors_ids(depth))\n end",
"def following?(other_user)\n active_relationships.find_by(followed_id: other_user.id)\n end",
"def request_friendship (user_2)\n #self will be current user (user_1)\n self.friendships.create(friend: user_2)\n end",
"def relations_in_holder\n if (@user = User.find_by_id(params[:id]))\n\n if (params[:role] == 'following')\n @relations = Relation.where(:user_id => @user.id)\n else\n @relations = Relation.where(:user_relation_id => @user.id)\n end\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.js { render }\n end\n\n else\n error404\n end\n end",
"def followers(user_ids)\n users = []\n user_ids.each do |user_id| \n user = Hashie::Mash.new\n user.user_id = user_id\n\n users << user\n end\n \n users \nend",
"def machi\n ints= Relationship.all.select(:following_id)\n p = Relationship.all.where(id:ints).select(:id)\n ps = Relationship.where(follower_id:p)\n end",
"def follow (other_user)\n active_relationships.create(followed_id: other_user.id)\nend",
"def request_users_ids_not_equal\n self.errors.add(:connection_requests, 'Юзеры IDs в одном ряду не должны быть равны в ConnectionRequest.') if self.user_id == self.with_user_id\n end",
"def test_addFriends\n user1 = User.new(\n :first_name=>'forest',\n :last_name=>'gump',\n :username=>'forest1',\n :password=>\"gump123\",\n :email=>\"[email protected]\",\n :start_year=>'2009',\n :start_sem=>'FA',\n :birthday=>'1990-10-29',\n :college => College.find(:first),\n :major => Major.find(:first)\n )\n user2 = User.new(\n :first_name=>'forest',\n :last_name=>'gump',\n :username=>'forest2',\n :password=>\"gump123\",\n :email=>\"[email protected]\",\n :start_year=>'2009',\n :start_sem=>'FA',\n :birthday=>'1990-10-29',\n :college => College.find(:first),\n :major => Major.find(:first)\n )\n assert_nothing_raised { user1.save! }\n assert_nothing_raised { user2.save! }\n @friends_all = User.find :all, :order => 'last_name ASC, first_name ASC' \n @friends_all.each do |eUser|\n if(eUser.id != user1.id) \n friend = User.find eUser.id\n user1.friends.concat friend\n end\n end\n \n #shouldn't be friends with self\n assert_equal(@friends_all.size - 1, user1.friends.length)\n end",
"def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end",
"def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end",
"def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end",
"def follow(other_user)\n active_relationships.create(followed_id: other_user.id)\n end"
] | [
"0.64751005",
"0.63839495",
"0.6315147",
"0.63050514",
"0.6249573",
"0.6199855",
"0.61677456",
"0.6138669",
"0.6086289",
"0.60167694",
"0.5800661",
"0.56960475",
"0.56880766",
"0.56662697",
"0.56655467",
"0.5611116",
"0.55957997",
"0.5548916",
"0.55425143",
"0.55153525",
"0.54883933",
"0.5431185",
"0.5419257",
"0.5414313",
"0.54129714",
"0.5407907",
"0.540048",
"0.5360086",
"0.53575534",
"0.5349315",
"0.5343104",
"0.53285617",
"0.5288769",
"0.5270883",
"0.52708715",
"0.52423143",
"0.52373415",
"0.5236457",
"0.52340597",
"0.5216447",
"0.5209898",
"0.5209547",
"0.52030236",
"0.5201756",
"0.5200683",
"0.5194962",
"0.5190549",
"0.5174042",
"0.5172582",
"0.51678705",
"0.5162644",
"0.51543146",
"0.515168",
"0.515168",
"0.5145029",
"0.5142363",
"0.51306695",
"0.5130464",
"0.5116696",
"0.51130205",
"0.51116014",
"0.5110321",
"0.5089757",
"0.5089035",
"0.5084347",
"0.50816935",
"0.50804895",
"0.50804555",
"0.507849",
"0.5076232",
"0.50726813",
"0.50718707",
"0.5070366",
"0.5065317",
"0.5061869",
"0.5055165",
"0.50539887",
"0.50415665",
"0.50312823",
"0.50312227",
"0.5027733",
"0.5027733",
"0.5027733",
"0.5027733",
"0.5027733",
"0.5024659",
"0.5023202",
"0.50179327",
"0.50178844",
"0.5017075",
"0.5014697",
"0.5013182",
"0.50114083",
"0.5006626",
"0.50056916",
"0.5003254",
"0.499039",
"0.499039",
"0.499039",
"0.499039"
] | 0.61790586 | 6 |
after_filter :add_visit, :only => [:index] | def index
@entries = @wall.entries.limit(15)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def after_filter; end",
"def index\n index_filter\n end",
"def before_filter; end",
"def filter\n setup_instance_variables\n render 'index'\n end",
"def filter_redirect; end",
"def filter_redirect; end",
"def index\n super\n end",
"def index\n handle_view\n end",
"def index\n @visitors = Visitor.all\n end",
"def index\n @tags = Tag.all\n @user = current_user\n\n\n if user_signed_in?\n visited = Visit.new(ip_address: request.remote_ip, :what => \"tags\", :user_id => current_user.id)\n visited.save\n else\n visited = Visit.new(ip_address: request.remote_ip, :what => \"tags\")\n visited.save\n end\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"def index\n \n end",
"def setup_index_view()\n # Perhaps I'm not doing something right...\n # I don't have a single line of duplicated code\n # in those in my get and post calls, so this is \n # difficult to refactor.\nend",
"def index\n @recent_changes = Page.find(:all, :include => :content, :conditions => [\"contents.published = ?\", true], :limit => 10, :order => \"pages.updated_at DESC\")\n @visits = Visit.find :all, :conditions => [\"contents.owner_type = ?\", 'Page'], :include => :content, :group => \"content_id\", :order => \"visits.created_at DESC\", :limit => 10\n @tags = Content.tag_counts\n \n if logged_in? && !current_user.default_page.nil?\n redirect_to page_url(current_user.default_page)\n else \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pages }\n end\n end\n end",
"def index\n @visits = Visit.all\n end",
"def index\n @visits = Visit.all\n end",
"def index\n @visits = Visit.all\n end",
"def route_index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def index; end",
"def filter_redirect=(_arg0); end",
"def filter_redirect=(_arg0); end",
"def on_pre_request( request ); end",
"def index\n\n \n end",
"def index \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index\n \n end",
"def index \n end",
"def index\n @visit_histories = VisitHistory.all\n end",
"def index\n @visits = @patient.visits\n if @visits.blank?\n redirect_to new_patient_visit_path(@patient) and return\n end\n end",
"def index \n end",
"def index\n render_index\n end",
"def index\n @blogs = Blog.all\n\n if user_signed_in?\n visited = Visit.new(ip_address: request.remote_ip, :what => \"blogs\", :user_id => current_user.id)\n visited.save\n else\n visited = Visit.new(ip_address: request.remote_ip, :what => \"blogs\")\n visited.save\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blogs }\n end\n end",
"def index\n redirect_to influencer_profile_path\n end",
"def index \n \n end",
"def index \n \n end",
"def on_pre_request( request )\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end",
"def index\n end"
] | [
"0.70698935",
"0.6924679",
"0.6830165",
"0.6807499",
"0.6568408",
"0.6568408",
"0.61760163",
"0.615979",
"0.6113233",
"0.6091317",
"0.6061638",
"0.60547686",
"0.60501486",
"0.5999248",
"0.5999248",
"0.5999248",
"0.59920114",
"0.5982916",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.5981882",
"0.59665847",
"0.59665847",
"0.5951512",
"0.5942679",
"0.59144497",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5911779",
"0.5908167",
"0.59064275",
"0.59055495",
"0.5903741",
"0.5892762",
"0.5890463",
"0.586643",
"0.5865518",
"0.5865518",
"0.5863793",
"0.586344",
"0.586344",
"0.586344",
"0.586344",
"0.586344",
"0.586344",
"0.586344",
"0.586344",
"0.586344",
"0.586344"
] | 0.0 | -1 |
Increments the value pointed to from the key If the key is nil then it is initialized to amount An optional block may be given, which is passed +key+, and each key in the hash. The block should return true for the key you wish to increment. Examples: h = Hash.new h['foo'] = nil h.increment('foo') 1 h.increment('foo') 2 age = Hash.new age['0 18'] = 0 age['18 24'] = 0 age['24 99999'] = 0 increment the key where 18 is in range of the min and max age.increment(18) do |v, e| min, max = e.split(' ') v >= min.to_i && v < max.to_i end assert_equal(0, age['0 18']) assert_equal(1, age['18 24']) assert_equal(0, age['24 99999']) | def increment(key, amount=1, &block)
if block.nil?
key_to_use = key
else
key_to_use = self.keys.detect { |k| block.call(key, k) }
end
if self[key_to_use].nil?
self[key_to_use] = amount
else
self[key_to_use] += amount
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def incrby(key, increment); end",
"def incrby(key, increment); end",
"def incrby(key, increment)\n node_for(key).incrby(key, increment)\n end",
"def incr(key); end",
"def incr(key); end",
"def increment(key, amount = 1, options = {})\n invoke(:increment, key) do |store|\n alter(store, key, amount, options)\n end\n end",
"def incrby(key, increment)\n send_command([:incrby, key, Integer(increment)])\n end",
"def increase key, amount=1\n @lock.write_sync do\n return unless @data[key].nil? || Numeric === @data[key]\n @data[key] ||= 0\n @data[key] += amount\n end\n end",
"def inc(key)\n \n end",
"def increment_map(map, key, age)\n if map.key?(key)\n map[key] = map[key]+1/2**(age/HALF_LIFE)\n else\n map[key] = 1/2**(age/HALF_LIFE)\n end\nend",
"def incr(key, increment=nil)\n timeout_retry(3, 3){\n if increment\n write \"INCRBY #{key} #{increment}\\r\\n\"\n else\n write \"INCR #{key}\\r\\n\"\n end \n integer_reply\n }\n end",
"def incrbyfloat(key, increment); end",
"def incrbyfloat(key, increment); end",
"def incr(key)\n node_for(key).incr(key)\n end",
"def incr(key, value = 1)\n mon_synchronize do\n perform [\"incr\", key, value], :proc => T_INT\n end\n end",
"def hincrby(key, field, increment); end",
"def hincrby(key, field, increment); end",
"def incr(key, value = 1)\n mon_synchronize do\n perform [\"incr\", key, value], proc: T_INT\n end\n end",
"def increment(key)\n @counter[key] += 1\n end",
"def increment(number)\n if block_given?\n yield\n else\n number + 1\n end\nend",
"def increment(by=1, &block)\n allow_expiration do\n val = redis.incrby(key, by).to_i\n block_given? ? rewindable_block(:decrement, by, val, &block) : val\n end\n end",
"def _inc(key,value)\n _set(key, (_get(key) || 0) + value)\n end",
"def increment(number)\n if block_given?\n yield(number + 1)\n else\n number + 1\n end\nend",
"def increment(number)\n if block_given?\n yield(number + 1)\n else\n number + 1\n end\nend",
"def increment(number)\n if block_given?\n yield(number + 1)\n end\n number + 1\nend",
"def increment(number)\n if block_given?\n yield(number + 1)\n end\n number + 1\nend",
"def increment(number)\n if block_given?\n yield(number + 1)\n end\n number + 1\nend",
"def incr(key, amt = 1, ttl = nil, default = nil)\n check_positive!(amt)\n\n perform(:incr, key, amt.to_i, ttl_or_default(ttl), default)\n end",
"def zincrby(key, increment, member); end",
"def zincrby(key, increment, member); end",
"def increment(key, offset=1)\n ret, value = Lib.memcached_increment(@struct, key, offset)\n check_return_code(ret, key)\n value\n rescue => e\n tries ||= 0\n raise unless tries < options[:exception_retry_limit] && should_retry(e)\n tries += 1\n retry\n end",
"def incrbyfloat(key, increment)\n node_for(key).incrbyfloat(key, increment)\n end",
"def hincrby(key, field, increment)\n node_for(key).hincrby(key, field, increment)\n end",
"def increment(k, amount = 1, ignored_options = nil)\n handle_fork\n new_v = _get(k).to_i + amount\n _set k, new_v, 0\n new_v\n end",
"def incr(key)\n send_command([:incr, key])\n end",
"def increment_counter(key)\n if @counters.key?(key)\n @counters[key] += 1\n else\n @counters[key] = 1\n end\n end",
"def increment\n Dictionary.db.zincrby @key, 1, @value\n end",
"def increment(key, inc_value = 1, expires_in = nil, initial = nil)\n puts \"Rails.cache.increment(#{key}, #{inc_value}, {expires_in: #{get_ttl(expires_in)}, initial: #{initial}, raw: false})\"\n return Rails.cache.increment(key, inc_value, {expires_in: get_ttl(expires_in), initial: initial, raw: false})\n rescue => exc\n Rails.logger.error { \"MEMCACHE-ERROR: increment: K: #{key}. M: #{exc.message}, I: #{exc.inspect}\" }\n return nil\n end",
"def zincrby(key, increment, member)\n node_for(key).zincrby(key, increment, member)\n end",
"def increment(name, amount = 1, options = {})\n instrument :increment, name, amount: amount do\n failsafe :increment do\n options = merged_options(options)\n key = normalize_key(name, options)\n\n with do |c|\n c.incrby(key, amount).tap do\n write_key_expiry(c, key, options)\n end\n end\n end\n end\n end",
"def increment_by amount, *args\n accumulators.incrby(scope(*args), amount)\n end",
"def hincrby(key, field, increment)\n send_command([:hincrby, key, field, Integer(increment)])\n end",
"def increment(name, amount = 1, options = nil)\n options ||= {}\n name = expanded_key name\n\n if ttl = options.delete(:expires_in)\n options[:ttl] ||= ttl\n end\n options[:create] = true\n instrument(:increment, name, options) do |payload|\n payload[:amount] = amount if payload\n @data.incr(name, amount, options)\n end\n rescue ::Couchbase::Error::Base => e\n logger.error(\"#{e.class}: #{e.message}\") if logger\n raise if @raise_errors\n false\n end",
"def increment(name, amount = 1, options = nil)\n options = merged_options(options)\n instrument(:increment, name, amount: amount) do\n rescue_error_with nil do\n @data.with { |c| c.incr(normalize_key(name, options), amount, options[:expires_in], amount) }\n end\n end\n end",
"def hincrbyfloat(key, field, increment); end",
"def hincrbyfloat(key, field, increment); end",
"def increment(name, amount = 1, expires_in: nil, initial: nil, **options)\n instrument :increment, name, amount: amount do\n failsafe :increment do\n key = normalize_key(name, options)\n res = collection.binary.increment(\n key, ::Couchbase::Options::Increment(delta: amount, expiry: expires_in, initial: initial)\n )\n @last_mutation_token = res.mutation_token\n res.content\n end\n end\n end",
"def increment(start, inc)\n\t\t\t\tProc.new{start +=inc}\nend",
"def incr(x) x + 1 end",
"def increment(key, val)\n self[key] += _floatify(val)\n end",
"def op_increment!(field, amount = 1)\n unless amount.is_a?(Numeric)\n raise ArgumentError, \"Amount should be numeric\"\n end\n operate_field! field, { __op: :Increment, amount: amount.to_i }.freeze\n end",
"def my_hash_modification_method!(hash, age_diff)\n hash.each { |name, age| hash[name] = (age + age_diff) }\nend",
"def increment key\n @statsd_client.increment [@options[:env], @options[:prefix], key].join(\".\")\n end",
"def increment(name, amount = 1, options = nil)\n key = expand_key(name)\n\n begin\n amount.times do |v|\n @gibson.inc key\n end\n rescue\n\n end\n end",
"def zincrby(key, increment, member)\n call(key, [:zincrby, key, increment, member], transform: Redis::Floatify)\n end",
"def incrbyfloat(key, increment)\n send_command([:incrbyfloat, key, Float(increment)], &Floatify)\n end",
"def increment(name, amount = 1, options=nil)\n options ||= {}\n name = namespaced_key(name, options)\n initial = options.has_key?(:initial) ? options[:initial] : amount\n expires_in = options[:expires_in]\n instrument_with_log(:increment, name, :amount => amount) do\n with { |c| c.incr(name, amount, expires_in, initial) }\n end\n rescue Dalli::DalliError => e\n log_dalli_error(e)\n instrument_error(e) if instrument_errors?\n raise if raise_errors?\n nil\n end",
"def increment *args\n accumulators.incr(scope(*args))\n end",
"def increment!\n @value += @increment\n \n self\n end",
"def update_counting_hash(hash, key)\n hash[key] ? hash[key] += 1 : hash[key] = 1\n hash\nend",
"def add_then_retrieve_by(key=nil,increment=nil)\n if key.class == String && increment.class == Fixnum && block_given?\n return @j_del.java_method(:addThenRetrieveBy, [Java::java.lang.String.java_class,Java::JavaLang::Long.java_class,Java::IoVertxCore::Handler.java_class]).call(key,increment,(Proc.new { |ar| yield(ar.failed ? ar.cause : nil, ar.succeeded ? ar.result : nil) }))\n end\n raise ArgumentError, \"Invalid arguments when calling add_then_retrieve_by(key,increment)\"\n end",
"def increment(node)\n change_by node, 1\n end",
"def increment(name, amount = T.unsafe(nil), options = T.unsafe(nil)); end",
"def increase_by(i)\n start = 0\n lambda { start += i } \n end",
"def increment_by(node, weight)\n raise ArgumentError.new('please use #decrement_by') if weight < 0\n change_by node, weight\n end",
"def increment(name, amount = 1, options = nil) # :nodoc:\n options = merged_options(options)\n response = instrument(:increment, name, :amount => amount) do\n @data.incrby(namespaced_key(name, options), amount)\n end\n rescue => e\n logger.error(\"Error incrementing cache entry in redis: #{e}\") if logger\n nil\n end",
"def my_hash_modification_method!(my_family_pets_ages, n)\n my_family_pets_ages.each {|key, value| my_family_pets_ages[key] = value + n}\nend",
"def step(start_val, end_val, increment)\n current_val = start_val\n until current_val > end_val\n yield(current_val)\n current_val += increment\n end\nend",
"def increment(item, amount = 1)\n @items[item] ||= {:value => 0}\n @normalized = false\n @items[item][:value] += amount\n end",
"def count_with_increment(start, inc)\n lambda do\n tmp = start\n start += inc\n tmp\n end\nend",
"def increment!(name,amount=1)\n raise ArgumentError, \"Only integer fields can be incremented.\" unless self.class.fields.include?({:name => name.to_s, :type => :integer})\n redis.incr(field_key(name), amount)\n end",
"def increment(field, amount = 1)\n #value = (self[field] || 0) + amount\n #self[field] = value\n #if !@parse_object_id\n # # TODO - warn that the object must be stored first\n # return nil\n #end\n\n body = {field => Parse::Increment.new(amount)}.to_json\n data = Parse.client.request(self.uri, :put, body)\n parse data\n self\n end",
"def increment(attribute, by = 1)\n self[attribute] ||= 0\n self[attribute] += by\n self\n end",
"def update_counting_hash(hash, key)\n if hash[key] \n hash[key] += 1\n else\n hash[key] = 1\n end\n hash\nend",
"def increment(name, amount = 1, options = nil)\n raise NotImplementedError.new(\"#{self.class.name} does not support increment\")\n end",
"def increment(name, amount = 1, options = nil)\n raise NotImplementedError.new(\"#{self.class.name} does not support increment\")\n end",
"def set_key(key, &block)\n @callbacks[key.ord] = block\n end",
"def incr(key, window=@max_window)\n key = key.to_s\n now = Time.now.to_f\n @redis.multi do\n @redis.zadd(key, now, SecureRandom.uuid)\n @redis.expire(key, @max_window.ceil)\n do_get(key, now, window)\n end.last\n end",
"def incr\n add(1)\n end",
"def inc_value(iIncrement = 1)\n super\n end",
"def increment(amount = 1)\n self[:start_time] ||= Time.now\n self[:current] = (self[:current] + amount < self[:max] ? self[:current] + amount : self[:max])\n self.save\n self[:previous_time] ||= Time.now\n end",
"def change_player_money(hash,amount)\n return hash[:money] += amount\nend",
"def increment(metric, value = 1)\n @adapter.increment metric, value\n end",
"def increment(att, count = 1)\n key[:counters].call(\"HINCRBY\", att, count)\n end",
"def increment(name, amount = 1, options = nil)\n options = merged_options(options)\n\n instrument(:increment, name, :amount => amount) do\n @client.incr(name, amount)\n end\n rescue Spymemcached::Error => e\n logger.error(\"Spymemcached::Error (#{e}): #{e.message}\") if logger\n nil\n end",
"def foobar(numbers, &block)\n if block_given?\n numbers.each do |key, value|\n block.call(key, value)\n end\n end\nend",
"def hincrbyfloat(key, field, increment)\n node_for(key).hincrbyfloat(key, field, increment)\n end",
"def increment(who, amount = 1)\n stat(key(who)).record_data_point(amount)\n end",
"def increment(prob_hash, key)\n di = key[0,2]\n freq_arr = prob_hash[di]\n if !freq_arr\n prob_hash[di] = [[key[-1,1], 1]]\n else\n target_letter = key[-1,1]\n freq = freq_arr.assoc(target_letter)\n if !freq then freq_arr << [target_letter, 1] else freq[1] += 1 end\n end\nend",
"def hash_data_add(hash, key)\n if hash.has_key?(key)\n hash[key] = hash[key] + 1\n else \n hash[key] = 1\n end\n end",
"def call_inc(reg_key, addr, i_reg, m_spec)\n reg = @registers[reg_key]\n val = get_mem_addr(addr, i_reg) + reg.word.to_i\n reg.word.from_int(val)\n end",
"def increment_duration(&block)\n start = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n yield\n ensure\n finish = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n increment(finish - start)\n end",
"def step(start, stop, increment)\n current_value = start\n loop do\n yield(current_value)\n current_value += increment\n break if current_value > stop\n end\nend",
"def zincr(key, member, score = 1)\n mon_synchronize do\n perform [\"zincr\", key, member, score], :proc => T_INT\n end\n end",
"def find_increment(keys)\n initial = keys * 7 / 9\n while gcd(keys, initial) != 1\n initial -= 1\n end\n return initial\nend",
"def set(key, value=nil, &block)\n assert_value_or_block_not_both(value, block)\n\n # Skip validation behavior if no validators are registered for this key\n return super unless validators.key?(key)\n\n value_to_evaluate = block || value\n\n if callable_without_parameters?(value_to_evaluate)\n super(key, assert_valid_later(key, value_to_evaluate), &nil)\n else\n assert_valid_now(key, value_to_evaluate)\n super\n end\n end",
"def inc(value=1) \n if valid?\n #raise CustomError::InvalidBar unless valid?\n _set(:start_at, Time.now.to_f) unless _get(:start_at)\n _set(:current_at, Time.now.to_f)\n inc_value = _inc(:current,value)\n mylog(\"inc inc_value: #{inc_value}\")\n inc_value\n end \n end",
"def update_group(increment)\n end",
"def adder(amount=1)\n yield + amount\nend",
"def increment_refund_value(value, increment)\n\t\tif value or increment\n\t\t\tvalue ||= 0\n\t\t\tincrement ||= 0\n\t\t\tvalue - increment\n\t\telse\n\t\t\tnil\n\t\tend\n\tend"
] | [
"0.6980712",
"0.6980712",
"0.68371296",
"0.6579625",
"0.6579625",
"0.6417474",
"0.6349763",
"0.6324647",
"0.6259782",
"0.6241858",
"0.61707723",
"0.61236584",
"0.61236584",
"0.6100169",
"0.6060157",
"0.60436255",
"0.60436255",
"0.60268813",
"0.60019165",
"0.60011065",
"0.597339",
"0.59084916",
"0.5903912",
"0.5903912",
"0.5853441",
"0.5853441",
"0.5853441",
"0.5830668",
"0.5821988",
"0.5821988",
"0.5778789",
"0.5777036",
"0.5774585",
"0.5772448",
"0.57092345",
"0.56032556",
"0.56001496",
"0.5586525",
"0.5578895",
"0.55057925",
"0.5495218",
"0.545318",
"0.5448441",
"0.540976",
"0.5382235",
"0.5382235",
"0.5372897",
"0.53533787",
"0.53498816",
"0.53381956",
"0.5330939",
"0.5317476",
"0.52668",
"0.5261406",
"0.52607304",
"0.52250904",
"0.52087986",
"0.5142144",
"0.51047254",
"0.50851107",
"0.5066143",
"0.50519425",
"0.5050788",
"0.5036044",
"0.50230604",
"0.49999717",
"0.49923056",
"0.49919042",
"0.49840468",
"0.4979622",
"0.497819",
"0.49517977",
"0.49280894",
"0.49242088",
"0.4909154",
"0.4909154",
"0.49082848",
"0.48994514",
"0.48834896",
"0.48754525",
"0.4863469",
"0.48466817",
"0.48337469",
"0.48322862",
"0.4818811",
"0.48173833",
"0.4815955",
"0.48144564",
"0.48121423",
"0.47955298",
"0.47707647",
"0.47672227",
"0.47497523",
"0.4748175",
"0.4740572",
"0.47403988",
"0.47360647",
"0.4731475",
"0.4729955",
"0.47294337"
] | 0.74691796 | 0 |
string_length_counter = sentence1.length 1 reversed_string = [] sentence1.collect do |letters| reversed_string << string_length_counter string_length_counter = 1 end reversed_string = [] string_length_counter = sentence1.length 1 split_string = sentence1.split("") end | def reverse_each_word(sentence1)
reverse_array=[]
split_sentence_array=sentence1.split(" ")
reversed=split_sentence_array.collect {|word| word.reverse}
reversed.join(" ")
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def reverse_each_word(sentence1)\r\nnew_array = []\r\nsentence1.split.collect do |words| new_array << \"#{words}\".reverse\r\n end\r\nnew_array.join(\" \")\r\nend",
"def reverse_a_string(string)\n puts \"Give me a sentence\"\n sentence = gets.chomp\n sentence_split = sentence.split \n p sentence_split\n reverse_array = [] \n x = sentence_split.count\n p x \n counter = x-1 \n x.times do \n reverse_array << sentence_split[counter]\n counter -= 1 \n end\n puts reverse_array \nend",
"def reverse_sentence(string)\n results = []\n\n split_string = string.split(' ')\n\n split_string.size.times do \n results << split_string.pop\n end\n\n results.join(\" \")\nend",
"def reverse_each_word(string)\nstring = string.split(\" \")\nsentence1 = string.each {|a| a.reverse}\nsentence1.join(\" \")\nsentence2 = string.collect {|a| a.reverse}\nsentence2.join(\" \")\nend",
"def reverse_sentence(string)\n reverse = []\n words = string.split(\" \")\n words.length.times do\n reverse << words.pop\n end\n reverse.join(\" \")\nend",
"def reverse_each_word(sentence1)\n sentence1.split.collect {|word| word.reverse}.join(\" \")\n# new_array = []\n# reversed_words = []\n# new_array << sentence1.split.collect(&:reverse!).join(\" \")\n #reversed_words << new_array.collect(&:reverse!)\n #new_array.collect {|word| reversed_words << word.reverse}\n# sentence1.split('').reverse.join('').reverse\n #binding.pry\n #new_array\nend",
"def reverse_each_word(sentence1)\n ## sentence1.split turns the string into an array, where each word is an element of the array. No spaces.\n sentence_array = sentence1.split\n sentence_array.collect { |word|\n \n ## .reverse! reverses each word \"in place\", not creating new\n word.reverse!\n }\n ## .join(\" \") takes the elements of the array, joins them as a string with a space between each \n sentence_array.join(\" \")\nend",
"def reverse_each_word(variable_sentance)\n #i=0\n #sentance_array= []\n # puts \"variable_sentance\"\n # puts variable_sentance\n #variable_sentance.split(' ').collect{|word| word.reverse}\n # puts \"variable_sentance SHOULD RETURN AN ARRAY\"\n # puts variable_sentance\n # while i < sentence1.length do\n # sentence1.reverse_each{|word| }\n # end\n\n word_array = variable_sentance.split(\" \")\n new_array = []\n new_array = word_array.collect { |word| word.reverse}\n new_array.join(\" \")\nend",
"def reverse_each_word(sentence)\n array =[ ]\n new_sentence = \" \"\n(sentence.split).collect do |word|\n word.reverse\n array << (word.reverse)\nend\narray.join(\" \")\nend",
"def reverse_sentence(sentence)\n s_array = sentence.split\n r_array = []\n s_array.length.times do\n r_array << s_array.pop\n end\n r_array.join(' ')\nend",
"def reverse_each_word(sentence)\n sentence_array = []\n split_sentence = sentence.split\n \n split_sentence.collect do |element|\n reverse = element.reverse\n sentence_array << reverse\n \n end\nreverse_sentence = sentence_array.join(\" \")\nreverse_sentence\nend",
"def reverse_each_word(sentence1)\n sentence1.split.collect{ |e| e }\n sentence1.reverse!\n sentence1.split.reverse.join(' ')\nend",
"def reverse_words(string)\n words = string.split(' ')\n #we split so that our string can be worked with as an array\n reverse_string = []\n #we create an empty array\n\n words.length.times do |i|\n \t#our variable words splits and we get the length of that, then the .times tells us to iterate that many times, do |i| creates a new variable for the iteration\n \t#so essentially, words.length = 4, which then goes 4.times do |i|\n reverse_string[i] = words[i].reverse\n #reverse_string is the empty array in which we now include variable i, and make it equal words[i] reverse\n end\n return reverse_string.join(\" \")\n #we then tell the reverse_string variable to join the words together again using a space, and this is the last thing in the method\nend",
"def reverse_each_word(sentence1)\n array=sentence1.split(\" \")\n new_array=array.collect do |word|\n word.reverse\n end\n new_array.join(\" \")\nend",
"def reverse_each_word(string_of_words)\n storage_array1 = string_of_words.split(\" \")\n final_message = \"\"\n storage_array1.collect do |word|\n final_message += \"#{word.reverse!} \"\n end\n final_message.strip\nend",
"def reverse_each_word(sentence2)\n new2 = []\n save2 = sentence2.split\n save2.collect do |more_words|\n new2 << more_words.reverse\n end\n new2.join(\" \")\nend",
"def reverse_sentence(sentence)\n sentence_array = sentence.split(\" \")\n reverse_array = []\n iterator = sentence_array.length\n while iterator > 0\n reverse_array << sentence_array[(iterator - 1)]\n iterator -= 1\n end\n reverse_array.join(' ')\nend",
"def reverse(str)\n length_of_string = str.length\n x = length_of_string - 1\n y = 0\n\n array_given = str.split('')\n array_reverse = []\n\n while (x >= 0) do\n array_reverse[y] = array_given[x]\n x -= 1\n y += 1\n end\n\n reverse_string = array_reverse.join\n return reverse_string\n\nend",
"def solution(sentence)\n sentence_arr = []\n sentence_arr = sentence.split(\" \")\n #puts \"#{sentence_arr}\"\n sentence_str = \"\"\n sentence_arr.reverse_each { |word| sentence_str += \"#{word} \" }\n #puts \"#{sentence_str}\"\n return sentence_str\nend",
"def reverse_each_word(sentence)\r\n array1 = sentence.split(\" \")\r\n array1.collect do |x|\r\n x.reverse!\r\n end\r\n array1.join(\" \")\r\nend",
"def string_reverser(str)\n new_arr = []\n reversed_array = str.split(\"\")\n\n reversed_array.length.times do |letter|\n new_arr << reversed_array.pop # maybe it's not a good idea to mutate the string in the middle of iteration\n end\n return new_arr\nend",
"def reverso_bot(string)\r\n\tstring = string.split.(\"\")\r\n\treversed = []\r\n\treversed << string.size.times\r\n\treversed.join\r\nend",
"def reverse_sentence(my_sentence)\n i = 0\n each_word_array = []\n word = \"\"\n reverse_sentence = \"\"\n until i > my_sentence.length\n if my_sentence[i] != \" \" && my_sentence[i] != nil\n word += my_sentence[i]\n i += 1\n elsif my_sentence[i] == nil\n each_word_array << word\n\n (each_word_array.length - 1).times do |j|\n reverse_sentence += \"#{each_word_array[each_word_array.length - (j + 1)]}\"\n i += 1\n end\n\n return reverse_sentence += \"#{each_word_array[0]}\"\n else\n each_word_array << word\n each_word_array << my_sentence[i]\n word = \"\"\n i += 1\n end\n end\nend",
"def reverse_each_word(string)\n sentence_array = string.split(\" \")\n reversed_array = []\n sentence_array.collect do |string|\n reversed_array << string.reverse\n end\n reversed_array.join(\" \")\nend",
"def reverse_each_word(sentence2)\n sentence2.split(' ').collect do |word|\n word.reverse\nend.join(\" \")\nend",
"def reverse_words(sent)\n letters = sent.split(\"\")\n sent_array = []\n \n sent_array += letters\n \n reverse_sent_array = sent_array.reverse!\n \n new_sent = reverse_sent_array.join \n new_words = new_sent.split(\" \")\n \n final_sent = new_words.reverse!\n \n print final_sent.join(\" \")\nend",
"def reverse_long_words(sentence)\n temp_array = []\n sentence.split.each do |word|\n word.length > 4 ? temp_array.push(word.reverse) : temp_array.push(word)\n end\n temp_array.join(\" \")\nend",
"def reverse_each_word(str2)\n new_str = []\n str2.split.collect do |word|\n new_str << word.reverse!\n end\n return new_str.join(\" \") \nend",
"def reverse_words(sentence)\n reversed_array = sentence.split.map do |x| \n if x.length > 4\n x.reverse\n else\n x\n end\n end\n reversed_array.join ' '\nend",
"def reverse_words(string)\n string_array = string.split(\" \")\n string_array.each do |word|\n word.reverse!\n end\n p string_array\n reversed_sentance = \"\"\n string_array.each do |reverse_word|\n reversed_sentance += reverse_word + \" \"\n end\n p reversed_sentance.chop\nend",
"def reverse_each_word(sentence)\n array=sentence.split(\" \")\n new_arr=[]\n array.collect do |word|\n new_arr<< word.reverse\n end\n new_arr.join(\" \")\n end",
"def reverse_words(string)\n word_array = string.split\n reversed_sentence = [ ]\n \n word_array.each do |word|\n reversed_sentence.push(word.reverse)\n end\n\n p reversed_sentence.join(\" \")\nend",
"def reverse_sentence(my_sentence)\n if my_sentence == nil || my_sentence.empty?\n return my_sentence\n end\n\n i = 0\n j = 0\n temp = []\n\n until i == my_sentence.length\n until my_sentence[j] == \" \" && my_sentence[j + 1] != \" \" || my_sentence[j] != \" \" && my_sentence[j + 1] == \" \" || j == my_sentence.length - 1\n j += 1\n end\n\n temp << my_sentence[i..j]\n\n j += 1\n i = j\n end\n\n total_index = my_sentence.length\n\n temp.each do |capture|\n total_index = total_index - capture.length\n my_sentence[total_index..(total_index + capture.length - 1)] = capture\n end\nend",
"def reverse_sentence(sentence)\n array = sentence.split(' ')\n reverse_array = []\n idx = array.size\n\n loop do\n idx -= 1\n break if idx < 0\n reverse_array << array[idx]\n end\n\n reverse_array.join(' ')\nend",
"def reverse_each_word(sentence)\n array_of_split_string = []\n reversed_words = []\n array_of_split_string = sentence.split\n array_of_split_string.collect {|words| reversed_words << words.reverse!}\n reversed_words.join(\" \")\nend",
"def reverse_a_string(string)\n split_string = string.split(\"\")\n reverse_string = []\n string.length.times { reverse_string << split_string.pop}\n reverse_string.join\nend",
"def reverse_sentence(string)\n reverse_words = []\n word_array = string.split(' ')\n counter = 0\n loop do\n break if counter == word_array.length\n reverse_words.unshift(word_array[counter])\n counter += 1\n end\n p reverse_words.join(' ')\nend",
"def reverse_each_word(sentence)\n# piecesOfSentence=sentence.split(\" \")\n# reversedSentence =[]\n# piecesOfSentence.each { |word| \n# reversedSentence << word.reverse }\n# output = reversedSentence.join(\" \")\n# return output\n\npiecesOfSentence=sentence.split(\" \")\nreversedSentence = []\npiecesOfSentence.collect { |word|\nreversedSentence << word.reverse }\noutput = reversedSentence.join(\" \")\nreturn output\n\nend",
"def reverse_each_word(sentance)\n reversed_sentance = []\n sentance = sentance.split(\" \")\n sentance.collect do |word|\n reversed_sentance << word.reverse\n end\n reversed_sentance.join(\" \")\nend",
"def reverse_each_word(string)\n sentence_array = string.split(\" \")\n reversed_sentence = []\n sentence_array.collect do |word|\n reversed_sentence << word.reverse\n end\n reversed_sentence.join(\" \")\nend",
"def reverse_sentence(string)\n result = []\n\n array = string.split(' ')\n \n i = 0\n loop do\n break if i == array.size\n result << array.pop\n end\n\n answer = result.join(' ')\n answer\nend",
"def reverse_each_word (sentence)\r\n arr = sentence.split\r\n new_sentence = []\r\n arr.collect do |word|\r\n new_sentence << word.reverse\r\n end\r\n new_sentence.join(\" \")\r\nend",
"def reverse_each_word(sentence2)\n sentence2.split.collect {|word| word.reverse}.join(\" \")\nend",
"def reverse_sentence(sentence)\n words = sentence.split(' ')\n reversed_words = []\n\n (words.size).downto(1) do |i|\n reversed_words << words[i-1]\n end\n\n reversed_words.join(' ')\nend",
"def reverse_words(str)\n result_array = []\n str.split.each do |word|\n if word.size >= 5\n result_array << word.reverse\n else\n result_array << word\n end\n end\n if result_array.size > 1\n answer = result_array.join(' ')\n else\n answer = result_array.join('')\n end\n answer\nend",
"def reverse_each_word(sentence)\n word_array = []\n rev_array = []\n word_array = sentence.split\n word_array.collect {|word| rev_array << word.reverse}\n return rev_array.join(\" \")\nend",
"def reverse_each_word_collect(sentence)\n array = sentence.split(\" \")\n return_array = []\n array.collect do|sentence|\n return_array << sentence.reverse\n end\n return_array.join(\" \")\nend",
"def reverse(string)\n #declare new array\n reversed = []\n #split string into separate characters in an array\n stringArray = string.split\n #loop through array from end to beginning\n i = string.length-1\n while (i >= 0)\n reversed.push(stringArray[i])\n i = i-1\n #push all characters into a new array\n end\n #join all characters in an array\n reversed = reversed.join\n #return the new array\n return reversed\nend",
"def reverse_words(str)\n new_sentence = str.split.map do |word|\n if word.length > 4\n word.reverse\n else\n word\n end\n end\n new_sentence.join(\" \")\nend",
"def reverse_each_word(sentence)\n sentence.split.collect {|word| word.reverse}.join(' ')\n # new_sentence = []\n # new_sentence = sentence.split(' ')\n # new_sentence.collect {|word| word.reverse}\n # new_sentence.join(' ')\n end",
"def reverse_each_word(sentence)\n\n sentence_array = sentence.split\n \n joined_sentence = sentence_array.collect do |something|\n something.reverse\n\n end\n joined_sentence.join(\" \")\nend",
"def reverse_words(string)\n result = []\n\n string.split.each do |word|\n word.reverse! if word.size >= 5\n result.push(word)\n end\n\n result.join(' ')\n\nend",
"def challenge3\t\n\tputs \"Enter a string:\"\n\t# arr = gets.chomp.split(\"\")\n\t# len = arr.length-1\n\t# new_arr = []\n\n\t# for i in 0..len\n\t# \tnew_arr.push(arr[len-i])\n\t# end\n\t# puts \"#{new_arr.join}\"\n\n\tword = gets.chomp.split(\"\")\n\treverse_word = []\n\n\tword.each do |letters|\n\t\treverse_word.unshift(letters)\n\tend\n\n\tputs \"Your reversed word is: #{reverse_word.join.to_s}\"\n\n\nend",
"def reverse_a_string(string)\n split_string = string.split(\"\")\n i = 4\n reverse = (\"\")\n\n split_string.length.times do \n reverse << string[i]\n i = i - 1\n end\n\n return reverse \nend",
"def reverse_sentence(sentence)\n words = sentence.split(' ')\n reversed_words = []\n\n i = 0\n while i < words.length\n reversed_words = [words[i]] + reversed_words\n i += 1\n end\n\n reversed_words.join(' ')\nend",
"def reverse_sentence(sentence)\n words = sentence.split(' ')\n reversed_words = []\n\n i = 0\n while i < words.length\n reversed_words = [words[i]] + reversed_words\n i += 1\n end\n\n reversed_words.join(' ')\nend",
"def reverse_words1(string)\n words = []\n\n string.split.each do |word|\n word.reverse! if word.size >= 5\n words << word\n end\n\n words.join(' ')\nend",
"def reverse_words(sentence)\n # sentence_array = sentence.split\n sentence.split.map(&:reverse)\n .join(' ')\n\nend",
"def reverse_each_word(sentence)\narrayed = sentence.split (\" \")\nreversed = arrayed.collect {|i| i.reverse}\nreversed.join (\" \")\nend",
"def reverse_words(sentence)\n words = sentence.split\n word_array = []\n words.each do |word|\n if word.length < 5\n word_array << word\n else\n word_array << word.reverse\n end\n end\n word_array.join(' ')\nend",
"def reverse_each_word(string)\n array = string.split(\" \") #can't enumerate on string, so must turn into an array.\n test_array = [] #creating a new array.\n array.collect do |string| #iterate over the string.\n test_array << string.reverse #adding the reverse string into the new empty array.\n end\n test_array.join(\" \") #making the array a string again. \nend",
"def reverse_sentence(str)\n word_array = str.split(\" \")\n word_array.each do |item| \n item.reverse! if item.size >= 5\n end\n word_array.join(\" \")\nend",
"def reverse_sentence2(sentence)\n words = sentence.split\n reversed = []\n words.each { |word| reversed.unshift(word) }\n reversed.join(' ')\nend",
"def reverse_each_word(sentence)\n array = sentence.split\n new_arr = []\n array.collect do |word| \n new_arr << word.reverse\n end\n p new_arr.join(' ')\nend",
"def reverse_each_word(s_input)\n a_input = s_input.split # convert scentance to array\n reversed = \"\" # string to hold reversed scentance\n # go through each word\n\n a_input.each_with_index { |word, index|\n characters = word.split \"\" # split the word into an array\n characters = characters.reverse # reverse the chars in array\n # puts \"#{characters} #{characters.is_a?(Array)}\"\n new_word = characters.join \"\" # join characters array into a word\n if index == 0\n reversed << \"#{new_word}\" # shovel the new_word into the string reversed without space if first word\n else\n reversed << \" #{new_word}\" # shovel the new_word into the string reversed\n end\n }\n reversed\nend",
"def reverse_each_word(string)\n string = string.split\n reversed_string = []\n \n string.collect do |char|\n reversed_string.push(char.reverse)\n end\n \n return reversed_string.join(' ')\nend",
"def reverse_words(sentence)\n arr = []\n sentence.split(' ').each do |word| \n if word.length >= 5\n arr << word.split(//).reverse!.join\n else \n arr << word\n end \n end\n arr.join(\" \")\nend",
"def reverse_sentence(str)\n words_array = str.split.reverse.join(' ')\n words_array\nend",
"def reverse_words(sentence)\nnew_sentence = []\n\nsentence.split(\" \").each do |word|\n rev_word = \"\"\n word.each_char {|char| rev_word = char + rev_word } \n new_sentence << rev_word\nend\n\nnew_sentence.join(\" \")\nend",
"def another_way(string)\n words = []\n \n string.split.each do |word|\n word.reverse! if word.size >= 5\n words << word\n end\n \n words.join(' ')\nend",
"def reverse_each_word(sentence)\n sentence = sentence.split(\" \")\n x = 0\n sentence.collect do |word|\n word = word.reverse\n sentence[x] = word\n x += 1\n end\n sentence.join(\" \")\nend",
"def reverse_each_word(sentence)\n array = sentence.split(\" \")\n array_new = []\n array_new = array.collect do |element| \n element.reverse \n end\n array_new.join(\" \")\nend",
"def reverse_sentence(sentence)\n string = ''\n unless sentence.empty?\n array = sentence.split(' ')\n until array.empty?\n if array.length == 1\n string << array.pop\n else\n string << array.pop + ' '\n end\n end\n end\n string\nend",
"def reverse_each_word(string)\n sentence = string.split(\" \")\n sentence.collect do |word|\nword.reverse\nend.join(\" \")\nend",
"def reverse_sentence(string)\n array_of_words = string.split.reverse.join(\" \")\nend",
"def reverse(string)\n arr = string.split\n new_arr = []\n loop do\n reversed_word = arr.pop\n new_arr.push(reversed_word)\n break if arr.length == 0\n end\n new_string = new_arr.join(' ')\nend",
"def letterReverse (string_of_words)\n new_sentence = ''\n new_word = ''\n word_array = string_of_words.split(' ')\n word_array.each do |elem|\n new_word = elem.split('').reverse().join('')\n puts new_word\n new_sentence.concat(new_word + ' ')\n puts new_sentence.to_s\n end\n new_sentence\nend",
"def reverse_string(string)\n reverse_array = []\n new_array = string.split(\" \")\n\n string.length.times do \n reverse_array << new_array.pop\n \n end\n\n reverse_array.join(' ').gsub('doing?', 'doing')\nend",
"def reverse_each_word (sentence)\n array_sentence = sentence.split()\n array_reversed = array_sentence.collect do |word|\n word.reverse\n end\n array_reversed.join(\" \")\nend",
"def reverse_each_word(x) \n #Create a new array to store the split string\n array = []\n #Use .split to split the string into an array of strings\n array = x.split \n #Use collect enumerable to iterate over the elements of array and .reverse! to reverse each element\n array.collect{|n| n.reverse!}\n #Use .join on the array with ' ' to join the elements together with a space into a string\n array.join(' ')\nend",
"def reverse_a_string(string)\n new_array = []\n \n string_to_array = string.chars\n string_length = string_to_array.length \n \n string_length.times do \n new_array << string_to_array.pop\n end\n new_array.join(\"\")\nend",
"def reverse_each_word(sentence)\n new_array = sentence.split(\" \")\n \n new_sentence = new_array.collect do |word| \n word.reverse \n end\n \n new_sentence.join(\" \")\nend",
"def reverse_sentence(input)\n sentence = []\n sentence << input.split.reverse.join(' ')\n\nend",
"def reverse_sentence(sentence)\n words = sentence.split(' ')\n reversed_words = []\n\n i = 0\n while i < words.length\n # reversed_words = words[i] + reversed_words\n reversed_words.unshift(words[i])\n i += 1\n end\n\n reversed_words.join(' ')\nend",
"def reverse_each_word(string)\r\n array = string.split(\" \")\r\n reverse_array = []\r\n array.collect do|string|\r\n reverse_array << string.reverse\r\n end\r\n reverse_array.join(\" \")\r\nend",
"def reverse_sentence(str)\n str.split.map { | word | word.length > 5 ? word.reverse : word }.join(\" \")\nend",
"def reverse_each_word(sentence)\n y = \"\"\n x =sentence.reverse.split(\" \")\n x = x.reverse\n x.collect do |word|\n y << word << \" \"\n end\n return y.chomp(\" \")\nend",
"def reverse_five(str)\nnew_sent = []\nwords = str.split(\" \")\nwords.each do |x|\n if x.length > 4\n new_sent << x.reverse\n else\n new_sent << x\n end\nend\n new_sent.join(\" \")\nend",
"def reverse_each_word(string)\n arrayOfReversedWords = string.split.collect do |letter|\n letter.reverse\n end\n arrayOfReversedWords.join(\" \")\nend",
"def reverse_each_word(str)\n words=str.split(' ')\n sentence = []\n words.collect do |word|\n sentence << word.reverse\n end\n sentence.join(' ')\nend",
"def reverse_sentence(my_sentence)\n return nil if my_sentence.nil? \n new_arr = []\n holder = []\n i = 0\n while i < my_sentence.length\n\n if my_sentence[i] == \" \" \n new_arr << holder.join \n new_arr << \" \" \n holder = [] \n else\n holder << my_sentence[i] \n end\n i += 1\n end \n\n new_arr << holder.join \n\n # creating the reversed string from the above array\n k = new_arr.length - 1\n i = 0\n while k >= 0\n \n if i < k\n temp = new_arr[i] # temporarly save words in the first half of the array \n new_arr[i] = new_arr[k] # swap each words in the array\n new_arr[k] = temp\n i += 1\n end\n k -= 1\n end\n \n i = 0\n new_sentence = new_arr.join\n\n while i < new_sentence.length\n my_sentence[i] = new_sentence[i] \n i += 1\n end\n return my_sentence\nend",
"def reverse_each_word(string_sentence)\n array = string_sentence.split\n in_place_reverse_string_sentence = []\n array.collect do |element|\n in_place_reverse_string_sentence << element.reverse \n end\n in_place_reverse_string_sentence.join(\" \")\nend",
"def reverse_each_word(string)\n array_frm_string = string.split(\" \")\n rev_string = \"\"\n array_frm_string.collect do |word|\n rev_string << word.reverse + \" \"\n end\n rev_string.chop\nend",
"def reverse_sentence(string)\n array = string.split\n array.reverse!\n array.join(\" \")\nend",
"def reverse_words(string)\n array = string.split.map do |element| \n if element.length >= 5\n element.reverse\n else \n element\n end\nend\narray.join(' ')\nend",
"def reverse_sentence(sentence)\n reverse_string = reverse_string(sentence)\n \n reverse_words = reverse_string.split\n \n new_words = []\n \n reverse_words.each do |word|\n new_words << reverse_string(word)\n end\n \n return new_words.join(\" \")\nend",
"def reverse_each_word(string)\n\n\n str_n = string.split.collect do |str|\n str.reverse\n end\n\n str_n.join(\" \")\n\nend",
"def reverse(string)\n output = \"\"\n array = string.chars\n string.length.times { output << array.pop } \n output\nend",
"def reverse_words(str)\n\tarr = []\n\n\tstr.split.map do |word| \n\tword.reverse if word.size >= 5\n\tarr << word\n\tend\n\n\tarr.join(' ')\nend",
"def reverse_each_word(string)\n new_arr = string.split\n new_arr.collect do |word|\n word.reverse\n end.join(' ')\n \nend"
] | [
"0.7485462",
"0.74588835",
"0.74037427",
"0.739221",
"0.73737806",
"0.73463607",
"0.73272675",
"0.7326399",
"0.73178774",
"0.72945964",
"0.7273104",
"0.7211865",
"0.7205191",
"0.7177311",
"0.71583074",
"0.715178",
"0.7149642",
"0.7132642",
"0.7118217",
"0.7114164",
"0.7108141",
"0.71067625",
"0.7084512",
"0.70842963",
"0.7074436",
"0.707026",
"0.7060071",
"0.7043512",
"0.70427656",
"0.70250446",
"0.70133245",
"0.70127803",
"0.7005946",
"0.70012987",
"0.6990811",
"0.69851136",
"0.6981227",
"0.6979909",
"0.6967341",
"0.6966384",
"0.6962375",
"0.6956307",
"0.69543886",
"0.69424516",
"0.69212526",
"0.6917995",
"0.69153947",
"0.6915234",
"0.6915151",
"0.69129324",
"0.6912076",
"0.6905634",
"0.6903383",
"0.6892975",
"0.689089",
"0.689089",
"0.68884206",
"0.6881143",
"0.68780005",
"0.6877177",
"0.68648964",
"0.68621624",
"0.686182",
"0.6856797",
"0.6855802",
"0.68475",
"0.68402755",
"0.683633",
"0.68359995",
"0.68313867",
"0.68304795",
"0.68291396",
"0.68264884",
"0.6820226",
"0.6818556",
"0.6816145",
"0.68112993",
"0.6810386",
"0.68089867",
"0.68031186",
"0.6801587",
"0.67978126",
"0.67977136",
"0.6797297",
"0.6796363",
"0.679593",
"0.6792042",
"0.67883193",
"0.67881095",
"0.67881083",
"0.67856413",
"0.6785282",
"0.67823434",
"0.6776236",
"0.6773687",
"0.67717546",
"0.6771181",
"0.67670727",
"0.6766386",
"0.6762738"
] | 0.7432545 | 2 |
Identify and describe the Ruby method(s) you implemented. each: This method iterates over each element in the array. After calling the method you must call "do" and in between || any variable name which you'll be using to refer to the element you want the code to do something to. It is convinient to call it something meaningful. include?: This method will check if the string it is being called on includes, the argument passed to it. It does not work on numbers. select!: This destructive method will keep in the array whathever elements meet the criteria in the argument. push: This method adds an element to an array. to_s: Transforms whatever it is being called to into a string. Person 2 | def my_array_modification_method!(source, thing_to_modify)
source.dup # This line is here to make sure all tests initially fail. Delete it when you begin coding.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def my_array_finding_method(source, thing_to_find)\n make_string = source.map { |e| e.to_s }\n make_string.select { |e| e.include?(thing_to_find) }\nend",
"def my_array_finding_method(i_want_pets, thing_to_find)\n p i_want_pets.select { |value| value.to_s.include? thing_to_find }\nend",
"def my_array_finding_method(source, thing_to_find)\n ans = source.select {|x| x.to_s.include?(thing_to_find)}\n return ans\nend",
"def my_array_finding_method(source, thing_to_find)\n new_array = source.select do |element|\n element.to_s.include? thing_to_find\n end\n return new_array\nend",
"def my_array_finding_method(source, thing_to_find)\n p final_array = source.select {|test| test.to_s.include?(thing_to_find.to_s)}\nend",
"def my_array_finding_method(source, thing_to_find)\n p final_array = source.select {|test| test.to_s.include?(thing_to_find.to_s)}\nend",
"def look_and_say(array)\n\nend",
"def some_array_methods\n teachers = ['James', 'Jim', 'Adriana']\n # p teachers.first\n # p teachers.last\n # p teachers.sample\n # reverse_teachers = teachers.reverse\n # teachers.delete_at(0)\n # p teachers.index('aldskjflskdjf')\n teachers.insert(0 , 'Angie')\n # p teachers.count do |name|\n # name == 'Jim'\n # end\n # p teachers.length\n # p teachers\n # teachers.each do |teacher|\n # p teacher\n # end\n new_teachers = teachers.map do |teacher|\n teacher += ' is a teacher.'\n end\n p new_teachers\nend",
"def my_array_finding_method(source, thing_to_find)\n source.select { |word| word.to_s.include? thing_to_find }\nend",
"def my_array_finding_method(source, thing_to_find)\n source.select { |word| word.to_s.include? thing_to_find}\nend",
"def my_array_finding_method(source, thing_to_find)\n result = source.select{ |word| word.to_s.include? (thing_to_find) }\n result\nend",
"def my_array_finding_method(source, thing_to_find)\n source.select{|value| value.to_s.include?(\"#{thing_to_find}\")}\nend",
"def my_array_finding_method(source, thing_to_find)\n answer = Array.new\n source.each do |x|\n if x.to_s.include?(thing_to_find)\n answer << x\n end\n end\n p answer\nend",
"def each(&a_proc); end",
"def internally_screaming\n people = [\"Taylor Swift\", \"Carly Rae Jeppsen\", \"Justin Bieber\"]\n\n people.map do |name|\n \"#{name} is bad at music\"\n end\n \nend",
"def each(*) end",
"def using_include(array, element)\n\tarray.include?(element)\nend",
"def say_hi\n if @names.nil?\n puts \"...\"\n elsif @names.respond_to?(\"each\")\n # @names is a list of some kind, iterate!\n\n @names.each do |name|\n puts \"Hello #{name}!\"\n end\n end\n\n #say bye to everyone \n\n def say_bye \n if @names.nil?\n puts \"...\"\n elsif @names.respond_to?(\"join\")\n #Join the list elements with commas \n puts \"Goodbye #{@names.join(\", \")}. Come back soon!\"\n else \n puts \"Goodbye #{@names}. Come back soon!\"\n end \n end\nend",
"def my_array_finding_method(source, thing_to_find)\n found_things_ary = Array.new\n\n source.each do |x|\n if x.to_s.include?(thing_to_find) == true\n found_things_ary.push(x)\n end\n end\n return found_things_ary\nend",
"def contains (array, string)\n# use select method to filter over array\n array.select do |value|\n# use include? to see if the array includes string\n value.include? string\n end\nend",
"def people_who_can_buy_beer(people)\nend",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def each; end",
"def my_array_finding_method(source, thing_to_find)\n # Array to hold search resutls\n search_results = []\n # iterate over source\n source.each do |string|\n # if it's a number convert to a string\n if string.is_a?(Integer) == true\n string.to_s\n\n # if string is what we're looking for\n elsif string.include?(thing_to_find) == true\n # put it in our array\n search_results << string\n\n end\n\n\n end\n # return the array\n return search_results\nend",
"def collect; end",
"def my_array_finding_method(source, thing_to_find)\n # final_array = []\n # source.each do |word|\n # if word.class == thing_to_find.class && word.include?(thing_to_find) == true\n # final_array << word\n # end\n # end\n # return final_array\n ###### refactor\n return source.grep(/#{ thing_to_find }/)\nend",
"def my_array_finding_method(source, thing_to_find)\n found=[]\n source.each do |find|\n if find.to_s.include?(thing_to_find)\n found.push(find)\n end\n end\n return found\nend",
"def more_method\n # incorrect\n if v = array.grep(/foo/) \n end\n\n # Reason\n\n # Avoid misunderstanding with ==\n\n # Encourage using ||= for variable declaration However, with boolean variables, false value will be overwritten\n\n # incorrect - will set enabled to be true even when it is false\n enabled ||= true\n\n #There is no white spaces between method name and arguments\n\n # incorrect\n self.f (3 + 2) + 1\n\n # Still keep argument also it do not used in block.\n\n # incorrect\n result = hash.map { |_, v| v + 1 }\n\n # Use shorten name of argument to name temporary argument in block\n\n # correct\n products.each { |product| product.maintain! }\n\n # OK\n products.each { |prod| prod.maintain! }\n\n # Naming\n\n # Method name or variable name use snake_case\n\n # Class name or Module name use CamelCase\n\n # Constant use SCREAMING_SNAKE_CASE\n\n # Methods which return boolean should add ? at the end, such as Array#empty?\n\n # Destroy method or dangerous method should add ! at the end, such as Array#flatten! When define destroy method, un-destroy method like Array#flatten should be defined as well.\n\n # Class\n\n # Avoid using class variables @@ unless it is really necessary\n end",
"def my_find (collection) # collection is the array described above, passed to the method my_find\n i = 0 # setting up a counter\n while i < collection.length #while the counter is less than the length of the array do something\n return collection[i] if yield(collection[i]) #this is the \"do something\": send an ellement ([i]) to a block and if\n # it is returned to the method as 'true' then make it the return value of the method\n i+=1 # if the condition above is not met then add one to the counter and cycle through the next element in collection\n end #ends the while statement\nend",
"def my_each(&prc)\n end",
"def my_array_finding_method(source, thing_to_find)\n return source.grep(/#{thing_to_find}/)\nend",
"def things_i_like (*things)\n things.each do |item|\n puts 'I like ' + item\n end\nend",
"def my_array_finding_method array, letter\n wooho = []\n array.each do |x|\n if x.class != Fixnum\n wooho << x if x.include? letter\n end\n end\n wooho\nend",
"def include?(array, query)\n array.each do |el|\n return true if el == query\n end\n false\nend",
"def iterating_method?(name); end",
"def include?(array, value)\n # method A\n array.any? { |element| element == value }\n \n # method B\n # for item in array\n # return true if item == value\n # end\n \n # false\nend",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each(&block); end",
"def each_set\n \n end",
"def my_select(collection)\n holder = [] #for collection at the end\n counter = 0 #start at beginning of array\n\n while counter < collection.length # condition to be met\n if yield(collection[counter]) == true #if the mumbojumbo results in true *which select gives\n holder.push(collection[counter]) #then push that element into the new array\n end\n counter += 1 #iterate throughout the array incremently\n end\n holder #show everyone your new array\nend",
"def contain_a(arr)\n arr.select do |word| \n word.include?(\"a\")\n end\nend",
"def include?(something); end",
"def contain_a(arr)\n arr.select do |element|\n element.include?(\"a\")\n end\nend",
"def my_array_finding_method(source, thing_to_find)\n i = 0\n t = 0\n output_array = []\n while i < source.length\n if source[i].to_s.include?(thing_to_find)\n output_array[t] = source[i].to_s\n t += 1\n end\n i +=1\n end\n return output_array\nend",
"def my_array_modification_method!(source, thing_to_modify)\n\nreturn source.collect! { |item| item.is_a?(Fixnum) ? item + thing_to_modify : item}\nend",
"def sum_numbers (numbers)\r\n##INJECT METHOD\r\n # numbers.each do |thing|\r\n # thing \r\n # this is where you put the thing to check for strings/not numbers\r\n # end \r\n numbers.inject(:+)\r\n# ##ACCUMULATOR METHOD\r\n# accumulator = 0\r\n# numbers.each do |num|\r\n# accumulator += num\r\n# end \r\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.map! do |e|\n if e.class == Fixnum\n e = e + thing_to_modify\n elsif e.class == String\n e = e\n end\n end\n return source\nend",
"def contain_a(array)\n array.select do |element|\n element.include?('a')\n end\nend",
"def some_method (testing1)\n\tputs testing1.collect! {|num| num**3} # method 2\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.collect! do |x| \n if x.is_a?(Integer) \n x+=thing_to_modify\n else x\n end\n end\n\n\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.collect! do |x| \n if x.is_a?(Integer) \n x+=thing_to_modify\n else x\n end\n end\n\n\nend",
"def add_s(array)\n array.collect do |word| \n if array[1] == word\n word\n else \n word + \"s\"\n #why does word.join(\"s\") not work here?\nend\nend\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.collect! do |item| # Array#collect! overrides original array\n if item.is_a? Integer #searches for integers and modifies them\n item + thing_to_modify\n else\n item #leaves non intgers alone\n end\n end\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.collect! do |item| # Array#collect! overrides original array\n if item.is_a? Integer #searches for integers and modifies them\n item + thing_to_modify\n else\n item #leaves non intgers alone\n end\n end\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.map! { |word| word.is_a?(Integer) ? word + thing_to_modify : word }\nend",
"def collect\n end",
"def my_array_finding_method(source, thing_to_find)\n result = [] # result is the output array\n source.each do |word|\n word_array = word.to_s.split(//) # This creates an array of charaters of 'word'\n if word_array.include?(thing_to_find)\n result.push(word)\n end\n end\n return result\nend",
"def my_array_modification_method!(source, thing_to_modify)\n source.collect! do |item|\n if item.is_a? Integer\n item += thing_to_modify\n else item\n end\n end\n return source\nend",
"def add_bang(array)\n # TODO: Take an array of strings and return a new array with \"!\" appended to each string.\n # You should use Enumerable#map\n array.map do |element|\n element+\"!\"\n end\nend",
"def test_collect_array_no_block\n assert_nothing_raised{ @words.collect }\n assert_equal(%w/foo bar baz/, @words.collect)\n assert_equal(%w/FOO BAR BAZ/, @words.collect(:upcase))\n assert_equal(%w/fooA barA bazA/, @words.collect(:+, 'A'))\n assert_equal(%w/foo bar baz/, @words) # Verify receiver unmodified\n end",
"def collect!\n block_given? or return enum_for(__method__)\n set = self.class.new\n each { |o| set << yield(o) }\n replace(set)\n end",
"def test_each_is_a_method_on_arrays\n assert_equal true, [].methods.include?(as_name(:each))\n end",
"def my_array_finding_method(ary, letter)\n\t\n\tif !letter.is_a?(String)\n\t\traise ArgumentError.new('The Second Argument Should be a String')\n\tend\n\treturn ary.find_all {|element| element.include?(letter) if element.is_a?(String)}\nend",
"def people; end",
"def my_array_finding_method(source, thing_to_find)\n source.select { |item| item =~ /#{thing_to_find}/ } #=> Returns items from source array where item matches thing_to_find\nend",
"def each\n end",
"def each\n end",
"def each\n end",
"def each\n end",
"def each\n end",
"def each\n end",
"def each(&block)\nend",
"def refute_includes(collection, obj, msg = T.unsafe(nil)); end",
"def names_of_people_better_at_english_than_maths(results_set)\nend",
"def my_select(&prc)\n\t\tnew_array = []\n\n\t\tself.my_each do |ele|\n\t\t\tnew_array << ele if prc.call(ele)\t\t\t\t\n\t\tend\n\n\t\tnew_array\n\tend",
"def my_array_modification_method(source, thing_to_modify)\n\t# #source[-1],source[2] = source[-1] + 1, source[2 ]+ 1 \n # source.collect! do |item|\n # # # if item.is_a?(Integer)\n # # # item = item + thing_to_modify\n # # # else \n # # # \titem = item\n # # end\n \n # item.is_a?(Integer) ? item = item + thing_to_modify : item = item\n # end\n source.collect! { |item| item.is_a?(Integer) ? item += thing_to_modify : item = item } \n source\nend",
"def contain_a(array)\n array.select do |string|\n string.include?('a')\n end\nend",
"def test_all_iteration_methods_work_on_any_collection_not_just_arrays\n # Ranges act like a collection\n result = (1..3).map { |item| item + 10 }\n assert_equal [11, 12, 13], result\n\n # Files act like a collection of lines. Mix-ins? Or does it just quack like\n # a collection-duck?\n File.open(\"example_file.txt\") do |file|\n upcase_lines = file.map { |line| line.strip.upcase }\n assert_equal ['THIS', 'IS', 'A', 'TEST'], upcase_lines\n end\n\n # NOTE: You can create your own collections that work with each,\n # map, select, etc.\n end",
"def each\n end",
"def each\n end",
"def include?(array, arg)\n boolean_return = false\n array.each {|value| return boolean_return = true if value == arg}\n boolean_return\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend",
"def my_array_modification_method(source, thing_to_modify)\n # Your code here!\nend"
] | [
"0.57045865",
"0.5672088",
"0.5616467",
"0.5536172",
"0.5531668",
"0.5531668",
"0.5524372",
"0.550353",
"0.5462816",
"0.5460113",
"0.5457466",
"0.54573774",
"0.54555726",
"0.54052526",
"0.53675973",
"0.53566253",
"0.53489596",
"0.5332775",
"0.5325118",
"0.5302254",
"0.5274603",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.5242473",
"0.52081513",
"0.52053285",
"0.5194643",
"0.5173233",
"0.5147271",
"0.5141675",
"0.51102036",
"0.51049215",
"0.5097165",
"0.5084852",
"0.50733364",
"0.5071411",
"0.50683725",
"0.50530857",
"0.50530857",
"0.50530857",
"0.50530857",
"0.50530857",
"0.50530857",
"0.5043026",
"0.50360656",
"0.50339764",
"0.5024654",
"0.50172174",
"0.5016946",
"0.5013601",
"0.5013325",
"0.50130856",
"0.5001974",
"0.4984966",
"0.4978533",
"0.4978533",
"0.4968094",
"0.4960884",
"0.4960884",
"0.495077",
"0.49505004",
"0.49310213",
"0.49301928",
"0.49299255",
"0.49274945",
"0.49147612",
"0.49055833",
"0.49045506",
"0.49040073",
"0.4902352",
"0.48958185",
"0.48958185",
"0.48958185",
"0.48958185",
"0.48958185",
"0.48958185",
"0.48925135",
"0.48906273",
"0.4890043",
"0.48808062",
"0.4874305",
"0.48734325",
"0.4871189",
"0.48648468",
"0.48648468",
"0.48602635",
"0.4854668",
"0.4854668",
"0.4854668",
"0.4854668",
"0.4854668",
"0.4854668",
"0.4854668"
] | 0.0 | -1 |
Identify and describe the Ruby method(s) you implemented. Person 3 | def my_array_sorting_method(source)
source # This line is here to make sure all tests initially fail. Delete it when you begin coding.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def methods() end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def extract_method_details; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def describeMethod(cname, type, mname)\n \n # If the class name part is ambiguous, then we have a join to\n # do\n \n method_list = methods_matching(cname, type, mname)\n\n case method_list.size\n \n when 0\n @op.error(\"Cannot find method `#{cname}#{type}#{mname}'\")\n throw :exit, 3\n \n when 1\n meth = method_list[0]\n @op.putMethodDescription do\n @op.putMethodHeader(meth.class_name, meth.typeAsSeparator, meth.name, meth.callseq)\n printFragments(meth) unless @synopsis\n end\n \n else\n\n @op.putListOfMethodsMatchingName(mname) do\n @op.putMethodList(method_list.collect { |m| \n \"#{m.class_name}#{m.typeAsSeparator}#{m.name}\" \n })\n end\n end\n end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method_symbol; end",
"def method_name\n\n end",
"def method_name\n\n end",
"def method_name\n\n end",
"def method_name\n end",
"def display_method_info\n end",
"def method_information(bound_method); end",
"def name_of_method\n # method body goes here\nend",
"def expected_method; end",
"def method_signature\n case @opcode.arguments.size\n when 0\n @file.puts \" def #{method_name}\"\n when 1\n @file.puts \" def #{method_name}(arg1)\"\n when 2\n @file.puts \" def #{method_name}(arg1, arg2)\"\n end\n end",
"def method\r\nend",
"def signature\n raise NotImplementedError, _(\"%{class} has not implemented method %{method}\") %{class: self.class, method: __method__}\n end",
"def print_method(*) end",
"def findAndDescribe(name)\n methods = MethodIndex.findMethods(name)\n \n if methods.size.zero?\n @op.error(\"Don't know anything about a method called `#{name}'.\")\n throw :exit, 4\n end\n \n if methods.size == 1\n methods[0] =~ /^(#{CN_PATTERN})(\\.|\\#|::)(.+)/\n describeMethod($1, $2, $3)\n else\n @op.putListOfMethodsMatchingName(name) do\n @op.putMethodList(methods)\n end\n end\n end",
"def yet_another_method\n puts \"I'm a method\"\nend",
"def firstMethod()\n p \"hey this is first method ok\"\n p \"here i show how can create method in ruby\"\n p \" know time end \"\nend",
"def method1; end",
"def signature\n \"#{klass_name}#{method_name}\"\n end",
"def my_method_param(name) #Define method \"my_method_param\"\n print \"Hello #{name}!\"\nend",
"def method_missing(meth, *args, &block)\n __describe_and_send__(meth, *args, &block)\n end",
"def display_method_list\n end",
"def method(arg1 = default_value, arg2, etc.) # Defines a method with the name method and arguments.\n # Code goes here, for example:\n puts \"Hello, #{arg1} #{arg2}!\"\nend",
"def type\n 'Method'\n end",
"def describe\n raise NotImplementedError\n end",
"def methodname\n # contents of method\nend",
"def demoMethod\n\t\traise \"Ceci est une methode abstraite. This is an abstact method.\";\n\tend",
"def report_method_stuff(requested_method_name, methods)\n entries = methods.find_all {|m| m.name == requested_method_name and (\n !@onlyLoadedClasses or \n Object.class_eval \"defined? #{m.nameSpace.full_name}\" ) }\n case entries.size\n when 1\n method = @ri_reader.get_method(entries.first)\n @display.display_method_info(method)\n when 0\n puts \"No loaded methods matched your request\"\n else\n @display.display_method_list(entries)\n end\n end",
"def simple_method\n puts \"I am a simple method!\"\nend",
"def method_description(method)\n call(\"System.methodDescription\", method)\n end",
"def display_method name\n found = load_methods_matching name\n raise NotFoundError, name if found.empty?\n filtered = filter_methods found, name\n out = RDoc::Markup::Document.new\n out << RDoc::Markup::Heading.new(1, name)\n out << RDoc::Markup::BlankLine.new\n filtered.each do |store, methods|\n methods.each do |method|\n out << RDoc::Markup::Paragraph.new(\"(from #{store.friendly_path})\")\n unless name =~ /^#{Regexp.escape method.parent_name}/ then\n out << RDoc::Markup::Heading.new(3, \"Implementation from #{method.parent_name}\")\n end\n out << RDoc::Markup::Rule.new(1)\n if method.arglists then\n arglists = method.arglists.chomp.split \"\\n\"\n arglists = arglists.map { |line| line + \"\\n\" }\n out << RDoc::Markup::Verbatim.new(*arglists)\n out << RDoc::Markup::Rule.new(1)\n end\n out << RDoc::Markup::BlankLine.new\n out << method.comment\n out << RDoc::Markup::BlankLine.new\n end\n end\n display out\n end",
"def my_method\nend",
"def method\n @method\n end",
"def defined_method()\n p \"success\"\nend",
"def my_method\n end",
"def greeting(name)\n \"Hello and welcome to Ruby methods \" + name + \"!\"\nend",
"def meth(arg1)\nend",
"def hey_hey; end",
"def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def example_method\n # code\n end",
"def meth(arg1,arg2)\nend",
"def meth(arg1,arg2)\nend",
"def how_it_works\r\n end",
"def report_methods cm\n return if cm.method_list.empty?\n\n report = []\n\n cm.each_method do |method|\n next if method.documented? and @coverage_level.zero?\n\n if @coverage_level > 0 then\n params, undoc = undoc_params method\n\n @num_params += params\n\n unless undoc.empty? then\n @undoc_params += undoc.length\n\n undoc = undoc.map do |param| \"+#{param}+\" end\n param_report = \" # #{undoc.join ', '} is not documented\\n\"\n end\n end\n\n next if method.documented? and not param_report\n\n line = method.line ? \":#{method.line}\" : nil\n scope = method.singleton ? 'self.' : nil\n\n report << \" # in file #{method.file.full_name}#{line}\\n\"\n report << param_report if param_report\n report << \" def #{scope}#{method.name}#{method.params}; end\\n\"\n report << \"\\n\"\n end\n\n report\n end",
"def internal_methods; end",
"def method\n @method\n end",
"def method\n @method\n end",
"def calls_by_method_name; end",
"def display_method name\n found = load_methods_matching name\n\n raise NotFoundError, name if found.empty?\n\n filtered = filter_methods found, name\n\n out = method_document name, filtered\n\n @history.go name, out, nil\n\n display out\n end",
"def method\r\n\t1\r\nend",
"def methods_accepting_symbol; end",
"def name\n 'method 2'\n end",
"def whatever\n end",
"def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end",
"def required_operations1\n raise NotImplementedError, \"#{self.class} has not implemented method '#{__method__}'\"\n end",
"def method\n\t\t# code code\n\tend",
"def add_method_documentation out, klass\n klass.method_list.each do |method|\n begin\n add_method out, method.full_name\n rescue NotFoundError\n next\n end\n end\n end",
"def handle_method(type, var_name, meth_name, function, param_count,\n source_file = nil)\n class_name = @known_classes[var_name]\n singleton = @singleton_classes.key? var_name\n\n @methods[var_name][function] << meth_name\n\n return unless class_name\n\n class_obj = find_class var_name, class_name\n\n if existing_method = class_obj.method_list.find { |m| m.c_function == function }\n add_alias(var_name, class_obj, existing_method.name, meth_name, existing_method.comment)\n end\n\n if class_obj then\n if meth_name == 'initialize' then\n meth_name = 'new'\n singleton = true\n type = 'method' # force public\n end\n\n meth_obj = RDoc::AnyMethod.new '', meth_name\n meth_obj.c_function = function\n meth_obj.singleton =\n singleton || %w[singleton_method module_function].include?(type)\n\n p_count = Integer(param_count) rescue -1\n\n if source_file then\n file_name = File.join @file_dir, source_file\n\n if File.exist? file_name then\n file_content = File.read file_name\n else\n @options.warn \"unknown source #{source_file} for #{meth_name} in #{@file_name}\"\n end\n else\n file_content = @content\n end\n\n body = find_body class_name, function, meth_obj, file_content\n\n if body and meth_obj.document_self then\n meth_obj.params = if p_count < -1 then # -2 is Array\n '(*args)'\n elsif p_count == -1 then # argc, argv\n rb_scan_args body\n else\n args = (1..p_count).map { |i| \"p#{i}\" }\n \"(#{args.join ', '})\"\n end\n\n\n meth_obj.record_location @top_level\n\n if meth_obj.section_title\n class_obj.temporary_section = class_obj.add_section(meth_obj.section_title)\n end\n class_obj.add_method meth_obj\n\n @stats.add_method meth_obj\n meth_obj.visibility = :private if 'private_method' == type\n end\n end\n end",
"def walk_method(name); end",
"def what_is\n end",
"def get_method_description(class_name, method_name = nil)\n ApipieDSL.debug(\"Getting #{class_name}##{method_name} documentation\")\n crumbs = class_name.split('#')\n method_name = crumbs.pop if method_name.nil?\n class_name = crumbs.join('#')\n class_description = get_class_description(class_name)\n raise ArgumentError, \"Class #{class_name} does not exists.\" if class_description.nil?\n\n class_description.method_description(method_name.to_sym)\n end"
] | [
"0.71895266",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70606774",
"0.70315236",
"0.6946403",
"0.6946403",
"0.6946403",
"0.6946403",
"0.69151235",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68842214",
"0.68234944",
"0.68233395",
"0.68233395",
"0.68233395",
"0.68076146",
"0.6792748",
"0.67580855",
"0.67518246",
"0.6743154",
"0.67135686",
"0.6712078",
"0.66984206",
"0.66792744",
"0.6643541",
"0.6585235",
"0.65817964",
"0.65334356",
"0.6503974",
"0.6477356",
"0.6475742",
"0.6438616",
"0.6435705",
"0.6431823",
"0.6421592",
"0.641671",
"0.63964504",
"0.63778734",
"0.63679874",
"0.6358625",
"0.6356189",
"0.6356014",
"0.63432956",
"0.6343232",
"0.6341617",
"0.6315659",
"0.62991893",
"0.6290085",
"0.6269554",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.6259374",
"0.62544733",
"0.6248898",
"0.6248898",
"0.6234385",
"0.62342834",
"0.61951077",
"0.6191015",
"0.6191015",
"0.6173109",
"0.61647666",
"0.6156906",
"0.6152805",
"0.6139978",
"0.6122635",
"0.6107544",
"0.61006343",
"0.60944307",
"0.60845315",
"0.6067469",
"0.6066526",
"0.60636294",
"0.60598135"
] | 0.0 | -1 |
Identify and describe the Ruby method(s) you implemented. Person 4 | def my_array_deletion_method!(source, thing_to_delete)
source.dup # This line is here to make sure all tests initially fail. Delete it when you begin coding.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def methods() end",
"def extract_method_details; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def describeMethod(cname, type, mname)\n \n # If the class name part is ambiguous, then we have a join to\n # do\n \n method_list = methods_matching(cname, type, mname)\n\n case method_list.size\n \n when 0\n @op.error(\"Cannot find method `#{cname}#{type}#{mname}'\")\n throw :exit, 3\n \n when 1\n meth = method_list[0]\n @op.putMethodDescription do\n @op.putMethodHeader(meth.class_name, meth.typeAsSeparator, meth.name, meth.callseq)\n printFragments(meth) unless @synopsis\n end\n \n else\n\n @op.putListOfMethodsMatchingName(mname) do\n @op.putMethodList(method_list.collect { |m| \n \"#{m.class_name}#{m.typeAsSeparator}#{m.name}\" \n })\n end\n end\n end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method_symbol; end",
"def method_name\n\n end",
"def method_name\n\n end",
"def method_name\n\n end",
"def method_name\n end",
"def method_information(bound_method); end",
"def display_method_info\n end",
"def method_signature\n case @opcode.arguments.size\n when 0\n @file.puts \" def #{method_name}\"\n when 1\n @file.puts \" def #{method_name}(arg1)\"\n when 2\n @file.puts \" def #{method_name}(arg1, arg2)\"\n end\n end",
"def name_of_method\n # method body goes here\nend",
"def signature\n raise NotImplementedError, _(\"%{class} has not implemented method %{method}\") %{class: self.class, method: __method__}\n end",
"def print_method(*) end",
"def expected_method; end",
"def method\r\nend",
"def findAndDescribe(name)\n methods = MethodIndex.findMethods(name)\n \n if methods.size.zero?\n @op.error(\"Don't know anything about a method called `#{name}'.\")\n throw :exit, 4\n end\n \n if methods.size == 1\n methods[0] =~ /^(#{CN_PATTERN})(\\.|\\#|::)(.+)/\n describeMethod($1, $2, $3)\n else\n @op.putListOfMethodsMatchingName(name) do\n @op.putMethodList(methods)\n end\n end\n end",
"def signature\n \"#{klass_name}#{method_name}\"\n end",
"def yet_another_method\n puts \"I'm a method\"\nend",
"def method1; end",
"def firstMethod()\n p \"hey this is first method ok\"\n p \"here i show how can create method in ruby\"\n p \" know time end \"\nend",
"def display_method_list\n end",
"def report_method_stuff(requested_method_name, methods)\n entries = methods.find_all {|m| m.name == requested_method_name and (\n !@onlyLoadedClasses or \n Object.class_eval \"defined? #{m.nameSpace.full_name}\" ) }\n case entries.size\n when 1\n method = @ri_reader.get_method(entries.first)\n @display.display_method_info(method)\n when 0\n puts \"No loaded methods matched your request\"\n else\n @display.display_method_list(entries)\n end\n end",
"def my_method_param(name) #Define method \"my_method_param\"\n print \"Hello #{name}!\"\nend",
"def method(arg1 = default_value, arg2, etc.) # Defines a method with the name method and arguments.\n # Code goes here, for example:\n puts \"Hello, #{arg1} #{arg2}!\"\nend",
"def method_missing(meth, *args, &block)\n __describe_and_send__(meth, *args, &block)\n end",
"def methodname\n # contents of method\nend",
"def type\n 'Method'\n end",
"def demoMethod\n\t\traise \"Ceci est une methode abstraite. This is an abstact method.\";\n\tend",
"def describe\n raise NotImplementedError\n end",
"def display_method name\n found = load_methods_matching name\n raise NotFoundError, name if found.empty?\n filtered = filter_methods found, name\n out = RDoc::Markup::Document.new\n out << RDoc::Markup::Heading.new(1, name)\n out << RDoc::Markup::BlankLine.new\n filtered.each do |store, methods|\n methods.each do |method|\n out << RDoc::Markup::Paragraph.new(\"(from #{store.friendly_path})\")\n unless name =~ /^#{Regexp.escape method.parent_name}/ then\n out << RDoc::Markup::Heading.new(3, \"Implementation from #{method.parent_name}\")\n end\n out << RDoc::Markup::Rule.new(1)\n if method.arglists then\n arglists = method.arglists.chomp.split \"\\n\"\n arglists = arglists.map { |line| line + \"\\n\" }\n out << RDoc::Markup::Verbatim.new(*arglists)\n out << RDoc::Markup::Rule.new(1)\n end\n out << RDoc::Markup::BlankLine.new\n out << method.comment\n out << RDoc::Markup::BlankLine.new\n end\n end\n display out\n end",
"def method_description(method)\n call(\"System.methodDescription\", method)\n end",
"def method\n @method\n end",
"def my_method\nend",
"def simple_method\n puts \"I am a simple method!\"\nend",
"def my_method\n end",
"def greeting(name)\n \"Hello and welcome to Ruby methods \" + name + \"!\"\nend",
"def defined_method()\n p \"success\"\nend",
"def report_methods cm\n return if cm.method_list.empty?\n\n report = []\n\n cm.each_method do |method|\n next if method.documented? and @coverage_level.zero?\n\n if @coverage_level > 0 then\n params, undoc = undoc_params method\n\n @num_params += params\n\n unless undoc.empty? then\n @undoc_params += undoc.length\n\n undoc = undoc.map do |param| \"+#{param}+\" end\n param_report = \" # #{undoc.join ', '} is not documented\\n\"\n end\n end\n\n next if method.documented? and not param_report\n\n line = method.line ? \":#{method.line}\" : nil\n scope = method.singleton ? 'self.' : nil\n\n report << \" # in file #{method.file.full_name}#{line}\\n\"\n report << param_report if param_report\n report << \" def #{scope}#{method.name}#{method.params}; end\\n\"\n report << \"\\n\"\n end\n\n report\n end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def hey_hey; end",
"def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end",
"def internal_methods; end",
"def meth(arg1)\nend",
"def meth(arg1,arg2)\nend",
"def meth(arg1,arg2)\nend",
"def calls_by_method_name; end",
"def methods_accepting_symbol; end",
"def example_method\n # code\n end",
"def how_it_works\r\n end",
"def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end",
"def method\n @method\n end",
"def method\n @method\n end",
"def display_method name\n found = load_methods_matching name\n\n raise NotFoundError, name if found.empty?\n\n filtered = filter_methods found, name\n\n out = method_document name, filtered\n\n @history.go name, out, nil\n\n display out\n end",
"def method\r\n\t1\r\nend",
"def name\n 'method 2'\n end",
"def required_operations1\n raise NotImplementedError, \"#{self.class} has not implemented method '#{__method__}'\"\n end",
"def runnable_methods; end",
"def runnable_methods; end",
"def add_method_documentation out, klass\n klass.method_list.each do |method|\n begin\n add_method out, method.full_name\n rescue NotFoundError\n next\n end\n end\n end",
"def walk_method(name); end",
"def method_shark es, method_name\n es.select {|e| e.method_name == method_name }\n .map {|e| \"\\n\\n\\n#{e.date}\\n\\n#{e.method_body}\" }\nend",
"def method_a\n end",
"def whatever\n end"
] | [
"0.7254233",
"0.7076545",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.70589155",
"0.69989115",
"0.69989115",
"0.69989115",
"0.69989115",
"0.69039017",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.6850014",
"0.68359166",
"0.68051296",
"0.68051296",
"0.68051296",
"0.6792697",
"0.6777436",
"0.6765092",
"0.6755315",
"0.6746921",
"0.6717673",
"0.66948414",
"0.66747177",
"0.66746956",
"0.6592361",
"0.6540305",
"0.6521387",
"0.65184194",
"0.6509266",
"0.6478398",
"0.64635575",
"0.64386904",
"0.6422853",
"0.64179265",
"0.63987464",
"0.63986784",
"0.6365477",
"0.6362875",
"0.63489616",
"0.63271207",
"0.6296039",
"0.6289587",
"0.6279259",
"0.62720555",
"0.62659055",
"0.62555826",
"0.6248694",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6248625",
"0.6246849",
"0.62294644",
"0.6225253",
"0.62173164",
"0.6184139",
"0.6184139",
"0.61828464",
"0.617915",
"0.6172181",
"0.61514974",
"0.6146621",
"0.61391467",
"0.61391467",
"0.61326784",
"0.61274654",
"0.6116273",
"0.608959",
"0.60857075",
"0.60857075",
"0.60700154",
"0.6069727",
"0.606945",
"0.60624087",
"0.60619885"
] | 0.0 | -1 |
Identify and describe the Ruby method(s) you implemented. Person 5 | def my_array_splitting_method(source)
source # This line is here to make sure all tests initially fail. Delete it when you begin coding.
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def methods() end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def method_name; end",
"def extract_method_details; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def describeMethod(cname, type, mname)\n \n # If the class name part is ambiguous, then we have a join to\n # do\n \n method_list = methods_matching(cname, type, mname)\n\n case method_list.size\n \n when 0\n @op.error(\"Cannot find method `#{cname}#{type}#{mname}'\")\n throw :exit, 3\n \n when 1\n meth = method_list[0]\n @op.putMethodDescription do\n @op.putMethodHeader(meth.class_name, meth.typeAsSeparator, meth.name, meth.callseq)\n printFragments(meth) unless @synopsis\n end\n \n else\n\n @op.putListOfMethodsMatchingName(mname) do\n @op.putMethodList(method_list.collect { |m| \n \"#{m.class_name}#{m.typeAsSeparator}#{m.name}\" \n })\n end\n end\n end",
"def method_name\n\n end",
"def method_name\n\n end",
"def method_name\n\n end",
"def method_name\n end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def name_of_method\n # method body goes here\nend",
"def method_symbol; end",
"def method_information(bound_method); end",
"def method_signature\n case @opcode.arguments.size\n when 0\n @file.puts \" def #{method_name}\"\n when 1\n @file.puts \" def #{method_name}(arg1)\"\n when 2\n @file.puts \" def #{method_name}(arg1, arg2)\"\n end\n end",
"def display_method_info\n end",
"def signature\n raise NotImplementedError, _(\"%{class} has not implemented method %{method}\") %{class: self.class, method: __method__}\n end",
"def method\r\nend",
"def print_method(*) end",
"def expected_method; end",
"def findAndDescribe(name)\n methods = MethodIndex.findMethods(name)\n \n if methods.size.zero?\n @op.error(\"Don't know anything about a method called `#{name}'.\")\n throw :exit, 4\n end\n \n if methods.size == 1\n methods[0] =~ /^(#{CN_PATTERN})(\\.|\\#|::)(.+)/\n describeMethod($1, $2, $3)\n else\n @op.putListOfMethodsMatchingName(name) do\n @op.putMethodList(methods)\n end\n end\n end",
"def yet_another_method\n puts \"I'm a method\"\nend",
"def firstMethod()\n p \"hey this is first method ok\"\n p \"here i show how can create method in ruby\"\n p \" know time end \"\nend",
"def method1; end",
"def report_method_stuff(requested_method_name, methods)\n entries = methods.find_all {|m| m.name == requested_method_name and (\n !@onlyLoadedClasses or \n Object.class_eval \"defined? #{m.nameSpace.full_name}\" ) }\n case entries.size\n when 1\n method = @ri_reader.get_method(entries.first)\n @display.display_method_info(method)\n when 0\n puts \"No loaded methods matched your request\"\n else\n @display.display_method_list(entries)\n end\n end",
"def signature\n \"#{klass_name}#{method_name}\"\n end",
"def method(arg1 = default_value, arg2, etc.) # Defines a method with the name method and arguments.\n # Code goes here, for example:\n puts \"Hello, #{arg1} #{arg2}!\"\nend",
"def display_method_list\n end",
"def my_method_param(name) #Define method \"my_method_param\"\n print \"Hello #{name}!\"\nend",
"def methodname\n # contents of method\nend",
"def method_missing(meth, *args, &block)\n __describe_and_send__(meth, *args, &block)\n end",
"def method_description(method)\n call(\"System.methodDescription\", method)\n end",
"def demoMethod\n\t\traise \"Ceci est une methode abstraite. This is an abstact method.\";\n\tend",
"def describe\n raise NotImplementedError\n end",
"def simple_method\n puts \"I am a simple method!\"\nend",
"def type\n 'Method'\n end",
"def display_method name\n found = load_methods_matching name\n raise NotFoundError, name if found.empty?\n filtered = filter_methods found, name\n out = RDoc::Markup::Document.new\n out << RDoc::Markup::Heading.new(1, name)\n out << RDoc::Markup::BlankLine.new\n filtered.each do |store, methods|\n methods.each do |method|\n out << RDoc::Markup::Paragraph.new(\"(from #{store.friendly_path})\")\n unless name =~ /^#{Regexp.escape method.parent_name}/ then\n out << RDoc::Markup::Heading.new(3, \"Implementation from #{method.parent_name}\")\n end\n out << RDoc::Markup::Rule.new(1)\n if method.arglists then\n arglists = method.arglists.chomp.split \"\\n\"\n arglists = arglists.map { |line| line + \"\\n\" }\n out << RDoc::Markup::Verbatim.new(*arglists)\n out << RDoc::Markup::Rule.new(1)\n end\n out << RDoc::Markup::BlankLine.new\n out << method.comment\n out << RDoc::Markup::BlankLine.new\n end\n end\n display out\n end",
"def greeting(name)\n \"Hello and welcome to Ruby methods \" + name + \"!\"\nend",
"def my_method\nend",
"def my_method\n end",
"def method\n @method\n end",
"def report_methods cm\n return if cm.method_list.empty?\n\n report = []\n\n cm.each_method do |method|\n next if method.documented? and @coverage_level.zero?\n\n if @coverage_level > 0 then\n params, undoc = undoc_params method\n\n @num_params += params\n\n unless undoc.empty? then\n @undoc_params += undoc.length\n\n undoc = undoc.map do |param| \"+#{param}+\" end\n param_report = \" # #{undoc.join ', '} is not documented\\n\"\n end\n end\n\n next if method.documented? and not param_report\n\n line = method.line ? \":#{method.line}\" : nil\n scope = method.singleton ? 'self.' : nil\n\n report << \" # in file #{method.file.full_name}#{line}\\n\"\n report << param_report if param_report\n report << \" def #{scope}#{method.name}#{method.params}; end\\n\"\n report << \"\\n\"\n end\n\n report\n end",
"def defined_method()\n p \"success\"\nend",
"def calls_by_method_name; end",
"def hey_hey; end",
"def method # test comment\n# ^^^ meta.function.method.without-arguments.ruby keyword.control.def.ruby\n# ^^^^^^ meta.function.method.without-arguments.ruby entity.name.function.ruby\n# ^ comment.line.number-sign.ruby punctuation.definition.comment.ruby\n# ^^^^^^^^^^^^^ comment.line.number-sign.ruby\n hello, world = [1,2]\n# ^^^^^ variable.other.ruby\n# ^ punctuation.separator.object.ruby\n# ^^^^^ variable.other.ruby\n# ^ keyword.operator.assignment.ruby\n# ^ punctuation.section.array.begin.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.separator.object.ruby\n# ^ constant.numeric.ruby\n# ^ punctuation.section.array.end.ruby\n end",
"def example_method\n # code\n end",
"def display_method name\n found = load_methods_matching name\n\n raise NotFoundError, name if found.empty?\n\n filtered = filter_methods found, name\n\n out = method_document name, filtered\n\n @history.go name, out, nil\n\n display out\n end",
"def meth(arg1)\nend",
"def internal_methods; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def signature; end",
"def do_methods\n @content.scan(%r%rb_define_\n (\n singleton_method |\n method |\n module_function |\n private_method\n )\n \\s*\\(\\s*([\\w\\.]+),\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\(|\\(METHOD\\))?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.(?:cpp|c|y)))?\n %xm) do |type, var_name, meth_name, function, param_count, source_file|\n\n # Ignore top-object and weird struct.c dynamic stuff\n next if var_name == \"ruby_top_self\"\n next if var_name == \"nstr\"\n\n var_name = \"rb_cObject\" if var_name == \"rb_mKernel\"\n handle_method(type, var_name, meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(%r%rb_define_global_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)\n (?:;\\s*/[*/]\\s+in\\s+(\\w+?\\.[cy]))?\n %xm) do |meth_name, function, param_count, source_file|\n handle_method(\"method\", \"rb_mKernel\", meth_name, function, param_count,\n source_file)\n end\n\n @content.scan(/define_filetest_function\\s*\\(\n \\s*\"([^\"]+)\",\n \\s*(?:RUBY_METHOD_FUNC\\(|VALUEFUNC\\()?(\\w+)\\)?,\n \\s*(-?\\w+)\\s*\\)/xm) do |meth_name, function, param_count|\n\n handle_method(\"method\", \"rb_mFileTest\", meth_name, function, param_count)\n handle_method(\"singleton_method\", \"rb_cFile\", meth_name, function,\n param_count)\n end\n end",
"def method\r\n\t1\r\nend",
"def methods_accepting_symbol; end",
"def name\n 'method 2'\n end",
"def how_it_works\r\n end",
"def method\n @method\n end",
"def method\n @method\n end",
"def method_shark es, method_name\n es.select {|e| e.method_name == method_name }\n .map {|e| \"\\n\\n\\n#{e.date}\\n\\n#{e.method_body}\" }\nend",
"def meth(arg1,arg2)\nend",
"def meth(arg1,arg2)\nend",
"def add_method_documentation out, klass\n klass.method_list.each do |method|\n begin\n add_method out, method.full_name\n rescue NotFoundError\n next\n end\n end\n end",
"def whatever\n end",
"def runnable_methods; end",
"def runnable_methods; end",
"def required_operations1\n raise NotImplementedError, \"#{self.class} has not implemented method '#{__method__}'\"\n end",
"def get_method_description(class_name, method_name = nil)\n ApipieDSL.debug(\"Getting #{class_name}##{method_name} documentation\")\n crumbs = class_name.split('#')\n method_name = crumbs.pop if method_name.nil?\n class_name = crumbs.join('#')\n class_description = get_class_description(class_name)\n raise ArgumentError, \"Class #{class_name} does not exists.\" if class_description.nil?\n\n class_description.method_description(method_name.to_sym)\n end",
"def walk_method(name); end"
] | [
"0.7144192",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.7030672",
"0.6951385",
"0.68914163",
"0.68914163",
"0.68914163",
"0.68914163",
"0.6845223",
"0.6793544",
"0.6793544",
"0.6793544",
"0.6783549",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67805564",
"0.67795163",
"0.67667294",
"0.6741895",
"0.67294997",
"0.6726204",
"0.666247",
"0.6658481",
"0.6649394",
"0.66460615",
"0.66315526",
"0.6559414",
"0.6527457",
"0.65019655",
"0.64998204",
"0.6488273",
"0.6453586",
"0.64475846",
"0.6427431",
"0.6399014",
"0.6376277",
"0.63458115",
"0.6334365",
"0.6327143",
"0.63208646",
"0.6318502",
"0.6315475",
"0.6309246",
"0.6304992",
"0.6294064",
"0.6272566",
"0.6266656",
"0.62443453",
"0.62321985",
"0.62075096",
"0.6204848",
"0.61607003",
"0.6154697",
"0.61518025",
"0.614699",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.6137053",
"0.61204946",
"0.61150235",
"0.6113433",
"0.61126316",
"0.61121863",
"0.61121815",
"0.61121815",
"0.60841584",
"0.608053",
"0.608053",
"0.6055033",
"0.6049334",
"0.60490596",
"0.60490596",
"0.6036352",
"0.6034377",
"0.6025764"
] | 0.0 | -1 |
GET /profiles/1 GET /profiles/1.json | def show
@user = @profile.user.id
@reviews = Review.where(:profile_id => @profile.id).order("created_at DESC")
@average_rating = @reviews.average(:rating)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_default_profile \n get(\"/profiles.json/default\")\nend",
"def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end",
"def show\n profile = Profile.find(params[:id])\n render status: 200, json: profile\n end",
"def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end",
"def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end",
"def index\n @profiles = Profile.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end",
"def profile\n check_auth :profile\n \n response = connection.post do |req|\n req.url '/user/profile'\n req.body = { :format => @format }\n end\n response.body[0]\n end",
"def show\n @profile = @user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def index\n @profiles = current_user.profiles\n end",
"def index\n @profiles = current_user.profiles\n end",
"def index\n @profiles = Profile.all\n @profile = Profile.find_by_id(params[:profile_id])\n end",
"def profile(user_id: '-')\n return get(\"#{API_URI}/#{PROFILE_API_VERSION}/user/#{user_id}/profile.json\")\n end",
"def index\n @profiles = Profile.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @profiles }\n end\n end",
"def get_profile_configuration(args = {}) \n get(\"/profiles.json/#{args[:profileId]}/configuration\", args)\nend",
"def retrieve_profile(id, content_type)\n call(:get, path(\"#{id}/profiles/#{content_type}/\"))\n end",
"def show\n @profile = current_user.profile\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def profile(profile_name:)\n claim_url = \"#{@@profile_service_url}/profile/#{profile_name}/next\"\n response = Faraday.get claim_url\n profile = JSON.parse(response.body)\n raise \"No profile available for #{profile_name}\" unless profile\n profile\n end",
"def show\n @profile = Profile.find(params[:id])\n render json: @profile.to_json(include_hash)\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def index\n @profiles = Profile.all.paginate :page => params[:page], :per_page => 3\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end",
"def show\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_profile }\n end\n end",
"def profile\n p @user.as_json\n render json: @user.as_json\n end",
"def index\n @profiles = Profile.all\n @original_niche = get_subscriber_details(@profiles, \"niche\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @profiles }\n end\n end",
"def show\n\t\t# begin\n\t\t\tprofile = Profile.find(params[:id])\n\t @conversation = current_profile.find_conversation(profile)\n\t respond_to do |format|\n\t format.html {render \"profiles/#{profile._type.underscore}_show\"}\n\t format.json { render :json => @profile }\n\t end\n\t\t# rescue => error\n\t\t# \trender \"profiles/not_found\"\n\t\t# \tputs error.message\n\t\t# end\n end",
"def get_profile\n path = self.api_root + '/register/profile'\n process_firecloud_request(:get, path)\n end",
"def profile; Profile.get(self.profile_id); end",
"def get_profile\n \n profil =\n Excon.get(\n 'https://eastus.api.cognitive.microsoft.com/speaker/identification/v2.0/text-independent/profiles',\n headers: {\n 'Content-Type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => \"3c43bca9ad884fe39518a5cf3925e707\"\n },\n body: JSON.generate(\"locale\": 'en-us')\n )\n return profil.body\n parsed = JSON.parse(profil.body)\n return parsed['profiles']\n rescue Excon::Error => e\n puts \"Error: #{e}\"\n\n end",
"def profiles\n collection(\"profiles\", paged: true)\n end",
"def profile\n raw = client.get @json['user']['links']['self']\n client.factory.create(GoodData::Profile, raw)\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @user_profiles }\n end\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def show\n @profile = Profile.find(params[:id])\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def index\n @profiles = Profile.all\n end",
"def show\n @profile = Profile.find(params[:id])\n @checkin = CheckIn.find_last_by_user_id(@profile.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @profile = Profile.find(params[:id])\n @checkin = CheckIn.find_last_by_user_id(@profile.user_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profile }\n end\n end",
"def show\n @profile = current_user.profile\n\n # ToDo: error message if no profile is found for user\n\n puts 'Got profile='\n pp @profile\n \n\n puts 'got other_names='\n pp @profile.other_names\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile }\n format.json { render :json => @profile }\n end\n \n end",
"def details\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n format.html # details.html.erb\n format.json { render json: @profile }\n end\n end",
"def index\n @profiles = Profile.all\n\n end",
"def index\n @profiles = current_user\n end",
"def index \n @profiles = Profile.all\n end",
"def profile\n @oneuser = User.find_by(username: params[:username]) \n profile = user_profile(@oneuser.id, @oneuser.username, @oneuser.email, @oneuser.first_name, @oneuser.last_name, @oneuser.avatar_img, @oneuser.created_at) \n render json: profile\n end",
"def show\n @private_profile = PrivateProfile.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @private_profile }\n end\n end",
"def user_profile(id)\n users(request(\"users/profile/#{id}.xml\", :auth => true))\n end",
"def index\r\n @profiles = Profile.all\r\n end",
"def index\r\n @profiles = Profile.all\r\n end",
"def index\n @profiles = Profile.all\n end",
"def users_profile\n @usersProfile = User.find(params[:id]).to_json(:include => :user_connections)\n render json: { data: @usersProfile }\n end",
"def find_profile\n\t\t# Find particular Profile \n\t\t@profile = Profile.where(id:params[:id])[0]\n\t\trender json: {success: false, message: 'Invalid Profile ID !'}, status: 400 if @profile.nil?\n\tend",
"def profile\n @profile ||= GATEWAY.get_profile_details(self.profile_id) unless profile_id.nil?\n end",
"def get_profile\n begin\n client.profile(fields: PROFILE_FIELDS)\n rescue Exception => e\n logger.error \"Linkedin #get_profile error #{e}\"\n end\n end",
"def profile\n render_json 0,\"ok\",current_member.as_profile\n end",
"def show\n @profiles = @grab.profiles\n end",
"def show_current\n user = current_user\n profile = Profile.find_by user_id: user.id\n\n render json: profile\n end",
"def profile\n if object = send(:\"current_#{resource_name}\")\n self.resource = resource_class.to_adapter.get!(object.to_key)\n respond_with self.resource\n else\n render json: '', status: 404\n end\n end",
"def get_profile_information\n # body = {\n # cmd: \"get_profile_information\"\n # }\n\n end",
"def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend",
"def getUserProfile(uid)\r\n uri = sprintf(\"/api/v1/users/%d/profile\",uid)\r\n dbg(uri)\r\n profile = $canvas.get(uri)\r\n return profile\r\nend",
"def show\n \t@profile = Profile.where(profile_name: params[:id]).first\n end",
"def profile\n service_response = UserManagement::ProfileDetail.new(params).perform\n render_api_response(service_response)\n end",
"def profile(profile_id, fields: nil)\n check_not_empty profile_id, 'profile_id'\n params = build_fields_params fields\n res = @connection.get profile_path(profile_id), params\n Profile.new res.body, self\n end",
"def profile\n @user = UserService.getUserById(params[:id])\n end",
"def profile\n # (1) the request go into the headers and grab the key authorization and give us the value back (this's the token our server gave us originally)\n # the server only knows about the system\n # byebug/\n token = request.headers[\"Authorization\"]\n # what makes it secure? only the server knows about the secret 'pegasuscode'; the data is encoded using this secret, only server knows it so when server gets the information back, it must be the same information server encoded using the secret. Otherwise, it will break.\n # server uses the secret to encode and decode information\n decoded_token = JWT.decode(token, 'pegasuscode', true, { algorithm: 'HS256' })\n\n user_id = decoded_token[0][\"user_id\"] # user id\n\n user = User.find(user_id)\n\n # get the user back\n render json: user\n end",
"def profiles(fields: nil)\n params = build_fields_params fields\n res = @connection.get profile_path, params\n map_as_collection res, Profile\n end",
"def index\n @skill_user_profiles = SkillUserProfile.all\n\n render json: @skill_user_profiles\n end",
"def get_user_detail\n user_id = params[:id]\n user = User.find(user_id)\n\n render json: UserSerializer.new(user).profile_detail_hash\n end",
"def index\n @github_profiles = GithubProfile.all\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_profile }\n end\n end",
"def show\n @providers = @profile.providers_data\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @profile }\n end\n end",
"def show\n @profile = @user.profile\n end",
"def get_profile\n\n # Auth\n token = auth\n\n # Get Client info based on fields provided\n client = LinkedIn::Client.new(API_KEY, API_SECRET, token)\n client.profile(:fields => @profile_fields)\n end",
"def get_profile\n self.class.get '/members/private', @options\n end",
"def profile\n @user = User.find(params[:id])\n end",
"def show\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile_attribute }\n format.json { render :json => @profile_attribute }\n end\n end",
"def profile_url\n @json['profile']['url'] rescue nil\n end",
"def user\n\n \n @profile = Profile.find_by_user_id(params[:id])\n\n\nend",
"def profile\n\n end",
"def show\n @profile = Profile.find(params[:id]) || current_user.profile\n end",
"def profile\n \t@user = UsersService.findUserById(params[:id])\n end",
"def index\n @profiles = Profile.all\n respond_to do |format|\n format.html\n format.json do\n @profiles = Profile.near(\n [\n current_user.profile.latitude,\n current_user.profile.longitude\n ], params[:radius]\n ).distinct\n @profiles = @profiles.where.not(id: current_user.profile.id)\n @profiles = @profiles.min_age(params[:min_age]) if params[:min_age].present?\n @profiles = @profiles.max_age(params[:max_age]) if params[:max_age].present?\n @profiles = @profiles.by_gender(params[:gender]) if params[:gender].present?\n @profiles = @profiles.by_activity(params[:activity])\n\n render json: @profiles.map{|profile| profile.attributes.merge(image: profile.image.url(:medium))}\n end\n end\n end"
] | [
"0.7775192",
"0.749174",
"0.7487005",
"0.7365681",
"0.73053837",
"0.730274",
"0.7301948",
"0.72442514",
"0.72312385",
"0.72312385",
"0.72312385",
"0.7217105",
"0.7217105",
"0.71651936",
"0.71406406",
"0.71140933",
"0.707894",
"0.7045284",
"0.701664",
"0.69901544",
"0.6978521",
"0.6962739",
"0.69494796",
"0.694837",
"0.69436747",
"0.6939894",
"0.6938486",
"0.6930165",
"0.68933207",
"0.68899614",
"0.6877104",
"0.6876668",
"0.68707955",
"0.68064415",
"0.68064415",
"0.68064415",
"0.68064415",
"0.68064415",
"0.68064415",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6799769",
"0.6792336",
"0.6792336",
"0.6784594",
"0.67775995",
"0.67466736",
"0.67327726",
"0.6731769",
"0.6725357",
"0.67211384",
"0.6711643",
"0.670597",
"0.670597",
"0.6693201",
"0.66872925",
"0.6683526",
"0.6673759",
"0.6670222",
"0.6668304",
"0.66665876",
"0.66657776",
"0.6663294",
"0.66614413",
"0.6659211",
"0.6659211",
"0.66287506",
"0.6614315",
"0.66118926",
"0.65992856",
"0.6598246",
"0.65974706",
"0.6585762",
"0.6561011",
"0.65553385",
"0.6548105",
"0.65348506",
"0.6530548",
"0.6510188",
"0.6507686",
"0.64951384",
"0.6482705",
"0.6478008",
"0.6470358",
"0.6458661",
"0.6458303",
"0.6448591",
"0.64452636"
] | 0.0 | -1 |
POST /profiles POST /profiles.json | def create
params[:profile][:tag_list] = params[:profile][:tag_list]
@profile = Profile.new(profile_params)
@profile.user_id = current_user.id
# Store friendly profile URI
current_user.profile_uri = getUniqueURI(current_user)
current_user.save
respond_to do |format|
if @profile.save
format.html { redirect_to profile_path(@profile), notice: 'Profile was successfully created.' }
format.json { render :show, status: :created, location: @profile }
else
format.html { render :new }
format.json { render json: @profile.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n @profile = current_user.profiles.build(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n if @profile.save\n render json: @profile, status: :created\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end",
"def create\n @profile = Profile.create({\n name: params['profile']['name'],\n speciality: params['profile']['speciality'],\n city: params['profile']['city'],\n user_id: current_user['id']\n })\n @profile.save\n respond_with(@profile)\n end",
"def create\n logger.info(\"CREATE PROFILE #{params[:profile].inspect}\")\n @profile = Profile.new(params[:profile])\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n @profile.profile_id = UUIDTools::UUID.timestamp_create().to_s\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_created) }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => 'Profile was successfully created.' }\n format.json { render :json => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @profiles = current_user.profiles.new(profile_params)\n\n if @profiles.save\n redirect_to profiles_path, notice: 'Profile was successfully created.'\n else\n render :new\n end\n end",
"def create\n # Buidles a profile in association witht eh user\n @user = User.find(current_user.id)\n @profile = @user.build_profile(params[:user])\n @profile.update_attributes(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: t('controller.profiles.create.success') }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n respond_to do |format|\n if @profile.save\n format.html do\n redirect_to @profile, notice:\n \"Profile was successfully created.\"\n end\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json do\n render json: @profile.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to '/', notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = current_user.build_profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => 'Profile was successfully created.' }\n format.json { render :json => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n @profile.user = current_user\n \n respond_to do |format|\n if @profile.save\n \n # Get photos directly from the params and save them to the database one by one\n if params[:profile][:photos]\n params[:profile][:photos].each { |photo|\n ProfilePhoto.create!(profile: @profile, photo: photo)\n }\n end\n \n format.html { redirect_to @profile, notice: 'profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.save\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @profile = Profile.new(profile_params)\r\n\r\n respond_to do |format|\r\n if @profile.save\r\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\r\n format.json { render :show, status: :created, location: @profile }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @profile.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to quit_user_profile_path, notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n format.html { redirect_to manage_profile_path(@profile), notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.my_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profiles_path, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = current_user.build_profile(pro_params)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { redirect_to new_profile_path, alert: 'Please fill all fields' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = @account.build_profile(profile_attributes)\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to root_path, notice: 'Анкета успешно сохранена. Ваш магазин добавлен в очередь на оптимизацию.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n \n @profile.user_id = current_user.id\n @profile.full_name = @profile.first_name + @profile.last_name\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, :notice => t('alerts.profiles.create') }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user=current_user\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # TO DO: make this for just generic creation.\n @profile = Profile.find_by_email(params[:profile][:email])\n @profile.user_id = current_user.id\n\n if @profile.nil?\n @profile = Profile.new(params[:profile])\n add_to_list_niche(params[:profile][:fname], params[:profile][:email], params[:profile][:niche], list_id=ENV[\"MAILCHIMP_LISTID\"])\n @profile.save\n else\n @profile.update_attributes(params[:profile])\n end\n\n redirect_to profiles_path, notice: 'Profile was successfully created.' \n # format.json { render json: @profile, status: :created, location: @profile }\n end",
"def create\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n authorize! :create, @profile\n \n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @security_profile = Security::Profile.new(security_profile_params)\n @security_profile.user_created_id = current_user.id\n respond_to do |format|\n if @security_profile.save\n format.html { redirect_to security_profiles_path, notice: I18n.t('profiles.controller.create')}\n format.json { render :show, status: :created, location: @security_profile }\n else\n format.html { render :new }\n format.json { render json: @security_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_profile = UserProfile.new(params[:user_profile])\n\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render json: @user_profile, status: :created, location: @user_profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_profile = UserProfile.new(params[:user_profile])\n\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render json: @user_profile, status: :created, location: @user_profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_to do |format|\n @profile = current_user.create_profile(params[:profile])\n if @profile \n format.html { redirect_to(profile_url(@profile.user_id), :notice => 'Profile was successfully created.') }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n profile = Payments::Profile.new(profile_params)\n profile.user = current_user\n\n respond_to do |format|\n if profile.save\n format.html {redirect_to payments_profiles_path}\n else\n format.html {redirect_to :back, flash: {error: \"Error saving payment profile\"}}\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n current_user.profile = Profile.new(params[:profile])\n @profile = current_user.profile\n\n if [email protected]?\n flash[:error_created] = @profile.errors.full_messages.join(\"<br>\").html_safe\n redirect_to new_user_profile_path(current_user)\n else\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path(current_user), notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end \n end\n end",
"def create\n @userprofile = Userprofile.new(userprofile_params)\n\n respond_to do |format|\n if @userprofile.save\n format.html { redirect_to @userprofile, notice: 'Userprofile was successfully created.' }\n format.json { render :show, status: :created, location: @userprofile }\n else\n format.html { render :new }\n format.json { render json: @userprofile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_profile\n new_profile = Profile.new\n new_profile.user_id = self.id\n new_profile.save!\n end",
"def create\n if current_user.profile.nil?\n profile = Profile.new(profile_params)\n profile.user = current_user\n if profile.save\n redirect_to profiles_path\n return\n end\n end\n redirect_to profiles_path\n end",
"def create\n \n @user.profile = Profile.new(params[:profile])\n if params[:goal_worth]\n @goal = @user.goals.create do |g|\n g.goal_type = \"recurring\"\n g.started_on = Date.today\n g.name = \"What my time is worth\"\n g.goal_amount_score = params[:goal_worth].to_i\n end\n else\n @goal = nil\n end\n \n respond_to do |format|\n \n if @user.profile && @goal\n \n format.html { redirect_to user_profiles_path, notice: 'Profile was successfully created.' }\n format.json { render json: @profile, status: :created, location: @profile }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n user = User.find(params[:user_id])\n @profile = Profile.new(params[:profile])\n @profile.user = user\n\n if @profile.save\n redirect_to user_profile_path(params[:user_id])\n else\n flash[:alert] = @profile.errors.full_messages.join(\",\")\n render :template => \"profiles/new\"\n end\n\n end",
"def create\n @profile = Profile.new(req_params)\n if @profile.save\n redirect_to new_partnership_path(p_id: @profile.id)\n else\n flash[:profile_attempt] = req_params\n respond_with_submission_error(@profile.errors.messages, new_dummy_profile_path)\n end\n end",
"def add_profile(post, profile)\n post[:profile] = profile\n post[:profileupdate] = 'Y'\n end",
"def create\n @admin_profile = Admin::Profile.new(admin_profile_params)\n\n respond_to do |format|\n if @admin_profile.save\n unless params[:admin_profile][:avatar].blank?\n preloaded = Cloudinary::Uploader.upload(params[:admin_profile][:avatar], :use_filename => true, :public_id => \"profiles/#{@admin_profile.id}\")\n end\n\n unless params[:admin_profile][:profile_skills_attributes].blank?\n params[:admin_profile][:profile_skills_attributes].each do |skill|\n admin_skill = Admin::ProfileSkill.create({profile_id: @admin_profile.id, name: skill[1][:name], skill: skill[1][:skill]})\n admin_skill.save\n end\n end\n\n unless params[:admin_profile][:profile_hobbies_attributes].blank?\n params[:admin_profile][:profile_hobbies_attributes].each do |hobby|\n admin_hobby = Admin::ProfileHobby.create({profile_id: @admin_profile.id, name: hobby[1][:name]})\n admin_hobby.save\n end\n end\n\n format.html { redirect_to admin_root_path, notice: 'Profile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @admin_profile }\n else\n format.html { render action: 'new'}\n format.json { render json: @admin_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n Userprofile.create(\"name\" => params[\"full_name\"], \"photo_url\" => params[\"url\"])\n redirect_to \"/userprofiles\"\n end",
"def set_profile(profile_contents)\n path = self.api_root + '/register/profile'\n process_firecloud_request(:post, path, profile_contents.to_json)\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n flash[:notice] = 'Profile was successfully created.'\n format.html { redirect_to profile_url(@profile) }\n format.xml { head :created, :location => profile_url(@profile) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors.to_xml }\n end\n end\n end",
"def create\n \t@profile = Profile.new(profile_params)\n\n \trespond_to do |format|\n if @profile.save\n UserMailer.delay.registration_confirmation(@profile)\n format.json { render action: 'show', status: :create, location: @profile }\n else\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_profile = UserProfile.new(user_profile_params)\n\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render :show, status: :created, location: @user_profile }\n else\n format.html { render :new }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def my_profiles\n @user = User.find(params[:user_id])\n @profiles = @user.profiles\n end",
"def create\n @profile = Profile.new(profile_params)\n if params['internal_setting_ids'].present?\n params['internal_setting_ids'].each do |internal_setting_id|\n @profile_internal_setting = @profile.profile_internal_settings.build(:internal_setting_id => internal_setting_id)\n @profile_internal_setting.save\n end \n end\n\n if params['email_access_ids'].present?\n params['email_access_ids'].each do |email_access_id|\n @profile_email_access = @profile.profile_email_accesses.build(:email_access_id => email_access_id)\n @profile_email_access.save\n end \n end\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user_id = current_user.id\n\n respond_to do |format|\n if @profile.save\n good_change(format, :created)\n else\n bad_change(format, :new)\n end\n end\n end",
"def create\n @user_profile = UserProfile.new(user_profile_params) \n\n respond_to do |format| \n if @user_profile.save\n format.html { redirect_to @user_profile, notice: 'User profile was successfully created.' }\n format.json { render :show, status: :created, location: @user_profile }\n else\n format.html { render :new }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile_user = ProfileUser.new(profile_user_params)\n\n respond_to do |format|\n if @profile_user.save\n format.html { redirect_to @profile_user, notice: 'Profile user was successfully created.' }\n format.json { render :show, status: :created, location: @profile_user }\n else\n format.html { render :new }\n format.json { render json: @profile_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @github_profile = GithubProfile.new(github_profile_params)\n\n respond_to do |format|\n if @github_profile.save\n format.html { redirect_to @github_profile, notice: 'Github profile was successfully created.' }\n format.json { render :show, status: :created, location: @github_profile }\n else\n format.html { render :new }\n format.json { render json: @github_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n flash[:notice] = 'Profile was successfully created.'\n format.html { redirect_to(@profile) }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n flash[:notice] = 'Profile was successfully created.'\n format.html { redirect_to(@profile) }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n\n respond_to do |format|\n if @profile.save\n flash[:notice] = 'Profile was successfully created.'\n format.html { redirect_to(@profile) }\n format.xml { render :xml => @profile, :status => :created, :location => @profile }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def profile_params\n params.require(:profile).permit(:user_id, :name, :surname, :age, :profile_picture, :gender, :relationship_status)\n end",
"def create\n @cleaners_profile = Cleaners::Profile.new(cleaners_profile_params)\n\n respond_to do |format|\n if @cleaners_profile.save\n format.html { redirect_to after_signup_path(:preference) }\n format.json { render action: 'show', status: :created, location: @cleaners_profile }\n else\n format.html { render action: 'new' }\n format.json { render json: @cleaners_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n\n @user = current_user\n\n @user.profile = @profile\n @profile.save\n\n\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to profile, notice: 'Profile was successfully created.' }\n format.json { render :show, profile: :created, location: profile }\n @profile.create(profile_image: image)\n\n else\n format.html { render :new }\n format.json { render json: status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @representative_profile = RepresentativeProfile.new(representative_profile_params)\n\n respond_to do |format|\n if @representative_profile.save\n format.html { redirect_to @representative_profile, notice: 'Representative profile was successfully created.' }\n format.json { render :show, status: :created, location: @representative_profile }\n else\n format.html { render :new }\n format.json { render json: @representative_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(params[:profile])\n @profile.user = current_user\n respond_to do |format|\n if @profile.save\n flash[:notice] = t('profiles.new.success')\n format.html { redirect_to(@user) }\n format.xml { render :xml => @profile, :status => :created, :location => @user }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @personal_profile = PersonalProfile.new(personal_profile_params)\n @personal_profile.user_id=current_user.id\n respond_to do |format|\n if @personal_profile.save\n format.html { redirect_to resume_path, notice: 'Personal profile was successfully created.' }\n format.json { render :show, status: :created, location: resume_path }\n else\n format.html { render :new }\n format.json { render json: @personal_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @profile = Profile.new\n @profile.build_user\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @profile }\n end\n end",
"def profile_params\n params.require(:profile).permit(:name, :bio, :country_id, :picture, interest_ids: [])\n end",
"def profiles \n personid = params[:id]\n @response = JSON.parse(current_user.access_token.token.get('/api/v0/aspects/profiles?ids=['+params[:id]+']'))\n respond_to do |format|\n format.html\n format.json {render :json=> @response, :callback=>params[:callback]}#{render json: @response}\n end\n end",
"def update_profile(params)\n post 'account/update_profile', :post => params\n end",
"def create_profile\n Profile.create(user_id: self.id)\n end",
"def create\n respond_to do |format|\n if @user_profile.save\n format.html { redirect_to @user_profile, :notice => 'Корисничкиот профил е успешно создаден.' }\n format.json { render :json => @user_profile, :status => :created, :location => @user_profile }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user_profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend",
"def create\n @client_profile = ClientProfile.new(client_profile_params)\n\n respond_to do |format|\n if @client_profile.save\n format.json { render :show, status: :created, location: @client_profile }\n else\n format.json { render json: @client_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user_profile = UserProfile.new(user_profile_params)\n\n respond_to do |format|\n if @user_profile.save\n flash[:success] = 'User profile was successfully created.'\n format.html { redirect_to @user_profile}\n format.json { render :show, status: :created, location: @user_profile }\n else\n flash[:danger] = \"There are some mistakes, please try again\"\n format.html { render :new }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n authorize Profile\n @profiles = ProfilePolicy::Scope.new(current_user, @user.profiles).resolve\n render json: @profiles\n end",
"def create\n @profile = Profile.new(profile_params)\n @profile.user = current_user\n @profile.site_identifier = params[:profile][:site_identifier]\n\n respond_to do |format|\n if @profile.save\n# current_user.default_profile = @profile\n set_banner\n format.html do\n redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: profile_home_path(@profile.site_identifier) }\n else\n format.html { render action: 'new' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @profile = Profile.new(profile_params)\n authorize @profile\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to @profile, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :created, location: @profile }\n else\n format.html { render :new }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Ensure that we have the right user\n @user = User.find( params[:user_id] )\n # Create profile linked to this specific user\n @profile = @user.build_profile( profile_params )\n @profile.save\n if @profile.save\n flash[:success] = \"Profile updated!\"\n # TODO: Redirect to profile page, once there is one. \n redirect_to user_path(params[:user_id])\n else\n # TODO: don't dump the user's inputs if save to database fails. \n render action: :new\n end\n end",
"def create\n assign_params_to_attributes\n @profile = Profile.new(params[:profile])\n @profile.user_id = current_user.id\n if @profile.save\n flash[:notice] = I18n.t('profile.create.notice')\n redirect_to user_path(current_user)\n else\n @user = current_user\n assing_attributes_to_params\n flash.now[:error] = I18n.t('profile.create.error')\n render :action => \"new\"\n end\n end"
] | [
"0.73701555",
"0.7367171",
"0.72288865",
"0.71786684",
"0.7172963",
"0.7170674",
"0.71145105",
"0.7096289",
"0.707034",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.7002038",
"0.6997514",
"0.69700205",
"0.69617796",
"0.6937631",
"0.6937631",
"0.6937631",
"0.6937631",
"0.6937631",
"0.6937631",
"0.6937631",
"0.6937631",
"0.69146293",
"0.69033545",
"0.6885607",
"0.68802375",
"0.6870222",
"0.68624455",
"0.6859433",
"0.6858937",
"0.6858937",
"0.6858937",
"0.6835788",
"0.683444",
"0.683444",
"0.6829081",
"0.68168384",
"0.6766037",
"0.67580324",
"0.6755173",
"0.6739768",
"0.6721227",
"0.66896856",
"0.6656213",
"0.6624241",
"0.66153675",
"0.6593402",
"0.658363",
"0.658363",
"0.6582606",
"0.65731853",
"0.6565113",
"0.6556708",
"0.65421325",
"0.6523615",
"0.6523474",
"0.65118587",
"0.649321",
"0.6491338",
"0.6482218",
"0.6480695",
"0.6472119",
"0.6464902",
"0.6459156",
"0.6436519",
"0.6423614",
"0.6421916",
"0.638889",
"0.63844866",
"0.63807064",
"0.6350672",
"0.6344352",
"0.6339668",
"0.6339668",
"0.6339668",
"0.6338429",
"0.63312715",
"0.63294077",
"0.63256717",
"0.6323012",
"0.63147956",
"0.6311688",
"0.62725914",
"0.62598944",
"0.62459344",
"0.624297",
"0.6238812",
"0.6235083",
"0.6233593",
"0.62270284",
"0.6220057",
"0.6217489",
"0.62169695",
"0.6204191",
"0.6203904"
] | 0.68550336 | 37 |
PATCH/PUT /profiles/1 PATCH/PUT /profiles/1.json | def update
respond_to do |format|
if @profile.update(profile_params)
format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }
format.json { render :show, status: :ok, location: @profile }
else
format.html { render :edit }
format.json { render json: @profile.errors, status: :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update\n @profiles = current_user.profiles.find(params[:id])\n\n respond_to do |format|\n if @profiles.update(profile_params)\n format.html { redirect_to profiles_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profiles }\n else\n format.html { render :edit }\n format.json { render json: @profiles.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n logger.debug(\"UPDATE PROFILE @profile = #{@profile.inspect}\")\n logger.debug(\"UPDATE PROFILE params = #{params[:profile].inspect}\")\n logger.debug(\"UPDATE PROFILE update_attributes #{@profile.update_attributes(params[:profile]).inspect}\")\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile.update(profile_params)\n respond_with(@profile)\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to edit_profile_path(current_user.profile), notice: t('controller.profiles.update.success') }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to vanity_profile_path(:id => @profile.user.name), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, :notice => 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to user_path, notice: 'Profile was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_profile(body={})\n perform_post(\"/account/update_profile.json\", :body => body)\nend",
"def update\n if user_signed_in?\n if @profile.update(profile_params)\n render json: @profile, status: :ok\n else\n render json: @profile.errors, status: :unprocessable_entity\n end\n end\n end",
"def update\n @profile = Profile.find(current_user.id)\n @profile.update_attributes(params[:profile])\n respond_with @profile\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n Rails.logger.info(\"PARAMS: #{profile_params}\")\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to (user_profile_path(current_user)), notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n #format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n #format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to root_url, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@profile = UsersDisciplines.find(params[:id])\n @profile = Profile.find_by_user_id(current_user.id)\n \n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to users_profile_index_path, notice: t(:profile_successfully_updated) }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to root_path, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n new_properties = params[:d]\n profile = Profile[params[:id]]\n profile.update_with(new_properties)\n\n respond_with(profile) do |format|\n format.json { render json: profile.stripped }\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to '/', notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to edit_profile_path(), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html do\n redirect_to @profile,\n notice: \"Profile was successfully updated.\"\n end\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json do\n render json: @profile.errors,\n status: :unprocessable_entity\n end\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(profile_attributes)\n format.html { redirect_to root_path, notice: 'Анкета успешно обновлена.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n params = profile_params\r\n params.delete(\"id\")\r\n params.delete(\"user\")\r\n respond_to do |format|\r\n if @profile.update(params)\r\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @profile }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @profile.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n current_user.admin? ? true : params[:profile][:id] = current_user.id\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n current_user.admin? ? true : params[:profile][:id] = current_user.id\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\r\n respond_to do |format|\r\n if @profile.update(profile_params)\r\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @profile }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @profile.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n good_change(format, :ok)\n else\n bad_change(format, :edit)\n end\n end\n end",
"def update\n @profile = @user.profile \n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = t('profiles.new.success')\n format.html { redirect_to(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def assign_default_profile(args = {}) \n put(\"/profiles.json/#{args[:profileId]}/default\", args)\nend",
"def update_profile! (data = {})\n check_auth :update\n \n response = connection.put do |req|\n req.url '/user/update'\n req.body = { :format => @format }.merge(data)\n end\n response\n end",
"def update\n @profile = @user.profile\n @profile.update_attributes(params[:profile])\n if params[\"starting\"] == \"pending\"\n @profile.started_on = nil\n @profile.target_completion_date = nil\n end\n\n respond_to do |format|\n if @profile.save\n format.html { redirect_to user_profile_path, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update_attributes profile_params\n format.html { redirect_to(@profile, notice: 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n @original_profile = Profile.find(@profile.id)\n format.html { render action: \"edit\" }\n format.xml { render xml: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@user = current_user\n\t\t@profile = @user.profile\n\t\[email protected]_columns(profile_params)\n\t\trespond_with @profile \n\tend",
"def update\n respond_to do |format|\n if @profile.update(pro_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n # This must be update_attributes, to do validations\n if @profile.update(profile_params)\n format.html { redirect_to profile_home_path(@profile.site_identifier), notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find_by_user_id(current_user.id)\n authorize! :update, @profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update_attributes(profile_params)\n format.html {\n flash[:notice] = t('Profile was successfully update.')\n redirect_to home_path\n }\n format.json { render json: {ok: true}, status: :ok }\n else\n format.html { redirect_to profile_edit_url, notice: t('Profile not saved !') }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n @profile.photo.data.blank? ? @profile.photo.update_attributes(photo_type: 2) : @profile.photo.update_attributes(photo_type: 1)\n\n current_user.user_tries.last.state_machine.transition_to(:pending)\n format.html { redirect_to root_path, notice: 'Profile was successfully created.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to profile_path(@profile.user_id) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n \n # Get photos directly from the params and save them to the database one by one\n if params[:profile][:photos]\n params[:profile][:photos].each { |photo|\n ProfilePhoto.create(profile: @profile, photo: photo)\n }\n end\n \n format.html { redirect_to @profile, notice: 'profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def clear_default_profile \n put(\"/profiles.json/default/clear\")\nend",
"def update\n # FIXME There's probably a better way to manage STI.\n profile_params = (@profile.type == DeveloperProfile.to_s ? params[:developer_profile] : params[:contractor_profile])\n profile_params[:project_type_ids] ||= []\n\n respond_to do |format|\n if @profile.update_attributes(profile_params)\n format.html { redirect_to(profile_path(@profile), :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_profile(params)\n post 'account/update_profile', :post => params\n end",
"def update_profile(params)\n post('/account/update_profile.json', params)\n end",
"def update\n respond_to do |format|\n if @profile.update_attributes params[:profile]\n @profile.user.index!\n format.html { redirect_to get_stored_location, :notice => t('profile.profile_updated') }\n else\n format.html { render :action => :edit }\n end\n end\n end",
"def update\n @profile = current_user.profile\n respond_to do |format|\n if @profile\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(@profile, :notice => 'Profile was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n else\n format.html { render :text => \"You currently do not have a profile.\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to profile_path, notice: \"Book was successfully updated.\" }\n format.json { render profile_path, status: :ok, location: @profile }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @personal_profile.update(personal_profile_params)\n format.html { redirect_to resume_path, notice: 'Your Personal profile was successfully updated.' }\n format.json { render :show, status: :ok, location: resume_path }\n else\n format.html { render :edit }\n format.json { render json: @personal_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n if @user_profile.update_attributes(params[:user_profile])\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_profile = UserProfile.find(params[:id])\n\n respond_to do |format|\n if @user_profile.update_attributes(params[:user_profile])\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Din profil uppdaterades!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to [@stakeholder, @profile], notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: [@stakeholder, @profile] }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n # render :text => \"<pre>#{params.to_yaml}</pre>\" and return\n @profile = Profile.find(params[:id])\n # @profile = Profile.find_or_create_by_user_id(@user.id)\n unless params.empty?\n @profile.update_attributes(params[:profile])\n @profile.user.update_attributes(params[:user])\n end\n respond_to do |format|\n if @profile.errors.empty? && @profile.user.errors.empty?\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors + @profile.user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n authorize @profile\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to quit_user_profile_path , notice: \"Profile: #{I18n.t('helpers.saved')}\" }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n @profile.user_id = current_user.id\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to(show_user_path(current_user.username)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update_profile(body)\n post(\"user/#{user_id}/profile.json\", body)\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n format.js\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = current_user.profile\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = \"Ваш профиль успешно обновлён\"\n format.html { redirect_to(profile_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\t\t\n\t\t# Check to see if this user matches the profile, if not don't let them do anything\n\t\tif @profile.id != Profile.find_by_user_id(current_user.id).id\n \tredirect_to :permission_error\n end\n\t\t\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Your profile was successfully updated'\n format.html { render action: 'edit', notice: 'Profile was successfully updated' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n # byebug\n if @profile.update(profile_params)\n format.html { redirect_to vendor_path(current_user.username), notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @profile.update(profile_params)\n format.html { redirect_to @profile, notice: t(\"controller.shared.flash.update.notice\", model: pick_model_from_locale(:profile)) }\n format.json { render :show, status: :ok, location: @profile }\n else\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n current_user.profile.update_attributes(profile_params)\n redirect_to '/profiles'\n end",
"def update\n @profile_attribute = current_user.profile_attributes.find(params[:id])\n\n respond_to do |format|\n if @profile_attribute.update_attributes(params[:profile_attribute])\n format.html { redirect_to(@profile_attribute, :notice => 'Profile attribute was successfully updated.') }\n format.xml { head :ok }\n format.json { render :json => {:profile_attribute => @profile_attribute} }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile_attribute.errors, :status => :unprocessable_entity }\n format.json { render :json => {:error => @profile_attribute.errors.full_messages} }\n end\n end\n end",
"def update_profile\n \t@user = User.find_by_id(params[:id])\n \tif @user.nil?\n render :json => {:message => \"User not exists\"}, :status => :not_acceptable\n else\n \tbegin\n\t @user.update_attributes(params[:user])\n\t @user.save!\n\t render :json => {:success => true, :message => \"User updated\", :user =>@user}, :status => :ok\n\t rescue Exception => e\n\t \tp e.backtrace\n\t render :json => {:success => false, :message => e.backtrace}, :status => :not_acceptable\n\t end\n end\n end",
"def update\n respond_to do |format|\n if @client_profile.update(client_profile_params)\n format.json { render :show, status: :ok, location: @client_profile }\n else\n format.json { render json: @client_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :update, @profile\n respond_to do |format|\n if @user.update_attributes(params[:user].permit(:username)) && @profile.update_attributes(profile_params)\n format.html { redirect_to @profile, notice: 'Profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render \"edit\" }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # puts \"profile_params: #{profile_params[:sport_ids]}\"\n\n respond_to do |format|\n begin\n if current_user != @profile.user\n performing_follow?\n @profile.user.toggle_followed_by(current_user)\n # the next two lines are all about the redirecting or the 'resheshing' of a page so that you can see the result of follow and unfollow without having to refresh.\n format.html { redirect_to @profile.user }\n format.json { render :show, status: :ok, location: @profile }\n end\n\n @profile.update(profile_params)\n # add skill objects and save to db\n # profile_params[:sport_ids].each do |sport_id|\n # Skill.create!(profile_id: @profile.user.id, sport_id: sport_id)\n # end\n format.html { redirect_to profile_url, notice: 'Profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @profile }\n rescue\n format.html { render :edit }\n format.json { render json: @profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find_by_user_id(params[:user_id])\n\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n flash[:notice] = 'Profile was successfully updated.'\n format.html { redirect_to profile_url(@profile) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors.to_xml }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n @profile.update_attributes(profile_params)\n @profile = Profile.all\n respond_to do |page|\n page.js\n end\n end",
"def update_profile(options = {}) \n # query profile info\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(URI_PROFILES, :params => { 'filter[name]' => options[:name] })\n if response.status.success?\n responseObj = JSON.parse(response.body)\n queried_profile_list = responseObj[\"data\"]\n if queried_profile_list.length() > 0\n profile = queried_profile_list[0]\n end\n else\n Asca::Tools::Log.error(response.body)\n return\n end\n \n if !profile\n Asca::Tools::Log.error(\"No profile named #{options[:name]} found\")\n return\n end\n # create new profile\n profile_type = profile[\"attributes\"][\"profileType\"]\n \n # get bundle id\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"bundleId\"][\"links\"][\"self\"])\n bundle_id = JSON.parse(response.body)[\"data\"][\"id\"]\n response = HTTP.auth('Bearer ' + Asca::Tools::Token.new_token).get(profile[\"relationships\"][\"certificates\"][\"links\"][\"self\"])\n certificate_ids = JSON.parse(response.body)[\"data\"].map { |cer| cer[\"id\"] }\n \n # get all device ids\n device_ids = Asca::REST::Provisioning::Devices.list_devices.map { |device|\n device[\"id\"]\n }\n \n # delete old prifile\n delete_profile :name => options[:name]\n \n if profile_type.include? 'APP_STORE'\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :certificate_ids => certificate_ids\n else\n create_new_profile :name => options[:name], :type => profile_type, :bundle_id => bundle_id, :device_ids => device_ids, :certificate_ids => certificate_ids\n end\n \n return true\n end",
"def update\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: 'User profile was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n\n if @profile.update_attributes(params[:profile])\n redirect_to @profile, notice: 'Profile was successfully updated.'\n else\n render action: \"edit\"\n end\n end",
"def update\n begin\n @profile.update!(metadata_profile_params)\n rescue => e\n render partial: \"shared/validation_messages\",\n locals: { object: @profile.errors.any? ? @profile : e },\n status: :bad_request\n else\n toast!(title: \"Profile updated\",\n message: \"The metadata profile \\\"#{@profile.name}\\\" has been \"\\\n \"updated.\")\n render \"shared/reload\"\n end\n end",
"def update\n @profile = Profile.find(params[:id])\n work_name\n respond_to do |format|\n if @profile.update_attributes(params[:profile])\n format.html { redirect_to(@profile, :notice => 'Profile ha sido modificado.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @profile.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @user_profile.update(user_profile_params)\n format.html { redirect_to @user_profile, notice: \"User profile was successfully updated.\" }\n format.json { render :show, status: :ok, location: @user_profile }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @user_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @profile.update(req_params)\n redirect_to show_path, notice: 'Profile was successfully updated.'\n else\n respond_with_submission_error(@profile.errors.messages, edit_path)\n end\n end",
"def create_or_update_profile_configuration(args = {}) \n id = args['profileId']\n temp_path = \"/profiles.json/{profileId}/configuration\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"profileId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend"
] | [
"0.7385554",
"0.7121749",
"0.7113102",
"0.7096679",
"0.7091465",
"0.7091465",
"0.7091465",
"0.7076842",
"0.707045",
"0.7063198",
"0.70600575",
"0.7022012",
"0.70120174",
"0.699651",
"0.6985236",
"0.6985236",
"0.6985236",
"0.6985236",
"0.6979028",
"0.697453",
"0.6968044",
"0.6967269",
"0.69600093",
"0.6953779",
"0.6948602",
"0.6928283",
"0.692623",
"0.6923915",
"0.69152933",
"0.69120854",
"0.6905072",
"0.6905072",
"0.6870408",
"0.6863119",
"0.68528676",
"0.68429637",
"0.6834663",
"0.682247",
"0.68176895",
"0.6814143",
"0.680932",
"0.68059534",
"0.6783105",
"0.6760196",
"0.6758649",
"0.6743165",
"0.67362434",
"0.67348063",
"0.67336524",
"0.67280525",
"0.6714092",
"0.6712624",
"0.6702015",
"0.6691855",
"0.6672218",
"0.6657492",
"0.6657492",
"0.665591",
"0.6652365",
"0.6643084",
"0.66245157",
"0.6615003",
"0.65870106",
"0.65640306",
"0.6560384",
"0.6551966",
"0.6543359",
"0.6539523",
"0.6537327",
"0.6534612",
"0.6533719",
"0.6527972",
"0.6524115",
"0.65115166",
"0.65014225",
"0.6499302",
"0.6497949",
"0.64870906",
"0.64701694",
"0.64701694",
"0.6459732",
"0.6457896",
"0.6442181",
"0.6436961",
"0.6430309",
"0.6425514"
] | 0.6940231 | 37 |
DELETE /profiles/1 DELETE /profiles/1.json | def destroy
@profile.destroy
respond_to do |format|
format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }
format.json { head :no_content }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :ok }\n end\n end",
"def destroy\n # @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_path, :notice => \"profile was successfully delete.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, :notice => t('alerts.profiles.destroy') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = current_user.profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \[email protected]\n\n \trespond_to do |format|\n \t\tprofiles = Profile.all\n \t\tformat.json { render json: profiles}\n \tend\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to root_path, notice: \"Profile was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n # @profile = Profile.find(params[:id])\n # authorize! :destroy, @profile\n\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: '*Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n end",
"def destroy\n raise params.inspect\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_profiles_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @profile.destroy\n @profile.requests.destroy_all\n @profile.member.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'El perfil fue eliminado exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to profiles_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user.profile.destroy\n respond_to do |format|\n format.html { redirect_to(profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to disciplines_url }\n format.json { head :ok }\n end\n end",
"def destroy\n # Delete profile\n @profil.destroy\n respond_to do |format|\n format.html { redirect_to profils_url, notice: 'Profil was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html do\n redirect_to profiles_url, notice:\n \"Profile was successfully destroyed.\"\n end\n format.json { head :no_content }\n end\n end",
"def destroy\n @users_profile = Users::Profile.find(params[:id])\n @users_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profile_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile = Profile.find(params[:id])\n @profile.destroy\n\n redirect_to profiles_url\n end",
"def destroy\r\n @profile.destroy\r\n respond_to do |format|\r\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @profile = @user.profile\n @profile.destroy\n\n respond_to do |format|\n format.html { redirect_to user_path(@user) }\n format.json { head :no_content }\n end\n #redirect_to user_path(@user)\n end",
"def destroy\n authorize @profile\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: \"Profile: #{I18n.t('helpers.deleted')}\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n redirect_to '/'\n end",
"def destroy\n @profile.destroy\n respond_with(@profile)\n end",
"def destroy\n @profile.destroy\n session[:profile_id] = nil\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to partnerships_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pay_profile = PayProfile.find(params[:id])\n @pay_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to pay_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @client_profile.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @personal_profile.destroy\n respond_to do |format|\n format.html { redirect_to resume_path, notice: 'Personal profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_profiles_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_profile.destroy\n respond_to do |format|\n format.html { redirect_to user_profiles_url, notice: 'User profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Perfil destruido correctamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @profile_detail.destroy\n respond_to do |format|\n format.html { redirect_to profile_details_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @admin_profile.destroy\n respond_to do |format|\n format.html { redirect_to admin_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if current_profile!=@profile\n redirect_to root_url, notice: 'Permission denied'\n end\n\n @profile.destroy\n respond_to do |format|\n format.html { redirect_to profiles_url, notice: 'Profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @private_profile = PrivateProfile.find(params[:id])\n @private_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to private_profiles_url }\n format.json { head :no_content }\n end\n end",
"def clear_default_profile \n put(\"/profiles.json/default/clear\")\nend",
"def destroy\n @project_profile.destroy\n respond_to do |format|\n format.html { redirect_to project_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n authorize @client_profile\n \n @client_profile.destroy\n respond_to do |format|\n format.html { redirect_to client_profiles_url, notice: 'Client profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @retailer_profile.destroy\n respond_to do |format|\n format.html { redirect_to retailer_profiles_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @userprofile.destroy\n respond_to do |format|\n format.html { redirect_to userprofiles_url, notice: 'Userprofile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @github_profile.destroy\n respond_to do |format|\n format.html { redirect_to github_profiles_url, notice: 'Github profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_profile = UserProfile.find(params[:id])\n @user_profile.destroy\n\n format.html { redirect_to(user_profiles_url) }\n end",
"def destroy\n @vet_profile.destroy\n respond_to do |format|\n format.html { redirect_to vet_profiles_url, notice: 'Vet profile was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @monitor_profile = MonitorProfile.find(params[:id])\n @monitor_profile.destroy\n\n respond_to do |format|\n format.html { redirect_to monitor_profiles_url }\n format.json { head :ok }\n end\n end"
] | [
"0.7739456",
"0.7739456",
"0.7739456",
"0.7707937",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.77065504",
"0.7706363",
"0.7704212",
"0.769637",
"0.7687797",
"0.7687588",
"0.7687588",
"0.76273435",
"0.7588475",
"0.75627995",
"0.75245315",
"0.7503449",
"0.75018144",
"0.7498817",
"0.7498817",
"0.74581385",
"0.74581385",
"0.7456729",
"0.7456729",
"0.7456729",
"0.7456729",
"0.7456729",
"0.7454245",
"0.742901",
"0.7427498",
"0.7422489",
"0.74219066",
"0.74209017",
"0.7410241",
"0.7405282",
"0.7403725",
"0.7402013",
"0.73968756",
"0.7396158",
"0.7385945",
"0.73832124",
"0.7320039",
"0.73195565",
"0.73191196",
"0.7318569",
"0.72908765",
"0.7288395",
"0.72759897",
"0.72652495",
"0.7219208",
"0.7190267",
"0.71853673",
"0.717773",
"0.7173035",
"0.7170404",
"0.71691376",
"0.7147211",
"0.71275276",
"0.7123824",
"0.71233344",
"0.71214837",
"0.7120485",
"0.7112716",
"0.70621276",
"0.7058789",
"0.70282286"
] | 0.74744916 | 52 |
Use callbacks to share common setup or constraints between actions. | def set_profile
if params[:id].to_i != 0
@profile = Profile.find(params[:id])
# @user = User.find(params[:id])
else
@user = User.find_by_profile_uri(params[:id])
end
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 set_actions\n actions :all\n end",
"def define_action_helpers?; 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 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 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 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 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 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 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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end",
"def default_action; end",
"def callback_phase\n super\n end",
"def advice\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",
"def shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def duas1(action)\n action.call\n action.call\nend",
"def _handle_action_missing(*args); end"
] | [
"0.6164095",
"0.6046031",
"0.5945298",
"0.59179014",
"0.58890367",
"0.58341795",
"0.5776118",
"0.5700777",
"0.5700777",
"0.5656277",
"0.56218207",
"0.5423995",
"0.5411516",
"0.5411516",
"0.5411516",
"0.5395004",
"0.53783494",
"0.53593004",
"0.53412604",
"0.534078",
"0.5332865",
"0.53135896",
"0.52999926",
"0.5297309",
"0.5296569",
"0.5261449",
"0.5247048",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52376497",
"0.52323204",
"0.52310973",
"0.523081",
"0.5225785",
"0.5219039",
"0.52136266",
"0.5208033",
"0.520763",
"0.5177365",
"0.5175224",
"0.5173357",
"0.5166104",
"0.5162502",
"0.51573396",
"0.5154547",
"0.5153531",
"0.51502854",
"0.51436496",
"0.5142863",
"0.51330835",
"0.5115634",
"0.5115634",
"0.511527",
"0.5109693",
"0.51076853",
"0.5093146",
"0.5090683",
"0.50829846",
"0.50819314",
"0.50670373",
"0.5055505",
"0.5053398",
"0.50504035",
"0.50504035",
"0.5037765",
"0.5027292",
"0.5024484",
"0.50150335",
"0.5014069",
"0.50022113",
"0.5001542",
"0.49981874",
"0.49915564",
"0.49915564",
"0.49880967",
"0.4982312",
"0.49787375",
"0.49786067",
"0.49687737",
"0.49676532",
"0.49602765",
"0.49565676",
"0.49550772",
"0.495342",
"0.49522525",
"0.49463704",
"0.49447197",
"0.49362713",
"0.49328062",
"0.49280638",
"0.49272856",
"0.4927058",
"0.49221697",
"0.4919526",
"0.49185994",
"0.49184805",
"0.49170163",
"0.49168405",
"0.49167764"
] | 0.0 | -1 |
Never trust parameters from the scary internet, only allow the white list through. | def profile_params
params.require(:profile).permit(:company_list, :industry_list, :tag_list, :image, :years_of_experience, :experience_level, :price, :portfolio_link, :linked_link, :location, :company, :title, :summary)
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 valid_params_request?; 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 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 valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def active_code_params\n params[:active_code].permit\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 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 valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\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 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 url_params\n params[:url].permit(:full)\n end",
"def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\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.6979893",
"0.6781746",
"0.6746611",
"0.6742344",
"0.6735229",
"0.6592651",
"0.65027124",
"0.6498011",
"0.648163",
"0.647716",
"0.64556813",
"0.64386255",
"0.63784456",
"0.63756156",
"0.636574",
"0.6319542",
"0.63004524",
"0.6299559",
"0.62925464",
"0.62923217",
"0.6289894",
"0.6289475",
"0.62831545",
"0.6242381",
"0.6240358",
"0.6217451",
"0.6214354",
"0.62098235",
"0.61918235",
"0.6177287",
"0.61755854",
"0.61712915",
"0.61620486",
"0.6151379",
"0.61510575",
"0.6145169",
"0.61207956",
"0.6115647",
"0.6107701",
"0.61030304",
"0.60909295",
"0.60797",
"0.60701567",
"0.6062068",
"0.60203075",
"0.60167485",
"0.60125494",
"0.6009718",
"0.6007027",
"0.6007027",
"0.6000283",
"0.59990394",
"0.5996995",
"0.59915864",
"0.59914654",
"0.59912056",
"0.5979621",
"0.596686",
"0.5959418",
"0.59585625",
"0.59583765",
"0.5958032",
"0.5952298",
"0.5951678",
"0.5941885",
"0.59378815",
"0.59376645",
"0.59376645",
"0.5933908",
"0.59302104",
"0.5924862",
"0.5923981",
"0.59165645",
"0.5909916",
"0.590986",
"0.5908378",
"0.5904956",
"0.5897421",
"0.58970135",
"0.5894611",
"0.5893914",
"0.58927566",
"0.5891277",
"0.5885355",
"0.58825094",
"0.58783555",
"0.58728755",
"0.58686864",
"0.5867015",
"0.58660764",
"0.58659357",
"0.5864526",
"0.58634263",
"0.5861585",
"0.5861255",
"0.5858771",
"0.58579147",
"0.5854071",
"0.5853147",
"0.58498794",
"0.58492327"
] | 0.0 | -1 |
GET /friend_invites GET /friend_invites.xml | def index
@friend_invites = FriendInvite.all
respond_to do |format|
format.html # index.html.erb
format.xml { render :xml => @friend_invites }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @user = User.find(params[:user_id]) \n @invitations = @user.invitations\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitations.to_xml }\n end\nend",
"def invitations\n\t\t@invits = current_user.receive_invites.order(\"id DESC\")\n\tend",
"def show\n @invite_friend = InviteFriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @invite_friend.to_xml }\n end\n end",
"def index\n @invitations = Invitation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"def index\n @invite_requests = InviteRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invite_requests }\n end\n end",
"def index\n @invites = Invite.find(:all, :conditions => \"to_user_id = #{current_user.id} or to_email = '#{current_user.email}'\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invites }\n end\n end",
"def index\n @invitations = Invitation.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitations.to_xml }\n end\n end",
"def invited\n self.class.find(friend_ids)\n end",
"def show\n @invites = Invite.all\n end",
"def index\n @invitations = @event.invitations.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"def friends(id)\n friends_data(request(\"users/friends/#{id}.xml\", :auth => true))\n end",
"def show\n @friend_invite = FriendInvite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friend_invite }\n end\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @inviteds = Invited.all\n end",
"def invitations\n @invitations = Invitation.pending_by_user(current_user.id)\n\n respond_to do |format|\n format.html\n end\n end",
"def index\n\t\t@user = User.find(params[:user_id])\n\t\t@order = @user.orders.find(params[:order_id])\n\t\t@invited_friends = @order.order_friend_invitations\n\t\t@invited_friends_ids = []\n\t\t@invited_friends.each do |inv|\n\t\t\t@invited_friends_ids << inv.user_id.to_i\n\t\tend\n\t\t@invited_friends = User.where(id: @invited_friends_ids)\n\tend",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index_invites\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.invited_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end",
"def received_invitations\n user = User.find(params[:user_id])\n @invitations = user.invitations\n\n render json: @invitations\n end",
"def index\n current_user = get_current_user\n @users = current_user.friends_list\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def index\n @invitations = Invitation.where(receiver_id: current_user.id)\n end",
"def index\n @friend_requests = FriendRequest.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def invited_users\n render json: @moot.list_users_can_vote\n end",
"def view_invitations\n @invitations = Invitation.all(:conditions => ['status = ?', 'pending'])\n end",
"def invites\n raise 'Tried to request invites from a non-server channel' unless server\n\n invites = JSON.parse(API::Channel.invites(@bot.token, @id))\n invites.map { |invite_data| Invite.new(invite_data, @bot) }\n end",
"def index\n @invitations = Invitation.all\n respond_with(@invitations)\n end",
"def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil)\n params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)\n users_request_client.get(\"userInvitations\", params)\n end",
"def index\n @invites = current_user.invites.where(is_declined: nil).all\n end",
"def group_invites\n @invites = GroupsController.group_invites current_user\n end",
"def show\n if params[:ids]\n ids = params[:ids].split(\",\")\n @invitation = Invitation.find_by_permalink(ids[0]) \n else\n @invitation = Invitation.find_by_permalink(params[:id]) \n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def index\n @invites = current_user.invites\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n session[:new_invite_error] = nil\n session[:new_invite_error_url] = nil\n end",
"def friend_requests\n get(\"users/requests\").requests\n end",
"def index\n @invitados = Invitado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitados }\n end\n end",
"def index\n @friendsofusers = Friendsofuser.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friendsofusers }\n end\n end",
"def friendships_incoming(options = {})\n @req.get(\"/1.1/friendships/incoming.json\", options)\n end",
"def index\n @invitations = Invitation.all\n end",
"def index\n @invitations = Invitation.all\n end",
"def index\n @invitations = Invitation.all\n end",
"def index\n # @invitations = Invitation.all\n end",
"def show\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @invitation.to_xml }\n end\nend",
"def index\n @invitations = Invitation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invitations }\n end\n end",
"def index\n\t\t@guild_invites = @guild.invites.order(\"id DESC\")\n\tend",
"def show\n @invite_request = InviteRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invite_request }\n end\n end",
"def invites(auth, server_id)\n MijDiscord::Core::API.request(\n :guilds_sid_invites,\n server_id,\n :get,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}/invites\",\n Authorization: auth\n )\n end",
"def index\n @invites = current_user.recieved_team_requests\n @sent = current_user.sent_team_requests\n end",
"def show\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def index\n @user_invitations = UserInvitation.all\n end",
"def index\n @invited_fiends = InvitedFiend.all\n end",
"def index\n if params[:story_id].present?\n @invitations = Story.find(params[:story_id]).invitations\n else\n @invitations = Invitation.find_by_email(@current_user.email)\n end\n render json: @invitations\n end",
"def show\n @notify = current_user.invited_members;\n @groups = Group.all\n @group = Group.new\n @group_s = Group.find(params[:id])\n @friends = @group_s.users\n render :index\n \n end",
"def index\n @teams = current_user.teams\n\n @team_invitations = current_user.team_invitations_as_receiver\n end",
"def show\n @invite_list = InviteList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite_list }\n end\n end",
"def index\n @list_invites = ListInvite.all\n end",
"def dogwalker_invited\n #@invitations = Invitation.invited_clients_email(params[:email]).select(:email)\n @invitations = Invitation.invitees(params[:email]).select(:email)\n logger.debug(\"@invitations.to_json = \" + @invitations.to_json)\n render json: {:invitations => @invitations }, :layout => false\n end",
"def invited_by\n self.class.find(inverse_friend_ids)\n end",
"def index\n # byebug\n if params[:requester] == \"sent\"\n @friend_requests = current_user.friend_requests_as_requester\n else\n @friend_requests = current_user.friend_requests_as_requested\n end\n filter_friend_requests\n end",
"def index\n @team = Team.find_by_id(params[:team_id])\n @invite_requests = @team.invite_requests\n end",
"def index\n @invitees = Invitee.all\n end",
"def index\n @invitees = Invitee.all\n end",
"def index\n @friends = Friend.all(:conditions=>{:created_by=>current_user.id})\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friends }\n end\n end",
"def invitestatuslist\n @inviteStatus = InviteStatus.find :all\n render :layout => 'plain'\n end",
"def pending_invited\n self.class.find(pending_friend_ids)\n end",
"def pending_invites\n list = []\n pending_contacts.links(:class=>\"s3d-bold s3d-regular-light-links\", :title=>/View/).each { |link| list << link.text }\n return list\n end",
"def index\n\t\t@users = Invitation.pending_users(params[:page])\n\tend",
"def index\n retrieve_and_develop_all_friendships\n end",
"def index\n @team_invites = TeamInvite.where(team: current_team)\n end",
"def new_invites\n self.invites.all(:hide => false)\n end",
"def show\n user = User.find_by(id: params[:id]) #should use session id\n if user\n invitations = user.invitations\n if invitations\n render json: invitations, status: :ok\n else\n head :no_content\n end\n else\n render json: {error: \"User not found\"}, status: :not_found\n end\n end",
"def index\n @invitations = @event.invitations.to_a\n if @invitations.empty?\n redirect_to new_page_event_invitation_path(@page, @event)\n return\n end\n @summary = Invitation.summarize(@invitations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"def invite_facebook_friends\n end",
"def index\n @title = 'Invitations'\n @invitations = Invitation.all\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render json: @invitations }\n end\n end",
"def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.rhtml\n end\n end",
"def invitations\n res = []\n\n tmp = GoodData.get @json['project']['links']['invitations']\n tmp['invitations'].each do |invitation|\n res << GoodData::Invitation.new(invitation)\n end\n\n res\n end",
"def friends(options={})\n get('/friends', options)\n end",
"def invite_friend(opts)\n unless opts[:email] || opts[:user_id]\n raise InvalidArgumentError.new \"invite_friend hash argument must include :email or :user_id\"\n end\n translated_options = {}\n translated_options[:invitedUserEmail] = opts[:email] if opts[:email]\n translated_options[:invitedUserId] = opts[:user_id] if opts[:user_id]\n post(\"/user/#{@user_id}/friends/invitations.json\", translated_options)\n end",
"def tournaments\n get('sports/en/tournaments.xml')\n end",
"def invite_detail\n service_response = AdminManagement::AdminUser::GetInviteDetail.new(params).perform\n render_api_response(service_response)\n end",
"def show\n @invite = @event.invites.find(params[:id])\n end",
"def show\n @friendsofuser = Friendsofuser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friendsofuser }\n end\n end",
"def index\n @friends = @member.friends\n end",
"def invitable_users\n @title = \"Invitar usuario\"\n @invitable_users = GetInvitableUsers.call(@previa_group)\n end",
"def test_should_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :api_key=>'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response :created\r\n end",
"def friend_requests\n # Requires authorization\n raise PutioError::AuthorizationRequired if authentication_required!\n\n make_get_call('/friends/waiting-requests').friends\n end",
"def index\n @invitation_codes = InvitationCode.paginate :per_page => 25, \n :page => params[:page],\n :order => 'response_count DESC'\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitation_codes.to_xml }\n end\n end",
"def get_unissued_invites()\n User.find(session[:user_id]).unissued_invites\n end",
"def inverse_friends\n output = []\n inverse_friendships.each do |f|\n output << f.user\n end\n output\n end",
"def index\n @pending_friend_requests = PendingFriendRequest.all\n end",
"def index\n @invitations = Invitation.where(organization_id: current_user.organization_id).all\n end",
"def invite_people\n end",
"def show\n @friendship_sent_request = FriendshipSentRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friendship_sent_request }\n end\n end",
"def invitestatuslist\n @inviteStatus = InviteStatus.all\n render :layout => 'plain'\n end",
"def index\n @friend_requests = FriendRequest.all\n end",
"def friends_timeline(params = {})\n get \"statuses/friends_timeline\", params\n end"
] | [
"0.6916717",
"0.6844989",
"0.6743942",
"0.67401826",
"0.6720286",
"0.6709978",
"0.6675588",
"0.6666562",
"0.66264033",
"0.6612731",
"0.6605473",
"0.65979743",
"0.6590543",
"0.6590543",
"0.6590543",
"0.6590543",
"0.6590543",
"0.6574244",
"0.65320206",
"0.6421544",
"0.64167786",
"0.64167786",
"0.64167786",
"0.6400667",
"0.639436",
"0.6367214",
"0.6343902",
"0.63355106",
"0.63342977",
"0.63218653",
"0.62930185",
"0.627107",
"0.62710154",
"0.62556684",
"0.6242085",
"0.6241355",
"0.6232084",
"0.62134516",
"0.62121516",
"0.61975837",
"0.61654633",
"0.61646575",
"0.6162024",
"0.6162024",
"0.6162024",
"0.6152869",
"0.61433804",
"0.6111679",
"0.6104399",
"0.61040443",
"0.6095862",
"0.60875297",
"0.6062691",
"0.60259616",
"0.60109353",
"0.60069084",
"0.60029024",
"0.59971416",
"0.59859914",
"0.5958363",
"0.59581506",
"0.59566325",
"0.5956128",
"0.59554976",
"0.59367776",
"0.59367776",
"0.5933759",
"0.592696",
"0.5923303",
"0.59223837",
"0.5909172",
"0.5902842",
"0.58989614",
"0.5893713",
"0.5883368",
"0.5882798",
"0.5875955",
"0.58757395",
"0.58746225",
"0.58627576",
"0.5861004",
"0.58472776",
"0.58449876",
"0.58153325",
"0.580168",
"0.5801231",
"0.5799915",
"0.5799401",
"0.5798673",
"0.5791993",
"0.57771915",
"0.57701147",
"0.5768109",
"0.57669574",
"0.5764808",
"0.5759109",
"0.5758894",
"0.57384545",
"0.5736888",
"0.57354647"
] | 0.74392706 | 0 |
GET /friend_invites/1 GET /friend_invites/1.xml | def show
@friend_invite = FriendInvite.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @friend_invite }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"def show\n @invite_friend = InviteFriend.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @invite_friend.to_xml }\n end\n end",
"def friends(id)\n friends_data(request(\"users/friends/#{id}.xml\", :auth => true))\n end",
"def index\n @user = User.find(params[:user_id]) \n @invitations = @user.invitations\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitations.to_xml }\n end\nend",
"def index\n @invite_requests = InviteRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invite_requests }\n end\n end",
"def index\n @invites = Invite.find(:all, :conditions => \"to_user_id = #{current_user.id} or to_email = '#{current_user.email}'\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invites }\n end\n end",
"def index\n @invitations = Invitation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"def index\n @invitations = Invitation.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitations.to_xml }\n end\n end",
"def invited\n self.class.find(friend_ids)\n end",
"def show\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @invitation.to_xml }\n end\nend",
"def show\n @invite_request = InviteRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invite_request }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_requests }\n end\n end",
"def index\n @invitations = @event.invitations.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"def invitations\n\t\t@invits = current_user.receive_invites.order(\"id DESC\")\n\tend",
"def show\n if params[:ids]\n ids = params[:ids].split(\",\")\n @invitation = Invitation.find_by_permalink(ids[0]) \n else\n @invitation = Invitation.find_by_permalink(params[:id]) \n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def index\n current_user = get_current_user\n @users = current_user.friends_list\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @users }\n end\n end",
"def show\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def show\n @invites = Invite.all\n end",
"def index\n\t\t@user = User.find(params[:user_id])\n\t\t@order = @user.orders.find(params[:order_id])\n\t\t@invited_friends = @order.order_friend_invitations\n\t\t@invited_friends_ids = []\n\t\t@invited_friends.each do |inv|\n\t\t\t@invited_friends_ids << inv.user_id.to_i\n\t\tend\n\t\t@invited_friends = User.where(id: @invited_friends_ids)\n\tend",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @invites = Invite.all\n end",
"def index\n @friendsofusers = Friendsofuser.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friendsofusers }\n end\n end",
"def show\n @friendship_sent_request = FriendshipSentRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friendship_sent_request }\n end\n end",
"def index\n @inviteds = Invited.all\n end",
"def invitations\n @invitations = Invitation.pending_by_user(current_user.id)\n\n respond_to do |format|\n format.html\n end\n end",
"def show\n @friendsofuser = Friendsofuser.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friendsofuser }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invites = Invite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n end",
"def index\n @invitados = Invitado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitados }\n end\n end",
"def view_invitations\n @invitations = Invitation.all(:conditions => ['status = ?', 'pending'])\n end",
"def friend_requests\n get(\"users/requests\").requests\n end",
"def show\n @friend_request = FriendRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friend_request }\n end\n end",
"def show\n @friend_request = FriendRequest.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friend_request }\n end\n end",
"def index\n @friends = Friend.all(:conditions=>{:created_by=>current_user.id})\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friends }\n end\n end",
"def index\n @invitations = Invitation.where(receiver_id: current_user.id)\n end",
"def received_invitations\n user = User.find(params[:user_id])\n @invitations = user.invitations\n\n render json: @invitations\n end",
"def index_invites\n puts \"user: #{@current_user.json_hash[:id]}\"\n dinners = []\n @dinners = @current_user.invited_dinners\n @dinners.each do |dinner|\n dinners << dinner.all_info\n end\n render json: dinners\n end",
"def show\n @notify = current_user.invited_members;\n @groups = Group.all\n @group = Group.new\n @group_s = Group.find(params[:id])\n @friends = @group_s.users\n render :index\n \n end",
"def index\n @invitations = Invitation.all\n respond_with(@invitations)\n end",
"def friendships_incoming(options = {})\n @req.get(\"/1.1/friendships/incoming.json\", options)\n end",
"def show\n @invite_list = InviteList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite_list }\n end\n end",
"def show\n @invitation_code = InvitationCode.find(params[:id])\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @invitation_code.to_xml }\n end\n end",
"def index\n @invites = current_user.invites\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n session[:new_invite_error] = nil\n session[:new_invite_error_url] = nil\n end",
"def find_friendship(inviter, invited, status)\n conditions = {:inviter_id => inviter.id, :invited_id => invited.id}\n conditions.merge!(:status => status) if status\n Friendship.find(:first, :conditions => conditions)\n end",
"def index\n retrieve_and_develop_all_friendships\n end",
"def invited_by\n self.class.find(inverse_friend_ids)\n end",
"def index\n\t\t@guild_invites = @guild.invites.order(\"id DESC\")\n\tend",
"def friends\n @person = Person.find(params[:id]) \n @project = Project.find(params[:project_id]) \n @persons = @person.get_all_friends\n \n respond_to do |format|\n format.html # friends.html.erb\n format.xml { render :xml => @persons }\n end\n \n end",
"def index\n @friendships = @user.friendships\n\n respond_to do |format|\n format.html # index.rhtml\n end\n end",
"def index\n # @invitations = Invitation.all\n end",
"def index\n @invitations = Invitation.all\n end",
"def index\n @invitations = Invitation.all\n end",
"def index\n @invitations = Invitation.all\n end",
"def index\n # byebug\n if params[:requester] == \"sent\"\n @friend_requests = current_user.friend_requests_as_requester\n else\n @friend_requests = current_user.friend_requests_as_requested\n end\n filter_friend_requests\n end",
"def test_should_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :api_key=>'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response :created\r\n end",
"def query\n url = \"/statuses/friends_timeline.xml\"\n uri = URI.parse(@source.url+url)\n\n # Login authentication. The logic is taken from basecamp_projects.rb\n req = Net::HTTP::Get.new(uri.path, 'Accept' => 'application/xml')\n req.basic_auth @source.login, @source.password\n\n res = Net::HTTP.start(uri.host,uri.port) do |http|\n http.request(req)\n end\n xml_data = XmlSimple.xml_in(res.body); \n @result = xml_data[\"status\"]\n end",
"def index\n @invites = current_user.invites.where(is_declined: nil).all\n end",
"def index\n @team = Team.find_by_id(params[:team_id])\n @invite_requests = @team.invite_requests\n end",
"def show\n @invite = @event.invites.find(params[:id])\n end",
"def invite_detail\n service_response = AdminManagement::AdminUser::GetInviteDetail.new(params).perform\n render_api_response(service_response)\n end",
"def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friend }\n end\n end",
"def show\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friend }\n end\n end",
"def get_user_invitations(filter: {}, includes: nil, limit: nil, sort: nil)\n params = users_request_client.build_params(filter: filter, includes: includes, limit: limit, sort: sort)\n users_request_client.get(\"userInvitations\", params)\n end",
"def index\n @invitations = Invitation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invitations }\n end\n end",
"def invited_users\n render json: @moot.list_users_can_vote\n end",
"def group_invites\n @invites = GroupsController.group_invites current_user\n end",
"def pending_invited\n self.class.find(pending_friend_ids)\n end",
"def show\n @invite_status = InviteStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite_status }\n end\n end",
"def show\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite }\n end\n end",
"def show\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite }\n end\n end",
"def show\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite }\n end\n end",
"def show\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @invite }\n end\n end",
"def index\n @invites = current_user.recieved_team_requests\n @sent = current_user.sent_team_requests\n end",
"def show\n user = User.find_by(id: params[:id]) #should use session id\n if user\n invitations = user.invitations\n if invitations\n render json: invitations, status: :ok\n else\n head :no_content\n end\n else\n render json: {error: \"User not found\"}, status: :not_found\n end\n end",
"def invitestatuslist\n @inviteStatus = InviteStatus.find :all\n render :layout => 'plain'\n end",
"def index\n @invitation_codes = InvitationCode.paginate :per_page => 25, \n :page => params[:page],\n :order => 'response_count DESC'\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitation_codes.to_xml }\n end\n end",
"def show\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @friendship }\n end\n end",
"def friends\n @start = Time.now\n @users = current_user.friends.order(:name).page params[:page]\n\n respond_to do |format|\n format.html # friends.html.erb\n format.json { render :json => @users }\n format.xml { render :xml => @users }\n end\n end",
"def show\n @invier_acceso = InvierAcceso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invier_acceso }\n end\n end",
"def index\n @friends = @member.friends\n end",
"def show\n @inbound_email = InboundEmail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inbound_email }\n end\n end",
"def show\n @email_tracker = EmailTracker.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @email_tracker }\n end\n end",
"def index\n @friend_requests = FriendRequest.all\n end",
"def index\n @pending_friend_requests = PendingFriendRequest.all\n end",
"def invite_facebook_friends\n end",
"def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end",
"def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end",
"def show\n @participants = Participant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @participants }\n end\n end",
"def friends_timeline(params = {})\n get \"statuses/friends_timeline\", params\n end",
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def show\n @invitation = Invitation.find(params[:id])\n if @invitation.inviter_id != current_user.id\n redirect_to root_path \n else\n @tasks = @invitation.get_tasks\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @invitation }\n end\n end\n end",
"def friends(options={})\n get('/friends', options)\n end",
"def index\n @invitations = @event.invitations.to_a\n if @invitations.empty?\n redirect_to new_page_event_invitation_path(@page, @event)\n return\n end\n @summary = Invitation.summarize(@invitations)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"def show\n #head :status => 405\n #return\n \n @participant = Participant.find(params[:id])\n \n # debugging\n #@meeting = Meeting.find(@participant.meeting_id)\n #send_invitation\n\n respond_to do |format|\n format.html # show.html.erb\n #format.xml { render :xml => @participant }\n end\n end",
"def index\n @invited_fiends = InvitedFiend.all\n end"
] | [
"0.734871",
"0.70893246",
"0.6913218",
"0.6898154",
"0.6691045",
"0.66116476",
"0.6607192",
"0.6564615",
"0.6476136",
"0.64601004",
"0.6452081",
"0.6449752",
"0.6440474",
"0.64096445",
"0.6401935",
"0.63865715",
"0.63148916",
"0.6304589",
"0.6278377",
"0.6239744",
"0.6214679",
"0.6214679",
"0.6214679",
"0.6214679",
"0.6214679",
"0.6183296",
"0.618046",
"0.6176566",
"0.61644125",
"0.6104566",
"0.6102359",
"0.6102359",
"0.6102359",
"0.6072227",
"0.6066018",
"0.6057297",
"0.6046083",
"0.6045002",
"0.60429347",
"0.60111564",
"0.6007224",
"0.5992283",
"0.59743726",
"0.5958253",
"0.59529376",
"0.59446913",
"0.592738",
"0.5886794",
"0.58864737",
"0.587719",
"0.58729523",
"0.5870312",
"0.5862735",
"0.58569133",
"0.5850308",
"0.58439296",
"0.58439296",
"0.58439296",
"0.5841953",
"0.584038",
"0.5813763",
"0.58110595",
"0.58061874",
"0.58033484",
"0.57976997",
"0.5797586",
"0.5797586",
"0.57808226",
"0.5779162",
"0.57772696",
"0.5767919",
"0.5767305",
"0.57641035",
"0.576362",
"0.576362",
"0.576362",
"0.576362",
"0.57545966",
"0.573412",
"0.5728838",
"0.57258046",
"0.5719132",
"0.57181895",
"0.57138824",
"0.57121646",
"0.5702065",
"0.5699575",
"0.5695564",
"0.56927395",
"0.56927305",
"0.5689535",
"0.5689535",
"0.5689535",
"0.5687193",
"0.56862307",
"0.5684136",
"0.5678426",
"0.5678181",
"0.5672374",
"0.5671611"
] | 0.68945944 | 4 |
GET /friend_invites/new GET /friend_invites/new.xml | def new
@friend_invite = FriendInvite.new
respond_to do |format|
format.html {redirect_to invite_thank_you_path}
format.xml { render :xml => @friend_invite }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invite }\n end\n end",
"def new\n @invite_request = InviteRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invite_request }\n end\n end",
"def new\n @friend = current_user_or_guest.friends.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @friend }\n format.json { render json: @friend }\n end\n end",
"def new\n @invitee = Invitee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invitee }\n end\n end",
"def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def new\n @friend_request = FriendRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend_request }\n end\n end",
"def new\n @friend_request = FriendRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend_request }\n end\n end",
"def new\n @friend = Friend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend }\n end\n end",
"def new\n @friendship = Friendship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friendship }\n end\n end",
"def new\n @invitado = Invitado.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invitado }\n end\n end",
"def new\n @friendsofuser = Friendsofuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friendsofuser }\n end\n end",
"def new\n @inv_type = InvType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inv_type }\n end\n end",
"def new\n @invitation = Invitation.new\n @contacts=current_member.contacts\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invitation }\n end\n end",
"def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite }\n end\n end",
"def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite }\n end\n end",
"def new\n @invite = Invite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite }\n end\n end",
"def new\n @invite_list = InviteList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite_list }\n end\n end",
"def new\n @users = User.find(:all)\n @invoice = Invoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invoice }\n end\n end",
"def new\n @favourites = Favourites.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @favourites }\n end\n end",
"def new\n @title = 'New Invitation'\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @invitation }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => new_vurl }\n end\n end",
"def new\n @invite_status = InviteStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invite_status }\n end\n end",
"def new\n head :status => 405\n return\n \n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @participant }\n end\n end",
"def new\n @invier_acceso = InvierAcceso.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @invier_acceso }\n end\n end",
"def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitation }\n end\n end",
"def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitation }\n end\n end",
"def new\n @favourite = Favourite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @favourite }\n end\n end",
"def new\n @invitation = Invitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitation }\n end\n end",
"def new\n @who_member = WhoMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @who_member }\n end\n end",
"def new\n @email_list = EmailList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email_list }\n end\n end",
"def new\n @friendship_sent_request = FriendshipSentRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"def new\n @friendrequest = Friendrequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendrequest }\n end\n end",
"def new\n @nickname = Nickname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @nickname }\n end\n end",
"def new\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @online_retailer_user }\n end\n end",
"def new\n @pneighbour = Pneighbour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pneighbour }\n end\n end",
"def new\n @friend = Friend.new\n respond_with(@friend)\n end",
"def create\n @invite = Invite.new(params[:invite])\n @user = current_user\n @user.invites << @invite\n @candidate = current_user.candidate\n @invites = Invite.scoped\n respond_to do |format|\n if @user.save\n InviteMailer.invite_friend(@invite, @user).deliver\n format.html { redirect_to new_invite_path, notice: \"Invitation was successfully sent to #{@invite.name} <#{@invite.email}>\" }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"def create\n @invite = Invite.new(params[:invite])\n\n respond_to do |format|\n if @invite.save\n flash[:notice] = 'Invite was successfully created.'\n format.html { redirect_to(@invite) }\n format.xml { render :xml => @invite, :status => :created, :location => @invite }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @participant = Participant.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @votereply = Votereply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @votereply }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @notifier }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @participant }\n end\n end",
"def new\n @via = Via.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @via }\n end\n end",
"def new\n @people = People.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @people }\n end\n end",
"def new\n @friend = Friend.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friend }\n end\n end",
"def new\n @student_noticeship = StudentNoticeship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @student_noticeship }\n end\n end",
"def new\n @inbound_email = InboundEmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @inbound_email }\n end\n end",
"def new\n @new_employee_request = NewEmployeeRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_employee_request }\n end\n end",
"def new\n @user_following = UserFollowing.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_following }\n end\n end",
"def new\n @identity = Identity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @identity }\n end\n end",
"def new\n @buddy = Buddy.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @buddy }\n end\n end",
"def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @email }\n end\n end",
"def new\n @memberapp = Memberapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @memberapp }\n end\n end",
"def new\n @invitation = Invitation.new(event: Event.find(params[:event_id]), user: User.new)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @invitation }\n end\n end",
"def new\n @friendslist = Friendslist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendslist }\n end\n end",
"def new\n @member_info = MemberInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member_info }\n end\n end",
"def new\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @participant }\r\n end\r\n end",
"def new\n @relationship = Relationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @relationship }\n end\n end",
"def new\n @counterparty = Counterparty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @counterparty }\n end\n end",
"def new\n @invitation = Invitation.new\n respond_with(@invitation)\n end",
"def new\n @teammember = Teammember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @teammember }\n end\n end",
"def new\n @reqinfo = Reqinfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reqinfo }\n end\n end",
"def new_invites\n self.invites.all(:hide => false)\n end",
"def new\n @user = User.new\n get_list\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @user }\n end\n end",
"def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end",
"def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end",
"def new\n @member = Member.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end",
"def new\n @user = User.find(params[:id])\n @privacy_friend = PrivacyFriend.new\n @friendsofmine = PrivacyFriend.my_friends_all(@user.id)\n @friendofsomeone = PrivacyFriend.friend_of_someone(@user.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @privacy_friend }\n end\n end",
"def new\n @favorite = Favorite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @favorite }\n end\n end",
"def new\n @whitelist = Whitelist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @whitelist }\n end\n end",
"def create\n @invitee = Invitee.create(params[:invitee])\n\n respond_to do |format|\n if @invitee.save\n flash[:notice] = 'Invitee was successfully created.'\n format.html { redirect_to(@invitee) }\n format.xml { render :xml => @invitee, :status => :created, :location => @invitee }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invitee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new_from_invite_data\n new\n render :new\n end",
"def new\n @old_twit = OldTwit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @old_twit }\n end\n end",
"def new\n @family_member = FamilyMember.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @family_member }\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 @follower = Follower.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @follower }\n end\n end",
"def new\n @friendship = Friendship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendship }\n end\n end",
"def new\n @friendship = Friendship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @friendship }\n end\n end",
"def new\n @feat = @person.feats.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @feat }\n end\n end",
"def new\n @member = Member.new\n @title = \"New member\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @member }\n end\n end",
"def new\n @membership_kind = MembershipKind.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @membership_kind }\n end\n end",
"def new\n @NewsletterSignup = NewsletterSignup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @NewsletterSignup }\n end\n end",
"def new\n @account = current_user.accounts.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end",
"def new\n @ip_addr = IpAddr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ip_addr }\n end\n end",
"def new\n @omatsuri = Omatsuri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @omatsuri }\n end\n end",
"def new\n @today_activity = TodayActivity.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @today_activity }\n end\n end",
"def new\n @friend = Friend.new\n flash[:user_id ]= params[:id];\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @friend }\n end\n end",
"def new\n @solicitation = @representative.solicitations.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitation }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @profile }\n end\n end",
"def new\n @mailfetch = Mailfetch.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @mailfetch }\n end\n end",
"def invite_friends\n @invite = Invite.new\n end",
"def new\n @user.invitation_code = ENV['EMPLOYEE_INVITATION_CODE']\n respond_to do |format|\n format.html { render_template } # new.html.erb\n format.xml { render xml: @user }\n end\n end",
"def new\n @family = Family.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @family }\n end\n end",
"def new\n @twitterfeed = Twitterfeed.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @twitterfeed }\n end\n end",
"def new\n @partner_link = PartnerLink.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partner_link }\n end\n end",
"def new\n @usr = Usr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @usr }\n end\n end"
] | [
"0.731703",
"0.72240376",
"0.7124394",
"0.7035069",
"0.70196736",
"0.70196736",
"0.69675934",
"0.69675934",
"0.6859307",
"0.67454255",
"0.67084503",
"0.6706349",
"0.667743",
"0.66704726",
"0.6632762",
"0.6632762",
"0.6632762",
"0.6582353",
"0.6555207",
"0.65349543",
"0.6495633",
"0.6468793",
"0.64600486",
"0.6430104",
"0.6405903",
"0.640038",
"0.640038",
"0.63893723",
"0.6387051",
"0.6383281",
"0.6378161",
"0.63734275",
"0.6369535",
"0.6350869",
"0.63460946",
"0.6325372",
"0.6306003",
"0.6304716",
"0.6304304",
"0.62969136",
"0.6296044",
"0.6296044",
"0.6296044",
"0.62952715",
"0.6288301",
"0.62785023",
"0.6277185",
"0.62723446",
"0.62695205",
"0.62653244",
"0.6261348",
"0.6251699",
"0.62485266",
"0.6233971",
"0.6231097",
"0.6226558",
"0.6224292",
"0.6215625",
"0.6215429",
"0.6215047",
"0.61934924",
"0.6192517",
"0.6185277",
"0.6181971",
"0.6175964",
"0.6171148",
"0.616994",
"0.6157275",
"0.61528033",
"0.61528033",
"0.61528033",
"0.6151477",
"0.6145875",
"0.6141241",
"0.61320865",
"0.6131856",
"0.6121651",
"0.61211264",
"0.6119347",
"0.61083263",
"0.61079705",
"0.61079705",
"0.6107419",
"0.61015445",
"0.6096334",
"0.60898674",
"0.60894775",
"0.6083861",
"0.6080792",
"0.60743105",
"0.60729223",
"0.6071505",
"0.60659176",
"0.60651153",
"0.6061199",
"0.6059137",
"0.6058757",
"0.60583204",
"0.60573894",
"0.60488766"
] | 0.69714737 | 6 |
POST /friend_invites POST /friend_invites.xml | def create
@friend_invite = FriendInvite.new(params[:friend_invite])
respond_to do |format|
if @friend_invite.save
invite = ApplicationMailer.create_invite_mailer(params)
invite.set_content_type("text/html")
ApplicationMailer.deliver(invite)
format.html { redirect_to(invite_thank_you_path, :notice => 'Your invitation has been sent.') }
else
format.html { redirect_to invite_friend_path }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_should_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :api_key=>'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response :created\r\n end",
"def create\n @invite = Invite.new(params[:invite])\n @user = current_user\n @user.invites << @invite\n @candidate = current_user.candidate\n @invites = Invite.scoped\n respond_to do |format|\n if @user.save\n InviteMailer.invite_friend(@invite, @user).deliver\n format.html { redirect_to new_invite_path, notice: \"Invitation was successfully sent to #{@invite.name} <#{@invite.email}>\" }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite_friend(opts)\n unless opts[:email] || opts[:user_id]\n raise InvalidArgumentError.new \"invite_friend hash argument must include :email or :user_id\"\n end\n translated_options = {}\n translated_options[:invitedUserEmail] = opts[:email] if opts[:email]\n translated_options[:invitedUserId] = opts[:user_id] if opts[:user_id]\n post(\"/user/#{@user_id}/friends/invitations.json\", translated_options)\n end",
"def create\n successes = []\n (params[:invitations].split(',') || []).each do |name|\n name.strip!\n invitation = @game.invitations.build(:twitter_login => name, :invited_by => current_user)\n successes << name if invitation.save\n # TODO: send actual invitations as DMs from the user??\n # TODO: verify that the listed people are actually followers of the user?\n end\n flash[:notice] = \"Invitations have been sent to the #{successes.length} people you selected\"\n redirect_to(game_path(@game))\n end",
"def test_should_not_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def invite\n invitation_service.invite(invitation_params)\n end",
"def invite\n \n end",
"def invite_facebook_friends\n end",
"def invite\n invite = params[:invite]\n profile.update_attribute(:email, invite[:email])\n invite = Notifier.send_invite(profile, invite[:message])\n invite.deliver\n flash[:notice] = \"An invititation to join YentaFriend was sent to #{profile.name}. Check your dashboard for an update when they join!\"\n end",
"def invite\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n User.find(params[:user_id]).invites << current_user\n redirect_to friends_path\n end\n end",
"def invite_friends\n @invite = Invite.new\n end",
"def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n\n invited_users = InvitedUser.where(email: @user.email)\n invited_users.each do |invited_user|\n Message.create(sender_id: 1, receiver_id: invited_user.inviter.id, title: \"Your friend has just joined\", content: \"I have just joined to TennisBuddy World! Thank you for inviting me. #{@user.full_name}\")\n end\n\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite_people\n end",
"def accept\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n invites = PendingInvite.where(user_id: current_user, invite_id: params[:user_id])\n\n if invites.exists?\n # Remove invite\n invites.destroy_all\n\n # Add firendship relation\n User.find(params[:user_id]).friends << current_user\n current_user.friends << User.find(params[:user_id])\n end\n\n redirect_to friends_path\n end\n end",
"def invite_friend\n friend = params[:invite_friend]\n profile = User.find_by_id(friend[:user_id])\n\n UserMailer.send_invitation(friend, profile).deliver\n redirect_to profile_path(profile)\n end",
"def invite\n @invite = Invite.new\n @invite.invited_id = params[:invited_id]\n @invite.dinner_id = params[:id]\n if @invite.valid?\n @invite.save\n render json: @invite\n else\n puts @invite.errors.messages.inspect\n render status: :bad_request, json: {\n errors: @invite.errors.messages\n }\n end\n end",
"def create\n @member=current_member\n @invitation=Invitation.new(params[:invitation])\n \n \n respond_to do |format|\n if @invitation.save\n @myevent.invitations << @invitation\n \n format.html { redirect_to event_invitations_path, :notice => 'Invitation was successfully sent to your friends email address.' }\n format.json { render :json => @invitation, :status => :created, :location => @invitation }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @invited = Invited.new(invited_params)\n\n respond_to do |format|\n if @invited.save\n format.html { redirect_to @invited, notice: 'Invited was successfully created.' }\n format.json { render :show, status: :created, location: @invited }\n else\n format.html { render :new }\n format.json { render json: @invited.errors, status: :unprocessable_entity }\n end\n end\n end",
"def sent_invitations\n user = User.find(params[:user_id])\n @invitations = Invitation.created_by_user(user)\n\n render json: @invitations\n end",
"def invite\n service_response = AdminManagement::AdminUser::Invite::Send.new(params).perform\n render_api_response(service_response)\n end",
"def create\n @invite_friend = InviteFriend.new\n @invite_friend.friends_email=params[:email]\n @invite_friend.uid=logged_in_hmm_user.id\n \n \n if @invite_friend.save\n frindslist=@invite_friend.friends_email.split(',')\n for i in frindslist\n Postoffice.deliver_invite(logged_in_hmm_user.v_fname,logged_in_hmm_user.v_e_mail,i)\n end\n redirect_to :controller => 'invite_friends',:action =>'list'\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invite_friend.errors.to_xml }\n end\n \n \n end",
"def invite\r\n if request.post?\r\n @pi = PrivateInvite.new(params[:pi]) \r\n if @pi.email == User.find(session[:user_id]).email\r\n flash[:notice] = \"you are already listed\"\r\n redirect_to :back\r\n return \r\n end \r\n PrivateInvite.find_all_by_private_event_id(@pi.private_event_id).each do |p|\r\n if p.email == @pi.email\r\n flash[:notice] = \"#{@p.email}is already on the guest list\"\r\n redirect_to :back\r\n return \r\n end\r\n end\r\n \r\n @pi.invited_at = Date.today \r\n invite = Invitation.new\r\n invite.title = PrivateEvent.find(@pi.private_event_id).title\r\n invite.host_email = User.find(session[:user_id]).email\r\n invite.guest_email = @pi.email \r\n email = InvitationMailer.create_invite(invite)\r\n email.set_content_type(\"text/html\")\r\n @guest_list = PrivateInvite.find(:all)\r\n if @pi.save\r\n begin\r\n InvitationMailer.deliver(email) \r\n rescue\r\n @pi.destroy\r\n flash[:notice] = \"address not found\"\r\n end \r\n end \r\n end\r\n redirect_to :back\r\n end",
"def post_user_invitation(email: nil, first_name: nil, last_name: nil, roles: [], provisioning_allowed: nil, all_apps_visible: nil)\n body = {\n data: {\n type: \"userInvitations\",\n attributes: {\n email: email,\n firstName: first_name,\n lastName: last_name,\n roles: roles,\n provisioningAllowed: provisioning_allowed,\n allAppsVisible: all_apps_visible\n }\n }\n }\n users_request_client.post(\"userInvitations\", body)\n end",
"def invite_params\n params.require(:invite).permit(:sender_id, :receiver_id, :token, :email, :list_id)\n end",
"def create\n @invitation = current_user.invitations.build(:invitee_user_id => params[:user_id])\n\n respond_to do |format|\n if @invitation.save\n flash[:notice] = \"#{@invitation.invitee.email} was successfully invited.\"\n format.html { redirect_to(admin_users_path) }\n format.xml { render :xml => @invitation, :status => :created, :location => @invitation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @invite = Invite.new(params[:invite])\n\n respond_to do |format|\n if @invite.save\n flash[:notice] = 'Invite was successfully created.'\n format.html { redirect_to(@invite) }\n format.xml { render :xml => @invite, :status => :created, :location => @invite }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_should_create_invite_via_API_JSON\r\n get \"/logout\"\r\n post \"/invites.json\", :api_key => 'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response :created\r\n invite = JSON.parse(response.body)\r\n check_new_invite(invite) \r\n end",
"def add\n params[:friends].each do |email|\n friend = User.find_by_email(email)\n next unless friend.present?\n\n # Check the inverse friendship and add if necessary\n friendship = Friendship.find_by_user_id_and_friend_id(friend.id, current_user.id)\n unless friendship.present?\n inverse_friendship = friend.friendships.build(friend_id: current_user.id)\n if inverse_friendship.save\n puts \"Added friendship for #{friend.name} (#{friend.id}) and #{current_user.name} (#{current_user.id})\"\n end\n end\n end\n\n render json: { success: true }\n end",
"def invited\n self.class.find(friend_ids)\n end",
"def create\n @users = User.all\n\n @event = current_user.events.build(event_params.except(:invites))\n\n respond_to do |format|\n if @event.save\n\n event_params.slice(:invites).values.each do |x|\n x.each do |y|\n if y.empty?\n else\n user = @users.find(y.to_i)\n @event.attendees << user\n end\n end\n end\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def accept!()\n self.status = Invite::Status::ACCEPTED\n invitable.add_member invitee\n save!\n end",
"def create\n @invitation = Invitation.new(invitation_params)\n @invitation.sender = current_user\n\t path = request.host_with_port\n if @invitation.save\n if user_signed_in?\n Mailer.invite_friend(@invitation,current_user, path+new_user_registration_path(:invitation_token => @invitation.token)).deliver\n flash[:notice] = \"Thank you, invitation sent.\"\n redirect_to users_url\n else\n flash[:notice] = \"Thank you, we will notify when we are ready.\"\n redirect_to root_url\n end\n else\n render :action => 'new'\n end\n end",
"def create\n\t\tif !params[:add_invites].blank?\n\t\t\tUser.add_to_invitation_limit(params[:add_invites].to_i)\n flash[:notice] = \"Invitation limit updated.\"\n redirect_to admin_users_path\n else\n\t\t\tflash[:error] = \"There was a problem updating the invitation limit.\"\n redirect_to admin_invites_path\n\t\tend\n\tend",
"def invite_friends (owner_name, friend_name, friend_email)\n @greeting = \"Hi\"\n @owner_name=owner_name\n @friend_name=friend_name\n mail to: friend_email\n end",
"def create_and_invitation_studant(params = {})\n run(:post, \"/invitations\", [201,422], JSON.dump(params))\n end",
"def invite\n @invite = Invite.new(params[:invite])\n @invite.user_id = current_user.id\n render :update do |page|\n if @invite.save\n #UserMailer.send_invitation(@invite).deliver\n if params[:action] == \"invite_friends\"\n page.alert('Invitation sent successfully')\n else\n page.alert('Invitation sent successfully')\n page.redirect_to home_index_path\n end\n else\n params[:emails].present? ? page.alert('Please Enter Correct Email') : page.alert('Please Enter Atleast One Email')\n end\n end\n end",
"def invite(firm_name, firstname, lastname, email, phone)\n invite_params = vendor_params(firm_name, firstname, lastname, email, phone)\n @client.post(\"/#{@model}\", {}, invite_params)\n end",
"def create\n\t\tFriendship::request(@user, @friend)\n\t\tUserMailer::friend_request(\n\t\t\t:user => @user,\n\t\t\t:friend => @friend,\n\t\t\t:user_url => profile_for(@user),\n\t\t\t:accept_url => url_for(:action => \"accept\", :id => @user.screen_name),\n\t\t\t:decline_url => url_for(:action => \"decline\", :id => @user.screen_name)\n\t\t).deliver_now\n\t\tflash[:notice] = \"Friend request sent.\"\n\t\tredirect_to profile_for(@friend)\n\tend",
"def invite_by_email\n\n @errors = ''\n emails = params[:emails].split(',')\n servicelisting = Servicelisting.find(params[:servicelisting_id])\n no_of_guests = servicelisting.no_of_guests.to_i\n invites = GuestList.where(:user_id => current_user.id, :product => params[:order_id])\n\n if(invites.size + emails.size <= no_of_guests)\n emails.each do |email|\n guest_list = GuestList.new({\n :email => email.strip,\n :user_id => current_user.id,\n :product => params[:order_id]\n })\n\n if guest_list.save\n Notifier.invite_friend_party(guest_list.email, params[:subject], params[:message], current_user.email).deliver\n end\n end\n else\n @errors = \"You can only invite #{no_of_guests} friends.\"\n end\n\n respond_to do |format|\n format.js\n end\n end",
"def create\n\n user = params[:user]\n \n #abort(\"user #{user}\")\n\n from_id = user[:fb_id]\n\n existing_fb_user = User.find_by_fb_id(from_id)\n\n if existing_fb_user\n \n user_invitations = user[:invitations]\n \n @invitations_array = []\n\n user_invitations.each do |inv|\n\n inv[:fb_id] = from_id\n inv[:is_accept] = false\n inv[:isPoints] = false\n\n\n @invitation = Invitation.new(inv)\n\n @invitations_array.push(inv) \n\n render :json => { :errors => @invitation.errors.full_messages } unless @invitation.save\n\n end\n\n Invitation.new.getInvitations(@invitations_array)\n\n else\n render :json => { :message => \"No user found\" }\n end\n \n end",
"def create\n if params[:invite]\n @invite = Invite.new(invite_params)\n elsif params[:user_id]\n @invite = Invite.new(:user_id => params[:user_id], :request_id => params[:request_id], :to_id => params[:to_id] )\n end\n @invite.state = 'sent' if @invite.state.blank?\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render json: @invite, status: :created, location: @invite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite_params\n params.require(:invite).permit(:email, :sender_id, :recipient_id, :token)\n end",
"def create\n if params[:invitee_email]\n @friend = User.where(params[:invitee_email])\n @friendship = current_user.friendships.new(invitee_email :@friend)\n if @friendship.save\n flash[:success] = \"Congrats! You are now friends.\"\n else\n flash[:error] = \"Oops! There's been a mistake.\"\n redirect_to profile_path(@friend)\n end\n end\n end",
"def add_friends\n @params[:friend_ids].each do |id|\n @plan.users_plans.new(user_id: id)\n end\n end",
"def invited_users\n render json: @moot.list_users_can_vote\n end",
"def dogwalker_invited\n #@invitations = Invitation.invited_clients_email(params[:email]).select(:email)\n @invitations = Invitation.invitees(params[:email]).select(:email)\n logger.debug(\"@invitations.to_json = \" + @invitations.to_json)\n render json: {:invitations => @invitations }, :layout => false\n end",
"def index\n @invite_requests = InviteRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invite_requests }\n end\n end",
"def create\n @invitee = Invitee.create(params[:invitee])\n\n respond_to do |format|\n if @invitee.save\n flash[:notice] = 'Invitee was successfully created.'\n format.html { redirect_to(@invitee) }\n format.xml { render :xml => @invitee, :status => :created, :location => @invitee }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invitee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @invite = @event.invites.new(invite_params)\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to [@event, @invite], notice: 'Invite was successfully created.' }\n format.json { render action: 'show', status: :created, location: [@event, @invite] }\n else\n format.html { render action: 'new' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def accept invitation\n @logger.log(BEFORE_ACCEPT_INVITATION)\n parsed_response = get_and_parse \"/api/invitations/#{invitation[\"id\"]}/accept\"\n game_id = parsed_response[\"body\"][\"game_id\"]\n @logger.log(AFTER_ACCEPT_INVITATION, \"Created game #{game_id}\")\n game_id\n\n #response = self.class.post \"/api/invitations/#{invitation[\"id\"]}/accept\"\n\n #raise response.inspect unless response.parsed_response['status'] == 'success'\n\n #response.parsed_response[\"body\"]\n end",
"def invitations\n\t\t@invits = current_user.receive_invites.order(\"id DESC\")\n\tend",
"def received_invitations\n user = User.find(params[:user_id])\n @invitations = user.invitations\n\n render json: @invitations\n end",
"def create\n @friendship = current_user.friendships.build(:friend_id => params[:friend_id])\n @friendship.status = \"SENT\"\n if @friendship.save\n flash[:notice] = \"Added friend.\"\n redirect_to root_url\n else\n flash[:error] = \"Unable to add friend.\"\n redirect_to root_url\n end\n end",
"def accept\n @from = params[:from_id]\n @to = current_user.id\n @friend_request = FriendRequest.where(to_id: @to, from_id: @from)\n Notification.where(user_id: @to, from_id: @from).destroy_all\n @f = Friendship.new(user_id: @to, friend_id: @from)\n if @f.save\n User.find(@from).friends.push(User.find(@to))\n @friend_request.destroy_all\n flash[:notice] = \"Friendship accepted\"\n redirect_to friends_find_path\n else\n flash[:alert] = \"Couldnt accept friendship\"\n redirect_to friends_find_path\n end\n end",
"def group_invites\n @invites = GroupsController.group_invites current_user\n end",
"def invite\n\[email protected]_to_invited(@invitee)\n\t\n\trespond_to do |format|\n\t\tformat.html { }\n\t\tformat.mobile { render json: {status: \"success\"} }\n\t\tformat.js { }\n\tend\n end",
"def create\n @attr = params[:idea]\n puts \"----- idea.create #{current_user.inspect}\"\n @attr[:organizer] = current_user \n \n guest_emails = params[:email]\n if (guest_emails.nil?)\n arr_emails = []\n else\n arr_emails = guest_emails.split(\",\")\n end\n \n @idea = current_user.ideas.build(@attr)\n @idea.users << current_user\n \n arr_emails.each do |email|\n puts \"building invite #{email}\"\n invitee = Invite.new\n invitee.email = email\n puts \"Phone #{email}\"\n @idea.invites << invitee\n end\n \n host = request.host\n \n if (host =~ /localhost/i)\n host = request.host_with_port\n end\n \n respond_to do |format|\n if @idea.save\n @idea.invites.each do |invite|\n twilio(invite.email, @idea.id, host)\n end\n \n format.html { redirect_to(root_path, :notice => 'Idea was successfully created.') }\n format.xml { render :xml => @idea, :status => :created, :location => @idea }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @idea.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @user = User.find(params[:user_id]) \n @invitations = @user.invitations\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitations.to_xml }\n end\nend",
"def accept_invite(_token)\n # stub\n end",
"def invitations\n @invitations = Invitation.pending_by_user(current_user.id)\n\n respond_to do |format|\n format.html\n end\n end",
"def create\n count = Member.mass_invite!(params[\"MassInvite\"][\"emails\"])\n respond_to do |format|\n format.html { redirect_to new_member_path, notice: \"Yaay! Totalt #{count} invitasjoner ble sendt.\" }\n end\n end",
"def create\n @user = current_user\n @friend = User.find(params[:friend_id])\n @friendship_created = @user.invite(@friend)\n if @friendship_created\n flash[:request_sent] = 'Frindship request has succesffully been sent $green'\n # for the log file \n l = Log.new\n l.user_id_1 = @user.id\n l.user_id_2 = @friend.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n name_2 = if @friend.name.nil? then @friend.email.split('@')[0] else @friend.name end\n l.message = \"#{name_1.humanize} requested friendship of #{name_2.humanize}\"\n l.loggingtype = 0\n l.save\n # Author: Omar\n #adding the notification to the database on sending a friendship request\n UserNotification.create(owner: @friend.id , user: @user.id, story: nil , comment: nil , notify_type: 1 , new: true)\n @friend.notifications = @friend.notifications.to_i + 1\n @friend.save\n else \n flash[:request_not_sent] = 'Frindship request was not sent $red'\n end \n\n redirect_to action: \"index\"\n end",
"def index\n @invites = current_user.invites\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @invites }\n end\n session[:new_invite_error] = nil\n session[:new_invite_error_url] = nil\n end",
"def create\n @invite = NewInvite.new(invite_params, current_user)\n @invite.call\n respond_with @invite, location: wallet_path(id: invite_params[:wallet_id])\n end",
"def create\n\t\tif params[:remove_invites]\n\t\t\tUser.remove_all_invitations\n flash[:notice] = \"Invitation limit updated.\"\n redirect_to admin_users_path\n else\n\t\t\tflash.now[:error] = \"There was a problem updating the invitation limit.\"\n render :action => 'index'\n\t\tend\n\tend",
"def mass_create\n requests = []\n group_invite_params[:mass_requests].each do |element|\n requests << @current_user.requests_as_sender.new(:group_id => element[:group_id], :receiver_id => element[:receiver_id], :status => \"pending\")\n end\n\n @invites = Request.import requests\n\n if @invites\n render json: requests, status: :created\n else\n render json: requests.errors, status: :unprocessable_entity\n end\n end",
"def index\n\t\t@user = User.find(params[:user_id])\n\t\t@order = @user.orders.find(params[:order_id])\n\t\t@invited_friends = @order.order_friend_invitations\n\t\t@invited_friends_ids = []\n\t\t@invited_friends.each do |inv|\n\t\t\t@invited_friends_ids << inv.user_id.to_i\n\t\tend\n\t\t@invited_friends = User.where(id: @invited_friends_ids)\n\tend",
"def accept\n @user = current_user\n @friend = User.find(params[:friend_id])\n @friendship_approved = @user.approve(@friend)\n @friends = @user.friends\n @pending_invited_by = @user.pending_invited_by\n l = Log.new\n l.user_id_1 = @user.id\n l.user_id_2 = @friend.id\n name_1 = if @user.name.nil? then @user.email.split('@')[0] else @user.name end\n name_2 = if @friend.name.nil? then @friend.email.split('@')[0] else @friend.name end\n l.message = \"#{name_1.humanize} accepted friendship of #{name_2.humanize}\"\n l.loggingtype = 0\n l.save\n # Author: Omar\n #adding the notification to the database on accepting a friendship request\n UserNotification.create(owner:@friend.id , user:@user.id, story:nil , comment:nil , notify_type:2 , new:true)\n @friend.notifications = @friend.notifications.to_i + 1\n @friend.save\n flash[:freindship_accept] = \"You and #{name_2.humanize} are now friends $green\"\n \n @user.rank = @user.rank + 4\n @user.save\n @friend.rank = @friend.rank + 4\n @friend.save\n\n redirect_to action: 'pending'\n end",
"def sent_friend_requests\n friendships = Friendship.where(:user_id => self.id, :confirmed => false)\n users = []\n friendships.each do |friendship|\n users.push User.find friendship.friend_id\n end\n\n users\n end",
"def update\n @users = User.all\n respond_to do |format|\n if @event.update(event_params.except(:invites))\n\n event_params.slice(:invites).values.each do |x|\n x.each do |y|\n if y.empty?\n else\n user = @users.find(y.to_i)\n @event.attendees << user\n end\n end\n end\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite(email, role, label_or_expression, value)\n muf = prepare label_or_expression, value\n\n invitation = {\n \"invitations\" => [ {\n \"invitation\" => {\n \"content\" => {\n \"email\" => email,\n \"userFilters\" => [ muf[:url] ],\n \"role\" => role\n }\n }\n } ]\n }\n pp invitation\n GoodData.post \"/gdc/projects/#{@project_id}/invitations\", invitation\n end",
"def accept\n @invite = Invite.find_by(dinner_id: params[:id], invited_id: @current_user.json_hash[:id])\n if @invite\n @acceptance = AttendeeDinner.new\n @acceptance.dinner_id = @invite.dinner_id\n @acceptance.attendee_id = @invite.invited_id\n if @acceptance.valid?\n @acceptance.save\n @invite.delete\n render json: @acceptance\n else\n puts @acceptance.errors.messages.inspect\n render status: :bad_request, json: {\n errors: @acceptance.errors.messages\n }\n end\n end\n end",
"def update_invitations\n # user: nil is here to make sure invitations are linked only once\n invitations << Invitation.where(token: invitation_token, user: nil)\n end",
"def accept_invite3\n # find the invitation\n @invitation = Invitation.find_by_verify_email_token(params[:token])\n duplicate_accept_invite = false\n\n # has the invitation already been accepted?\n if @invitation.status.eql?('accepted')\n duplicate_accept_invite = true\n @invitation.accept_count += 1\n @invitation.save\n else\n @invitation.update_attributes(:status => 'accepted')\n end\n # do we know the invitee?\n @person = People.where(\"email => ? AND status => ?\", @invitation.invitee_email, 'active_mobile').first\n if @person\n create_relationships(@invitation)\n end\n end",
"def create\n @invite_request = InviteRequest.new(params[:invite_request])\n\n respond_to do |format|\n if @invite_request.save\n flash[:notice] = \"Thanks for your interest! We'll get back to you as soon as possible.\"\n format.html { redirect_to('/thanks') }\n format.xml { render :xml => @invite_request, :status => :created, :location => @invite_request }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @invite_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def friends(id)\n friends_data(request(\"users/friends/#{id}.xml\", :auth => true))\n end",
"def create\n @invite = Invite.new(params[:invite])\n @invite.user_id = current_user.id\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render json: @invite, status: :created, location: @invite }\n else\n format.html { render action: \"new\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def after_create(user)\n if user.invited_by_id?\n invitation = Invitation.new(sender: user.invited_by, friend: user)\n invitation.accept!\n else\n # TODO There's a potential exploit here where someone creates 100 dummy accounts, invites one account and collects all the free time on that one account.\n Invitation.where(email: user.email).each do |invitation|\n invitation.friend = user\n invitation.accept!\n end\n end\n end",
"def invite_member\n @organization = MnoEnterprise::Organization.find(params[:id])\n\n # Find or create a new user - We create it in the frontend as MnoHub will send confirmation instructions for newly\n # created users\n user = MnoEnterprise::User.find_by(email: user_params[:email]) || create_unconfirmed_user(user_params)\n\n # Create the invitation\n invite = @organization.org_invites.create(\n user_email: user.email,\n user_role: params[:user][:role],\n referrer_id: current_user.id,\n status: 'staged' # Will be updated to 'accepted' for unconfirmed users\n )\n\n @user = if user.confirmed?\n invite.accept!(user)\n invite.reload\n else\n user.reload\n end\n end",
"def acceptFriend\n signedin\n @n = Notification.find_by(id: params[:id])\n if @n != nil && current_user.id == @n.user_id\n @user1 = User.find_by(id: @n.user_id)\n @user2 = User.find_by(id: @n.sender_id)\n @friend12 = @user1.friends.build(:user_id => @user1.id, :friend_id => @user2.id)\n @friend12.save\n @friend21 = @user2.friends.build(:user_id => @user2.id, :friend_id => @user1.id)\n @friend21.save\n @n.destroy #delete notification after\n # send user confirmation that their friend request was accepted\n @notification = @user2.notifications.build(:user_id => @user2.id, :title => 'Friend Request Accepted', :desc => getName(@user2.id, @user1.id) + ' has accepted your friend request.', :sender_id => @user1.id, :notification_type => 2)\n @notification.save\n respond_to do |format|\n format.html { redirect_to notifications_url, notice: 'Friend request accepted.' }\n format.json { head :no_content }\n end\n else\n redirect_to notifications_url\n end\n end",
"def join_server(token, invite_code)\n request(\n __method__,\n :post,\n \"#{api_base}/invite/#{invite_code}\",\n nil,\n Authorization: token\n )\n end",
"def create_request\n Friendship.request(@user, @friend)\n flash[:notice] = \"Friend request sent.\"\n redirect_to :back\n end",
"def invite_friend(user, invitation)\n @user = user\n @invitation = invitation\n\n mail to: @invitation.email, subject: \"Invitation to connect@ustksa\"\n end",
"def index\n @inviteds = Invited.all\n end",
"def requests_sent\n friends = Friend.where(user_id: params[:user_id], accepted: false)\n\t render json:friends\n end",
"def create\n\n if current_user.friends.include?(params[:friend_id])\n flash[:notice] = \"It's polite to ask once.\"\n else\n\n\n @friendship = current_user.friendships.build(:friend_id => params[:friend_id], approved: \"false\")\n\n if @friendship.save\n\n\n\n log_activity\n\n flash[:notice] = \"Friend requested.\"\n\n\n\n redirect_to :back\n else\n flash[:error] = \"Unable to request friendship.\"\n redirect_to :back\n end\n end\n end",
"def invite_params\n params.require(:invite).permit(:sender, :reciever, :accepted)\n end",
"def invite\n # p @@invitedFriends\n if params[:group_id].present?\n @group = Group.find(params[:group_id])\n @result = Array.new\n for user in @group.users\n @res = Hash.new\n if @@invitedFriends.include? user.id\n @res = { error: true, message: user.name+\" is already invited to order\" }\n else\n @@invitedFriends.push(user.id)\n @res = { error: false, message: user.name+\" invited to order\", name: user.name, avatar: user.avatar.url(:thumb), id: user.id }\n\n end\n @result.push(@res)\n end\n render json: @result\n elsif params[:user_id].present?\n @res = Hash.new\n user = User.find(params[:user_id])\n if @@invitedFriends.include? user.id\n @res = { error: true, message: user.name+\" is already invited to order\" }\n else\n @@invitedFriends.push(user.id)\n @res = { error: false, message: user.name+\" invited to order\", name: user.name, avatar: user.avatar.url(:thumb), id: user.id }\n\n end\n render json: @res\n end\n end",
"def friend_request\n\nend",
"def invite(n, c)\n @socket << \"INVITE #{n} #{c}\"\n end",
"def invite\n Notifications.invite\n end",
"def invite_user\n invited_user = User.find(params[:user_id])\n InviteUser.call(@previa_group, invited_user)\n\n respond_to do |format|\n format.html { redirect_to previa_group_invitable_users_path(@previa_group), notice: 'El usuario fue invitado con éxito.' }\n format.json { head :no_content }\n end\n end",
"def accept_invitation\n \n end",
"def accept\n self.status = :accepted\n self.group.add_members(self.receiver, self.role, :was_invited, self.sender)\n self.save\n end",
"def send_invites\n # Security stuff\n raise Kroogi::NotPermitted unless permitted?(@user, :profile_edit) # @user is inviter\n unless check_invites_quota(@user)\n redirect_to(:controller => 'invite', :action => 'find') and return\n end\n \n request = InviteRequest.find(params[:invite_id]) unless params[:invite_id].blank?\n\n # Ensure sufficient params\n unless params[:to_invite]\n flash[:warning] = 'No users selected to invite -- please try again'.t\n redirect_to(:controller => 'invite', :action => 'find') and return\n end\n unless params[:circle_id] && Invite.valid_circle_id?(params[:circle_id].to_i, :include_site_invite => true)\n flash[:warning] = 'Invalid circle id -- please try again'.t\n redirect_to(:controller => 'invite', :action => 'find') and return\n end\n\n invites_sent = Invite.send_invites(params, @user)\n\n # Set success or failure messages\n if invites_sent.empty?\n flash[:warning] = 'Unable to send any of the invites'.t\n redirect_to(:controller => 'invite', :action => 'find', :invitee_id => invites_sent.size == 1 && !invites_sent.first.user_id.blank? ? invites_sent.first.user_id : nil) and return\n else\n flash[:success] = (invites_sent.size == 1) ? (\"Successfully invited %s\" / [invites_sent.first.display_name]) : (\"Successfully sent %d invitations\" / [invites_sent.size])\n end\n\n question_of_some_target_user = invites_sent.find { |i| i.user && !i.user.public_questions.interactive_for(@user).empty? }\n PublicQuestionHelper::set_question_artist_id(question_of_some_target_user.user, self, :force_show => true) if question_of_some_target_user\n\n # OK, now redirect appropriately\n respond_to do |wants|\n wants.html do\n is_site_invite = params[:circle_id].to_i == Invite::TYPES[:site_invite][:id]\n redirect_to is_site_invite ? ({:controller => '/user', :action => 'founders', :id => @user}) : ({:controller => '/kroogi', :action => 'show_pending', :id => @user, :type => params[:circle_id], :highlight_invite => invites_sent.map(& :id).join('|')})\n end\n wants.js do\n render(:update) do |page|\n page.select(\".invite_#{request.id}_status\").each { |i| i.replace 'User added'.t }\n page.select(\".invite_#{request.id}_status\").each { |i| i.visual_effect :highlight }\n end\n end\n end\n # Shit... something went wrong. It shouldn't, so send admin alert out, too\n rescue ActiveRecord::RecordInvalid => e\n flash[:warning] = 'Unable to send some or all of your invites'.t\n just_notify(e)\n redirect_to :controller => 'invite', :action => 'find'\n end",
"def create\n @invite = Invite.new(invite_params)\n\n respond_to do |format|\n if @invite.save\n format.html { redirect_to @invite, notice: 'Invite was successfully created.' }\n format.json { render :show, status: :created, location: @invite }\n else\n format.html { render :new }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite\n if current_user.active_oauth_account.blank?\n session[:inviting_friend] = true\n redirect_to zh? ? \"/auth/weibo\" : \"/auth/facebook\"\n else\n redirect_to current_user.fb_invite_link\n end\n end",
"def without_users_create\n response = params[:values].reduce({}) do |response, value|\n response[value[:id]] = UserInviter.new(\n self, User, current_user, Devise\n ).invite(value[:email], params[:resend_invitation])\n response\n end\n respond_to do |format|\n format.json { render :json => response.to_json }\n end\n end",
"def invites\n raise 'Tried to request invites from a non-server channel' unless server\n\n invites = JSON.parse(API::Channel.invites(@bot.token, @id))\n invites.map { |invite_data| Invite.new(invite_data, @bot) }\n end"
] | [
"0.6790766",
"0.6546351",
"0.651511",
"0.64166266",
"0.6415754",
"0.6291076",
"0.622905",
"0.62208724",
"0.61873686",
"0.61768925",
"0.6135564",
"0.6104391",
"0.610241",
"0.6099297",
"0.60697484",
"0.60518914",
"0.5991253",
"0.59707206",
"0.59477264",
"0.59004354",
"0.5892184",
"0.58803207",
"0.5874272",
"0.58683",
"0.5854464",
"0.5845008",
"0.58222073",
"0.5814558",
"0.5812278",
"0.58121777",
"0.57832134",
"0.57786864",
"0.5767775",
"0.5746293",
"0.5744756",
"0.57340485",
"0.5733092",
"0.5722598",
"0.57122356",
"0.5701436",
"0.5696138",
"0.5693943",
"0.5691069",
"0.5688821",
"0.56825924",
"0.5649905",
"0.56426966",
"0.56315875",
"0.56267023",
"0.5625977",
"0.56187767",
"0.5614717",
"0.56025624",
"0.5589289",
"0.55824727",
"0.5578607",
"0.5577044",
"0.55649525",
"0.55642205",
"0.55602336",
"0.55521953",
"0.55230236",
"0.5517768",
"0.5514416",
"0.55112016",
"0.5503246",
"0.5501027",
"0.5500278",
"0.54982275",
"0.549728",
"0.5494516",
"0.5488909",
"0.5485251",
"0.54821205",
"0.547154",
"0.5470097",
"0.54602385",
"0.5458731",
"0.5457131",
"0.5445816",
"0.5436328",
"0.5435169",
"0.54323345",
"0.5430012",
"0.54281056",
"0.54226345",
"0.5420744",
"0.5417773",
"0.5414491",
"0.541275",
"0.540844",
"0.540576",
"0.5395522",
"0.53939897",
"0.53882176",
"0.5386508",
"0.5383748",
"0.5381893",
"0.5381698",
"0.5380694",
"0.53733194"
] | 0.0 | -1 |
PUT /friend_invites/1 PUT /friend_invites/1.xml | def update
@friend_invite = FriendInvite.find(params[:id])
respond_to do |format|
if @friend_invite.update_attributes(params[:friend_invite])
format.html { redirect_to(@friend_invite, :notice => 'FriendInvite was successfully updated.') }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @friend_invite.errors, :status => :unprocessable_entity }
end
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_should_update_invite_via_API_XML\r\n get \"/logout\"\r\n put \"/invites/1.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def update\n @invite_friend = InviteFriend.find(params[:id])\n\n respond_to do |format|\n if @invite_friend.update_attributes(params[:invite_friend])\n flash[:notice] = 'InviteFriend was successfully updated.'\n format.html { redirect_to invite_friend_url(@invite_friend) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invite_friend.errors.to_xml }\n end\n end\n end",
"def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n flash[:notice] = 'Invite was successfully updated.'\n format.html { redirect_to(@invite) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invite.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t\t@friend = Friend.find(params[:user_id])\n\t\t@invite = Friend.find(params[:friend_id]) \n\n\t\tif @friend.update_attributes(params['friend']) \n\t\t\tredirect_to :back\n\t\tend\t\n\tend",
"def update\n @invitee = Invitee.find(params[:id])\n\n respond_to do |format|\n if @invitee.update_attributes(params[:invitee])\n flash[:notice] = 'Invitee was successfully updated.'\n format.html { redirect_to(@invitee) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitee.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def invite_friend(opts)\n unless opts[:email] || opts[:user_id]\n raise InvalidArgumentError.new \"invite_friend hash argument must include :email or :user_id\"\n end\n translated_options = {}\n translated_options[:invitedUserEmail] = opts[:email] if opts[:email]\n translated_options[:invitedUserId] = opts[:user_id] if opts[:user_id]\n post(\"/user/#{@user_id}/friends/invitations.json\", translated_options)\n end",
"def update\n @users = User.all\n respond_to do |format|\n if @event.update(event_params.except(:invites))\n\n event_params.slice(:invites).values.each do |x|\n x.each do |y|\n if y.empty?\n else\n user = @users.find(y.to_i)\n @event.attendees << user\n end\n end\n end\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.with_token!(params[:id])\n\n authorize! @invitation\n\n @invitation.update_attributes(invitation_params)\n\n head 204\n end",
"def update\n @invite_request = InviteRequest.find(params[:id])\n\n respond_to do |format|\n if @invite_request.update_attributes(params[:invite_request])\n flash[:notice] = 'InviteRequest was successfully updated.'\n format.html { redirect_to(@invite_request) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invite_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user = User.find(params[:id])\n @user.friend_ids = params[:friend_ids]\n @user.save\n end",
"def update_invitations\n # user: nil is here to make sure invitations are linked only once\n invitations << Invitation.where(token: invitation_token, user: nil)\n end",
"def test_should_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :api_key=>'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response :created\r\n end",
"def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: (t 'invite.update') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(params[:invite])\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invited.update(invited_params)\n format.html { redirect_to @invited, notice: 'Invited was successfully updated.' }\n format.json { render :show, status: :ok, location: @invited }\n else\n format.html { render :edit }\n format.json { render json: @invited.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to(@invitation, :notice => 'Invitation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invitado = Invitado.find(params[:id])\n\n respond_to do |format|\n if @invitado.update_attributes(params[:invitado])\n format.html { redirect_to(@invitado, :notice => 'Invitado was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitado.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n flash[:notice] = 'Invitation was successfully updated.'\n format.html { redirect_to invitation_url(@invitation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors.to_xml }\n end\n end\n end",
"def update\n @invitation = Invitation.find(params[:id])\n @invitation.update_attributes(params[:invitation])\n respond_with(@invitation)\n end",
"def update\n @invite = Invite.find(params[:id])\n\n respond_to do |format|\n if @invite.update_attributes(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invited\n self.class.find(friend_ids)\n end",
"def invite\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n User.find(params[:user_id]).invites << current_user\n redirect_to friends_path\n end\n end",
"def update!(**args)\n @invitations = args[:invitations] if args.key?(:invitations)\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { render :show, status: :ok, location: @invite }\n else\n format.html { render :edit }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { render :show, status: :ok, location: @invite }\n else\n format.html { render :edit }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { render :show, status: :ok, location: @invite }\n else\n format.html { render :edit }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { render :show, status: :ok, location: @invite }\n else\n format.html { render :edit }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_invited\n @invited = Invited.find(params[:id])\n end",
"def accept\n if not user_signed_in?\n redirect_to new_user_session_path\n else\n invites = PendingInvite.where(user_id: current_user, invite_id: params[:user_id])\n\n if invites.exists?\n # Remove invite\n invites.destroy_all\n\n # Add firendship relation\n User.find(params[:user_id]).friends << current_user\n current_user.friends << User.find(params[:user_id])\n end\n\n redirect_to friends_path\n end\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to event_invites_url, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite_facebook_friends\n end",
"def update\n @friend = Friend.find(params[:id])\n @friend.update_attributes(params[:friend])\n respond_with(@friend)\n end",
"def update\n @friend_request = FriendRequest.find(params[:id])\n respond_to do |format|\n if @friend_request.update_attributes(params[:friend_request])\n format.html { redirect_to(@friend_request, :notice => 'Friend request was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friend_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def test_should_not_create_invite_via_API_XML\r\n get \"/logout\"\r\n post \"/invites.xml\", :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response 401\r\n end",
"def update\n @invite_list = InviteList.find(params[:id])\n\n respond_to do |format|\n if @invite_list.update_attributes(params[:invite_list])\n format.html { redirect_to @invite_list, notice: 'Invite list was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invite.update(invite_params)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @friend_request = FriendRequest.find(params[:id])\n\n respond_to do |format|\n if @friend_request.update_attributes(params[:friend_request])\n flash[:notice] = 'FriendRequest was successfully updated.'\n format.html { redirect_to(@friend_request) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friend_request.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def friendships_update(options = {})\n @req.post(\"/1.1/friendships/update.json\", options)\n end",
"def update\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n if @friend.update_attributes(params[:friend])\n format.html { redirect_to(@friend, :notice => 'Friend was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friend.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @friend = Friend.find(params[:id])\n\n respond_to do |format|\n if @friend.update_attributes(params[:friend])\n flash[:notice] = 'Friend was successfully updated.'\n format.html { redirect_to(@friend) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friend.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def invite\n invite = params[:invite]\n profile.update_attribute(:email, invite[:email])\n invite = Notifier.send_invite(profile, invite[:message])\n invite.deliver\n flash[:notice] = \"An invititation to join YentaFriend was sent to #{profile.name}. Check your dashboard for an update when they join!\"\n end",
"def update\n @friendsofuser = Friendsofuser.find(params[:id])\n\n respond_to do |format|\n if @friendsofuser.update_attributes(params[:friendsofuser])\n flash[:notice] = 'Friendsofuser was successfully updated.'\n format.html { redirect_to(@friendsofuser) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friendsofuser.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\t @friendable = Friendable.where(from_id: current_user, to_id: params[:id]).first\n\t @friendable.update(approved: true)\n\t if @friendable.save\n\t redirect_to root_url, :notice => \"Successfully confirmed friend!\"\n\t else\n\t redirect_to root_url, :notice => \"Sorry! Could not confirm friend!\"\n\t end\n\t end",
"def update\n @gift = Gift.find(params[:id])\n\t@invitations = current_host.invitations\n\t@invite_hash = {}\n @invitations.each do |i| \n\t\t@invite_hash[\"#{i.party.name} | #{i.guest.name}\"] = i.id\n\tend\n\n respond_to do |format|\n if @gift.update_attributes(params[:gift])\n format.html { redirect_to(@gift, :notice => 'Gift was successfully updated.') }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end",
"def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, :notice => 'Invitation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n friend = current_user.friends.find params[:id]\n return render json: { error: \"This doesn't seem to be your friend\" } if friend.nil?\n subscribed = !friend.subscribed\n change = subscribed ? 1 : -1\n friend.update subscribed: subscribed\n notify friend, change, 'subscribe'\n render json: {success: subscribed == friend.subscribed}\n end",
"def update\n @invite_status = InviteStatus.find(params[:id])\n\n respond_to do |format|\n if @invite_status.update_attributes(params[:invite_status])\n format.html { redirect_to @invite_status, notice: 'Invite status was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invite_status.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.find_by_permalink(params[:id])\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n flash[:notice] = 'Invitation was successfully updated.'\n format.html { redirect_to(\"/users/#{current_user.id}/invitations/#{@invitation.permalink}\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n inviter_mail = resource_params.delete \"invitermail\"\n \n accepted_inviter = resource_class.to_adapter.find_first(email: inviter_mail)\n \n # before inviting person gets credit for the new user: check if he is\n # really allowed to claim. Only certain vip users are allowed...\n if accepted_inviter && accepted_inviter.ability.can?(:invite, resource_class)\n self.resource = resource_class.accept_invitation!(resource_params) \n resource.invited_by = accepted_inviter\n else\n ## No discussion. User didn't have the right to invite, so show...\n flash[:error] = I18n.t(\"devise.invitations.no_authorized_inviter\")\n raise CanCan::AccessDenied\n end\n\n if resource.errors.empty?\n flash_message = resource.active_for_authentication? ? :updated : :updated_not_active \n set_flash_message :notice, flash_message\n sign_in(resource_name, resource)\n respond_with resource, :location => after_accept_path_for(resource)\n else\n respond_with_navigational(resource){ render :edit }\n end\n end",
"def update\n friendship_new = Friendship.new\n friendship_new.user1_id = @friendship.user2_id\n friendship_new.user2_id = @friendship.user1_id\n friendship_new.approved = true\n friendship_new.save!\n @friendship.approved = true\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to back_page, flash: { :success => 'Friendship was approved.' } }\n format.json { render :index, status: :ok, location: @friendship }\n else\n set_index_friendships\n format.html { render :index }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n end\n end",
"def accept!()\n self.status = Invite::Status::ACCEPTED\n invitable.add_member invitee\n save!\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, flash: { success: 'Invitation was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite_friends\n @invite = Invite.new\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite\n \n end",
"def update!(**args)\n @invitations = args[:invitations] if args.key?(:invitations)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n end",
"def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post 'update', opts\n end",
"def update_friends\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n flash[:notice] = 'Your friends were updated successfully.'\n format.html { redirect_to(user_friendships_path(@user)) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n \n end",
"def update\n respond_to do |format|\n if @invite.proces(confirmed_params, current_user)\n format.html { redirect_to @invite, notice: 'Invite was successfully updated.' }\n format.json { render :show, status: :ok, location: @invite }\n else\n format.html { render :edit }\n format.json { render json: @invite.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @friendship = Friendship.find_by_user_id_and_friend_id(current_user.id,params[:friend_id])\n if @friendship.nil? then\n @friendship = Friendship.find_by_user_id_and_friend_id(params[:friend_id],current_user.id)\n end\n @friendship.update_attributes(:accepted => true)\n redirect_to :show_friends\n end",
"def update\n @friendship = Friendship.find_by(sender_id: params[:user_id], receiver_id: current_user.id, status: false)\n return unless @friendship\n\n @friendship.status = true\n if @friendship.save\n flash[:success] = \"Request accepted\"\n @friendship_mutual = current_user.friend_sent.build(receiver_id: params[:user_id], status: true)\n @friendship_mutual.save\n else\n flash[:warning] = \"Request failed\"\n end\n\n redirect_back fallback_location: root_url\n end",
"def update\n ActiveRecord::Base.transaction do\n @invitee = @invitation.invitee\n accepted_invitees = @meeting.invitations.count { |invitation| invitation.response == \"Accepted\"}\n if @invitee==current_user && @meeting.max_size>= accepted_invitees\n if @invitation.update_attributes(invitation_update_params)\n return json_response(@invitation, :updated)\n end\n end\n end\n head :no_content\n end",
"def index\n @friend_invites = FriendInvite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @friend_invites }\n end\n end",
"def edit\n @invite = Invite.find(params[:id])\n end",
"def update\n @invitation = @event.invitations.find(params[:id])\n if @invitation.key != params[:invitation][:key]\n redirect_to friendly_page_url(@page)\n return\n end\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to(\n friendly_page_url(@page, :invitation_key => @invitation.key),\n :notice => 'Invitation was successfully updated.') }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @inv_type = InvType.find(params[:id])\n @inv_type.updated_id = current_user.id\n\n respond_to do |format|\n if @inv_type.update_attributes(params[:inv_type])\n format.html { redirect_to(@inv_type, :notice => 'Inv type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inv_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @invitacione = Invitacione.find(params[:id])\n\n respond_to do |format|\n if @invitacione.update_attributes(params[:invitacione])\n format.html { redirect_to @invitacione, :notice => 'Invitacione was successfully updated.' }\n\n else\n format.html { render :action => \"edit\" }\n\n end\n end\n end",
"def update\n @invier_acceso = InvierAcceso.find(params[:id])\n\n respond_to do |format|\n if @invier_acceso.update_attributes(params[:invier_acceso])\n flash[:notice] = 'InvierAcceso was successfully updated.'\n format.html { redirect_to(@invier_acceso) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invier_acceso.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @inv.update(inv_params)\n format.html { redirect_to @inv, notice: 'Inv was successfully updated.' }\n format.json { render :show, status: :ok, location: @inv }\n else\n format.html { render :edit }\n format.json { render json: @inv.errors, status: :unprocessable_entity }\n end\n end\n end",
"def invite\n invitation_service.invite(invitation_params)\n end",
"def update\n @friendship = Friendship.find(params[:id])\n\n respond_to do |format|\n if @friendship.update_attributes(params[:friendship])\n format.html { redirect_to(@friendship, :notice => 'Friendship was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @friendship.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n if params[:status] == \"accepted\"\n @friendship = current_user.friendships.build(:friend_id => params[:friend_id], :status => 'accepted')\n friend = User.find(params[:friend_id])\n @friendship2 = friend.friendships.build(:friend_id => params[:user_id], :status => 'accepted')\n\n respond_to do |format|\n if @friendship.save\n format.html { redirect_to @friendship, notice: 'Your Connection Request has been sent' }\n format.json { render action: 'show', status: :created, location: @friendship }\n else\n format.html { render action: 'new' }\n format.json { render json: @friendship.errors, status: :unprocessable_entity }\n end\n if @friendship2.save\n format.html { redirect_to @friendship2, notice: 'You received a friendship invitation' }\n format.json { render action: 'show', status: :created, location: @friendship2 }\n else\n format.html { render action: 'new' }\n format.json { render json: @friendship2.errors, status: :unprocessable_entity }\n end\n end\n end\n\n end",
"def friends(id)\n friends_data(request(\"users/friends/#{id}.xml\", :auth => true))\n end",
"def invite_friend\n friend = params[:invite_friend]\n profile = User.find_by_id(friend[:user_id])\n\n UserMailer.send_invitation(friend, profile).deliver\n redirect_to profile_path(profile)\n end",
"def associate_invites\n Invitation.where_email_matches(email)\n .where(invitee: nil)\n .update_all(invitee_id: id)\n end",
"def invite\n @invite = Invite.new(params[:invite])\n @invite.user_id = current_user.id\n render :update do |page|\n if @invite.save\n #UserMailer.send_invitation(@invite).deliver\n if params[:action] == \"invite_friends\"\n page.alert('Invitation sent successfully')\n else\n page.alert('Invitation sent successfully')\n page.redirect_to home_index_path\n end\n else\n params[:emails].present? ? page.alert('Please Enter Correct Email') : page.alert('Please Enter Atleast One Email')\n end\n end\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def update\n @inv_x_ref = InvXRef.find(params[:id])\n\n respond_to do |format|\n if @inv_x_ref.update_attributes(params[:inv_x_ref])\n format.html { redirect_to @inv_x_ref, notice: 'Inv x ref was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inv_x_ref.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @friendship = Friendship.where(friend_id: current_user, user_id: params[:id]).first\n @friendship.update(approved: true)\n if @friendship.save\n redirect_to :back, :notice => \"Successfully confirmed friend!\"\n else\n redirect_to :back, :notice => \"Sorry! Could not confirm friend!\"\n end\n end",
"def update\n @friendship = Friendship.where(friend_id: current_user, user_id: params[:id]).first\n @friendship.update(approved: true)\n if @friendship.save\n redirect_to root_url, :notice => \"Successfully confirmed friend!\"\n else\n redirect_to root_url, :notice => \"Sorry! Could not confirm friend!\"\n end\n end",
"def update\n @favourites = Favourite.find(params[:id])\n\n respond_to do |format|\n if @favourites.update_attributes(params[:favourites])\n flash[:notice] = 'Favourites was successfully updated.'\n format.html { redirect_to(@favourites) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @favourites.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @person.authorizer = current_person\n\n respond_to do |format|\n if @person.update(person_params)\n @person.invite!(current_person) if params['resend_invite']=='true' \n \n format.html { redirect_to :people, notice: 'Profile successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @friend_request = FriendRequest.find(params[:id])\n\n respond_to do |format|\n if @friend_request.update_attributes(params[:friend_request])\n format.html { redirect_to @friend_request, notice: 'Friend request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @friend_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @invitee.update(invitee_params)\n format.html { redirect_to @invitee, notice: 'Invitee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invitee.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end",
"def set_invite\n @invite = Invite.find(params[:id])\n end"
] | [
"0.72037303",
"0.67752385",
"0.6380558",
"0.633506",
"0.6260861",
"0.6237299",
"0.62027264",
"0.61488986",
"0.6129216",
"0.6113481",
"0.61118686",
"0.61007553",
"0.6082273",
"0.6051589",
"0.6051589",
"0.6051589",
"0.60193217",
"0.6012262",
"0.59933674",
"0.59891045",
"0.5984268",
"0.59691656",
"0.5967799",
"0.5860587",
"0.58578867",
"0.58548737",
"0.58548737",
"0.58548737",
"0.58548737",
"0.5853857",
"0.58494234",
"0.5818959",
"0.58183247",
"0.5809181",
"0.5795595",
"0.57857025",
"0.57821816",
"0.57701063",
"0.57701063",
"0.57700664",
"0.5757007",
"0.57482094",
"0.574637",
"0.57371575",
"0.5732299",
"0.5726104",
"0.5724993",
"0.572471",
"0.57186973",
"0.5712378",
"0.5703121",
"0.56832707",
"0.56778526",
"0.56759423",
"0.5673931",
"0.5673769",
"0.5672896",
"0.5658284",
"0.5658284",
"0.5658284",
"0.5656606",
"0.5654025",
"0.56485057",
"0.5630151",
"0.56087345",
"0.55899423",
"0.5589329",
"0.55881935",
"0.5587332",
"0.5582637",
"0.5581671",
"0.55760163",
"0.55707484",
"0.55646795",
"0.55596966",
"0.55568063",
"0.55515635",
"0.55491406",
"0.55459785",
"0.5541696",
"0.5541583",
"0.55250317",
"0.5519143",
"0.5516536",
"0.5516536",
"0.5516536",
"0.5516536",
"0.55160826",
"0.5510674",
"0.55042136",
"0.55008984",
"0.5499656",
"0.54914916",
"0.5488421",
"0.54866594",
"0.54866594",
"0.54866594",
"0.54866594",
"0.54866594",
"0.54866594"
] | 0.67864174 | 1 |
DELETE /friend_invites/1 DELETE /friend_invites/1.xml | def destroy
@friend_invite = FriendInvite.find(params[:id])
@friend_invite.destroy
respond_to do |format|
format.html { redirect_to(friend_invites_url) }
format.xml { head :ok }
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def destroy\n @invite_friend = InviteFriend.find(params[:id])\n @invite_friend.destroy\n\n respond_to do |format|\n format.html { redirect_to invite_friends_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to(invites_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invite_request = InviteRequest.find(params[:id])\n @invite_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(invite_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invitee = Invitee.find(params[:id])\n @invitee.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitees_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friend_request = FriendRequest.find(params[:id])\n @friend_request.destroy\n\n respond_to do |format|\n format.html { redirect_to(friend_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friend_request = FriendRequest.find(params[:id])\n @friend_request.destroy\n respond_to do |format|\n format.html { redirect_to(friend_requests_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitations_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friendsofuser = Friendsofuser.find(params[:id])\n @friendsofuser.destroy\n\n respond_to do |format|\n format.html { redirect_to(friendsofusers_url) }\n format.xml { head :ok }\n end\n end",
"def remove_invite\n @invited = Dinner.find(params[:id]).invites.find_by(invited_id: params[:user_id])\n @invited.delete\n render json: { message: 'user uninvited' }\n end",
"def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to(friendships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite = Invite.find(params[:id])\n @invite.destroy\n\n respond_to do |format|\n format.html { redirect_to invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n destroy_friendship_sent_request()\n respond_to do |format|\n format.html { redirect_to(:back, :notice => \"Friendship request from #{params[:id]} was rejected\") }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friend = Friend.find(params[:id])\n @friend.destroy\n\n respond_to do |format|\n format.html { redirect_to(friends_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friend = Friend.find(params[:id])\n @friend.destroy\n\n respond_to do |format|\n format.html { redirect_to(friends_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friendship = current_user.friendships.find_by_id(params[:id])\n @friendship = current_user.inverse_friendships.find_by_id(params[:id]) unless @friendship.present? \n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to user_friend_url(current_user), notice: 'Friendship was successfully Removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitado = Invitado.find(params[:id])\n @invitado.destroy\n\n respond_to do |format|\n format.html { redirect_to(invitados_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friend = current_user.friendships.find(params[:id])\n @friend.destroy\n flash[:notice] = \"Removed friend.\"\n redirect_to current_user\n end",
"def destroy\n @friendship = @current_user.friendships.find_by(friendship_params)\n @inverse_friendship = @current_user.inverse_friendships.find_by(@friendship.friend_id)\n @friendship.destroy\n @inverse_friendship.destroy\n\n head :no_content\n end",
"def deleteResource(doc, msg_from)\n \n \n begin\n\n puts \"Deleting\"\n\n path = \"\"\n params = {}\n headers = {}\n \n context, path = findContext(doc, path) \n \n # Deleting member from group\n if context == :user_group_member\n params = {}\n else\n raise Exception.new(\"No context given!\")\n end\n \n httpAndNotify(path, params, msg_from, :delete)\n \n rescue Exception => e\n puts \"Problem in parsing data (CREATE) from xml or sending http request to the VR server: \" + e\n puts \" -- line: #{e.backtrace[0].to_s}\"\n end\n \n end",
"def destroy\n @invier_acceso = InvierAcceso.find(params[:id])\n @invier_acceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(invier_accesos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n invited_users = InvitedUser.where(email: @user.email)\n invited_users.each do |invited_user|\n Message.create(sender_id: 1, receiver_id: invited_user.inviter.id, title: \"Your friend has just left\", content: \"I am living TennisBuddy World! Thank you for inviting me, I am really sorry. #{@user.full_name}\")\n end\n @user.destroy\n respond_to do |format|\n format.html { redirect_to users_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n puts 'callin'\n friendship = Friendship.find(params[:id])\n user = friendship.user\n friend = friendship.friend\n reciprocal_friendship = Friendship.find_by(user: friend, friend: user)\n friendship.destroy\n reciprocal_friendship.destroy\n respond_to do |format|\n # format.html do\n # { redirect_back(fallback_location: root_path, notice: \"Friendship with #{friend.name} ended.\") }\n format.json do\n render json: {\n status: 'deleted',\n notice: \"Friendship with #{friend.name} ended.\"\n }\n end\n end\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = current_user.friendships.find(params[:id])\n @friendship.destroy\n flash[:notice] = \"Removed friendship.\"\n redirect_to current_user\n end",
"def destroy\n\t @friendable = Friendable.where(from_id: [current_user, params[:id]]).where(to_id: [current_user, params[:id]]).last\n\t @friendable.destroy\n\t flash[:notice] = \"Removed friendship.\"\n\t redirect_to :back\n\t end",
"def delete_invite(token, code)\n request(\n __method__,\n :delete,\n \"#{api_base}/invites/#{code}\",\n Authorization: token\n )\n end",
"def destroy\n @invite_status = InviteStatus.find(params[:id])\n @invite_status.destroy\n\n respond_to do |format|\n format.html { redirect_to invite_statuses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friend_request = FriendRequest.find(params[:id])\n @friend_request.destroy\n\n respond_to do |format|\n format.html { redirect_to friend_requests_url }\n format.json { head :ok }\n end\n end",
"def destroy\n #Deletes the friendship (both ways)\n @user=current_user\n friend=User.find_by_email(params[:email])\n if(friend)\n friendCheck=Friendship.find_by_user_id_and_friend_id(@user.id, friend.id)\n if(friendCheck)\n @friendship = @user.friendships.find_by_friend_id(friend.id)\n @friendship.destroy\n @friendship = friend.friendships.find_by_friend_id(@user.id)\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { render json: {:deleted => 'true'}}\n end\n else\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { render json: {:deleted => 'false'}}\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { render json: {:deleted => 'false'}}\n end\n end\n end",
"def delete\n @user = User.find(params[:id])\n @user.rvsps.delete_all()\n @user.destroy\n\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n # Your friend will first remove you as friend\n your_friend = Friend.where(\"account_id = ? AND friend_account_id = ?\", @friend.friend_account_id, current_account.id).first\n your_friend.destroy\n\n # Now, Remove your friend\n @friend.destroy\n\n respond_to do |format|\n format.html { redirect_to friends_url, notice: 'Friend was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def delete_friend\n \t#friend = User.find(params[:friend_id])\n respond_to do |format|\n \tif @user.friends.include?(@friend)\n Friendship.breakup(@user, @friend)\n message = \"Friendship with #{@friend.nick_name} deleted!\"\n format.json{render :json => {:message => message, :status => \"200\"}}\n else\n error = \"You aren't friends with #{@friend.nick_name}\"\n format.json { render :json => {:error => error, :status => \"400\"} }\n end\n end\n end",
"def destroy\n @user = User.find(params[:user_id])\n\n #this is okay because only one of these EVER exists at a time\n current_user.friends_requested.delete(@user)\n current_user.friend_requesters.delete(@user)\n\n if current_user.save\n flash[:success] = \"Request deleted!\"\n else\n flash[:error] = \"You can't let that person go just yet.\"\n end\n\n redirect_to session.delete(:return_to)\n end",
"def destroy\n\t\tredirect_to guild_invites_url, :alert => \"Already used\" and return unless @guild.invites.find(params[:id]).state == \"waiting\"\n\t\[email protected](params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to guild_invites_url, notice: 'Invite was successfully destroyed.' }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend",
"def delete_friend(receiver)\r\n self.friends.delete(receiver)\r\n receiver.friends.delete(self)\r\n self.friends.save && receiver.friends.save\r\n end",
"def destroy\n @invited.destroy\n respond_to do |format|\n format.html { redirect_to inviteds_url, notice: 'Invited was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = Friendship.find(params[:id]).destroy\n redirect_to users_url\n end",
"def destroy\n @invite_list = InviteList.find(params[:id])\n @invite_list.destroy\n\n respond_to do |format|\n format.html { redirect_to invite_lists_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @inbound_email = InboundEmail.find(params[:id])\n @inbound_email.destroy\n\n respond_to do |format|\n format.html { redirect_to(inbound_emails_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @privacy_friend = PrivacyFriend.find(params[:id])\n @privacy_friend.destroy\n\n respond_to do |format|\n format.html { redirect_to('/privacy_friends/' +current_user.id.to_s() + '/new') }\n format.xml { head :ok }\n end\n end",
"def destroy\n @inv_x_ref = InvXRef.find(params[:id])\n @inv_x_ref.destroy\n\n respond_to do |format|\n format.html { redirect_to inv_x_refs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendrequest = Friendrequest.find(params[:id])\n @friendrequest.destroy\n\n respond_to do |format|\n format.html { redirect_to friendrequests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n @plant = Plant.find(params[:id])\n @friendship = @plant.friendships.find_by_friend_id(params[:friend_id])\n\n if @friendship.destroy\n flash[:notice] = \"Removed friendship.\"\n redirect_to request.referrer\n else\n flash[:error] = \"Unable to remove friend\"\n redirect_to request.referrer\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @request_friendship.destroy\n respond_to do |format|\n format.html { redirect_to request_friendships_url, notice: 'La solicitud de amistad fue eliminada con éxito.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = Friendship.find(params[:id])\n @friendship_mutual = Friendship.where(:user_id => @friendship.friend_id).first\n @friendship.destroy \n @friendship_mutual.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 @list_invite.destroy\n respond_to do |format|\n format.html { redirect_to list_invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = @current_user.friendships.find_by_id(params[:id])\n if @friendship.destroy\n flash[:success] = \"This relationship has been deleted\"\n else\n flash[:error] = \"Delete failed, if you really want, please try again\"\n end\n redirect_to(individual_path(@current_user))\n end",
"def destroy\n @friend = Friend.find(params[:id],:conditions=>{:created_by=>current_user.id})\n @friend.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_path, :notice => \"Group #{@friend.group.name} was updated.\") }\n format.xml { head :ok }\n end\n end",
"def delete_friendship\n user = User.find(params[:user_id])\n @friendship = user.friendships.where(friend_id: params[:friend_id]).first ||\n user.inverse_friendships.where(friend_id: params[:user_id]).first\n if @friendship.present? # Can't call exists on a single record\n @friendship.delete\n render status: :ok, json: {\n message: 'Successfully deleted friendship'\n }.to_json\n else\n render status: :bad_request, json: {\n message: 'No friendship to delete'\n }\n end\n end",
"def destroy\n @friendrefuse = Friend.find(params[:id])\n @friendrefuse.destroy\n redirect_to hub_path\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to invites_url, notice: 'Invite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to invites_url, notice: 'Invite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to invites_url, notice: 'Invite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to invites_url, notice: 'Invite was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = @user.friendships.find(params[:id])\n @friendship.destroy\n\n respond_to do |format|\n format.html { redirect_to game_user_friendships_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invite.destroy\n respond_to do |format|\n format.html { redirect_to event_invites_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n other = Friendship.find_by(user: @friendship.friend, friend: @friendship.user)\n other.destroy unless other.nil?\n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to current_user, notice: 'Friendship was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @pending_friend_request.destroy\n respond_to do |format|\n format.html { redirect_to '/profile?id=%s' % [session[:user_id]] }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship = Friendship.where(friend_id: [current_user, params[:id]]).where(user_id: [current_user, params[:id]]).last\n @friendship.destroy\n flash[:notice] = \"Removed friendship.\"\n redirect_to :back\n end",
"def uninvite\n if @@invitedFriends.include? params[:uId].to_i\n @user = User.find(params[:uId].to_i)\n if @@invitedFriends.delete(params[:uId].to_i)\n render json: {error: false, message: @user.name+\" un inveited from order\" }\n else\n render json: {error: true, message: \"can't un invite \"[email protected]+\" to order\" }\n end\n else\n render json: {error: true, message: @user.name+\"is not invited to order\" }\n end\n end",
"def destroy\n @vip_email.destroy\n respond_to do |format|\n format.html { redirect_to(admin_vip_emails_url) }\n format.xml { head :ok }\n end\n website.add_log(user: current_user, action: \"Deleted a amx vip email: #{@vip_email.email}\")\n end",
"def destroy\n @inv_type = InvType.find(params[:id])\n @inv_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(inv_types_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friendship = Friendship.find(params[:id])\n @friendship.destroy\n \n flash[:notice] = \"Removed friendship.\"\n redirect_to root_path\n end",
"def destroy\n @friend=Friend.where(\"user_id = ? AND friend_id=?\",params[:user_id],params[:friend_id]).destroy_all\n reload\n\n end",
"def destroy\n @email_user = Email::User.find(params[:id])\n @email_user.destroy\n\n respond_to do |format|\n format.html { redirect_to(email_users_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n logger.info(\"Delete friend_id 33333\")\n logger.info(\"Delete friend_id #{params[:user_id]}\")\n @friendship.destroy\n if request.format.json?\n render text: \"Delete\"\n else\n @friendship.destroy\n redirect_to friendships_url \n end \n end",
"def remove_friend\n end",
"def destroy\n @inbound_email_log = InboundEmailLog.find(params[:id])\n @inbound_email_log.destroy\n\n respond_to do |format|\n format.html { redirect_to(inbound_email_logs_url) }\n format.xml { head :ok }\n end\n end",
"def delete()\n response = send_post_request(@xml_api_delete_path)\n response.is_a?(Net::HTTPSuccess) or response.is_a?(Net::HTTPRedirection)\n end",
"def destroy\n @friendship = Friendship.where(friend_id: [current_user, params[:id]]).where(user_id: [current_user, params[:id]]).last\n @friendship.destroy\n flash[:notice] = \"No longer friends.\"\n redirect_to :back\n end",
"def destroy\n @invitation = Invitation.find(params[:id])\n @invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @member = Member.find(params[:id])\n @member.destroy\n \n \n respond_to do |format|\n format.html { redirect_to(members_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n current_user.end_friendship!(@relationship.friend)\n respond_to do |format|\n format.html { redirect_to relationships_url }\n end\n end",
"def destroy\n @invite_request.destroy\n render :index\n\n end",
"def remove_reverse_friendship\n Friendship.delete_all :user_id => self.friend_id, :friend_id => self.user_id\n end",
"def destroy\n @identity = Identity.find(params[:id])\n @identity.destroy\n\n respond_to do |format|\n format.html { redirect_to(identities_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @memberapp = Memberapp.find(params[:id])\n @memberapp.destroy\n\n respond_to do |format|\n format.html { redirect_to(memberapps_url) }\n format.xml { head :ok }\n end\n end",
"def deleteAttendee(name)\n RSVP.delete(@id,name)\n end",
"def destroy\n @friendship = Friendship.where(friend_id: [current_user, params[:id]]).where(user_id: [current_user, params[:id]]).last\n @friendship.destroy\n flash[:notice] = \"Removed friendship.\"\n\n #log_activity #doesnt work with call backs\n\n redirect_to :back\n end",
"def destroy\n @friendship = current_user.friendships.find(params[:id])\n @friendship.destroy\n flash[:notice] = \"Removed friendship.\"\n redirect_to posts_path\n end",
"def destroy\n second_friendship = Friendship.find_by(:user1_id => @friendship.user2_id)\n @friendship.destroy\n second_friendship.destroy if second_friendship\n \n respond_to do |format|\n format.html { redirect_to back_page, flash: { :success => 'Friendship was deleted.' } }\n format.json { head :no_content }\n end\n end",
"def destroy\n another_user = User.find params[:user_id]\n current_user.friends.delete(another_user)\n redirect_to users_path\n end",
"def destroy\n @account_membership = AccountMembership.find(params[:id])\n @account_membership.destroy\n\n respond_to do |format|\n format.html { redirect_to(account_memberships_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @friend_request.destroy\n respond_to do |format|\n format.html { redirect_to friend_requests_url, notice: 'Friend request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friend_request.destroy\n respond_to do |format|\n format.html { redirect_to friend_requests_url, notice: 'Friend request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @friendship.destroy\n respond_to do |format|\n format.html { redirect_to friendships_url, notice: \"Friens request denied\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @login = Login.find(params[:id])\n #first destory invitees and responses\n r = Response.find_by_login_id(@login.id)\n r.destroy if !r.nil?\n Invitee.find(:all, :conditions => { :login_id => @login.id }).each { |i| i.destroy }\n @login.destroy\n\n respond_to do |format|\n format.html { redirect_to(logins_url) }\n format.xml { head :ok }\n end\n end"
] | [
"0.7367369",
"0.69668",
"0.6878382",
"0.6796715",
"0.669191",
"0.6686713",
"0.6582892",
"0.6523661",
"0.6523661",
"0.65087575",
"0.64569813",
"0.6446774",
"0.6394026",
"0.6394026",
"0.6394026",
"0.6394026",
"0.63845015",
"0.637915",
"0.637915",
"0.6369605",
"0.6358333",
"0.6331148",
"0.63128966",
"0.62949795",
"0.6293575",
"0.6281382",
"0.6270388",
"0.62468225",
"0.62468225",
"0.62241197",
"0.62221867",
"0.62026405",
"0.6197381",
"0.6178844",
"0.6166339",
"0.6159859",
"0.61447567",
"0.6144407",
"0.6143073",
"0.61421376",
"0.6138414",
"0.61321914",
"0.61160123",
"0.6112092",
"0.61010784",
"0.61000663",
"0.6077443",
"0.6069108",
"0.60687065",
"0.60620993",
"0.60604876",
"0.6056168",
"0.60527223",
"0.6049375",
"0.6047419",
"0.60318744",
"0.6030318",
"0.60298187",
"0.60292757",
"0.60292757",
"0.60292757",
"0.60292757",
"0.6019988",
"0.60180897",
"0.6017848",
"0.6017848",
"0.6017848",
"0.6017848",
"0.6017848",
"0.60040736",
"0.5997064",
"0.59932745",
"0.599103",
"0.5985075",
"0.5983567",
"0.59828126",
"0.5980758",
"0.59807175",
"0.59739906",
"0.5973929",
"0.5973824",
"0.5971297",
"0.59660906",
"0.59629905",
"0.59625304",
"0.5961965",
"0.59593105",
"0.5950676",
"0.59491533",
"0.5948486",
"0.5948199",
"0.5942592",
"0.5938201",
"0.5937435",
"0.59318626",
"0.5930815",
"0.5926187",
"0.5926187",
"0.59254456",
"0.592351"
] | 0.7374037 | 0 |
has_many :customers define methods for other data we want to include in the JSON(like to call a method in the model) | def available_inventory
object.check_inventory
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def customers\n self.customers\n end",
"def customer_order\n order = current_user.restaurant.orders.find(params[:id])\n render json: order.as_json(include: [:customer, {order_details: {include: :meal}}]), status: :ok\n end",
"def related_customers\n ratings.customers\n end",
"def as_json(options={})\n \n methods = options[:methods] || []\n methods << :categories_by_taxonomy\n methods << :translated_categories\n methods << :excerpt\n\n relationships = options[:relationships] || {}\n relationships.store(:content_type, {})\n relationships.store(:categories, {:include => [:content, :category]}) \n \n super(options.merge({:relationships => relationships, :methods => methods}))\n\n end",
"def as_json(options={})\n\t\t## what i can do is\n\t\t## that each user who is pending verification\n\t\t## \n\t\tsuper(:methods => [:users_pending_approval, :employee_roles])\n\tend",
"def customers\n ShopifyAPI::Customer.all\n end",
"def customer\n self.customer\n end",
"def customer_created; end",
"def as_json(options={})\n options[:include] = {\n :organisation => {},\n :locations => { \n methods: :geometry,\n include: :accessibilities\n },\n :taxonomies => { methods: :slug },\n :meta => {},\n :contacts => {},\n :local_offer => {},\n :send_needs => {},\n :suitabilities => {},\n :cost_options => {},\n :regular_schedules => {},\n :links => {}\n }\n super\n end",
"def index\n @customers = @user.customers.all\n render json: @customers\n end",
"def listall\n return render :json => Customer.all.as_json(:only => [:id, :custID, :interested, :bought])\n end",
"def json_data\n json_format = params[:json_format] || 'default'\n case json_format\n when 'basic'\n collection.map { |u| { 'id' => u.id, 'name' => u.email } }.to_json\n else\n address_fields = [:firstname, :lastname, :address1, :address2, :city, :zipcode, :phone, :state_name, :state_id, :country_id]\n includes = { only: address_fields, include: { state: { only: :name }, country: { only: :name } } }\n\n collection.to_json(only: [:id, :email], include:\n { bill_address: includes, ship_address: includes })\n end\n end",
"def serializable_hash(options = {})\n super(\n :include => {\n :photos => {},:customer => {}, :user => {}\n })\n end",
"def customers\n self.reviews.collect do |review|\n review.customer\n end\n end",
"def as_json(options={})\n\n methods = options[:methods] || []\n methods << :composer_user\n methods << :publication_info\n\n super(options.merge(:methods => methods))\n\n end",
"def customers\n @customers ||= new_resource(self, :customer, :customers)\n end",
"def customer_name\n customer.name\n end",
"def as_json(options={})\n super( only: [:name, :email],\n include:\n {\n tables: { only: [:name] }\n }\n )\n end",
"def get_customers\n return ShopifyAPI::Customer.all\n end",
"def as_json(options={})\n \n methods = options[:methods] || []\n methods << :image_url\n methods << :thumbnail_url\n methods << :size\n \n relationships = options[:relationships] || {}\n \n super(options.merge({:relationships => relationships, :methods => methods}))\n\n end",
"def methds\n [ :category_id, :name, :description, :handle, :url, :customer_ids, :image_ids, :created_at, :updated_at ]\n end",
"def customer\n @@all.select {|review| self.restaurant.customers}\n end",
"def get_customers()\n customers = Customer.where(company_id: self.id).order(:name)\n\n return customers\n end",
"def get_customers()\n customers = Customer.where(company_id: self.id).order(:name)\n\n return customers\n end",
"def get_customers()\n customers = Customer.where(company_id: self.id).order(:name)\n\n return customers\n end",
"def to_map_json\n to_json(\n :only => [:id, :name, :label],\n :include => {\n :stores => {\n :only => [:longitude, :latitude, :address_line_1, :address_line_2, :city, :state, :zip],\n :methods => [:formatted_phone_number]\n },\n :offers => {\n :only => [:id, :message, :featured, :value_proposition],\n :methods => [:category_names, :expired]\n }\n }\n )\n end",
"def as_json options=nil\n options ||= {}\n options[:methods] = ((options[:methods] || []) + [:studentsAmount, :ceo, :ceo_id, :is_member, :logo_file, :access_requested])\n super options\n end",
"def as_json(options={})\n super(:methods => [:saldo_actual])\n end",
"def as_json(options={})\n \t\tsuper(:only => [:firstname,:lastname,:email, :language, :nationality, :birthdate, :phone, :description, :profile_picture, :banner_picture, :number_of_walks, :walking_region, :skills, :is_premium, :pricing, :professional, :is_walker],\n \t:include => {\n \t\t:preference => {:only => [:name]},\n \t\t:experience => {:only => [:value]},\n \t\t:address => {:only => [:street, :number, :numberAddition, :latitude, :longitude, :distance],\n \t\t\t:include => {\n \t\t\t\t\t:city => {:only => [:name]},\n \t\t\t\t\t:country => {:only => [:name]},\n \t\t\t\t}\n \t\t\t}\n \t}\n \t\t)\n\tend",
"def as_json(options = {})\n options[:only] ||= [:id, :order_id, :delivery_date, :delivery_time, :feedback_submitted]\n options[:include] = {\n order_items: { only: [:order_item_id, :meal_name] }\n }\n\n super(options)\n end",
"def as_json(options = {})\n super options.merge(methods: [:total_cost])\n end",
"def as_json(options = nil)\n options ||= {}\n options[:include] = self.class.collection_attribute_names\n super(options)\n end",
"def create\n @customer = Customer.new(customer_params)\n @customer.user = current_user\n authorize @customer, :create?\n\n respond_to do |format|\n if @customer.save\n @customer.works.create!(trackable_url: \"#{customer_path(@customer)}\", action: :create, user: current_user, \n parameters: @customer.to_json(except: {customer: [:fullname_and_address_and_pesel_nip_and_birth_date]}, \n include: { \n user: {\n only: [:id, :name, :email] } \n }))\n\n flash_message :success, t('activerecord.messages.successfull.created', data: @customer.fullname)\n format.html { redirect_to @customer }\n format.json { render :show, status: :created, location: @customer }\n else\n format.html { render :new }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def all\n @customer_objects\n end",
"def customers\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON tickets.customer_id = customers.id WHERE tickets.film_id = #{@id};\"\n return Customer.map_items(sql) \n end",
"def service_response_data\n\n {\n customer: @customer.get_hash,\n gateway_customer_associations: @gateway_customer_associations.map{|x| x.get_hash}\n }\n\n end",
"def customer_comments\n end",
"def json_format\n object.to_json(\n only: [:id, :title, :key_information, :description],\n methods: [:photo_url, :net_mrp, :mrp_per_unit],\n :include => {\n store: {\n only: [:name, :id],\n methods: [:full_address, :logo_url, :store_rating, :store_distance]\n }\n }\n )\n end",
"def customer_recurring_orders\n # 1 represents \n @orders = Order.where(customer_id: current_user.customer_id, category: :recurring)\n render json: @orders, status: 200\n \n \n end",
"def show\n render :json => @reservation, :include => {:customer => {:include => :user}}, status: :ok\n end",
"def customer_single_orders\n @orders = Order.where(customer_id: current_user.customer_id, category: :single)\n render json: @orders, status: 200\n\n end",
"def as_json(options = {})\n attrs = super.except('client_id')\n\n attrs[:client_id] = client.user_id\n attrs[:operator_id] = operator.user_id\n\n if options\n if options[:client]\n attrs[:client] = client.user \n end\n if options[:operator]\n attrs[:operator] = operator.user\n end\n if options[:store] && store\n attrs[:store] = store.as_json(only: [:id, :name])\n end\n if options[:loyalty_program] && loyalty_program\n attrs[:loyalty_program] = loyalty_program.as_json(only: [:id, :name]) \n end\n if options[:promotion] && promotion\n attrs[:promotion] = promotion.as_json(only: [:id, :name]) \n end\n if options[:client_point] && client_point\n attrs[:points] = client_point.initial_points\n end\n end\n\n return attrs\n end",
"def customers\n Easybill::Api::Customers\n end",
"def index\n \tcustomers = Customer.all\n \trender json: customers\n \tend",
"def as_json(options = {})\n super(options.merge(include: :author))\n end",
"def as_json(options = {})\n super(:include => { :member => { :only => [:name, :slug, :image_url] } })\n end",
"def index\n @user = current_user\n @customers = @user.customers\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @customers }\n end\n end",
"def decorate_with_methods(jsonb)\n return nil unless product_category.present?\n product_category.properties.each do |property|\n jsonb.define_singleton_method(property.name) do\n case property.field_type\n when 'select'\n if jsonb[property.name].is_a? Array\n jsonb[property.name].map do |option|\n property.property_options.where(name: option).first\n end.compact\n else\n property.property_options.where(name: jsonb[property.name]).first\n end\n when 'checkbox'\n jsonb[property.name] == \"1\"\n else\n jsonb[property.name]\n end\n end\n end\n jsonb\n end",
"def index\n if current_user.role == 'customer_admin'\n render json: current_user.customer and return\n else\n authorize! :read_all, Customer\n customers = Customer.order('name asc')\n render json: customers and return\n end\n end",
"def as_json\n super(except: [:updated_at,:admin_movie_id, :user_id]).merge(movie_detail)\n end",
"def as_json(options = {})\n super(options.merge(include: {\n user: { only: [ :name,:id ] }\n }\n ))\n end",
"def getOffers\n if current_contractor || current_user\n offers_per_post = Offer.where(post_id: params[:post_id])\n @offers = offers_per_post.order(created_at: :asc).limit(10)\n\n render json: @offers.as_json(include: [{contractor: { methods: [:avatar_url] }}, :post,])\n end\n end",
"def as_json(options = nil)\n super(options || \n {include: :friends, except: [:created_at, :updated_at, :id]})\nend",
"def get_address_json\r\n address = @customer.addresses.find( params[:id] )\r\n render :text => address.attributes.to_json\r\n end",
"def current_order\n order = current_user.customer.orders.last\n render json: order.as_json(include: [:restaurant, {order_details: {include: :meal}}]), status: :ok\n end",
"def as_json(options = {})\n # super(methods: :discount_rate)\n # permite passar opções além do desconto\n super ({ methods: :discount_rate }.merge(options))\n end",
"def related_fields(method)\n \n end",
"def serialize(method = :to_json)\n super\n end",
"def customer_details\n @customers.sample\n end",
"def add_customer(customer_id)\n self.customer_id = customer_id\n self.save\n end",
"def add_customer_data(post, options)\n a = options[:address] || {} # shipping address\n \n phone = get_phone_number(a[:phone])\n \n c = {\n :firstname => options[:first_name],\n :lastname => options[:last_name],\n :email => options[:email],\n :zippostal => a[:zip],\n :city => a[:city],\n :address1 => a[:address1],\n :address2 => nil,\n :stateregioniso => a[:state],\n :countryiso => iso_code_for(a[:country]),\n \n :phone1phone => phone[:number],\n :phone1country => phone[:country],\n :phone1area => phone[:area],\n \n :phone2phone => nil,\n :phone2country => nil,\n :phone2area => nil,\n \n :birthday => options[:birth_day] || 01,\n :birthmonth => options[:birth_month] || 01,\n :birthyear => options[:birth_year] || 1980,\n :ipaddress => options[:ip],\n :accountid => options[:id]\n }\n\n post[:customer] = c\n post\n end",
"def as_json(options = {})\n\t\tsuper(options.merge(include: [:user, comments: {include: :user}]))\n\tend",
"def as_json(options = {})\n\t\tsuper(options.merge(include: [:user, comments: {include: :user}]))\n\tend",
"def as_json(options={})\n super(include: :user)\n end",
"def view_product\n to_json(\n only: [:id, :title, :description, :key_information],\n methods: [:photo_url, :net_mrp, :mrp_per_unit, :quantity],\n :include => {\n store: {\n only: [:name, :id],\n methods: [:full_address]\n }\n }\n )\n end",
"def as_json(options = {})\n super({ methods: :venue_ids }.merge(options))\n end",
"def show\n @customer = Customer.includes(:invoices).find(params[:id].split(\",\"))\n\n render json: @customer\n end",
"def as_json(options={})\n\t super(:only => [:name],\n\t :include => {\n\t :app => {:only => [:name, :description, :url_prefix]},\n\t :intent => {:only => [:name]},\n\t :param_map => {:only => [:name, :content]}\n\t }\n\t )\n\tend",
"def create\n @customer = Customer.new(customer_params)\n if @customer.save\n # render json: {name:@customer.name,mobile:@customer.mobile,email:@customer.email,state_name:@customer.state.name,\n # city_name:@customer.city.name,state_id:@customer.state_id,city_id:@customer.city_id}\n render json: @customer.attributes.merge(state_name:@customer.state.name,city_name:@customer.city.name,customer_count:Customer.count);\n else\n render json:{error: @customer.errors.full_messages}\n end\n end",
"def as_json(options = {})\n product = super(options)\n product[:comments] = self.comments.as_json(except: [:product_id, :author_ip])\n product[:colors] = self.colors\n product[:sizes] = self.sizes\n product\n end",
"def associated_records\n raise NotImplementedError\n end",
"def particular_customer_quotes\n offset = 0\n filter = \"%\"\n if (params[:offset].class.to_s != \"NilClass\" && params[:offset].integer?)\n offset = params[:offset].to_i\n end\n if (params[:filter].class.to_s != \"NilClass\")\n filter = \"%\" + params[:filter] + \"%\"\n end\n # lstQuotes = Quote.includes(:dispatcher, :customer, :status).order('dtCreated DESC').offset(offset).limit(30).to_json(include: [:dispatcher, :customer, :status])\n # it should be this query which is written down\n lstQuotes = Quote.includes(:dispatcher, :customer, :status).where(idClient: params[:no]).order('dtCreated DESC').offset(offset).limit(30).to_json(include: [:dispatcher, :customer, :status])\n # lstQuotes = Quote.includes(:dispatcher, :customer, :status).where(\"(note like ? OR status.name LIKE ? OR dispatcher.firstName LIKE ? OR dispatcher.lastName LIKE ? OR reference LIKE ? ) AND idClient = ?\", filter, filter, filter, filter, filter, params[:no]).order('DESC').offset(offset).limit(30)\n\n # lstQuotes.each do |quote|\n # # TODO! Format each quote before send it.\n # end\n return render_json_response(lstQuotes, :ok)\n end",
"def decorate_relations(attributes = {}, options = {})\n inclusions = options[:decorated_include]\n relation_names(inclusions).each do |name|\n metadata = relations[name.to_s]\n relation = send(metadata.name)\n if relation\n attributes[metadata.name.to_s] =\n relation.as_json(relation_options(inclusions, options, name))\n end\n end\n end",
"def as_json(options = {})\n\t\tsuper(options.merge(include: [:user, comments: { include: :user }]))\n\tend",
"def customer_id\n customer.id\n end",
"def model_relationships; end",
"def scoped_collection\n end_of_association_chain.includes([:customer])\n end",
"def customers()\n sql = \"SELECT customers.* FROM customers\n INNER JOIN tickets\n ON tickets.customer_id = customers.id\n WHERE tickets.screening_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n return customers.map{|customer| Customer.new(customer)}\nend",
"def list\n display_customers\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: CustomersDatatable.new(view_context) }\n end\n @customers = Customer.all\n end",
"def as_json(options = {})\n super options.merge(methods: %i[name email])\n end",
"def add_customer(customer)\n respond_with customer.to_vaulted_billing\n end",
"def add_customer(customer)\n respond_with customer.to_vaulted_billing\n end",
"def orders # return all the associated orders / reader method \n Order.all.select do |order| #select will returnn an array \n order.customer == self #condition true or false \n end \n end",
"def create\n @customer = @user.customers.build(customer_params)\n if @customer.save\n render json: @customer, status: :created\n else\n render json: @customer.errors, status: :unprocessable_entity\n end\n\n end",
"def customer\n @customer = Customer.order(name: :asc)\n end",
"def new_customer\n end",
"def to_json(*attrs); super self.class.params; end",
"def to_json(*attrs); super self.class.params; end",
"def to_json(*attrs); super self.class.params; end",
"def customers()\n sql = \"SELECT customers.* FROM customers INNER JOIN tickets ON customers.id = tickets.customer_id INNER JOIN screenings ON screenings.id = tickets.screening_id INNER JOIN films ON films.id = screenings.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n return Customer.map_customers(customers)\n end",
"def as_json(options = {})\n super(\n only: [ :id, :original_message, :created_at, :bot ],\n methods: [ :author, :data, :user_hack, :tag_hack ]\n )\n end",
"def customer()\n sql = \"SELECT customers.* from customers INNER JOIN tickets on\n customers.id = tickets.customer_id WHERE film_id = $1 \"\n values = [@id]\n results = SqlRunner.run(sql, values)\n results.map {|result| Customer.new(result)}\n end",
"def add_customer_data(post, options, payment_method)\n customer = options[:customer]\n post['supporter'] =\n {\n 'Email Address': email(options[:email], options[:email_label]),\n 'First Name': customer[:first_name],\n 'Last Name': customer[:last_name],\n 'Birthday yyyy mm dd':\n (customer[:dob] unless empty?(customer[:dob])),\n 'Mobile Phone': customer[:mobile_number],\n 'Home Phone': customer[:home_phone],\n 'questions': add_questions(options)\n }.merge(add_address(options))\n\n if payment_method.is_a?(ActiveMerchant::Billing::Check)\n post['supporter'].update(\n {\n 'Bank Account Number': payment_method.account_number,\n 'Bank Routing Transit Number': payment_method.routing_number,\n 'Bank Account Type': payment_method.account_type\n }\n )\n end\n end",
"def as_json(options={})\n\n methods = options[:methods] || []\n methods << :aspect_attributes\n\n options[:methods] = methods\n \n super(options)\n\n end",
"def show_customers\n sql = \"SELECT customers.* FROM films INNER JOIN screenings ON films.id = screenings.film_id INNER JOIN tickets ON screenings.id = tickets.screening_id INNER JOIN customers on tickets.customer_id = customers.id WHERE films.id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n return result.map {|customer| Customer.new(customer)}\n end",
"def customer(customer)\n self.all.select {|rev| rev.customer == customer}\n end",
"def customer(options = nil)\n request = Request.new(@client)\n path = \"/authorization-requests/\" + CGI.escape(@id) + \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n customer = Customer(self._client)\n return_values.push(customer.fill_with_data(body))\n\n \n return_values[0]\n end",
"def index\n #byebug\n #CHECK AUTHORIZATION HERE NOT JUST JUST AUTHENTICATION\n \n render json: {farmers: Farmer.all, customers: CustomerUser.all} #User.all #CustomerUser.all #{users: User.all, customers: Customer_User.all}\n end",
"def customer_info(customer)\n return customer\n end",
"def activos\n render :json => Producto.activo.all\n end"
] | [
"0.63633573",
"0.6287434",
"0.6022965",
"0.5977957",
"0.5917495",
"0.5857673",
"0.5849566",
"0.58391845",
"0.5837148",
"0.5819272",
"0.58176994",
"0.57798135",
"0.5758697",
"0.5748838",
"0.57394737",
"0.57226324",
"0.5709107",
"0.56460124",
"0.56438136",
"0.56327236",
"0.5615142",
"0.5606936",
"0.55969274",
"0.55969274",
"0.55969274",
"0.557031",
"0.5559322",
"0.55495346",
"0.55370873",
"0.55314434",
"0.55250955",
"0.5504255",
"0.5497105",
"0.5495858",
"0.54836285",
"0.5477898",
"0.54752296",
"0.5474356",
"0.54709226",
"0.54687876",
"0.54520726",
"0.54496753",
"0.54455113",
"0.54301924",
"0.54256725",
"0.5424848",
"0.5421038",
"0.54016715",
"0.5397623",
"0.53975475",
"0.5396194",
"0.53906435",
"0.5382043",
"0.5381905",
"0.53764355",
"0.53758514",
"0.53589904",
"0.5358548",
"0.53562987",
"0.53338504",
"0.5331097",
"0.5321668",
"0.5321668",
"0.53151864",
"0.53137684",
"0.53134614",
"0.53130496",
"0.5305742",
"0.52969664",
"0.5296027",
"0.52894425",
"0.52855223",
"0.52823734",
"0.5279242",
"0.52761143",
"0.5268575",
"0.52573",
"0.52555877",
"0.52427167",
"0.52368104",
"0.52323484",
"0.52298594",
"0.52298594",
"0.5229394",
"0.5229026",
"0.5227429",
"0.52241397",
"0.5222086",
"0.5222086",
"0.5222086",
"0.52077556",
"0.51967025",
"0.519386",
"0.51913583",
"0.5189744",
"0.5186888",
"0.51800686",
"0.5179241",
"0.51768285",
"0.5168272",
"0.5166876"
] | 0.0 | -1 |
callback for create function | def require_no_authentication
assert_is_devise_resource!
return unless is_navigational_format?
no_input = devise_mapping.no_input_strategies
authenticated = if no_input.present?
args = no_input.dup.push :scope => resource_name
warden.authenticate?(*args)
else
warden.authenticated?(resource_name)
end
if authenticated && warden.user(resource_name)
render json: {
success: false,
error: "You already logged as #{ current_user.email }"
}
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create\n \n end",
"def create; end",
"def create; end",
"def create; end",
"def create; end",
"def create\n \t\n end",
"def create\r\n\r\n\r\n end",
"def create\n \n end",
"def create\r\n end",
"def create\n run_callbacks :create do\n true\n end\n end",
"def create #:doc:\n end",
"def create!\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def enter_created; end",
"def after_create(obj); end",
"def create\n end",
"def create(param)\n\t\traise NotImplementedError\n\tend",
"def create \n end",
"def create \n end",
"def create\n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n\tend",
"def create\n\tend",
"def create\n\tend",
"def create\n\tend",
"def create\n\tend",
"def create\n # TODO: implement create\n end",
"def create\n\n\tend",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n end",
"def create\n #\n # NO-OP\n #\n end",
"def after_create; end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n \n end",
"def create\n #\n end",
"def create\n #\n end",
"def create\n #\n end",
"def before_create()\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end",
"def create\n\n end"
] | [
"0.7412077",
"0.7366489",
"0.7366489",
"0.7366489",
"0.7366489",
"0.7337582",
"0.7028147",
"0.701083",
"0.6968749",
"0.694277",
"0.6901445",
"0.68374276",
"0.6798814",
"0.6798814",
"0.6798814",
"0.6785291",
"0.6766384",
"0.6749261",
"0.67012906",
"0.6693949",
"0.6693949",
"0.6692835",
"0.6679812",
"0.6679812",
"0.6679812",
"0.6679812",
"0.667928",
"0.667928",
"0.667928",
"0.667928",
"0.667928",
"0.6665639",
"0.662696",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.6610976",
"0.66038716",
"0.65522355",
"0.6551921",
"0.6551921",
"0.6551921",
"0.6551921",
"0.6551921",
"0.6551921",
"0.6551921",
"0.6551921",
"0.6522223",
"0.6522223",
"0.6522223",
"0.6512101",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314",
"0.6500314"
] | 0.0 | -1 |
TODO: ensure admin area is accessible to admin | def test_comment_sanitization
full_tests = {
"hey `there`" => "<p>hey <code>there</code></p>",
"hey `<b>`" => "<p>hey <code><b></code></p>",
# this one is not desired, but it's safe and acceptable
"hey `<script>`" => "<p>hey <code><script></code></p>",
"hey `<link href=\"what\">`" => "<p>hey <code><link href=\"what\"></code></p>",
"hey <script>" => "<p>hey <script></script></p>",
"hey <script>yes</script>" => "<p>hey <script>yes</script></p>",
"hey <b>yes</b>" => "<p>hey <b>yes</b></p>",
}
full_tests.each do |input, output|
assert_equal output, routing.render_comment_body(input).strip
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def admin\n #TODO\n end",
"def admin_logic\n end",
"def admin\n end",
"def admin\n end",
"def admin\n end",
"def admin\n end",
"def admin\n\n end",
"def show\n\t\trequire_admin!\n\tend",
"def require_admin\n end",
"def show\n checkadmin\n end",
"def admin\n self.sitemap\n self.follow('dtime:dashboard:admin')\n self.get\n self\n end",
"def admin?; false end",
"def admin_index\n return unless (user_is_allowed_to 'view', 'rets_properties') \n render :layout => 'caboose/admin' \n end",
"def admin\n unless current_user.admin?\n #if logged user is not admin display error message and redirect to application INDEX (store_path)\n flash[:error] = \"Authorisation is required to access this content.\"\n redirect_to store_path\n end\n end",
"def show_admin\n screen_name(\"Inicial-Admin\")\n\n distribute_ots\n\n respond_to do |format|\n format.html { render action: \"show_admin\" }\n format.json { head :ok }\n end\n end",
"def show\n isadmin\n end",
"def show\n is_admin?\n end",
"def ensure_admin!\n authorize! :read, :admin_dashboard\n end",
"def ensure_admin!\n authorize! :read, :admin_dashboard\n end",
"def admin_actions\n unless @current_admin.is_super_admin\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n end",
"def show\n is_admin?\n end",
"def admin\n @shell.admin\n end",
"def admin_use\n redirect_to(root_url) unless current_use.admin?\n end",
"def isAdmin\n \n end",
"def admin_user\n redirect_to root_url, notice: \"You do not have permission to view or edit this information.\" unless current_user.admin?\n end",
"def admin_user\n redirect_to(admin_page_url) if current_user.admin?\n end",
"def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end",
"def admin_user\n #redirect_to(root_url) unless\n current_user.admin?\n end",
"def admin?() false end",
"def admin?\n false\n end",
"def admin_user\n \t\tredirect_to(root_url) unless current_user.admin?\n \tend",
"def admin_user\n redirect_to(admin_page_url) if current_user.admin?\n end",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin? #NB il metodo \"admin?\" è stato aggiunto direttamente da Rails quando alla creazione ha visto che admin è un booleano\n\tend",
"def admin\n object.site_admin?\n end",
"def admin_agent\n redirect_to(root_url) unless current_agent.admin?\n end",
"def admin\n\t\tcan :manage, :all\n\tend",
"def show\n authorize! :read, @admin_system_admin\n end",
"def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t end",
"def admin_user\n redirect_to(news_index_path) unless is_admin?\n end",
"def show\n set_administrator\n end",
"def admin_access?\n admin?\n end",
"def ensure_admin_user\n redirect_to dashboard_index_path unless is_admin?\n end",
"def show\n admin_only\n end",
"def show\n admin_only\n end",
"def show\n admin_only\n end",
"def admin?; current_user.admin?; end",
"def admin?; current_user.admin?; end",
"def admin_in!\n access_denied! unless current_user.admin?\n end",
"def show\n admin_only do\n end\n end",
"def is_admin\n\t\tself.admin == true\n\tend",
"def admin_only\n\t\t\tif logged_in?\n\t\t\t\tif User.find_by(id: current_user.id.to_i).admin != true\n\t\t\t\t\tredirect_to root_path, :alert => \"Odmowa dostępu musisz być adminem\"\n\t\t\t\tend\n\t\t\tend\n\t\tend",
"def admin_only\n unless current_user.admin\n redirect_to home_path, notice: \n \"You must be an admin to perform that function!\"\n end\n end",
"def admin_user \n if (!current_user.lunches_admin?) \n flash[:alert] = 'You not allowed to edit menu.'\n \n redirect_to(root_url)\n end\n end",
"def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"def admin_user\n\t\t\tredirect_to(root_url) unless current_user.admin?\n\t\tend",
"def admin?\n admin\n end",
"def require_admin\n unless view_context.admin?\n redirect_to root_url\n end\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n \n end",
"def is_admin\n \tif current_user != nil\n\t \t \tif !current_user.admin\n redirect_to root_path, :alert => \"Acceso denegado\"\n\t \tend\n\t\t else\n redirect_to root_path, :alert => \"Acceso denegado\"\n\t\t end\n \t\t\n\n end",
"def admin_only\n false\n end",
"def admin\n self.is_admin_for?\n end",
"def admin_user\n unless current_user && current_user.admin?\n redirect_to login_url, notice: \"admin can only do this action.\" \n end\n end",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"def admin_user\n\t\tredirect_to(root_url) unless current_user.admin?\n\tend",
"def admin_user\n redirect_to(root_url) unless current_user.admin? \n end",
"def admin\n\t\tif !session[:admin]\n\t\t\tredirect_to root_url\n\t\tend\n\tend",
"def admin_user\n #redirect_to(root_url) unless\n current_user.admin || current_user.super_admin?# || top_layer_administrator\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin? # se current_user.admin for falso redireciona para pagina principal\n end",
"def admin_user\n\t\tredirect_to(root_path) unless current_user.admin?\n\tend",
"def admin_user\n unless signed_in?\n store_location\n redirect_to signin_url, notice: \"Please sign in.\" \n return\n end\n\n unless current_user.admin?\n redirect_to boards_path, notice: \"You do not have permission for that.\" \n return\n end\n end",
"def index\n render ('index') #render the admin_helpers view. The main page controller calls this action after the admin_helpers logs in\n end",
"def i_am_admin\n unless current_user.is_admin?\n redirect_to :root \n flash[:error] = \"You haven't the rights to access the required page.\"\n end\n end",
"def check_admin\n redirect_to houses_path, alert: \"You do not have admin privileges.\" unless current_user.admin\n end",
"def admin_user\n # redirect_to(root_url) unless\n current_user.admin?\n end",
"def display_resource(admin)\r\n admin.login\r\n end",
"def admin_user\n redirect_to(admin_admins_path) unless current_user.admin?\n end",
"def is_admin?\n admin\n end",
"def is_admin?\n admin\n end",
"def require_admin\n redirect_to(root_path) unless current_user.admin?\n end",
"def admin\n\t\t\n\t\t# Apenas o administrador pode ver o conteudo desta View\n\t\tif !current_user || current_user.user_role.id != 1\n\t\t\tredirect_to root_url and return\n\t\tend\n\t\t\n\t\t@coordinators = User.all.coordenadores.ativo\n\t\t@newCoords = User.all.coordenadores.inativo \n\t\t@projects = Project.all\n\t\t\n\tend",
"def admin_access\n if current_user.access? :admin\n return true\n elsif current_user\n flash[:notice] = \"Du har ikke adgang til denne side\"\n redirect_to nationalities_path\n else\n flash[:notice] = \"Du har ikke adgang til denne side\"\n redirect_to login_path\n end\n end",
"def admin\n\t\tauthenticate_user!\n\t if current_user.admin\n\t\t return\n\t else\n\t\t redirect_to root_url\n\t end\n\tend",
"def check_admin\n redirect_to :root unless current_user.admin?\n end",
"def is_admin\n admin?\n end",
"def admin_user\n redirect_to(root_path) unless current_user.admin?\n end",
"def admin_only\n unless current_user.admin?\n redirect_to :back, :alert => \"Access denied.\"\n end\n end",
"def authorize_admin\n redirect_to root_path, notice: \"You don't have access to admin pages.\" if !current_user.admin?\n end",
"def admin_user\n redirect_to(root_path) unless is_admin?\n end",
"def viewer\n admin\n end",
"def administrate!\n\tif current_user.admin == false \n\t\tredirect \"/home\"\n\tend\nend",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.is_admin?\n end",
"def admin!\n redirect_to root_path, alert: \"Not authorized\" and return unless is_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_only\n return if admin_user?\n\n add_message 'Insufficient permission to view page'\n redirect_to '/'\n end",
"def search_admins\n unless @current_admin.is_super_admin\n flash[:error]=\"You are not authorized to navigate to this page \"\n redirect_to admin_index_path\n return\n end\n @sub_admin=Admin.new\n end",
"def require_admin_permission\n redirect_to tables_path, notice: 'Necesita permisos de administrador para visualizar la configuracion' unless current_user_admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end",
"def admin_user\n redirect_to(root_url) unless current_user.admin?\n end"
] | [
"0.7987685",
"0.7905653",
"0.7890157",
"0.7890157",
"0.7890157",
"0.7890157",
"0.78491884",
"0.78207916",
"0.7506345",
"0.74201626",
"0.73916966",
"0.73326695",
"0.7308058",
"0.7307785",
"0.7289716",
"0.72761196",
"0.7199536",
"0.7198923",
"0.7198923",
"0.7188741",
"0.71818393",
"0.71810997",
"0.7162558",
"0.71577024",
"0.7116912",
"0.7110324",
"0.70958567",
"0.70958567",
"0.70860773",
"0.7083488",
"0.706556",
"0.7056685",
"0.70554686",
"0.7055242",
"0.70460784",
"0.7039027",
"0.70260674",
"0.7018916",
"0.7003879",
"0.69919825",
"0.6978203",
"0.6978194",
"0.6968702",
"0.6968702",
"0.6968702",
"0.6961696",
"0.6961696",
"0.69551384",
"0.6955101",
"0.695145",
"0.69438124",
"0.69384086",
"0.6937158",
"0.69364125",
"0.69364125",
"0.6934747",
"0.6933168",
"0.6927922",
"0.69256663",
"0.692502",
"0.6919676",
"0.6915358",
"0.6914838",
"0.6914838",
"0.6914838",
"0.6907313",
"0.6898378",
"0.6894815",
"0.68915963",
"0.6885943",
"0.6882976",
"0.68816644",
"0.6881257",
"0.68743753",
"0.68693453",
"0.686667",
"0.6863463",
"0.6860547",
"0.6860547",
"0.68587774",
"0.6856178",
"0.68554467",
"0.6853243",
"0.6849488",
"0.6848684",
"0.6844168",
"0.68392843",
"0.68392384",
"0.6836015",
"0.6825785",
"0.6820438",
"0.68176454",
"0.68176454",
"0.68175673",
"0.6817484",
"0.68160266",
"0.68145794",
"0.6808915",
"0.6807964",
"0.6807964",
"0.6807964"
] | 0.0 | -1 |
Initialize CatalogFieldMappings with a catalog name currently in Beta only | def initialize(catalog, conf = nil)
@catalog = catalog
super conf
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def insertMapping(name, id)\n row = DatabaseManager.row('SYMPLECTIC_COLL_MAP')\n row.setColumn('key_text', name)\n row.setColumn('collection_id', id)\n DatabaseManager.insert(DSpace.context, row)\nend",
"def initialize(name)\n self.list_map_db = CartonDb::ListMapDb.new(name)\n end",
"def set_catalog\n @catalog = Catalog.friendly.find(params[:id])\n end",
"def get_flexi_fields_map\n self._flexi_fields_map ||=\n Hash[get_flexi_collection.fields.\n map { |_field| [_field.name.to_sym, _field] }]\n end",
"def initialize_custom_fields\n fields = service.get_custom_fields(contact_point_list)\n existing_fields = fields.map(&:FieldName)\n\n [\n { name: \"organization_id\", type: 'Number' },\n { name: \"organization_name\", type: 'Text' },\n { name: \"cop_status\", type: 'Text' },\n { name: \"cop_due_on\", type: 'Text' },\n ].each do |hash|\n create_custom_field(hash.fetch(:name), hash.fetch(:type))\n end\n end",
"def catalog_params\n params.require(:catalog).permit(:name, :slug, :type, :code, :short_name)\n end",
"def set_catalog\n id = params[:id].nil? ? params[:catalog_id] : params[:id]\n @catalog = Catalog.find(id)\n end",
"def initialize(defect)\n @customFieldMap = getAllFieldsMap\n @defect = defect\n end",
"def set_catalog\n @catalog = Catalog.find(params[:catalog_id])\n end",
"def initialize name\n @name = name\n @@mapping[name] = self\n end",
"def init_fieldlets(fieldlets=[])\n\t\t\tfieldlets.each do |fieldlet|\n\t\t\t\t@instances[fieldlet[:instance_id]] = @fields.push(fieldlet)\n \n\t\t\t\t@fieldlets[fieldlet[:instance_id]][fieldlet.class::IDENTIFIER] = fieldlet\n\t\t\t\t@fieldlets_by_type[fieldlet.class::IDENTIFIER] ||= fieldlet\n\t\t\tend\n\t\tend",
"def catalog=(value)\n @catalog = value\n end",
"def define_mapping\n # no additional parameters\n nil\n end",
"def initialize(name, index, map_context)\n @name, @index, @map_context = name, index, map_context\n end",
"def set_catalog\n @catalog = Catalog.find(params[:id])\n end",
"def set_catalog\n @catalog = Catalog.find(params[:id])\n end",
"def initialize(attrib_name)\n raise \"attrib_name #{attrib_name} not found when creating AttribField object\" unless @@ATTRIBS[attrib_name.to_sym]\n @@ATTRIBS[attrib_name.to_sym].each{|k,v| self.send(\"#{k}=\", v)}\n end",
"def initialize( schema, name )\n @schema = schema\n @name = name\n @columns = {}\n @indexes = []\n @foreign_keys = []\n end",
"def map_name; end",
"def fields\n field_map_class.new do |field_map|\n index_config.each { |name, index_field_config| field_map.insert(name, index_field_config, object) }\n end\n end",
"def set_catalog\n @catalog = Catalog.find_by(slug: params[:id])\n\n if @catalog.blank?\n @catalog = Catalog.find(params[:id])\n end\n end",
"def mapping\n {key => name}\n end",
"def initialize(name)\n @name = name\n @klass = name.classify\n @table_name = name.tableize\n @custom_table_name = resolve_custom_table_name \n @fields = {}\n @link_fields = {}\n @fields_registered = false\n self\n end",
"def pre_initialize_fields\n end",
"def initialize_fields(attributes, file)\n terms.each do |key|\n file[key] = attributes[key]\n end\n end",
"def catalog; end",
"def initialize_register_debug_table\n @register_debug_table = get_register_name_hash.invert\n end",
"def field_mapping_for_cloud_exposures\n {\n 'application-server-software' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"application_server_software_#{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Exposed App Server Software: #{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"application_server_software_#{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\".to_string_identifier }\n }\n ]\n },\n 'bacnet-servers' => {}, \n '-certificate-advertisements' => {}, \n 'development-environments' => {},\n 'dns-servers' => {}, \n '-domain-control-validated-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"comain_control_validated_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Domain Control Validated Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"comain_control_validated_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'ethernet-ip-servers' => {}, \n 'expired-when-scanned-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"expired_when_scanned_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Expired Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"expired_when_scanned_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'ftp-servers' => {}, \n 'ftps-servers' => {}, \n '-healthy-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"healthy_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Healthy Certificate Advertisement: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"healthy_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'insecure-signature-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"insecure_signature_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Insecure Signature Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"insecure_signature_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'internal-ip-address-advertisements'=> {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"internal_ip_address_advertisements_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Detected Internal IP advertisement with configuration: #{JSON.pretty_generate(x[\"firstObservation\"][\"configuration\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"internal_ip_address_advertisements_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n }\n ]\n },\n 'load-balancers' => {},\n 'long-expiration-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"long_expiration_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Long Expiration Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"long_expiration_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'memcached-servers' => {}, \n 'modbus-servers' => {}, \n 'ms-sql-servers' => {}, \n 'my-sql-servers' => {}, \n 'net-bios-name-servers' => {},\n 'pop3-servers' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"detected_server_pop3_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Detected Pop3 Server with configuration: #{JSON.pretty_generate(x[\"firstObservation\"][\"configuration\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"detected_server_pop3_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n }\n ]\n }, \n 'rdp-servers' => {},\n 'self-signed-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"self_signed_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Self Signed Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"self_signed_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'server-software' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"server_software_#{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Exposed Server Software: #{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"server_software_#{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\".to_string_identifier }\n }\n ]\n },\n 'short-key-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"shert_key_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Short Key Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"shert_key_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'sip-servers' => {},\n 'smb-servers' => {},\n 'smtp-servers' => {},\n 'snmp-servers' => {},\n 'ssh-servers' => {},\n 'telnet-servers' => {},\n 'upnp-servers' => {},\n 'unencrypted-logins' => {},\n 'unencrypted-ftp-servers' => {},\n 'web-servers' => {},\n 'wildcard-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"wildcard_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Wildcard Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"wildcard_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'vnc-servers' => {},\n 'vx-works-servers' => {}\n }\n end",
"def mapping_from_name(name)\n const_get(\"#{name}_mapping\".upcase)\n end",
"def init( initMapping = [] )\n\tclear\n\tinitMapping.reverse_each do | objKlass, soapKlass, factory, info |\n \t add( objKlass, soapKlass, factory, info )\n \tend\n end",
"def initialize(mapping)\n @mapping = mapping\n end",
"def map_name=(_arg0); end",
"def initialize(entry)\n for name in entry\n self[\"_#{name}\"] = entry[name]\n end\n end",
"def add_mapping(resource, options); end",
"def custom_index_fields(blacklight_config)\n Hash[exhibit.custom_fields.reject(&:new_record?).map do |custom_field|\n original_config = blacklight_config.index_fields[custom_field.field] || {}\n field = Blacklight::Configuration::IndexField.new original_config.merge(\n custom_field.configuration.merge(\n key: custom_field.field, field: custom_field.solr_field, custom_field: true\n )\n )\n [custom_field.field, field]\n end]\n end",
"def set_product_catalog\n @product_catalog = ProductCatalog.find(params[:id])\n end",
"def mapped_id\n input_hash = { type => cardname }\n map_card.import_item_class.new(input_hash).map_field type, cardname\n end",
"def inject_combo_for_name_column(c)\n netzke_attrs = config[:owner].data_class.netzke_attributes.map{ |a| a[:name] }\n c.merge(:editor => {:xtype => :combo, :store => netzke_attrs, :force_selection => true})\n end",
"def fix_mapping(name, mapping)\n mapping = {name => mapping} unless mapping.keys == [name]\n properties = mapping[name]['properties']\n properties && properties.each do |field, val|\n properties[field] = {type: val} if val.is_a?(String)\n end\n mapping\n end",
"def initialize(mapping)\n @mapping = mapping\n @overrides = {}\n @storage = {}\n end",
"def set_catalog\n @catalog = present(Catalog::Show).model\n end",
"def initialize_fields_entities!\n @entity = SimpleAdmin::Entity.find_by(model_klass_name: model_klass.to_s)\n @entity_fields = @entity.entity_fields.where(presentation: field_presentation)\n end",
"def load_attributes!\n self.flexi_fields.map { |f| self.send(f.name.to_sym) }\n end",
"def setup_catalog\n [\n {product_name: 'bamba', photo_url: 'dummy_url1', barcode: 'xxx1', sku: 111, price: 2.23, producer: 'Nestle'},\n {product_name: 'apple', photo_url: 'dummy_url2', barcode: 'xxx2', sku: 555, price: 4.66, producer: 'WFM'},\n {product_name: 'tapu chepse', photo_url: 'dummy_url3', barcode: 'xxx3', sku: 1111444, price: 7.33, producer: 'Nestle'}\n ].each do |data|\n Catalog.create(data)\n end\n end",
"def catalog\n puts \"library.catalog\"\n ap self.inspect\n end",
"def initialize\r\n load_word_catalog\r\n end",
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def init_with(c)\n c.map.keys.each do|k|\n instance_variable_set(\"@#{k}\", c.map[k])\n end\n\n @table.keys.each do|k|\n new_ostruct_member(k)\n end\n end",
"def init_map\n @map = [\n ['Enumerable Canyon', 'Monkey Patch City', 'Duck Type Beach'],\n ['Monkey Patch City', 'Nil Town', 'Matzburg', 'Enumerable Canyon'],\n ['Duck Type Beach', 'Matzburg', 'Enumerable Canyon'],\n ['Matzburg', 'Duck Type Beach', 'Monkey Patch City', 'Hash Crossing', 'Dynamic Palisades'],\n ['Nil Town', 'Moneky Patch City', 'Hash Crossing'],\n ['Hash Crossing', 'Matzburg', 'Dynamic Palisades', 'Nil Town'],\n ['Dynamic Palisades', 'Hash Crossing', 'Matzburg']\n ]\n end",
"def post_initialize_fields\n end",
"def initialize(name, route = nil)\n @name = name.underscore.singularize \n self.associations = HashWithIndifferentAccess.new\n self.validations = []\n self.fields = HashWithIndifferentAccess.new\n self.foreign_keys = HashWithIndifferentAccess.new\n self.options = { }\n self.routes = [] # of the form [:classname, [:otherclass, :classname], ...]\n if Object.const_defined? self.cs\n Object.send(:remove_const, self.cs)\n end\n Object.const_set self.cs, self\n end",
"def to_mapping\n\n\t\tis_protected_field?\n\n\t\tmapping = nil\n\n\t\t######################### BASIC MAPPING ############################\n\t\tmapping = {\n\t\t\tself.name.to_sym => {\n\t\t\t\t:properties => {\n\t\t \t:content_text => {\n\t\t\t\t\t\t:type => 'text', \n\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\",\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t},\n\t\t\t\t\t:title_text => {\n\t\t\t\t\t\t:type => 'keyword', \n\t\t\t\t\t\t:fields => {\n\t\t\t\t\t :raw => { \n\t\t\t\t\t \t:type => 'text', \n\t\t\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\"\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t},\n\t\t\t\t\t:textbook_name => {\n\t\t\t\t\t\t:type => 'keyword', \n\t\t\t\t\t\t:fields => {\n\t\t\t\t\t :raw => { \n\t\t\t\t\t \t:type => 'text', \n\t\t\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\"\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t}\n\t \t}\n \t}\n\t\t}\n\n\t\t#either you cannot have a field name workup in the components\n\t\t## or whatever. \n\t\t## should raise an error called workup\n\t\t#puts \"mapping becomes first --------------:\"\n\t\t#puts \"commong field mapping ----\"\n\t\t#puts COMMON_FIELD_MAPPING\n\t\t#puts JSON.pretty_generate(mapping) \n\n\t\t######################## MERGE SEARCHABLE AT ROOT DOC ##############\n\t\tmapping[self.name.to_sym][:properties].merge!({\n\t\t\t:searchable => {\n\t\t\t\t:type => \"text\"\n\t\t\t},\n\t\t\t:workup_text => {\n\t\t\t\t:type => \"text\"\n\t\t\t},\n\t\t\t:workup => {\n\t\t\t\t:type => \"keyword\"\n\t\t\t}\n\t\t}) if self.name == \"_doc\"\n\n\t\t#puts \"mapping becomes:\"\n\t\t#puts JSON.pretty_generate(mapping)\n\n\t\t######################## COPY FIELD TO SEARCHABLE IF SEARCHABLE #####\n\t\tunless self.searchable.blank?\n\t\t\t#puts \"this is the mapping\"\n\t\t\t#puts mapping[self.name.to_sym][:properties][:content_text]\n\t\t\tmapping[self.name.to_sym][:properties][:content_text][:copy_to] << \"searchable\"\n\t\tend\n\n\t\t###################### IF CONTAINS_TESTS IS TRUE #####################\n\t\t\t\n\t\tunless self.contains_tests.blank?\n\t\t\t#puts \"name is:#{self.name}, contains tests is: #{self.contains_tests}\"\n\t\t\tif self.contains_tests == true\n\t\t\t\tmapping[self.name.to_sym][:properties][:content_text][:copy_to] << \"workup_text\"\n\t\t\tend\n\t\tend\n\n\t\t####################### SET FIELD TYPE AS NESTED UNLESS ITS ROOT DOC## \n\t\tunless self.name == \"_doc\"\n\t\t\tmapping[self.name.to_sym].merge!(:type => \"nested\") \n\t\tend\n\n\n\t\t###################### CALL PUT MAPPING ON ALL COMPONENTS ############\n\t\tself.components.each do |component|\n\t\t\tmapping[self.name.to_sym][:properties].merge!(component.to_mapping)\n\t\tend\n\n\t\tmapping\n\n\tend",
"def load_schema!\n @columns_hash = _projection_fields.except(*ignored_columns)\n\n @columns_hash.each do |name, column|\n define_attribute(\n name,\n connection.lookup_cast_type_from_column(column),\n default: column.default,\n user_provided_default: false\n )\n end\n end",
"def catalogs=(value)\n @catalogs = value\n end",
"def map name, &block\n mapped_name, mapped_class = name.first\n mappings[mapped_name] =\n HotCocoa::Mappings::Mapper.map_instances_of mapped_class, mapped_name, &block\n end",
"def post_initialize\n initialize_id\n initialize_fields_by_type\n end",
"def initialize(session, name)\n @session = session # the session from which this module was retrieved\n @name = name\n @klass = name.classify\n unless custom_module?\n @table_name = name.tableize\n else\n @table_name = @name\n end\n @custom_table_name = resolve_custom_table_name \n @fields = {}\n @link_fields = {}\n @fields_registered = false\n self\n end",
"def catalog(opts = {})\n return nil unless catalog?\n\n opts[:replace] = true unless opts.key?(:replace)\n\n cat = Systemd::Journal.catalog_for(self[:message_id])\n # catalog_for does not do field substitution for us, so we do it here\n # if requested\n opts[:replace] ? field_substitute(cat) : cat\n end",
"def init_custom_fields\n @item_types = [nil, '']\n @capacities_types = [nil, '']\n end",
"def add_hstore_field_accessors\n self.item_category_attributes.pluck(:label).each do |field_name|\n add_store_accessor field_name\n end\n end",
"def initialize(aggregate_fields)\n raise ArgumentError, \"aggregate_fields must not be empty\" unless aggregate_fields && aggregate_fields.size > 0\n @aggregate_fields_hash = {}\n aggregate_fields.each {|c| @aggregate_fields_hash[c.label.to_s] = c}\n @values_map = {}\n end",
"def field_map_class\n ActiveFedora::RDF::FieldMap\n end",
"def catalog_params\n params.require(:catalog).permit(:name, :locality, :addr, :phone, :email, :siteurl, :description, :biztype, \n catalogimgs_attributes: [:picture, :id, :_destroy] )\n end",
"def set_searchable_fields\n NUMBER_TO_OBJECT_MAP.each do |num, object|\n @searchable_fields[num] = object.column_names - ['id']\n end\n \n @searchable_fields.each do |key, _|\n @searchable_fields[key] += ['_id', 'tags']\n end\n\n @searchable_fields['1'] << 'domain_names'\n end",
"def set_catalogue\n @catalogue = Catalogue.friendly.find(params[:id])\n end",
"def initialize(fields, first_field_val, hidden)\n\t\t@fields = fields.map{|field| field.downcase}\n\t\t@hidden_fields = hidden.map{|hiddenField| hiddenField.downcase}\n\t\t@name = first_field_val.downcase\n\t\t@data = Hash.new\n\n\t\t@fields[1..-1].each{|field|\n\t\t\t@data[field] = Array.new\n\t\t}\n\tend",
"def initialize(opts)\n @solrField = opts[:solrField]\n @first = opts[:firstOnly] || false \n @defaultValue = opts[:default] || nil\n @map = opts[:map] || nil\n @noMapKeyDefault = opts[:noMapKeyDefault] || nil\n @arity = 1\n @marcfieldspecs = []\n end",
"def initialize(model, database_id = nil, &block)\n super\n instance_eval(&block) if block_given?\n\n @name ||= 'ldap'\n end",
"def getAllFieldsMap\n @customFieldMap = self.class.get(\"/rest/api/2/field\", :verify => false)\n end",
"def set_default_data_index(c)\n c[:data_index] = c[:name].camelize(:lower)\n end",
"def initialize(obj, field_name)\n super\n @obj = obj\n @field_name = field_name\n end",
"def advanced_search_legacy_field_mapping\n {\n author: 'search_author',\n title: 'search_title',\n subject: 'subject_terms',\n description: 'search',\n pub_info: 'pub_search',\n number: 'isbn_search'\n }\n end",
"def initialize(query, field = :name)\n fail UnsupportedIndex unless %w(name sncf_id).include?(field.to_s)\n @query = query\n @by = field\n end",
"def initialize(mapname, map)\n @mapname = mapname\n @map = map\n end",
"def catalog_type=(value)\n @catalog_type = value\n end",
"def build_localized_attributes(attributes)\n @localized_attributes.each do |name|\n _name = name.to_sym\n attributes[_name] = I18nField.new(_name, attributes[name.to_s] || attributes[_name])\n end\n end",
"def initialize(fields)\n @fields = fields\n @field_index = 0 # index of field\n @records = [] # all records\n @index = 0 # index of record\n @fieldname_with_table = nil\n end",
"def initialize_custom_attributes_collections(relation, sections)\n sections.each do |section|\n query = CustomAttribute.where(:resource_type => relation.model.name,\n :resource_id => relation,\n :section => section.to_s)\n @inv_collections[[:custom_attributes_for, relation.model.name, section.to_s]] =\n ::ManagerRefresh::InventoryCollection.new(\n :model_class => CustomAttribute,\n :arel => query,\n :manager_ref => [:resource, :section, :name],\n )\n end\n end",
"def preinitialize_on_first_load(input_document, form_names)\n remedy_context = ArsModels::Context.new(\n :server => get_info_value(input_document, 'server'),\n :username => get_info_value(input_document, 'username'),\n :password => get_info_value(input_document, 'password'),\n :port => get_info_value(input_document, 'port'),\n :prognum => get_info_value(input_document, 'prognum'),\n :authentication => get_info_value(input_document, 'authentication')\n )\n\n # Build up a new configuration\n if @disable_caching\n @config = {\n #:properties => properties,\n :context => remedy_context,\n :forms => form_names.inject({}) do |hash, form_name|\n hash.merge!(form_name => ArsModels::Form.find(form_name, :context => remedy_context))\n end\n }\n else\n @@config = {\n #:properties => properties,\n :context => remedy_context,\n :forms => form_names.inject({}) do |hash, form_name|\n hash.merge!(form_name => ArsModels::Form.find(form_name, :context => remedy_context))\n end\n }\n end\n end",
"def getExistingOrgMappings\n sql = 'SELECT KEY_TEXT, COLLECTION_ID FROM SYMPLECTIC_COLL_MAP'\n tri = DatabaseManager.queryTable(DSpace.context, 'SYMPLECTIC_COLL_MAP', sql)\n map = {}\n while (iter = tri.next)\n map[iter.getStringColumn('KEY_TEXT')] = iter.getIntColumn('COLLECTION_ID')\n end\n tri.close\n map\nend",
"def set_admin_catalog\n @admin_catalog = catalog_model.find(params[:id])\n end",
"def update_catalog_metadata\n source = metadata_builder.metadata_source.find_by(source_type: 'descriptive')\n raise 'Descriptive metadata source not available' unless source\n\n bibnumber = source.original_mappings['bibnumber']&.first\n raise 'Descriptive metadata does not contain bibnumber' if bibnumber.blank?\n\n source.set_metadata_mappings(clone_location)\n source.save!\n end",
"def initialize(name, form)\n @name = name\n @form = form\n @fields = []\n\n fields = get_screen_config['fields']\n if [\"infrastructure\", \"monitoring\"].include?(@form.name)\n fields.each do |field|\n @fields << Field.new(field['name'], self, @form)\n end\n else\n field_class_name = \"#{form.product_name.capitalize}Field\"\n fields.each do |screen_field|\n @fields << Uhuru::BoshCommander.const_get(field_class_name).new(screen_field['name'], self, @form)\n end\n end\n\n end",
"def initialize_field(key)\n return super unless current_user.student?\n\n case key.to_sym\n when :creator\n self[key] = [current_user.authority_name]\n when :rights_statement\n self[key] = DEFAULT_RIGHTS_STATEMENT_URI\n when :rights_holder\n self[key] = [current_user.authority_name]\n else\n super\n end\n end",
"def canonical_mapping\n @@canonical_mapping ||= Hash[Danbooru.config.full_tag_config_info.map { |k, v| [k.capitalize, v[\"category\"]] }]\n end",
"def initialize(resource_types=nil, resource_type_field_name=nil)\n self.resource_types = resource_types\n self.resource_type_field_name = resource_type_field_name\n end",
"def initialize_fields_by_type\n database_field_names.each do |field|\n field_info = self.class.get_table_info.select {|hash| hash[\"name\"] == field}.first\n initialize_to_correct_date_type(field_info, field) \n end\n end",
"def load_contact_types\n ContactType.create(name_cd: 'email')\n ContactType.create(name_cd: 'phone')\n ContactType.create(name_cd: 'mobile')\n ContactType.create(name_cd: 'address')\nend",
"def add_sidecar_fields(solr_hash)\n solr_hash.merge! resource.sidecar.to_solr\n end",
"def record_fields\n mappings = {}\n if log_record?\n Rails.logger.debug(\"Aeon Fulfillment Plugin\") { \"Mapping Record: #{self.record}\" }\n end\n\n mappings['identifier'] = self.record.identifier || self.record['identifier']\n mappings['publish'] = self.record['publish']\n mappings['level'] = self.record.level || self.record['level']\n mappings['title'] = strip_mixed_content(self.record['title'])\n mappings['uri'] = self.record.uri || self.record['uri']\n\n resolved_resource = self.record['_resolved_resource'] || self.record.resolved_resource\n if resolved_resource\n resource_obj = resolved_resource[self.record['resource']]\n if resource_obj\n collection_id_components = [\n resource_obj[0]['id_0'],\n resource_obj[0]['id_1'],\n resource_obj[0]['id_2'],\n resource_obj[0]['id_3']\n ]\n\n mappings['collection_id'] = collection_id_components\n .reject {|id_comp| id_comp.blank?}\n .join('-')\n\n mappings['collection_title'] = resource_obj[0]['title']\n end\n end\n\n resolved_repository = self.record.resolved_repository\n if resolved_repository\n mappings['repo_code'] = resolved_repository['repo_code']\n mappings['repo_name'] = resolved_repository['name']\n end\n\n if self.record['creators']\n mappings['creators'] = self.record['creators']\n .select { |cr| cr.present? }\n .map { |cr| cr.strip }\n .join(\"; \")\n end\n\n if self.record.dates\n mappings['date_expression'] = self.record.dates\n .select{ |date| date['date_type'] == 'single' or date['date_type'] == 'inclusive'}\n .map{ |date| date['final_expression'] }\n .join(';')\n end\n\n if (self.record.notes['userestrict'])\n mappings['userestrict'] = self.record.notes['userestrict']\n .map { |note| note['subnotes'] }.flatten\n .select { |subnote| subnote['content'].present? and subnote['publish'] == true }\n .map { |subnote| subnote['content'] }.flatten\n .join(\"; \") \n end\n \n mappings\n end",
"def initialize(marc_record)\n @record = marc_record\n @bib_format = BibFormat.new(record).code\n @types = BibTypes.new(@bib_format, record).codes\n end",
"def initialize(code_name, display_name, database_encoding)\n @code_name = code_name\n @display_name = display_name\n @database_encoding = database_encoding\n end",
"def add_controlled_fields\n metadata_schema.controlled_field_names.each do |field_name|\n field = metadata_schema.get_field(field_name)\n raw_metadata_for_field = {}\n raw_metadata.each do |k, v|\n # Handle both camelCase and snake_case\n if k.match?(/#{field_name.downcase}(_\\d+)?/) || k.match?(/#{field_name.underscore}(_\\d+)?/)\n raw_metadata_for_field[k] = v\n end\n end\n next if raw_metadata_for_field.blank?\n\n all_values = raw_metadata_for_field.values.compact&.map { |value| value.split(/\\s*[|]\\s*/) }&.flatten\n parsed_metadata[field_name] = []\n next if all_values.blank?\n\n parsed_metadata.delete(field_name) # replacing field_name with field_name_attributes\n all_values.each_with_index do |value, i|\n auth_id = sanitize_controlled_field_uri(field, value)\n auth_id ||= search_authorities_for_id(field, value)\n auth_id ||= create_local_authority_id(field, value)\n next unless auth_id.present?\n\n parsed_metadata[\"#{field_name}_attributes\"] ||= {}\n parsed_metadata[\"#{field_name}_attributes\"][i] = { 'id' => auth_id }\n end\n end\n end",
"def initialize_type_map(m = type_map)\n super\n m.register_type 'box', OID::Box.new\n m.register_type 'circle', OID::Circle.new\n m.register_type 'interval', OID::Interval.new\n m.register_type 'line', OID::Line.new\n m.register_type 'segment', OID::Segment.new\n end",
"def initialize(name, schema)\n @name = name\n @schema = schema\n end",
"def initialize_attributes(attributes); end",
"def initialize(name) end",
"def initialize(name)\n assert_kind_of 'name', name, Symbol\n\n @name = name\n @identity_maps = {}\n end",
"def set_base_attributes_by_lookup attributes_hash\n searchable_type = self.class.base_name.demodulize.downcase \n initialize_base_attributes_getters attributes_hash[ searchable_type ]\n end"
] | [
"0.5574938",
"0.536709",
"0.5200782",
"0.51519376",
"0.51490414",
"0.50763553",
"0.5071118",
"0.50668305",
"0.5035048",
"0.5030631",
"0.50187093",
"0.49855518",
"0.49484232",
"0.49070257",
"0.48994124",
"0.48994124",
"0.48882502",
"0.48832053",
"0.48672557",
"0.48654768",
"0.4852438",
"0.48522073",
"0.4844359",
"0.48413816",
"0.48271096",
"0.48182955",
"0.4811961",
"0.4788415",
"0.4788167",
"0.4783497",
"0.47819033",
"0.47734782",
"0.47429848",
"0.47215012",
"0.47194877",
"0.47168604",
"0.4712348",
"0.47050905",
"0.46970153",
"0.4696954",
"0.46939215",
"0.46875107",
"0.46873483",
"0.46799064",
"0.46776402",
"0.4673072",
"0.46694282",
"0.46650416",
"0.4661046",
"0.4659957",
"0.46570757",
"0.46300092",
"0.4621191",
"0.461937",
"0.46061367",
"0.46057203",
"0.46045515",
"0.46031442",
"0.46017116",
"0.46004403",
"0.45937622",
"0.45861712",
"0.4570521",
"0.45663035",
"0.45572174",
"0.45562065",
"0.455502",
"0.45537457",
"0.45438617",
"0.45348912",
"0.45181274",
"0.4512583",
"0.45125395",
"0.45059165",
"0.4501547",
"0.44995528",
"0.44994667",
"0.449343",
"0.44875345",
"0.44809693",
"0.44738328",
"0.4471308",
"0.44709355",
"0.44594193",
"0.44586304",
"0.44463968",
"0.44454923",
"0.44437915",
"0.44408202",
"0.4435017",
"0.44286796",
"0.44275233",
"0.442551",
"0.4423388",
"0.44182768",
"0.44105887",
"0.44105247",
"0.4400501",
"0.43998885"
] | 0.5291565 | 3 |
Get field mappings for a catalog | def get
Iterable.request(conf, base_path).get
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_flexi_fields_map\n self._flexi_fields_map ||=\n Hash[get_flexi_collection.fields.\n map { |_field| [_field.name.to_sym, _field] }]\n end",
"def fields\n field_map_class.new do |field_map|\n index_config.each { |name, index_field_config| field_map.insert(name, index_field_config, object) }\n end\n end",
"def getAllFieldsMap\n @customFieldMap = self.class.get(\"/rest/api/2/field\", :verify => false)\n end",
"def fields\n [*lookup]\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 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 fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"def history_fields_mapping fields\n history_fields_mapping = fields.with_indifferent_access\n\n define_method(:history_fields_mapping) do\n history_fields_mapping\n end\n end",
"def field_map\n {\n 'C' => 'C',\n 'D' => 'date',\n 'N' => 'N',\n 'P' => 'endpoint',\n 'T' => 'amount'\n }\n end",
"def dynamic_fields\n self.dynamic_attributes.keys.map do |name|\n self.content_type.find_field(name)\n end\n end",
"def to_mapping\n\n\t\tis_protected_field?\n\n\t\tmapping = nil\n\n\t\t######################### BASIC MAPPING ############################\n\t\tmapping = {\n\t\t\tself.name.to_sym => {\n\t\t\t\t:properties => {\n\t\t \t:content_text => {\n\t\t\t\t\t\t:type => 'text', \n\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\",\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t},\n\t\t\t\t\t:title_text => {\n\t\t\t\t\t\t:type => 'keyword', \n\t\t\t\t\t\t:fields => {\n\t\t\t\t\t :raw => { \n\t\t\t\t\t \t:type => 'text', \n\t\t\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\"\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t},\n\t\t\t\t\t:textbook_name => {\n\t\t\t\t\t\t:type => 'keyword', \n\t\t\t\t\t\t:fields => {\n\t\t\t\t\t :raw => { \n\t\t\t\t\t \t:type => 'text', \n\t\t\t\t\t\t\t\t:analyzer => \"standard\",\n\t\t\t\t\t\t\t\t:search_analyzer => \"whitespace_analyzer\"\n\t\t\t\t\t }\n\t\t\t\t\t },\n\t\t\t\t\t\t:copy_to => []\n\t\t\t\t\t}\n\t \t}\n \t}\n\t\t}\n\n\t\t#either you cannot have a field name workup in the components\n\t\t## or whatever. \n\t\t## should raise an error called workup\n\t\t#puts \"mapping becomes first --------------:\"\n\t\t#puts \"commong field mapping ----\"\n\t\t#puts COMMON_FIELD_MAPPING\n\t\t#puts JSON.pretty_generate(mapping) \n\n\t\t######################## MERGE SEARCHABLE AT ROOT DOC ##############\n\t\tmapping[self.name.to_sym][:properties].merge!({\n\t\t\t:searchable => {\n\t\t\t\t:type => \"text\"\n\t\t\t},\n\t\t\t:workup_text => {\n\t\t\t\t:type => \"text\"\n\t\t\t},\n\t\t\t:workup => {\n\t\t\t\t:type => \"keyword\"\n\t\t\t}\n\t\t}) if self.name == \"_doc\"\n\n\t\t#puts \"mapping becomes:\"\n\t\t#puts JSON.pretty_generate(mapping)\n\n\t\t######################## COPY FIELD TO SEARCHABLE IF SEARCHABLE #####\n\t\tunless self.searchable.blank?\n\t\t\t#puts \"this is the mapping\"\n\t\t\t#puts mapping[self.name.to_sym][:properties][:content_text]\n\t\t\tmapping[self.name.to_sym][:properties][:content_text][:copy_to] << \"searchable\"\n\t\tend\n\n\t\t###################### IF CONTAINS_TESTS IS TRUE #####################\n\t\t\t\n\t\tunless self.contains_tests.blank?\n\t\t\t#puts \"name is:#{self.name}, contains tests is: #{self.contains_tests}\"\n\t\t\tif self.contains_tests == true\n\t\t\t\tmapping[self.name.to_sym][:properties][:content_text][:copy_to] << \"workup_text\"\n\t\t\tend\n\t\tend\n\n\t\t####################### SET FIELD TYPE AS NESTED UNLESS ITS ROOT DOC## \n\t\tunless self.name == \"_doc\"\n\t\t\tmapping[self.name.to_sym].merge!(:type => \"nested\") \n\t\tend\n\n\n\t\t###################### CALL PUT MAPPING ON ALL COMPONENTS ############\n\t\tself.components.each do |component|\n\t\t\tmapping[self.name.to_sym][:properties].merge!(component.to_mapping)\n\t\tend\n\n\t\tmapping\n\n\tend",
"def mapped_columns\n @columns.map do |column|\n @mappings[column] || column.to_s.send(@inflector)\n end\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 @field_labels.collect { |k, v| { sym: k, name: v } }\n end",
"def add_hstore_field_accessors\n self.item_category_attributes.pluck(:label).each do |field_name|\n add_store_accessor field_name\n end\n end",
"def form_fields\n values = super\n result = {}\n mappings.values.each { |field|\n result[field] = values[field] if values[field]\n }\n result\n end",
"def field_map_class\n ActiveFedora::RDF::FieldMap\n end",
"def field_mapping_for_cloud_exposures\n {\n 'application-server-software' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"application_server_software_#{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Exposed App Server Software: #{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"application_server_software_#{x[\"firstObservation\"][\"configuration\"][\"applicationServerSoftware\"]}\".to_string_identifier }\n }\n ]\n },\n 'bacnet-servers' => {}, \n '-certificate-advertisements' => {}, \n 'development-environments' => {},\n 'dns-servers' => {}, \n '-domain-control-validated-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"comain_control_validated_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Domain Control Validated Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"comain_control_validated_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'ethernet-ip-servers' => {}, \n 'expired-when-scanned-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"expired_when_scanned_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Expired Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"expired_when_scanned_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'ftp-servers' => {}, \n 'ftps-servers' => {}, \n '-healthy-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"healthy_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Healthy Certificate Advertisement: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"healthy_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'insecure-signature-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"insecure_signature_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Insecure Signature Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"insecure_signature_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'internal-ip-address-advertisements'=> {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"internal_ip_address_advertisements_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Detected Internal IP advertisement with configuration: #{JSON.pretty_generate(x[\"firstObservation\"][\"configuration\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"internal_ip_address_advertisements_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n }\n ]\n },\n 'load-balancers' => {},\n 'long-expiration-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"long_expiration_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Long Expiration Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"long_expiration_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'memcached-servers' => {}, \n 'modbus-servers' => {}, \n 'ms-sql-servers' => {}, \n 'my-sql-servers' => {}, \n 'net-bios-name-servers' => {},\n 'pop3-servers' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"detected_server_pop3_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Detected Pop3 Server with configuration: #{JSON.pretty_generate(x[\"firstObservation\"][\"configuration\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"detected_server_pop3_#{x[\"cloudAssetId\"]}\".to_string_identifier }\n }\n ]\n }, \n 'rdp-servers' => {},\n 'self-signed-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"self_signed_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Self Signed Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"self_signed_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'server-software' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"server_software_#{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Exposed Server Software: #{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"server_software_#{x[\"firstObservation\"][\"configuration\"][\"serverSoftware\"]}\".to_string_identifier }\n }\n ]\n },\n 'short-key-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"shert_key_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Short Key Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"shert_key_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'sip-servers' => {},\n 'smb-servers' => {},\n 'smtp-servers' => {},\n 'snmp-servers' => {},\n 'ssh-servers' => {},\n 'telnet-servers' => {},\n 'upnp-servers' => {},\n 'unencrypted-logins' => {},\n 'unencrypted-ftp-servers' => {},\n 'web-servers' => {},\n 'wildcard-certificate-advertisements' => {\n 'asset' => [],\n 'vuln' => [\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"wildcard_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n },\n ],\n 'vuln_def' => [ \n { action: \"proc\", target: \"description\", proc: lambda{|x| \n \"Wildcard Certificate: #{JSON.pretty_generate(x[\"certificate\"])}\" } },\n { action: \"proc\", target: \"scanner_identifier\", proc: lambda{|x| \n \"wildcard_certificate_advertisement_#{x[\"certificate\"][\"id\"]}\".to_string_identifier }\n }\n ]\n },\n 'vnc-servers' => {},\n 'vx-works-servers' => {}\n }\n end",
"def fields_map\n {\n id: 'did/unitid[@label = \"Reference\"]',\n title: 'did/unittitle',\n repository: 'did/repository',\n extent: 'did/physdesc/extent',\n access: 'accessrestrict[not(@type=\"status\")]',\n description: 'scopecontent',\n dates: 'did/unitdate',\n language: 'did/langmaterial/language',\n dates_normal: 'did/unitdate/@normal',\n collection_id: \"#{collection_xpath}/#{Ead::Collection.fields_map[:id]}\",\n collection_title: \"#{collection_xpath}/#{Ead::Collection.fields_map[:title]}\",\n }\n end",
"def categories\n Hash[self.class.catalogs.map { |fld, klass|\n name = fld.gsub(/_id$/, '_name');\n [fld, {:id => self.send(fld), :name => self.send(name)}] rescue nil\n }.reject {|cat| cat.nil?}]\n end",
"def get_fields\n _fields = @config['form']['fields']\n _fields.map{|k,v| Field.new(k=>v)}\n end",
"def fields\n java_import org.dspace.content.MetadataField\n MetadataField.findAllInSchema(DSpace.context, @obj.getSchemaID)\n end",
"def to_fields(fields, mapping_method)\n fields.each { |field| to_field field, mapping_method }\n end",
"def attribute_mappings\n return @attribute_mappings\n end",
"def mappings\n @mappings ||= []\n end",
"def getExistingOrgMappings\n sql = 'SELECT KEY_TEXT, COLLECTION_ID FROM SYMPLECTIC_COLL_MAP'\n tri = DatabaseManager.queryTable(DSpace.context, 'SYMPLECTIC_COLL_MAP', sql)\n map = {}\n while (iter = tri.next)\n map[iter.getStringColumn('KEY_TEXT')] = iter.getIntColumn('COLLECTION_ID')\n end\n tri.close\n map\nend",
"def record_fields\n mappings = super\n\n if record.use_restrictions_note && record.use_restrictions_note.present?\n mappings['use_restrictions_note'] = record.use_restrictions_note\n end\n\n if record.access_restrictions_note && record.access_restrictions_note.present?\n mappings['access_restrictions_note'] = record.access_restrictions_note\n end\n\n mappings['language'] = self.record['language']\n\n return mappings\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 custom_index_fields(blacklight_config)\n Hash[exhibit.custom_fields.reject(&:new_record?).map do |custom_field|\n original_config = blacklight_config.index_fields[custom_field.field] || {}\n field = Blacklight::Configuration::IndexField.new original_config.merge(\n custom_field.configuration.merge(\n key: custom_field.field, field: custom_field.solr_field, custom_field: true\n )\n )\n [custom_field.field, field]\n end]\n end",
"def map\n mappings = {}\n\n mappings = mappings\n .merge(self.system_information)\n .merge(self.json_fields)\n .merge(self.record_fields)\n .merge(self.user_defined_fields)\n\n mappings\n end",
"def mappings\n @mappings ||= []\n end",
"def for_mappings(database_record)\n Registry[target_class(database_record)].each do |mapping|\n lookup = lookup_field(mapping, database_record)\n next unless lookup\n yield mapping, lookup\n end\n end",
"def map\n mappings = {}\n\n mappings = mappings\n .merge(self.system_information)\n .merge(self.json_fields)\n .merge(self.record_fields)\n\n return mappings\n end",
"def _get_values\n _fields_map = get_flexi_fields_map\n\n @attributes.map do |k, v|\n field = _fields_map[k]\n raise \"Field - #{k} not defined\" if field.nil?\n VALUE.new(:field => field, value: self.send(:\"#{k}\"))\n end\n end",
"def record_fields\n mappings = {}\n if log_record?\n Rails.logger.debug(\"Aeon Fulfillment Plugin\") { \"Mapping Record: #{self.record}\" }\n end\n\n mappings['identifier'] = self.record.identifier || self.record['identifier']\n mappings['publish'] = self.record['publish']\n mappings['level'] = self.record.level || self.record['level']\n mappings['title'] = strip_mixed_content(self.record['title'])\n mappings['uri'] = self.record.uri || self.record['uri']\n\n resolved_resource = self.record['_resolved_resource'] || self.record.resolved_resource\n if resolved_resource\n resource_obj = resolved_resource[self.record['resource']]\n if resource_obj\n collection_id_components = [\n resource_obj[0]['id_0'],\n resource_obj[0]['id_1'],\n resource_obj[0]['id_2'],\n resource_obj[0]['id_3']\n ]\n\n mappings['collection_id'] = collection_id_components\n .reject {|id_comp| id_comp.blank?}\n .join('-')\n\n mappings['collection_title'] = resource_obj[0]['title']\n end\n end\n\n resolved_repository = self.record.resolved_repository\n if resolved_repository\n mappings['repo_code'] = resolved_repository['repo_code']\n mappings['repo_name'] = resolved_repository['name']\n end\n\n if self.record['creators']\n mappings['creators'] = self.record['creators']\n .select { |cr| cr.present? }\n .map { |cr| cr.strip }\n .join(\"; \")\n end\n\n if self.record.dates\n mappings['date_expression'] = self.record.dates\n .select{ |date| date['date_type'] == 'single' or date['date_type'] == 'inclusive'}\n .map{ |date| date['final_expression'] }\n .join(';')\n end\n\n if (self.record.notes['userestrict'])\n mappings['userestrict'] = self.record.notes['userestrict']\n .map { |note| note['subnotes'] }.flatten\n .select { |subnote| subnote['content'].present? and subnote['publish'] == true }\n .map { |subnote| subnote['content'] }.flatten\n .join(\"; \") \n end\n \n mappings\n end",
"def mapping\n {key => name}\n end",
"def dynamic_fields\n fields = []\n variant_combinations.each do |field_variants|\n FIELD_TYPES.each do |type|\n fields << DynamicField.new(type, field_variants)\n end\n end\n fields\n end",
"def mapping; end",
"def mapping; end",
"def record_fields\n mappings = {}\n\n mappings['identifier'] = self.record.identifier || self.record['identifier']\n mappings['publish'] = self.record['publish']\n mappings['level'] = self.record.level || self.record['level']\n mappings['title'] = strip_mixed_content(self.record['title'])\n mappings['uri'] = self.record.uri || self.record['uri']\n\n resolved_resource = self.record['_resolved_resource'] || self.record.resolved_resource\n if resolved_resource\n resource_obj = resolved_resource[self.record['resource']]\n if resource_obj\n mappings['collection_id'] = \"#{resource_obj[0]['id_0']} #{resource_obj[0]['id_1']} #{resource_obj[0]['id_2']} #{resource_obj[0]['id_3']}\".rstrip\n mappings['collection_title'] = resource_obj[0]['title']\n end\n end\n\n resolved_repository = self.record.resolved_repository\n if resolved_repository\n mappings['repo_code'] = resolved_repository['repo_code']\n mappings['repo_name'] = resolved_repository['name']\n end\n\n if record['creators']\n mappings['creators'] = self.record['creators']\n .select { |cr| cr.present? }\n .map { |cr| cr.strip }\n .join(\"; \")\n end\n\n if record.notes\n accessrestrict = record.notes['accessrestrict']\n if accessrestrict\n arSubnotes = accessrestrict['subnotes']\n if arSubnotes\n mappings['accessrestrict'] = arSubnotes\n .select { |arSubnote| arSubnote['content'].present? }\n .map { |arSubnote| arSubnote['content'].strip }\n .join(\"; \")\n end\n end\n end\n\n return mappings\n end",
"def mappings\n {\n 'propertyid' => 'property_id',\n 'prop_id' => 'vebra_ref',\n 'propid' => 'vebra_ref',\n 'firmid' => 'firm_id',\n 'branchid' => 'branch_id',\n 'lastchanged' => 'last_changed',\n 'solddate' => 'sold_on',\n 'leaseend' => 'lease_ends_on',\n 'soldprice' => 'sold_price',\n 'groundrent' => 'ground_rent',\n 'userfield1' => 'user_field_1', \n 'userfield2' => 'user_field_2' ,\n 'updated' => 'updated_at',\n 'FirmID' => 'firm_id',\n 'BranchID' => 'branch_id',\n 'web_status' => 'status',\n 'available' => 'available_on',\n 'uploaded' => 'uploaded_on',\n 'price' => 'price_attributes'\n }\n end",
"def get_qc_field_descriptions\n @qc_field_descs = {}\n QcFieldDescription.all.each do |desc|\n @qc_field_descs[ desc.qc_field.to_sym ] = desc\n end\n end",
"def _field_assignments\n result = []\n @fields.each do |field|\n field_type = field.type.type_sym # Record, Union, Enum, Array or Map\n schema_base_type = _schema_base_class(field.type)\n field_base_type = _field_type(schema_base_type)\n method_argument = %i(array map).include?(field_type) ? 'values' : 'value'\n is_schema_class = %i(record enum).include?(schema_base_type.type_sym)\n\n field_initialization = method_argument\n\n if is_schema_class\n field_initialization = \"#{field_base_type}.initialize_from_value(value)\"\n end\n\n result << {\n field: field,\n field_type: field_type,\n is_schema_class: is_schema_class,\n method_argument: method_argument,\n deimos_type: deimos_field_type(field),\n field_initialization: field_initialization\n }\n end\n\n result\n end",
"def history_additionals_fields_mapping fields\n history_additionals_fields_mapping = fields.with_indifferent_access\n\n define_method(:history_additionals_fields_mapping) do\n history_additionals_fields_mapping\n end\n end",
"def reflect_fields\n send_and_receive('admin/luke', params: { fl: '*', 'json.nl' => 'map' })['fields']\n end",
"def fields\n class_name.constantize.fields\n end",
"def lookups\n (instance_type::INTERNAL_ATTRIBUTES + @mapping.salesforce_fields).uniq.join(\", \")\n end",
"def process_mappings\n errors = 0\n content.each do |type, lines|\n fields = lines.shift\n klass = type.classify.constantize\n mappings[type] = []\n fields.each do |field|\n next if field == \"project_identifier\" && type == \"issues\"\n if field.match(/^customfield(\\d+)$/)\n cf = CustomField.where(:type => \"#{klass}CustomField\", :id => $1).first\n if cf.present?\n mappings[type] << cf\n else\n $stderr.puts \"Unable to find CustomField with type=#{klass}CustomField and id=#{$1}\"\n errors += 1\n end\n else\n if klass.column_names.include?(field) || klass.instance_methods.include?(:\"#{field}=\")\n mappings[type] << field\n else\n $stderr.puts \"No field #{klass}##{field}\"\n errors += 1\n end\n end\n end\n end\n exit 1 if errors > 0\n end",
"def fields_map\n {\n id: 'did/unitid[@label = \"Reference\"]',\n title: 'did/unittitle',\n repository: \"did/repository\",\n dates: 'did/unitdate',\n dates_normal: 'did/unitdate/@normal',\n extent: 'did/physdesc/extent',\n access: 'accessrestrict[not(@type=\"status\")]',\n custodial_history: 'custodhist',\n language: 'did/langmaterial/language',\n biog_hist: 'bioghist',\n description: 'scopecontent',\n arrangement: 'arrangement',\n related: 'relatedmaterial',\n pub_notes: 'bibliography/bibref',\n copyright: 'userestrict[@encodinganalog=\"Calm Copyright\"]'\n }\n end",
"def jiraAPIMapping\n mapping = Hash.new\n mp = @customFieldMap\n for i in 0..mp.size-1 do\n mapping[mp[i]['name']] = mp[i]['id']\n end\n\n return mapping\n end",
"def field_names\n @_field_path.map{ |field_| field_.name }\n end",
"def dynamic_fields\n default_columns.collect do |c|\n {\n :name => c[:name],\n :type => c[:attr_type] == :json ? :text : c[:attr_type], # store :json columns as :text\n :default => c[:default_value]\n }\n end\n end",
"def schema_mappings(**pairs)\n mappings = pairs.collect do |method, property|\n [method, property]\n end\n define_method(:mappings) do\n super() | mappings\n end\n end",
"def get_collection_map(labels_and_nicks, meta_map)\n collection_map = {}\n field_map = {}\n labels_and_nicks.each do |label, nick|\n field_map = meta_map.fetch(label)\n collection_map.store(nick, field_map)\n end\n # contentdm metadata fields\n collection_map.store('dmaccess', { :label => 'dmaccess', :namespace => 'cdm', :map => 'dmAccess', :type => nil, :vocab => nil})\n collection_map.store('dmimage', { :label => 'dmimage', :namespace => 'cdm', :map => 'dmImage', :type => nil, :vocab => nil})\n collection_map.store('restrictionCode', { :label => 'restrictionCode', :namespace => 'cdm', :map => 'restrictionCode', :type => nil, :vocab => nil})\n collection_map.store('cdmfilesize', { :label => 'cdmfilesize', :namespace => 'cdm', :map => 'fileSize', :type => nil, :vocab => nil})\n collection_map.store('cdmfilesizeformatted', { :label => 'cdmfilesizeformatted', :namespace => 'cdm', :map => 'fileSizeFormatted', :type => nil, :vocab => nil})\n collection_map.store('cdmprintpdf', { :label => 'cdmprintpdf', :namespace => 'cdm', :map => 'printPDF', :type => nil, :vocab => nil})\n collection_map.store('cdmhasocr', { :label => 'cdmhasocr', :namespace => 'cdm', :map => 'hasOCR', :type => nil, :vocab => nil})\n collection_map.store('cdmisnewspaper', { :label => 'cdmisnewspaper', :namespace => 'cdm', :map => 'isNewspaper', :type => nil, :vocab => nil})\n collection_map.store('dmaccess', { :label => 'dmaccess', 'category' => nil, :namespace => 'cdm', :map => 'dmAccess', :type => nil, :vocab => nil})\n collection_map.store('dmimage', { :label => 'dmimage', 'category' => nil, :namespace => 'cdm', :map => 'dmImage', :type => nil, :vocab => nil})\n collection_map.store('restrictionCode', { :label => 'restrictionCode', 'category' => nil, :namespace => 'cdm', :map => 'restrictionCode', :type => nil, :vocab => nil})\n collection_map.store('cdmfilesize', { :label => 'cdmfilesize', 'category' => nil, :namespace => 'cdm', :map => 'fileSize', :type => nil, :vocab => nil})\n collection_map.store('cdmfilesizeformatted', { :label => 'cdmfilesizeformatted', 'category' => nil, :namespace => 'cdm', :map => 'fileSizeFormatted', :type => nil, :vocab => nil})\n collection_map.store('cdmprintpdf', { :label => 'cdmprintpdf', 'category' => nil, :namespace => 'cdm', :map => 'printPDF', :type => nil, :vocab => nil})\n collection_map.store('cdmhasocr', { :label => 'cdmhasocr', 'category' => nil, :namespace => 'cdm', :map => 'hasOCR', :type => nil, :vocab => nil})\n collection_map.store('cdmisnewspaper', { :label => 'cdmisnewspaper', 'category' => nil, :namespace => 'cdm', :map => 'isNewspaper', :type => nil, :vocab => nil})\n collection_map\n end",
"def fields_for_type(type)\n return @field_mapping[type] || Set.new\n end",
"def all_fields\n return @all_fields if defined? @all_fields\n\n @all_fields ||= fields.includes(field_set: [:catalog]).each_with_object([]) do |field, all|\n all << field\n next unless field.is_a?(Field::ChoiceSet)\n\n field.choices.includes(:category).each do |choice|\n category = choice.category\n next unless category&.not_deleted?\n\n additional_fields = category.fields.includes(field_set: [:catalog]).map do |f|\n f.category_choice = choice\n f.category_choice_set = field.choice_set\n f\n end\n all.concat(additional_fields)\n end\n end\n end",
"def column_mappings\n raise SolidusImportProducts::AbstractMthodCall\n end",
"def get_field_deserializers()\n return {\n \"columnId\" => lambda {|n| @column_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"qualityId\" => lambda {|n| @quality_id = n.get_string_value() },\n }\n end",
"def get_field_names(template); end",
"def fieldmap\n { \n 'MEMBERID' => 'id',\n 'EMAIL' => 'email',\n 'FNAME' => 'first_name',\n 'LNAME' => 'last_name',\n 'ADDRESS' => 'address',\n 'CITY' => 'city',\n 'STATE' => 'state',\n 'ZIP' => 'zip',\n 'BIRTHDATE' => 'birth_date',\n 'MSINCEDATE' => 'member_since_date',\n 'BILLDATE' => 'next_retry_bill_date',\n 'EXTERNALID' => 'external_id',\n 'GENDER' => 'gender',\n 'PHONE' => 'full_phone_number',\n 'CJOINDATE' => 'current_join_date'\n }\n end",
"def fields\n call(\"Webs\", \"get_columns\").xpath(\"//sp:Field\", NS).map do |field|\n attributes = clean_attributes(field.attributes)\n supersite && supersite.field(attributes[\"ID\"].downcase) || Field.new(self, attributes[\"ID\"].downcase, attributes[\"StaticName\"], attributes[\"Type\"], nil, attributes) if attributes[\"ID\"] && attributes[\"StaticName\"]\n end.compact\n end",
"def canonical_fields(table_def)\n table_def.fields.inject([]) do |fields, f|\n fields << SpreeMigrateDB::FieldDef.new(canonical_table_name(f.table), f.column, f.type, f.options)\n end\n end",
"def fetch_fields\n fields = @result.fields\n field_types = @result.field_types\n tables = @result.respond_to?(:tables) ? @result.tables : [] # My addition to mysql2 results.c\n fields_arr = []\n ([email protected]).each do |i|\n fields_arr[i] = MySQL_FIELD.new(\n name: fields[i],\n table: tables[i],\n db: databases[i],\n type: field_types[i]\n )\n end\n return fields_arr\n end",
"def get_field_deserializers()\n return {\n \"costCenter\" => lambda {|n| @cost_center = n.get_string_value() },\n \"division\" => lambda {|n| @division = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def describe_index_fields(index_name, type)\n response = send_request(:get, path: \"#{index_name}/_mapping/#{type}\")\n if response.success?\n body = ActiveSupport::JSON.decode(response.body) if response.body.present?\n return if body.blank?\n fields = body[index_name.to_s][\"mappings\"][type.to_s][\"properties\"]\n\n fields.map do |field_name, properties|\n properties = Hash[ properties.map{|k,v| [k.to_sym, v]} ]\n type = properties.delete(:type)\n AgnosticBackend::Elasticsearch::RemoteIndexField.new field_name, type, **properties\n end\n end\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"locale\" => lambda {|n| @locale = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"addLicenses\" => lambda {|n| @add_licenses = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AssignedLicense.create_from_discriminator_value(pn) }) },\n \"removeLicenses\" => lambda {|n| @remove_licenses = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n }\n end",
"def field_names\n fields.keys\n end",
"def generic_document_fields(config_field)\n send(:\"document_#{config_field}s\")\n end",
"def generic_document_fields(config_field)\n send(:\"document_#{config_field}s\")\n end",
"def map_columns\n @map_columns ||= attribute_definitions.values.select { |c| c.type == :map }\n end",
"def map_datapackage_column_types(datapackage_json, csv_name)\n csv_dp_detail = datapackage_json[\"resources\"].detect{ |a| a[\"path\"] == csv_name }\n dp_column_types = {}\n csv_dp_detail[\"schema\"][\"fields\"].each do |sf|\n dp_column_types[sf[\"name\"]] = DATAPACKAGE_TYPE_MAP[sf[\"type\"]]\n end\n dp_column_types\n end",
"def field_indexes\r\n return @field_indexes\r\n end",
"def process_fields\n models.each do |key, model|\n table = translation.find(model.table_name)\n model = generate_fields_for model, table if table\n end\n end",
"def column_mappings\n @column_mappings ||= raw_column_mappings.map do |column_mapping|\n NdrImport::NonTabular::ColumnMapping.new(column_mapping)\n end\n end",
"def get_field_deserializers()\n return {\n \"configurationManagerDataConnectorConfigured\" => lambda {|n| @configuration_manager_data_connector_configured = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def attribute_map\n attribute_hash = {}\n embeds = embedded_relations.keys\n fields.reject do |k, _v|\n k =~ /^_id|created_at|updated_at|record_status$/ ||\n embeds.include?(k)\n end.each do |k, _v|\n attribute_hash[k.to_sym] = k.to_sym\n end\n attribute_hash\n end",
"def get_fields\n FIELD_DESCS\n end",
"def load_attributes!\n self.flexi_fields.map { |f| self.send(f.name.to_sym) }\n end",
"def advanced_search_legacy_field_mapping\n {\n author: 'search_author',\n title: 'search_title',\n subject: 'subject_terms',\n description: 'search',\n pub_info: 'pub_search',\n number: 'isbn_search'\n }\n end",
"def mapping\n {\n city: :locality,\n company: :org_name_address,\n department: :org_unit_address,\n }\n end",
"def manifestation_index_field_names\n Blacklight.config[:manifestation_index_fields][:field_names]\n end",
"def dynamo_fields\n DynamoField.find(:all, :conditions=>['model = ?', self.to_s]).map(&:field_name)\n end",
"def get_fields(centreX, centreY, zone = 5)\n # TODO: Get all fields in a specified area of the current map\n @fields = Hash.new\n self.terraformings.where(\"posx BETWEEN ? and ?\n AND posy BETWEEN ? and ?\",\n centreX-zone, centreX+zone,\n centreY-zone, centreY+zone).each do |field|\n @fields[\"#{field.posx};#{field.posy}\"] = field\n end\n @fields\n end",
"def subfield_x_collections\n return unless cocina_object.respond_to?(:structural) && cocina_object.structural\n\n collections = cocina_object.structural.isMemberOf\n collection_info = []\n\n collections.each do |collection_druid|\n collection = CocinaObjectStore.find(collection_druid)\n next unless ReleaseTags.released_to_searchworks?(cocina_object: collection)\n\n catalog_link = collection.identification&.catalogLinks&.find { |link| link.catalog == catalog }\n collection_info << { code: 'x', value: \"collection:#{collection.externalIdentifier.sub('druid:', '')}:#{catalog_link&.catalogRecordId}:#{Cocina::Models::Builders::TitleBuilder.build(collection.description.title)}\" }\n end\n\n collection_info\n end",
"def add_controlled_fields\n metadata_schema.controlled_field_names.each do |field_name|\n field = metadata_schema.get_field(field_name)\n raw_metadata_for_field = {}\n raw_metadata.each do |k, v|\n # Handle both camelCase and snake_case\n if k.match?(/#{field_name.downcase}(_\\d+)?/) || k.match?(/#{field_name.underscore}(_\\d+)?/)\n raw_metadata_for_field[k] = v\n end\n end\n next if raw_metadata_for_field.blank?\n\n all_values = raw_metadata_for_field.values.compact&.map { |value| value.split(/\\s*[|]\\s*/) }&.flatten\n parsed_metadata[field_name] = []\n next if all_values.blank?\n\n parsed_metadata.delete(field_name) # replacing field_name with field_name_attributes\n all_values.each_with_index do |value, i|\n auth_id = sanitize_controlled_field_uri(field, value)\n auth_id ||= search_authorities_for_id(field, value)\n auth_id ||= create_local_authority_id(field, value)\n next unless auth_id.present?\n\n parsed_metadata[\"#{field_name}_attributes\"] ||= {}\n parsed_metadata[\"#{field_name}_attributes\"][i] = { 'id' => auth_id }\n end\n end\n end",
"def definitions(key, field=nil)\n begin\n defs = self.definition_schema[key]\n if field.present?\n defs[field]\n else\n defs\n end\n rescue NoMethodError => e\n field_key = field.present? ? \"#{key}/#{field}\" : key\n ErrorTracker.report_exception(e, self.study.user, { missing_key: field_key, analysis_metadatum: self.attributes.to_h})\n Rails.logger.error \"Error accessing remote HCA Analysis metadata field definitions for #{field_key}: #{e.message}\"\n nil\n end\n end",
"def mappers\n configuration.mappers\n end",
"def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def typus_fields_for(filter)\n\n fields_with_type = ActiveSupport::OrderedHash.new\n\n begin\n fields = Typus::Configuration.config[name]['fields'][filter.to_s]\n fields = fields.extract_settings.collect { |f| f.to_sym }\n rescue\n return [] if filter == 'default'\n filter = 'default'\n retry\n end\n\n begin\n\n fields.each do |field|\n\n attribute_type = model_fields[field]\n\n if reflect_on_association(field)\n attribute_type = reflect_on_association(field).macro\n end\n\n if typus_field_options_for(:selectors).include?(field)\n attribute_type = :selector\n end\n\n # Custom field_type depending on the attribute name.\n case field.to_s\n when 'parent', 'parent_id' then attribute_type = :tree\n when /password/ then attribute_type = :password\n when 'position' then attribute_type = :position\n when /\\./ then attribute_type = :transversal\n end\n\n if respond_to?(:attachment_definitions) && attachment_definitions.try(:has_key?, field)\n attribute_type = :file\n end\n\n # And finally insert the field and the attribute_type\n # into the fields_with_type ordered hash.\n fields_with_type[field.to_s] = attribute_type\n\n end\n\n rescue\n fields = Typus::Configuration.config[name]['fields']['default'].extract_settings\n retry\n end\n\n return fields_with_type\n\n end",
"def fields\n displayed_fields = @display_fields.select { |display_field| @document.key?(display_field) }\n pairs = displayed_fields.map do |display_field|\n [display_field, Array.wrap(@document.fetch(display_field))]\n end\n Hash[pairs]\n end",
"def fields\n fields = orig_fields\n\n fields.instance_exec(self) do |content_type|\n fields.define_singleton_method(:add) do |field|\n content_type.update(fields: content_type.merged_fields(field))\n end\n\n fields.define_singleton_method(:create) do |params|\n field = Contentful::Management::Field.new\n Field.property_coercions.each do |key, _value|\n snakify_key = Support.snakify(key)\n param = params[snakify_key.to_sym]\n field.send(\"#{snakify_key}=\", param) if param\n end\n content_type.update(fields: content_type.merged_fields(field))\n end\n\n fields.define_singleton_method(:destroy) do |id|\n fields = content_type.fields.reject { |field| field.id == id }\n content_type.update(fields: fields)\n end\n end\n\n fields\n end",
"def fields\n return @fields if fields_registered?\n all_fields = SugarCRM.connection.get_fields(@name)\n @fields = all_fields[\"module_fields\"].with_indifferent_access\n @link_fields= all_fields[\"link_fields\"]\n handle_empty_arrays\n @fields_registered = true\n @fields\n end",
"def index_field_names\n Blacklight.config[:index_fields][:field_names]\n end",
"def search_field_list(lens = nil)\n blacklight_config(lens).search_fields.values\n end",
"def object_definition_mappings\n parsed_json = object_definition_metadata\n\n object_names = []\n parsed_json.each do |object_definition|\n object_names << object_definition[\"name\"].downcase\n end\n object_names\n end",
"def json_fields\n\n mappings = {}\n\n json = self.record.json\n return mappings unless json\n\n lang_materials = json['lang_materials']\n if lang_materials\n mappings['language'] = lang_materials\n .select { |lm| lm['language_and_script'].present? and lm['language_and_script']['language'].present?}\n .map{ |lm| lm['language_and_script']['language'] }\n .flatten\n .join(\";\")\n end\n\n language = json['language']\n if language\n mappings['language'] = language\n end\n\n\n notes = json['notes']\n if notes\n mappings['physical_location_note'] = notes\n .select { |note| note['type'] == 'physloc' and note['content'].present? and note['publish'] == true }\n .map { |note| note['content'] }\n .flatten\n .join(\"; \")\n\n mappings['accessrestrict'] = notes\n .select { |note| note['type'] == 'accessrestrict' and note['subnotes'] }\n .map { |note| note['subnotes'] }\n .flatten\n .select { |subnote| subnote['content'].present? and subnote['publish'] == true}\n .map { |subnote| subnote['content'] }\n .flatten\n .join(\"; \")\n end\n\n if json['dates']\n json['dates']\n .select { |date| date['expression'].present? }\n .group_by { |date| date['label'] }\n .each { |label, dates|\n mappings[\"#{label}_date\"] = dates\n .map { |date| date['expression'] }\n .join(\"; \")\n }\n end\n\n\n if json['linked_agents']\n mappings['creators'] = json['linked_agents']\n .select { |l| l['role'] == 'creator' and l['_resolved'] }\n .map { |l| l['_resolved']['names'] }.flatten\n .select { |n| n['is_display_name'] == true}\n .map { |n| n['sort_name']}\n .join(\"; \")\n end\n\n if json['rights_statements']\n mappings['rights_type'] = json['rights_statements'].map{ |r| r['rights_type']}.uniq.join(';')\n end\n\n digital_instances = json['instances'].select { |instance| instance['instance_type'] == 'digital_object'}\n if (digital_instances.any?)\n mappings[\"digital_objects\"] = digital_instances.map{|d| d['digital_object']['ref']}.join(';')\n end\n\n mappings['restrictions_apply'] = json['restrictions_apply']\n mappings['display_string'] = json['display_string']\n\n instances = self.container_instances\n return mappings unless instances\n\n mappings['requests'] = instances\n .each_with_index\n .map { |instance, i|\n request = {}\n \n instance_count = i + 1\n\n request['Request'] = \"#{instance_count}\"\n\n request[\"instance_is_representative_#{instance_count}\"] = instance['is_representative']\n request[\"instance_last_modified_by_#{instance_count}\"] = instance['last_modified_by']\n request[\"instance_instance_type_#{instance_count}\"] = instance['instance_type']\n request[\"instance_created_by_#{instance_count}\"] = instance['created_by']\n\n container = instance['sub_container']\n return request unless container\n\n request[\"instance_container_grandchild_indicator_#{instance_count}\"] = container['indicator_3']\n request[\"instance_container_child_indicator_#{instance_count}\"] = container['indicator_2']\n request[\"instance_container_grandchild_type_#{instance_count}\"] = container['type_3']\n request[\"instance_container_child_type_#{instance_count}\"] = container['type_2']\n request[\"instance_container_last_modified_by_#{instance_count}\"] = container['last_modified_by']\n request[\"instance_container_created_by_#{instance_count}\"] = container['created_by']\n\n top_container = container['top_container']\n return request unless top_container\n\n request[\"instance_top_container_ref_#{instance_count}\"] = top_container['ref']\n\n top_container_resolved = top_container['_resolved']\n return request unless top_container_resolved\n\n request[\"instance_top_container_long_display_string_#{instance_count}\"] = top_container_resolved['long_display_string']\n request[\"instance_top_container_last_modified_by_#{instance_count}\"] = top_container_resolved['last_modified_by']\n request[\"instance_top_container_display_string_#{instance_count}\"] = top_container_resolved['display_string']\n request[\"instance_top_container_restricted_#{instance_count}\"] = top_container_resolved['restricted']\n request[\"instance_top_container_created_by_#{instance_count}\"] = top_container_resolved['created_by']\n request[\"instance_top_container_indicator_#{instance_count}\"] = top_container_resolved['indicator']\n request[\"instance_top_container_barcode_#{instance_count}\"] = top_container_resolved['barcode']\n request[\"instance_top_container_type_#{instance_count}\"] = top_container_resolved['type']\n request[\"instance_top_container_uri_#{instance_count}\"] = top_container_resolved['uri']\n\n if (top_container_resolved['container_locations'])\n request[\"instance_top_container_location_note_#{instance_count}\"] = top_container_resolved['container_locations'].map{ |l| l['note']}.join{';'}\n end\n\n request[\"requestable_#{instance_count}\"] = (top_container_resolved['active_restrictions'] || [])\n .map{ |ar| ar['local_access_restriction_type'] }\n .flatten.uniq\n .select{ |ar| (self.repo_settings[:hide_button_for_access_restriction_types] || []).include?(ar)}\n .empty?\n\n locations = top_container_resolved[\"container_locations\"]\n if locations.any?\n location_id = locations.sort_by { |l| l[\"start_date\"]}.last()[\"ref\"]\n location = archivesspace.get_location(location_id)\n request[\"instance_top_container_location_#{instance_count}\"] = location['title']\n request[\"instance_top_container_location_id_#{instance_count}\"] = location_id\n request[\"instance_top_container_location_building_#{instance_count}\"] = location['building']\n end\n\n collection = top_container_resolved['collection']\n if collection\n request[\"instance_top_container_collection_identifier_#{instance_count}\"] = collection\n .select { |c| c['identifier'].present? }\n .map { |c| c['identifier'] }\n .join(\"; \")\n\n request[\"instance_top_container_collection_display_string_#{instance_count}\"] = collection\n .select { |c| c['display_string'].present? }\n .map { |c| c['display_string'] }\n .join(\"; \")\n end\n\n series = top_container_resolved['series']\n if series\n request[\"instance_top_container_series_identifier_#{instance_count}\"] = series\n .select { |s| s['identifier'].present? }\n .map { |s| s['identifier'] }\n .join(\"; \")\n\n request[\"instance_top_container_series_display_string_#{instance_count}\"] = series\n .select { |s| s['display_string'].present? }\n .map { |s| s['display_string'] }\n .join(\"; \")\n\n end\n\n request\n }\n\n mappings\n end",
"def get_field_deserializers()\n return {\n \"defaultDomainName\" => lambda {|n| @default_domain_name = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"federationBrandName\" => lambda {|n| @federation_brand_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n }\n end",
"def indexable_fields\n self.class.props.map { |key| key.to_s }\n end"
] | [
"0.6237863",
"0.62130094",
"0.62124634",
"0.59520185",
"0.57564276",
"0.57145846",
"0.57145846",
"0.56560385",
"0.56560385",
"0.5632446",
"0.5610524",
"0.5600444",
"0.55822104",
"0.5579219",
"0.55511475",
"0.5522536",
"0.5484111",
"0.5474731",
"0.5439302",
"0.5392655",
"0.5366521",
"0.535829",
"0.5356877",
"0.53265446",
"0.53192985",
"0.5316571",
"0.5307201",
"0.53054154",
"0.5288328",
"0.52719283",
"0.52712935",
"0.5262022",
"0.5254395",
"0.5213831",
"0.52029157",
"0.5187454",
"0.5172518",
"0.5171457",
"0.5164546",
"0.5148226",
"0.5148226",
"0.5144429",
"0.51422966",
"0.5138587",
"0.51349664",
"0.5125368",
"0.5116461",
"0.5101559",
"0.5093481",
"0.5091053",
"0.50845313",
"0.5072131",
"0.506215",
"0.5061253",
"0.50478864",
"0.50442106",
"0.5029189",
"0.5027031",
"0.50256515",
"0.502305",
"0.5017743",
"0.50155354",
"0.50139195",
"0.5009278",
"0.5004106",
"0.49870968",
"0.49714",
"0.49686465",
"0.4968207",
"0.49512362",
"0.4944407",
"0.4944407",
"0.49359396",
"0.49288604",
"0.49208543",
"0.49152976",
"0.4895282",
"0.48900896",
"0.488818",
"0.4887099",
"0.4884942",
"0.48845845",
"0.48777658",
"0.4876753",
"0.48722157",
"0.48669678",
"0.48658517",
"0.48654717",
"0.48609564",
"0.4860021",
"0.48555928",
"0.48548642",
"0.48543513",
"0.48509505",
"0.4841002",
"0.48405004",
"0.484045",
"0.48373616",
"0.48333123",
"0.48321366",
"0.48313102"
] | 0.0 | -1 |
gets all answers for the given question id | def create
questionId = params[:questionId]
answerId = params[:answerId]
answer = params[:answer]
numAnswers = params[:numAnswers].to_i
begin
success = ParseManager.createUserAnswer(answer, answerId, questionId)
numAnswers -= 1
end until numAnswers == 0
render json:success
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def get_answers_for_question(question_id)\n answers = Array.new\n question = Question.find_by_id(question_id, :include => :answers)\n question.answers.each do |ans|\n answers << ans\n end\n return answers\n end",
"def answers\n return Answer.where(question_id: self.id) \n end",
"def all_answers_for(question)\n answers.select {|a| a.question == question}\n end",
"def retrieve( answer_id )\n answers = @all_answers[ answer_id ]\n ( answers && answers.possibilities ) || []\n end",
"def get_answers(company_id)\n self.answers.select {|answer| answer.user.company_id == company_id }\n end",
"def answer_by_id(question, id)\n\t\t\t\tbegin\n\t\t\t\t\tanswer = question.answers.find(id)\n\t\t\t\trescue ActiveRecord::RecordNotFound\n\t\t\t\t\thalt 404\n\t\t\t\tend\n\t\t\tend",
"def get_questions int_id\r\n @all_questions = Questionare.find_by_interview_id int_id\r\n end",
"def correct_answers_by_quiz(quiz)\n full_list_of_answers = self.correct_answers #gets correct_answers on the current user instance.\n correct_answers_from_quiz = full_list_of_answers.select {|answer| answer.quiz_id == quiz.id} #selects answers whose quiz_id matches the passed in quiz's id. Makes an array of correct answers by quiz for this user instance\n end",
"def answers(options={})\n @answers = self.class.parse_answers(request(singular(question_id) + \"/answers\", options))\n end",
"def find_answers_from_db\n answers_from_db = get_questions_from_db\n answers_from_db.each do |answer_from_db|\n @answers.add answer_from_db[:answer]\n break if @answers.length >= @answer_limit\n end\n @answers.to_a\n end",
"def find_wrong_answers(id)\n wrong_answers = get_incresults(UserAnswer.all)\n arr = [] \n wrong_answers.select do |v|\n if v.question_id == id && v.is_right == false \n a = Answer.find(v.choice_id).answer\n arr << a \n end\nend\narr\nend",
"def all_answered_questions\n self.all_answered_options.map{ |answer| answer.question }\n end",
"def getResponses(surveyId)\n return survey_responses.where({:survey_id => surveyId})\n end",
"def show\n @questions = Question.find(params[:id])\n @answers = @question.answers.all\n end",
"def answers(options={})\n parse_answers(request(singular(id) + \"answers\", options))\n end",
"def questions\n results = CONNECTION.execute(\"SELECT * FROM questions WHERE student_id = #{@id};\")\n \n results_as_objects = []\n \n results.each do |result_hash|\n results_as_objects << Question.new(result_hash[\"id\"], result_hash[\"student_id\"], result_hash[\"content\"])\n end\n \n return results_as_objects\n end",
"def show\n @question = Question.find(params[:id])\n @answerlist = Answer.where(\"question_id = ?\", @question.id )\n \n end",
"def get_answers_list\n @answers = Answer.find_all_by_questionare_id params[:q_id]\n unless @answers.blank?\n render :partial => \"answers_list\"\n else\n render :text => \"No Record Found\"\n end\n end",
"def all_correct_answers\n self.all_answered_options.select{|answer| answer.correct}\n end",
"def replies\n Reply.find_by_question_id(@id)\n end",
"def get_answers\n @answers\n end",
"def show\n # id from url comes in as :id key of params hash\n @question = Question.find(params[:id])\n\n @answers = @question.answers.order(created_at: :desc)\n end",
"def build_answers\n existing_answers = answers.index_by &:question_id\n survey.questions.each do |q|\n next if existing_answers.has_key? q.id\n answers.build question: q\n end\n end",
"def find_response(answer_id)\n self.responses.find_by_answer_id(answer_id)\n end",
"def answer_a_question\n user = current_user\n render_401 and return unless user\n question = ShortQuestion.find_by_id(params[:id])\n render_404 and return unless question\n\n obj = {\n :qid => params[:id],\n :answer => params[:choice]\n }\n \n answers = {}\n $r.multi do\n $r.lpush(\"user:#{user.id}:questions\", obj)\n $r.hincrby(\"question:#{question.id}:answers\", \"choice#{params[:choice]}\", 1)\n choices = $r.hget(\"question:#{question.id}:answers\", :num_choices)\n for i in 1..choices\n answers[i] = $r.hget(\"question:#{question.id}:answers\", \"choice#{i}\")\n end\n end\n render :json => {\n :success => true,\n :answers => answers\n }\n end",
"def answers\n request('answers')\n end",
"def set_responses\n\t\t@responses = Response.where(question_id: params[:id] ) rescue nil\n\tend",
"def index\n @quizzes_answers = Quizzes::Answer.all\n end",
"def index\n @question_answers = QuestionAnswer.all\n end",
"def answers\n @answers ||= generate_answers\n end",
"def answers_for_phase( phase_id )\n @user_quiz_answers ||= self.user_quiz_answers#( :include => { :quiz_learning_blurbs => affiliate_products } )\n @user_quiz_answers.select { |uqa| uqa.quiz_answer.quiz_question.quiz_phase_id == phase_id }\n end",
"def get_choices\n @choices = CONNECTION.execute(\"SELECT * FROM choices WHERE question_id = #{@id};\")\n end",
"def index\n\t\t@answers = Answer.all\n\tend",
"def answers\n []\n end",
"def show\n idx = params[:id]\n @question = Question.find(params[:id])\n @newAnswer = Answer.new(:question_id => params[:id])\n @Answers = Answer.where(question_id: idx)\n @answer = Answer.all\n end",
"def get_questions\n result = QuizQuestion.includes(:quiz_answers).where(quiz_id: params[:id])\n\n @questions = result.map { |question| QuestionPresenter.new(question) }\n end",
"def current_answers\n if assessment.randomization.nil?\n # Filtering by question ids is not needed for non-randomized assessment as it adds more query time.\n filtered_answers = answers\n else\n # Can't do filtering in AR because `answer` may not be persisted, and AR is dumb.\n question_ids = questions.pluck(:id)\n filtered_answers = answers.select { |answer| answer.question_id.in? question_ids }\n end\n filtered_answers.select(&:current_answer?).group_by(&:question_id).map { |pair| pair[1].first }\n end",
"def answers\n return @answers\n end",
"def show\n @quiz = params[:quiz_id]\n @fake_answers = FakeAnswer.where(question_id: params[:id])\n end",
"def answers(options={})\n self.class.parse_answers(request(singular(user_id) + \"/answers\", options))\n end",
"def answer_list\n answers = Quiz.where(id: params[:ids]).map{|quiz| [quiz.id => quiz.answer]}\n render json: {status: 200, answers: answers.flatten, msg: \"Success.\"}\n end",
"def answers\n object.answers.collect do |a|\n {\n id: a.id,\n user_id: a.user_id,\n alternative_id: a.alternative_id\n }\n end\n end",
"def get_quest\n\t\tget_data\n\n\t\t$finish = false\n\t\tunless $finish == true\n\t\t\t$randId = rand(0...(@data.length-1))\n\t\t\twhile $quiz_arr.include?(@data[$randId]['id'])\n\t\t\t\t$randId = rand(0...(@data.length-1))\n\t\t\tend\n\t\t\t$quiz_arr.push(@data[$randId]['id'])\n\t\t\t$i += 1\n\n\t\t\tif $i == 7\n\t\t\t\t$finish = true\n\t\t\tend\n\n\t\t\t@quest = @data[$randId]['question_name']\n\t\t\t@c_answer = @data[$randId]['c_answer']\n\t\t\t@alt1 = @data[$randId]['alt1']\n\t\t\t@alt2 = @data[$randId]['alt2']\n\t\t\t@alt3 = @data[$randId]['alt3']\n\t\t\t@imgurl = @data[$randId]['imgurl']\n\t\t\t@url = @data[$randId]['news_url']\n\t\t\t@cat = @data[$randId]['category_id']\n\t\t\t@hex = @data[$randId]['category_hex_code']\n\t\t\tget_descriptions(@url)\n\t\t\t@image = @desc_data['image']\n\n\t\t\t$answer_array = Array.new()\n\t \tend\n\tend",
"def replies\n Reply.find_by_question_id(self.id)\n end",
"def index\n #show answers for particular survey\n @survey = Survey.find(params[:survey_id])\n @answers = @survey.answers.order(\"question_id, created_at\")\n \n #show answers for specific question\n if (params[:question_id])\n @question = Question.find(params[:question_id])\n @answers = @question.answers.order(\"question_id, created_at\")\n end\n #show answers for specific response\n if (params[:response_id])\n @response = Response.find(params[:response_id])\n @answers = @response.answers.order(\"question_id\")\n end\n end",
"def answers\n extracted_answers = []\n\n unless self.qp_values.nil?\n self.qp_values.each do |answer| \n extracted_answers.push(ResponseAnswer.new(answer))\n end \n end\n\n return extracted_answers \n end",
"def index\n @asked_to_answers = AskedToAnswer.all\n end",
"def answers(ids=nil, **params)\n resource_request(Answer, ids, 'answers', params)\n end",
"def answers_for_question(question)\n @answers_for_question ||= {}\n @answers_for_question[question] ||= Answer.first_level_only\n .joins(:form_item)\n .where(response_id: responses.map(&:id))\n .where(\"form_items.question_id\" => question.id)\n .index_by(&:response_id)\n end",
"def index\n @answers = eager_answer.joins(:userpoll).where(userpolls: {user_id: current_user.id})\n end",
"def get_questionnaires\n @get_questionnaires ||= questionnaire_service.search('context-type-value': get_use_context)\n end",
"def correct_answers\n correct_answers = self.answers.where(truthiness: true) #for this current user instance (self), gets all the answers where the truthiness is true (set during question/answer creation)\n end",
"def question\n Question.find_by_id(questions_id)\n end",
"def index\n @answers = @question.answers\n respond_with( @answers )\n end",
"def answer\n @form_data = Form.get_published_form(params[:code])\n if @form_data.nil?\n redirect_to \"/dashboard\"\n else\n @questions = Question.get_questions_by_ids(@form_data['id'], JSON.parse(@form_data['question_order']))\n @all_options = Option.collect_options_per_quetions(JSON.parse(@form_data['question_order']))\n end\n end",
"def remove( answer_id )\n answers = retrieve( answer_id )\n @all_answers.delete( answer_id )\n serialize\n answers\n end",
"def show\n @answers = Answer.where(survey_id: params[:id])\n @survey = ISurvey.find_by_id(params[:id])\n #Empty dict to fill with precache (to prevent mass queries)\n @users = {}\n end",
"def index\n @quiz_answers = QuizAnswer.all\n end",
"def index\n @dei_field_answers = DeiFieldAnswer.all\n end",
"def index\n @question_option_selections = @question_answer.question_option_selections\n end",
"def index\n @answers = Answer.all\n end",
"def index\n @answers = Answer.all\n end",
"def index\n @answers = Answer.all\n end",
"def index\n @answers = Answer.all\n end",
"def index\n @answers = Answer.all\n end",
"def all_answered_options\n self.user_answers.map{ |answer| answer.answer_option}\n end",
"def answers_by_votes(options={})\n parse_answers(request(singular(id) + \"answers/votes\", options))\n end",
"def survey_answers\n survey_questions.map(&:survey_answers).flatten\n end",
"def with_answers\n @questions = Question.answered\n render(:action => \"index\")\n end",
"def show\n \n @dquestion = Dquestion.find(params[:id])\n session[:quest_id] = @dquestion.id\n @danswers = Danswer.where(dquestion_id: @dquestion.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: [@dtest, @dquestion] }\n end\n end",
"def index\n @answers=Answer.all\n end",
"def index\n @responses = @survey.responses\n @questions = Question.all\n end",
"def questions\n self.class.get(\"/2.2/questions\", @options)\n end",
"def get_question(form_name, id)\n get_form(form_name)[:questions][id]\n end",
"def quiz_questions\n @questions = set_quiz.questions\n end",
"def answer_read(id)\n loop do\n debug \"Waiting for answer #{id}\\n\" if @debug\n answer = @answers[id].pop\n debug \"Returning answer #{id}\\n\" if @debug\n\n if answer.is_a?(Hash) and type = answer[:type]\n if type == :error and class_str = answer[:class] and msg = answer[:msg] and bt_orig = answer[:bt]\n begin\n raise \"#{class_str}: #{msg}\"\n rescue => e\n bt = []\n bt_orig.each do |btline|\n bt << \"(#{@pid}): #{btline}\"\n end\n\n bt += e.backtrace\n e.set_backtrace(bt)\n raise e\n end\n elsif type == :proxy_obj && id = answer[:id] and pid = answer[:pid]\n return proxyobj_get(id, pid)\n elsif type == :proxy_block_call and block = answer[:block] and args = answer[:args] and queue = answer[:queue]\n #Calls the block. This is used to call the block from the same thread that the answer is being read from. This can cause problems in Hayabusa, that uses thread-variables to determine output and such.\n block.call(*args)\n\n #Tells the parent thread that the block has been executed and it should continue.\n queue << true\n else\n return answer\n end\n else\n return answer\n end\n end\n\n raise \"This should never be reached.\"\n end",
"def getanswerable\n @the_question = Question.find(params[:id])\n @user_id = session[:user_id]\n if @the_question.user.id == @user_id\n render json: [{question: @the_question}]\n end\n end",
"def get_questions(module_id, version)\n formatted_questions = []\n questions = @redis.lrange(\"aes:unit:#{module_id}:#{version}:questions\", \"0\", \"-1\")\n questions.each do |question_string|\n formatted_questions << JSON.parse(question_string)\n end\n formatted_questions\n end",
"def answer\n if answered?\n answers.last.answer\n else\n [{:answer => \"not answered\"}]\n end\n end",
"def index\n @answers = Answer.all\n \n end",
"def get_3_random_answers(company_id)\n get_answers(company_id).sample(3)\n end",
"def set_questionary_and_results\n @questionary = Questionary.find(params[:id])\n @questionary_results = QuestionaryResult.where(questionary_id: params[:id])\n end",
"def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case question.type\n\n when :none\n answer = question.answers.first\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => data\n })\n\n when :one\n # the value is the reference identifier of the target answer\n answer = question.answers.where(reference_identifier: data).first\n\n unless answer.nil?\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :any\n # the value is an array of the chosen answers\n answers = question.answers.where(reference_identifier: data)\n answers.each do |answer|\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :repeater\n # the value is an array of answers\n answer = question.answers.first\n i = 0\n data.each do |value|\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => value,\n response_group: i\n })\n i += 1\n end\n\n else\n throw \"not handled> #{question.inspect}\"\n end\n\n end",
"def answer question\n\n # find the value that should be entered\n data = request[question[:reference_identifier]]\n\n response_set.responses.where(question_id: question).delete_all\n\n case question.type\n\n when :none\n answer = question.answers.first\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => data\n })\n\n when :one\n # the value is the reference identifier of the target answer\n answer = question.answers.where(reference_identifier: data).first\n\n unless answer.nil?\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :any\n # the value is an array of the chosen answers\n answers = question.answers.where(reference_identifier: data)\n answers.each do |answer|\n response_set.responses.create({\n answer: answer,\n question: question\n })\n end\n\n when :repeater\n # the value is an array of answers\n answer = question.answers.first\n i = 0\n data.each do |value|\n response_set.responses.create({\n answer: answer,\n question: question,\n answer.value_key => value,\n response_group: i\n })\n i += 1\n end\n\n else\n throw \"not handled> #{question.inspect}\"\n end\n\n end",
"def question_by_id(id)\n\t\t\t\tbegin \n\t\t\t\t\tquestion = Question.find(id)\n\t\t\t\trescue ActiveRecord::RecordNotFound\n\t\t\t\t\thalt 404\n\t\t\t\tend\n\t\t\tend",
"def answers_by_views(options={})\n parse_answers(request(singular(id) + \"answers/views\", options))\n end",
"def index\n @answers = @question.answers.all\n\n respond_to_index\n end",
"def appt_questionnaires\n base_qm[:questionnaire].each_with_object({}) do |quest, acc|\n questionnaire_id = quest['id']\n acc[questionnaire_id] = quest\n end\n end",
"def getResponse(surveyId, questionId)\n return survey_responses.where({:survey_id => surveyId, :survey_question_id => questionId}).first\n end",
"def index\n @given_answers = GivenAnswer.all\n end",
"def from_question(question_id)\n where(question_id: question_id)\n end",
"def from_question(question_id)\n where(question_id: question_id)\n end",
"def list_questions_in_quiz(course_id,quiz_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"quiz_id is required\" if quiz_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :quiz_id => quiz_id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/quizzes/{quiz_id}/questions\",\n :course_id => course_id,\n :quiz_id => quiz_id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response.map {|response|QuizQuestion.new(response)}\n end",
"def index\n @answer_respondents = AnswerRespondent.all\n end",
"def index\n @audio_quiz_answers = AudioQuizAnswer.all\n end",
"def index\n @pub_quiz_answers = PubQuizAnswer.all\n end",
"def index\n @selected_answers = SelectedAnswer.all\n end",
"def answers\n [answer_1, answer_2]\n end",
"def answers\n @answers ||= Factory.load_answers_at_machine(@location, @load_scores)\n end",
"def find_answers_from_query\n locations = get_places_from_db\n\n locations.each do |location|\n query_answers = @query.results location[:city]\n query_answers.each do |query_answer|\n @answers.add query_answer[:answer]\n break if @answers.length >= @answer_limit\n end\n break if @answers.length >= @answer_limit\n end\n @answers.to_a\n end",
"def answers\n @answers ||= {}\n end"
] | [
"0.8286245",
"0.73799884",
"0.72958106",
"0.7107213",
"0.68788236",
"0.6818334",
"0.67468685",
"0.66474044",
"0.6608249",
"0.6598092",
"0.6516267",
"0.65018827",
"0.64631706",
"0.6420905",
"0.6408637",
"0.63946235",
"0.63900703",
"0.63855916",
"0.6349807",
"0.6319654",
"0.619112",
"0.6190231",
"0.61875606",
"0.617343",
"0.6147797",
"0.6137621",
"0.6132501",
"0.61113936",
"0.6101187",
"0.60934407",
"0.60868067",
"0.6056363",
"0.6053731",
"0.6041456",
"0.60409397",
"0.6039265",
"0.60368663",
"0.6030616",
"0.59968346",
"0.59710205",
"0.59702975",
"0.5967629",
"0.59633386",
"0.5962224",
"0.5945371",
"0.5942646",
"0.5928737",
"0.5924812",
"0.5912857",
"0.58905256",
"0.5876403",
"0.5871548",
"0.5860345",
"0.5857007",
"0.5839344",
"0.5826638",
"0.5818267",
"0.5815931",
"0.58137673",
"0.58005714",
"0.5788462",
"0.5788462",
"0.5788462",
"0.5788462",
"0.5788462",
"0.57744265",
"0.5742792",
"0.5740771",
"0.5737108",
"0.5735223",
"0.5734419",
"0.57212734",
"0.5720274",
"0.5717882",
"0.57148904",
"0.5708769",
"0.5701034",
"0.5699367",
"0.5698604",
"0.5684434",
"0.5684152",
"0.5683926",
"0.56810856",
"0.56810856",
"0.5670213",
"0.566919",
"0.5667088",
"0.5659542",
"0.5656282",
"0.5646143",
"0.56450886",
"0.56450886",
"0.56439126",
"0.56231767",
"0.5622811",
"0.56226826",
"0.5616358",
"0.5607748",
"0.5605397",
"0.56027406",
"0.55930936"
] | 0.0 | -1 |
This fxn exists to provide the API consistent with John's request for the 689R class. Options may include a list of fragment classes as symbols (i.e. :b, :y) | def fragment(pep_seq, options={}) # TODO handle an intensity option to handle normalization and scaling...?
set_options(options) unless options.empty?
generate_fragment_masses(pep_seq)
@list.map(&:mass)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def update_options_with_class!(options, klass)\n options[:class] ||= ''\n options[:class] << \" #{klass}\"\n options\n end",
"def object_serialization_options\n {\n :except => [:site_id, :node_type, :position],\n :include => {\n :fields => {\n :except => [:variant_id, :position],\n :methods => [:classification,:options]\n }\n }\n }\n end",
"def update_options_with_class!(options, klass)\n @template.update_options_with_class!(options, klass)\n end",
"def initialize(**options)\n @type = options[:type]\n @uri = options[:uri]\n @class_name ||= Lotus::Utils::String.new(\"#{@type}_adapter\").classify\n end",
"def parse_def(opt)\n\t\t# Determines for definition string: class, body and default.\n\t\t# The determined class is either a special one (by signature at the beginning),\n\t\t# a \"value_option\" (by a '=' in the string) or otherwise a \"plain_option\".\n\t\tklass = nil\n\t\tword = opt\n\t\t@special_class.keys.each do |sig|\n\t\t\tif opt.index(sig) == 0\n\t\t\t\tword = opt[sig.length .. -1]\n\t\t\t\tklass = @special_class[sig]\n\t\t\t\tbreak\n\t\t\tend\n\t\tend\n\t\teqs = /=/\n\t\tif eqs.match word\n\t\t\tbody, value = word.split(eqs, 2)\n\t\t\tvalue = nil if value.empty?\n\t\t\tklass ||= @value_option\n\t\telse\n\t\t\tbody = word\n\t\t\tvalue = nil\n\t\t\tklass ||= @plain_option\n\t\tend\n\t\t[klass, body, value]\n\tend",
"def initialize(options)\n @classes = options[:classes]\n super\n end",
"def append_class_name! options, class_name\n key = options.has_key?('class') ? 'class' : :class \n unless options[key].to_s =~ /(^|\\s+)#{class_name}(\\s+|$)/\n options[key] = \"#{options[key]} #{class_name}\".strip\n end\n options\n end",
"def processor_options(options)\n opts = { output_file_service: output_file_service }\n encode_class = options.delete(:encode_class)\n opts = opts.merge(encode_class: encode_class) if encode_class\n opts\n end",
"def object_serialization_options\n {:except => [:variant_id, :type, :position], :methods => [:classification, :options]}\n end",
"def options(uri, options = T.unsafe(nil)); end",
"def options_for_class(klass)\n DoesKeyValue.log(\"State: Querying options_for_class for class:#{klass.to_s}\")\n @classes[klass.to_s] rescue {}\n end",
"def class_name_from_options_object_or_class_name(class_name, options={})\n if options.has_key?(:object)\n options[:object].class\n else\n klass = class_name.to_s.classify.constantize\n end \n end",
"def default_options\n {:engine => :coderay, :fragment => 10}\n end",
"def select_type\n case @options[\"format\"]\n when \"rdfxml\" then 'application/rdf+xml'\n when \"ntriples\" then 'text/plain'\n when \"turtle\" then 'application/x-turtle'\n when \"n3\" then 'text/rdf+n3'\n when \"trix\" then 'application/trix'\n when \"trig\" then 'application/x-trig'\n else 'Unknown'\n end\n end",
"def get_options_for(classname , *a)\n\t\treturn GreyGoo::Options.get_options_for(classname, player, *a)\n\tend",
"def class_name_parameters(class_def)\n\n\n\n # 32:7: '<' ( class_special_identifier[class_def] )* '>'\n match(:LEFT_ANGULAR_BRACKET)\n class_def.name += '<'\n # 33:7: ( class_special_identifier[class_def] )*\n while true\n alt5 = 2\n # ()* loopback of 33:7: ( class_special_identifier[class_def] )*\n look_ahead5_0 = look_ahead(1)\n if look_ahead5_0 == :RIGHT_ANGULAR_BRACKET \n # ()* loopback of 33:7: ( class_special_identifier[class_def] )*\n look_ahead5_1 = look_ahead(2)\n if look_ahead5_1 == :EXTENDS \n # ()* loopback of 33:7: ( class_special_identifier[class_def] )*\n look_ahead5_3 = look_ahead(3)\n if look_ahead5_3 == :IDENTIFIER \n # ()* loopback of 33:7: ( class_special_identifier[class_def] )*\n look_ahead5_5 = look_ahead(4)\n if (TOKENS[look_ahead5_5] >= 5 && TOKENS[look_ahead5_5] <= 6) || (TOKENS[look_ahead5_5] >= 25 && TOKENS[look_ahead5_5] <= 28) \n alt5 = 1\n end\n elsif look_ahead5_3 == :EXTENDS || (TOKENS[look_ahead5_3] >= 25 && TOKENS[look_ahead5_3] <= 28) \n alt5 = 1\n end\n elsif look_ahead5_1 == :IDENTIFIER || (TOKENS[look_ahead5_1] >= 25 && TOKENS[look_ahead5_1] <= 28) \n alt5 = 1\n end\n elsif (TOKENS[look_ahead5_0] >= 5 && TOKENS[look_ahead5_0] <= 6) || look_ahead5_0 == :LEFT_ANGULAR_BRACKET || (TOKENS[look_ahead5_0] >= 27 && TOKENS[look_ahead5_0] <= 28) \n alt5 = 1\n end\n case alt5\n when 1\n # 33:9: class_special_identifier[class_def]\n class_special_identifier(class_def)\n\n else\n break\n end\n end\n match(:RIGHT_ANGULAR_BRACKET)\n class_def.name += '>'\n\n\n\n end",
"def parse_class\n [object_ref, @tokens.next]\n end",
"def class_for(fragment, *args)\n item_class = class_from(fragment, *args) or raise DeserializeError.new(\":class did not return class constant.\")\n item_class.new\n end",
"def lighting_class_params\n params.fetch(:lighting_class, {})\n end",
"def options\n { discriminator: @discriminator, types: @types }\n end",
"def get_request_options(options) # :nodoc:\n options = @options.merge(options)\n \n options[:out] = 'json'\n\n # only option that is currently supported\n options[:showsource] = 'yes'\n\n unless options[:doc] or options[:file] or options[:content]\n raise ArgumentError, \"an uri, file or block of text is required.\"\n end\n\n # URI should be a string. If it is a URI object, .to_s will\n # be seamless; if it is not an exception will be raised.\n if options[:doc] and not options[:doc].kind_of?(String)\n options[:doc] = options[:doc].to_s\n end\n options\n end",
"def initialize(options={})\n @wsdl = options[:wsdl]\n @instanceCode = options[:instanceCode] || 'YOUR_BURNING_GLASS_INSTANCE_CODE_CAN_GO_HERE'\n @svcCall = options[:svcCall] || :tag_binary_data\n @svcResponse = options[:svcResponse] || :tag_binary_data_response\n @svcReturn = options[:svcReturn] || :tag_binary_data_return\n end",
"def find_class_options_for_query_with_and(query, options={})\n options\n end",
"def render_options(classname, *a)\n\t\taccept = env['rack-accept.request']\n\n\t\tif !classname.is_a?(Class)\n\t\t\tclassname = GreyGoo.collection_to_class(classname)\n\t\tend\n\t\toptions = get_options_for(classname, *a)\n\n\t\t# If in the root, also get options for the resource\n\t\tunless a.empty?\n\t\t\trequest.path.match(%r{^/(\\w+)$}) do |thing|\n\t\t\t\toptions += get_options_for(GreyGoo.collection_to_class(thing[1]))\n\t\t\tend\n\t\tend\n\n\t\toptions_json = JSON.pretty_generate(options)\n\t\tout = \"\"\n\t\tunless options.empty? \n\t\t\tif accept.media_type?('text/html')\n\t\t\t\tform_html = form_from_options(options)\n\t\t\t\tunless form_html.empty?\n\t\t\t\t\tout += \"<br><h1>Forms</h1>#{form_html}\"\n\t\t\t\tend\n\t\t\t\tout += \"<br><h1>Options</h1><pre>#{linkify(options_json)}</pre>\"\n\t\t\telse\n\t\t\t\tcontent_type('application/json')\n\t\t\t\tout = options_json\n\t\t\tend\n\t\tend\n\t\treturn out\n\tend",
"def gx_class_params\n params[:gx_class]\n end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def options; end",
"def validate_options(options, klass)\n raise(ArgumentError, \"Options cannot be \" + options.class.name) unless options.is_a?(klass) || options.is_a?(Hash)\n options.is_a?(Glassfrog::Base) ? options.hashify : options\n end",
"def operation_for!(operation_class, options, &block)\n params = options[:params] || self.params # TODO: test params: parameter properly in all 4 methods.\n params = params!(params)\n process_params!(params) # deprecate or rename to #setup_params!\n\n res, op = Trailblazer::Endpoint.new(operation_class, params, request, options).(&block)\n setup_operation_instance_variables!(op, options)\n\n [res, op, options.merge(params: params)]\n end",
"def klass\n @options[:class].presence\n end",
"def extract( options )\n \n end",
"def initialize(location, options={})\r\n @location = location\r\n @fragment_ref = FragmentRef.new\r\n @fragment_ref.fragment = self\r\n @data = options[:data]\r\n @resolved_refs = nil \r\n @changed = false\r\n @identifier_provider = options[:identifier_provider]\r\n end",
"def options() end",
"def parse_options; end",
"def parse_options; end",
"def add_class(class_name)\n @fragment.children.each do |c|\n c['class'] = ((c['class']||'').split(' ') + [class_name]).join(' ')\n end\n end",
"def add_class(class_name)\n @fragment.each_element do |c|\n c.attributes['class'] = ((c.attributes['class']||'').split(' ') + [class_name]).join(' ')\n end\n end",
"def get_scanner_options(options); end",
"def options_for(type, query, options={})\n opts = instance_options.merge(filter_hash(options, BASE_OPTIONS))\n opts.merge!(:sources => type.to_s, :query => build_query(query, options))\n \n source_options = filter_hash(options, [:http] + BASE_OPTIONS + QUERY_KEYWORDS)\n opts.merge!(scope_source_options(type, source_options))\n \n http_options = options[:http] || {}\n http_options.merge(:query => opts)\n end",
"def parse!() options.parse!(self) end",
"def options(opt); end",
"def options(opt); end"
] | [
"0.5170185",
"0.50379187",
"0.49283826",
"0.49068972",
"0.48953354",
"0.48782712",
"0.487401",
"0.48621804",
"0.48435414",
"0.48423022",
"0.4823746",
"0.47539607",
"0.4735918",
"0.47032008",
"0.46984053",
"0.46936542",
"0.46447563",
"0.46291554",
"0.46263087",
"0.46212554",
"0.4616958",
"0.4600185",
"0.4582932",
"0.45818436",
"0.458182",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45734155",
"0.45539078",
"0.4551432",
"0.45317292",
"0.45302618",
"0.45276105",
"0.45262372",
"0.45244294",
"0.45244294",
"0.45160636",
"0.45079568",
"0.45050582",
"0.44957304",
"0.44921184",
"0.44917786",
"0.44899195"
] | 0.0 | -1 |
clears cache data once reading created by sidekiq | def clear_cache
$redis.del self.id
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def cache_clear\n @client.flushall\n end",
"def cache_clear\n @dataset.delete\n end",
"def cache_clear\n @dataset.delete\n end",
"def clear_cache; end",
"def clear\n @cache.clear\n end",
"def clear\n cache.clear\n end",
"def clear_cache() @cache = {}; end",
"def clear_cache!\n @cache = {}\n end",
"def clear_cache!\n @cache = {}\n end",
"def clear_cache\n @cache = {}\n end",
"def clear!\n @cache = {}\n end",
"def cache_clear\n @store.clear\n end",
"def clear\r\n @cache.flush\r\n end",
"def clear_cache!\n # this should be overridden by concrete adapters\n end",
"def cache_clear\n @store.flush_all\n rescue ::MemCache::MemCacheError => e\n Log.error(e)\n nil\n end",
"def cache_clear\n @store.delete\n end",
"def clear\n @cache = {}\n end",
"def clear\n\n set_id_to_cache_key_map\n\n cache_response = fetch\n @id_to_cache_key_map.each do |id, key|\n Memcache.delete(key)\n Memcache.delete(\"ca_sa_shared_de_sa_cs_#{cache_response[id][:api_key]}\")\n end\n\n nil\n\n end",
"def clear_cache\n ccs.each(&:clear_cache)\n end",
"def clear\n @cache.clear\n self\n end",
"def cache_clear\n @moneta.clear\n end",
"def memcache_flush\n client_pepo_campaign_details_memcache_key = ClientPepoCampaignDetail.get_memcache_key_object.key_template % {client_id: self.client_id}\n Memcache.delete(client_pepo_campaign_details_memcache_key)\n end",
"def flush!\n @_cache = {}\n end",
"def clear_cache\n Rails.cache.delete(self.class.cache_key(self.key))\n end",
"def clear\n @lock.write_sync{ @data.clear }\n end",
"def clear_cache\n $redis.del \"posts\"\n end",
"def clear\n self.lock_acquire_time = nil\n\n redis.del(key)\n end",
"def clear_cache\n @all = nil\n end",
"def clear\n @metadata = {}\n clear_cache\n end",
"def clear!\n Goalkeeper.redis.del(key)\n end",
"def clear_cache! *keys\n clear_cache *keys\n ipcm_trigger :clear_cache, *keys\n end",
"def flush_memos\n CACHE.clear\n end",
"def flush_cache; end",
"def reset\n Sidekiq.redis do |conn|\n conn.keys(namespace_key(\"*\")).each do |key|\n conn.del(key)\n end\n end\n end",
"def clear\n @redis.flushdb\n end",
"def clear\n\n set_id_to_cache_key_map\n\n @id_to_cache_key_map.each do |_, keys|\n Memcache.delete(keys[:kit])\n Memcache.delete_from_all_instances(keys[:saas])\n end\n\n nil\n\n end",
"def flush_cache\n KitSaasSharedCacheManagement::TokenDetails.new([client_id]).clear\n KitSaasSharedCacheManagement::TokenByTokenId.new([id]).clear\n end",
"def memcache_flush\n client_memcache_key = ClientKycPassSetting.get_memcache_key_object.key_template % {client_id: self.client_id}\n Memcache.delete(client_memcache_key)\n end",
"def reset\r\n @cache.reset\r\n end",
"def clear_cached\n Rails.cache.delete(self.cache_key, opts_for_cache)\n end",
"def clear\n synchronize_block do\n @data.clear\n @key_access_store.clear\n end\n end",
"def clear_all!\n @cache = Cache.new\n end",
"def _clear_cache\n @cache_parent.clear\n end",
"def clear\n @cache.clear\n entries.clear\n self\n end",
"def clear\n FileUtils.rm_f(cache_file)\n initialize!\n end",
"def clear!\n @cache.delete(current_store_id)\n end",
"def clear_cache\n @access.refresh\n end",
"def clear_cache\n @access.refresh\n end",
"def clear\n @redis.delete_matched(\"#{@key}:*\")\n end",
"def memoize_cache_clear\n __memoize_cache__.clear\n self\n end",
"def clear_cache\n @results = nil\n @result_ids = nil\n @num_results = nil\n @letters = nil\n end",
"def reset_cache\n self.class.reset_cache\n end",
"def clear_cache *keys\n keys.size == 0 ?\n cache_pool.clear :\n keys.each { |key| cache_pool.delete key }\n end",
"def clear\n # TODO: this is rather brutal, in future need to be able to revert\n Rails.logger.info(\"Clearing OpenbisMedataStore at #{filestore_path}\")\n # cache.delete_matched(/.*/)\n # need to add an entry to empty cache otherwise the clear failes on unexisting deak\n cache.fetch('fake') { '' } unless File.exist?(cache.cache_path)\n cache.clear\n end",
"def free\n cache.clear\n nil\n end",
"def clear_cache\n property_cache.clear\n end",
"def cache_delete\n model.send(:cache_delete, cache_key)\n end",
"def expire_cache!\n @snapshot = nil\n end",
"def memcache_flush\n memcache_key = self.singleton_class.get_memcache_key_object.key_template % {\n shard_identifier: self.singleton_class.shard_identifier,\n aml_search_uuid: aml_search_uuid\n }\n Memcache.delete(memcache_key)\n end",
"def purge_cache\n return unless self.respond_to? :tracked_cache_keys\n\n self.delete_from_cache(*self.tracked_cache_keys, after_commit: true)\n end",
"def clear_queues_cache\n channel.queues.clear\n end",
"def reset\n hash.clear\n expire_cache!\n self\n end",
"def clear_balance_cache\n @balance = nil\n @available_cache = nil\n end",
"def clear_cache_like! *keys\n clear_cache_like *keys\n ipcm_trigger :clear_cache_like, *keys\n end",
"def clear_caches\n self.log.debug \"Clearing entry and values caches.\"\n\t\t@entry = nil\n\t\[email protected]\n\tend",
"def clear_cache\n CircleCi.request(conf, \"#{base_path}/build-cache\").delete\n end",
"def test_clear_also_clears_local_cache\n key = SecureRandom.uuid\n cache = lookup_store(raw: true)\n stub_called = false\n\n client(cache).stub(:flush_all, -> { stub_called = true; client.delete(\"#{@namespace}:#{key}\") }) do\n cache.with_local_cache do\n cache.write(key, SecureRandom.alphanumeric)\n cache.clear\n assert_nil cache.read(key)\n end\n assert_nil cache.read(key)\n end\n assert stub_called\n end",
"def reset!\n @cache = nil\n end",
"def reset\n redis.del(key)\n nil\n end",
"def refresh_cache\n @cache = build_cache\n end",
"def clear_cache(auth_token)\n Authentication::RedisStore.instance.delete(auth_token)\n end",
"def clear\n @redis.del @name\n end",
"def purge!\n @data = nil\n end",
"def purge!\n @data = nil\n end",
"def clear!\n Thread.current[LOCAL_KEY] = nil\n end",
"def clear_cache(uri)\n if last_cached(uri) > 0\n cache_store.delete(cache_key([uri, last_cached(uri)]))\n cache_store.delete(cache_key(uri))\n end\n end",
"def clear_cache\n @current_site.set_meta(cache_key, nil)\n end",
"def clear\n @redis.del @options[:key_name]\n end",
"def clear\n @redis.del @options[:key_name]\n end",
"def cache_clear\n DrgCms.cache_clear(:dc_page)\nend",
"def delete\n cache_delete\n super\n end",
"def delete\n cache_delete\n super\n end",
"def delete_cache_files; end",
"def delete_cache_files; end",
"def clear_data_uri_cache\n @_uri_cache = {}\n end",
"def clear_cache\n CircleCi.request(@conf, \"/project/#{username}/#{project}/build-cache\").delete\n end",
"def cache_delete(key)\n @cache_store.delete(key)\n nil\n end",
"def reset\n @entry_cache.clear\n end",
"def clear_cache\n Slides.log :cache_clear do\n Timeout.timeout(1) do\n begin\n Rails.cache.clear\n rescue\n $stderr.puts \"error message=#{$!.message}\"\n end\n end\n end\nend",
"def refill\n now = Time.now.to_i\n cache_set.each {|rec|\n ttl = rec[:end_ts].to_i - now\n cache_write( rec[:key], rec[:value], ttl ) if ttl > 0 \\\n if rec[:value] and rec[:value].length > MAX_OBJ_SIZE and ttl > 0\n }\n end",
"def clear\n with_redis { |redis| redis.del(@set_key) }\n end",
"def clear_cache\n\t\tprint \"Clearing cache...\"\n\t\turl = get_url(\"clear\", @uid, @password, @sid)\n\t\trun_1010(url, \"\") { puts \"done\" }\n\tend",
"def memcache_flush\n memcache_key = self.singleton_class.get_memcache_key_object.key_template % {\n shard_identifier: self.singleton_class.shard_identifier,\n user_kyc_detail_id: self.user_kyc_detail_id,\n user_extended_detail_id: self.user_extended_detail_id\n }\n Memcache.delete(memcache_key)\n end",
"def clear_cache\n Rails.cache.clear\n render :text => 'cleared'\n end",
"def cache!\n @@cache\n end",
"def clear_workers!\n Shuttle::Redis.del worker_set_key\n if loading?\n self.loading = false\n save!\n end\n end",
"def cache_get(key)\n nil\n end",
"def flush\n redis.del(bucket_key)\n end",
"def clearQueryCache\r\n result = request(\"DELETE\", \"_api/query-cache\")\r\n return return_delete(result)\r\n end"
] | [
"0.7630013",
"0.7626285",
"0.7626285",
"0.74478716",
"0.74381894",
"0.7420034",
"0.73992175",
"0.7377624",
"0.7377624",
"0.7367263",
"0.7344208",
"0.7338464",
"0.72716314",
"0.7262069",
"0.725342",
"0.72002476",
"0.7196411",
"0.70716006",
"0.70246464",
"0.6997503",
"0.6953332",
"0.69341344",
"0.68656236",
"0.68515384",
"0.6838992",
"0.683897",
"0.680296",
"0.6735541",
"0.6735397",
"0.6725475",
"0.66934067",
"0.6670895",
"0.66668534",
"0.6621174",
"0.6606279",
"0.6606174",
"0.66049165",
"0.65794367",
"0.6575962",
"0.6551833",
"0.6548999",
"0.65454626",
"0.6544863",
"0.65444577",
"0.653655",
"0.65348214",
"0.65200454",
"0.65200454",
"0.6493699",
"0.64916193",
"0.6470334",
"0.6444913",
"0.64182574",
"0.64138895",
"0.6400269",
"0.6382688",
"0.6377208",
"0.63750523",
"0.63630986",
"0.6359223",
"0.63580245",
"0.63555723",
"0.6347172",
"0.6328732",
"0.6318297",
"0.6301948",
"0.6295766",
"0.6294463",
"0.62898743",
"0.62897176",
"0.62736434",
"0.62721753",
"0.6270396",
"0.6270396",
"0.6265516",
"0.6263409",
"0.6260475",
"0.62489533",
"0.62489533",
"0.6231169",
"0.62227744",
"0.62227744",
"0.62198806",
"0.62198806",
"0.62168235",
"0.6211251",
"0.6209465",
"0.6205492",
"0.6202147",
"0.6201426",
"0.6183204",
"0.6181326",
"0.6176975",
"0.6165411",
"0.6163413",
"0.61632955",
"0.61632276",
"0.6137977",
"0.6118531"
] | 0.74469334 | 5 |
methods for returning wgs coordiates from | def wgs_coordinates
return @data["WGS_COORDINATES"] if @data["WGS_COORDINATES"]
query = Geocoder::Query.new(
coordinates, {
coord_in: 'utmk',
coord_out: 'wgs84'
})
lookup = Geocoder::Lookup::Olleh.new
wgs = lookup.search(query).first.converted_coord
@data["WGS_COORDINATES"] = wgs
wgs
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_WGS\n [@lat - @d_lat, @lon - @d_lon]\n end",
"def to_WGS84\n\n\t if @type == :ie\n\t @a = 6377340.189\n\t @b = 6356034.447\n else\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n\n @phi = deg_to_rad(@latitude)\n @lambda = deg_to_rad(@longitude)\n @v = @a / (Math.sqrt(1 - @eSquared * sin_pow_2(@phi)))\n @H = 0\n @x = (@v + @H) * Math.cos(@phi) * Math.cos(@lambda)\n @y = (@v + @H) * Math.cos(@phi) * Math.sin(@lambda)\n @z = ((1 - @eSquared) * @v + @H) * Math.sin(@phi)\n\n @tx = 446.448\n @ty = -124.157\n @tz = 542.060\n\n @s = -0.0000204894\n @rx = deg_to_rad( 0.00004172222)\n @ry = deg_to_rad( 0.00006861111)\n @rz = deg_to_rad( 0.00023391666)\n\n @xB = @tx + (@x * (1 + @s)) + (-@rx * @y) + (@ry * @z)\n @yB = @ty + (@rz * @x) + (@y * (1 + @s)) + (-@rx * @z)\n @zB = @tz + (-@ry * @x) + (@rx * @y) + (@z * (1 + @s))\n\n @a = 6378137.000\n @b = 6356752.3141\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n\n @lambdaB = rad_to_deg(Math.atan(@yB / @xB))\n @p = Math.sqrt((@xB * @xB) + (@yB * @yB))\n @phiN = Math.atan(@zB / (@p * (1 - @eSquared)))\n\n (1..10).each do |i|\n @v = @a / (Math.sqrt(1 - @eSquared * sin_pow_2(@phiN)))\n @phiN1 = Math.atan((@zB + (@eSquared * @v * Math.sin(@phiN))) / @p)\n @phiN = @phiN1\n end\n\n @phiB = rad_to_deg(@phiN)\n\n { :latitude => @phiB, :longitude => @lambdaB }\n\n end",
"def coordinates\n [@data[:szer_geogr].to_f, @data[:dl_geogr].to_f]\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 coordinates\n return 166, 72\n end",
"def get_wgs84_conversion_info(index)\n @horizontal_datum.wgs84_parameters\n end",
"def theBox\n [ [nw_lon, nw_lat], [se_lon, se_lat]]\n end",
"def determine_coordinates\n coordinates = Hash.new()\n coordinates[:x] = @scaled_meta.domain_x.lower +\n calculated_dimension_delta(@scaled_meta.domain_x)\n coordinates[:y] = @scaled_meta.domain_y.lower +\n calculated_dimension_delta(@scaled_meta.domain_y)\n return coordinates\n end",
"def coords; {:x => @x, :y => @y} end",
"def to_wgs84\n ll = to_latlng(@easting, @northing, @type)\n lat_lng = LatLng.new(latitude: ll[:latitude], longitude: ll[:longitude], type: @type)\n lat_lng.to_WGS84\n end",
"def vector\n\t\treturn [(end_lng - start_lng), (end_lat - start_lat)]\n\tend",
"def test_gk_to_wgs84\n from = Proj4::Point.new(@rw, @hw, @zw)\n to = @proj_gk.transform(@proj_wgs84, from)\n assert_not_equal from.object_id, to.object_id\n assert_in_delta @lon, to.x * Proj4::RAD_TO_DEG, PRECISION\n assert_in_delta @lat, to.y * Proj4::RAD_TO_DEG, PRECISION\n assert_in_delta 0, to.z, PRECISION\n end",
"def to_wgs84(error_if_incompatible = false)\r\n parameter_count = 7\r\n out_values = FFI::MemoryPointer.new(:double, parameter_count)\r\n Api.proj_coordoperation_get_towgs84_values(self.context, self, out_values, parameter_count, error_if_incompatible ? 1 : 0)\r\n out_values.read_array_of_double(parameter_count)\r\n end",
"def geo; end",
"def to_wgs84(options={})\n if is_gridref?\n Osgb::Gridref.new(self, options).to_latlng(:wgs84)\n else\n self.coordinates(:wgs84, options)\n end\n end",
"def num_conversion_to_wgs84\n @horizontal_datum.wgs84_parameters ? 1 : 0\n end",
"def coordinates\n @coordinates\n end",
"def test_wgs84_to_gk\n point = @proj_wgs84.transform(@proj_gk, Proj4::Point.new(@lon * Proj4::DEG_TO_RAD, @lat * Proj4::DEG_TO_RAD, 0))\n assert_equal @rw, point.x.round\n assert_equal @hw, point.y.round\n assert_in_delta @zw, point.z, PRECISION\n end",
"def location(x, y, w, h)\n return x - w/2, y + 20\n end",
"def construct_coordinates\n construct_latitude\n construct_longitude\n end",
"def coords_to_wkt_polygon(min_x, min_y, max_x, max_y)\n [[min_x, min_y],\n [max_x, min_y],\n [max_x, max_y],\n [min_x, max_y],\n [min_x, min_y]]\n end",
"def coordinates(alt_format = false)\n coordinates_array = []\n if alt_format\n return ['-80.394617, 31.066399'] unless has_coordinates?\n dcterms_spatial.each do |el|\n coordinates_array << \"#{longitude(el)}, #{latitude(el)}\" if element_has_coordinates el\n end\n else\n return ['31.066399, -80.394617'] unless has_coordinates?\n dcterms_spatial.each do |el|\n coordinates_array << \"#{latitude(el)}, #{longitude(el)}\" if element_has_coordinates el\n end\n end\n coordinates_array\n end",
"def getgm() end",
"def coordinates\n [@y_location, @x_location]\n end",
"def calc_vertices\n @worksheet.position_object( @params[:start_col],\n @params[:start_row],\n @params[:x_offset],\n @params[:y_offset],\n @params[:width],\n @params[:height]\n )\n end",
"def cal_pos\n x, y = map_location(@grid_x, @grid_y)\n x += @tile_size/2\n y += @tile_size/2\n [x,y]\n end",
"def geometry\n @geometry\n end",
"def get_3d_polygon()\n height = get_keyword_value(\"HEIGHT\").to_f\n width = get_keyword_value(\"WIDTH\").to_f\n x = self.check_keyword?(\"X\")? self.get_keyword_value(\"X\").to_f : 0.0\n y = self.check_keyword?(\"Y\")? self.get_keyword_value(\"Y\").to_f : 0.0\n #counter clockwise\n origin = OpenStudio::Point3d.new( x, y , 0.0 )\n p2 = OpenStudio::Point3d.new(x + width , y,0.0 )\n p3 = OpenStudio::Point3d.new(x + width , y + height , 0.0 )\n p4 = OpenStudio::Point3d.new(x, y + height,0.0 )\n return [origin,p2,p3,p4]\n end",
"def georss_w3cgeo_representation(options)\r\n w3cgeo_ns = options[:w3cgeo_ns] || \"geo\"\r\n \r\n \"<#{w3cgeo_ns}:lat>#{self[0][0].y}</#{w3cgeo_ns}:lat>\\n<#{w3cgeo_ns}:long>#{self[0][0].x}</#{w3cgeo_ns}:long>\\n\"\r\n end",
"def coords\n coord_list = []\n (@x..(@x + @size_x - 1)).each do |i|\n (@y..(@y + @size_y - 1)).each do |j|\n coord = [i, j]\n coord_list << coord\n end\n end\n\n return coord_list\n end",
"def get_geo_transform\n @gdalfile.get_geo_transform\n end",
"def start_coords\n marker_coords('S')\n end",
"def coords\n [x, y]\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 create_gr(entities)\n\tif($gr_side == \"SW1\")\n\t\tr = Geom::Transformation.rotation [0, 0, 0], [0,0,1], 360.degrees\n\t\tt = Geom::Transformation.new [$gr_offset,0,$gr_height]\n\t\tbuild_gr(entities,r,t)\n\tend\n\tif($gr_side == \"SW2\")\n\t\tr = Geom::Transformation.rotation [0, 0, 0], [0,0,1], 180.degrees\n\t\tt = Geom::Transformation.new [$length-$gr_offset,$width,$gr_height]\n\t\tbuild_gr(entities,r,t)\n\tend\n\tif($gr_side == \"EW1\")\n\t\tr = Geom::Transformation.rotation [0, 0, 0], [0,0,1], 270.degrees\n\t\tt = Geom::Transformation.new [0,$width-$gr_offset,$gr_height]\n\t\tbuild_gr(entities,r,t)\n\tend\n\tif($gr_side == \"EW2\")\n\t\tr = Geom::Transformation.rotation [0, 0, 0], [0,0,1], 90.degrees\n\t\tt = Geom::Transformation.new [$length,$gr_offset,$gr_height]\n\t\tbuild_gr(entities,r,t)\n\tend\n\t\nend",
"def georss_w3cgeo_representation(options = {}) #:nodoc:\r\n w3cgeo_ns = options[:w3cgeo_ns] || \"geo\"\r\n point = self.center\r\n \"<#{w3cgeo_ns}:lat>#{point.y}</#{w3cgeo_ns}:lat>\\n<#{w3cgeo_ns}:long>#{point.x}</#{w3cgeo_ns}:long>\\n\"\r\n end",
"def xyz\n return [self.x,self.y,self.z]\n end",
"def to_gpos\n Point[ self.x, self.y ]\n end",
"def initialize w\n self.w = w\n\n self.x, self.y = rand(w.w), rand(w.h)\n self.a = 0.0\n self.ga = 0.0\n self.m = 0.0\n end",
"def coordinate \n @coordinate\n end",
"def coordinates\n [latitude, longitude]\n end",
"def geoObject()\n return @shape ;\n end",
"def text_coordinates\n return 28, 5, 152, 16\n end",
"def xy\n @geometries.dig(@geometry_index, @coordinates_index)\n end",
"def gen_coordinates\n [@gen_x, @gen_y] if generator?\n end",
"def calculate_coordinates\n bresenham_circle_coordinates\n end",
"def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end",
"def get_grids(x, y, width, height)\n x = (x*10)-5\n y = (y*10)-5\n end_x= x+(width*10)-1\n end_y= y+(height*10) -1\n return [[y, x], [end_y, end_x]]\n end",
"def coords\n Vector[@ob.x, @ob.y, @ob.z]\n end",
"def spritestack_coordinates\n return 25, 125\n end",
"def test_gk_to_wgs84_forward\r\n transform = Proj::Transformation.new(@crs_gk, @crs_wgs84)\r\n from = Proj::Coordinate.new(x: 5428192.0, y: 3458305.0, z: -5.1790915237)\r\n to = transform.forward(from)\r\n\r\n assert_in_delta(48.98963932450735, to.x, PRECISION)\r\n assert_in_delta(8.429263044355544, to.y, PRECISION)\r\n assert_in_delta(-5.1790915237, to.z, PRECISION)\r\n assert_in_delta(0, to.t, PRECISION)\r\n end",
"def vertices\n vertices = []\n\n vertices << [(@origin[0] + @l/2.0), (@origin[1] + @h/2.0), (@origin[2] + @w/2.0)]\n vertices << [(@origin[0] + @l/2.0), (@origin[1] + @h/2.0), (@origin[2] - @w/2.0)]\n vertices << [(@origin[0] + @l/2.0), (@origin[1] - @h/2.0), (@origin[2] - @w/2.0)]\n vertices << [(@origin[0] + @l/2.0), (@origin[1] - @h/2.0), (@origin[2] + @w/2.0)]\n vertices << [(@origin[0] - @l/2.0), (@origin[1] - @h/2.0), (@origin[2] + @w/2.0)]\n vertices << [(@origin[0] - @l/2.0), (@origin[1] - @h/2.0), (@origin[2] - @w/2.0)]\n vertices << [(@origin[0] - @l/2.0), (@origin[1] + @h/2.0), (@origin[2] - @w/2.0)]\n vertices << [(@origin[0] - @l/2.0), (@origin[1] + @h/2.0), (@origin[2] + @w/2.0)]\n\n vertices\n end",
"def to_coordinates\n\n CGPointMake(self.x.to_coordinates, self.y.to_coordinates)\n end",
"def coordquery(p)\r\nend",
"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 points; end",
"def meshcode2_coordinate(gps_info)\n grid_square_code = gps_info.to_s\n \n # calc from 1st grid square code\n lat = grid_square_code[0..1].to_f / 1.5; lon = grid_square_code[2..3].to_f + 100\n\n # calc from 2nd grid square code\n latcode = grid_square_code[4].to_f; loncode = grid_square_code[5].to_f\n lat += latcode * 5 / 60; lon += loncode * 7.5 / 60\n\n # calc from 3rd grid square code \n latcode = grid_square_code[6].to_f; loncode = grid_square_code[7].to_f\n lat += latcode * 0.5 / 60; lon += loncode * 0.75 / 60\n\n # calc from 4th grid square code \n num = grid_square_code[8].to_f - 1; latcode = (num / 2).to_i\n loncode = (num - latcode * 2).to_f; \n lat += latcode * 0.5 / 2 / 60; lon += loncode * 0.75 / 2 / 60\n\n # calc from 5th grid square code \n num = grid_square_code[9].to_f - 1\n latcode = (num / 2).to_i; loncode = (num - latcode * 2).to_f\n lat += latcode * 0.5 / 4 / 60; lon += loncode * 0.75 / 4 / 60\n\n # calc from 6th grid square code \n num = grid_square_code[10].to_f - 1\n latcode = (num / 2).to_i; loncode = (num - latcode * 2).to_f\n lat += latcode * 0.5 / 8 / 60; lon += loncode * 0.75 / 8 / 60\n\n mlat = 0.5 / 8; mlon = 0.75 / 8\n \n # left-down lat/ lon\n lat0 = lat; lon0 = lon\n # right-up lat/ lon\n lat1 = lat0 + mlat / 60; lon1 = lon0 + mlon / 60\n \n return lon0, lat0, lon1, lat1\n end",
"def gridpoints\n gridpoints = {'l' => @ngauss, 'e' => @negrid, 's' => @nspec}\n if @grid_option == \"single\"\n gridpoints.absorb({'x'=>1, 'y'=>1})\n else\n gridpoints.absorb({'x' => (@ntheta0 or (2.0 * (@nx - 1.0) / 3.0 + 1.0).floor), 'y' => (@naky or ((@ny - 1.0) / 3.0 + 1.0).floor)})\n end\n return gridpoints\nend",
"def coordinates\n row_values.product(col_values)\n end",
"def OSGB36toWGS84(easting, northing)\n #Initialising ellipsoidal and projection constants\n airy_semimajor = 6377563.396 #Airy 1830 semi-major axis used for OSGB36 (m)\n airy_semiminor = 6356256.909 #Airy 1830 semi-minor axis used for OSGB36 (m)\n scale_factor = 0.9996012717 #scale factor on the central meridian\n pi = Math::PI\n lat_origin = (49*pi)/180 #latitude of true origin (radians)\n lon_origin = (-2*pi)/180 #longtitude of true origin (radians)\n northing_origin = -100000 #northing of true origin (m)\n easting_origin = 400000 #easting of true origin (m)\n\n e_squared = 1 - ((airy_semiminor * airy_semiminor) / (airy_semimajor * airy_semimajor)) #eccentricity squared\n n = (airy_semimajor - airy_semiminor) / (airy_semimajor + airy_semiminor)\n\n #iteration\n lat = lat_origin\n m = 0\n\n lat = (n-northing_origin-m)/(airy_semimajor*scale_factor) + lat\n m_1 = (1 + n + (5./4)*n**2 + (5./4)*n**3) * (lat-lat_origin)\n m_2 = (3*n + 3*n**2 + (21./8)*n**3) * Math.sin(lat-lat_origin) * Math.cos(lat+lat_origin)\n m_3 = ((15./8)*n**2 + (15./8)*n**3) * Math.sin(2*(lat-lat_origin)) * Math.cos(2*(lat+lat_origin))\n m_4 = (35./24)*n**3 * Math.sin(3*(lat-lat_origin)) * Math.cos(3*(lat+lat_origin))\n\n # meridional arc\n m = airy_semiminor * scale_factor * (m_1 - m_2 + m_3 - m_4)\n\n #transverse radius of curvature\n nu = (airy_semimajor*scale_factor)/Math.sqrt(1-e_squared*Math.sin(lat)**2)\n\n #meridional radius of curvature\n rho = airy_semimajor*scale_factor*(1-e_squared)*(1-e_squared*Math.sin(lat)**2)**(-1.5)\n eta_squared = nu/rho-1\n\n sec_lat = 1/Math.cos(lat)\n vii = Math.tan(lat)/(2*rho*nu)\n viii = Math.tan(lat)/(24*rho*nu**3)*(5+3*Math.tan(lat)**2+eta_squared-9*Math.tan(lat)**2*eta_squared)\n ix = Math.tan(lat)/(720*rho*nu**5)*(61+90*Math.tan(lat)**2+45*Math.tan(lat)**4)\n x = sec_lat/nu\n xi = sec_lat/(6*nu**3)*(nu/rho+2+Math.tan(lat)**2)\n xii = sec_lat/(120*nu**5)*(5+28*Math.tan(lat)**2+24*Math.tan(lat)**4)\n xiia = sec_lat/(5040*nu**7)*(61+662*Math.tan(lat)**2+1320*Math.tan(lat)**4+720*Math.tan(lat)**6)\n dE = easting - easting_origin\n\n #Airy 1830 (denoted by _1)\n lat_1 = lat - vii*dE**2 + viii*dE**4 - ix*dE**6\n lon_1 = lon_origin + x*dE - xi*dE**3 + xii*dE**5 - xiia*dE**7\n\n #conversion to GRS80 ellipsoid\n #conversion to cartesian coordinates\n h = 0 #third cartesian coord\n x_1 = (nu/scale_factor + h)*Math.cos(lat_1)*Math.cos(lon_1)\n y_1 = (nu/scale_factor + h)*Math.cos(lat_1)*Math.sin(lon_1)\n z_1 = ((1-e_squared)*nu/scale_factor + h)*Math.sin(lat_1)\n\n #Helmert transformation to go from Airy 1830 -> GRS80\n s = -20.4894*10**-6 #scale factor\n tx = 446.448\n ty = -125.157\n tz = 542.060\n rxs = 0.1502\n rys = 0.2470\n rzs = 0.8421\n\n #convert seconds to radians\n def sec_to_rad(x)\n x*Math::PI/(180*3600)\n end\n\n rx = sec_to_rad(rxs)\n ry = sec_to_rad(rys)\n rz = sec_to_rad(rzs)\n x_2 = tx + (1+s)*x_1 + (-rz)*y_1 + (ry)*z_1\n y_2 = ty + (rz)*x_1 + (1+s)*y_1 + (-rx)*z_1\n z_2 = tz + (-ry)*x_1 + (rx)*y_1 + (1+s)*z_1\n\n #back to polar coordinates\n a_2 = 6378137.000\n b_2 = 6356752.3141\n e_squared_2 = 1 - (b_2*b_2)/(a_2*a_2) # The eccentricity(squared) of the GRS80 ellipsoid\n p_1 = Math.sqrt(x_2**2 + y_2**2)\n\n #obtain latitude\n lat = Math.atan2(z_2, (p_1*(1-e_squared_2)))\n latold = 2*pi\n\n nu_2 = a_2/Math.sqrt(1-e_squared_2*Math.sin(latold)**2)\n lat = Math.atan2(z_2+e_squared_2*nu_2*Math.sin(latold), p_1)\n\n #obtain longitude and height\n lon = Math.atan2(y_2, x_2)\n h = p_1/Math.cos(lat) - nu_2\n\n #convert to degrees\n lat = lat*180/pi\n lon = lon*180/pi\n\n return [lat, lon]\nend",
"def xy() @records.get_data(GRT_XY); end",
"def hyp_geom_dist()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::HypGeom_Dist::HypGeomDistRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def svg_coord(row, col)\n\t\t[col*10 + 5, row*10 + 5]\n\tend",
"def georss_w3cgeo_representation(options)#:nodoc: \r\n self[0].georss_w3cgeo_representation(options)\r\n end",
"def to_a; [w, x, y, z] end",
"def coord_geographic\n FACTORY.unproject(self.coord)\n end",
"def coordinate_systems\n [:row_col, :col_row, :box]\n end",
"def ship_coordinates\n @ship_squares.map do |squares|\n squares.map { |square| [square.x, square.y] }\n end\n end",
"def coord2pos(x, y)\n (y % h)*w+(x % w)\n end",
"def test_gk_to_wgs84_forward\n transform = Proj::Transformation.new(@crs_gk, @crs_wgs84)\n from = Proj::Coordinate.new(x: 5428192.0, y: 3458305.0, z: -5.1790915237)\n to = transform.forward(from)\n\n assert_in_delta(48.98963932450735, to.x, PRECISION)\n assert_in_delta(8.429263044355544, to.y, PRECISION)\n assert_in_delta(-5.1790915237, to.z, PRECISION)\n assert_in_delta(0, to.t, PRECISION)\n end",
"def s_coords(attrs)\n height = (attrs['HEIGHT'] || 0).to_i\n width = (attrs['WIDTH'] || 0).to_i\n hpos = (attrs['HPOS'] || 0).to_i\n vpos = (attrs['VPOS'] || 0).to_i\n [hpos, vpos, width, height]\n end",
"def calculate_coordinates\n (\n egde(@x1, @y1, @x2, @y1) +\n egde(@x2, @y1, @x2, @y2) +\n egde(@x2, @y2, @x1, @y2) +\n egde(@x1, @y2, @x1, @y1)\n ).uniq\n end",
"def bgs_to_MGS\n x = @lon - 0.0065; y = @lat - 0.006\n z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * BAIDU_PI)\n theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * BAIDU_PI)\n [z * Math.sin(theta), z * Math.cos(theta)]\n end",
"def surface_bounds\n\n sql = \"select \"\\\n \"min(surface_longitude) as min_longitude, \"\\\n \"min(surface_latitude) as min_latitude, \"\\\n \"max(surface_longitude) as max_longitude, \"\\\n \"max(surface_latitude) as max_latitude \"\\\n \"from well where \"\\\n \"surface_longitude between -180 and 180 and \"\\\n \"surface_latitude between -90 and 90 and \"\\\n \"surface_longitude is not null and \"\\\n \"surface_latitude is not null\"\n\n corners = @gxdb[sql].all[0]\n\n {\n name: \"surface_bounds\",\n location: {\n type: \"polygon\",\n coordinates: [[\n [corners[:min_longitude], corners[:min_latitude]], #LL\n [corners[:min_longitude], corners[:max_latitude]], #UL\n [corners[:max_longitude], corners[:max_latitude]], #UR\n [corners[:max_longitude], corners[:min_latitude]], #LR\n [corners[:min_longitude], corners[:min_latitude]] #LL\n ]]\n }\n }\n end",
"def getPolyCoordinates(radius, lat, lon, num_sides)\r\n # Create array to the radian values of the regular polygon\r\n rads = (0..2*Math::PI).step((2 * Math::PI) / num_sides.to_f).to_a\r\n\r\n # Compute angular distance (meters)\r\n ang_dist = (radius.to_f / EARTH_RAD_M.to_f) #*(Math::PI/180.0)\r\n lat_rad = lat * Math::PI/180.0\r\n lon_rad = lon * Math::PI/180.0\r\n\r\n # Constants\r\n a = Math.sin(lat_rad) * Math.cos(ang_dist)\r\n b = Math.cos(lat_rad) * Math.sin(ang_dist)\r\n\r\n # Loop over radians (clockwise) to compute geo points of the polygon\r\n points = Array.new\r\n cnt = 0\r\n rads.each do |r|\r\n # new point latitude (in radians)\r\n new_lat = Math.asin(a + b * Math.cos(r)) \r\n\r\n # new point longitude (in radians)\r\n c = Math.cos(ang_dist) - Math.sin(lat_rad) * Math.sin(new_lat)\r\n new_lon = lon_rad + Math.atan2(Math.sin(r) * Math.sin(ang_dist) * Math.cos(lat_rad), c)\r\n\r\n # Store (in degrees)\r\n points[cnt] = {:lat => new_lat*180.0/Math::PI, :lon => new_lon*180.0/Math::PI}\r\n cnt += 1\r\n end\r\n\r\n return points\r\n end",
"def to_coordinates\n coord = [x, y]\n coord << z if with_z\n coord << m if with_m\n coord\n end",
"def building_coordinates(x, y, height, width)\n puts\"building #{height}x#{width} at location (#{x},#{y})\"\n coords = Array.new\n (0..width-1).each do |j|\n\n (0..height-1).each do |i|\n\n co = Coordinate.new(x+i,y+j)\n coords.push(co)\n end\n\n end\n puts\"*getBuildingCoordinates* returning array of building coordinates\"\n coords\n end",
"def generate_coordinates\n coordinates = []\n (0..@column_count - 1).to_a.each do |i|\n (0..@row_count - 1).to_a.each do |j|\n coordinates << {x: i, y: j, z: 0}\n end\n end\n coordinates\n end",
"def compute_weighted_center_of_mass(map, pieces)\n #cx = (x0*w0 + x1*w1 + ... + xn*wn) / (w0 + w1 + ... wn)\n total_weight = 0\n cx = 0\n cy = 0\n pieces.each do |loc|\n site = map.site(loc)\n total_weight += site.strength\n cx += loc.x*site.strength\n cy += loc.y*site.strength\n end\n return [cx / total_weight, cy / total_weight]\nend",
"def area\n w * h\n end",
"def location\n [@posX, @posY, @facing]\n end",
"def carve_walls_from_point(x, y, grid)\n \nend",
"def geometry_as_wkt\n return geom unless geom.match?(/ENVELOPE/)\n\n envelope_to_polygon\n end",
"def test_wgs84_to_gk_forward\r\n transform = Proj::Transformation.new(@crs_wgs84, @crs_gk)\r\n from = Proj::Coordinate.new(lam: 48.9906726079, phi: 8.4302123334)\r\n to = transform.forward(from)\r\n\r\n assert_in_delta(5428306, to.x, PRECISION)\r\n assert_in_delta(3458375, to.y, PRECISION)\r\n assert_in_delta(0, to.z, PRECISION)\r\n assert_in_delta(0, to.t, PRECISION)\r\n end",
"def coordinates\n coordinates = Array.new\n \n coordinates.push self.lat\n coordinates.push self.lng\n \n return coordinates\n end",
"def convert_coords(screen, x, y, z)\n\t\txd = x * $persp / (z + $space_size) + screen.width / 2\n\t\tyd = y * $persp / (z + $space_size) + screen.height / 2\n\t\treturn xd, yd\n\tend",
"def to_coordinates\n [latitude, longitude]\n end",
"def get_coordinates(pos)\n row = (pos / @width) + 1\n col = (pos % @width) + 1\n [row, col]\n end",
"def points\n [top_left, top_right, bottom_left, bottom_right]\n end",
"def loc\r\n { x: @mapx,\r\n y: @mapy }\r\n end",
"def asteroid_relative(x,y,grid)\n\tpoints = Hash.new\n\tx_root, y_root = x, y\n\tgrid.each do |(x, y), value|\t\t\n\t\tpoints[[x,y]] = Point.from_offset(x_root, y_root, x, y)\n\tend\n\tpoints\nend",
"def get_containing_geography\n return self.geography\n end",
"def squaremeters(l, w)\n l * w\nend",
"def coordinates\n return {latitude: self.latitude, longitude: self.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 x2\n x + w\n end",
"def points\n object.polygon.points\n end",
"def get_coordinates(widget)\n x = widget[\"x\"]\n y = widget[\"y\"]\n return x, y\nend",
"def grid_coords(lat, lon, dist) # dist in meter\n dist_POLE_RADIUS = 6356752.314 # North to South 6356km\n dist_EQUATOR_RADIUS = 6378137 # East to West 6378km\n lat_degree = ( 360 * 1000 ) / ( 2 * Math::PI * dist_POLE_RADIUS )\n lng_degree = ( 360 * 1000 ) / ( 2 * Math::PI * ( dist_EQUATOR_RADIUS * Math.cos(lat.to_f * Math::PI / 180.0) ) )\n \n dist_lat = lat_degree * dist.to_f/1000\n dist_lon = lng_degree* dist.to_f/1000\n \n grid_lat = (lat.to_f/dist_lat).to_i\n grid_lon = (lon.to_f/dist_lat).to_i\n \n return ([grid_lat, grid_lon])\nend",
"def to_MGS\n if out_of_china?\n [@lat, @lon]\n else\n [@lat + @d_lat, @lon + @d_lon]\n end\n end"
] | [
"0.6932745",
"0.6696975",
"0.65165",
"0.6266386",
"0.62373936",
"0.62175196",
"0.61869127",
"0.6129023",
"0.61173135",
"0.6087097",
"0.59785604",
"0.5926055",
"0.59042066",
"0.58509505",
"0.58195496",
"0.5818461",
"0.57615054",
"0.57496005",
"0.57419395",
"0.57248914",
"0.5723144",
"0.56863403",
"0.56686383",
"0.5658908",
"0.5649379",
"0.56391066",
"0.5634942",
"0.56032795",
"0.5600268",
"0.5599911",
"0.55832314",
"0.5581598",
"0.55813634",
"0.5566468",
"0.55628943",
"0.5544119",
"0.554006",
"0.553618",
"0.55296046",
"0.5520993",
"0.5515565",
"0.5514653",
"0.5505856",
"0.5501961",
"0.55015177",
"0.5494832",
"0.54936045",
"0.54936045",
"0.5493471",
"0.5488205",
"0.548498",
"0.54833335",
"0.5457538",
"0.54573315",
"0.544688",
"0.5439966",
"0.54383606",
"0.54308736",
"0.54278326",
"0.5420761",
"0.54186666",
"0.5417479",
"0.54165125",
"0.5413597",
"0.5402892",
"0.53980035",
"0.53950864",
"0.5394802",
"0.53920865",
"0.5391806",
"0.53879714",
"0.5384231",
"0.53839016",
"0.53816813",
"0.5375734",
"0.5353598",
"0.53493786",
"0.53417313",
"0.5337204",
"0.53363746",
"0.53327334",
"0.53290135",
"0.53222936",
"0.53215665",
"0.5312969",
"0.5307231",
"0.5299435",
"0.5288172",
"0.5287326",
"0.52735233",
"0.52719307",
"0.5265325",
"0.5262866",
"0.52569866",
"0.525504",
"0.52510846",
"0.52505463",
"0.5244388",
"0.5243096",
"0.5238505"
] | 0.72892433 | 0 |
methods for converting coord system | def coord_type
@data[1]['COORDTYPE']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_coord\n self[:to_coord].to_sym unless self[:to_coord].blank?\n end",
"def to_coordinates\n\n CGPointMake(self.x.to_coordinates, self.y.to_coordinates)\n end",
"def convert_coords(screen, x, y, z)\n\t\txd = x * $persp / (z + $space_size) + screen.width / 2\n\t\tyd = y * $persp / (z + $space_size) + screen.height / 2\n\t\treturn xd, yd\n\tend",
"def convert_user_coord(input)\n input.split\n end",
"def convert_coordinate(num)\r\n\t\tarray = @array_translate[num][1].split(\",\")\r\n\t\tcoordinate = Coordinate.new(array[1].to_i,array[0].to_i)\r\n\t\tcoordinate\r\n\tend",
"def to_coordinates\n coord = [x, y]\n coord << z if with_z\n coord << m if with_m\n coord\n end",
"def user_coordinate\r\n\t\tconvert_coordinate(1)\r\n\tend",
"def meshcode2_coordinate(gps_info)\n grid_square_code = gps_info.to_s\n \n # calc from 1st grid square code\n lat = grid_square_code[0..1].to_f / 1.5; lon = grid_square_code[2..3].to_f + 100\n\n # calc from 2nd grid square code\n latcode = grid_square_code[4].to_f; loncode = grid_square_code[5].to_f\n lat += latcode * 5 / 60; lon += loncode * 7.5 / 60\n\n # calc from 3rd grid square code \n latcode = grid_square_code[6].to_f; loncode = grid_square_code[7].to_f\n lat += latcode * 0.5 / 60; lon += loncode * 0.75 / 60\n\n # calc from 4th grid square code \n num = grid_square_code[8].to_f - 1; latcode = (num / 2).to_i\n loncode = (num - latcode * 2).to_f; \n lat += latcode * 0.5 / 2 / 60; lon += loncode * 0.75 / 2 / 60\n\n # calc from 5th grid square code \n num = grid_square_code[9].to_f - 1\n latcode = (num / 2).to_i; loncode = (num - latcode * 2).to_f\n lat += latcode * 0.5 / 4 / 60; lon += loncode * 0.75 / 4 / 60\n\n # calc from 6th grid square code \n num = grid_square_code[10].to_f - 1\n latcode = (num / 2).to_i; loncode = (num - latcode * 2).to_f\n lat += latcode * 0.5 / 8 / 60; lon += loncode * 0.75 / 8 / 60\n\n mlat = 0.5 / 8; mlon = 0.75 / 8\n \n # left-down lat/ lon\n lat0 = lat; lon0 = lon\n # right-up lat/ lon\n lat1 = lat0 + mlat / 60; lon1 = lon0 + mlon / 60\n \n return lon0, lat0, lon1, lat1\n end",
"def convert_values\n @x_size = @x_size.to_i\n @y_size = @y_size.to_i\n @x_offset = @x_offset.to_i\n @y_offset = @y_offset.to_i\n @point = @point.to_s\n @blank_space = @blank_space.to_s\n end",
"def construct_coordinates\n construct_latitude\n construct_longitude\n end",
"def trans(coord)\n\treturn [coord[0]+600, -coord[1]+350]\nend",
"def transformCoord(coord)\n dotat = coord.index('.') \n tmp1 = coord[dotat-1]\n tmp2 = coord[dotat-2]\n \n coord[dotat-2] = \".\"\n coord[dotat-1] = tmp2\n coord[dotat] = tmp1\n \n return coord.to_f \n end",
"def to_coordinates\n [latitude, longitude]\n end",
"def transform_data\n latitude = self.latitude\n longitude = self.longitude\n tempLat = latitude/100\n floatLat = (latitude - (tempLat.to_i * 100))/60\n lat = tempLat.to_i + floatLat\n tempLng = longitude/100\n floatLng = (longitude - (tempLng.to_i * 100))/60\n lng = tempLng.to_i + floatLng\n self.latitude = lat \n self.longitude = lng \nend",
"def coordinates\n return 166, 72\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 coord2pos(x, y)\n (y % h)*w+(x % w)\n end",
"def coord_to_array(coordinates)\n x = coordinates[1]\n y = coordinates[0]\n conversion = ((x-1) * @size) + (y -1)\n end",
"def new_coord\n [@position, @@move[@direction]].transpose.map { |coord| coord.reduce(:+) }\n end",
"def to_xy\n [x, y]\n end",
"def coordinate_systems\n [:row_col, :col_row, :box]\n end",
"def convert_coordinates_to_location(coordinates)\n index_to_letter(coordinates[0]) + coordinates[1].to_s\n end",
"def decimal_to_coordinate\n\t\treturn nil if self.blank?\n\t\tvalue = self.to_f\n\n\t\t# Degrees\n\t\tdegrees = value.to_i\n\t\tvalue = value - degrees # Remove integer part\n\t\t\n\t\t# Minutes\n\t\tvalue = value * 60\n\t\tminutes = value.to_i\n\t\tvalue = value - minutes # Remove integer part\n\n\t\t# Seconds\n\t\tvalue = value * 60\n\t\tseconds = value.round(2)\n\t\t\n\t\tresult = \"#{degrees.to_s}°\"\n\t\tresult += \" #{minutes.to_s}'\"\n\t\tresult += \" #{seconds.to_s}\\\"\"\n\t\treturn result\n\tend",
"def separate_coordinates\n piece = @input[0..1]\n @row = input_to_row(piece[1])\n @col = input_to_col(piece[0])\n\n location = @input[2..3]\n @row_new = input_to_row(location[1])\n @col_new = input_to_col(location[0])\n end",
"def normalize_coords(x, y)\n x = x * -1 - 1 if x < 0\n y = y * -1 - 1 if y > -1\n [x, y]\n end",
"def convert_coord(strcoord)\n strcoord[0] = \"0\" if strcoord[0] == \"A\"\n strcoord[0] = \"1\" if strcoord[0] == \"B\"\n strcoord[0] = \"2\" if strcoord[0] == \"C\"\n strcoord[0] = \"3\" if strcoord[0] == \"D\"\n strcoord[0] = \"4\" if strcoord[0] == \"E\"\n strcoord[0] = \"5\" if strcoord[0] == \"F\"\n strcoord[0] = \"6\" if strcoord[0] == \"G\"\n strcoord[0] = \"7\" if strcoord[0] == \"H\"\n #Returns integer coordinates from the input:@# (letter,number)\n [strcoord[0].to_i,strcoord[1].to_i - 1]\n end",
"def to_xy\n a = self\n a = [a[0].x, a[0].y] if length == 1\n return *a\n end",
"def coord_geographic\n FACTORY.unproject(self.coord)\n end",
"def coords; {:x => @x, :y => @y} end",
"def api\n CLLocationCoordinate2DMake(latitude, longitude)\n end",
"def coordinates\n row_values.product(col_values)\n end",
"def coordinates\n [@data[:szer_geogr].to_f, @data[:dl_geogr].to_f]\n end",
"def indices2coords(i,j)\n row = i2row(i)\n col = j2col(j)\n \"#{row}#{col}\"\n end",
"def convert_position!\n trx = self[:TrX]\n try = self[:TrY]\n\n self[:TrX] = 0\n self[:TrY] = 0\n self[:TrZ] = 0\n\n # To fix an issue with pto reading files ignoring attributes that have a =0\n trx = '0.0' if trx == 0.0\n try = '0.0' if try == 0.0\n\n self[:d] = trx\n self[:e] = try\n self\n end",
"def new_coords(x,y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end",
"def convert_centroid(lat, lon)\n [lat + LAT_GRID/2, lon + LON_GRID/2]\nend",
"def coordinates\n\t coordinate_array.map(&:to_s).join(\",\")\n\tend",
"def coordquery(p)\r\nend",
"def to_xyz\n\t\t\tlab = []\n\n\t\t\tlab[1] = (self.l * 100 + 16) / 116\n\t\t\tlab[0] = self.a / 500 + lab[1]\n\t\t\tlab[2] = lab[1] - self.b / 200\n\n\t\t\tputs \"lab\"\n\t\t\tputs lab\n\n\t\t\tlab = lab.collect do |c| \n\t\t\t\tc = c ** 3 > 0.008856 ? c ** 3 : ( c - 16 / 116 ) / 7.787\n\t\t\tend\n\n\t\t\tx = lab[0] * CIELab::Reference[:x]\n\t\t\ty = lab[1] * CIELab::Reference[:y]\n\t\t\tz = lab[2] * CIELab::Reference[:z]\n\n\t\t\tx = x.has_decimals? ? x.to_i : x.round(2)\n\t\t y = y.has_decimals? ? y.to_i : y.round(2)\n\t\t z = z.has_decimals? ? z.to_i : z.round(2)\n\t\t\t\n\t\t\tXYZ.new([x, y, z]).to_s\n\t\tend",
"def determine_coordinates\n coordinates = Hash.new()\n coordinates[:x] = @scaled_meta.domain_x.lower +\n calculated_dimension_delta(@scaled_meta.domain_x)\n coordinates[:y] = @scaled_meta.domain_y.lower +\n calculated_dimension_delta(@scaled_meta.domain_y)\n return coordinates\n end",
"def to_chipmunk\n\t\tself.normalize!\n\t\[email protected] { |point| vec2(point[0] - self.center_x, point[1] - self.center_y) }\n\tend",
"def normalize_coordinates\t\n\t\tself.latitude = latitude.round(6) unless self.latitude.nil?\n\t\tself.longitude = longitude.round(6) unless self.longitude.nil?\n\tend",
"def cal_pos\n x, y = map_location(@grid_x, @grid_y)\n x += @tile_size/2\n y += @tile_size/2\n [x,y]\n end",
"def new_coords(x, y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end",
"def coordinate_array\n\t\t[latitude,longitude]\n\tend",
"def to_a\n if defined?(@to_a)\n @to_a\n else\n cs = self.coord_seq\n @to_a = if self.has_z?\n [ cs.get_x(0), cs.get_y(0), cs.get_z(0) ]\n else\n [ cs.get_x(0), cs.get_y(0) ]\n end\n end\n end",
"def transform \n \n @pixel_location = get_pixel_points \n puts \"px loc : #{@pixel_location}\"\n \n while @pixel_location.size != 0 \n transform_pixel_points(@pixel_location)\n @pixel_location.shift\n @pixel_location.shift\n end\n end",
"def to_latlng(easting, northing, type = :gb)\n\n \t if type == :ie\n @OSGB_F0 = 1.000035\n @N0 = 250000.0\n @E0 = 200000.0\n @phi0 = deg_to_rad(53.5)\n @lambda0 = deg_to_rad(-8.0)\n @a = 6377340.189\n @b = 6356034.447\n else\n @OSGB_F0 = 0.9996012717\n @N0 = -100000.0\n @E0 = 400000.0\n @phi0 = deg_to_rad(49.0)\n @lambda0 = deg_to_rad(-2.0)\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n @phi = 0.0\n @lambda = 0.0\n @E = easting\n @N = northing\n @n = (@a - @b) / (@a + @b)\n @M = 0.0\n @phiPrime = ((@N - @N0) / (@a * @OSGB_F0)) + @phi0\n\n \t begin\n\n \t @M =\n \t (@b * @OSGB_F0)\\\n \t * (((1 + @n + ((5.0 / 4.0) * @n * @n) + ((5.0 / 4.0) * @n * @n * @n))\\\n \t * (@phiPrime - @phi0))\\\n \t - (((3 * @n) + (3 * @n * @n) + ((21.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(@phiPrime - @phi0)\\\n \t * Math.cos(@phiPrime + @phi0))\\\n \t + ((((15.0 / 8.0) * @n * @n) + ((15.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(2.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(2.0 * (@phiPrime + @phi0)))\\\n \t - (((35.0 / 24.0) * @n * @n * @n)\\\n \t * Math.sin(3.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(3.0 * (@phiPrime + @phi0))))\n\n \t @phiPrime += (@N - @N0 - @M) / (@a * @OSGB_F0)\n\n \t end while ((@N - @N0 - @M) >= 0.001)\n\n \t @v = @a * @OSGB_F0 * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -0.5)\n \t @rho =\n \t @a\\\n \t * @OSGB_F0\\\n \t * (1.0 - @eSquared)\\\n \t * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -1.5)\n \t @etaSquared = (@v / @rho) - 1.0\n \t @VII = Math.tan(@phiPrime) / (2 * @rho * @v)\n \t @VIII =\n \t (Math.tan(@phiPrime) / (24.0 * @rho * (@v ** 3.0)))\\\n \t * (5.0\\\n \t + (3.0 * tan_pow_2(@phiPrime))\\\n \t + @etaSquared\\\n \t - (9.0 * tan_pow_2(@phiPrime) * @etaSquared))\n \t @IX =\n \t (Math.tan(@phiPrime) / (720.0 * @rho * (@v ** 5.0)))\\\n \t * (61.0\\\n \t + (90.0 * tan_pow_2(@phiPrime))\\\n \t + (45.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @X = sec(@phiPrime) / @v\n \t @XI =\n \t (sec(@phiPrime) / (6.0 * @v * @v * @v))\\\n \t * ((@v / @rho) + (2 * tan_pow_2(@phiPrime)))\n \t @XII =\n \t (sec(@phiPrime) / (120.0 * (@v ** 5.0)))\\\n \t * (5.0\\\n \t + (28.0 * tan_pow_2(@phiPrime))\\\n \t + (24.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @XIIA =\n \t (sec(@phiPrime) / (5040.0 * (@v ** 7.0)))\\\n \t * (61.0\\\n \t + (662.0 * tan_pow_2(@phiPrime))\\\n \t + (1320.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime))\\\n \t + (720.0\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)))\n \t @phi =\n \t @phiPrime\\\n \t - (@VII * ((@E - @E0) ** 2.0))\\\n \t + (@VIII * ((@E - @E0) ** 4.0))\\\n \t - (@IX * ((@E - @E0) ** 6.0))\n \t @lambda =\n \t @lambda0\\\n \t + (@X * (@E - @E0))\\\n \t - (@XI * ((@E - @E0) ** 3.0))\\\n \t + (@XII * ((@E - @E0) ** 5.0))\\\n \t - (@XIIA * ((@E - @E0) ** 7.0))\n\n \t { :latitude => rad_to_deg(@phi), :longitude => rad_to_deg(@lambda) }\n\n \t end",
"def coordinates\n [@y_location, @x_location]\n end",
"def convert(loc)\n row = loc[1].to_i\n col = @hash[loc[0]]\n return [row,col]\n end",
"def to_WGS84\n\n\t if @type == :ie\n\t @a = 6377340.189\n\t @b = 6356034.447\n else\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n\n @phi = deg_to_rad(@latitude)\n @lambda = deg_to_rad(@longitude)\n @v = @a / (Math.sqrt(1 - @eSquared * sin_pow_2(@phi)))\n @H = 0\n @x = (@v + @H) * Math.cos(@phi) * Math.cos(@lambda)\n @y = (@v + @H) * Math.cos(@phi) * Math.sin(@lambda)\n @z = ((1 - @eSquared) * @v + @H) * Math.sin(@phi)\n\n @tx = 446.448\n @ty = -124.157\n @tz = 542.060\n\n @s = -0.0000204894\n @rx = deg_to_rad( 0.00004172222)\n @ry = deg_to_rad( 0.00006861111)\n @rz = deg_to_rad( 0.00023391666)\n\n @xB = @tx + (@x * (1 + @s)) + (-@rx * @y) + (@ry * @z)\n @yB = @ty + (@rz * @x) + (@y * (1 + @s)) + (-@rx * @z)\n @zB = @tz + (-@ry * @x) + (@rx * @y) + (@z * (1 + @s))\n\n @a = 6378137.000\n @b = 6356752.3141\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n\n @lambdaB = rad_to_deg(Math.atan(@yB / @xB))\n @p = Math.sqrt((@xB * @xB) + (@yB * @yB))\n @phiN = Math.atan(@zB / (@p * (1 - @eSquared)))\n\n (1..10).each do |i|\n @v = @a / (Math.sqrt(1 - @eSquared * sin_pow_2(@phiN)))\n @phiN1 = Math.atan((@zB + (@eSquared * @v * Math.sin(@phiN))) / @p)\n @phiN = @phiN1\n end\n\n @phiB = rad_to_deg(@phiN)\n\n { :latitude => @phiB, :longitude => @lambdaB }\n\n end",
"def from_coord\n self[:from_coord].to_sym unless self[:from_coord].blank?\n end",
"def infer_coordinates_from_notation\n\n #expand the castling notation\n if self[:notation].include?('O-O')\n new_notation = 'K' + (self[:notation].include?('O-O-O') ? 'c' : 'g')\n new_notation += (match.next_to_move == :white) ? '1' : '8'\n self[:notation] = new_notation\n end\n\n self[:to_coord] = notation.to_s[-2,2]\n function = NOTATION_TO_FUNCTION_MAP[ notation[0,1] ] || :pawn\n @possible_movers = board.select do |pos, piece| \n piece.side == match.next_to_move && \n piece.function == function && \n piece.allowed_moves(board).include?( self[:to_coord].to_sym )\n end\n\n self[:from_coord] = @possible_movers[0][0] and return if @possible_movers.length == 1\n disambiguator = notation[-3,1]\n matcher = (disambiguator =~ /[1-8]/) ? Regexp.new( \"^.#{disambiguator}$\" ) : Regexp.new( \"^#{disambiguator}.$\" )\n movers = @possible_movers.select { |pos, piece| matcher.match(pos) }\n\n self[:from_coord] = movers[0][0] and return if movers.length == 1\n\n end",
"def coordinate \n @coordinate\n end",
"def to_gpos\n Point[ self.x, self.y ]\n end",
"def loc2(x,y)\n TwoDGridLocation.new x, y\nend",
"def pos_to_a\r\n [ pos.x, pos.y ]\r\n end",
"def coord_to_pos(row,col)\n return nil if row.even? && col.even? || row.odd? && col.odd? #these are always empty squares in checkers!\n return row*4+(col/2).floor+1\n end",
"def transformed(p)\r\n (0..1).map do |i|\r\n (p[i] - @old_center[i])*@zoom + (@center[i] - @old_center[i])*@zoom + @old_center[i]\r\n end\r\n end",
"def spritestack_coordinates\n return 25, 125\n end",
"def coords_to_gui(lat, lng)\n [(lat / map_config[\"lat_ratio\"]) + map_config[\"lat\"], (lng / map_config[\"lng_ratio\"] + map_config[\"lng\"])]\n end",
"def meshcode2coordinate(code)\n unless code.instance_of?(String)\n STDERR.puts \"E: argument must be String.\"\n return nil\n end\n latitude = 0.0\n longitude = 100.0\n case code.length\n when 4\n latitude, longitude = parse4(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH4,\n height: HEIGHT4}\n when 6\n latitude, longitude = parse6(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH6,\n height: HEIGHT6}\n when 8\n latitude, longitude = parse8(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH8,\n height: HEIGHT8}\n when 9\n latitude, longitude = parse9(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH9,\n height: HEIGHT9}\n when 10\n latitude, longitude = parse10(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH10,\n height: HEIGHT10}\n when 11\n latitude, longitude = parse11(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH11,\n height: HEIGHT11}\n else\n STDERR.puts \"E: invalid length of code: #{code.length}\"\n return {latitude: nil, longitude: nil, width: nil, height: nil}\n end\nend",
"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 convert_map_coordinate(map_coordinate)\n coordinate = map_coordinate.to_s # in case it was a symbol\n # converts first character \"ABCDEFGHIJ\" <=> \"0123456789\"\n one = coordinate[0]\n two = coordinate[1,2]\n\n if one.ord < \"A\".ord\n # \"00\"..\"09\" to \"A1\"..\"J1\"\n two = (two.ord + 17).chr # convert digits to characters\n one = (one.to_i + 1).to_s\n coordinate = (two + one).to_sym\n else\n one = (one.ord - 17).chr # convert characters to digits\n two = (two.to_i - 1).to_s\n coordinate = two + one # allows A1 J1 map to 00..09\n end\n return coordinate\nend",
"def to_coordinate(human_move)\n mapping = {\n \"A1\"=>[0,0], \"A2\"=>[0,1], \"A3\"=>[0,2], \"A4\"=>[0,3], \"A5\"=>[0,4], \"A6\"=>[0,5],\n \"B1\"=>[1,0], \"B2\"=>[1,1], \"B3\"=>[1,2], \"B4\"=>[1,3], \"B5\"=>[1,4], \"B6\"=>[1,5],\n \"C1\"=>[2,0], \"C2\"=>[2,1], \"C3\"=>[2,2], \"C4\"=>[2,3], \"C5\"=>[2,4], \"C6\"=>[2,5],\n \"D1\"=>[3,0], \"D2\"=>[3,1], \"D3\"=>[3,2], \"D4\"=>[3,3], \"D5\"=>[3,4], \"D6\"=>[3,5],\n \"E1\"=>[4,0], \"E2\"=>[4,1], \"E3\"=>[4,2], \"E4\"=>[4,3], \"E5\"=>[4,4], \"E6\"=>[4,5],\n \"F1\"=>[5,0], \"F2\"=>[5,1], \"F3\"=>[5,2], \"F4\"=>[5,3], \"F5\"=>[5,4], \"F6\"=>[5,5],\n \"G1\"=>[6,0], \"G2\"=>[6,1], \"G3\"=>[6,2], \"G4\"=>[6,3], \"G5\"=>[6,4], \"G6\"=>[6,5]\n }\n mapping[human_move]\n end",
"def pos_to_coords(pos)\n x = (pos % size)\n y = size - 1 - (pos / size).to_i\n\n Point.new x, y\n end",
"def convert_to_piece_position(coordinates)\n alpha = ('a'..'h').to_a\n\n row_index, column_index = coordinates\n\n alpha[row_index-1] + column_index.to_s\n end",
"def vector_to(point2)\n end",
"def input_convertion(input)\n\t\t@letter_convertion = {\"a\" => 1, \"b\" => 2, \"c\" => 3, \"d\" => 4, \"e\" => 5, \"f\" => 6, \"g\" => 7, \"h\" => 8}\n\t\t#stores the name of the node occupying the start square.\n\t\t@opponent_piece = @board[input[1]].name\n\t\t#stores the name of the node occupying the final square.\n\t\t@piece_name = @board[input[0]].name\n\t\t#stores the coordinate of the start square.\n\t\t@first_coord_convertion = input[0]\n\t\t#stores the coordinate of the final square.\n\t\t@second_coord_convertion = input[1]\n\t\t#stores the node which is occupying the start square.\n\t\t@start_node = @board[input[0]]\n\t\t#stores the node which is occupying the final square.\n\t\t@final_node = @board[input[1]]\n\t\tfinal_movement = []\n\t\tx1 = @letter_convertion[input[0][0]]\n\t\ty1 = input[0][1].to_i\n\t\tx2 = @letter_convertion[input[1][0]]\n\t\ty2 = input[1][1].to_i\n\t\t#stores the coordinate of the start square after being transformed into numbers.\n\t\t@start_coord = [x1,y1]\n\t\t#stores the coordinate of the final square after being transformed into numbers.\n\t\t@final_coord = [x2,y2]\n\t\tfinal_movement << (x2 - x1)\n\t\tfinal_movement << (y2 - y1)\n\t\t#stores the subtraction of the two squares coordinates to get the final move required.\n\t\tfinal_movement\n\tend",
"def internal_coordinates(axes)\n raise TypeError unless axes.is_a?(Mageo::Axes)\n\n axes = axes.to_a\n Mageo::Vector3DInternal[ *(Malge::SimultaneousEquations.cramer(axes.transpose, self)) ]\n end",
"def svg_coord(row, col)\n\t\t[col*10 + 5, row*10 + 5]\n\tend",
"def calculate_coordinates\n (\n egde(@x1, @y1, @x2, @y1) +\n egde(@x2, @y1, @x2, @y2) +\n egde(@x2, @y2, @x1, @y2) +\n egde(@x1, @y2, @x1, @y1)\n ).uniq\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def cm2pts(x)\n (x / 2.54) * 72\n end",
"def text_coordinates\n return 28, 5, 152, 16\n end",
"def to_ecef\n\t\t\tclon = Math::cos(lon * D2R)\n\t\t\tslon = Math::sin(lon * D2R)\n\t\t\tclat = Math::cos(lat * D2R)\n\t\t\tslat = Math::sin(lat * D2R)\n\n\t\t\tn = WGS84_A / Math::sqrt(1.0 - WGS84_E * WGS84_E * slat * slat)\n\t\t\n\t\t\tx = n * clat * clon\n\t\t\ty = n * clat * slon\n\t\t\tz = n * (1.0 - WGS84_E * WGS84_E) * slat\n\t\n\t\t\treturn x, y, z\n\t\tend",
"def coord_array\n _coords.dup\n end",
"def to_latlong\n end",
"def convert_position_to_array(position)\n\t\t@coordinate = position.chars\n\t\ttemp = @coordinate[0]\n\t\tx = @coordinate[1]\n\t\tx = (8 - position[1].to_i )\n\t\tconvert_y = { a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6 , h: 7 }\n\t\ty= convert_y.values_at(temp.to_sym)\n\t\t@coordinate[0]=x\n\t\t@coordinate[1]= y[0]\n\t\tposition_array = @coordinate\n\tend",
"def to_coordinates(x, y, size, orientation)\n coords = []\n\n if orientation == :across\n size.times do |n|\n coords << [x+n, y] \n end\n elsif orientation == :down\n size.times do |n|\n coords << [x, y+n]\n end\n end\n\n return coords\n end",
"def to_WGS\n [@lat - @d_lat, @lon - @d_lon]\n end",
"def project x1, y1, a, m\n rad = a * D2R\n [x1 + Math.cos(rad) * m, y1 + Math.sin(rad) * m]\n end",
"def to_coordinates\n [:latitude, :longitude].map{ |i| send self.class.geocoder_options[i] }\n end",
"def coords\n [x, y]\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 normalize_coordinates\n minY = minX = 1000000\n maxX = maxY = -minX\n @passages.each do |passage|\n if passage.x < minX then minX = passage.x end\n if passage.x > maxX then maxX = passage.x end\n if passage.y < minY then minY = passage.y end\n if passage.y > maxY then maxY = passage.y end\n end\n x_distance = 0 - minX\n y_distance = 0 - minY\n @extentX = maxX + x_distance\n @extentY = maxY + y_distance\n @passages.each do |passage|\n passage.x += x_distance\n passage.y += y_distance\n end\n end",
"def get_coords_from_node(node)\n\t\t[node.x,node.y]\n\tend",
"def to_image_space p, origin_x, origin_y\n {x: (origin_x - @scale * (p[0] * @canonical_x[0] + p[1] * @canonical_x[1] + \n p[2] * @canonical_x[2] + p[3] * @canonical_x[3])),\n y: (origin_y + @scale * (p[0] * @canonical_y[0] + p[1] * @canonical_y[1] + \n p[2] * @canonical_y[2] + p[3] * @canonical_y[3]))};\n end",
"def coordinates(alt_format = false)\n coordinates_array = []\n if alt_format\n return ['-80.394617, 31.066399'] unless has_coordinates?\n dcterms_spatial.each do |el|\n coordinates_array << \"#{longitude(el)}, #{latitude(el)}\" if element_has_coordinates el\n end\n else\n return ['31.066399, -80.394617'] unless has_coordinates?\n dcterms_spatial.each do |el|\n coordinates_array << \"#{latitude(el)}, #{longitude(el)}\" if element_has_coordinates el\n end\n end\n coordinates_array\n end",
"def gather_coords(x,y)\n if y == 100\n y = 99.9\n end\n if x == 100\n x = 99.9\n end\n id = (x * 10000 + 0.5).floor * 10000 + (y * 10000 + 0.5).floor\n return id/100\nend",
"def coordinates\n @coordinates\n end",
"def position\n [ @x, @y, COMPASS[@orientation].to_s ]\n end",
"def calculate_coordinates\n bresenham_circle_coordinates\n end",
"def coordinates\n [latitude, longitude]\n end",
"def make_coordinate_matrix collection1, collection2\n #in_collection = op.input(INPUT).collection\n if debug\n collection1 = Collection.find(394053)\n end\n #out_collection = op.output(OUTPUT).collection\n input_coordinate_matrix = []\n collection1_coordinate_matrix = []\n curr_char = 'A'\n curr_char_ascii = 0\n log_info \"in_collection.matrix inside method\", collection1.matrix\n collection1.matrix.each do |row|\n curr_row = []\n curr_num = 1\n row.each do |col|\n curr_coordinate = curr_char + (curr_num.to_s)\n if col != -1\n curr_row.push(curr_coordinate)\n end\n curr_num += 1\n end\n curr_char_ascii = curr_char.ord\n curr_char_ascii += 1\n curr_char = curr_char_ascii.chr\n curr_num = 0\n collection1_coordinate_matrix.push(curr_row)\n end\n log_info \"coordinate matrix\", collection1_coordinate_matrix\n collection1_matrix = collection1_coordinate_matrix.flatten\n matrix_for_display = []\n collection1_matrix.each_slice(collection2.dimensions[1]) do |slice|\n matrix_for_display.push(slice)\n end\n \n matrix_for_display # return\n end",
"def coordinate_to_decimal\n\t\treturn nil if self.blank?\n\t\tresult = 0.0\n\t\tminus = false\n\t\t\n\t\t# Degrees\n\t\tsplitted_1 = self.split(\"°\")\n\t\treturn nil if splitted_1.length != 2\n\t\tresult += splitted_1[0].to_i.to_f\n\n\t\t# Minus correction\n\t\tif result < 0.0\n\t\t\tminus = true\n\t\t\tresult = -result\n\t\tend\n\n\t\t# Minutes\n\t\tsplitted_2 = splitted_1[1].split(\"'\")\n\t\treturn nil if splitted_2.length != 2\n\t\tresult += (splitted_2[0].to_i.to_f / 60.to_f).to_f\n\n\t\t# Seconds\n\t\tresult += (splitted_2[1].to_f / 3600.to_f).to_f\n\n\t\t# Minus correction\n\t\tif minus\n\t\t\tresult = -result\n\t\tend\n\n\t\treturn result\n\tend",
"def position_to_location_and_tile_coords(position)\n ::Demiurge::TiledLocation.position_to_loc_coords(position)\n end",
"def correct_geo_coords\n coords = params.seek :geo, :geojson, :geometry, :coordinates\n if coords\n array = GeosHelper.geo_coords_to_array(coords)\n params[:geo][:geojson][:geometry][:coordinates] = array\n end\n end",
"def to_coordinates_ddmmss(orig_val)\n w, e, n, s = orig_val.to_s.scanf('%f -- %f/%f -- %f')\n raise ArgumentError, \"Out of bounds latitude: #{n} #{s}\" unless n >= -90 && n <= 90 && s >= -90 && s <= 90\n raise ArgumentError, \"Out of bounds longitude: #{w} #{e}\" unless w >= -180 && w <= 180 && e >= -180 && e <= 180\n\n w = \"#{w < 0 ? 'W' : 'E'} #{dd2ddmmss_abs w}\"\n e = \"#{e < 0 ? 'W' : 'E'} #{dd2ddmmss_abs e}\"\n n = \"#{n < 0 ? 'S' : 'N'} #{dd2ddmmss_abs n}\"\n s = \"#{s < 0 ? 'S' : 'N'} #{dd2ddmmss_abs s}\"\n \"#{w}--#{e}/#{n}--#{s}\"\n end",
"def coordinates\n \"#{longitude},#{latitude}\"\n end"
] | [
"0.683111",
"0.6757375",
"0.6693201",
"0.6676919",
"0.66255313",
"0.6622134",
"0.66210645",
"0.65812904",
"0.65732133",
"0.6523067",
"0.650704",
"0.64561826",
"0.6397892",
"0.6352838",
"0.630922",
"0.62871784",
"0.62734216",
"0.61899614",
"0.61732113",
"0.6146312",
"0.61312777",
"0.61265504",
"0.6118713",
"0.60950136",
"0.60819113",
"0.60755146",
"0.6071351",
"0.60639566",
"0.60416645",
"0.60394526",
"0.60044605",
"0.5937552",
"0.59260315",
"0.59183294",
"0.591813",
"0.5910471",
"0.5890593",
"0.5874592",
"0.58554995",
"0.58458495",
"0.5841452",
"0.5839752",
"0.5839105",
"0.5838211",
"0.5824905",
"0.5820475",
"0.58069825",
"0.57968503",
"0.5783721",
"0.5764249",
"0.57585627",
"0.57396334",
"0.5731883",
"0.56837124",
"0.5674374",
"0.56686604",
"0.5655864",
"0.5653962",
"0.56517106",
"0.5648625",
"0.56343865",
"0.56295973",
"0.5626981",
"0.56248796",
"0.5622658",
"0.5619772",
"0.5615633",
"0.56143063",
"0.558834",
"0.55811435",
"0.5574554",
"0.5570066",
"0.5568455",
"0.5568455",
"0.55636376",
"0.55624175",
"0.55549484",
"0.55534816",
"0.5550843",
"0.55502325",
"0.55475247",
"0.55414724",
"0.5517849",
"0.5511119",
"0.55040914",
"0.55002004",
"0.5495948",
"0.5493859",
"0.5488374",
"0.548127",
"0.54694664",
"0.54675037",
"0.54644376",
"0.54635036",
"0.5456303",
"0.545599",
"0.5453418",
"0.54523456",
"0.5444652",
"0.5433449",
"0.54329103"
] | 0.0 | -1 |
methods for route search results total_time : minutes total_dist : meter | def total_time
@data[1]['ROUTE']['total_time']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def total_time(distance, mph)\n time = distance / mph \nend",
"def find_by_route\n @result = Array.new\n @distancias = Array.new\n\n @ride = Ride.order('id')\n if params[:radio] != '0'\n @ride.each do |p|\n distancia1 =Geocoder::Calculations.distance_between([params[:destLatitud],params[:destLongitud]], [p.destPointLat,p.destPointLong])\n distancia2 =Geocoder::Calculations.distance_between([params[:startLatitud],params[:startLongitud]], [p.startPointLat,p.startPointLong])\n if distancia1 <params[:radio].to_f && distancia2 <params[:radio].to_f\n @result.push(p)\n #@distancias.push(distancia1)\n end\n end\n # json_response={\n # result: @result,\n # distancias: @distancias\n # } \n respond_with @result , location: nil\n end\n if params[:radio] == '0'\n respond_with @ride,location: nil\n end \n #Ride.find_by_destPointLat_and_destPointLong(params[:latitud],params[:longitud])\n \n end",
"def stats\n [ride_distance, ride_time]\n end",
"def trip_calc dist, miles_per_g, price_per_g, speed_mph\n gallons_used = dist / miles_per_g\n cost = gallons_used * price_per_g\n time = dist / speed_mph\n return {cost: cost.to_f.round(2), time: time.to_f.round(2)}\nend",
"def traveling_time(distance)\n \n hour = Time.new.hour\n bus_speed = 0\n taxi_speed = 0\n \n # vehicle speeds depend on time of day\n case hour\n when 5..8\n bus_speed = 0.6 # km/minute 30km/hour\n \n when 9..13\n bus_speed = 0.5\n \n when 14..16\n bus_speed = 0.6\n \n when 17..20\n bus_speed = 0.4\n \n when 21..23\n bus_speed = 0.8\n \n when 0..4\n bus_speed = 0.000001\n end\n\n case hour\n when 5..8\n taxi_speed = 0.9 # km/minute 30km/hour\n \n when 9..13\n taxi_speed = 0.8\n \n when 14..16\n taxi_speed = 0.9\n \n when 17..20\n taxi_speed = 0.6\n \n when 21..23\n taxi_speed = 0.9\n \n when 0..4\n taxi_speed = 1.0\n end\n \n time_taken_in_bus = distance.to_f / bus_speed.to_f\n time_taken_in_taxi = distance.to_f / taxi_speed.to_f\n return time_taken_in_bus #, time_taken_in_taxi\nend",
"def distance_measurement; end",
"def distance_calculator(start, destination)\n #http://forrst.com/posts/Read_JSON_data_using_Ruby-13V\n url = \"http://maps.googleapis.com/maps/api/distancematrix/json?origins=#{start}&destinations=#{destination}&mode=driving&sensor=false\"\n \n buffer = open(url).read\n result = JSON.parse(buffer)\n \n duration = result[\"rows\"].first[\"elements\"].first[\"duration\"][\"value\"]\n distance = result[\"rows\"].first[\"elements\"].first[\"distance\"][\"value\"]\n return duration.to_f/60, distance.to_f/1000\nend",
"def trip_time(distance, speed)\n result = (distance / speed)\n return result\nend",
"def getTotalDistance\n return @totalDistance\n end",
"def match\n @current_route = Route.find(params[:id])\n \n @dep_lat = @current_route.departure_lat \n @dep_lng = @current_route.departure_lng\n @dep_lat_range = @current_route.distance_departure_range * 0.009\n @dep_lng_range = @current_route.distance_departure_range * 0.008\n \n @arr_lat = @current_route.arrival_lat \n @arr_lng = @current_route.arrival_lng\n @arr_lat_range = @current_route.distance_arrival_range * 0.009\n @arr_lng_range = @current_route.distance_arrival_range * 0.008\n \n @time_min = @current_route.time_range_from\n @time_max = @current_route.time_range_to\n\n @date = @current_route.date\n \n if @current_route.offer == true\n @status = false\n else\n @status = true\n end\n \n @routes = Route.find(:all, :conditions => \n [\"`routes`.`date` = ? AND \n `routes`.`active` = 1 AND \n `routes`.`offer` = ? AND \n (`routes`.`departure_lat` BETWEEN ? AND ?) AND \n (`routes`.`departure_lng` BETWEEN ? AND ?) AND \n (`routes`.`arrival_lat` BETWEEN ? AND ?) AND \n (`routes`.`arrival_lng` BETWEEN ? AND ?) AND \n ( (`routes`.`time_range_to` BETWEEN ? AND ?) OR \n (`routes`.`time_range_from` BETWEEN ? AND ?) OR\n (`routes`.`time_range_from` < ? AND `routes`.`time_range_to` > ?) \n )\",\n @date, \n @status,\n @dep_lat - @dep_lat_range, @dep_lat + @dep_lat_range,\n @dep_lng - @dep_lng_range, @dep_lng + @dep_lng_range,\n @arr_lat - @arr_lat_range, @arr_lat + @arr_lat_range, \n @arr_lng - @arr_lng_range, @arr_lng + @arr_lng_range,\n @time_min, @time_max, @time_min, @time_max, @time_min, @time_max]);\n \n \n # @routes = Route.find(:all, :conditions => \n # [\"`routes`.`date` = ? AND \n # `routes`.`active` = 1 AND \n # `routes`.`offer` = ? AND \n # (`routes`.`departure_lat` BETWEEN ? AND ?) AND \n # (`routes`.`departure_lng` BETWEEN ? AND ?) AND \n # (`routes`.`arrival_lat` BETWEEN ? AND ?) AND \n # (`routes`.`arrival_lng` BETWEEN ? AND ?) AND \n # ((`routes`.`time_range_to` BETWEEN ? AND ?) OR (`routes`.`time_range_from` BETWEEN ? AND ?))\",\n # @date, \n # @status,\n # @dep_lat - @dep_lat_range, @dep_lat + @dep_lat_range,\n # @dep_lng - @dep_lng_range, @dep_lng + @dep_lng_range,\n # @arr_lat - @arr_lat_range, @arr_lat + @arr_lat_range, \n # @arr_lng - @arr_lng_range, @arr_lng + @arr_lng_range,\n # @time_min, @time_max,@time_min, @time_max]);\n \n # @routes = Route.where(:departure_lat => @dep_lat - @dep_lat_range..@dep_lat + @dep_lat_range,\n # :departure_lng => @dep_lng - @dep_lng_range..@dep_lng + @dep_lng_range,\n # :arrival_lat => @arr_lat - @arr_lat_range..@arr_lat + @arr_lat_range, \n # :arrival_lng => @arr_lng - @arr_lng_range..@arr_lng + @arr_lng_range,\n # :date => @date,\n # :time_range_to => @time_min..@time_max,\n # :active => true,\n # :offer => @status).limit(20).all \n \n respond_to do |format|\n format.html \n format.json { render json: @routes }\n end\n end",
"def distance_calculator\n @trips.each do |trip|\n @total_distance += trip.distance.to_f\n end\n end",
"def total_distance_driven\n distances = rides.map{ |ride| ride.distance }\n distances.reduce(:+)\n end",
"def trip_duration(distance)\n distance/speed\n end",
"def total_meters\n data[:total_meters]\n end",
"def getTimeOnPath(view_path_coordinates, average_speed, distance)\n target = distance/average_speed # miliseconds\n end",
"def show\n \n @url = \"https://maps.googleapis.com/maps/api/directions/json?origin=#{@trip.origin.gsub(\" \", \"_\") + \"_ny\"}&destination=#{@trip.destination.gsub(\" \", \"_\") + \"_ny\"}\"\n \n #driving details\n @drivingroute=HTTParty.get(@url)\n @drivingroutedetails = {'distance' => @drivingroute['routes'][0]['legs'][0]['distance']['text'], 'time' => @drivingroute['routes'][0]['legs'][0]['duration']['text']}\n @urltransit = \"https://maps.googleapis.com/maps/api/directions/json?origin=#{@trip.origin.gsub(\" \", \"_\") + \"_ny\"}&destination=#{@trip.destination.gsub(\" \", \"_\") + \"_ny\"}&departure_time=#{@trip.departure_time.to_i}&mode=transit\"\n\n #transit details\n @transitroute=HTTParty.get(@urltransit)\n @transitroutedetails = {'distance' => @transitroute['routes'][0]['legs'][0]['distance']['text'], 'time' => @transitroute['routes'][0]['legs'][0]['duration']['text']}\n\n \n @carbondioxideemission = @drivingroute['routes'][0]['legs'][0]['distance']['text'].to_f*248\n @gasolineused = @drivingroute['routes'][0]['legs'][0]['distance']['text'].to_f*0.04149\n\n # Trip.find(params[:id]).cabcost(@drivingroutedetails['distance'].to_f,@drivingroutedetails['time'].to_i)\n\n @moneyspent = Trip.find(params[:id]).cabcost(@drivingroutedetails['distance'].to_f,@drivingroutedetails['time'].to_i)\n @moneysaved = (@moneyspent/(Trip.find(params[:id]).number_of_people.to_f) - 2.50).to_f\n\n\n # 163g of CO2 emitted per mile for transit....411g of C02 emitted per mile for cars = 248 diff\n # 9.4g of CO emitted per mile for cars ...\n #sources: EPA, CarbonFund.org, \n\n #http://www.epa.gov/otaq/consumer/420f08024.pdf\n\n #stats to be seen: CO2, gasoline saved, money saved \n\n\n \n end",
"def trip_duration(distance)\n distance / @speed\n end",
"def compute_stops(route)\n route.visited_stops\n end",
"def calculate(route)\n dist = 0\n route.each_cons(2) { |points| dist = dist + points[0].distance(points[1])}\n dist\nend",
"def totalDistance\n @distanceTraveled \n @gasCost = @milage * @distanceTraveled\n @gasCost\n \"You've spent $#{@gasCost} for gas so far!\"\n end",
"def totalDistance\n @distanceTraveled \n @gasCost = @milage * @distanceTraveled\n @gasCost\n \"You've spent $#{@gasCost} for gas so far!\"\n end",
"def travel_time\n travel_time = 0\n @solution.each { |route| travel_time += route.travel_time_and_cost[1] }\n return travel_time\n end",
"def calculateTravelTime( distance, speed )\n time = distance / speed\n\n return time.round( 2 )\nend",
"def trip_distance(duration)\n duration * @speed\n end",
"def perform(duration_in_ms, route, status)\n end",
"def optimize_for_location(params)\n flight_floor = params[:flight_floor] || 5000 #meters\n flight_ceiling = params[:flight_ceiling] || 60000 #meters\n\n #verify parameters\n params = params.with_indifferent_access\n\n raise 'No start altitude (params[:start][:altitude])' unless params[:start][:altitude].present?\n raise 'No start latitude (params[:start][:lat])' unless params[:start][:lat].present?\n raise 'No start longitude (params[:start][:lon])' unless params[:start][:lon].present?\n raise 'No start time (params[:start][:time])' unless params[:start][:time].present?\n\n raise 'No finish latitude (params[:finish][:lat])' unless params[:finish][:lat].present?\n raise 'No finish longitude (params[:finish][:lon])' unless params[:finish][:lon].present?\n\n # creates a filter lambda to check that any path passes certain conditions\n filter = lambda {|node, previous|\n node.altitude < flight_ceiling &&\n node.altitude > flight_floor &&\n # (!x || y) checks y only if x is true\n (!params[:use_faa] || node.faa_zones_approx(previous)) && #no restricted zones\n (!params[:check_countries] || node.countries(previous))\n }\n\n #run the search with the provided start, duration, and performance factor\n greedy_search({\n start: Node.from_pos(\n params[:start][:lat].to_f, params[:start][:lon].to_f,\n params[:start][:altitude].to_f, params[:start][:time]\n ),\n finish: Node.from_pos(\n params[:finish][:lat].to_f, params[:finish][:lon].to_f,\n params[:start][:altitude].to_f, params[:start][:time]\n ),\n movement_cost: lambda {|current|\n #vent / ballast costs are proportional to the square of the altitude change\n (current.parent.altitude - current.altitude).abs/1200000.0\n },\n heuristic: lambda {|current|\n ((current.parent.lon - current.lon) / Prediction::time_variance)\n },\n neighbors: lambda {|current|\n current.neighbors(filter)\n },\n build_from_finish: lambda{|finish|\n finish.build_chain\n },\n timeout: params[:timeout],\n performance: params[:performance]\n })\n\n end",
"def result_description\n \"Distance\"\n end",
"def distance_on_path(t)\n # for now, just average\n average_speed * t\n end",
"def totalDistance\n @gasCost = @milage * @distanceTraveled\n \"You've spent $#{@gasCost} for gas so far!\"\n end",
"def score_with_phrf_time_on_distance\n cf = self.rating\n et = self.elapsed_time\n d = self.distance\n\n (et - (d * cf)).round\n end",
"def run\n start = rand(20)\n puts \" Starting at: #{@locations[start].name}\"\n tripDesc = \"\" # human-readable List of moves for current trip segment\n @locations[start].visited = true\n visited = 1\n totalTime = 0\n while visited < 20\n group = group_nearest(start)\n best_time = 9999999999\n\n for i in 0..3\n result = getBestPath(start, group[i]) if group[i]\n if result[0] < best_time\n best_time = result[0]\n best_path = result[1]\n best_dest = group[i]\n end\n end\n tripDesc << best_path\n totalTime += best_time\n @locations[best_dest].visited = true\n start = best_dest\n visited += 1\n end\n\n puts \"*********** Total Trip Time = #{secondstoHMS(totalTime)} **************\"\n confirm = \"Complete.\\n\"\n for i in 0..19\n confirm = \"Error, not all locations visited!!\\n\" if !@locations[i].visited\n end\n tripDesc << confirm\n return [totalTime, tripDesc]\n\n end",
"def total_time; end",
"def multiple_usage\r\n date_ranges = get_date_ranges\r\n meters = get_meters\r\n dtps = get_dtps\r\n\r\n #MeterAggregation.aggregate_missing_data date_ranges, dtps, meters\r\n\r\n #dtps = []\r\n\r\n #usages = Meter.usage_by_meter date_ranges, dtps, meters\r\n #usages = Meter.detailed_usage_by_meter date_ranges, dtps, meters\r\n #usages = Meter.usage_by_time date_ranges, dtps, meters\r\n usages = {}\r\n\r\n t = Benchmark.measure {\r\n usages = Meter.detailed_usage_by_time date_ranges, dtps, meters\r\n }\r\n logger.info \"Time taken => #{t}\"\r\n # usages[:query_time] = t\r\n render :json => usages\r\n\r\n #redirect_to action: 'index'\r\n end",
"def distance\n distance = 0\n @solution.each { |route| distance += route.distance }\n return distance\n end",
"def meters\n if self.u == 'meters' # meter in meter\n self.distance\n# 1 mile = 1609.344 meters\n elsif self.u == 'miles' # meter in mile\n self.distance * 1609.34\n# 1 kilometer = 1000 meters \n elsif self.u == 'kilometers' # meter in kilometer\n self.distance * 1000\n# 1 yard = 0.9144 meters\n elsif self.u == 'yards' # meter in yard\n self.distance * 0.9144\n end\n end",
"def distance\n if valid\n route[:distance].to_i\n end\n end",
"def total_distance()\n self.rides().map() { | ride | ride.distance() }.reduce(:+)\n end",
"def total_distance\n distances = self.rides.map { |ride| ride.distance }\n distances.inject(:+).to_f\n end",
"def total_workout_with_km_calories\n set_sport_by_user.sum(:distance)\n end",
"def generateStats(metros, routes)\n getLongestFlight(routes)\n getShortestFlight(routes)\n getAverageFlight(routes)\n\n getLargestCity(metros)\n getSmallestCity(metros)\n getAverageCity(metros)\n\n getContinentsServed(metros)\n getHubCities(routes)\n end",
"def get_route_duration\n return duration.div(3600)+\"Stunden\"+(duration % 60)+ \"Minuten\" \n end",
"def total_distance\n rides.reduce(0) {|total, ride| total + ride.distance}\n end",
"def total_distance\n rides.reduce(0) {|total, ride| total + ride.distance}\n end",
"def index\n time = time_spent\n hours = ( (1.0/60.0).to_f * time ).round(2)\n\n puts \"Time spent: #{time} minutes (#{hours} hours)\"\n end",
"def calculate_path_size\n t0 = Time.now\n path_sizes = {0 => 0.0, 1 => 0.0, 2 => 0.0, 4 => 0.0, 10 => 0.0, Float::INFINITY => 0.0}\n\n # Retrieves all routes provenient from the same trip\n sibling_routes = AlternateRoute.where(:trip_id => @route.trip_id)#.where(\"state != 'discarded'\")\n\n # Get segment-based mileage for all sibling routes\n sibling_routes_mileage = calculate_routes_mileage(sibling_routes)\n\n # Remove the main route from sibling routes group\n sibling_routes = (sibling_routes.map{|r| r.id} - [@route.id])\n\n # Generate frequencies of each route segment over alternate routes\n frequencies = {}\n appearances = Segment.where(:osm_way_id => @segment_ids).group_by {|s| s.osm_way_id}\n appearances.each do |k, v|\n frequencies[k] = v.map{|e| e.alternate_route_id}.uniq - [nil]\n end\n\n @route.segments.each do |segment|\n segment_length = segment.length\n\n impedance = segment_length/sibling_routes_mileage[@route.id]\n\n # Get all sibling routes where the current segment is used\n ocurrences = frequencies[segment.osm_way_id] & sibling_routes\n #ocurrences = AlternateRoute.joins(:segments).where(:id => sibling_routes).where(\"segments.osm_way_id = ?\", segment.osm_way_id).references(:segments).pluck(:id).uniq\n\n path_sizes.keys.each do |gamma|\n sums = {0 => 1.0, 1 => 1.0, 2 => 1.0, 4 => 1.0, 10 => 1.0, Float::INFINITY => 1.0}\n\n ocurrences.each do |route|\n if gamma == Float::INFINITY\n # if (sibling_routes_mileage[@route.id]/sibling_routes_mileage[route]) > 1.0\n if (sibling_routes_mileage.values.min/sibling_routes_mileage[route]) > 1.0\n sums[gamma] = 0.0\n end\n else\n # sums[gamma] += (sibling_routes_mileage[@route.id]/sibling_routes_mileage[route])**gamma\n # sums[gamma] += (sibling_routes_mileage.values.min/sibling_routes_mileage[route])**gamma\n sums[gamma] += (sibling_routes_mileage.values.min/sibling_routes_mileage[route])**gamma**@route.systems_suggested\n end\n end\n\n if gamma == Float::INFINITY\n path_sizes[gamma] += (impedance * sums[gamma])\n else\n path_sizes[gamma] += (impedance * (1.0/sums[gamma]))\n end\n end\n end\n puts \"[#{@route.id}] Completed in #{(Time.now - t0)* 1000.0} ms\"\n puts \"[#{@route.id}] Path Size: #{path_sizes}\"\n path_sizes\n end",
"def get_route(curr_pos, end_time, pmap, tws, twe) \n ans = []\n starting_tuple = curr_pos << 0 # 0 is the waiting time\n ans << starting_tuple # [y, x, time unit]\n \n\t\n\t\n max_y = pmap.length - 1 \n max_x = pmap[0].length - 1\n \n highest_score = 0.0\n \n\ttime_for_score = 0.0\n\ttime_for_get_ans = 0.0\n\t\n\ttemp = -1\n\ttemp1 = 0\n\tfor y in 0..max_y\n\t\ttemp1 = pmap[y].count(temp)+ temp1 \n\tend\n\t\n\tno_of_pokemon = (pmap.length*pmap[0].length - temp1)\n\t\n\tnumber_of_loops = 0.7541*Math.log(no_of_pokemon,E) + 0.9829\n\t\n\n\t\n\t\n for h in 0...number_of_loops\n pmap1 = Marshal.load(Marshal.dump(pmap))\n tws1 = Marshal.load(Marshal.dump(tws))\n twe1 = Marshal.load(Marshal.dump(twe))\n\t\t\n time_taken = Time.now\n sortedArrayByRatioDistStart1 = []\n ans1 = []\n ans1 = getArrayResultsWithStartingPokemon(starting_tuple, pmap1, tws1, twe1, sortedArrayByRatioDistStart1, end_time, h)\n\t\ttime_for_get_ans = Time.now - time_taken + time_for_get_ans\n\t\t\n\t\tpmap1 = Marshal.load(Marshal.dump(pmap))\n tws1 = Marshal.load(Marshal.dump(tws))\n twe1 = Marshal.load(Marshal.dump(twe))\n\t\t\n\t\ttime_taken = Time.now\n score_time1 = get_score(ans1, pmap1, tws1, twe1)\n route_score1 = score_time1[0].round\n route_time1 = score_time1[1].round(3)\n time_for_score = Time.now - time_taken + time_for_score\n\t\t\n if highest_score <= route_score1\n final_ans = ans1\n highest_score = route_score1\n end\n\t\t\n\t\t\n end\n \n\n return final_ans\nend",
"def index_old\n \n user = User.find(session[:id])\n \n # Connecting with dopplr and creating session \n client = Dopplr::Client.new\n client.token = user.tokendopplr\n\t \n\t # Getting the XML with all the trips and iterating by trip\n\t mike = client.traveller\n\t \n\t \n\t # Starting variables\n\t @trips = \"\" \n\t @km = 0;\n\t @nrtrips = 0;\n\t @totalco2 = 0;\n\t \n\t # Getting the XML with all the trips and iterating by trip\n\t mike.trips.each do |trip|\n\t\t\n\t\t# Get the coordinates of the startpoint based on the position of the day before traveling\n\t\tstartdate = trip.start.to_date - 1.day\n\t\tstartplace = client.get('location_on_date', :date => startdate)['location']\n\t\t\n\t\tif startplace['trip'] != nil\n\t\t\tlat = startplace['trip']['city']['latitude']\n\t\t\tlong = startplace['trip']['city']['longitude']\n\t\t\tnamestart = startplace['trip']['city']['name']\n\t\telse\n\t\t\tlat = startplace['home']['latitude']\n\t\t\tlong = startplace['home']['longitude']\n\t\t\tnamestart = startplace['home']['name']\n\t\tend\n\t\t\n\t\t# Calculate the distance in km based in Km based on the latitude and longitude\n\t\tdLat = 3.141592653589793238462643383298 * (trip.city.latitude - lat) / 180\n \n dLon = 3.141592653589793238462643383298 *(trip.city.longitude - long) / 180\n\t\t\n\t\ta = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos( 3.141592653589793238462643383298 * lat / 180) * Math.cos(3.141592653589793238462643383298 * trip.city.latitude/ 180) * Math.sin(dLon/2) * Math.sin(dLon/2)\n\t \t\n\t \tc = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))\n\t \tdistancekm = 6371 * c\n\t \t\n\t \t# Calculate co2 if flight\n\t \tif trip.outgoing_transport == 'plane' then\n\t \t\tif distancekm < 800 then\n\t \t \t \t# If short haul\n\t \t \t\tco2 = distancekm * Source.find(3).factor\n\t \t\telse\n\t \t \t\t# If long haul\n\t \t \t\tco2 = distancekm * Source.find(4).factor\n\t \t\tend\n\t \tend\n\t \t\n\t \t# Calculate co2 if train\n\t \tif trip.outgoing_transport == 'train' then\n\t \t\tco2 = distancekm * Source.find(5).factor\n\t \tend\n\t \t\n\t \t# Calculate co2 if bus\n\t\tif trip.outgoing_transport. == 'bus' then\n\t \t\tco2 = distancekm * Source.find(6).factor\n\t \tend \t\n\t \t\n\t \t# Calculate co2 if car\n\t \tif trip.outgoing_transport == 'car' then\n\t \t\tco2 = distancekm * Source.find(7).factor\n\t \tend \t\n\t \t\n\t \t# Aggregate information\n\t \t@nrtrips += 1\n\t \t@totalco2 += co2 \n\t \t@km += distancekm\n\t \t@trips = @trips + \" From \" + namestart + \" to \" + trip.city.name + \" was \"+ distancekm.round.to_s + \" Km. By: \" + trip.outgoing_transport + \" and emitted \"+ co2.round.to_s + \" Kg CO2. <br>\"\n\t \t\n\t \t# Calculate return\n\t\t \n\t\t finishdate = trip.finish.to_date + 1.day\n \t\tfinishplace = client.get('location_on_date', :date => finishdate)['location']\n\t\t\n if finishplace.has_key?('trip')\n \t\t\t\n \t\t\tif finishplace['trip']['city']['name'] == namestart\n \t\t # Return to same city as the start (but not the home place)\n \t\t lat = trip.city.latitude\n \t\t\tlong = trip.city.longitude\n \t\t\tnamestart = trip.city.name\n \t\t\tlatfinish = finishplace['trip']['city']['latitude']\n \t\t longfinish = finishplace['trip']['city']['longitude']\n \t\t namefinish = finishplace['trip']['city']['name']\n \t\t else\n\t\t # The trip continues to another place, so nothing happens\n\t\t namestart = \"\"\n\t\t end\n\t else\n \t\t\t# The trip returns home\t\n \t\t\tlatfinish = finishplace['home']['latitude']\n \t\t longfinish = finishplace['home']['longitude']\n \t\t namefinish = finishplace['home']['name']\n\t\t end\n\t\t \n\t\t if namestart != \"\"\n\t\t \n\t\t\n\t\t\tlat = trip.city.latitude\n\t\t\tlong = trip.city.longitude\n\t\t\tnamestart = trip.city.name\n\t\t \n\n\t\t\t\n\t\t\t# ReCalculate the distance in km based in Km based on the latitude and longitude\n\t\t\tdLat = 3.141592653589793238462643383298 * (latfinish- lat) / 180\n \n \tdLon = 3.141592653589793238462643383298 * (longfinish - long) / 180\n\t\t\n\t\t\ta = Math.sin(dLat/2) * Math.sin(dLat/2) + Math.cos( 3.141592653589793238462643383298 * lat / 180) * Math.cos(3.141592653589793238462643383298 * latfinish/ 180) * Math.sin(dLon/2) * Math.sin(dLon/2)\n\t \t\n\t \t\tc = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a))\n\t \t\tdistancekm = 6371 * c\n\t\t\t\n\t\t\t# Recalculate co2\n\t\t\t# Calculate co2 if flight\n\t \t\tif trip.return_transport == 'plane' then\n\t \t\t\tif distancekm < 800 then\n\t \t \t \t\t# If short haul\n\t \t \t\t\tco2 = distancekm * Source.find(3).factor\n\t \t\t\telse\n\t \t \t\t\t# If long haul\n\t \t \t\t\tco2 = distancekm * Source.find(4).factor\n\t \t\t\tend\n\t \t\tend\n\t \t\n\t \t\t# Calculate co2 if train\n\t \t\tif trip.return_transport == 'train' then\n\t \t\t\tco2 = distancekm * Source.find(5).factor\n\t \t\tend\n\t \t\n\t \t\t# Calculate co2 if bus\n\t\t\tif trip.return_transport == 'bus' then\n\t \t\t\tco2 = distancekm * Source.find(6).factor\n\t \t\tend \t\n\t\t \t\n\t\t \t# Calculate co2 if car\n\t\t \tif trip.return_transport == 'car' then\n\t \t\t\tco2 = distancekm * Source.find(7).factor\n\t\t \tend \n\t\n\t\t\t# Aggregate information for return\n\t\t\t@km += distancekm\n\t\t\t@totalco2 += co2\n\t\t\t@trips = @trips + \" From \" + namestart + \" to \" + namefinish + \" was \"+ distancekm.round.to_s + \" Km. By: \" + trip.return_transport + \" and emitted \"+ co2.round.to_s + \" Kg CO2\" + trip.id.to_s + \"<br><br><br>\"\n\n\t\tend\n\t \t\n\t end\t \n\t \n \n end",
"def service_time\n service_time = 0\n @solution.each { |route| service_time += route.service_time }\n return service_time\n end",
"def total_distance\n total = 0\n self.rides.each do { |ride| total += ride.distance }\n total\n end\n\n def self.mileage_cap(distance)\n self.all.select { |driver| driver.total_distance > distance }\n end\n\nend",
"def total_duration\n running_total = 0\n @trips.each do |trip|\n @total_driving_time += trip.duration\n end\n end",
"def get_total_time\n return RideShare.get_all_trip_durations_in_seconds(@trips)\n end",
"def calculate_sim_stats(fences,walk)\n\ttime = (walk['distance']*111110.0).ceil/(@@vars['avg_path_speed_ms']/walk['body'].length)\n\tpath = \"random\"\n\tpath = @@vars['sim_static_walk'] if @@vars['sim_static_walk'] > 0\n\n\tputs \"====== System stats\" if @@vars['show_intermediate_countings']\n\tputs \" Walked distance: #{(walk['distance']*111110.0).ceil}m\n Sim time: #{time}s (#{(time/60).floor}m#{(((time/60)-(time/60).floor)*60).floor}s)\" if @@vars['show_intermediate_countings']\n\n\t# Add to total accumulators\n\t@@vars['total_walked_distance'] += (walk['distance']*111110.0).ceil\n\t@@vars['total_sim_time'] += time\n return\nend",
"def nearof\n @coordenadas = [params[:longitud].to_i,params[:latitud].to_i]\n distance = 100 #km\n\n if @coordenadas\n @nearest = Rails.cache.fetch(\"reports/near/#{params[:longitud].to_i},#{params[:latitud].to_i}\", :expires_in => 8.hours) do\n Report.where(:coord => { \"$nearSphere\" => @coordenadas , \"$maxDistance\" => (distance.fdiv(6371)) }).and(:status => 1).without(:email,:description,:links,:source,:status,:reported_at,:shape,:duration).limit(50).entries\n end\n end\n\n respond_to do |format|\n format.html # nearof.html.erb\n format.json { render json: @nearest }\n end\n end",
"def set_route\n route = Gmaps4rails.destination({\"from\" =>address_start, \"to\" =>address_end},{},\"pretty\")\n\n self.distance = route[0][\"distance\"][\"value\"]\n self.duration = route[0][\"duration\"][\"value\"]\n end",
"def estimate_hits\n nodes = @driver.neighbors\n authority_prime = 0.0\n hub_prime = 0.0\n square_sum_authority_prime = 0.0\n square_sum_hub_prime = 0.0\n # Compute the sum\n nodes.each do |p|\n authority_prime += p.hub\n hub_prime += p.authority\n square_sum_authority_prime += p.authority_prime**2\n square_sum_hub_prime += p.hub_prime**2\n end\n square_sum_authority_prime += authority_prime**2\n square_sum_hub_prime += hub_prime**2\n # Normalize\n authority = authority_prime**2/square_sum_authority_prime\n hub = hub_prime**2/square_sum_hub_prime\n\n # Update routing\n new_routing = @driver.update_routing do |routing|\n routing.authority = authority\n routing.hub = hub\n routing.authority_prime = authority_prime\n routing.hub_prime = hub_prime\n routing.last_update = DateTime.now\n end\n\n new_routing\n end",
"def directions\n @start_abbr = Station.name_to_abbr(params[:start])\n @dest_abbr = Station.name_to_abbr(params[:end])\n\n @start = params[:start]\n @dest = params[:end]\n # Should be something like\n # Station.find_fastest(start: @start, end: @end)\n # And it should return Hash\n @fastest = Station.find_fastest(@start_abbr, @dest_abbr)\n\n if @fastest.is_a?(String)\n render :directions\n return\n end\n\n # Should be something like\n # Station.find_optimal(start: @start, end: @end)\n # And it should return Hash\n # @optimal = {\n # transfer: 'civic',\n # currentDeparture: '17:26',\n # upsteamColor: 'RED',\n # upsteamDestination: 'mlbr',\n # transferArrival: '17:30',\n # transferDeparture: '17:42',\n # downstreamColor: 'YELLOW',\n # downstreamDestination: 'ptsb',\n # finalEta: '18:15',\n # chanceOfStand: 'Very likely',\n # chanceOfSeat: 'Likely'\n # }\n @optimal =\n if @fastest[:waitTime] < 5\n \"Cannot catch the same train upstream\"\n else\n Station.find_optimal(@start_abbr, @dest_abbr, @fastest)\n end\n\n # Should be soething like\n # If Optimal chanceOfSeat is bad then\n # Station.find_guaranteed_seat(start: @start, end: @end)\n # And it should return Hash\n # @guaranteed_seat = {\n # transfer: 'UN Plaza',\n # currentDeparture: '17:30',\n # upstreamColor: 'RED',\n # upstreamDestination: 'mlbr',\n # transferArrival: '17:35',\n # transferDeparture: '17:52',\n # downstreamColor: 'YELLOW',\n # downstreamDestination: 'ptsb',\n # finalEta: '18:25',\n # chanceOfStand: 'Very likely',\n # chanceOfSeat: 'Likely'\n # }\n @guaranteed_seat =\n if @optimal.is_a?(String) ||\n @optimal[:chanceOfSeat] != 'Very likely' \n\n Station.find_guaranteed_seat(@start_abbr, @dest_abbr)\n else\n \"Optimal is guaranteed seat\"\n end\n p \"results\"\n p @fastest\n p @optimal\n p @guaranteed_seat\n render :directions\n end",
"def distance\n distance_and_arc[:distance]\n end",
"def distance\n distance_and_arc[:distance]\n end",
"def count_distance(departure, arrival, sub)\n\tdeparture_line = get_station_line(sub, departure)\n\tarrival_line = get_station_line(sub, arrival)\n\n\tif departure_line.to_s == 'red_line'\n\t\tdistance_first = (get_station_no(sub, departure) - 2).abs\n\telse \n\t\tdistance_first = (get_station_no(sub, departure) - 3).abs\n\tend\n\t\n\tif arrival_line.to_s == 'red_line'\n\t\tdistance_second = (get_station_no(sub, arrival) - 2).abs\n\telse \n\t\tdistance_second = (get_station_no(sub, arrival) - 3).abs\n\tend\n\treturn distance_first + distance_second\n\nend",
"def totalDistance\n\t\ti = 0\n\t\tsum = 0\n\t\twhile i < @@walks\n\t\t\tsum += @@distance[i].to_i\n\t\t\ti += 1\n\t\tend\n\t\tputs \"Bark\"\n\t\tif @@walks == 0\n\t\t\tputs \"#{@name}'s owners don't love them. They haven't been on a walk yet :(\"\n\t\telsif @@walks == 1\n\t\t\tputs \"#{@name} has walked #{sum}kms in a single walk\"\n\t\telse\n\t\t\tputs \"#{@name} has already walked #{sum}kms in #{@@walks} walks\"\n\t\tend\n\tend",
"def kilometers\n self.distance\n end",
"def time_on_path(d)\n getTimeOnPath(view_path_coordinates[\"LonLat\"], average_speed, d)\n end",
"def tracking_result\n @location_detail.update_attributes(eta_calc_time: Time.zone.now) if @location_detail.eta_calc_time.nil?\n\n if @link_generator\n @time_variation = 0\n # @is_api_limit_exceed = true if @location_detail.dispatcher_refresh_count > 3\n else\n @time_variation = 10000\n # @is_api_limit_exceed = true if @location_detail.dispatcher_refresh_count > 4\n end\n set_source_and_dest_points(@location_detail.source_lat,@location_detail.source_long,@location_detail.dest_lat,@location_detail.dest_long)\n @eta = @location_detail.eta\n # @eta = 7 # testing value\n @eta_min = (@eta)%60\n @eta_hr = (@eta)/60\n @curr_mile = @location_detail.curr_mile\n check_for_reached\n # refresh_image\n logger.info\"========eta======#{@eta}=================\"\n logger.info\"=======eta_min========#{@eta_min}================\"\n logger.info\"========eta_hr=======#{@eta_hr}================\"\n logger.info\"======@time_variation===========#{@time_variation}==============\"\n end",
"def distance_price\n distance * price_per_km\n end",
"def calculate_stations\n total=($start-$end).abs\n p \"total of stations of your trip is #{total}\"\n end",
"def results(stop,start)\n hours = stop.hour - start.hour\n mins = stop.min - start.min\n secs = stop.sec - start.sec\n (mins = mins + 60) && (hours = hours - 1) if mins < 0\n (secs = secs + 60) && (mins = mins - 1) if secs < 0\n puts \"Done in #{hours}:#{mins}:#{secs}\"\n puts \"Got: #{Group.count} groups, #{Category.count} categories, #{Product.count} products\"\n end",
"def parse_and_find_distance(full_route)\n cities = full_route.split('-')\n distance=0 \n cities.each_with_index do|city,index|\n if cities[index+1]\n route = prev_find{|route| route.start_city.to_s==city && route.end_city.to_s==cities[index+1]}\n if route\n distance += route.distance.to_i\n else\n return \"No Such Route\"\n end\n end\n end\n distance==0 ? \"No Such Route\" : distance\n end",
"def initialize( meters_swam = 0, time_swam = 0, disqualifications = 0 )\r\n # Individual results\r\n @meters_swam = meters_swam\r\n @time_swam = time_swam\r\n @disqualifications = disqualifications\r\n end",
"def meters \n metrics(Meter)\n end",
"def total_miles\n self.inject(0) do |accum,trip|\n accum += trip.distance_in_miles\n accum\n end\n end",
"def h_dist_total\n self.h_dist_start + self.h_dist_end\n end",
"def find(query)\n begin\n answer = \"Unknown Query. We are sorry!! We coludnot answer you\"\n\n case query\n when /^The distance of the route (.+)$/\n distance = parse_and_find_distance($1)\n answer = distance.kind_of?(String) ? distance : query+' is '+distance.to_s\n when /^The length of the shortest route from ([A-Z]{1}) to ([A-Z]{1})$/\n distance = find_shortest_distance($1,$2)\n answer = distance > 0 ? query+' is '+distance.to_s : \"No Such Route\"\n when /^The number of trips starting at ([A-Z]{1}) and ending at ([A-Z]{1}) with a maximum of (\\d+) stops$/\n trips = trip_with_maximum_stops($1,$2,$3)\n answer = query +' are '+trips.size.to_s+\"(#{trips.join(',')})\"\n when /^The number of trips starting at ([A-Z]{1}) and ending at ([A-Z]{1}) with exactly (\\d+) stops$/\n trips = trip_with_maximum_stops($1,$2,$3,'exactly')\n answer = query +' are '+trips.size.to_s+\"(#{trips.join(',')})\"\n when /^The number of different routes from ([A-Z]{1}) to ([A-Z]{1}) with a distance of less than (\\d+)$/\n trips = trip_with_maximum_stops($1,$2,0,false,$3)\n puts \"Here\"\n answer = query +' are '+trips.size.to_s+\"(#{trips.join(',')})\" \n end\n rescue=>e\n puts \"We are sorry due to technical difficulties we can't answer you at present.\"\n end\n answer.to_s\n end",
"def index\n @trips = Trip.all\n @price = Trip.sum(:price)\n @distance = Trip.sum(:distance)\n @date = Date.today\n\n begin\n fuel_price = Fuel.first.price\n fuel_value = Consumption.first.value\n @km = (fuel_price * fuel_value) / 100\n rescue ActiveRecord::RecordNotFound => e\n fuel_price = 0\n fuel_value = 0\n @km = (fuel_price * fuel_value) / 100\n end\n end",
"def meters(options = {})\n path = OpenStack.get_ceilometer_query(options, [:project_id, :resource_id, :message_id, :start, :end], :limit, \"#{@connection.service_path}/meters\")\n response = @connection.csreq('GET', @connection.service_host, path, @connection.service_port, @connection.service_scheme)\n OpenStack::Exception.raise_exception(response) unless response.code.match(/^20.$/)\n end",
"def grab_nearest_by_location(distance, loc)\n\n end",
"def total_distance\n approved_flights.sum(:distance)\n end",
"def travel_time_and_cost\n cost = 0\n travel_time = 0\n (@path.size - 1).times do |i|\n current_vertex = @path[i]\n next_vertex = @path[i+1]\n # travel time = travel distance\n distance = Vertex.euclidean_distance(current_vertex, next_vertex)\n travel_time += distance\n # calculate how early or how late is service\n early_cost = (next_vertex.ready_time - travel_time) > 0 ? (next_vertex.ready_time - travel_time) : 0\n late_cost = (travel_time - next_vertex.due_time) > 0 ? (travel_time - next_vertex.due_time) : 0\n # calculate penalty cost\n cost += early_cost * @penalty_coefficient + late_cost * @penalty_coefficient\n # add service_time and early_cost (wait-for-service time) to travel time\n travel_time += next_vertex.service_time + early_cost\n end\n return cost, travel_time\n end",
"def cache_statistics data\n self.start_date = DateTime.parse data.first[:timestamp]\n self.duration = DateTime.parse(data.last[:timestamp]).to_time - DateTime.parse(data.first[:timestamp]).to_time\n calculate_distance\n self.min_speed = data.map{|p| p[:speed]}.min\n self.max_speed = data.map{|p| p[:speed]}.max\n self.min_height = data.map{|p| p[:alt]}.min\n self.max_height = data.map{|p| p[:alt]}.max\n save\n end",
"def initialize\n @total_distance = 0\n @journey_depth = 0\n end",
"def distance(start_point, end_point)\n result = prepare_url(start_point, end_point)\n return result[\"routes\"].first[\"legs\"].first[\"distance\"][\"value\"]/1000\n end",
"def total_time=(_arg0); end",
"def next_distances(save = true) ; next_task(@@DISTANCE_TASKS, save) ; end",
"def avarage_workout_with_km_calories\n # Sum totals\n total_distance = set_sport_by_user.sum(:distance)\n # Return if there are workouts\n return total_distance / total_workouts if total_workouts > 0\n 0\n end",
"def analysis_data()\n first_destination = metro[metro.keys[0]].destination\n longest_distance = first_destination[first_destination.keys[0]]\n shortest_distance = first_destination[first_destination.keys[0]]\n avg_distance = 0\n total_number = 0\n longest_city_pair = \"#{metro.keys[0]}-#{first_destination.keys[0]}\"\n shortest_city_pair = \"#{metro.keys[0]}-#{first_destination.keys[0]}\"\n\n biggest_population = metro[metro.keys[0]].population\n smallest_population = metro[metro.keys[0]].population\n avg_population = 0\n biggest_city = metro.keys[0]\n smallest_city = metro.keys[0]\n\n continent = []\n hub_city = metro.keys[0]\n hub_size = first_destination.length\n\n #start the iteration for distance.\n @metros.each do |city_code, city|\n dest = city.destination\n dest.each do |dest, distance|\n if distance > longest_distance\n longest_distance = distance\n longest_city_pair = \"#{city.code}-#{dest}\"\n end\n if distance < shortest_distance\n shortest_distance = distance\n shortest_city_pair = \"#{city.code}-#{dest}\"\n end\n #calculate average\n avg_distance += distance\n total_number += 1\n end\n end\n\n #Search all values needed about continent, population and length.\n city_num = 0\n @metros.each do |city_code, city|\n if !continent.include?(city.continent)\n continent.push(city.continent)\n end\n\n if city.destination.length > hub_size\n hub_city = city_code\n hub_size = city.destination.length\n end\n if city.population > biggest_population\n biggest_population = city.population\n biggest_city = city_code\n end\n if city.population < smallest_population\n smallest_population = city.population\n smallest_city = city_code\n end\n avg_population += city.population\n city_num += 1\n end\n\n @longest_dist = longest_distance\n @shortest_dist = shortest_distance\n @avg_dist = avg_distance\n @biggest_pop = biggest_population\n @biggest_city = biggest_city\n @avg_pop = avg_population/city_num\n @hub_ct = hub_city\n #Here is the printing.\n puts \"------------------CSAIR information---------------------\"\n puts \"The longest distance in CSAIR is #{longest_distance}, #{longest_city_pair}\"\n puts \"The shortest distance in CSAIR is #{shortest_distance}, #{shortest_city_pair}\"\n puts \"The average distance is #{avg_distance/total_number}\"\n puts \"The biggest city is #{biggest_city}, population #{biggest_population}\"\n puts \"The smallest city is #{smallest_city}, population #{smallest_population}\"\n puts \"The average population is #{avg_population/city_num}\"\n puts \"We fly to these continents and cities:\"\n continent.each do |single_continent|\n print \"#{single_continent}: \"\n @metros.each do |city_code, attri|\n if attri.continent == single_continent\n print \"#{city_code} \"\n end\n end\n print \"\\n\"\n end\n puts \"Our hub city is #{hub_city}, it has #{hub_size} lines\"\n puts \"------------------CSAIR information---------------------\"\n puts \"\"\n end",
"def add_result_distances_multi(base)\n MiGA::Result.new(\"#{base}.json\")\n end",
"def total_time\n minutes_to_human_readable_time(entries.internal.sum(:duration) + expected_remaining_work * 60)\n end",
"def time_difference(distance, time)\n etd = base_time + departure_time.minutes\n eta = etd + journey_pattern.time_on_path(distance)\n if eta - 1.minute <= time\n if time <= eta + 1.minute\n # We are for the most part, on time\n return 0;\n else\n logger.info \"LATE!!!! #{tz(time)} ETA #{tz(eta)} #{time-eta} #{((time - eta)/1.minute).to_i}\"\n # we are late (positive) in minutes\n return ((time - eta)/1.minute).to_i\n end\n else\n logger.info \"EARLY!!! #{tz(time)} ETA #{tz(eta)} #{time-eta} #{((time - eta)/1.minute).to_i}\"\n # We are early (negative)\n return ((time - eta)/1.minute).to_i\n end\n end",
"def initialize_routes(data, single)\n data.each do |line|\n @metros[line['ports'][0]].add_distination(line['ports'][1], line['distance'])\n if single == 0\n @metros[line['ports'][1]].add_distination(line['ports'][0], line['distance'])\n end\n end\n end",
"def index\n find_exact_match_only = false\n if (params[:restaurant] or params[:location] )\n find_exact_match_only = true\n end\n if params[:featured] == '1' or params[:trip_location_id] == '0'\n @exact_match_count = 9 \n @message_with_trip_render = nil\n i = 0\n @trips = self.get_featured_trips(params, 3)\n else\n @trips, @exact_match_count, @message_with_trip_render = Trip.search(params, find_exact_match_only)\n end\n \n @trips, @exact_match_count, @message_with_trip_render = get_trips_filtered_by_landmarks(params, @trips, @message_with_trip_render, @exact_match_count)\n @locations = nil\n @restaurants = nil\n @traveler_types = nil\n trips_per_page_default = 3\n\n if (params[:trip_location_id] and params[:trip_location_id] != \"\" and (params[:page] == nil or params[:page] == \"1\"))\n # generate landmark of interest only for the initial trip search with location, not while paginating \n @locations = LocationDetail.search(params[:trip_location_id])\n @restaurants = RestaurantDetail.search(params[:trip_location_id])\n if (params[:traveler_type_id])\n @traveler_types = TravelerType.where(\"traveler_type_id IN (?)\", params[:traveler_type_id])\n end\n end\n \n # this can be simplified later\n page = !params[:page].blank? ? params[:page].to_i : 1\n @trips_per_page = !params[:per_page].blank? ? params[:per_page].to_i : trips_per_page_default\n @trips_per_page = (page <= 1) ? (@trips_per_page - 1) : @trips_per_page\n @exact_match_count = @exact_match_count - (page - 1) * @trips_per_page\n \n if params[:featured] != '1' and params[:trip_location_id] != '0'\n offset = (page == 1) ? 0 : ((page - 1) * @trips_per_page) - 1\n if [email protected]? and @trips.size % trips_per_page_default == 0\n # reset the trips per page as we are adding a dummy trip here\n @trips_per_page = trips_per_page_default \n @trips = @trips.unshift('wxyz')\n end\n @trips = @trips.paginate(:page => page != 1 ? params[:page] : \"1\", :per_page => @trips_per_page, :offset => offset) \n end\n \n respond_to do |format|\n if [email protected]?\n flash.now[:notice] = @message_with_trip_render\n format.html # index.html.erb\n format.js # index.js.erb\n format.json { render json: @trips }\n else\n format.html { redirect_to root_url() }\n end\n end\n end",
"def index\n\n @lat_lons = LatLon.where(nil)\n\n if params[:search].present?\n @lat_lons = @lat_lons.search(params[:search])\n\n elsif params[:radius].present?\n\n if params[:current_location].present?\n @coords = [params[:geolat].to_f, params[:geolon].to_f]\n elsif params[:location].present?\n @coords = Geocoder.coordinates(params[:location])\n end\n\n if !(@coords)\n @coords = [0, 0]\n end\n\n @lat_lons = @lat_lons.within(params[:radius], :origin => @coords)\n\n case params[:search_type]\n when \"cheapest\"\n @lat_lons = @lat_lons.order_by_cheapest.by_distance(:origin => @coords)\n when \"closest\"\n @lat_lons = @lat_lons.by_distance(:origin => @coords)\n when \"optimal\"\n @lat_lons = @lat_lons.sort_by{ |l| l.distance_to(@coords)*params[:price].to_f + l.parking_meter.price}\n end\n elsif params[:recents].present? || !session[:user_id].nil?\n recent_names = User.find(session[:user_id]).get_recents\n arr = Array.new\n recent_names.each { |n| arr = arr + @lat_lons.search(n)}\n @lat_lons = arr\n else\n @lat_lons = LatLon.none\n end\n\n @lat_lons = @lat_lons.no_broken if params[:no_broken].present?\n @lat_lons = @lat_lons.no_occupied if params[:no_occupied].present?\n @lat_lons = @lat_lons.no_after_hours if params[:no_after_hours].present?\n\n @hash = Gmaps4rails.build_markers(@lat_lons) do |lat_lon, marker|\n marker.lat lat_lon.lat\n marker.lng lat_lon.lon\n meter = lat_lon.parking_meter\n\n color = \"18bc9c\"\n if meter.is_broken\n color = \"e74c3c\"\n elsif meter.is_occupied\n color = \"3498db\"\n end\n marker.picture({\n :url => \"http://chart.apis.google.com/chart?chst=d_map_pin_letter&chld=|\" + color + \"|000000\", \n :width => 32,\n :height => 32\n })\n marker.json({ :meter_id => meter.id, :meter_name => meter.name })\n end\n\n end",
"def eval_res_distances\n self.greater_than_twenty_away = (self.position_one - self.position_two).abs > 20\n self.greater_than_50_away = (self.position_one - self.position_two).abs > 50\n self.greater_than_100_away = (self.position_one - self.position_two).abs > 100\n self.greater_than_200_away = (self.position_one - self.position_two).abs > 200\n self.greater_than_300_away = (self.position_one - self.position_two).abs > 300\n self.greater_than_400_away = (self.position_one - self.position_two).abs > 400\n self.greater_than_500_away = (self.position_one - self.position_two).abs > 500\n self.greater_than_600_away = (self.position_one - self.position_two).abs > 600\n self.greater_than_700_away = (self.position_one - self.position_two).abs > 700\n self.greater_than_800_away = (self.position_one - self.position_two).abs > 800\n self.greater_than_900_away = (self.position_one - self.position_two).abs > 900\n self.greater_than_1000_away = (self.position_one - self.position_two).abs > 1000\n self.greater_than_1100_away = (self.position_one - self.position_two).abs > 1100\n self.greater_than_1200_away = (self.position_one - self.position_two).abs > 1200\n self.greater_than_1300_away = (self.position_one - self.position_two).abs > 1300\n self.greater_than_1400_away = (self.position_one - self.position_two).abs > 1400\n self.greater_than_1500_away = (self.position_one - self.position_two).abs > 1500\n self.greater_than_1600_away = (self.position_one - self.position_two).abs > 1600\n self.greater_than_1700_away = (self.position_one - self.position_two).abs > 1700\n self.greater_than_1800_away = (self.position_one - self.position_two).abs > 1800\n self.greater_than_1900_away = (self.position_one - self.position_two).abs > 1900\n self.greater_than_2000_away = (self.position_one - self.position_two).abs > 2000\n self.greater_than_2100_away = (self.position_one - self.position_two).abs > 2100\n self.greater_than_2200_away = (self.position_one - self.position_two).abs > 2200\n self.greater_than_2300_away = (self.position_one - self.position_two).abs > 2300\n self.greater_than_2400_away = (self.position_one - self.position_two).abs > 2400\n self.greater_than_2500_away = (self.position_one - self.position_two).abs > 2500\n self.save\n end",
"def add_result_distances_multi(base)\n MiGA::Result.new(\"#{base}.json\")\n end",
"def add_result_distances_multi(base)\n MiGA::Result.new(\"#{base}.json\")\n end",
"def results(time_taken)\n raise \"Implement this in a sub-class\"\n end",
"def total_time\n entries.reduce(0) do |acc, entry|\n acc + entry.total_minutes\n end\n end",
"def get_route_description(route, params)\n @descriptions = {} # Hash to store station code along with station names.\n route.each do |station|\n @stations.each do |line_stations|\n line_stations.each do |line_station|\n if line_station[0] == station\n station_name = line_station[1]\n @descriptions.store(station, station_name)\n end\n end\n end\n end\n route_description = []\n description_index = 0\n @descriptions.each do |key, value|\n route_description << \"Take #{key[0, 2]} line from #{value} to \" unless key == params[:destination]\n unless description_index.zero?\n if route_description[description_index - 1].include? value\n if key == params[:destination] # Checks whether the destination station is a interchange station\n route_description[description_index - 1] = ''\n @timeline.each do |train_line|\n if train_line[0] == params[:destination][0, 2]\n @total_travel_time = (@total_travel_time - train_line[3])\n end\n end\n else\n route_description[description_index - 1] = \"Change from #{@descriptions.keys[description_index - 1][0, 2]} to #{key[0, 2]} line\"\n end\n else\n route_description[description_index - 1] = route_description[description_index - 1] + value\n end\n end\n description_index += 1\n end\n route_description.reject(&:empty?)\n end",
"def add_result_distances(base, _opts)\n if nonmulti?\n if ref?\n add_result_distances_ref(base)\n else\n add_result_distances_nonref(base)\n end\n else\n add_result_distances_multi(base)\n end\n end",
"def add_result_distances(base, _opts)\n if nonmulti?\n if ref?\n add_result_distances_ref(base)\n else\n add_result_distances_nonref(base)\n end\n else\n add_result_distances_multi(base)\n end\n end",
"def search_trip(city_start, city_end, date)\n dputs __method__.to_s\n req = setup_http_request($search_req, @cookie, {:url_arg => [city_start, city_end, CGI.escape(date)]})\n res = @http.request(req)\n res=JSON.parse(res.body)['html']['results'].force_encoding('utf-8')\n results = []\n url = res.scan(/<meta itemprop=\"url\" content=\"([^>]*)\">/).flatten\n user = res.scan(/<div class=\"user-info\">\\s*<h2 class=\"username\">(.*)<\\/h2>\\s*/)#(.*)<br \\/>\\s*<\\/div>/)\n user = res.scan(/<strong class=\"MemberCard-name u-block\">([^<]*)<\\/strong>/).flatten\n user_bis = res.scan(/<h2 class=\"ProfileCard-info ProfileCard-info--name u-truncate\">\\s*(.*)\\s*<\\/h2>/).flatten\n users = user+user_bis\n #prefs = res.scan(/ <div class=\\\"preferences-container\\\">\\s*((?:<span class=\"[^ ]* prefs tip\" title=\".*\"><\\/span>)*)\\s*((?:<span class=\"[^ ]* prefs tip\" title=\".*\"><\\/span>)*)\\s*((?:<span class=\"[^ ]* prefs tip\" title=\".*\"><\\/span>)*)\\s*((?:<span class=\"[^ ]* prefs tip\" title=\".*\"><\\/span>)*)/)\n trip_time = res.scan(/<h3 class=\"time light-gray\" itemprop=\"startDate\" content=\"([^\"]*)\">\\s*(.*)\\s*<\\/h3>/)\n trip = res.scan(/<span class=\"from trip-roads-stop\">(.*)<\\/span>\\s*<span class=\"arrow-ie\">.*<\\/span>\\s*<span class=\"trip-roads-stop\">([^<]*)<\\/span>/)\n start = res.scan(/<dd class=\"js-tip-custom\" title=\"D.part\">\\s*(.*)\\s*<\\/dd>/).flatten\n stop = res.scan(/<dd class=\"js-tip-custom\" title=\"Arriv.e\">\\s*(.*)\\s*<\\/dd>/).flatten\n #car = res.scan(/<dd class=\"js-tip-custom\" title=\"Arriv.e\">\\s*.*\\s*<\\/dd>\\s*<\\/dl>\\s*((?:<dl class=\"car-type\" [^>]*>\\s*<dt>V.hicule : <strong>.*<\\/strong><\\/dt>)){0,1}/)\n #car = res.scan(/Véhicule : <strong>(.*)<\\/strong><\\/dt>/)\n place = res.scan(/<div class=\"availability\">\\s*<strong>(.*)<\\/strong>(?: <span>.*<\\/span>){0,1}/).flatten\n price = res.scan(/<div class=\"price price-[^\"]+\" itemprop=\"location\">\\s*<strong>\\s*<span class=\"\" >\\s*(\\d+)*<span class=\"size20\">(,[^<]*)<\\/span>/)\n acceptation = res.scan(/title=\"Acceptation : ([^\"]+)\"/).flatten\n url.each_with_index{|u, ind|\n results[ind] = {\n :url => u[ind],\n :user => users[ind],\n #:preferences => prefs[ind].map{|p| p.scan(/<span class=\".*\" title=\"(.*)\"><\\/span>/)}.flatten,\n :time => trip_time[ind].join(\" \"),\n :trip => trip[ind].join(\" -> \"),\n :start => start[ind],\n :stop => stop[ind],\n #:car => car[ind].first ==nil ? \"no info\" : car[ind].first.scan(/hicule : <strong>(.*)<\\/strong>/).flatten.first,\n :place => place[ind]==\"Complet\" ? \"Complet\" : \"%s disponible(s)\"%place[ind],\n :price => \"%s\" % price[ind].join(\"\"),\n :acceptation => acceptation[ind]\n }\n }\n puts \"[+] Got results\"\n results\n end",
"def show_search_results\n @ride = Ride.new(params[:ride])\n tolerance = 10 # default\n search_by = params[:search_by]\n start_address = @ride.start_address\n end_address = @ride.end_address\n # determine interval for search results\n case params[:time_mode]\n when \"thirty_mins\"\n first_result_at = Time.now\n last_result_at = Time.now + 30.minutes\n when \"sixty_mins\"\n first_result_at = Time.now.utc\n last_result_at = Time.now + 30.minutes\n when \"today\"\n first_result_at = Time.now\n last_result_at = Time.now.end_of_day\n when \"tomorrow\"\n first_result_at = Time.now.tomorrow.beginning_of_day\n last_result_at = Time.now.tomorrow.end_of_day\n when \"custom\"\n requested_time = Time.zone.parse(params[:ride][:start_date] +\n ' ' + params[:ride][:start_time])\n if requested_time <= Time.now\n # user searched for rides in past\n @ride.errors.add(:start_date)\n @ride.errors.add(:start_time)\n redirect_to searchride_path(:ride => @ride)\n end\n tolerance = params[:tolerance].to_i if params[:tolerance]\n first_result_at = requested_time - tolerance.minutes\n last_result_at = requested_time + tolerance.minutes\n else\n # TODO implement fallback behaviour\n end\n # retrieve rides between FIRST_RESULT_AT and LAST_RESULT_AT\n @outrides = match_rides(@ride, first_result_at, last_result_at, params[:search_by])\n respond_with do |format|\n format.html do\n if request.xhr? # has controller received an ajax request?\n render :partial => \"rides/search_results\", \n :locals => { :out_rides => @outrides }, :layout => false\n else\n redirect_to searchride_path(:ride => @ride)\n end\n end\n end\n end"
] | [
"0.6728119",
"0.660959",
"0.6451124",
"0.63647413",
"0.63307196",
"0.6236405",
"0.62065125",
"0.6194379",
"0.61358",
"0.6112958",
"0.6109422",
"0.610727",
"0.6100607",
"0.60863256",
"0.60711616",
"0.60397583",
"0.6014585",
"0.5998915",
"0.5983809",
"0.5966727",
"0.5966727",
"0.5932989",
"0.5931759",
"0.5928576",
"0.5920935",
"0.5920732",
"0.59050715",
"0.58994853",
"0.58854747",
"0.5883544",
"0.58826905",
"0.5824432",
"0.5800633",
"0.57915306",
"0.5757817",
"0.57484114",
"0.57409227",
"0.574019",
"0.57359785",
"0.57269937",
"0.5698871",
"0.56807363",
"0.56807363",
"0.5676924",
"0.56580985",
"0.56338155",
"0.56301266",
"0.5627748",
"0.56243",
"0.5619225",
"0.5598812",
"0.55950004",
"0.5593573",
"0.5590007",
"0.55801594",
"0.55715096",
"0.556785",
"0.556785",
"0.5535366",
"0.55323243",
"0.55298495",
"0.551788",
"0.5502942",
"0.54948074",
"0.5494012",
"0.5487588",
"0.5487318",
"0.547378",
"0.5472109",
"0.54680544",
"0.5460508",
"0.5460059",
"0.54590815",
"0.54564196",
"0.5448705",
"0.54396796",
"0.54264015",
"0.5425945",
"0.5421249",
"0.5412842",
"0.54114646",
"0.5403369",
"0.54033434",
"0.5382721",
"0.53827155",
"0.53812826",
"0.5369744",
"0.536565",
"0.53615814",
"0.5352167",
"0.5337824",
"0.5335902",
"0.5335902",
"0.53299123",
"0.5326348",
"0.53213686",
"0.5316104",
"0.5316104",
"0.53011477",
"0.529672"
] | 0.608185 | 14 |
methods for converting coord system | def coord_type
@data[1]['COORDTYPE']
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def to_coord\n self[:to_coord].to_sym unless self[:to_coord].blank?\n end",
"def to_coordinates\n\n CGPointMake(self.x.to_coordinates, self.y.to_coordinates)\n end",
"def convert_coords(screen, x, y, z)\n\t\txd = x * $persp / (z + $space_size) + screen.width / 2\n\t\tyd = y * $persp / (z + $space_size) + screen.height / 2\n\t\treturn xd, yd\n\tend",
"def convert_user_coord(input)\n input.split\n end",
"def convert_coordinate(num)\r\n\t\tarray = @array_translate[num][1].split(\",\")\r\n\t\tcoordinate = Coordinate.new(array[1].to_i,array[0].to_i)\r\n\t\tcoordinate\r\n\tend",
"def to_coordinates\n coord = [x, y]\n coord << z if with_z\n coord << m if with_m\n coord\n end",
"def user_coordinate\r\n\t\tconvert_coordinate(1)\r\n\tend",
"def meshcode2_coordinate(gps_info)\n grid_square_code = gps_info.to_s\n \n # calc from 1st grid square code\n lat = grid_square_code[0..1].to_f / 1.5; lon = grid_square_code[2..3].to_f + 100\n\n # calc from 2nd grid square code\n latcode = grid_square_code[4].to_f; loncode = grid_square_code[5].to_f\n lat += latcode * 5 / 60; lon += loncode * 7.5 / 60\n\n # calc from 3rd grid square code \n latcode = grid_square_code[6].to_f; loncode = grid_square_code[7].to_f\n lat += latcode * 0.5 / 60; lon += loncode * 0.75 / 60\n\n # calc from 4th grid square code \n num = grid_square_code[8].to_f - 1; latcode = (num / 2).to_i\n loncode = (num - latcode * 2).to_f; \n lat += latcode * 0.5 / 2 / 60; lon += loncode * 0.75 / 2 / 60\n\n # calc from 5th grid square code \n num = grid_square_code[9].to_f - 1\n latcode = (num / 2).to_i; loncode = (num - latcode * 2).to_f\n lat += latcode * 0.5 / 4 / 60; lon += loncode * 0.75 / 4 / 60\n\n # calc from 6th grid square code \n num = grid_square_code[10].to_f - 1\n latcode = (num / 2).to_i; loncode = (num - latcode * 2).to_f\n lat += latcode * 0.5 / 8 / 60; lon += loncode * 0.75 / 8 / 60\n\n mlat = 0.5 / 8; mlon = 0.75 / 8\n \n # left-down lat/ lon\n lat0 = lat; lon0 = lon\n # right-up lat/ lon\n lat1 = lat0 + mlat / 60; lon1 = lon0 + mlon / 60\n \n return lon0, lat0, lon1, lat1\n end",
"def convert_values\n @x_size = @x_size.to_i\n @y_size = @y_size.to_i\n @x_offset = @x_offset.to_i\n @y_offset = @y_offset.to_i\n @point = @point.to_s\n @blank_space = @blank_space.to_s\n end",
"def construct_coordinates\n construct_latitude\n construct_longitude\n end",
"def trans(coord)\n\treturn [coord[0]+600, -coord[1]+350]\nend",
"def transformCoord(coord)\n dotat = coord.index('.') \n tmp1 = coord[dotat-1]\n tmp2 = coord[dotat-2]\n \n coord[dotat-2] = \".\"\n coord[dotat-1] = tmp2\n coord[dotat] = tmp1\n \n return coord.to_f \n end",
"def to_coordinates\n [latitude, longitude]\n end",
"def transform_data\n latitude = self.latitude\n longitude = self.longitude\n tempLat = latitude/100\n floatLat = (latitude - (tempLat.to_i * 100))/60\n lat = tempLat.to_i + floatLat\n tempLng = longitude/100\n floatLng = (longitude - (tempLng.to_i * 100))/60\n lng = tempLng.to_i + floatLng\n self.latitude = lat \n self.longitude = lng \nend",
"def coordinates\n return 166, 72\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 coord2pos(x, y)\n (y % h)*w+(x % w)\n end",
"def coord_to_array(coordinates)\n x = coordinates[1]\n y = coordinates[0]\n conversion = ((x-1) * @size) + (y -1)\n end",
"def new_coord\n [@position, @@move[@direction]].transpose.map { |coord| coord.reduce(:+) }\n end",
"def to_xy\n [x, y]\n end",
"def coordinate_systems\n [:row_col, :col_row, :box]\n end",
"def convert_coordinates_to_location(coordinates)\n index_to_letter(coordinates[0]) + coordinates[1].to_s\n end",
"def decimal_to_coordinate\n\t\treturn nil if self.blank?\n\t\tvalue = self.to_f\n\n\t\t# Degrees\n\t\tdegrees = value.to_i\n\t\tvalue = value - degrees # Remove integer part\n\t\t\n\t\t# Minutes\n\t\tvalue = value * 60\n\t\tminutes = value.to_i\n\t\tvalue = value - minutes # Remove integer part\n\n\t\t# Seconds\n\t\tvalue = value * 60\n\t\tseconds = value.round(2)\n\t\t\n\t\tresult = \"#{degrees.to_s}°\"\n\t\tresult += \" #{minutes.to_s}'\"\n\t\tresult += \" #{seconds.to_s}\\\"\"\n\t\treturn result\n\tend",
"def separate_coordinates\n piece = @input[0..1]\n @row = input_to_row(piece[1])\n @col = input_to_col(piece[0])\n\n location = @input[2..3]\n @row_new = input_to_row(location[1])\n @col_new = input_to_col(location[0])\n end",
"def normalize_coords(x, y)\n x = x * -1 - 1 if x < 0\n y = y * -1 - 1 if y > -1\n [x, y]\n end",
"def convert_coord(strcoord)\n strcoord[0] = \"0\" if strcoord[0] == \"A\"\n strcoord[0] = \"1\" if strcoord[0] == \"B\"\n strcoord[0] = \"2\" if strcoord[0] == \"C\"\n strcoord[0] = \"3\" if strcoord[0] == \"D\"\n strcoord[0] = \"4\" if strcoord[0] == \"E\"\n strcoord[0] = \"5\" if strcoord[0] == \"F\"\n strcoord[0] = \"6\" if strcoord[0] == \"G\"\n strcoord[0] = \"7\" if strcoord[0] == \"H\"\n #Returns integer coordinates from the input:@# (letter,number)\n [strcoord[0].to_i,strcoord[1].to_i - 1]\n end",
"def to_xy\n a = self\n a = [a[0].x, a[0].y] if length == 1\n return *a\n end",
"def coord_geographic\n FACTORY.unproject(self.coord)\n end",
"def coords; {:x => @x, :y => @y} end",
"def api\n CLLocationCoordinate2DMake(latitude, longitude)\n end",
"def coordinates\n row_values.product(col_values)\n end",
"def coordinates\n [@data[:szer_geogr].to_f, @data[:dl_geogr].to_f]\n end",
"def indices2coords(i,j)\n row = i2row(i)\n col = j2col(j)\n \"#{row}#{col}\"\n end",
"def convert_position!\n trx = self[:TrX]\n try = self[:TrY]\n\n self[:TrX] = 0\n self[:TrY] = 0\n self[:TrZ] = 0\n\n # To fix an issue with pto reading files ignoring attributes that have a =0\n trx = '0.0' if trx == 0.0\n try = '0.0' if try == 0.0\n\n self[:d] = trx\n self[:e] = try\n self\n end",
"def new_coords(x,y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end",
"def convert_centroid(lat, lon)\n [lat + LAT_GRID/2, lon + LON_GRID/2]\nend",
"def coordinates\n\t coordinate_array.map(&:to_s).join(\",\")\n\tend",
"def coordquery(p)\r\nend",
"def to_xyz\n\t\t\tlab = []\n\n\t\t\tlab[1] = (self.l * 100 + 16) / 116\n\t\t\tlab[0] = self.a / 500 + lab[1]\n\t\t\tlab[2] = lab[1] - self.b / 200\n\n\t\t\tputs \"lab\"\n\t\t\tputs lab\n\n\t\t\tlab = lab.collect do |c| \n\t\t\t\tc = c ** 3 > 0.008856 ? c ** 3 : ( c - 16 / 116 ) / 7.787\n\t\t\tend\n\n\t\t\tx = lab[0] * CIELab::Reference[:x]\n\t\t\ty = lab[1] * CIELab::Reference[:y]\n\t\t\tz = lab[2] * CIELab::Reference[:z]\n\n\t\t\tx = x.has_decimals? ? x.to_i : x.round(2)\n\t\t y = y.has_decimals? ? y.to_i : y.round(2)\n\t\t z = z.has_decimals? ? z.to_i : z.round(2)\n\t\t\t\n\t\t\tXYZ.new([x, y, z]).to_s\n\t\tend",
"def determine_coordinates\n coordinates = Hash.new()\n coordinates[:x] = @scaled_meta.domain_x.lower +\n calculated_dimension_delta(@scaled_meta.domain_x)\n coordinates[:y] = @scaled_meta.domain_y.lower +\n calculated_dimension_delta(@scaled_meta.domain_y)\n return coordinates\n end",
"def to_chipmunk\n\t\tself.normalize!\n\t\[email protected] { |point| vec2(point[0] - self.center_x, point[1] - self.center_y) }\n\tend",
"def normalize_coordinates\t\n\t\tself.latitude = latitude.round(6) unless self.latitude.nil?\n\t\tself.longitude = longitude.round(6) unless self.longitude.nil?\n\tend",
"def cal_pos\n x, y = map_location(@grid_x, @grid_y)\n x += @tile_size/2\n y += @tile_size/2\n [x,y]\n end",
"def new_coords(x, y)\n [x % GRID_WIDTH, y % GRID_HEIGHT]\n end",
"def coordinate_array\n\t\t[latitude,longitude]\n\tend",
"def to_a\n if defined?(@to_a)\n @to_a\n else\n cs = self.coord_seq\n @to_a = if self.has_z?\n [ cs.get_x(0), cs.get_y(0), cs.get_z(0) ]\n else\n [ cs.get_x(0), cs.get_y(0) ]\n end\n end\n end",
"def transform \n \n @pixel_location = get_pixel_points \n puts \"px loc : #{@pixel_location}\"\n \n while @pixel_location.size != 0 \n transform_pixel_points(@pixel_location)\n @pixel_location.shift\n @pixel_location.shift\n end\n end",
"def to_latlng(easting, northing, type = :gb)\n\n \t if type == :ie\n @OSGB_F0 = 1.000035\n @N0 = 250000.0\n @E0 = 200000.0\n @phi0 = deg_to_rad(53.5)\n @lambda0 = deg_to_rad(-8.0)\n @a = 6377340.189\n @b = 6356034.447\n else\n @OSGB_F0 = 0.9996012717\n @N0 = -100000.0\n @E0 = 400000.0\n @phi0 = deg_to_rad(49.0)\n @lambda0 = deg_to_rad(-2.0)\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n @phi = 0.0\n @lambda = 0.0\n @E = easting\n @N = northing\n @n = (@a - @b) / (@a + @b)\n @M = 0.0\n @phiPrime = ((@N - @N0) / (@a * @OSGB_F0)) + @phi0\n\n \t begin\n\n \t @M =\n \t (@b * @OSGB_F0)\\\n \t * (((1 + @n + ((5.0 / 4.0) * @n * @n) + ((5.0 / 4.0) * @n * @n * @n))\\\n \t * (@phiPrime - @phi0))\\\n \t - (((3 * @n) + (3 * @n * @n) + ((21.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(@phiPrime - @phi0)\\\n \t * Math.cos(@phiPrime + @phi0))\\\n \t + ((((15.0 / 8.0) * @n * @n) + ((15.0 / 8.0) * @n * @n * @n))\\\n \t * Math.sin(2.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(2.0 * (@phiPrime + @phi0)))\\\n \t - (((35.0 / 24.0) * @n * @n * @n)\\\n \t * Math.sin(3.0 * (@phiPrime - @phi0))\\\n \t * Math.cos(3.0 * (@phiPrime + @phi0))))\n\n \t @phiPrime += (@N - @N0 - @M) / (@a * @OSGB_F0)\n\n \t end while ((@N - @N0 - @M) >= 0.001)\n\n \t @v = @a * @OSGB_F0 * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -0.5)\n \t @rho =\n \t @a\\\n \t * @OSGB_F0\\\n \t * (1.0 - @eSquared)\\\n \t * ((1.0 - @eSquared * sin_pow_2(@phiPrime)) ** -1.5)\n \t @etaSquared = (@v / @rho) - 1.0\n \t @VII = Math.tan(@phiPrime) / (2 * @rho * @v)\n \t @VIII =\n \t (Math.tan(@phiPrime) / (24.0 * @rho * (@v ** 3.0)))\\\n \t * (5.0\\\n \t + (3.0 * tan_pow_2(@phiPrime))\\\n \t + @etaSquared\\\n \t - (9.0 * tan_pow_2(@phiPrime) * @etaSquared))\n \t @IX =\n \t (Math.tan(@phiPrime) / (720.0 * @rho * (@v ** 5.0)))\\\n \t * (61.0\\\n \t + (90.0 * tan_pow_2(@phiPrime))\\\n \t + (45.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @X = sec(@phiPrime) / @v\n \t @XI =\n \t (sec(@phiPrime) / (6.0 * @v * @v * @v))\\\n \t * ((@v / @rho) + (2 * tan_pow_2(@phiPrime)))\n \t @XII =\n \t (sec(@phiPrime) / (120.0 * (@v ** 5.0)))\\\n \t * (5.0\\\n \t + (28.0 * tan_pow_2(@phiPrime))\\\n \t + (24.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime)))\n \t @XIIA =\n \t (sec(@phiPrime) / (5040.0 * (@v ** 7.0)))\\\n \t * (61.0\\\n \t + (662.0 * tan_pow_2(@phiPrime))\\\n \t + (1320.0 * tan_pow_2(@phiPrime) * tan_pow_2(@phiPrime))\\\n \t + (720.0\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)\\\n \t * tan_pow_2(@phiPrime)))\n \t @phi =\n \t @phiPrime\\\n \t - (@VII * ((@E - @E0) ** 2.0))\\\n \t + (@VIII * ((@E - @E0) ** 4.0))\\\n \t - (@IX * ((@E - @E0) ** 6.0))\n \t @lambda =\n \t @lambda0\\\n \t + (@X * (@E - @E0))\\\n \t - (@XI * ((@E - @E0) ** 3.0))\\\n \t + (@XII * ((@E - @E0) ** 5.0))\\\n \t - (@XIIA * ((@E - @E0) ** 7.0))\n\n \t { :latitude => rad_to_deg(@phi), :longitude => rad_to_deg(@lambda) }\n\n \t end",
"def coordinates\n [@y_location, @x_location]\n end",
"def convert(loc)\n row = loc[1].to_i\n col = @hash[loc[0]]\n return [row,col]\n end",
"def to_WGS84\n\n\t if @type == :ie\n\t @a = 6377340.189\n\t @b = 6356034.447\n else\n @a = 6377563.396\n @b = 6356256.909\n end\n\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n\n @phi = deg_to_rad(@latitude)\n @lambda = deg_to_rad(@longitude)\n @v = @a / (Math.sqrt(1 - @eSquared * sin_pow_2(@phi)))\n @H = 0\n @x = (@v + @H) * Math.cos(@phi) * Math.cos(@lambda)\n @y = (@v + @H) * Math.cos(@phi) * Math.sin(@lambda)\n @z = ((1 - @eSquared) * @v + @H) * Math.sin(@phi)\n\n @tx = 446.448\n @ty = -124.157\n @tz = 542.060\n\n @s = -0.0000204894\n @rx = deg_to_rad( 0.00004172222)\n @ry = deg_to_rad( 0.00006861111)\n @rz = deg_to_rad( 0.00023391666)\n\n @xB = @tx + (@x * (1 + @s)) + (-@rx * @y) + (@ry * @z)\n @yB = @ty + (@rz * @x) + (@y * (1 + @s)) + (-@rx * @z)\n @zB = @tz + (-@ry * @x) + (@rx * @y) + (@z * (1 + @s))\n\n @a = 6378137.000\n @b = 6356752.3141\n @eSquared = ((@a * @a) - (@b * @b)) / (@a * @a)\n\n @lambdaB = rad_to_deg(Math.atan(@yB / @xB))\n @p = Math.sqrt((@xB * @xB) + (@yB * @yB))\n @phiN = Math.atan(@zB / (@p * (1 - @eSquared)))\n\n (1..10).each do |i|\n @v = @a / (Math.sqrt(1 - @eSquared * sin_pow_2(@phiN)))\n @phiN1 = Math.atan((@zB + (@eSquared * @v * Math.sin(@phiN))) / @p)\n @phiN = @phiN1\n end\n\n @phiB = rad_to_deg(@phiN)\n\n { :latitude => @phiB, :longitude => @lambdaB }\n\n end",
"def from_coord\n self[:from_coord].to_sym unless self[:from_coord].blank?\n end",
"def infer_coordinates_from_notation\n\n #expand the castling notation\n if self[:notation].include?('O-O')\n new_notation = 'K' + (self[:notation].include?('O-O-O') ? 'c' : 'g')\n new_notation += (match.next_to_move == :white) ? '1' : '8'\n self[:notation] = new_notation\n end\n\n self[:to_coord] = notation.to_s[-2,2]\n function = NOTATION_TO_FUNCTION_MAP[ notation[0,1] ] || :pawn\n @possible_movers = board.select do |pos, piece| \n piece.side == match.next_to_move && \n piece.function == function && \n piece.allowed_moves(board).include?( self[:to_coord].to_sym )\n end\n\n self[:from_coord] = @possible_movers[0][0] and return if @possible_movers.length == 1\n disambiguator = notation[-3,1]\n matcher = (disambiguator =~ /[1-8]/) ? Regexp.new( \"^.#{disambiguator}$\" ) : Regexp.new( \"^#{disambiguator}.$\" )\n movers = @possible_movers.select { |pos, piece| matcher.match(pos) }\n\n self[:from_coord] = movers[0][0] and return if movers.length == 1\n\n end",
"def coordinate \n @coordinate\n end",
"def to_gpos\n Point[ self.x, self.y ]\n end",
"def loc2(x,y)\n TwoDGridLocation.new x, y\nend",
"def pos_to_a\r\n [ pos.x, pos.y ]\r\n end",
"def coord_to_pos(row,col)\n return nil if row.even? && col.even? || row.odd? && col.odd? #these are always empty squares in checkers!\n return row*4+(col/2).floor+1\n end",
"def transformed(p)\r\n (0..1).map do |i|\r\n (p[i] - @old_center[i])*@zoom + (@center[i] - @old_center[i])*@zoom + @old_center[i]\r\n end\r\n end",
"def spritestack_coordinates\n return 25, 125\n end",
"def coords_to_gui(lat, lng)\n [(lat / map_config[\"lat_ratio\"]) + map_config[\"lat\"], (lng / map_config[\"lng_ratio\"] + map_config[\"lng\"])]\n end",
"def meshcode2coordinate(code)\n unless code.instance_of?(String)\n STDERR.puts \"E: argument must be String.\"\n return nil\n end\n latitude = 0.0\n longitude = 100.0\n case code.length\n when 4\n latitude, longitude = parse4(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH4,\n height: HEIGHT4}\n when 6\n latitude, longitude = parse6(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH6,\n height: HEIGHT6}\n when 8\n latitude, longitude = parse8(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH8,\n height: HEIGHT8}\n when 9\n latitude, longitude = parse9(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH9,\n height: HEIGHT9}\n when 10\n latitude, longitude = parse10(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH10,\n height: HEIGHT10}\n when 11\n latitude, longitude = parse11(code, latitude, longitude)\n return {latitude: latitude, longitude: longitude, width: WIDTH11,\n height: HEIGHT11}\n else\n STDERR.puts \"E: invalid length of code: #{code.length}\"\n return {latitude: nil, longitude: nil, width: nil, height: nil}\n end\nend",
"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 convert_map_coordinate(map_coordinate)\n coordinate = map_coordinate.to_s # in case it was a symbol\n # converts first character \"ABCDEFGHIJ\" <=> \"0123456789\"\n one = coordinate[0]\n two = coordinate[1,2]\n\n if one.ord < \"A\".ord\n # \"00\"..\"09\" to \"A1\"..\"J1\"\n two = (two.ord + 17).chr # convert digits to characters\n one = (one.to_i + 1).to_s\n coordinate = (two + one).to_sym\n else\n one = (one.ord - 17).chr # convert characters to digits\n two = (two.to_i - 1).to_s\n coordinate = two + one # allows A1 J1 map to 00..09\n end\n return coordinate\nend",
"def to_coordinate(human_move)\n mapping = {\n \"A1\"=>[0,0], \"A2\"=>[0,1], \"A3\"=>[0,2], \"A4\"=>[0,3], \"A5\"=>[0,4], \"A6\"=>[0,5],\n \"B1\"=>[1,0], \"B2\"=>[1,1], \"B3\"=>[1,2], \"B4\"=>[1,3], \"B5\"=>[1,4], \"B6\"=>[1,5],\n \"C1\"=>[2,0], \"C2\"=>[2,1], \"C3\"=>[2,2], \"C4\"=>[2,3], \"C5\"=>[2,4], \"C6\"=>[2,5],\n \"D1\"=>[3,0], \"D2\"=>[3,1], \"D3\"=>[3,2], \"D4\"=>[3,3], \"D5\"=>[3,4], \"D6\"=>[3,5],\n \"E1\"=>[4,0], \"E2\"=>[4,1], \"E3\"=>[4,2], \"E4\"=>[4,3], \"E5\"=>[4,4], \"E6\"=>[4,5],\n \"F1\"=>[5,0], \"F2\"=>[5,1], \"F3\"=>[5,2], \"F4\"=>[5,3], \"F5\"=>[5,4], \"F6\"=>[5,5],\n \"G1\"=>[6,0], \"G2\"=>[6,1], \"G3\"=>[6,2], \"G4\"=>[6,3], \"G5\"=>[6,4], \"G6\"=>[6,5]\n }\n mapping[human_move]\n end",
"def pos_to_coords(pos)\n x = (pos % size)\n y = size - 1 - (pos / size).to_i\n\n Point.new x, y\n end",
"def convert_to_piece_position(coordinates)\n alpha = ('a'..'h').to_a\n\n row_index, column_index = coordinates\n\n alpha[row_index-1] + column_index.to_s\n end",
"def vector_to(point2)\n end",
"def input_convertion(input)\n\t\t@letter_convertion = {\"a\" => 1, \"b\" => 2, \"c\" => 3, \"d\" => 4, \"e\" => 5, \"f\" => 6, \"g\" => 7, \"h\" => 8}\n\t\t#stores the name of the node occupying the start square.\n\t\t@opponent_piece = @board[input[1]].name\n\t\t#stores the name of the node occupying the final square.\n\t\t@piece_name = @board[input[0]].name\n\t\t#stores the coordinate of the start square.\n\t\t@first_coord_convertion = input[0]\n\t\t#stores the coordinate of the final square.\n\t\t@second_coord_convertion = input[1]\n\t\t#stores the node which is occupying the start square.\n\t\t@start_node = @board[input[0]]\n\t\t#stores the node which is occupying the final square.\n\t\t@final_node = @board[input[1]]\n\t\tfinal_movement = []\n\t\tx1 = @letter_convertion[input[0][0]]\n\t\ty1 = input[0][1].to_i\n\t\tx2 = @letter_convertion[input[1][0]]\n\t\ty2 = input[1][1].to_i\n\t\t#stores the coordinate of the start square after being transformed into numbers.\n\t\t@start_coord = [x1,y1]\n\t\t#stores the coordinate of the final square after being transformed into numbers.\n\t\t@final_coord = [x2,y2]\n\t\tfinal_movement << (x2 - x1)\n\t\tfinal_movement << (y2 - y1)\n\t\t#stores the subtraction of the two squares coordinates to get the final move required.\n\t\tfinal_movement\n\tend",
"def internal_coordinates(axes)\n raise TypeError unless axes.is_a?(Mageo::Axes)\n\n axes = axes.to_a\n Mageo::Vector3DInternal[ *(Malge::SimultaneousEquations.cramer(axes.transpose, self)) ]\n end",
"def svg_coord(row, col)\n\t\t[col*10 + 5, row*10 + 5]\n\tend",
"def calculate_coordinates\n (\n egde(@x1, @y1, @x2, @y1) +\n egde(@x2, @y1, @x2, @y2) +\n egde(@x2, @y2, @x1, @y2) +\n egde(@x1, @y2, @x1, @y1)\n ).uniq\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def lonlat\r\n [longitude,latitude]\r\n end",
"def cm2pts(x)\n (x / 2.54) * 72\n end",
"def text_coordinates\n return 28, 5, 152, 16\n end",
"def to_ecef\n\t\t\tclon = Math::cos(lon * D2R)\n\t\t\tslon = Math::sin(lon * D2R)\n\t\t\tclat = Math::cos(lat * D2R)\n\t\t\tslat = Math::sin(lat * D2R)\n\n\t\t\tn = WGS84_A / Math::sqrt(1.0 - WGS84_E * WGS84_E * slat * slat)\n\t\t\n\t\t\tx = n * clat * clon\n\t\t\ty = n * clat * slon\n\t\t\tz = n * (1.0 - WGS84_E * WGS84_E) * slat\n\t\n\t\t\treturn x, y, z\n\t\tend",
"def coord_array\n _coords.dup\n end",
"def to_latlong\n end",
"def convert_position_to_array(position)\n\t\t@coordinate = position.chars\n\t\ttemp = @coordinate[0]\n\t\tx = @coordinate[1]\n\t\tx = (8 - position[1].to_i )\n\t\tconvert_y = { a: 0, b: 1, c: 2, d: 3, e: 4, f: 5, g: 6 , h: 7 }\n\t\ty= convert_y.values_at(temp.to_sym)\n\t\t@coordinate[0]=x\n\t\t@coordinate[1]= y[0]\n\t\tposition_array = @coordinate\n\tend",
"def to_coordinates(x, y, size, orientation)\n coords = []\n\n if orientation == :across\n size.times do |n|\n coords << [x+n, y] \n end\n elsif orientation == :down\n size.times do |n|\n coords << [x, y+n]\n end\n end\n\n return coords\n end",
"def to_WGS\n [@lat - @d_lat, @lon - @d_lon]\n end",
"def project x1, y1, a, m\n rad = a * D2R\n [x1 + Math.cos(rad) * m, y1 + Math.sin(rad) * m]\n end",
"def to_coordinates\n [:latitude, :longitude].map{ |i| send self.class.geocoder_options[i] }\n end",
"def coords\n [x, y]\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 normalize_coordinates\n minY = minX = 1000000\n maxX = maxY = -minX\n @passages.each do |passage|\n if passage.x < minX then minX = passage.x end\n if passage.x > maxX then maxX = passage.x end\n if passage.y < minY then minY = passage.y end\n if passage.y > maxY then maxY = passage.y end\n end\n x_distance = 0 - minX\n y_distance = 0 - minY\n @extentX = maxX + x_distance\n @extentY = maxY + y_distance\n @passages.each do |passage|\n passage.x += x_distance\n passage.y += y_distance\n end\n end",
"def get_coords_from_node(node)\n\t\t[node.x,node.y]\n\tend",
"def to_image_space p, origin_x, origin_y\n {x: (origin_x - @scale * (p[0] * @canonical_x[0] + p[1] * @canonical_x[1] + \n p[2] * @canonical_x[2] + p[3] * @canonical_x[3])),\n y: (origin_y + @scale * (p[0] * @canonical_y[0] + p[1] * @canonical_y[1] + \n p[2] * @canonical_y[2] + p[3] * @canonical_y[3]))};\n end",
"def coordinates(alt_format = false)\n coordinates_array = []\n if alt_format\n return ['-80.394617, 31.066399'] unless has_coordinates?\n dcterms_spatial.each do |el|\n coordinates_array << \"#{longitude(el)}, #{latitude(el)}\" if element_has_coordinates el\n end\n else\n return ['31.066399, -80.394617'] unless has_coordinates?\n dcterms_spatial.each do |el|\n coordinates_array << \"#{latitude(el)}, #{longitude(el)}\" if element_has_coordinates el\n end\n end\n coordinates_array\n end",
"def gather_coords(x,y)\n if y == 100\n y = 99.9\n end\n if x == 100\n x = 99.9\n end\n id = (x * 10000 + 0.5).floor * 10000 + (y * 10000 + 0.5).floor\n return id/100\nend",
"def coordinates\n @coordinates\n end",
"def position\n [ @x, @y, COMPASS[@orientation].to_s ]\n end",
"def calculate_coordinates\n bresenham_circle_coordinates\n end",
"def coordinates\n [latitude, longitude]\n end",
"def make_coordinate_matrix collection1, collection2\n #in_collection = op.input(INPUT).collection\n if debug\n collection1 = Collection.find(394053)\n end\n #out_collection = op.output(OUTPUT).collection\n input_coordinate_matrix = []\n collection1_coordinate_matrix = []\n curr_char = 'A'\n curr_char_ascii = 0\n log_info \"in_collection.matrix inside method\", collection1.matrix\n collection1.matrix.each do |row|\n curr_row = []\n curr_num = 1\n row.each do |col|\n curr_coordinate = curr_char + (curr_num.to_s)\n if col != -1\n curr_row.push(curr_coordinate)\n end\n curr_num += 1\n end\n curr_char_ascii = curr_char.ord\n curr_char_ascii += 1\n curr_char = curr_char_ascii.chr\n curr_num = 0\n collection1_coordinate_matrix.push(curr_row)\n end\n log_info \"coordinate matrix\", collection1_coordinate_matrix\n collection1_matrix = collection1_coordinate_matrix.flatten\n matrix_for_display = []\n collection1_matrix.each_slice(collection2.dimensions[1]) do |slice|\n matrix_for_display.push(slice)\n end\n \n matrix_for_display # return\n end",
"def coordinate_to_decimal\n\t\treturn nil if self.blank?\n\t\tresult = 0.0\n\t\tminus = false\n\t\t\n\t\t# Degrees\n\t\tsplitted_1 = self.split(\"°\")\n\t\treturn nil if splitted_1.length != 2\n\t\tresult += splitted_1[0].to_i.to_f\n\n\t\t# Minus correction\n\t\tif result < 0.0\n\t\t\tminus = true\n\t\t\tresult = -result\n\t\tend\n\n\t\t# Minutes\n\t\tsplitted_2 = splitted_1[1].split(\"'\")\n\t\treturn nil if splitted_2.length != 2\n\t\tresult += (splitted_2[0].to_i.to_f / 60.to_f).to_f\n\n\t\t# Seconds\n\t\tresult += (splitted_2[1].to_f / 3600.to_f).to_f\n\n\t\t# Minus correction\n\t\tif minus\n\t\t\tresult = -result\n\t\tend\n\n\t\treturn result\n\tend",
"def position_to_location_and_tile_coords(position)\n ::Demiurge::TiledLocation.position_to_loc_coords(position)\n end",
"def correct_geo_coords\n coords = params.seek :geo, :geojson, :geometry, :coordinates\n if coords\n array = GeosHelper.geo_coords_to_array(coords)\n params[:geo][:geojson][:geometry][:coordinates] = array\n end\n end",
"def to_coordinates_ddmmss(orig_val)\n w, e, n, s = orig_val.to_s.scanf('%f -- %f/%f -- %f')\n raise ArgumentError, \"Out of bounds latitude: #{n} #{s}\" unless n >= -90 && n <= 90 && s >= -90 && s <= 90\n raise ArgumentError, \"Out of bounds longitude: #{w} #{e}\" unless w >= -180 && w <= 180 && e >= -180 && e <= 180\n\n w = \"#{w < 0 ? 'W' : 'E'} #{dd2ddmmss_abs w}\"\n e = \"#{e < 0 ? 'W' : 'E'} #{dd2ddmmss_abs e}\"\n n = \"#{n < 0 ? 'S' : 'N'} #{dd2ddmmss_abs n}\"\n s = \"#{s < 0 ? 'S' : 'N'} #{dd2ddmmss_abs s}\"\n \"#{w}--#{e}/#{n}--#{s}\"\n end",
"def coordinates\n \"#{longitude},#{latitude}\"\n end"
] | [
"0.683111",
"0.6757375",
"0.6693201",
"0.6676919",
"0.66255313",
"0.6622134",
"0.66210645",
"0.65812904",
"0.65732133",
"0.6523067",
"0.650704",
"0.64561826",
"0.6397892",
"0.6352838",
"0.630922",
"0.62871784",
"0.62734216",
"0.61899614",
"0.61732113",
"0.6146312",
"0.61312777",
"0.61265504",
"0.6118713",
"0.60950136",
"0.60819113",
"0.60755146",
"0.6071351",
"0.60639566",
"0.60416645",
"0.60394526",
"0.60044605",
"0.5937552",
"0.59260315",
"0.59183294",
"0.591813",
"0.5910471",
"0.5890593",
"0.5874592",
"0.58554995",
"0.58458495",
"0.5841452",
"0.5839752",
"0.5839105",
"0.5838211",
"0.5824905",
"0.5820475",
"0.58069825",
"0.57968503",
"0.5783721",
"0.5764249",
"0.57585627",
"0.57396334",
"0.5731883",
"0.56837124",
"0.5674374",
"0.56686604",
"0.5655864",
"0.5653962",
"0.56517106",
"0.5648625",
"0.56343865",
"0.56295973",
"0.5626981",
"0.56248796",
"0.5622658",
"0.5619772",
"0.5615633",
"0.56143063",
"0.558834",
"0.55811435",
"0.5574554",
"0.5570066",
"0.5568455",
"0.5568455",
"0.55636376",
"0.55624175",
"0.55549484",
"0.55534816",
"0.5550843",
"0.55502325",
"0.55475247",
"0.55414724",
"0.5517849",
"0.5511119",
"0.55040914",
"0.55002004",
"0.5495948",
"0.5493859",
"0.5488374",
"0.548127",
"0.54694664",
"0.54675037",
"0.54644376",
"0.54635036",
"0.5456303",
"0.545599",
"0.5453418",
"0.54523456",
"0.5444652",
"0.5433449",
"0.54329103"
] | 0.0 | -1 |
methods for parsing nearest position search | def position_address
"#{@data['SIDO']} #{@data['L_SIGUN_GU']} #{@data['L_DONG']} #{@data['GIBUN']}"
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def grab_nearest_by_location(distance, loc)\n\n end",
"def positions(passes) = passes.map { find_position(_1) }",
"def explore(pos)\n end",
"def findnearest( coords, targetx, targety )\n # find nearest coordinate\n nearest = 0\n targetcounter = 0\n target = -1\n coords.each do |neighborx,neighbory|\n d = Math::sqrt( ( neighborx - targetx ) ** 2 + ( neighbory - targety ) ** 2 )\n if d < 0.2\n target = targetcounter\n end\n targetcounter += 1\n end\n return target\nend",
"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 search(string, max_nearest = 3)\n return [] if needs_rebuild?\n carry = proximity_norms_for_content(string)\n unless carry.nil?\n result = carry.collect { |x| x[0] }\n result[0..max_nearest - 1]\n end\n end",
"def scan_proximity(item, match, x_pos, y_pos)\n (x_pos + 1..x_pos + 2).each do |next_x_pos|\n scan_area = @radar_scan.crop(next_x_pos, y_pos, item.width, item.height)\n next_match = item.match(scan_area)\n if next_match > match\n x_pos = next_x_pos\n match = next_match\n end\n end\n\n [x_pos, match]\n end",
"def find_related(doc, max_nearest = 3, &block)\n carry =\n proximity_array_for_content(doc, &block).reject { |pair| pair[0].eql? doc }\n result = carry.collect { |x| x[0] }\n result[0..max_nearest - 1]\n end",
"def search_insert_position(nums, target)\n\nend",
"def pos() end",
"def pos() end",
"def pos() end",
"def pos() end",
"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 nearestLocations _args\n \"nearestLocations _args;\" \n end",
"def near_match\n (0..3).each do |guess_index|\n compare_for_near_match(guess_index)\n end\n end",
"def nearestLocation _args\n \"nearestLocation _args;\" \n end",
"def nearest(geometry_index: nil, xy:)\n position = nil\n min_distance = 21_000_000 # max distance on earth in meters\n @geometries.each.with_index do |geometry, g_index|\n next unless geometry_index.nil? || geometry_index == g_index\n geometry.each.with_index do |coordinates, c_index|\n distance = xy.distance(coordinates).dim\n if distance < min_distance\n position = Position.new(geometries: geometries, geometry_index: g_index, coordinates_index: c_index)\n min_distance = distance\n end\n end\n end\n position\n end",
"def main(points) # array with all the points\n #copy of the array by an especific cordinate\n #nlogn\n # This is a primitive, aka operations that are costless compared to the\n # total complexity we are aming for\n px = sort_by_cordinate(points, 0)\n py = sort_by_cordinate(points, 1)\n\n result = closest_pair(px, py)\nend",
"def nearest(coords, code, n=5)\n with_distance = find(code).map { |pos| [pos, (pos[0] - coords[0]).abs + (pos[1] - coords[1]).abs + (pos[2] - coords[2]).abs ] }\n return with_distance.sort_by { |pos, dist| dist }[0..n]\n end",
"def parse_and_find_distance(full_route)\n cities = full_route.split('-')\n distance=0 \n cities.each_with_index do|city,index|\n if cities[index+1]\n route = prev_find{|route| route.start_city.to_s==city && route.end_city.to_s==cities[index+1]}\n if route\n distance += route.distance.to_i\n else\n return \"No Such Route\"\n end\n end\n end\n distance==0 ? \"No Such Route\" : distance\n end",
"def belongsToWhichPostcode lat, lon\n\tsmallestPostcode = Postcode\n\tsmallestDist = 9999999999999999999.0\n\t#we want to look at all post codes & find closest\n\tPosition.all.each do |pos|\n\t\tif pos.postcodes.last\n\t\t\tcurrentDist = Math.sqrt( ((pos.latitude.to_f - lat).abs)**2 + ((pos.longitude.to_f - lon).abs)**2 )\n\t\t\tif(currentDist < smallestDist)\n\t\t\t\tsmallestDist = currentDist\n\t\t\t\tsmallestPostcode = pos.postcodes\n\t\t\tend\n\t\tend\n\tend\n\t#return the last postcode that was made for that position\n\tsmallestPostcode.last\nend",
"def find_nearby\n locations = read_locations_from FILE\n locations.select_within_radius 100 \n locations.sort.filter_fields\n end",
"def find_next (matrix, word, index, start_row, start_col)\n\tif(index < word.length - 1)\n\t\tneighbors = find_neighbors(matrix, start_row, start_col)\n\t\t\n\t\tneighbors.each do |neighborObj|\t\t\t\n\t\t\tif neighborObj[:char] == word[index + 1]\n\t\t\t\t# print word, \" - \", word[index], \" \", neighborObj[:char], \" \", neighborObj[:row_index], neighborObj[:col_index], \"\\n\"\n\t\t\t\tcoord = neighborObj[:row_index].to_s + '-' + neighborObj[:col_index].to_s\n\t\t\t\tfind_next(matrix, word, index + 1, neighborObj[:row_index], neighborObj[:col_index])\n\t\t\tend\n\t\tend\t\t\n\telsif index == word.length - 1\n\t\t$find_next_found = true\n\tend\nend",
"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 gotPoint(lat,lon)\n\n nearby_place_found = false\n\n # call get_close_places to get nearby OSM places\n # (as per the grid squares)\n get_close_places(lat,lon).each do |place|\n\n #for each place\n plat,plon,name = place\n\n if is_close([lat, lon], [plat.to_f, plon.to_f])\n #It's vaguely close by. Let's do the actual distance calculation\n dist = spherical_distance([lat, lon], [plat.to_f, plon.to_f])\n if dist < Buffer\n nearby_place_found = true\n break\n end\n end\n end\n if not nearby_place_found\n #No nearby places found (which is the intersting case!)\n $missingcount+=1\n puts \"gpx point \" + $count.to_s + \" - No nearby place. \" + lat.to_s + \" \" + lon.to_s #+ \" \" + shortest_dist.to_s + \"km (\" + shortest_place.to_s + \" \" + splat.to_s + \" \" + splon.to_s + \")\"\n\n #Write a waypoint to the output GPX file\n File.open(OutputGPX, 'a') {|f| f.write( \"<wpt lat=\\\"\" + lat.to_s + \"\\\" lon=\\\"\" + lon.to_s + \"\\\"></wpt>\\n\" ) }\n\n end\nend",
"def test_find\n @search.adjacent_points_function = ->(current) {[-0.1, 0.1].map {|x| current + x}}\n @search.cost_function = ->(x){x - 0.1}\n assert_in_delta 0.1, @search.find\n end",
"def position_filter(arg)\r\n spos = epos = nil\r\n sflag = eflag = 0\r\n $position_map.each do |k, v|\r\n re = Regexp.new(v)\r\n ####################################\r\n if ((sflag==0) && (eflag==0) && (k==1))\r\n if (arg =~ re)\r\n mh1 = $1\r\n\t\tmh2 = $2\r\n $position_list.each do |p|\r\n if mh1.include? p\r\n spos = p\r\n sflag = 1\r\n arg.gsub!(mh1, \"\")\r\n break\r\n end\r\n end\r\n $position_list.each do |p|\r\n if mh2.include? p\r\n epos = p\r\n eflag = 1\r\n arg.gsub!(mh2, \"\")\r\n break\r\n end\r\n end\r\n end\r\n end\r\n ####################################\r\n if ((sflag==0) && (k==2))\r\n if (arg =~ re)\r\n mh = $1\r\n $position_list.each do |p|\r\n if mh.include? p\r\n spos = p\r\n sflag = 1\r\n arg.gsub!(mh, \"\")\r\n break\r\n end\r\n end\r\n end\r\n end\r\n ####################################\r\n if ((eflag==0) && (k==3))\r\n if (arg =~ re)\r\n mh = $1\r\n $position_list.each do |p|\r\n if mh.include? p\r\n epos = p\r\n eflag = 1\r\n arg.gsub!(mh, \"\")\r\n break\r\n end\r\n end\r\n end\r\n end\r\n ####################################\r\n if ((eflag==0) && (k==4))\r\n if (arg =~ re)\r\n mh = $1\r\n $position_list.each do |p|\r\n if mh.include? p\r\n epos = p\r\n eflag = 1\r\n arg.gsub!(mh, \"\")\r\n break\r\n end\r\n end \r\n end\r\n end\r\n ####################################\r\n end\r\n\r\n if (eflag==0)\r\n $position_list.each do |p|\r\n if arg.include? p\r\n epos = p\r\n eflag = 1\r\n break\r\n end\r\n end\r\n end\r\n puts \"position_filter>spos #{spos} epos #{epos}\"\r\n return [spos, epos]\r\nend",
"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 near_to(p)\n\t\treturn around(p).sort_by{|e| e.distance_sq_to(p)}\n\tend",
"def find_small_neighbors array\n tmp_char = array[0]\n array.each_with_index do |char, index|\n next if index === 0\n return index if tmp_char > char \n tmp_char = char\n end\n return false;\nend",
"def nearest_driver_name(pos)\n a = @driver_pos.find_index(pos)\n @driver_name[a]\n end",
"def index_of_next_closest(q, from = 0)\n index_of_closest(1, q, from)\n end",
"def nearestLocationWithDubbing _args\n \"nearestLocationWithDubbing _args;\" \n end",
"def match_position_by_sad\n # SAD = \"sum of absolute differences\"\n best_sad = 1_000_000\n\n search_rows.times do |y|\n search_cols.times do |x|\n puts \"Checking search image at #{x}, #{y}\" if @verbose\n sad = 0.0\n\n template_image.rows.times do |j|\n template_image.columns.times do |i|\n s_pixel = search_image.pixel_color(x+i,y+j)\n t_pixel = template_image.pixel_color(i,j)\n\n # Could use pixel hue\n # #to_hsla returns [hue, saturation, lightness, alpha]\n # sad += (s_pixel.to_hsla[0] - t_pixel.to_hsla[0]).abs\n \n # Or pixel \"intensity\" which is computed as:\n # (0.299*R) + (0.587*G) + (0.114*B)\n sad += (s_pixel.intensity - t_pixel.intensity).abs\n \n end\n end\n\n # save if this is best position (least difference) so far\n if sad < best_sad\n puts \"New best at #{x}, #{y}: #{sad}\" if @verbose\n best_sad = sad\n self.match_result = x, y\n end\n\n end\n end\n\n return match_result\n\n end",
"def find_bot_position\n position_coordinates('m')\n end",
"def get_near(point)\n res = []\n\n for dx in -1..1\n for dy in -1..1\n if dx == 0 && dy == 0\n next\n end\n res << get_at(Point.new(point.x + dx, point.y + dy))\n end\n end\n\n res.empty? ? nil : res\n end",
"def all_neighbords(base_word)\n \n matches = four_letter_words.select do |match_word|\n are_neighbors?(base_word, match_word)\n end \n\n return matches\n \nend",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; end",
"def pos; 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 test_singlepos_2d\n deploy_app(SearchApp.new.sd(selfdir+\"singlepos2d.sd\"))\n start\n feed_and_wait_for_docs(\"singlepos2d\", 12, :file => selfdir+\"singlepos2d.xml\")\n wait_for_hitcount(\"query=Steinberget\", 1)\n puts \"Query: Search with position\"\n assert_hitcount(\"query=Steinberget&pos.ll=0N%3B0E\", 0)\n assert_hitcount(\"query=Steinberget&pos.ll=63N25%3B10E25\", 1)\n\n assert_hitcount(\"query=sddocname:singlepos2d&pos.ll=63.4225N%3B10.3637E\", 10)\n assert_hitcount(\"query=sddocname:singlepos2d&pos.ll=63.4225N%3B10.3637E&pos.radius=5km\", 6)\n assert_hitcount(\"query=sddocname:singlepos2d&pos.ll=63.4225N%3B10.3637E&pos.radius=100m\", 1)\n end",
"def parse_position(info)\n ## FIXME: push into parse\n if RbConfig::CONFIG['target_os'].start_with?('mingw') and\n info =~ /^[A-Za-z]:/\n drive_letter = info[0..1]\n info = info[2..-1]\n else\n drive_leter = nil\n end\n info = parse_location(info) if info.kind_of?(String)\n case info.container_type\n when :fn\n if (meth = method?(info.container)) && meth.iseq\n return [meth, meth.iseq.source_container[1], info.position,\n info.position_type]\n else\n return [nil] * 4\n end\n when :file\n filename = canonic_file(info.container)\n # ?? Try to look up method here?\n frame =\n if @frame\n container = frame_container(@frame, false)\n try_filename = container[1]\n frame = (canonic_file(try_filename) == filename) ? @frame : nil\n else\n nil\n end\n # else\n # LineCache.compiled_method(filename)\n # end\n return frame, filename, info.position, info.position_type\n when nil\n if [:line, :offset].member?(info.position_type)\n if @frame\n container = frame_container(@frame, false)\n filename = container[1]\n else\n errmsg \"No stack\"\n return [nil] * 4\n end\n\n return @frame, canonic_file(filename), info.position, info.position_type\n elsif !info.position_type\n errmsg \"Can't parse #{arg} as a position\"\n return [nil] * 4\n else\n errmsg \"Unknown position type #{info.position_type} for location #{arg}\"\n return [nil] * 4\n end\n else\n errmsg \"Unknown container type #{info.container_type} for location #{arg}\"\n return [nil] * 4\n end\n end",
"def match_position_by_pixel_objects\n qfuzz = QuantumRange * fuzz\n \n catch :found_match do\n search_rows.times do |y|\n search_cols.times do |x|\n\n catch :try_next_position do\n puts \"Checking search image at #{x}, #{y}\" if @verbose\n\n template_image.rows.times do |j|\n template_image.columns.times do |i|\n\n # #pixel_color returns a Pixel object\n # around 4x slower than export_pixels_to_str\n t_pixel = template_image.pixel_color(i,j)\n s_pixel = search_image.pixel_color(x+i,y+j)\n \n # Pixel objects allow fuzzy comparisions\n # #fcmp returns true/false if pixels are close\n if !s_pixel.fcmp(t_pixel, qfuzz)\n throw :try_next_position\n end\n\n end # template_image.rows.times do\n end # template_image.columns.times do\n\n # Success! We made it through the whole template\n # at this position.\n self.match_result = x, y\n throw :found_match\n\n end # catch :try_next_position\n\n end\n\n end\n end # catch :found_match\n return match_result\n end",
"def infer_coordinates_from_notation\n\n #expand the castling notation\n if self[:notation].include?('O-O')\n new_notation = 'K' + (self[:notation].include?('O-O-O') ? 'c' : 'g')\n new_notation += (match.next_to_move == :white) ? '1' : '8'\n self[:notation] = new_notation\n end\n\n self[:to_coord] = notation.to_s[-2,2]\n function = NOTATION_TO_FUNCTION_MAP[ notation[0,1] ] || :pawn\n @possible_movers = board.select do |pos, piece| \n piece.side == match.next_to_move && \n piece.function == function && \n piece.allowed_moves(board).include?( self[:to_coord].to_sym )\n end\n\n self[:from_coord] = @possible_movers[0][0] and return if @possible_movers.length == 1\n disambiguator = notation[-3,1]\n matcher = (disambiguator =~ /[1-8]/) ? Regexp.new( \"^.#{disambiguator}$\" ) : Regexp.new( \"^#{disambiguator}.$\" )\n movers = @possible_movers.select { |pos, piece| matcher.match(pos) }\n\n self[:from_coord] = movers[0][0] and return if movers.length == 1\n\n end",
"def pos()\n #This is a stub, used for indexing\n end",
"def find_position(grid, p_m)\n grid.each_with_index do |row, index|\n @position_x = index\n @position_y = row.index(p_m)\n break if @position_y\n end\n fail \"#{p_m == 'p' ? 'Princess' : 'Bot'} not found\" unless @position_y\n [@position_x, @position_y]\n end",
"def get_neighbors_pins_coordinates(item)\n item.set_default_neighbors_settings\n by_distance = item.neighbors_ids_by_distance\n by_choice = item.neighbors_ids_by_choice\n by_property = item.neighbors_ids_by_property\n union = by_choice\n if by_property\n union = union | by_distance & by_property\n else\n union = union | by_distance\n end\n list = []\n Spree::Location.where(:id => union).each do |location|\n product = location.locatable\n next if product.nil?\n list << {\n :latitude => location.latitude,\n :longitude => location.longitude,\n :distance => item.distance_from([location.latitude, location.longitude]),\n :locatable_id => location.id\n }\n end\n\n sorted = list\n if item.neighbors_settings\n case item.neighbors_settings.sort\n when 2 then sorted = list.sort_by { |neighbor| Spree::Location.find(neighbor[:locatable_id]).locatable.name }\n when 1 then sorted = list.sort_by { |neighbor| neighbor[:distance] }\n end\n end\n sorted = sorted[0,item.neighbors_settings.count] if item.neighbors_settings && item.neighbors_settings.count > 0\n sorted\n end",
"def get_locations(lines, filename, params)\n positions = Hash.new\n missing_pos = Array.new\n first = true\n\t\n\tif(params[:has_positions])\n\t\tlines.each do |line|\n\t\t\tif first\n\t\t\t\tfirst = false\n\t\t\t\tnext\n\t\t\tend\n\t\t\tdata = strip_and_split(line)\n\t\t\tsnpid = data[@snpid]\n\t\t\tif data[@location] =~ /\\d/\n\t\t\t\tpositions[snpid] = Hash.new\n\t\t\t\tpositions[snpid]['chr'] = data[@chromnum]\n\t\t\t\tpositions[snpid]['chr'] =~ /(\\d+)/ or positions[snpid]['chr'] =~ /(\\w+)/\n\t\t\t\tpositions[snpid]['chr'] = $1\n\t\t\t\tpositions[snpid]['pos'] = data[@location]\n\t\t\telsif data[@snpid] =~ /\\w/\n\t\t\t\t# missing so will try to get information from database\n\t\t\t\tmissing_pos << snpid\n\t\t\tend\n\t\tend\n\n\t\t# if any missing try database for location if have mysql support\n\t\tif @@mysql_support and !missing_pos.empty?\n\t\t\tfinder = SNPpos.new\n\t\t\tsnpsinfo = finder.get_pos(missing_pos)\n\t\t\tstill_missing = Array.new\n\t\t\tmissing_pos.each do |rsid|\n\t\t\t\tif snpsinfo.has_key?(rsid) and snpsinfo[rsid]['chr'] != nil\n\t\t\t\t\tpositions[rsid] = snpsinfo[rsid]\n\t\t\t\telse\n\t\t\t\t\tstill_missing << rsid\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tmissing_pos = still_missing\n\t\tend\n\n\t\tif !missing_pos.empty?\n\t\t\twrite_missing_log(filename, missing_pos)\n\t\tend\n\telse\n\t\t# set arbitrary positions in order of input\n\t\tpos=1\n\t\tlines.each do |line|\n\t\t\tif first\n\t\t\t\tfirst = false\n\t\t\t\tnext\n\t\t\tend\n\t\t\tdata = strip_and_split(line)\n\t\t\tsnpid = data[@snp1] + '_' + data[@snp2]\n\t\t\tnext if positions.has_key?(snpid)\n\t\t\tpositions[snpid] = Hash.new\n\t\t\tpositions[snpid]['chr'] = 1\n\t\t\tpositions[snpid]['pos'] = pos\n\t\t\tpos += 1\n\t\tend\n\tend\n\n return positions\nend",
"def position_result\n hurdle_match.rank.index(self) + 1\n end",
"def near(node_map)\n output_nodes = []\n \n potential_neighbor_strings().each do |coordinate_string|\n\n if !node_map[coordinate_string][:contents]\n output_nodes << node_map[coordinate_string][:node]\n end\n end\n\n output_nodes\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 parse_search; end",
"def eval_res_distances\n self.greater_than_twenty_away = (self.position_one - self.position_two).abs > 20\n self.greater_than_50_away = (self.position_one - self.position_two).abs > 50\n self.greater_than_100_away = (self.position_one - self.position_two).abs > 100\n self.greater_than_200_away = (self.position_one - self.position_two).abs > 200\n self.greater_than_300_away = (self.position_one - self.position_two).abs > 300\n self.greater_than_400_away = (self.position_one - self.position_two).abs > 400\n self.greater_than_500_away = (self.position_one - self.position_two).abs > 500\n self.greater_than_600_away = (self.position_one - self.position_two).abs > 600\n self.greater_than_700_away = (self.position_one - self.position_two).abs > 700\n self.greater_than_800_away = (self.position_one - self.position_two).abs > 800\n self.greater_than_900_away = (self.position_one - self.position_two).abs > 900\n self.greater_than_1000_away = (self.position_one - self.position_two).abs > 1000\n self.greater_than_1100_away = (self.position_one - self.position_two).abs > 1100\n self.greater_than_1200_away = (self.position_one - self.position_two).abs > 1200\n self.greater_than_1300_away = (self.position_one - self.position_two).abs > 1300\n self.greater_than_1400_away = (self.position_one - self.position_two).abs > 1400\n self.greater_than_1500_away = (self.position_one - self.position_two).abs > 1500\n self.greater_than_1600_away = (self.position_one - self.position_two).abs > 1600\n self.greater_than_1700_away = (self.position_one - self.position_two).abs > 1700\n self.greater_than_1800_away = (self.position_one - self.position_two).abs > 1800\n self.greater_than_1900_away = (self.position_one - self.position_two).abs > 1900\n self.greater_than_2000_away = (self.position_one - self.position_two).abs > 2000\n self.greater_than_2100_away = (self.position_one - self.position_two).abs > 2100\n self.greater_than_2200_away = (self.position_one - self.position_two).abs > 2200\n self.greater_than_2300_away = (self.position_one - self.position_two).abs > 2300\n self.greater_than_2400_away = (self.position_one - self.position_two).abs > 2400\n self.greater_than_2500_away = (self.position_one - self.position_two).abs > 2500\n self.save\n end",
"def parse_place\n s0 = @scanner.pos\n s1 = parse_num\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_numkan\n if s2 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = { 'x' => s1, 'y' => s2 }\n end\n end\n if s0 == :failed\n s0 = @scanner.pos\n if match_regexp('同') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n match_str(' ')\n @reported_pos = s0\n s0 = { 'same' => true }\n end\n end\n s0\n end",
"def search( grid, init , deltas, cost, goal , delta_names)\n # ----------------------------------------\n # insert code here and make sure it returns the appropriate result\n # ----------------------------------------\n closed = copy_array_dimensions grid\n expand = copy_array_dimensions grid #, -1\n action = copy_array_dimensions grid, -1\n\t#initalize starting location \n\tclosed[init[0]][init[1]] =1\n\n\tx = init[0]\n\ty = init[1]\n\tg = 0 \n\t\n\topen = [[g,x,y]]\n\tputss 'open', open\n\tputss closed\n\tprint_array expand\n\t#flags\n\tfound = false\n\tresign = false \n\t\n\twhile ( found == false && resign == false )\n\t\t\n\t\tif open.size == 0 \n\t\t\tresign = true \n\t\t\tputs 'fail'\n\t\t\tclosed.each do | row | \n\t\t\t\tputs row.inspect\n\t\t\tend\n\t\telse\n\t\t\topen.sort()\n\t\t\topen.reverse()\n\t\t\tnext_ = open.pop() #use unshift\n\t\t\tputss 'next', next_[0], next_[1]\n\t\t\tx = next_[1] \n\t\t\ty = next_[2]\n\t\t\tg = next_[0] \n\t\t\t\n\t\t\tif x == goal[0] && y == goal[1]\n\t\t\t\tfound = true \n\t\t\t\tputss 'done', next_\n\t\t\telse\n\t\t\t\t#apply action , nod eexpantion\n\t\t\t\tdeltas.each_with_index do | delta, i | \n\t\t\t\t\tx2 = x + delta[0]\n\t\t\t\t\ty2 = y + delta[1]\n\t\t\t\t\tif x2 >= 0 && x2 < grid.size &&\n\t\t\t\t\t\ty2 >= 0 && y2 < grid[0].size\n\t\t\t\t\t\t#putss 'add to open list', [ x2, y2]\n\t\t\t\t\t\t#if not closed and natvigable \n\t\t\t\t\t\tif closed[x2][y2] == 0 && grid[x2][y2] == 0 \n\t\t\t\t\t\t\tg2 = g + cost\n\t\t\t\t\t\t\topen << [g2, x2, y2]\n\t\t\t\t\t\t\texpand[x2][y2] = g2\n\t\t\t\t\t\t\t#putss 'add to open list', [ x2, y2]\n\t\t\t\t\t\t\tclosed[x2][y2] = 1\n\t\t\t\t\t\t\taction[x2][y2] = i\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif grid[x2][y2] != 0 \n\t\t\t\t\t\t\texpand[x2][y2] = -1\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\t\n\t\n\t#\n\tpolicy = copy_array_dimensions grid, ' '\n\tx = goal[0]\n\ty = goal[1]\n\tpolicy[x][y] = '*'\n\t\n\tprint_array action\n\tputss init, x, y\n\t#return\n\tif resign != true\n\t\twhile ( x != init[0] && y != init[1] )\n\t\t\t#apply inverse action \n\t\t\tx2 = x - deltas[action[x][y]][0]\n\t\t\ty2 = y - deltas[action[x][y]][1]\n\t\t\tpolicy[x][y] = delta_names[action[x][y]]\n\t\t\tx = x2\n\t\t\ty = y2\n\t\tend\n\t\t\n\t\tprint_array policy\n\tend\n\texpand\nend",
"def tokenizer_ranking_row_result_position\n TokenExtractor.new(\n :result_position,\n /(?<rank>\\s*(\\d{1,3}|\\s*)(?=(\\)|\\s)\\s{2}\\d{3}))/i,\n #/(\\)|\\s)\\s{2}\\d{3}\\s+\\w+/i\n 2\n )\n end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def pos; [lft,rgt] end",
"def match_position_by_pixel_strings\n\n catch :found_match do\n search_rows.times do |y|\n search_cols.times do |x|\n\n catch :try_next_position do\n puts \"Checking search image at #{x}, #{y}\" if @verbose\n\n template_image.rows.times do |j|\n template_image.columns.times do |i|\n\n t_pixel = template_image.export_pixels_to_str(i, j, 1, 1)\n s_pixel = search_image.export_pixels_to_str(x+i, y+j, 1, 1)\n\n if s_pixel != t_pixel\n throw :try_next_position\n end\n\n end # template_image.rows.times do\n end # template_image.columns.times do\n\n # Success! We made it through the whole \n # template at this position.\n self.match_result = x, y\n throw :found_match\n\n end # catch :try_next_position\n\n end\n\n end\n end # catch :found_match\n return match_result\n end",
"def distance position\n return -1 if contains? position\n # If POI is given instead of location, get location first\n position = position.location if PointOfInterest === position\n # Set a ridiculous min distance. Any way around this?\n min_dist = 999999999\n\n # Iterate over every edge-point (vertex)\n vertices.each_cons(2) do |vertices|\n c_v = vertices[0]\n o_v = vertices[1]\n\n r = ((c_v - o_v) * (position - o_v)) / (position - o_v).magnitude\n\n if r < 0 then dist = (position - o_v).magnitude\n elsif r > 1 then dist = (c_v - position).magnitude\n else dist = (position - o_v).magnitude ** 2 - r * (c_v - o_v).magnitude ** 2\n end\n\n min_dist = [dist, min_dist].min\n end\n min_dist\n end",
"def get_position_list\n\n end",
"def binary_search(opts={})\n # I have a lot of stuff to do for scouts\n # but instead i'm doing this\n # hizzah!\n count = 0\n \n until opts[:find].empty?\n new_search = []\n count += 1\n \n zipped = opts[:find].zip opts[:repo].between(opts[:find])\n zipped.each do |(n, list)|\n list << n[1]\n p = n[0]\n f = 1 # ??? why are these vars so NAMELESS\n \n list.each do |item|\n UI::debug \"narrowing #{f}:#{list.size} #{short item}\"\n \n if opts[:node_map].include? item\n if f <= 2\n opts[:on_find].call(p, item)\n else\n UI::debug \"narrowed branch search to #{short p}:#{short item}\"\n new_search << [p, item]\n end\n break\n end\n \n p, f = item, f*2\n end\n end\n \n opts[:find] = new_search\n end\n \n [opts[:find], count]\n end",
"def calculate_position_coordinates(n, grid, character)\n which_row = []\n which_cell = []\n (0...n).each do |i|\n grid[i].split('').each_with_index do |k ,index|\n if k == character\n which_row << i\n which_cell << index\n end \n end\n end\n return which_row, which_cell\nend",
"def closest_match(tokenstream, preference=:none)\n token_locs=self.apply_to(tokenstream)\n return find_closest_match(token_locs, tokenstream.label_index)\n end",
"def geternode(text)\n #@prnode = Prnode.where(\"pgscore > 0\").first.pgnodename\n\n @prnodes = Prnode.select(:pgnodename)\n\n puts \"DEBUGHEeeeeeeeeeeeeeeee\"\n # puts @prnodes.inspect\n #[@prnodes.first.pgnodename, @prnodes.first.pgscore]\n\n FuzzyMatch.new(@prnodes).find(text)\n\n end",
"def find_princess_position\n position_coordinates('p')\n end",
"def closest_neighbors(num_neighbors, point, data)\n data.keys.sort { |a,b| euclidean_distance(a, point) <=> euclidean_distance(b, point) }.take(num_neighbors)\nend",
"def search(path, final_point)\n\n current = path.first\n puts \"current.center = #{current.center}\"\n puts \"final_point.center = #{final_point.center}\"\n puts \"path.size = #{path.size}\"\n puts \"path = #{path.map{ |p| [p.center,p.wp_visited?].flatten }}\"\n puts \"current.wp_visited? = #{current.wp_visited?}\"\n\nbinding.pry # => debugger\n\n if wp_distance2(current, final_point) < 1.0\n puts \"found\"\n return path.reverse\n end\n\n wp_adjacents = sort_and_filter(current.wp_adjacents, final_point)\n\n wp_adjacents.each do |wp|\n search(path.unshift(wp), final_point)\nbinding.pry # => debugger\n wp.wp_mark\n end\n end",
"def match_position_by_similar\n add_fuzz_to_images\n self.match_result = search_image.find_similar_region(template_image)\n return match_result\n end",
"def seek_pos lines, series\n i, j = 0, 0\n best_match = [nil, nil]\n while line = lines[i]\n i += 1\n if line !~ /^\\s*$/\n indent, _, _, pattern = series[j]\n return [i, j] if !indent # max match\n if line =~ pattern\n j += 1\n best_match = [i, j] if !best_match[1] or best_match[1] < j\n else\n leading = line[/^\\s*/].size\n # when 0?\n if leading > 0 and leading < indent.size\n i -= 1\n j = leading / 2 - 1\n end\n end\n end\n end\n best_match\nend",
"def get_nearby_locations(nelat, nelng, swlat, swlng, user_id)\n @locations = []\n validLocations = []\n\n validLocations = Location.where(\"latitude > ? AND latitude < ? AND longitude > ? AND longitude < ?\", swlat, nelat, swlng, nelng)\n validLocations = validLocations.sort_by { |k| k[\"latitude\"] }\n validLocations = validLocations[0..49]\n\n validLocations.each do|loc|\n @locations << loc.to_hash_with_follow(user_id)\n end\n\n end",
"def nearestObjects _args\n \"nearestObjects _args;\" \n end",
"def findPrincessPosition(n, grid)\n return calculate_position_coordinates(n, grid, 'p')\nend",
"def search_for_codons(otrail)\n return SearchResult.new, SearchResult.new if otrail.trail.empty?\n onode = otrail[0]\n\n make_marker = lambda do |position|\n marker = Marker.new\n marker.position_in_node = position\n marker.node = onode.node\n marker\n end\n\n #log.debug \"Looking for codons #{words.to_a}\" if log.debug?\n words = Set.new(START_CODONS).merge(STOP_CODONS)\n\n # search within first / last node\n fwd_nodes_sequence, twin_nodes_sequence = get_sequences onode\n #log.debug \"Looking in #{fwd_nodes_sequence}\" if log.debug?\n fwd_within_first = word_search(fwd_nodes_sequence, words, CODON_LENGTH)\n #log.debug \"Found codons #{fwd_within_first.keys.join(',')} at positions #{fwd_within_first.values.join(',')} in #{fwd_nodes_sequence}\" if log.debug?\n #log.debug \"Looking in #{twin_nodes_sequence}\" if log.debug?\n twin_within_first = word_search(twin_nodes_sequence, words, CODON_LENGTH)\n #log.debug \"Found codons #{twin_within_first.keys.join(',')} in twin node at positions #{twin_within_first.values.join(',')} in #{fwd_nodes_sequence}\" if log.debug?\n\n # extend search along trail\n fwd_overlap_sequence, twin_overlap_sequence = get_overlap_sequences(otrail, CODON_LENGTH)\n #log.debug \"Looking in #{fwd_overlap_sequence}\" if log.debug?\n fwd_in_overlap = word_search(fwd_overlap_sequence, words, CODON_LENGTH)\n #log.debug \"Found codons #{fwd_in_overlap.keys.join(',')} in twin node at positions #{fwd_in_overlap.values.join(',')} in #{fwd_overlap_sequence}\" if log.debug?\n #log.debug \"Looking for stops in #{twin_overlap_sequence}\" if log.debug?\n twin_in_overlap = word_search(twin_overlap_sequence, words, CODON_LENGTH)\n #log.debug \"Found codons #{twin_in_overlap.keys.join(',')} in twin node at positions #{twin_in_overlap.values.join(',')} in #{twin_overlap_sequence}\" if log.debug?\n\n # offset positions in overlap to be relative to start of node / twin node\n offset = onode.node.length_alone\n fwd_in_overlap.each{|word, inds| fwd_in_overlap[word] = inds.collect{|pos| pos + offset}}\n twin_in_overlap.each{|word, inds| twin_in_overlap[word] = inds.collect{|pos| pos + 1 - CODON_LENGTH}}\n #log.debug \"Codons in overlap positions relative to start of first node #{fwd_in_overlap.values.join(',')}\" if log.debug?\n #log.debug \"Codons in overlap positions relative to start of first twin node #{twin_in_overlap.values.join(',')}\" if log.debug?\n\n # assemble result\n fwd_result = SearchResult.new\n twin_result = SearchResult.new\n\n push_mark_to_list = lambda do |list, word, positions|\n if positions.has_key? word\n list.push positions[word].collect{|pos| make_marker.call pos}\n end\n end\n\n fwd_positions = fwd_within_first.merge fwd_in_overlap\n twin_positions = twin_within_first.merge twin_in_overlap\n START_CODONS.each do |word|\n # fwd starts\n push_mark_to_list.call(fwd_result.start_markers, word, fwd_positions)\n # twin starts\n push_mark_to_list.call(twin_result.start_markers, word, twin_positions)\n end\n fwd_result.start_markers.flatten!\n twin_result.start_markers.flatten!\n #log.debug \"Positions of start codons #{fwd_result.start_markers.join(',')}\" if log.debug?\n #log.debug \"Positions of start codons in twin node #{twin_result.start_markers.join(',')}\" if log.debug?\n\n STOP_CODONS.each do |word|\n #fwd stops\n push_mark_to_list.call(fwd_result.stop_markers, word, fwd_positions)\n # twin stops\n push_mark_to_list.call(twin_result.stop_markers, word, twin_positions)\n end\n fwd_result.stop_markers.flatten!\n twin_result.stop_markers.flatten!\n #log.debug \"Positions of stop codons #{fwd_result.stop_markers.join(',')}\" if log.debug?\n #log.debug \"Positions of stop codons in twin node #{twin_result.stop_markers.join(',')}\" if log.debug?\n\n\n return fwd_result, twin_result\n end",
"def find_closest_points(reference_point, geometric_resolution)\n do_find_closest_points(reference_point.to_a, geometric_resolution)\n end",
"def find_word( file, target_letter_height, iterations )\n\n points = []\n File.open( file , \"r\" ) do |f|\n f.each_line do |line|\n matches = /position=<\\s*([^\\s]+),\\s*([^\\s]+)> velocity=<\\s*([^\\s]+),\\s*([^\\s]+)>/.match( line )\n points << Point.new( matches[1].to_i, matches[2].to_i, matches[3].to_i, matches[4].to_i )\n end\n end\n\n iter_counter = 0\n candidate_grid = nil\n candidate_iteration = nil\n cols_at_height_current = 0\n \n loop do\n\n break if iter_counter >= iterations\n\n allpoints = {}\n xmaxes = Hash.new( 0 )\n \n points.each do |p|\n p.x = p.xvel + p.x \n p.y = p.yvel + p.y \n key = \"#{p.x},#{p.y}\"\n \n # if we have not yet seen this point, then count its x pos\n if ! allpoints.key?( key )\n xmaxes[p.x] = xmaxes[p.x] + 1\n end\n \n allpoints[key] = 1\n end\n\n # figure out how many columns we have, that are at the same row value\n cols_at_height = 0\n xmaxes.each do |k,v|\n cols_at_height = cols_at_height + 1 if v == target_letter_height\n end\n\n if cols_at_height > cols_at_height_current\n cols_at_height_current = cols_at_height\n candidate_grid = allpoints.dup\n candidate_iteration = iter_counter\n end\n \n iter_counter += 1\n end\n\n [ candidate_iteration + 1, candidate_grid ]\nend",
"def findcoordinates(input)\n case input\n when \"^\"\n position = [0,1]\n when \"v\"\n position = [0,-1]\n when \">\"\n position = [1,0]\n when \"<\"\n position = [-1,0]\n end\nend",
"def pos\n\t\tif not moved_to.nil? and moved?\n\t\t\tsquare.neighbor( moved_to )\n\t\telse\n\t\t\tsquare\n\t\tend\n\tend",
"def identifyAddNps\r\n pd = ParseData.new\r\n @sentences.each do |sentence|\r\n strSent = sentence.strRep\r\n \r\n sentNps = @parseAdapter.parse strSent\r\n \r\n #in the future, do a little better on matching\r\n foundNps = pd.onlyNP sentNps\r\n \r\n foundNps.sort_by{|word| word.length}.each do |foundNp|\r\n #puts \"#{foundNp}\"\r\n\r\n sentence.npAdd foundNp, newId\r\n end\r\n end\r\n\r\n #add the position on here...\r\n pos = 1\r\n @sentences.each do |sentence|\r\n sentence.npModels.each do |npModel|\r\n npModel.position = pos\r\n pos = pos + 1\r\n end\r\n end\r\n end",
"def parse_coordinations scs, vissim\n \n # adjust the position of controllers such the left-most one\n # is at position zero \n minpos = scs.map{|sc|sc.position}.min\n scs.each{|sc|sc.update :position => (sc.position - minpos)}\n \n coordinations = []\n scs.each_cons(2) do |sc1,sc2|\n next unless (sc2.number - sc1.number).abs == 1 # assigned numbers indicate proximity\n # setup a coordination in each direction\n [[sc1,sc2],[sc2,sc1]].each do |fromsc,tosc|\n coordinations << Coordination.new(fromsc,tosc,vissim.speed(fromsc,tosc),vissim.distance(fromsc,tosc))\n end\n end\n \n coordinations\nend",
"def tokenizer_ranking_row_result_position\n TokenExtractor.new(\n :result_position,\n 0,\n #/(.)(?=[a-z°)])/i\n /\\s*(\\w|\\?){3}-(\\d|\\?){6}/i\n )\n end",
"def pos()\n #This is a stub, used for indexing\n end",
"def pos()\n #This is a stub, used for indexing\n end",
"def find_within(tags, span, pointer); end",
"def find_within(tags, span, pointer); end",
"def search(points)\n if points.is_a?(String)\n points = [points]\n end\n stones = []\n @groups.each do |group|\n group.each do |stone|\n stones << stone if points.include? stone.point\n end\n end\n return stones\n end",
"def spot\n case\n when respond_to?(:exact_spot)\n exact_spot\n when respond_to?(:trigram_spot)\n trigram_spot\n else\n tsearch_spot\n end\n end",
"def find_bunny(easter_bunny_recruit_doc, origin, facing)\n\n if easter_bunny_recruit_doc.empty?\n raise \"file is empty.\"\n end\n\n distance = 0\n\n commands = extract_commands(easter_bunny_recruit_doc)\n\n destination = coordinate_system_mover(commands, origin, facing)\n\n distance = city_grid_distance(origin, destination)\n\n return distance\nend",
"def getBotPosition(n, grid)\n return calculate_position_coordinates(n, grid, 'm')\nend"
] | [
"0.6339187",
"0.62296534",
"0.6146507",
"0.61063534",
"0.60950625",
"0.60000217",
"0.5943372",
"0.5895443",
"0.58800095",
"0.58719075",
"0.58719075",
"0.58719075",
"0.58719075",
"0.58254457",
"0.58254457",
"0.5823336",
"0.58157164",
"0.5801092",
"0.579321",
"0.576223",
"0.5692149",
"0.567878",
"0.56484485",
"0.5644186",
"0.5643857",
"0.56099784",
"0.5606978",
"0.55973744",
"0.55924773",
"0.55651814",
"0.555634",
"0.5548321",
"0.5545757",
"0.55357057",
"0.55260724",
"0.55198336",
"0.5515499",
"0.55122304",
"0.5495311",
"0.5493805",
"0.5493805",
"0.5493805",
"0.5493805",
"0.5493805",
"0.5493805",
"0.54752386",
"0.547322",
"0.5469064",
"0.5463786",
"0.5460335",
"0.54587543",
"0.5453751",
"0.5448013",
"0.54393643",
"0.54343474",
"0.5430014",
"0.5429808",
"0.54196405",
"0.54110795",
"0.54022026",
"0.53989124",
"0.53898907",
"0.53813446",
"0.53813446",
"0.53813446",
"0.53813446",
"0.53813446",
"0.53813446",
"0.53813446",
"0.53813446",
"0.5374349",
"0.536698",
"0.5365761",
"0.53517395",
"0.53483164",
"0.53459",
"0.5342455",
"0.53140557",
"0.5312264",
"0.5311791",
"0.5309502",
"0.5300881",
"0.52996486",
"0.52989185",
"0.5285763",
"0.5282918",
"0.5281012",
"0.5280453",
"0.5278585",
"0.52781975",
"0.5265806",
"0.52626634",
"0.5259645",
"0.5258928",
"0.5258928",
"0.5258465",
"0.5258465",
"0.5254493",
"0.52520674",
"0.52435195",
"0.523811"
] | 0.0 | -1 |
Create a log message given a response Hash. | def response_message response
"%s %s: %s %s (%f)\n%s" % [
*response[:_response_meta].slice(
:request_method, :request_url, :status_code, :status_message, :total_time
).values,
Yajl::Encoder.encode(response.except(:_response_meta))
]
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def create_message(response)\n return if response.nil?\n\n message = \"#{response[:method].to_s.upcase} \"\n message << \"#{response[:url]}: \"\n message << \"#{@status} - #{format_response}\"\n message\n end",
"def build_response(response)\n \"HTTP/1.1 #{response[:status_code]} #{response[:status_message]}\\r\\n\" +\n \"Content-Type: text/plain\\r\\n\" +\n \"Content-Length: #{response[:bytesize]}\\r\\n\" +\n \"Connection: close\\r\\n\"\n end",
"def create_new_log (log_data)\n new_log = Log.new()\n logs_columns = Log.column_lists\n string_columns = logs_columns[\"string_columns\"]\n string_columns.each do |string_column|\n new_log[string_column] = log_data[string_column]\n end\n time_columns = logs_columns[\"time_columns\"]\n time_columns.each do |time_column|\n new_log[time_column] = Time.at(log_data[time_column].to_f / 1000).getutc\n end\n if new_log[\"application\"].to_s == ''\n new_log[:application] = \"Unknown: \" + request.referer.to_s\n end\n new_log[:parameters] = log_data[\"parameters\"] || {}\n new_log[:extras] = log_data.reject do |key, value|\n key == \"parameters\" || string_columns.include?(key) || time_columns.include?(key)\n end\n\n # first commit the log to the database\n saved = new_log.save\n\n # and then send the log message to the AWS log manager if defined\n if ENV[\"AWS_LOG_MANAGER_URL\"]\n result = HTTParty.post(ENV[\"AWS_LOG_MANAGER_URL\"], :body => log_data.to_json, :headers => {\"Content-Type\" => \"application/json\"})\n if result.code != 201\n logger.error(result)\n end\n end\n\n return saved, new_log\n end",
"def format_msg(hash, level)\n @level = level # Log level\n str = \"\" # Final String we return. We keep appending to this\n count = 0 # Use to indent on 2nd+ iteration\n\n str_keys_values = add_key_values_to_str(hash)\n s_msg = split_msg(str_keys_values) # Split message incase it's MAX_CHAR+ chars\n\n s_msg.each do |n|\n str += count == 0 ? \"#{add_log_level(str)}#{get_date} | \" : \"#{add_log_level(str)}\"\n str += count == 0 ? \"#{n}\\n\" : \" \" * (get_date.length) + \" | #{n}\\n\" # Indent if 2nd+ iteration\n count += 1\n end\n\n str\n end",
"def initialize(hash)\n @header = Msg::Header.new(hash)\n @body = Msg::Body.new(content_is_json?, hash)\n end",
"def format(hash ={})\n # Create a Message Data where all hash keys become methods for convenient interpolation\n # in issue text.\n msgdata = MessageData.new(*arg_names)\n begin\n # Evaluate the message block in the msg data's binding\n msgdata.format(hash, &message_block)\n rescue StandardError => e\n raise RuntimeError, \"Error while reporting issue: #{issue_code}. #{e.message}\", caller\n end\n end",
"def create_log(param); end",
"def response_message(response)\n @last_response = response\n \"HTTP Response status: [#{response.code.to_s}] #{reason_phrase(response.code)}\"\n end",
"def create\n params[:logs].each { |message| Passbook::Log.create(message: message) }\n head :ok\n end",
"def response_message(response)\n @last_response = response\n 'HTTP Response status: [' + response.code.to_s + '] ' + reason_phrase(response.code)\n end",
"def response_message(response)\n @last_response = response\n 'HTTP Response status: [' + response.code.to_s + '] ' + reason_phrase(response.code)\n end",
"def logs_response\n \"\\u0001\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000]64 bytes from fra07s30-in-f6.1e100.net (173.194.112.102): icmp_req=35272 ttl=52 time=36.9 ms\\n\\u0001\\u0000\\u0000\\u0000\\u0000\\u0000\\u0000]64 bytes from fra07s30-in-f6.1e100.net (173.194.112.102): icmp_req=35273 ttl=52 time=35.3 ms\\n\"\n end",
"def append_buffer(buffer, hash)\n if hash['message'] != nil\n buffer['message'] << \" #{hash['message'].gsub(\"\\n\", ' ')}\"\n end\n end",
"def call(params)\n log_email(params[:logger], \"RESPONSE\", params[:response])\n end",
"def generate_response(sha1, last_update)\n if sha1.empty?\n response = {:error => ERROR_MESSAGE}\n else\n response = {:code => {:sha1 => \"#{sha1}\",:updated_at => \"#{last_update}\"}}\n end\n response\n end",
"def h2(msg)\n fail ReportError.new self, msg: 'util: can not h2 nil' if msg.nil?\n RbNaCl::Hash.sha256 RbNaCl::Hash.sha256 \"\\0\" * 32 + msg\n end",
"def report_error!(hash)\n report = ErrorReport.create!(hash.merge(:api_key => api_key))\n report.save\n report.generate_notice!\n end",
"def log_response response\n if config.logger\n message = config.log_formatter.format(response)\n config.logger.send(config.log_level, message)\n end\n nil\n end",
"def log_message event, id, data, errors, creation_time, sender\n Log.create(event, id, data, errors, creation_time, sender)\n end",
"def makehash(body)\n Log.debug(\"Creating message hash using #{private_key_file}\")\n\n sign(private_key_file, body.to_s)\n end",
"def log(params_hash = {})\n begin\n raise_error_unless_params_is_a_hash(params_hash)\n request.method = :get\n request.uri = \"_log#{querystring(params_hash)}\"\n Couchdbtools.execute(request)\n rescue Exception => exception\n exception.message\n end\n end",
"def format_response response \n translate_response_hash_keys response_to_hash(response)\n end",
"def build_hb_message(host,port,asg_name,domain,account,instance_id)\n timestamp=(Time.now.to_f * 1000.0).to_i # ts should be in ms\n metrics={:account=>account,:appId=>asg_name, :instanceID=>instance_id,:timestamp=>timestamp,:entryList=>[{:name=>\"METRIC_CPU\",:value=>0},{:name=>\"METRIC_CPU_DEMAND\",:value=>0},{:name=>\"METRIC_CPU_NUM\",:value=>1},{:name=>\"METRIC_MEM\",:value=>0},{:name=>\"METRIC_MEM_FREE\",:value=>0}]}\n hb={:host=>host,:port=>port.to_i,:uris=>[\"#{asg_name}.#{domain}\"],:tags=>{:metrics=>metrics}}\n hb.to_json\n end",
"def create_response(response, first_response=nil)\n message = message_from(response)\n\n # This allows the second response to grab the auth info from the first\n first_response ||= response\n\n Response.new(!response.has_key?(:ErrCode), message, response,\n :test => test?,\n # The AccessPass and AccessID are used for all alterations to a\n # transaction, so we store that as the authorization instead of TranID\n :authorization => \"#{first_response[:AccessID]}-#{first_response[:AccessPass]}\"\n )\n end",
"def post_messages!(hash)\n Net::HTTP.post_form(URI.parse(@target), {'data'=>hash.to_json})\n end",
"def report_response_body(response)\n write_verbose_log(\"Response from Honeybadger: \\n#{response}\")\n end",
"def process_log_output(output)\n in_message = false\n hsh_array = []\n hsh = nil\n\n output.each_line do |line|\n line = line.chomp\n\n if line[0].nil?\n in_message = !in_message\n next\n end\n\n if in_message\n hsh[\"message\"] << \"#{line[4..]}\\n\"\n next\n end\n\n key, *value = line.split\n key = key.sub(\":\", \"\").downcase\n value = value.join(\" \")\n\n case key\n when \"commit\"\n hsh_array << hsh if hsh\n hsh = {\"sha\" => value, \"message\" => +\"\", \"parent\" => []}\n when \"parent\"\n hsh[\"parent\"] << value\n when \"author\"\n tmp = value.split(\"<\")\n hsh[\"author\"] = tmp[0].strip\n hsh[\"email\"] = tmp[1].sub(\">\", \"\").strip\n when \"date\"\n hsh[\"date\"] = DateTime.parse(value)\n else\n hsh[key] = value\n end\n end\n hsh_array << hsh if hsh\n hsh_array\n end",
"def format_hash(header, hash)\n # Staring with the \"header\" parameter string, concatenate each of the\n # parameter name/value pairs with a prefix intended to better display the\n # results within the Kinetic Task log.\n hash.inject(header) do |result, (key, value)|\n result << \"\\n #{key}: #{value}\"\n end\n end",
"def initialize(response)\n response.error = self\n @response = response\n\n message = []\n\n if response.parsed.is_a?(Hash)\n @code = response.parsed['error']\n @description = response.parsed['error_description']\n message << \"#{@code}: #{@description}\"\n end\n\n message << response.body.force_encoding(\"UTF-8\")\n\n super(message.join(\"\\n\"))\n end",
"def build_created_audit(rec, eh)\n build_audit_payload(rec, eh[:new], nil, \"#{rec.class.to_s.downcase}_record_add\", \"Record created\")\n end",
"def create_log\n\t\tApplicationLog.find_or_create_by(\n\t\t\tchecksum: self.checksum,\n\t\t)\n\tend",
"def create(hash)\n NotImplementedError\n end",
"def hash_to_message(data)\n klass = Hastur::Message.symbol_to_class(data[:type])\n\n # if no UUID is provided, set one in the message payload\n data[:uuid] ||= @uuid\n\n payload = MultiJson.dump(data)\n klass.new :from => @uuid, :payload => payload\n end",
"def response2hash(http)\n if http.response_data.length > (1024 * 100) # more thank 100K\n response_data = http.response_data[0..(1024*100)]\n response_data += \"\\n<---------- Response Data Truncated---------->\"\n else\n response_data = http.response_data\n end\n\n {\n :id => http.id,\n :request => http.request.force_encoding('UTF-8'),\n :response => response_data.force_encoding('UTF-8'),\n :response_headers => http.response_headers.force_encoding('UTF-8'),\n :proto => http.proto.force_encoding('UTF-8'),\n :domain => http.domain.force_encoding('UTF-8'),\n :port => http.port.force_encoding('UTF-8'),\n :path => http.path.force_encoding('UTF-8'),\n :date => http.request_date,\n :has_ran => http.has_ran.force_encoding('UTF-8')\n }\n end",
"def createErrorTeamEmailBody(order_hash, status_hash)\n\t\tbody = <<EOM\t\nOrderNum: #{order_hash[:order_number]}<br/>\nError: #{order_hash[:status_detail]}<br/>\nS3 Status: #{status_hash[:s3_move_msg]}<br/>\nEOM\n\n\t\tbody\n\tend",
"def init_buffer(buffer, hash)\n buffer['message'] = hash['message'].gsub(\"\\n\", ' ')\n buffer['source'] = hash['source']\n buffer['timestamp'] = hash['timestamp']\n buffer['offset'] = hash['offset']\n buffer['system'] = hash['system']\n timestamp = buffer['timestamp'].to_i\n buffer['date'] = Time.at(timestamp/1000).to_s[0..9]\n end",
"def create_hash\n require 'digest/md5'\n digest_string = [self.id, self.url, self.referrer, self.created_at].join(\"\")\n self.record_hash = Digest::MD5.hexdigest(digest_string)\n end",
"def create_challenge_response(cognito_response:, params:)\n if cognito_response.challenge_name == 'MFA_SETUP'\n response_hash = setup_mfa_response(cognito_response: cognito_response, params: params)\n elsif cognito_response.challenge_name.include?('_RETRY')\n cognito_response.challenge_name = cognito_response.challenge_name.gsub('_RETRY', '')\n response_hash = cognito_response.to_h\n else\n response_hash = { email: params[:email], cognito_response: cognito_response }\n end\n\n ChallengeResponse.new(response_hash)\n end",
"def create_record(line, path, log_state, process_fields)\r\n directives = {}\r\n\r\n # If we have directive information about fields in the logs parse it.\r\n if log_state.log_directives.fields != nil\r\n directives = Hash[log_state.log_directives.fields.zip(line.split(\" \"))]\r\n end\r\n\r\n if process_fields && log_state.log_directives.fields != nil\r\n record = directives\r\n elsif\r\n record = {'message' => line }\r\n end\r\n\r\n # Add information about where the log entry came from.\r\n record['log-path'] = path\r\n # Attempt to get a timestamp from the fields and/or directives.\r\n timestamp = get_timestamp(directives['date'], directives['time'], log_state.log_directives.date)\r\n record['timestamp'] = timestamp if timestamp != nil\r\n return record\r\n end",
"def create_log_logshuttle_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LoggingLogshuttleApi.create_log_logshuttle ...'\n end\n # unbox the parameters from the hash\n service_id = opts[:'service_id']\n version_id = opts[:'version_id']\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling LoggingLogshuttleApi.create_log_logshuttle\"\n end\n # verify the required parameter 'version_id' is set\n if @api_client.config.client_side_validation && version_id.nil?\n fail ArgumentError, \"Missing the required parameter 'version_id' when calling LoggingLogshuttleApi.create_log_logshuttle\"\n end\n allowable_values = [\"none\", \"waf_debug\", \"null\"]\n if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])\n fail ArgumentError, \"invalid value for \\\"placement\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [1, 2]\n if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])\n fail ArgumentError, \"invalid value for \\\"format_version\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/service/{service_id}/version/{version_id}/logging/logshuttle'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n form_params['name'] = opts[:'name'] if !opts[:'name'].nil?\n form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?\n form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?\n form_params['format'] = opts[:'format'] if !opts[:'format'].nil?\n form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?\n form_params['token'] = opts[:'token'] if !opts[:'token'].nil?\n form_params['url'] = opts[:'url'] if !opts[:'url'].nil?\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LoggingLogshuttleResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"LoggingLogshuttleApi.create_log_logshuttle\",\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: LoggingLogshuttleApi#create_log_logshuttle\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def send_log(line, level = :DEBUG)\n log = FastlaneCI::Proto::Log.new(message: line, timestamp: Time.now.to_i, level: level)\n @yielder << FastlaneCI::Proto::InvocationResponse.new(log: log)\n end",
"def create_purchase_log_entry\n PurchaseLog.create!({\n ethereum_address: @ethereum_address,\n ether_wei_value: @ether_wei_value,\n usd_value: @usd_value,\n st_wei_value: @st_wei_value,\n block_creation_timestamp: @block_creation_timestamp,\n pst_day_start_timestamp: get_pst_rounded_purchase_date,\n transaction_hash: @contract_event_obj.transaction_hash\n })\n end",
"def pretty_hash_message(msg_hash)\n message = msg_hash['message']\n if msg_hash['errors']\n msg_hash['errors'].each do |k,v|\n if msg_hash['errors'][k]\n message = \"#{message}:\\n#{k}: #{v}\"\n end\n end\n end\n message\n end",
"def make_log_entry\n le = LogEntry.new(:description => \"Desc ##{sn}\")\n le end",
"def log(request, response)\n time = Time.new.strftime(\"%Y-%m-%d %H-%M-%S\")\n http_request = \"#{request.http_method} #{request.uri}\"\n http_response = \"#{response.code}\"\n @log_file.puts \"#{++@log_no} -- [#{time}] #{http_request} #{http_response}\"\n end",
"def create_message(data); end",
"def create_message(data); end",
"def initialize\n @request = VarnishLog::Request.new\n @response = VarnishLog::Response.new\n end",
"def log_hash_safe(hash)\n hash_obj = {}\n hash.each do |key, val|\n if val.is_a?(Hayabusa::Http_session::Post_multipart::File_upload)\n hash_obj[key] = \"<Fileupload>\"\n elsif val.is_a?(Hash)\n hash_obj[key] = self.log_hash_safe(val)\n else\n hash_obj[key] = val\n end\n end\n\n return hash_obj\n end",
"def payment_gateway_response_exception(payment_gateway_response, message = \"\")\n recipients \"[email protected]\"\n from \"[email protected]\"\n subject \"[\" + ServerInstance.current_host_short_string + \"]\" + \"Exception while creating a credit card transaction log\"\n body :response => payment_gateway_response, :message => message\n end",
"def create_log_entry\n Rails.logger.debug(\"@@@ create_log_entry: task = #{@task.inspect} event = #{@event.inspect}\")\n params = Hash.new\n params[:user_id] = current_user.id\n params[:role_id] = current_user.role.id\n params[:ot_id] = @task.ot.id\n params[:task_id] = @task.id\n params[:description] = \"Transicion de #{@task.current_state} a #{@task.current_state.events[@event.to_sym].transitions_to}\"\n log_entry = Audit.new(params)\n log_entry.save\n end",
"def create\n @history_log = HistoryLog.new(params[:history_log])\n\n respond_to do |format|\n if @history_log.save\n format.html { redirect_to(@history_log, :notice => 'HistoryLog was successfully created.') }\n format.xml { render :xml => @history_log, :status => :created, :location => @history_log }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @history_log.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def make_log( type, msg )\n return \"#{type} #{msg}\"\nend",
"def createCompleteNoTrackingErrorEmailBody(order_hash)\n\t\tbody = <<EOM\t\nOrderNum: #{order_hash[:order_number]}<br/>\nEmailSubject: #{order_hash[:subject]}\nEOM\n\n\t\tbody\n\tend",
"def create\n @message_log = MessageLog.new(params[:message_log])\n\n respond_to do |format|\n if @message_log.save\n format.html { redirect_to @message_log, notice: 'Message log was successfully created.' }\n format.json { render json: @message_log, status: :created, location: @message_log }\n else\n format.html { render action: \"new\" }\n format.json { render json: @message_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def _build_and_log_aws_message(phone_number, message)\n msg = {\n phone_number: phone_number,\n message: message,\n message_attributes: @message_attributes,\n }\n @logger.debug msg\n return msg\n end",
"def create_log_heroku_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: LoggingHerokuApi.create_log_heroku ...'\n end\n # unbox the parameters from the hash\n service_id = opts[:'service_id']\n version_id = opts[:'version_id']\n # verify the required parameter 'service_id' is set\n if @api_client.config.client_side_validation && service_id.nil?\n fail ArgumentError, \"Missing the required parameter 'service_id' when calling LoggingHerokuApi.create_log_heroku\"\n end\n # verify the required parameter 'version_id' is set\n if @api_client.config.client_side_validation && version_id.nil?\n fail ArgumentError, \"Missing the required parameter 'version_id' when calling LoggingHerokuApi.create_log_heroku\"\n end\n allowable_values = [\"none\", \"waf_debug\", \"null\"]\n if @api_client.config.client_side_validation && opts[:'placement'] && !allowable_values.include?(opts[:'placement'])\n fail ArgumentError, \"invalid value for \\\"placement\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [1, 2]\n if @api_client.config.client_side_validation && opts[:'format_version'] && !allowable_values.include?(opts[:'format_version'])\n fail ArgumentError, \"invalid value for \\\"format_version\\\", must be one of #{allowable_values}\"\n end\n # resource path\n local_var_path = '/service/{service_id}/version/{version_id}/logging/heroku'.sub('{' + 'service_id' + '}', CGI.escape(service_id.to_s)).sub('{' + 'version_id' + '}', CGI.escape(version_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n form_params['name'] = opts[:'name'] if !opts[:'name'].nil?\n form_params['placement'] = opts[:'placement'] if !opts[:'placement'].nil?\n form_params['response_condition'] = opts[:'response_condition'] if !opts[:'response_condition'].nil?\n form_params['format'] = opts[:'format'] if !opts[:'format'].nil?\n form_params['format_version'] = opts[:'format_version'] if !opts[:'format_version'].nil?\n form_params['token'] = opts[:'token'] if !opts[:'token'].nil?\n form_params['url'] = opts[:'url'] if !opts[:'url'].nil?\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'LoggingHerokuResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['token']\n\n new_options = opts.merge(\n :operation => :\"LoggingHerokuApi.create_log_heroku\",\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: LoggingHerokuApi#create_log_heroku\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def create\n @message_log = MessageLog.new(message_log_params)\n\n respond_to do |format|\n if @message_log.save\n format.html { redirect_to @message_log, notice: 'Message log was successfully created.' }\n format.json { render :show, status: :created, location: @message_log }\n else\n format.html { render :new }\n format.json { render json: @message_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create(verb)\n if params['name']\n message = verb + params['name']\n else\n message = verb + GeneralMedium.find_by(id: params['deleteId'].to_i).name\n end\n message += \" at \"\n @history_log = HistoryLog.new(historyMessage: message, users_id: current_user.id)\n\n respond_to do |format|\n if @history_log.save\n format.html {head :no_content}\n format.json {head :no_content}\n else\n format.html {head :internal_server_error}\n format.json {head :internal_server_error}\n end\n\n end\n end",
"def log_response\n log \"SOAP response (status #{@response.code}):\"\n log @response.body\n end",
"def log_message\n #History.new(\n # mailbox_name: 'N/A',\n # name: @updater,\n # message: Array(@msg).join(',')\n #).save!\n end",
"def initialize(msg, response = nil)\n @response = response\n msg += \" => #{response.body}\" if response&.body\n super(msg)\n end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def creating( msg )\n @log.info \"creating #{msg}\"\n end",
"def create_version_hash\n new_version = {}\n new_version['created'] = ''\n new_version['message'] = ''\n new_version['user'] = {}\n # user is #name, # address.\n new_version['user']['name'] = ''\n new_version['user']['address'] = ''\n new_version['state'] = {}\n new_version\n end",
"def format_response(response)\n result = \" Response:\\n\"\n\n result += format_response_headers response.headers\n result += format_response_body response.body\n\n result\n end",
"def send_hash\n @user = User.find(params[:user_id])\n @id1 = params[:user_id]\n @file_uploads = FileUpload.find_by_id(params[:file_upload_id])\n @md5 = Digest::MD5.file(@file_uploads.attachment.path).hexdigest \n @message = RequestMessage.create(:status_code=>502, :file_hash=>@md5, :file_upload_id=>@file_uploads[:id], :user_id=>@id1)\n #if @message.save\n redirect_to user_file_uploads_path\n #end\n end",
"def record_response(response)\n response[2] = create_recording_response(response[2])\n response\n end",
"def handle_create_message(message, obj, response)\n new_name = message[:name] || message[:hrn]\n msg_props = message.properties.merge({ hrn: new_name })\n\n obj.create(message[:type], msg_props, &lambda do |new_obj|\n begin\n response[:res_id] = new_obj.resource_address\n response[:uid] = new_obj.uid\n\n # Getting property status, for preparing inform msg\n add_prop_status_to_response(new_obj, msg_props.keys, response)\n\n if (cred = new_obj.certificate)\n response[:cert] = cred.to_pem_compact\n end\n # self here is the parent\n self.inform(:creation_ok, response)\n rescue => ex\n err_resp = message.create_inform_reply_message(nil, {}, src: resource_address)\n err_resp[:reason] = ex.to_s\n error \"Encountered exception, returning ERROR message\"\n debug ex.message\n debug ex.backtrace.join(\"\\n\")\n return self.inform(:error, err_resp)\n end\n end)\n end",
"def message_from(response)\n response[:message]\n end",
"def log_response_details(event)\n env = event.payload\n\n if env.response.nil?\n return error do\n \"[#{req_id(env)}] #{req_dest(env)} < #{res_result(env)}\"\n end\n end\n\n debug do\n \"[#{req_id(env)}] #{req_dest(env)} < \" \\\n \"#{env.response_headers.sort.to_h.to_json}\"\n end\n end",
"def format_response(response)\n case\n when response == 'OK'\n true\n when response =~ /^ACK/\n ack = format_ack(response)\n logger.warn ack\n \n ack\n when response.split.size == 1\n # set value -> value\n Hash[*(response.split.*2)]\n else\n # remove first response: \"OK\"\n response = response.split\n response.pop\n\n Hash[*response.collect{|x| x.gsub(/:$/,'')}]\n end\n end",
"def log_response(request_id, status_code, start_time, args = {})\n return unless @communicator_logger\n\n duration = (Time.now - start_time) * 1000 # in milliseconds\n headers = args[:headers]\n body = args[:body] unless args[:body].nil?\n content_type = args[:content_type]\n\n log_msg_builder = Ingenico::Connect::SDK::Logging::ResponseLogMessageBuilder.new(request_id, status_code, duration,\n @body_obfuscator,\n @header_obfuscator)\n unless headers.nil?\n headers = convert_from_sdk_headers(headers)\n headers.each do |key, value|\n log_msg_builder.add_headers(key, value)\n end\n end\n\n if binary_content_type?(content_type)\n log_msg_builder.set_body('<binary content>', content_type)\n else\n log_msg_builder.set_body(body, content_type)\n end\n\n begin\n @communicator_logger.log(log_msg_builder.get_message)\n rescue StandardError => e\n @communicator_logger.log(\"An error occurred trying to log response #{request_id}\", e)\n end\n end",
"def create_response(response)\r\n\r\n#\r\n#\tSetup default response values.\r\n#\r\n message = nil\r\n authorization = nil\r\n success = false\r\n exception = nil\r\n#\r\n#\tExtract key elements from the response.\r\n#\r\n reasonCode = response.Get(RocketGate::GatewayResponse::REASON_CODE);\r\n message = @@response_codes[('r' + reasonCode).to_sym] || \"ERROR - \" + reasonCode\r\n responseCode = response.Get(RocketGate::GatewayResponse::RESPONSE_CODE);\r\n if ((responseCode != nil) && (responseCode == \"0\"))\r\n success = true; # Transaction succeeded\r\n authorization = response.Get(RocketGate::GatewayResponse::TRANSACT_ID);\r\n else\r\n exception = response.Get(RocketGate::GatewayResponse::EXCEPTION);\r\n end\r\n\r\n#\r\n#\tExtract values that are not dependent up success/failure.\r\n#\r\n avsResponse = response.Get(RocketGate::GatewayResponse::AVS_RESPONSE)\r\n cvv2Response = response.Get(RocketGate::GatewayResponse::CVV2_CODE)\r\n fraudResponse = response.Get(RocketGate::GatewayResponse::SCRUB_RESULTS)\r\n\r\n#\r\n#\tCreate the response object.\r\n#\r\n card_hash = response.Get(RocketGate::GatewayResponse::CARD_HASH)\r\n Response.new(success, message, {:result => responseCode, :exception => exception, :card_hash => card_hash},\r\n :test => test?,\r\n :authorization => authorization,\r\n :avs_result => {:code => avsResponse},\r\n :cvv_result => cvv2Response,\r\n :fraud_review => fraudResponse\r\n )\r\n end",
"def create_valid_message hash\n attributes = { \n subject: 'A valid subject',\n body: 'A valid body should have at least 40 characters ' +\n \"*\"*40\n }\n Message.new( attributes.merge(hash) )\n end",
"def initialize(data)\n super S2A_LOGSTRING_HEADER, data\n\n @content_data.getbyte\n @message = @content_data.string\n end",
"def create(record_hash = {})\n record = new(record_hash)\n record.save\n end",
"def log_response(receiver, response)\n unless response.instance_of? Net::HTTPOK\n LogPoint::write 'Cannot deliver to ' + receiver, 'slack_messages', Logger::WARN\n end\n LogPoint::write(\n sprintf('Processed %s with status %s.', receiver, response.to_s),\n 'inbound',\n Logger::INFO\n )\n\n self\n end",
"def printhostresp(response)\n text = \"\"\n response.each do |resp|\n if resp[:body].is_a?(String)\n text += \"#{resp[:senderid]}:\"\n text += \" \" + resp[:body].split(\"\\n\").join(\"\\n \") + \"\\n\\n\"\n elsif resp[:body].is_a?(Array)\n text += \"#{resp[:senderid]}:\"\n text += \" \" + resp[:body].join(\"\\n \") + \"\\n\\n\"\n else\n text += \"#{resp[:senderid]} responded with a #{resp[:body].class}\"\n end\n end\n\n text\n end",
"def call(log, logger)\n # Header with date, time, log level and process info\n message = \"#{log.level_to_s} [#{log.process_info}]\"\n\n # Tags\n message << ' ' << log.tags.collect { |tag| \"[#{tag}]\" }.join(' ') if log.tags && (log.tags.size > 0)\n\n # Duration\n message << \" (#{log.duration_human})\" if log.duration\n\n # Class / app name\n message << \" #{log.name}\"\n\n # Log message\n message << \" -- #{log.message}\" if log.message\n\n # Payload\n if payload = log.payload_to_s\n message << ' -- ' << payload\n end\n\n # Exceptions\n if log.exception\n message << \" -- Exception: #{log.exception.class}: #{log.exception.message}\\n\"\n message << log.backtrace_to_s\n end\n message\n end",
"def log_request\n ServerRequestLog.create! default_log_hash\n end",
"def generate_log(timestamp)\n\n customer_id = rand(1000000) + 1\n resource_id = rand(10) + 1\n qty = rand(100)\n\n #cost is in cents, could be zero\n cost = rand(200) - 20\n cost = 0 if cost < 0\n\n logline = \"#{timestamp},#{customer_id},#{resource_id},#{qty},#{cost}\"\n #puts logline\n\n ## generate JSON format\n #dict = {\"timestamp\" => timestamp,\n #\"customer_id\" => customer_id,\n #\"resource_id\" => resource_id,\n #\"qty\" => zone_id,\n #\"cost\" => cost\n #}\n #logline = JSON::generate(dict)\n\n\n logline\nend",
"def format_log_message(msg)\n \"[Cloudtasker/Server][#{id}] #{msg}\"\n end",
"def createShippedTeamEmailBody(order_hash)\t\n\t\tbody = <<EOM\t\nOrderNum: #{order_hash[:order_number]}<br/>\nShipMethod: #{order_hash[:ship_option]}<br/>\nTrackingNum: #{order_hash[:tracking_number]}<br/>\nShipToFirstName: #{order_hash[:ship_to_first_name]}<br/>\nShipToLastName: #{order_hash[:ship_to_last_name]}<br/>\nShipToCompany: #{order_hash[:ship_to_company]}<br/>\nShipToAddr1: #{order_hash[:ship_to_addr1]}<br/>\nShipToAddr2: #{order_hash[:ship_to_addr2]}<br/>\nShipToCity: #{order_hash[:ship_to_city]}<br/>\nShipToState: #{order_hash[:ship_to_state]}<br/>\nShipToZip: #{order_hash[:ship_to_zip]}<br/>\nEOM\n\n\t\tbody\n\tend",
"def execute_output(send, line)\n return {:type => :log, :message => line}\n end",
"def <<(hash)\n @flash.set_flash(hash)\n end",
"def createPrinterReceivedEmailBody(order_hash)\n\t\tbody = <<EOM\t\nOrderNum: #{order_hash[:order_number]}<br/>\nShipMethod: #{order_hash[:ship_option]}<br/>\nShipToFirstName: #{order_hash[:ship_to_first_name]}<br/>\nShipToLastName: #{order_hash[:ship_to_last_name]}<br/>\nShipToCompany: #{order_hash[:ship_to_company]}<br/>\nShipToAddr1: #{order_hash[:ship_to_addr1]}<br/>\nShipToAddr2: #{order_hash[:ship_to_addr2]}<br/>\nShipToCity: #{order_hash[:ship_to_city]}<br/>\nShipToState: #{order_hash[:ship_to_state]}<br/>\nShipToZip: #{order_hash[:ship_to_zip]}<br/>\nShipToPhone: #{order_hash[:ship_to_phone]}<br/>\n<br/>\nOrder Items:<br/>\nEOM\n\n\t\tbody\n\tend",
"def from_response(response)\n\n payload = response.body\n @error = payload['error']\n @error_code = payload['error_code']\n @details = payload['details']\n @response = response\n\n logger.error(\"Request failed with status #{response.code.to_s}: '#{@error_code} #{@error}': #{response.body}\")\n\n self\n end",
"def initialize(validation_failure_hash)\n self.affected_fields = Array((validation_failure_hash.dig(:affected_fields) || {})[:string])\n self.message = validation_failure_hash[:message]\n end",
"def log str, options = nil\n @logs ||= Array.new\n @logs << {content: str, options: (options || Hash.new)}\n end",
"def postContract_log( contract_id, date, payment_provider, response, success, amount, currency)\n params = Hash.new\n params['contract_id'] = contract_id\n params['date'] = date\n params['payment_provider'] = payment_provider\n params['response'] = response\n params['success'] = success\n params['amount'] = amount\n params['currency'] = currency\n return doCurl(\"post\",\"/contract_log\",params)\n end",
"def create_payload(api_key_str:, msg:, extra_content:)\n \"#{api_key_str} #{extra_content} #{msg}\\n\"\n end",
"def build_activity_message(activity, response)\n # Set activity\n activity_hash = activity\n # Send response based on adapter\n case robot.config.robot.adapter\n when :slack\n # Send response\n response.reply(\"*#{activity_hash[:activityName]}*\\n#{activity_hash[:activityDescription]}\\n*Skulls:* #{activity_hash[:skulls].join(', ')}\")\n else\n # Send response\n response.reply(\"#{activity_hash[:activityName]}\\n#{activity_hash[:activityDescription]}\\nSkulls: #{activity_hash[:skulls].join(', ')}\")\n end\n end",
"def createPrinterReceivedEmail(order_hash, status_hash)\n\t\tprocess = ProcessHandler.new\n\t\tbody = createPrinterReceivedEmailBody(order_hash)\n\t\torder_hash[:items].each do |item|\n\t\t\tbody += itemForEmailBody(order_hash, process.createItemHash(item, order_hash, status_hash))\n\t\tend\t \n\n\t\torder_hash[:body] = body\n\tend",
"def simple_hash(request, response = \"\")\n {\n \"id\" => \"simple_hash\",\n \"connection\" => {\n \"pre_transaction_event\" => [\n {\n \"which\" => 1,\n \"connection_event\" => {\n \"local_ip\" => \"1.2.3.4\",\n \"local_port\" => 80,\n \"remote_ip\" => \"5.6.7.8\",\n \"remote_port\" => 1000\n }\n }\n ],\n \"transaction\" => [\n {\n \"event\" => [\n {\n \"which\" => 2,\n \"data_event\" => {\"data\" => request}\n }\n ]\n },\n {\n \"event\" => [\n {\n \"which\" => 3,\n \"data_event\" => {\"data\" => response}\n }\n ]\n },\n ],\n \"post_transaction_event\" => [\n {\n \"which\" => 4\n }\n ]\n }\n }\n end",
"def make_response(response, attachments = [])\n {\n text: response, # send a text response (replies to channel if not blank)\n attachments: attachments,\n link_names: '1',\n username: 'Foosey',\n icon_url: 'http://foosey.futbol/icon.png'\n }\nend",
"def create_log_event(level, message, data=nil)\n event = {}\n event[:timestamp] = Time.now.strftime(\"%Y-%m-%dT%H:%M:%S.%6N%z\")\n event[:level] = level\n event[:message] = message\n if data.is_a?(Hash)\n event.merge!(data)\n end\n# MultiJson.dump(event)\n Oj.dump(event)\n end",
"def create\n @log = Log.new(log_params)\n\n if @log.save\n render json: @log, status: :created, location: @log\n else\n render json: @log.errors, status: :unprocessable_entity\n end\n end",
"def initialize(hash)\n @download_url = hash[:download_url]\n @file_output_format = FileOutputFormat.new(hash[:file_output_format][:file_output_type], hash[:file_output_format][:zipped])\n @report_id = hash[:report_id]\n @report_status = hash[:report_status]\n end",
"def webhook\n header = \"<h4>#{params[:verb]} #{params[:url]}</h4><p>Server: <b>#{params[:mode]}</b></p>\"\n query = if params[:params] then \"<p>Params: <pre>#{params[:params]}</pre></p>\" else \"\" end\n session = if params[:session] then \"<p>Session Attribute: <pre>#{params[:session]}</pre></p>\" else \"\" end\n exception = \"<p>Exception: <pre>#{params[:exception]}</pre></p>\"\n content = header + query + session + exception\n @project_logs = ProjectLog.create(project: @project, category: 'ERROR', content: content, date: Date.today)\n render nothing: true\n end"
] | [
"0.67554885",
"0.59179956",
"0.56001985",
"0.5595342",
"0.5567572",
"0.5535381",
"0.55058026",
"0.5470559",
"0.54417294",
"0.5432932",
"0.5432932",
"0.537138",
"0.53340644",
"0.5330785",
"0.5326451",
"0.52752334",
"0.5267429",
"0.5263246",
"0.5259962",
"0.5255423",
"0.5254488",
"0.5234019",
"0.5233833",
"0.5224372",
"0.52114666",
"0.52090025",
"0.5202921",
"0.52019405",
"0.5194377",
"0.5187004",
"0.51803",
"0.5144873",
"0.51399374",
"0.51389694",
"0.5138115",
"0.51302236",
"0.5120465",
"0.5120035",
"0.51166624",
"0.5108567",
"0.5102885",
"0.50906646",
"0.5077857",
"0.5073217",
"0.50391996",
"0.5032719",
"0.5032719",
"0.50257546",
"0.5022712",
"0.50199383",
"0.5017917",
"0.50147974",
"0.50029385",
"0.4998137",
"0.4994461",
"0.49838",
"0.49814445",
"0.49778673",
"0.4970735",
"0.49658638",
"0.4965406",
"0.49566868",
"0.4955343",
"0.49545616",
"0.4951862",
"0.49420032",
"0.49272633",
"0.4914674",
"0.48912525",
"0.4887492",
"0.48831716",
"0.48823798",
"0.48752415",
"0.48699805",
"0.48664117",
"0.48604155",
"0.48569384",
"0.48514283",
"0.48488483",
"0.48481005",
"0.48462963",
"0.48405257",
"0.4839199",
"0.48382318",
"0.4832608",
"0.48227012",
"0.48184508",
"0.48142627",
"0.4808019",
"0.48077726",
"0.48074868",
"0.48038614",
"0.479279",
"0.47913507",
"0.47888872",
"0.4783821",
"0.4782959",
"0.47674322",
"0.4765554",
"0.47620702"
] | 0.5443789 | 8 |
Add more helper methods to be used by all tests here... | def age_token(user, client_id)
if user.tokens[client_id]
user.tokens[client_id]['updated_at'] = Time.now - (DeviseTokenAuth.batch_request_buffer_throttle + 10.seconds)
user.save!
end
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def test_legacy_helpers\n assert_equal @patron.primary_phone, @patron.primary_address_phone\n assert_equal @patron.secondary_phone, @patron.secondary_address_phone\n assert_nil @patron.primary_address_mobile_phone\n assert_nil @patron.secondary_address_mobile_phone\n end",
"def helpers; end",
"def helpers; end",
"def helpers; end",
"def my_tests\n end",
"def tests; end",
"def tests; end",
"def testing\n # ...\n end",
"def test_legacy\n # Set up legacy handlers\n setup_legacy_handling\n\n common_tests\n end",
"def test_method\n end",
"def define_helpers; end",
"def test_defaults\n end",
"def self_test; end",
"def self_test; end",
"def test_case; end",
"def default_test; end",
"def default_test\r\n end",
"def default_test\n end",
"def __dummy_test__\n end",
"def test_added_methods\r\n assert_respond_to @default_user, :roles\r\n assert_respond_to @default_user, :has_role?\r\n \r\n assert_respond_to @default_user, :permissions\r\n assert_respond_to @default_user, :has_static_permission?\r\n end",
"def test_nothing\n end",
"def default_test\n end",
"def test_cases; end",
"def test_users_searches\n do_users_all\n do_simple_query\n do_tag_query\n do_profile_query\n end",
"def stest_method_1(test); end",
"def test_should_eat()\n yay_or_nay = should_eat(\"ice cream\", \"winter\")\n assert_equal(\"False\", should_eat)\n end",
"def test_nothing\n end",
"def should; super end",
"def before_test(test); end",
"def before_test(test); end",
"def spec; end",
"def spec; end",
"def test_entry_attrs\n raise \"Implement this method in your test class\"\n end",
"def test_get_content_for\n end",
"def test\n end",
"def test\n end",
"def test\n end",
"def test_hack\n assert(true)\n end",
"def test_pet_shop_name # this uses a function calles pet_shop_name ans passes in the argument @petshop (which contains the list of pets and admin info)\n name = pet_shop_name(@pet_shop) # the function should pull out the the name:\n assert_equal(\"Camelot of Pets\", name) # should return Camelot of pets\n end",
"def test \n end",
"def test_nothing; end",
"def test_entry_attrs\n raise 'Implement the method \"test_entry_attrs\" in your test class'\n end",
"def test\n\n end",
"def compare_tests(test_a, test_b); end",
"def compare_tests(test_a, test_b); end",
"def assertions; end",
"def assertions; end",
"def test_setup\r\n \r\n end",
"def test_truth\n end",
"def build_test_helper \n \n return if skip_method(__method__)\n \n puts \"build Rails test helper for #{model_name} in test/helpers\"\n filename = \"#{plural_table_name}_helper_test.rb\"\n\n template = File.read(template(\"rails/test/helper_test.rb\"))\n # #text = ERB.new(template, nil, '-').result(binding)\n text = Erubis::Eruby.new(template).evaluate( self )\n\n path = namespaced_path(\"test/helpers\",filename)\n write_artifact(path,text) \n end",
"def make_assertions_on_tests( tests, method )\n assert_equal false, tests[:bad].__send__( method )\n assert_equal true, tests[:good].__send__( method )\n assert_equal true, tests[:extra_good].__send__( method )\n end",
"def default_test\n end",
"def default_test\n end",
"def test_entry\n raise \"Implement this method in your test class\"\n end",
"def helper_method(*methods); end",
"def integration_test()\n return [\"all\"]\n end",
"def test_entry\n raise 'Implement the method \"test_entry\" in your test class'\n end",
"def test_order; end",
"def test_nothing\n return true\n end",
"def test_a\n end",
"def test_frameworks; end",
"def prepare_helpers\n base = File.join(config[:test_base_path], \"helpers\")\n\n helper_files.each do |src|\n dest = File.join(sandbox_suites_dir, src.sub(\"#{base}/\", \"\"))\n FileUtils.mkdir_p(File.dirname(dest))\n FileUtils.cp(src, dest, preserve: true)\n end\n end",
"def smoke_test ()\n\n smoke_test = [\"rest_get\"]\n return smoke_test\n end",
"def add_testing\n setup_rspec\n setup_rspec_generators\n setup_rails_helper\n setup_factories_file\nend",
"def testHelper arr, description, expected\n\tresult = leastOccuringValueInArray(arr)\n\tString resultType = result.class\n\t \n\tString testStatus = \"Failed\"\n\tif (leastOccuringValueInArray(arr).class == expected.class)\n\t\t(leastOccuringValueInArray(arr) == expected)? testStatus = \"Passed\" : testStatus = \"Failed\"\n\tend\n\t\n\t# Print test results\n\tputs \"| \" + testStatus + \" | \" + description + \", expected: \" + expected.to_s + \"(\" + expected.class.to_s + \")\" + \", actual: \" + result.to_s + \"(\" + resultType.to_s + \")\"\nend",
"def test_respond_to\n assert_respond_to system_wide, :role\n assert_respond_to system_wide, :role=\n assert_respond_to system_wide, :inspect\n assert_respond_to system_wide, :object_id\n end",
"def final_test_methods\n return []\n end",
"def tests=(_arg0); end",
"def tests=(_arg0); end",
"def running_test_case; end",
"def test\n return \"\ndef test_#{@test_name}\n assert_nothing_raised(#{self.class.name}) do\n #{@method} :#{@action}, #{@params.inspect}, #{@session.inspect}, #{@flash.inspect}\n end\nend\n\"\n end",
"def smoke_test()\n return [\"case_aaaa\"]\n end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def setup; end",
"def test_guest_name\n assert_equal('Peter', @guest1.return_guest_name)\n end",
"def test_truth\n april = riders(:rider_1)\n assert_equal \"April Jones\", april.name\n trigger = horses(:horse_1)\n assert_equal \"Trigger\", trigger.name\n event2 = events(:event_2)\n assert_equal \"5 Horse Scramble\", event2.name\n \n end",
"def generate_alltest\n\n end",
"def test_camel_case\n raise NotImplementedError, 'Undecided as to whether to check camel case or not'\n end",
"def test_find_single_item\n\n result=find_single_item(@warehouse_data, :b7)\n assert_equal(\"bath fizzers\",result)\n \nend",
"def test_autocomplete_searches\n do_find_all\n do_autocomplete_query\n end",
"def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend",
"def my_array_splitting_method(source)\n source # This line is here to make sure all tests initially fail. Delete it when you begin coding.\nend"
] | [
"0.7330966",
"0.701972",
"0.701972",
"0.701972",
"0.6772961",
"0.6679903",
"0.6679903",
"0.6583205",
"0.65507036",
"0.6377433",
"0.63762784",
"0.632961",
"0.6280821",
"0.6280821",
"0.6249786",
"0.6142927",
"0.6137607",
"0.6121912",
"0.6108209",
"0.60972595",
"0.60949636",
"0.6085482",
"0.6077252",
"0.60748607",
"0.603319",
"0.60055846",
"0.60010356",
"0.59755695",
"0.5975158",
"0.5975158",
"0.5973282",
"0.5973282",
"0.59555405",
"0.59167516",
"0.59057903",
"0.59057903",
"0.59057903",
"0.5894578",
"0.5886192",
"0.58858806",
"0.5885474",
"0.58805525",
"0.5860731",
"0.5860412",
"0.5860412",
"0.584998",
"0.584998",
"0.58033717",
"0.5794802",
"0.5785648",
"0.57691133",
"0.57356757",
"0.57356757",
"0.5733712",
"0.5718457",
"0.569885",
"0.5686251",
"0.56847906",
"0.56680214",
"0.5660432",
"0.56465375",
"0.5645647",
"0.5644992",
"0.56355596",
"0.5591017",
"0.55830294",
"0.5579137",
"0.55729306",
"0.55729306",
"0.5563504",
"0.555469",
"0.55488664",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.5540873",
"0.55373555",
"0.5536957",
"0.55365646",
"0.5536232",
"0.5533716",
"0.5533225",
"0.5530253",
"0.5530253",
"0.5530253",
"0.5530253"
] | 0.0 | -1 |
Gets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. | def additional_data
return @additional_data
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [] | [] | 0.0 | -1 |
Sets the additionalData property value. Stores additional data not described in the OpenAPI description found when deserializing. Can be used for serialization as well. | def additional_data=(value)
@additional_data = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [] | [] | 0.0 | -1 |
Gets the allowMultipleLines property value. Whether to allow multiple lines of text. | def allow_multiple_lines
return @allow_multiple_lines
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allow_multiple_lines=(value)\n @allow_multiple_lines = value\n end",
"def multiline_token_support\n attributes.fetch(:multilineTokenSupport)\n end",
"def multi_line?\n @buffer.is_a?(Array)\n end",
"def is_multiline?(text)\n text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\\s\n end",
"def multi_line_tag?(name) \n MULTI_LINE_TAGS.include?(name.to_s)\n end",
"def multiline?(node)\n node.multiline? && !allowed_multiline_argument?(node)\n end",
"def is_multiline?(line) # ' '[0] == 32\n line && line.length > 1 && line[-1] == MULTILINE_CHAR_VALUE && line[-2] == 32\n end",
"def allows_multiple?\n false\n end",
"def is_multiline?\n @code =~ /\\n/\n end",
"def multiline?(eval_string)\n false\n end",
"def format_multiline(text)\n Array.wrap(text).flat_map { |s| s.to_s.split(/ *[;\\n] */) }.compact_blank!\n end",
"def test_multilineText\n w = Window_Confirmation.new(0,160,640,MULTILINE_TEXT)\n @windows.push(w)\n return true\n end",
"def handle_multiline(count, line, index)\n suppress_render = false\n # Multilines are denoting by ending with a `|` (124)\n if is_multiline?(line) && @multiline_buffer\n # A multiline string is active, and is being continued\n @multiline_buffer += line[0...-1]\n suppress_render = true\n elsif is_multiline?(line) && (MULTILINE_STARTERS.include? line[0])\n # A multiline string has just been activated, start adding the lines\n @multiline_buffer = line[0...-1]\n @multiline_count = count\n @multiline_index = index\n process_indent(count, line)\n suppress_render = true\n elsif @multiline_buffer\n # A multiline string has just ended, make line into the result\n unless line.empty?\n process_line(@multiline_buffer, @multiline_index, count > @multiline_count)\n @multiline_buffer = nil\n end\n end\n\n return suppress_render\n end",
"def quoted_newlines\n @gapi.csv_options.allow_quoted_newlines\n end",
"def quoted_newlines\n @gapi.csv_options.allow_quoted_newlines\n end",
"def single_line?; end",
"def plain_single_line\n plain, multiline = @options[:plain], @options[:multiline]\n @options[:plain], @options[:multiline] = true, false\n yield\n ensure\n @options[:plain], @options[:multiline] = plain, multiline\n end",
"def multiple?\n @multiple\n end",
"def multiline_lines=(multiline_lines)\n if !multiline_lines.nil? && multiline_lines < 0\n fail ArgumentError, 'invalid value for \"multiline_lines\", must be greater than or equal to 0.'\n end\n\n @multiline_lines = multiline_lines\n end",
"def multiline?(node); end",
"def allowed_multiline_argument?(node); end",
"def allowed_multiline_argument?(node)\n elements(node).one? && !Util.begins_its_line?(node.loc.end)\n end",
"def lines?\n @lines\n end",
"def new_line?\n self[:value] ||= {}\n @new_line ||= multi_value? && CustomFields::CheckBox.true_or_false?(self[:value][:new_line])\n end",
"def multiline_kspawn? line\n if @kspawn_multiline\n @kspawn[:text] << line\n if line.include?(\"~\")\n @kspawn_multiline = false\n # However nothing but whitespace can follow that tilde!\n validate_tilde(\n line: line,\n line_number: @current_line,\n present: false\n )\n end\n true\n else\n false\n end\n # Returning true skips the rest of the parse method for this line\n end",
"def multiline_input?(e)\n case e.message\n when /Syntax error at end of/i\n true\n else\n false\n end\n end",
"def lines\n return [] unless @value && text\n\n text.split(/\\r\\n|\\r|\\n/)\n end",
"def readline_support?\n false\n end",
"def skip_newlines?\n @skip_newlines\n end",
"def set_Multiple(value)\n set_input(\"Multiple\", value)\n end",
"def max_lines\n (contents.width / line_height) - 1\n end",
"def lines_for_editing=(value)\n @lines_for_editing = value\n end",
"def reduce_multi_line(_production, _range, _tokens, _children)\n Regexp::MULTILINE\n end",
"def single_line_tag?(name) \n SINGLE_LINE_TAGS.include?(name.to_s)\n end",
"def newline?\n @kind == :newline\n end",
"def multiple?\n @multi\n end",
"def multiple?\n @multi\n end",
"def format_multiline_input(text)\n simple_format(h(text)).html_safe\n end",
"def multi?\n @db_column.is_a?(Array) && !comment?\n end",
"def multiline_arg; end",
"def lines_for_editing\n return @lines_for_editing\n end",
"def split_lines\n text.split(/\\n/)\n end",
"def supports_multiple?(type)\n rules_for_type(type).include?(:multiple)\n end",
"def multi_line_match(multi_lines)\n (multi_lines.size - 2).downto(0) do |index_start|\n concat_line = multi_lines[index_start .. -1].join(JOINT_FOR_MULTI_LINES)\n return multi_lines[index_start .. -1].join(\"\\n\") if @re =~ concat_line\n end\n\n return nil\n end",
"def multiple?\n @schema['multiple'] ? true : false\n end",
"def options\n self.read_attribute(:options).split(\"\\n\") unless self.read_attribute(:options).nil?\n end",
"def nl\n @linebreak = true\n end",
"def line_break(lines)\n lines_esc = lines.collect do |line|\n ERB::Util.h(line)\n end\n return (lines_esc.find_all do |line|\n line && line.to_s.length > 0\n end).join('<text:line-break/>')\n end",
"def is_paragraph_style?\n false\n end",
"def lines\n escaped = value.to_s.scan(/(\\\\n|\\\\t|\\\\r)/)\n escaped.empty? ? value.to_s.split(/\\n/, -1) : [value.to_s]\n end",
"def is_paragraph_style?\n true\n end",
"def lines\n text.split(/(?<=[\\n\\f])/)\n end",
"def too_long?\n length = self.chomp.length\n if length > line_length_max\n print_problem \"Line is >#{line_length_max} characters (#{length})\"\n return true\n end\n\n false\n end",
"def match_lines lines\n lines.each do |text|\n return true if self.match_text( text )\n end\n false\n end",
"def paragraphs?\n false\n end",
"def quoted_newlines= new_quoted_newlines\n frozen_check!\n @gapi.csv_options.allow_quoted_newlines = new_quoted_newlines\n end",
"def quoted_newlines= new_quoted_newlines\n frozen_check!\n @gapi.csv_options.allow_quoted_newlines = new_quoted_newlines\n end",
"def lines\n @lines ||= Vedeu::Editor::Lines.coerce(data)\n end",
"def multiline\n text=\"\"\n while (txt = gets) != \"\\n\"\n text << txt\n end\n return text\nend",
"def display_lines( text, rows = DEFAULT_ROWS_TEXTAREA, cols = DEFAULT_COLS_TEXTAREA )\n html = String.new\n html += \"<textarea class=\\\"form-control\\\" rows=\\\"#{ rows }\\\" cols=\\\"#{ cols }\\\" readonly>#{text}</textarea>\"\n html.html_safe\n end",
"def skip_newlines=(bool)\n @skip_newlines = bool\n end",
"def has_lines?\n @lines.any?\n end",
"def read_multiline(prompt = '')\n @stop = false\n lines = []\n loop do\n line = read_line(prompt)\n break if !line || line == ''\n next if line !~ /\\S/ && !@stop\n if block_given?\n yield(line) unless line.to_s.empty?\n else\n lines << line unless line.to_s.empty?\n end\n break if @stop\n end\n lines\n end",
"def modifier_keyword?\n return false unless keyword_to_indent?\n\n line_of_text = @options[:full_line_of_text]\n log \"Line of text: #{line_of_text}\"\n\n catch(:result) do\n sexp_line = Ripper.sexp(line_of_text)\n\n if sexp_line.nil?\n msg = 'sexp line was nil. '\n msg << 'Perhaps that line is part of a multi-line statement?'\n log msg\n log 'Trying again with the last char removed from the line...'\n line_of_text.chop!\n sexp_line = Ripper.sexp(line_of_text)\n end\n\n if sexp_line.nil?\n log 'sexp line was nil again.'\n log 'Trying 1 more time with the last char removed from the line...'\n line_of_text.chop!\n sexp_line = Ripper.sexp(line_of_text)\n end\n\n if sexp_line.is_a? Array\n log \"sexp_line.flatten: #{sexp_line.flatten}\"\n log \"sexp_line.last.first: #{sexp_line.last.first}\"\n\n begin\n throw(:result, sexp_line.flatten.compact.any? do |s|\n s == MODIFIERS[self]\n end)\n rescue NoMethodError\n end\n end\n end\n end",
"def inline_example?\n check_assignment_or_regexp(:inline_example, InlineExampleRegexp)\n end",
"def texts=(texts)\n if texts.is_a?(String)\n @multi = false\n @texts = [texts]\n else\n @multi = true\n @texts = texts\n end\n end",
"def lineBreak \n \"lineBreak\" \n end",
"def line_max\n return @line_max if @line_max\n return @line_max = contents_height / line_height\n end",
"def readline_supported?\n @readline_supported = READLINE_SUPPORTED if @readline_supported.nil?\n @readline_supported\n end",
"def multiple?(field)\n self.class.multiple?(field)\n end",
"def lines\n @lines ||= text.map do |line|\n line.split /\\s{2}/\n end.flatten.reject!{|l| l == '' }\n #puts \"LINES? #{@lines}\"\n @lines\n end",
"def stop_text?\n stop_text_array.include?(@text)\n end",
"def multiple?(term)\n self.class.multiple?(term)\n end",
"def eol_pattern()\n return /\\r\\n?|\\n/ # Applicable to *nix, Mac, Windows eol conventions\n end",
"def line_comments_option; end",
"def accept_multiple_sets?\n return true\n end",
"def validate\n @lines.select! do |line|\n line.include?(\"The configuration is\") || # success\n line.include?(\"Error: \") # error\n end\n end",
"def multiple?\r\n not single?\r\n end",
"def allows_multiple_groups?\n max_groups && max_groups > 1\n end",
"def max_line_length\n @max_line_length ||= ProxPage.max_line_length\nend",
"def multiple?(field)\n raise UnknownAttributeError.new(nil, field, self) unless delegated_attributes.key?(field)\n delegated_attributes[field].multiple\n end",
"def csv_multi_replacements\n [\n [/\\n\\n/ , \"\\n\"]\n ]\n end",
"def linebreak?(cell)\n cell.nonzero? && (cell % columns).zero?\n end",
"def multiples?\n @maxOccurs == nil || 1 < @maxOccurs\n end",
"def lines\n\t\tcontents.split(\"\\n\")\n\tend",
"def lines\n\t\tcontents.split(\"\\n\")\n\tend",
"def jagged_rows\n @gapi.csv_options.allow_jagged_rows\n end",
"def jagged_rows\n @gapi.csv_options.allow_jagged_rows\n end",
"def restrict_to_lines(content, lines)\n line_range = one_index_range_or_number(lines)\n Array(content.lines.to_a[line_range]).join\n end",
"def restrict_to_lines(content, lines)\n line_range = one_index_range_or_number(lines)\n Array(content.lines.to_a[line_range]).join\n end",
"def extended\n divided_text.length > 1\n end",
"def allow_many?\n @allow_many == true\n end",
"def is_multi?\n is_multi\n end",
"def multi?\n @multi\n end",
"def newline_format(options = {})\n content_tag 'span', options[:value].join('<br>'), nil, false\n end",
"def verbatim?(tokens)\n @sentences.include?(tokens) || @mentions.include?(tokens)\n end",
"def wrapped\n @lines.join(\"\\n\")\n end",
"def set_line_mode data=\"\"\n @lt2_mode = :lines\n (@lt2_linebuffer ||= []).clear\n receive_data data.to_s\n end",
"def include_multi_answers?(standalone)\n standalone || current_user.try(:should_see_inline_answer?, @script_level)\n end",
"def textual?\n properties.include?(\"textual\")\n end"
] | [
"0.83213437",
"0.6415545",
"0.6138348",
"0.5735378",
"0.57066154",
"0.5676352",
"0.56335616",
"0.56022626",
"0.5424472",
"0.5401344",
"0.53951806",
"0.5367026",
"0.5353544",
"0.5349827",
"0.5349827",
"0.5339627",
"0.53288686",
"0.5285873",
"0.5281335",
"0.5239974",
"0.5231438",
"0.5224397",
"0.51892763",
"0.51224506",
"0.5060983",
"0.5004745",
"0.49456245",
"0.48846772",
"0.48703519",
"0.48469675",
"0.48260728",
"0.48199382",
"0.48157227",
"0.47929358",
"0.47827673",
"0.4774027",
"0.4774027",
"0.47688955",
"0.47473776",
"0.47396076",
"0.47339943",
"0.47312358",
"0.4724567",
"0.47098964",
"0.46939188",
"0.46894178",
"0.46862307",
"0.46693578",
"0.46584836",
"0.4655971",
"0.46535015",
"0.4652756",
"0.4651464",
"0.46249905",
"0.46095282",
"0.45554543",
"0.45554543",
"0.45541197",
"0.45416364",
"0.452289",
"0.45149583",
"0.45115262",
"0.44729784",
"0.4465898",
"0.44582492",
"0.44525966",
"0.44339654",
"0.44327775",
"0.44281468",
"0.44234955",
"0.44074357",
"0.44050002",
"0.43960682",
"0.43939677",
"0.43777874",
"0.43742174",
"0.43518052",
"0.43433493",
"0.43394613",
"0.43383965",
"0.43364528",
"0.43286526",
"0.43244663",
"0.4308337",
"0.42997637",
"0.42997637",
"0.429406",
"0.429406",
"0.4287622",
"0.4287622",
"0.4287189",
"0.42857203",
"0.42816612",
"0.42798162",
"0.42693993",
"0.42647672",
"0.42430925",
"0.42393276",
"0.42344028",
"0.42302015"
] | 0.84840107 | 0 |
Sets the allowMultipleLines property value. Whether to allow multiple lines of text. | def allow_multiple_lines=(value)
@allow_multiple_lines = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def allow_multiple_lines\n return @allow_multiple_lines\n end",
"def multiline_lines=(multiline_lines)\n if !multiline_lines.nil? && multiline_lines < 0\n fail ArgumentError, 'invalid value for \"multiline_lines\", must be greater than or equal to 0.'\n end\n\n @multiline_lines = multiline_lines\n end",
"def plain_single_line\n plain, multiline = @options[:plain], @options[:multiline]\n @options[:plain], @options[:multiline] = true, false\n yield\n ensure\n @options[:plain], @options[:multiline] = plain, multiline\n end",
"def multiline_token_support\n attributes.fetch(:multilineTokenSupport)\n end",
"def set_Multiple(value)\n set_input(\"Multiple\", value)\n end",
"def handle_multiline(count, line, index)\n suppress_render = false\n # Multilines are denoting by ending with a `|` (124)\n if is_multiline?(line) && @multiline_buffer\n # A multiline string is active, and is being continued\n @multiline_buffer += line[0...-1]\n suppress_render = true\n elsif is_multiline?(line) && (MULTILINE_STARTERS.include? line[0])\n # A multiline string has just been activated, start adding the lines\n @multiline_buffer = line[0...-1]\n @multiline_count = count\n @multiline_index = index\n process_indent(count, line)\n suppress_render = true\n elsif @multiline_buffer\n # A multiline string has just ended, make line into the result\n unless line.empty?\n process_line(@multiline_buffer, @multiline_index, count > @multiline_count)\n @multiline_buffer = nil\n end\n end\n\n return suppress_render\n end",
"def allows_multiple?\n false\n end",
"def quoted_newlines= new_quoted_newlines\n frozen_check!\n @gapi.csv_options.allow_quoted_newlines = new_quoted_newlines\n end",
"def quoted_newlines= new_quoted_newlines\n frozen_check!\n @gapi.csv_options.allow_quoted_newlines = new_quoted_newlines\n end",
"def quoted_newlines\n @gapi.csv_options.allow_quoted_newlines\n end",
"def quoted_newlines\n @gapi.csv_options.allow_quoted_newlines\n end",
"def multi_line?\n @buffer.is_a?(Array)\n end",
"def test_multilineText\n w = Window_Confirmation.new(0,160,640,MULTILINE_TEXT)\n @windows.push(w)\n return true\n end",
"def multiline?(node)\n node.multiline? && !allowed_multiline_argument?(node)\n end",
"def format_multiline(text)\n Array.wrap(text).flat_map { |s| s.to_s.split(/ *[;\\n] */) }.compact_blank!\n end",
"def lines_for_editing=(value)\n @lines_for_editing = value\n end",
"def nl\n @linebreak = true\n end",
"def allowed_multiline_argument?(node); end",
"def texts=(texts)\n if texts.is_a?(String)\n @multi = false\n @texts = [texts]\n else\n @multi = true\n @texts = texts\n end\n end",
"def skip_newlines=(bool)\n @skip_newlines = bool\n end",
"def allowed_multiline_argument?(node)\n elements(node).one? && !Util.begins_its_line?(node.loc.end)\n end",
"def csv_multi_replacements\n [\n [/\\n\\n/ , \"\\n\"]\n ]\n end",
"def multiline_arg; end",
"def multi_line_tag?(name) \n MULTI_LINE_TAGS.include?(name.to_s)\n end",
"def before_examples(examples)\n @multiline = []\n end",
"def reduce_multi_line(_production, _range, _tokens, _children)\n Regexp::MULTILINE\n end",
"def is_multiline?(line) # ' '[0] == 32\n line && line.length > 1 && line[-1] == MULTILINE_CHAR_VALUE && line[-2] == 32\n end",
"def single_line?; end",
"def before_multiline_arg(multiline_arg)\n @multiline = []\n @expected_row = []\n @actual_row = []\n end",
"def set_line_mode(data = \"\")\n @data_mode = :lines\n (@linebuffer ||= []).clear\n receive_data data.to_s\n end",
"def is_multiline?(text)\n text && text.length > 1 && text[-1] == MULTILINE_CHAR_VALUE && text[-2] == ?\\s\n end",
"def display_lines( text, rows = DEFAULT_ROWS_TEXTAREA, cols = DEFAULT_COLS_TEXTAREA )\n html = String.new\n html += \"<textarea class=\\\"form-control\\\" rows=\\\"#{ rows }\\\" cols=\\\"#{ cols }\\\" readonly>#{text}</textarea>\"\n html.html_safe\n end",
"def set_line_mode data=\"\"\n @lt2_mode = :lines\n (@lt2_linebuffer ||= []).clear\n receive_data data.to_s\n end",
"def line_break(lines)\n lines_esc = lines.collect do |line|\n ERB::Util.h(line)\n end\n return (lines_esc.find_all do |line|\n line && line.to_s.length > 0\n end).join('<text:line-break/>')\n end",
"def format_multiline_input(text)\n simple_format(h(text)).html_safe\n end",
"def multiline?(eval_string)\n false\n end",
"def setRemoveEmptyLines(value)\n @fields['remove_empty_lines'] = value\n self\n end",
"def multiline_input?(e)\n case e.message\n when /Syntax error at end of/i\n true\n else\n false\n end\n end",
"def insert_multiple_lines(text_array)\r\n # Hold paragraphs to be inserted into, corresponding to the index of the strings in the text array\r\n paragraphs = []\r\n paragraph = self.parent_paragraph\r\n # Remove text from paragraph\r\n paragraph.blank!\r\n paragraphs << paragraph\r\n for i in 0...(text_array.size - 1)\r\n # Copy previous paragraph\r\n new_p = paragraphs[i].copy\r\n # Insert as sibling of previous paragraph\r\n new_p.insert_after(paragraphs[i])\r\n paragraphs << new_p\r\n end\r\n\r\n # Insert text into corresponding newly created paragraphs\r\n paragraphs.each_index do |index|\r\n paragraphs[index].text = text_array[index]\r\n end\r\n end",
"def multiline?(node); end",
"def update!(**args)\n @disable_nl_interpretation = args[:disable_nl_interpretation] if args.key?(:disable_nl_interpretation)\n @enable_verbatim_mode = args[:enable_verbatim_mode] if args.key?(:enable_verbatim_mode)\n end",
"def is_multiline?\n @code =~ /\\n/\n end",
"def lines=(v)\n Axlsx.validate_int v\n @lines = v\n end",
"def initialize()\n super\n @unsupported.delete :newline\n end",
"def edit_lines_in_file\n locked_file = \"\"\n begin\n locked_file = lock_file()\n lines = IO.read(locked_file).split(/\\n/)\n lines.map! { |s| s.rstrip }\n lines = yield lines\n # Blank lines (\"\") will always be deleted.\n lines.reject! { |line| line == '' }\n File.open(locked_file, 'w') { |f| f.write(lines.join(\"\\n\")+\"\\n\") }\n return true\n ensure\n unlock_file(locked_file)\n end\n end",
"def set_lines\n set_line(:line_item, OLE_QA::Framework::OLEFS::Line_Item)\n end",
"def set_lines(lines:, align: \"left\")\n if lines.length >= @max_row\n set_string(row: 0, string: lines[0].to_s, align: align)\n set_string(row: 1, string: lines[1].to_s, align: align)\n else\n set_string(row: 0, string: lines[0].to_s, align: align)\n end\n end",
"def multiline_kspawn? line\n if @kspawn_multiline\n @kspawn[:text] << line\n if line.include?(\"~\")\n @kspawn_multiline = false\n # However nothing but whitespace can follow that tilde!\n validate_tilde(\n line: line,\n line_number: @current_line,\n present: false\n )\n end\n true\n else\n false\n end\n # Returning true skips the rest of the parse method for this line\n end",
"def possible_values=(arg)\n if arg.is_a?(Array)\n super(arg.compact.collect(&:strip).select {|v| !v.blank?})\n else\n self.possible_values = arg.to_s.split(/[\\n\\r]+/)\n end\n end",
"def match_lines lines\n lines.each do |text|\n return true if self.match_text( text )\n end\n false\n end",
"def new_line?\n self[:value] ||= {}\n @new_line ||= multi_value? && CustomFields::CheckBox.true_or_false?(self[:value][:new_line])\n end",
"def setup_style\n self.read_only = true\n self.word_wrap_mode = Qt::TextOption::WrapAnywhere\n end",
"def line_break\n append '(?:\\n|(?:\\r\\n))'\n end",
"def restrict_to_lines(content, lines)\n line_range = one_index_range_or_number(lines)\n Array(content.lines.to_a[line_range]).join\n end",
"def restrict_to_lines(content, lines)\n line_range = one_index_range_or_number(lines)\n Array(content.lines.to_a[line_range]).join\n end",
"def set_lines\n set_line(:receiving_line,OLE_QA::Framework::OLEFS::Receiving_Line)\n end",
"def format_textarea\n @attr[:readonly] = :readonly\n super\n end",
"def lineBreak \n \"lineBreak\" \n end",
"def set_lines\n create_data_line(1)\n end",
"def set_line_break_positions!(lb)\n l_ch = @options[:language].chars\n\n # Don't break lines between double open quote and apostrophe (via ~)\n lb.gsub!(\n \"#{ l_ch[:d_quote_open] } #{ l_ch[:apostrophe] }\",\n \"#{ l_ch[:d_quote_open] }~#{ l_ch[:apostrophe] }\"\n )\n\n # Insert zero-width space after all elipses, emdashes, and hyphens.\n # This gives latex the option to break a line after these characters.\n # \\hspace{0pt} is the latex equivalent of zero-width space (​)\n line_breakable_chars = Regexp.escape(\n [l_ch[:elipsis], l_ch[:em_dash], '-'].join\n )\n # Exceptions: Don't insert zero-width space if followed by no-break characters:\n no_break_following_chars = Regexp.escape(\n [\n l_ch[:s_quote_close],\n l_ch[:d_quote_close],\n ')?,!',\n \"\\u00A0\", # non-breaking space\n \"\\u202F\", # narrow non-breaking space\n ].join\n )\n # We only want to allow linebreak _after_ line_breakable_chars but not _before_.\n # We insert a \\\\nolinebreak to prevent linebreaks _before_.\n lb.gsub!(\n /\n (?<lbc> # named capture group\n [#{ line_breakable_chars }]\n )\n (?! # not followed by one of the following options\n (\n [#{ no_break_following_chars }] # certain characters\n |\n #{ options[:ed_and_trn_abbreviations] } # language specific editor or translator abbreviations\n |\n \\\\RtLastEagle # last eagle latex command\n )\n )\n /ix,\n \"\\\\nolinebreak[4]\\\\k<lbc>\\\\hspace{0pt}\"\n )\n\n # When we adjust kerning in smallcaps emulation, the previous gsub!\n # inserts a \\\\nolinebreak[4]-\\\\hspace{0pt} between the opening brace\n # and the minus sign of either of any negative kerning values.\n # This gsub! undoes it. I chose to break it into a separate gsub! call\n # in order to keep the previous regex simpler:\n # Original latex:\n # T\\RtSmCapsEmulation{-0.1em}{EXT}\n # Modified by above gsub! to:\n # T\\RtSmCapsEmulation{\\nolinebreak[4]-\\hspace{0pt}0.1em}{EXT}\n # Here we revert it back to:\n # T\\RtSmCapsEmulation{-0.1em}{EXT}\n lb.gsub!(\"{\\\\nolinebreak[4]-\\\\hspace{0pt}\", \"{-\")\n\n # We don't allow linebreaks _before_ or _after_ an emdash when followed\n # by some abbreviations.\n lb.gsub!(\n /\n #{ l_ch[:em_dash] }\n (\n #{ options[:ed_and_trn_abbreviations] }\n )\n /ix,\n \"\\\\nolinebreak[4]\" + l_ch[:em_dash] + \"\\\\nolinebreak[4]\" + '\\1'\n )\n\n # We don't allow linebreaks before certain numbers:\n # `word 1` => `word~1`\n # lb.gsub!(/(?<=[a-z])\\s(?=\\d)/, \"~\")\n\n # We don't allow linebreaks between period and numbers:\n # `word .22` => `word .\\\\nolinebreak[4]22`\n lb.gsub!(/( \\.)(\\d)/, '\\1' + \"\\\\nolinebreak[4]\" + '\\2')\n\n # We don't allow linebreaks between the end of a control sequence and a period\n lb.gsub!(\"}.\", \"}\\\\nolinebreak[4].\")\n\n # We don't allow linebreaks between a hyphen and an ellipsis when\n # followed by a closing quote mark\n lb.gsub!(\n \"\\\\nolinebreak[4]-\\\\hspace{0pt}…#{ l_ch[:d_quote_close] }\",\n \"\\\\nolinebreak[4]-\\\\nolinebreak[4]…#{ l_ch[:d_quote_close] }\"\n )\n\n # We don't allow linebreaks between an ellipsis and the next word\n # when it is preceded by an opening quote mark\n lb.gsub!(\n \"#{ l_ch[:d_quote_open] }\\\\nolinebreak[4]…\\\\hspace{0pt}\",\n \"#{ l_ch[:d_quote_open] }\\\\nolinebreak[4]…\\\\nolinebreak[4]\"\n )\n\n # We don't allow linebreaks between chinese period and closing bracket\n lb.gsub!(\"。]\", \"。\\\\nolinebreak[4]]\")\n\n # Convert any zero-width spaces to latex equivalent\n lb.gsub!(/\\u200B/, \"\\\\hspace{0pt}\")\n end",
"def choices_as_text=(str)\n choice_values = str.split(\"\\n\").map { |s| s.strip }\n choice_values = choice_values.compact.uniq\n\n if choice_values.any?\n custom_attribute_choices.clear\n\n choice_values.each_with_index do |val, i|\n custom_attribute_choices.build(:value => val, :position => i)\n end\n end\n end",
"def line_one=(line_one)\n @line_one = line_one\n end",
"def validate\n @lines.select! do |line|\n line.include?(\"The configuration is\") || # success\n line.include?(\"Error: \") # error\n end\n end",
"def skip_newlines?\n @skip_newlines\n end",
"def split_lines\n text.split(/\\n/)\n end",
"def wrapped\n @lines.join(\"\\n\")\n end",
"def setWrap(bool)\n @textBox.wrap=bool\n self\n end",
"def normal_line(text)\n end",
"def with_line_numbers(y_n = true)\n alter do\n @with_line_numbers = y_n\n end\n end",
"def multiple?\n @multiple\n end",
"def accept_verbatim verbatim\n throw :done if @characters >= @character_limit\n input = verbatim.text.rstrip\n\n text = truncate input\n text << ' ...' unless text == input\n\n super RDoc::Markup::Verbatim.new text\n\n add_paragraph\n end",
"def with_line_numbers(y_n=true)\n alter do\n @with_line_numbers = y_n\n end\n end",
"def non_tabular_lines=(lines)\n @non_tabular_lines = lines.map.with_index do |line, i|\n NdrImport::NonTabular::Line.new(line, i)\n end\n end",
"def remove_lines(text)\n text.delete(\"\\n\")\n end",
"def line=(line)\n @parsed_rules.line = line if @parsed_rules\n super\n end",
"def accept_multiple_sets?\n return true\n end",
"def add_linebreaks(definition)\n definition.gsub(\"\\r\", '<br>')\nend",
"def wrap_text=(value)\n @wrap_text = value\n end",
"def max_lines\n (contents.width / line_height) - 1\n end",
"def set_html_message\n self.text = self.text.gsub(\"\\r\\n\", \"<br />\")\n end",
"def multiple *args\n @multiple = args.first if args.size > 0\n @multiple\n end",
"def attempt_multiline(message, &block)\n perform_action(message, true, nil, false, &block)\nend",
"def jagged_rows= new_jagged_rows\n frozen_check!\n @gapi.csv_options.allow_jagged_rows = new_jagged_rows\n end",
"def jagged_rows= new_jagged_rows\n frozen_check!\n @gapi.csv_options.allow_jagged_rows = new_jagged_rows\n end",
"def readline_support?\n false\n end",
"def html_line_breaks(rawText)\n rawText.gsub(/(?:\\n\\r?|\\r\\n?)/, '<br>').html_safe\n end",
"def line_ending=(value)\n @line_ending = value || \"\\r\\n\"\n end",
"def add_multiline_label(content = [], position = 0)\n opts = {}\n content.each_with_index do |options, i|\n options = DEFAULTS.merge(options)\n if i.zero?\n opts = options\n opts[:position] = position\n else\n opts[:skip] = true\n opts.merge!(options)\n end\n text = opts.delete(:text)\n opts = add_label(text, opts)\n end\n end",
"def update!(**args)\n @disable_nl_interpretation = args[:disable_nl_interpretation] if args.key?(:disable_nl_interpretation)\n @disable_supplemental_results = args[:disable_supplemental_results] if args.key?(:disable_supplemental_results)\n @enable_verbatim_mode = args[:enable_verbatim_mode] if args.key?(:enable_verbatim_mode)\n end",
"def allow_short_words\n not @emphasis[:ignore_short_words]\n end",
"def break_to_newline\n end",
"def convert_linebreaks(value)\n value.gsub(/(?:\\n\\r?|\\r\\n?)/, '<br/>').html_safe\n end",
"def break_to_newline\n end",
"def word_wrap(text, *args)\n options = extract_options_from_args!(args) || {}\n unless args.blank?\n options[:line_width] = args[0] || 80\n end\n options.reverse_merge!(:line_width => 80)\n\n text.split(\"\\n\").collect do |line|\n line.length > options[:line_width] ? line.gsub(/(.{1,#{options[:line_width]}})(\\s+|$)/, \"\\\\1\\n\").strip : line\n end * \"\\n\"\n end",
"def multi_line_match(multi_lines)\n (multi_lines.size - 2).downto(0) do |index_start|\n concat_line = multi_lines[index_start .. -1].join(JOINT_FOR_MULTI_LINES)\n return multi_lines[index_start .. -1].join(\"\\n\") if @re =~ concat_line\n end\n\n return nil\n end",
"def line_comments_option; end",
"def newline_format(options = {})\n content_tag 'span', options[:value].join('<br>'), nil, false\n end",
"def check_line(file_name, line_number, line_content)\n\t\tif (line_content.length > LONG_LINE_LENGTH) then\n\t\t\tadd_note(MsfLint::Note::WARNING, \"Line exceeding #{LONG_LINE_LENGTH.to_s} bytes\", line_number) \n\t\tend\n\tend",
"def supports_multiple?(type)\n rules_for_type(type).include?(:multiple)\n end",
"def check_line(file_name, line_number, line_content)\n\t\tif (line_content.length > LONG_LINE_LENGTH) then\n\t\t\tadd_note(LintWorm::Note::WARNING, \"Line exceeding #{LONG_LINE_LENGTH.to_s} bytes\", line_number) \n\t\tend\n\tend"
] | [
"0.7993178",
"0.62009764",
"0.56984085",
"0.56431687",
"0.5592195",
"0.5544511",
"0.54977125",
"0.53569794",
"0.53569794",
"0.53287387",
"0.53287387",
"0.53220814",
"0.52856916",
"0.52822673",
"0.5212219",
"0.5207211",
"0.50223595",
"0.5006243",
"0.5001838",
"0.49701497",
"0.4925696",
"0.49215072",
"0.49174732",
"0.49016613",
"0.4873341",
"0.48482436",
"0.48447272",
"0.4843224",
"0.48364207",
"0.48065186",
"0.48002082",
"0.47324902",
"0.4731612",
"0.47303605",
"0.47098956",
"0.46954596",
"0.4682904",
"0.46743423",
"0.46487036",
"0.46155003",
"0.4601069",
"0.45785433",
"0.456921",
"0.4558589",
"0.45366016",
"0.4536276",
"0.45124835",
"0.4497095",
"0.44970784",
"0.44717297",
"0.44672152",
"0.44337732",
"0.44324523",
"0.44243947",
"0.44243947",
"0.4406034",
"0.439606",
"0.43761665",
"0.43756887",
"0.43661237",
"0.43475375",
"0.43434724",
"0.4342687",
"0.43340605",
"0.43011346",
"0.4291344",
"0.4290495",
"0.42864534",
"0.42781588",
"0.42746684",
"0.42738476",
"0.4271337",
"0.4264178",
"0.42626593",
"0.42592263",
"0.4232143",
"0.42316422",
"0.422567",
"0.42148688",
"0.42138797",
"0.4211851",
"0.42091873",
"0.42075887",
"0.42075887",
"0.420691",
"0.42006284",
"0.41982296",
"0.41951084",
"0.41919965",
"0.4188696",
"0.41859508",
"0.41822928",
"0.41797185",
"0.41622648",
"0.41619778",
"0.4158342",
"0.41562194",
"0.41559744",
"0.41400358",
"0.4136906"
] | 0.88923717 | 0 |
Gets the appendChangesToExistingText property value. Whether updates to this column should replace existing text, or append to it. | def append_changes_to_existing_text
return @append_changes_to_existing_text
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_changes_to_existing_text=(value)\n @append_changes_to_existing_text = value\n end",
"def additional_text_edits\n attributes.fetch(:additionalTextEdits)\n end",
"def additional_text_edits\n attributes.fetch(:additionalTextEdits)\n end",
"def new_text\n return @new_text\n end",
"def appendtext(value)\n merge(appendtext: value.to_s)\n end",
"def old_text\n return @old_text\n end",
"def new_text=(value)\n @new_text = value\n end",
"def append(appended_text = '')\n @text << ' ' << appended_text\n end",
"def new_text\n attributes.fetch(:newText)\n end",
"def old_text=(value)\n @old_text = value\n end",
"def appendable?\n false\n end",
"def insert_text_mode\n attributes.fetch(:insertTextMode)\n end",
"def modified_existing?\n false\n end",
"def to_s\n\t\t\tcase status\n\t\t\twhen :new\n\t\t\t\t'+++'+text\n\t\t\twhen :old\n\t\t\t\t'---'+text\n\t\t\twhen :range\n\t\t\t\t'@@'+text\n\t\t\twhen :ins\n\t\t\t\t'+'+text\n\t\t\twhen :del\n\t\t\t\t'-'+text\n\t\t\twhen :other\n\t\t\t\t' '+text\n\t\t\tend\n\t\tend",
"def can_modify\n write_file( @output, read_file(@message).gsub(/[ ]/, \" modified text \") )\n end",
"def text_edit\n attributes.fetch(:textEdit)\n end",
"def text_edit\n attributes.fetch(:textEdit)\n end",
"def append(text, summary = nil, minor = true, bot = true)\n #require login\n @site.login\n puts text\n result = @site.query_prop_info(:titles => @normtitle, :intoken => 'edit')\n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(:title => @normtitle, :text => text, :token => token, :summary => summary, \n\t\t:minor => minor, :bot => bot, :appendtext => text)\n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\n end",
"def update_text_field(new_value)\n self.row.text_field.text = row_value.to_s\n end",
"def change_to_s(currentvalue, newvalue)\n if currentvalue == :absent\n return \"defined content as '#{newvalue}'\"\n elsif newvalue == :absent\n return \"undefined content from '#{currentvalue}'\"\n else\n return \"content changed '#{currentvalue}' to '#{newvalue}'\"\n end\n end",
"def new_clauses_text(changed_subsection) \n if !@array_of_new_clauses.empty?\n clauses_text_show(changed_subsection, 'added')\n end \n end",
"def compress_version_text\n self.text = changes[\"text\"].last if changes[\"text\"]\n self.text ||= self.journaled.text if self.journaled.text\n end",
"def get_columns_changeable_string\n if self.columns_changeable.blank?\n return ''\n else\n return (JSON.parse self.columns_changeable).join(', ')\n end\n end",
"def has_updates?\n self['newUpdatesFlag']\n end",
"def existing_mode?\n flag? Flags::REPLICATE_EXISTING\n end",
"def updatable?\n true\n end",
"def insert_text\n attributes.fetch(:insertText)\n end",
"def save_changes\n save(:changed=>true) || false unless @changed_columns.empty?\n end",
"def get_last_change\n lastChange ? 'Si' : 'No'\n end",
"def write_txt\n true\n end",
"def mode\n append ? 'a' : 'w'\n end",
"def overwriteText cursor, text\n if cursor.isAtEOL? or cursor.isAtEOF?\n insertText cursor, text\n else\n overwrite cursor, text\n end\n end",
"def update_text_field(new_value)\n self.row.text_field.text = row_value\n end",
"def text\n return @edit_line.text\n end",
"def update_message\n changes = @headlines - @existing_headlines\n result = changes.empty? ? '' : \"#{changes.size} new/changed headlines\"\n\n before = @existing_headlines & @headlines\n after = @headlines & @existing_headlines\n if before != after\n result += ', ' if not result.empty?\n result += 'existing headlines reordered'\n end\n return result.empty? ? nil : result\n end",
"def append(row,text)\n\t\t@text[row] = @text[row].dup\n\t\t@text[row] += text\n\tend",
"def dirty?\n @changes.length > 0\n end",
"def text=(x)\n self << x.to_s\n end",
"def protect_update\n unless self.changes.keys == [\"text\"] && self.changes[\"text\"].first.blank?\n raise ActiveRecord::ReadOnlyRecord\n end\n end",
"def overwrite c, text\n pos = text =~ /\\n/\n unless pos\n if text.size > @fileContent[c.line][c.column, @fileContent[c.line].size].size\n @fileContent[c.line] = @fileContent[c.line][0, c.column] + text\n else\n @fileContent[c.line] = @fileContent[c.line][0, c.column] +\n text + @fileContent[c.line][c.column + text.size,\n @fileContent[c.line].size]\n end\n c.moveToColumn c.column + text.size\n else\n if @fileContent[c.line][c.column, @fileContent[c.line].size].size > pos\n nbToDelete = text[pos, text.size].count \"^\\n\"\n insertText c, text\n deleteTextDelete c, nbToDelete\n else\n @fileContent[c.line] = @fileContent[c.line][0, c.column] + text[0, pos]\n c.moveToColumn c.column + pos\n insertText c, text[pos, text.size]\n end\n end\n end",
"def exists?\n @text_field.exists?\n end",
"def sql_diff_text_log\n @sql_diff_text_log ||= ''\n end",
"def sql_diff_text_log\n @sql_diff_text_log ||= ''\n end",
"def text\n # .dup is required because the String is frozen.\n mark(@doc.text.first.dup)\n end",
"def difftotext(value)\n merge(rvdifftotext: value.to_s)\n end",
"def changed_for_autosave?\n new_record? || has_changes_to_save? || marked_for_destruction? || nested_records_changed_for_autosave?\n end",
"def dirty?\n @changes && @changes.size > 0\n end",
"def add_text\n return '' unless @selector.key?(:text)\n\n text = @selector.delete :text\n if !text.is_a?(Regexp)\n \"[normalize-space()='#{text}' or @value='#{text}']\"\n elsif simple_regexp?(text)\n \"[contains(text(), '#{text.source}') or contains(@value, '#{text.source}')]\"\n else\n @selector[:text] = text\n ''\n end\n end",
"def adv_search_set_text\n if @edit[@expkey].history.idx.zero? # Are we pointing at the first exp\n @edit[:adv_search_applied][:text] = if @edit[:new_search_name]\n _(\" - Filtered by \\\"%{text}\\\"\") % {:text => @edit[:new_search_name]}\n else\n _(\" - Filtered by \\\"%{text}\\\" report\") %\n {:text => @edit[:adv_search_report]}\n end\n else\n @edit[:custom_search] = true\n @edit[:adv_search_applied][:text] = _(\" - Filtered by custom search\")\n end\n end",
"def append_version?\n !!@append_version\n end",
"def clause_line_text_altered(changed_clause, action)\n\n @altered_lines = Change.where('project_id = ? AND clause_id = ? AND revision_id = ? AND event = ? AND linetype_id > ?', @current_project.id, changed_clause.id, @selected_revision.id, action, 2).order('specline_id')\n if !@altered_lines.blank? \n check_added_print_status = @altered_lines.collect{|item| item.print_change}.uniq\n if check_added_print_status.include?(true) \n \"<table><tr id='#{changed_clause.id.to_s}'><td class='rev_subtitle'>Text #{action}:</td></tr></table>\".html_safe\n else\n \"<table><tr id='#{changed_clause.id.to_s}'><td class='rev_subtitle_strike'>Text #{action}:</td></tr></table>\".html_safe\n end\n end\n end",
"def has_changes?\n @has_updated || @has_created\n end",
"def new_line?\n self[:value] ||= {}\n @new_line ||= multi_value? && CustomFields::CheckBox.true_or_false?(self[:value][:new_line])\n end",
"def has_changes?\n (@edited_rows_codes.count > 0) || (@destroyed_rows_codes.count > 0)\n end",
"def update( text )\n text\n end",
"def saved_changes?\n mutations_before_last_save.any_changes?\n end",
"def last_text\n last_ele TEXT_VIEW\n end",
"def modified?\n\t\treturn @dirty ? true : false\n\tend",
"def modified?\n new? || @content\n end",
"def update_message\n return @num_new_notes != 0 ? \"#{@num_new_notes} new footnotes\" : nil\n end",
"def add_log_text(text)\n self.log_text = \"\" if self.log_text.nil?\n self.log_text += text + \"\\n\"\n end",
"def text(value)\n merge(text: value.to_s)\n end",
"def changed?\n if update_type == :no_change\n false\n else\n true\n end\n end",
"def text_edit_text\n attributes.fetch(:textEditText)\n end",
"def rich_text_attribute; end",
"def has_changes?\n @has_changed_the_db\n end",
"def update_or_add_value(value_name, text, append: true, hide: false, heading: nil)\n start_mark = \"<!--#{value_name}-->\"\n end_mark = \"<!--end-#{value_name}-->\"\n\n if issue_body_has?(value_name)\n update_body(start_mark, end_mark, text)\n else\n if hide\n value_heading = \"\"\n elsif heading.nil?\n value_heading = \"**#{value_name.capitalize.gsub(/[_-]/, \" \")}:** \"\n else\n value_heading = \"**#{heading}:** \"\n end\n\n if append\n append_to_body \"\\n#{value_heading}#{start_mark}#{text}#{end_mark}\"\n else\n prepend_to_body \"#{value_heading}#{start_mark}#{text}#{end_mark}\\n\"\n end\n end\n end",
"def emit_text value\n # don't bother emitting empty strings\n return if value.empty?\n\n # combine adjacent statements to reduce code size\n if prev = insertion_point.last and prev.type == :text\n prev.value << value\n else\n statement :text, value\n end\n end",
"def modified?(column=nil)\n if column\n changed_columns.include?(column)\n else\n @modified || !changed_columns.empty?\n end\n end",
"def modified?(column=nil)\n if column\n changed_columns.include?(column)\n else\n @modified || !changed_columns.empty?\n end\n end",
"def append(text); end",
"def has_text?; end",
"def changed_for_autosave?(doc)\n doc.new_record? || doc.changed? || doc.marked_for_destruction?\n end",
"def append text\n raise \"append: deprecated pls use << or push as per Array semantics\"\n @list ||= []\n @list.push text\n fire_dimension_changed :append\n self\n end",
"def replaced_text\n affected_lines_before[column..(column + length - 1)]\n end",
"def text\n @text.join('')\n end",
"def returnModified\n @modified\n end",
"def button_value\n if new_record?\n 'Добавить'\n else\n 'Изменить' \n end\n end",
"def saved_version_changes?\n track_altered_attributes ? (version_if_changed - saved_changes.keys).length < version_if_changed.length : saved_changes? # rubocop:disable Layout/LineLength\n end",
"def text(cell_value)\n texts(cell_value).join(', ')\n end",
"def text_document_sync\n attributes.fetch(:textDocumentSync)\n end",
"def uses_clob_for_text?\n false\n end",
"def write?\n return true unless added.zero?\n return false unless update?\n !(updated + removed).zero?\n end",
"def should_to_s(newvalue = @should)\n if @latest\n @latest.to_s\n else\n super(newvalue)\n end\n end",
"def should_to_s(newvalue = @should)\n if @latest\n @latest.to_s\n else\n super(newvalue)\n end\n end",
"def changed?\n raw?\n end",
"def text(cell_value)\n apply_format(cell_value, format, option.merge(:delimiter => '')).to_s\n end",
"def updatable\n can_update?\n end",
"def is_dirty?\n return true if options[:dirty] == true\n return false\n end",
"def columns_changeable_string\n if columns_changeable.blank?\n ''\n else\n JSON.parse(columns_changeable).join(', ')\n end\n end",
"def update(text)\n text\n end",
"def equal(operation)\n @content << operation.new_text\n end",
"def has_changes_to_save?\n mutations_from_database.any_changes?\n end",
"def text\n @text_utf8 ||= read_attribute(:text).dup.force_encoding(Encoding::UTF_8)\n end",
"def value_add_to_migration\n 'always'\n end",
"def edited?\n @description =~ /^[^\"].*edited \"/\n end",
"def append!\n self.operation = :append\n end",
"def value_on_new_line?\n key.loc.line != value.loc.line\n end",
"def updated?\n return @_updated\n end",
"def include?(msg)\n @changes.include? msg\n end"
] | [
"0.72567743",
"0.58929497",
"0.58929497",
"0.5761123",
"0.55316764",
"0.54123366",
"0.53945076",
"0.53904986",
"0.5349387",
"0.532613",
"0.5142969",
"0.50899434",
"0.50684637",
"0.50627446",
"0.4886818",
"0.47832555",
"0.47832555",
"0.47768778",
"0.47673687",
"0.4765066",
"0.47639176",
"0.47267154",
"0.47216856",
"0.46690488",
"0.46573737",
"0.46524322",
"0.4609892",
"0.4594348",
"0.45882115",
"0.4583819",
"0.45781478",
"0.45591387",
"0.45342436",
"0.45275658",
"0.4517976",
"0.45155177",
"0.45137703",
"0.45049313",
"0.45034236",
"0.4482539",
"0.44730145",
"0.4471592",
"0.4471592",
"0.44673488",
"0.44654486",
"0.44619003",
"0.44555944",
"0.44418636",
"0.44340277",
"0.44328797",
"0.44300234",
"0.44145796",
"0.44142103",
"0.44120726",
"0.44021314",
"0.43950802",
"0.4389313",
"0.4386064",
"0.4385538",
"0.4378687",
"0.43775156",
"0.43688706",
"0.43581524",
"0.43535635",
"0.43528283",
"0.43394065",
"0.43387032",
"0.433797",
"0.43355906",
"0.43355906",
"0.43271092",
"0.43263513",
"0.43262804",
"0.43237314",
"0.43207818",
"0.43179023",
"0.43122664",
"0.43045107",
"0.42973354",
"0.4290814",
"0.42826736",
"0.42768204",
"0.4274194",
"0.42684218",
"0.42684218",
"0.4267874",
"0.42645976",
"0.42516118",
"0.42506376",
"0.4250523",
"0.42502335",
"0.42416614",
"0.42369506",
"0.4236327",
"0.42324165",
"0.42318064",
"0.42288235",
"0.42280728",
"0.42259523",
"0.42234176"
] | 0.75926095 | 0 |
Sets the appendChangesToExistingText property value. Whether updates to this column should replace existing text, or append to it. | def append_changes_to_existing_text=(value)
@append_changes_to_existing_text = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def append_changes_to_existing_text\n return @append_changes_to_existing_text\n end",
"def append(appended_text = '')\n @text << ' ' << appended_text\n end",
"def appendtext(value)\n merge(appendtext: value.to_s)\n end",
"def new_text=(value)\n @new_text = value\n end",
"def old_text=(value)\n @old_text = value\n end",
"def overwriteText cursor, text\n if cursor.isAtEOL? or cursor.isAtEOF?\n insertText cursor, text\n else\n overwrite cursor, text\n end\n end",
"def overwrite c, text\n pos = text =~ /\\n/\n unless pos\n if text.size > @fileContent[c.line][c.column, @fileContent[c.line].size].size\n @fileContent[c.line] = @fileContent[c.line][0, c.column] + text\n else\n @fileContent[c.line] = @fileContent[c.line][0, c.column] +\n text + @fileContent[c.line][c.column + text.size,\n @fileContent[c.line].size]\n end\n c.moveToColumn c.column + text.size\n else\n if @fileContent[c.line][c.column, @fileContent[c.line].size].size > pos\n nbToDelete = text[pos, text.size].count \"^\\n\"\n insertText c, text\n deleteTextDelete c, nbToDelete\n else\n @fileContent[c.line] = @fileContent[c.line][0, c.column] + text[0, pos]\n c.moveToColumn c.column + pos\n insertText c, text[pos, text.size]\n end\n end\n end",
"def <<(text_element)\n self.text_elements << text_element\n self.merge!(text_element)\n end",
"def add_log_text(text)\n self.log_text = \"\" if self.log_text.nil?\n self.log_text += text + \"\\n\"\n end",
"def additional_text_edits\n attributes.fetch(:additionalTextEdits)\n end",
"def additional_text_edits\n attributes.fetch(:additionalTextEdits)\n end",
"def append(row,text)\n\t\t@text[row] = @text[row].dup\n\t\t@text[row] += text\n\tend",
"def update_text_field(new_value)\n self.row.text_field.text = row_value.to_s\n end",
"def adv_search_set_text\n if @edit[@expkey].history.idx.zero? # Are we pointing at the first exp\n @edit[:adv_search_applied][:text] = if @edit[:new_search_name]\n _(\" - Filtered by \\\"%{text}\\\"\") % {:text => @edit[:new_search_name]}\n else\n _(\" - Filtered by \\\"%{text}\\\" report\") %\n {:text => @edit[:adv_search_report]}\n end\n else\n @edit[:custom_search] = true\n @edit[:adv_search_applied][:text] = _(\" - Filtered by custom search\")\n end\n end",
"def append(text, summary = nil, minor = true, bot = true)\n #require login\n @site.login\n puts text\n result = @site.query_prop_info(:titles => @normtitle, :intoken => 'edit')\n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(:title => @normtitle, :text => text, :token => token, :summary => summary, \n\t\t:minor => minor, :bot => bot, :appendtext => text)\n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\n end",
"def text=(new_text)\n @text = new_text\n refresh\n update_cursor\n end",
"def update_text_field(new_value)\n self.row.text_field.text = row_value\n end",
"def append(text); end",
"def new_text\n return @new_text\n end",
"def merge!(other)\n raise TypeError, \"argument is not a TextElement\" unless other.instance_of?(TextElement)\n\n if (self <=> other) < 0\n self.text = other.text + self.text\n else\n self.text << other.text\n end\n super(other)\n end",
"def append text\n raise \"append: deprecated pls use << or push as per Array semantics\"\n @list ||= []\n @list.push text\n fire_dimension_changed :append\n self\n end",
"def text=(x)\n self << x.to_s\n end",
"def add_text_output_options(opt)\n opt.on(\"--wrap-at=X\", Integer,\n \"Wraps table after X's character (no wrap by default)\") do |x|\n io_options[:text][:wrap_at] = x\n end\n opt.on(\"--truncate-at=X\", Integer,\n \"Truncate row lines at X character\") do |x|\n io_options[:text][:truncate_at] = x\n io_options[:text][:append_with] = '...'\n end\n end",
"def can_modify\n write_file( @output, read_file(@message).gsub(/[ ]/, \" modified text \") )\n end",
"def master_text_changed(master_text)\n master_text.localized_texts.where(needs_entry: false).update_all(needs_review: true)\n end",
"def text(text)\n @document.add_text(text)\n end",
"def append_output(text)\n EM.next_tick do\n @buffer << text\n if @buffer.size > MIN_AUDIT_SIZE\n flush_buffer\n else\n reset_timer\n end\n end\n end",
"def _append_text(str)\n\t\tif(str != '')\n\t\t\tif(!@contents || !@contents[@content_index].is_a?(String))\n\t\t\t\t@content_index += 1\n\t\t\t\t@contents[@content_index] = ''\n\t\t\tend\n\t\t\t@contents[@content_index] += str.to_s\n\t\tend\n\tend",
"def append_to_body(text)\n @issue_body = issue_body + text\n update_issue({ body: @issue_body })\n end",
"def new_text\n attributes.fetch(:newText)\n end",
"def appendable?\n false\n end",
"def add_text\n return '' unless @selector.key?(:text)\n\n text = @selector.delete :text\n if !text.is_a?(Regexp)\n \"[normalize-space()='#{text}' or @value='#{text}']\"\n elsif simple_regexp?(text)\n \"[contains(text(), '#{text.source}') or contains(@value, '#{text.source}')]\"\n else\n @selector[:text] = text\n ''\n end\n end",
"def new_clauses_text(changed_subsection) \n if !@array_of_new_clauses.empty?\n clauses_text_show(changed_subsection, 'added')\n end \n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def update!(**args)\n @text = args[:text] if args.key?(:text)\n end",
"def append_text(content)\n temp_text_ele = @text_ele.clone\n temp_text_ele.elements[1].content = content\n last_para = @main_doc.xpath('.//w:p')[-1]\n last_para.add_child(temp_text_ele)\n end",
"def modified_existing?\n false\n end",
"def text=(val)\n return unless val # added 2010-11-17 20:11, dup will fail on nil\n # will bomb on integer or float etc !!\n #_set_buffer(val.dup)\n _set_buffer(val)\n end",
"def set_text( *args )\n value = args.pop\n elements = args\n\n value_node = build_document_tree( elements )\n modified_node = build_document_tree( elements, self.modified_document ) if self.modified_document\n\n value_node.text = value\n modified_node.text = value if self.modified_document\n end",
"def insert_text_mode\n attributes.fetch(:insertTextMode)\n end",
"def update!(**args)\n @is_text_to_speech_supported = args[:is_text_to_speech_supported] if args.key?(:is_text_to_speech_supported)\n end",
"def write_to_file file, *text\n text.flatten!\n\n File.open(File.expand_path(file), 'a+') do |file|\n full_text = (text * \"\\n\") + \"\\n\"\n\n unless file.read.include? full_text\n file.write full_text\n end\n end\n end",
"def write text\n\t\t@search_text = @line.text = text\n\tend",
"def append(filename, text)\n File.open(filename,\"a\") {|f| f << text + \"\\n\"}\n end",
"def append(filename, text)\n File.open(filename,\"a\") {|f| f << text + \"\\n\"}\n end",
"def update!(**args)\n @changed_text = args[:changed_text] if args.key?(:changed_text)\n @provenance = args[:provenance] if args.key?(:provenance)\n @text_anchor = args[:text_anchor] if args.key?(:text_anchor)\n end",
"def write_txt\n true\n end",
"def append!\n self.operation = :append\n end",
"def add_after_or_append(filename, matching_text, text_to_add, before_text, after_text)\n content = File.read(filename)\n if content.include?(matching_text)\n add_after(filename, matching_text, text_to_add)\n else\n append_file(filename, [before_text, text_to_add, after_text].join(\"\\n\"))\n end\n end",
"def _text(text)\n @target << text\n end",
"def replace_text(text)\n @txt .set_editable(true) # .freeze\n @txt .buffer .set_text(\"\")\n# hdr, value = text .split(\"\\n\\n\", 2)\n# hdr .to_s .each_line{|line|\n# case line\n# when /^Subject:/ ;color = BLUE\n# when /^X-SC-Subject:/ ;color = BLUE\n# when /^From:/ ;color = PURPLE\n# #when /^To:|Cc:/ ;color = ORANGE\n# #when /^Date:/ ;color = GREEN\n# when /^X-SC-(Time|Day):/ ;color = RED\n# else ;color = BLACK\n# end\n# @txt .insert(nil, color, nil, line) if line != ''\n# }\n# @txt .insert(nil, RED, WHITE, hdr .to_s)\n# @txt .insert(nil, BLACK, nil, \"\\n\\n\" + value .to_s)\n\n @txt .buffer .insert(@txt.buffer.start_iter, MhcKconv::todisp(text))\n @txt .set_editable(@text_editable) #.thaw\n end",
"def overwrite!\n @overwrite = true\n end",
"def update_document\n if searchables\n text = searchable_values.flatten.join(' ')\n return document.update_attribute(:search_text, text) if document\n create_document(search_text: text)\n end\n end",
"def append(document)\n with_add_callbacks(document, already_related?(document)) do\n _target.push(document)\n characterize_one(document)\n bind_one(document)\n end\n end",
"def text=(value)\n self.excerpt = value\n end",
"def text=(text)\n\t\tend",
"def text=(text)\n @text = normalize_text text\n self.key= @original_key if @original_key\n end",
"def search_for_content=(text)\n self.text_field(:class=>\"newaddcontent_existingitems_search\").set(\"#{text}\\n\")\n end",
"def display_text=(value)\n @display_text = value\n end",
"def compress_version_text\n self.text = changes[\"text\"].last if changes[\"text\"]\n self.text ||= self.journaled.text if self.journaled.text\n end",
"def text=(text)\n end",
"def update_raw_text(item)\n raw_text = +''\n\n append_text = lambda do |child|\n if child.type == :text\n raw_text << child.value\n else\n child.children.each {|c| append_text.call(c) }\n end\n end\n\n append_text.call(item)\n item.options[:raw_text] = raw_text\n end",
"def protect_update\n unless self.changes.keys == [\"text\"] && self.changes[\"text\"].first.blank?\n raise ActiveRecord::ReadOnlyRecord\n end\n end",
"def update!(**args)\n @text_redaction_mode = args[:text_redaction_mode] if args.key?(:text_redaction_mode)\n end",
"def quoted_newlines= new_quoted_newlines\n frozen_check!\n @gapi.csv_options.allow_quoted_newlines = new_quoted_newlines\n end",
"def quoted_newlines= new_quoted_newlines\n frozen_check!\n @gapi.csv_options.allow_quoted_newlines = new_quoted_newlines\n end",
"def add(text)\n @text << text\n end",
"def text=(value)\n # Value is frozen to prevent modification without updating the text on the\n # widget (i.e. mutation must be through this method)\n @text = value.clone.freeze\n\n gtk_instance.text = text\n end",
"def append_to_log_file( data_import_session, text )\n full_pathname = log_full_pathname( data_import_session )\n File.open( full_pathname, 'a+' ) do |f|\n f.puts( text )\n end if Rails.env != 'test' # (Avoid creating thousands of files during specs running)\n end",
"def add_text(text); end",
"def old_text\n return @old_text\n end",
"def save_changes\n save(:changed=>true) || false unless @changed_columns.empty?\n end",
"def append_tags\n self.text += (\" \"+self.tag_string) if !self.tag_string.blank?\n true\n end",
"def append_tags\n self.text += (\" \"+self.tag_string) if !self.tag_string.blank?\n true\n end",
"def add_plaintext(current_string)\n log_hint(BuilderHints::PLAINTEXT_FLAG) if @plaintext.present?\n add_if_present(@plaintext, current_string, \" -plaintext \")\n end",
"def clause_line_text_altered(changed_clause, action)\n\n @altered_lines = Change.where('project_id = ? AND clause_id = ? AND revision_id = ? AND event = ? AND linetype_id > ?', @current_project.id, changed_clause.id, @selected_revision.id, action, 2).order('specline_id')\n if !@altered_lines.blank? \n check_added_print_status = @altered_lines.collect{|item| item.print_change}.uniq\n if check_added_print_status.include?(true) \n \"<table><tr id='#{changed_clause.id.to_s}'><td class='rev_subtitle'>Text #{action}:</td></tr></table>\".html_safe\n else\n \"<table><tr id='#{changed_clause.id.to_s}'><td class='rev_subtitle_strike'>Text #{action}:</td></tr></table>\".html_safe\n end\n end\n end",
"def update!(**args)\n @raw_text = args[:raw_text] if args.key?(:raw_text)\n end",
"def addText(parameters = {})\n options = { text: '', # the text to add\n index: -1, # where to add it (beginning=0, ending=-1, etc)\n scroll: 'false' # scroll to show added text?\n }.merge(parameters)\n someText = options[:text]\n someIndex = options[:index].to_i\n someIndex = @textView.string.length + someIndex + 1 if someIndex < 0\n unless someIndex > @textView.string.length || someText == '' # nothing to add\n if someText.class.to_s.end_with?('AttributedString')\n @textView.textStorage.replaceCharactersInRange( [someIndex, 0],\n withAttributedString: someText)\n else # regular string\n @textView.replaceCharactersInRange( [someIndex, 0],\n withString: someText)\n end\n scrolling = %w[true yes 1].include?(options[:scroll].to_s.downcase)\n @textView.scrollRangeToVisible([someIndex, someText.length]) if scrolling\n end\n @textView.string\n end",
"def add_error_text(text)\n self.error_text = \"\" if self.error_text.nil?\n self.error_text += text + \"\\n\"\n end",
"def append_newline\n buffer << \"\\n\"\n @current_line_length = 0\n end",
"def text= t\n self.criterion_type = \"text\"\n write_attribute \"text\", t\n end",
"def update( text )\n text\n end",
"def input_model_text(new_text)\n pending(\"proper input text method that triggers all normal events\")\n fail\n end",
"def merge_texts!(hash, element)\n unless element.has_text?\n hash\n else\n # must use value to prevent double-escaping\n texts = +\"\"\n element.texts.each { |t| texts << t.value }\n merge!(hash, CONTENT_KEY, texts)\n end\n end"
] | [
"0.7114637",
"0.57877344",
"0.5679415",
"0.558914",
"0.5397085",
"0.5391201",
"0.50902903",
"0.5037438",
"0.49652958",
"0.48512244",
"0.48512244",
"0.48472497",
"0.48314473",
"0.48263013",
"0.4817114",
"0.4730583",
"0.47024634",
"0.46789056",
"0.4633324",
"0.4630135",
"0.4629878",
"0.46133435",
"0.45642236",
"0.45458692",
"0.4521219",
"0.45203486",
"0.4512262",
"0.45085353",
"0.4501922",
"0.44588625",
"0.44511473",
"0.4443647",
"0.44299662",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44286418",
"0.44284213",
"0.44022954",
"0.43932432",
"0.4387406",
"0.43810678",
"0.43667752",
"0.43505582",
"0.43426746",
"0.43301055",
"0.42985776",
"0.42985776",
"0.42905188",
"0.42831114",
"0.4269624",
"0.4267167",
"0.42668375",
"0.4264128",
"0.42605767",
"0.4259753",
"0.42381072",
"0.4224102",
"0.42204428",
"0.42178303",
"0.42017618",
"0.41983002",
"0.41938242",
"0.41854998",
"0.41788867",
"0.41728297",
"0.41684693",
"0.41645893",
"0.41645893",
"0.41616148",
"0.41578594",
"0.41415417",
"0.41287497",
"0.41257706",
"0.41247252",
"0.4113379",
"0.4113379",
"0.41117862",
"0.4105806",
"0.40874588",
"0.40819257",
"0.40757027",
"0.40742895",
"0.4072329",
"0.40651977",
"0.40651777",
"0.4062692"
] | 0.7766487 | 0 |
Instantiates a new textColumn and sets the default values. | def initialize()
@additional_data = Hash.new
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def initialize(text, line, column)\n @text = text\n @line = line\n @column = column\n end",
"def initialize(text, line, column)\n @text = text\n @line = line\n @column = column\n end",
"def set_column (text, data_index, filter=nil, xtype=nil, tpl=nil, renderer=nil)\n\t\tcolumnHash = {\n\t\t\t'text' => '', 'dataIndex' => '',\n\t\t\t'hidden' => false,\n\t\t\t'filter' => {'type' => 'string'},\n\t\t\t'width' => 110\n\t\t}\n\n\t\tcolumnHash['text'] = text\n\t\tcolumnHash['dataIndex'] = data_index\n\t\tcolumnHash['filter'] = filter unless filter.nil?\n\t\tunless xtype.nil?\n\t\t\tcolumnHash['xtype'] = xtype\n\t\t\tunless tpl.nil?\n\t\t\t\tcolumnHash['tpl'] = tpl\n\t\t\tend\n\t\tend\n\n\t\tif renderer.nil? == false\n\t\t\tcolumnHash['renderer'] = renderer\n\t\tend\n\t\tcolumnHash\n\tend",
"def initialize text=\" \", **kwargs\n @color = kwargs[:color] || [0,0,0]\n @font = kwargs[:font] || Default\n self.text= text\n end",
"def initialize(text, length_to_display = 20)\n @length_to_display = length_to_display\n @text = text\n end",
"def initialize(text,options={ :align=>:show_left, :tag => :default_font, :color => 0 } )\n @text = text\n @options=DEFAULT_OPTIONS.dup.merge(options)\n end",
"def initialize(text = \"\")\n @text = text\n end",
"def initialize config={}, &block\n @buffer = String.new\n @row = 0\n @col = 0\n @editable = true\n @focusable = true\n \n map_keys \n init_vars\n register_events(:CHANGE)\n super\n @width ||= 20\n @maxlen ||= @width\n end",
"def initialize\n # Since we want the ProfessionalLife model to be a proper ActiveRecord class,\n # we need to call the initialize function of the superclass first\n super \n \n ALL_TEXT_FIELDS.each do |field|\n self[field] = \"\"\n end\n end",
"def default_values\r\n self.column_position = number_of_columns\r\n end",
"def augment_column_config(c)\n super\n set_default_data_index(c)\n set_default_xtype c\n end",
"def insert_text(row, column, text, style = CharacterStyle.default)\n text.each_char do |char|\n self[row][column] = Character.new(char, style)\n column += 1\n end\n self\n end",
"def initialize(text = '', **options, &block)\n super(Gtk::Entry.new, **options, &block)\n self.text = text\n end",
"def initialize(name, text)\r\n super(name)\r\n @text = text.to_s\r\n end",
"def init\n initialize_columns\n load_default_behaviors # load default behaviors here rather than in application code\n\n cell_editable\n column_sortable\n\n apply_default_config\n end",
"def initialize(text_node)\n Hatemile::Helper.require_not_nil(text_node)\n Hatemile::Helper.require_valid_type(text_node, Nokogiri::XML::Text)\n\n @data = text_node\n init(text_node, self)\n end",
"def initialize(text)\n @text = text\n end",
"def test_new_with_hash_nil_cols\n # Initialize JTable and model\n nhk_word_table = JTable.new\n\n assert_raise(ArgumentError) do\n nhk_word_table.model = {:rows => [[\"1\", \"ないわ~\"], [\"2\", \"格好いい\"]]}\n end\n end",
"def initialize_defaults\n %w(show_first_column show_last_column show_row_stripes show_column_stripes).each do |attr|\n send(\"#{attr}=\", 0)\n end\n end",
"def initialize\n @text = \"\"\n end",
"def test_mysql_text_not_null_defaults_non_strict\n using_strict(false) do\n with_text_blob_not_null_table do |klass|\n assert_equal '', klass.columns_hash['non_null_blob'].default\n assert_equal '', klass.columns_hash['non_null_text'].default\n\n assert_nil klass.columns_hash['null_blob'].default\n assert_nil klass.columns_hash['null_text'].default\n\n instance = klass.create!\n\n assert_equal '', instance.non_null_text\n assert_equal '', instance.non_null_blob\n\n assert_nil instance.null_text\n assert_nil instance.null_blob\n end\n end\n end",
"def initialize(initial_hash = nil)\n super\n @optional_method_names = %i[textEdit additionalTextEdits]\n end",
"def column(name, type, options = {})\n def_accessors(name)\n set_attribute_default(name, options[:default])\n end",
"def initialize(parent = nil, name = nil) \n\t\tsuper(parent, name)\n\t\tviewport.set_w_flags(Qt::WNoAutoErase | Qt::WStaticContents)\n\t\tset_static_background(true)\n\n\t\t@invalid_rows = []\n\t\n\t\t@model = TextModel.new()\n\t\[email protected]_first_line_in_view_handler { first_line_in_view }\n\t\[email protected]_last_line_in_view_handler { last_line_in_view }\n\t\[email protected]_changed_handler { |invalid_rows| @invalid_rows = invalid_rows; repaint_contents(false) }\n\n\t\tset_enabled(true)\n\t\tset_focus_policy(Qt::Widget::StrongFocus)\n\n\t\tresize(500, 500)\n\tend",
"def initialize(text)\n @text = text\n end",
"def initialize(text)\n @text = text\n end",
"def after_initialize\n @type = :text\n\n @length ||= value.length\n end",
"def initialize(title=\"\")\n self.cell = title if title.is_a?(Cell)\n self.text = title.to_s unless title.is_a?(Cell)\n end",
"def initialize(type,text)\n\t\t@type = type\n\t\t@text = text\n\tend",
"def text_field(name, value = nil, options = {})\n\t\t\tset_class(options)\n\t\t\tsuper\n\t\tend",
"def initialize(text, options = {})\n super options\n @text = text\n end",
"def create_table(table_name, *args, **kwargs, &block)\n helper_context = self\n\n super do |t|\n t.define_singleton_method(:text) do |column_name, **kwargs|\n limit = kwargs.delete(:limit)\n\n super(column_name, **kwargs)\n\n if limit\n # rubocop:disable GitlabSecurity/PublicSend\n name = helper_context.send(:text_limit_name, table_name, column_name)\n # rubocop:enable GitlabSecurity/PublicSend\n\n column_name = helper_context.quote_column_name(column_name)\n definition = \"char_length(#{column_name}) <= #{limit}\"\n\n t.check_constraint(definition, name: name)\n end\n end\n\n t.instance_eval(&block) unless block.nil?\n end\n end",
"def initialize(type,text)\r\n\t\t@type = type\r\n\t\t@text = text\r\n\tend",
"def initialize\n @columns = []\n @columns_lookup = []\n @rows = []\n @newline = \"\\r\\n\"\n end",
"def set_default_contents(text)\n @default_contents = text\n end",
"def text=(text)\n end",
"def initialize(chars_max=0, default=nil)\n @chars_max = (chars_max == 0 ? 1000 : chars_max)\n @char_widths = calculate_char_widths\n @cursor_width = CURSOR_WIDTH\n super(0, 0, 480, 64)\n self.contents = Bitmap.new(width - 32, height - 32)\n self.z += 9999\n self.opacity = 0\n @cursor_x = 0\n @text = Array.new\n if default != nil\n for i in 0...default.size\n @text[i] = default[i].chr\n @cursor_x += @char_widths[@text[i]]\n end\n @index = @text.size\n else\n @index = 0\n end\n @last_text = @text.clone\n refresh\n update_cursor_rect\n end",
"def initialize text=\"\", config={}, &block\n @text = text\n @editable = false\n @focusable = false\n config_setup config # @config.each_pair { |k,v| variable_set(k,v) }\n instance_eval &block if block_given?\n init_vars\n end",
"def initialize text=\"\", config={}, &block\n @text = text\n @editable = false\n @focusable = false\n config_setup config # @config.each_pair { |k,v| variable_set(k,v) }\n instance_eval &block if block_given?\n init_vars\n end",
"def initialize text=\"\", config={}, &block\n @text = text\n @editable = false\n @focusable = false\n config_setup config # @config.each_pair { |k,v| variable_set(k,v) }\n instance_eval &block if block_given?\n init_vars\n end",
"def initialize(type,text)\n @type = type\n @text = text\n end",
"def init(max_size, empty_char = '_', on_new_char: nil, on_remove_char: nil)\n @current_text = ''\n @max_size = max_size.abs\n @empty_char = empty_char\n @on_new_char = on_new_char\n @on_remove_char = on_remove_char\n load_text(text)\n end",
"def text=(text)\n\t\tend",
"def initialize width, options = nil\n @width = width\n @value, options = options, {} unless Hash === options\n @value = options.fetch :value, value\n @alignment = options.fetch :alignment, :left\n @text_color = options.fetch :text_color, nil#:white\n @text_style = options.fetch :text_style, nil#:plain\n @background_color = options.fetch :background_color, nil#:black\n @colspan = options.fetch :colspan, 1\n end",
"def initialize(text)\n @text = text\n end",
"def initialize(text)\n @text = text\n end",
"def text= t\n self.criterion_type = \"text\"\n write_attribute \"text\", t\n end",
"def initialize form=nil, config={}, &block\n @form = form\n @buffer = String.new\n #@type=config.fetch(\"type\", :varchar)\n @row = 0\n @col = 0\n @editable = true\n @focusable = true\n #@event_args = {} # arguments passed at time of binding, to use when firing event\n map_keys \n init_vars\n register_events(:CHANGE)\n super\n @width ||= 20\n @maxlen ||= @width\n end",
"def initialize(type, text)\n @type, @text = type, text\n end",
"def initialize(type, text)\n @type, @text = type, text\n end",
"def initialize(name, type, length, decimal)\n @name, @type, @length, @decimal = strip_non_ascii_chars(name), type, length, decimal\n \n raise ColumnLengthError, \"field length must be greater than 0\" unless length > 0\n raise ColumnNameError, \"column name cannot be empty\" if @name.length == 0\n end",
"def initialize(text = \"\")\n @text = text\n reset!\n end",
"def initialize(source_text = nil)\n @rows = []\n\n super(source_text)\n\n return unless source_text\n\n parsed_table_data = parse_source(source_text)\n populate_table(self, parsed_table_data)\n end",
"def new_text=(value)\n @new_text = value\n end",
"def default_string_options(method, type) #:nodoc:\n column = self.column_for(method)\n\n if type == :text\n { :cols => @@default_text_field_size, :rows => @@default_text_area_height }\n elsif type == :numeric || column.nil? || column.limit.nil?\n { :size => @@default_text_field_size }\n else\n { :maxlength => column.limit, :size => [column.limit, @@default_text_field_size].min }\n end\n end",
"def initialize(attrs = nil)\n preinitialize(attrs)\n @attributes = attributes_from_column_definition\n self.attributes = attrs unless attrs.nil?\n end",
"def set_text(text); end",
"def defaults # :nodoc:\n self.columns.length.times { |idx|\n }\n end",
"def create_sample_text\n Text.new(0, viewport, 0, 0, 0, 0, ' ')\n end",
"def initialize(text)\n @text = text.to_s\n end",
"def initialize(text)\n @text = text.to_s\n end",
"def initialize\r\n raise MissingFormatterMethodError unless @node\r\n @default_font_size = @document.default_paragraph_style.font_size\r\n set_text_runs\r\n end",
"def initialize(text:, size:, color:)\n @text = text\n @size = size\n @color = color\n end",
"def set_text(text)\n @text = text\n self\n end",
"def initialize(table, column, type, allow_nil = false, allow_blank = false)\n @column = column\n @table = table\n @type = type\n @if_cond = nil\n @unless_cond = nil\n @allow_blank = allow_blank\n @allow_nil = allow_nil\n @is_new_column = false\n @custom_error_msg = false\n @has_cond = false\n end",
"def build_columns\n return unless configurable?\n return if @columns_opted == false\n selector(ORMUtils.properties(model), @columns_opted, @columns_ignored).each do |setup|\n setup << {summary: false} if setup.last == 'text'\n column *setup\n end\n end",
"def startEdit\n super\n create_text_field unless @text_field\n\n set_text nil\n set_graphic @text_field\n @text_field.select_all\n end",
"def text_default metric;\n @text_default = metric\n end",
"def initialize(key, text)\n super()\n @key = key\n @text = text\n end",
"def initialize(text, id: nil)\n @text = text\n @id = id || generate_id\n end",
"def restrict_default_value\n self.content = nil if self.content.eql?('Edit this text to see the text area expand and contract.')\n end",
"def text_type=(value)\n @text_type = value\n end",
"def initialize(text, text_height, font_name, z=0)\n\t\tsuper(text, text_height, font_name, z)\n\t\t@img = create_text_content(text, text_height, font_name)\n\t\t@bg_width = @img.width + @@bg_margin\n\tend",
"def initialize(height = AppConfig.default_height, width = AppConfig.default_width)\n @table = Table.new height, width\n end",
"def initialize(text, text_height, font_name, z=0)\n\t\t@text = text\n\t\t@text_height = text_height\n\t\t@font_name = font_name\n\n\t\t@z = z\n\n\t\t@x = 0\n\t\t@y = 0\n\n\t\t@text_colour = Gosu::Color::WHITE\n\t\t@background_colour = Gosu::Color::BLACK\n\n\t\t@bg_height = text_height + 2\n\tend",
"def initialize(args={})\n activate_sync!\n\n super\n self.text = args[:text] || \"\"\n\n # time between characters being revealed\n @char_time = args[:char_time] || 0.01\n\n # time wait after a line is displayed before starting new\n @line_wait = args[:line_wait] || 3\n\n @draw_next = false\n @timestamp = nil\n end",
"def set_Text(value)\n set_input(\"Text\", value)\n end",
"def set_Text(value)\n set_input(\"Text\", value)\n end",
"def set_Text(value)\n set_input(\"Text\", value)\n end",
"def set_text(text)\n @text = text\n end",
"def defaults\n {\n colour: {},\n style: [],\n text: '',\n width: nil,\n align: :left,\n parent: nil,\n }\n end",
"def insert_text_mode\n attributes.fetch(:insertTextMode)\n end",
"def use_default_attributes\n self.name = \"element#{column}\"\n self.units = ''\n self.default_min = nil\n self.default_max = nil\n self.scale_factor = 1.0\n self.offset = 0.0\n self.display_type = 'continuous'\n end",
"def initialize(columns, options = {})\n super\n \n @sortable = options[:sortable] || false\n @infixes = options[:infixes] || false\n @prefixes = options[:prefixes] || false\n end",
"def test_new_with_hash_nil_rows\n # Initialize JTable and model\n nhk_word_table = JTable.new\n\n assert_raise(ArgumentError) do\n nhk_word_table.model = {:columns => [\"ID\", \"NHK語\"]}\n end\n end",
"def initialize(row, col, content = :FREE)\n\t\t\t@content = content\n\t\t\t@row = row\n\t\t\t@col = col\n\t\t\t@flagged = false\n\t\t\t@bombs_count = 0\n\t\t\t@visible = false\n\t\tend",
"def []=(row, column, text)\n set_item(row.to_i, column.to_i, Qt::StandardItem.new(text.to_s))\n text\n end",
"def initialize(name, default, count=0)\n\n # We need to store the name and default for later.\n @name = name\n @default = default\n\n # This will contain all of our column data\n @storage = []\n\n # We need to populate our storage array with default data until it is as long as our count\n while @storage.length < count\n @storage.push(default)\n end\n\n end",
"def initialize(text, options = {})\n @text = text\n @options = options\n end",
"def initialize(rows = 0, columns = 0)\n resize_field rows, columns\n end",
"def initialize(${1:args})\n ${1:$\n(mapconcat\n '(lambda (x) (concat \"@\" x \" = \" x))\n (split-string text \", \")\n (concat \"\\n\" (make-string (current-column) 32)))\n}$0\nend",
"def default(text)\n text.to_s\n end",
"def initialize(name, text, show: true)\n @name = name\n @text = text\n @show = show || false\n end",
"def text(text)\n @text = text\n end",
"def initialize(args={})\n super\n @rows = args[:rows]\n @cols = args[:cols]\n @title = args[:title]\n\n @rowtitles = args[:rowtitles] || args[:row_titles] || Array.new(@rows) { \"\" }\n @coltitles = args[:coltitles] || args[:col_titles] || Array.new(@cols+1) { \"\" }\n @colwidths = args[:colwidths] || args[:col_widths] || Array.new(@cols+1) { 5 }\n @coltypes = args[:coltypes] || args[:col_types] || Array.new(@cols+1) { :UMIXED }\n end",
"def column( index )\n Column.new( self, col_letter( index ) )\n end",
"def init(cols)\r\n return Knj::Gtk2::Tv.init(self, cols)\r\n end",
"def text=(text)\n @text = normalize_text text\n self.key= @original_key if @original_key\n end",
"def text(value)\n attributes[:text] = value\n end",
"def set_defaults\n self.why_text ||= \"\"\n self.why_source ||= \"\"\n end",
"def text_position=(pos)\n end"
] | [
"0.62656325",
"0.6191882",
"0.6101368",
"0.582297",
"0.5794146",
"0.5753911",
"0.57014453",
"0.56821734",
"0.5680624",
"0.56597483",
"0.5562005",
"0.5467814",
"0.54616696",
"0.54570836",
"0.5414983",
"0.5408143",
"0.54037803",
"0.5377013",
"0.537621",
"0.5372852",
"0.53611815",
"0.5342994",
"0.5340478",
"0.5340088",
"0.53296125",
"0.53296125",
"0.5325783",
"0.5316084",
"0.52777123",
"0.5260608",
"0.5260402",
"0.5243767",
"0.5239616",
"0.5233736",
"0.5229007",
"0.52254146",
"0.5223476",
"0.52178264",
"0.52178264",
"0.52178264",
"0.5213697",
"0.52134514",
"0.5203495",
"0.5197272",
"0.51927197",
"0.51927197",
"0.5190476",
"0.51892877",
"0.51841146",
"0.51841146",
"0.51690143",
"0.5163377",
"0.5156293",
"0.5152405",
"0.5118955",
"0.5118515",
"0.5109443",
"0.51017666",
"0.510057",
"0.50927943",
"0.50927943",
"0.50883794",
"0.50791293",
"0.5071088",
"0.5063272",
"0.5040529",
"0.5020938",
"0.5013764",
"0.50069815",
"0.500672",
"0.49871534",
"0.49818105",
"0.4972374",
"0.49688137",
"0.49626523",
"0.4961722",
"0.4960044",
"0.4960044",
"0.4960044",
"0.49442914",
"0.49439865",
"0.49421963",
"0.49342805",
"0.49316582",
"0.4919739",
"0.49193782",
"0.49173206",
"0.49161682",
"0.49133605",
"0.4907323",
"0.49067158",
"0.4900402",
"0.4898406",
"0.4894844",
"0.4890049",
"0.48893556",
"0.48791328",
"0.48744616",
"0.48693073",
"0.48655087",
"0.4862653"
] | 0.0 | -1 |
The deserialization information for the current model | def get_field_deserializers()
return {
"allowMultipleLines" => lambda {|n| @allow_multiple_lines = n.get_boolean_value() },
"appendChangesToExistingText" => lambda {|n| @append_changes_to_existing_text = n.get_boolean_value() },
"linesForEditing" => lambda {|n| @lines_for_editing = n.get_number_value() },
"maxLength" => lambda {|n| @max_length = n.get_number_value() },
"@odata.type" => lambda {|n| @odata_type = n.get_string_value() },
"textType" => lambda {|n| @text_type = n.get_string_value() },
}
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def deserialized\n @deserialized ||= @serializer.deserialize @serialized_object\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"fileDetails\" => lambda {|n| @file_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n })\n end",
"def serialized_attributes\n read_inheritable_attribute(\"attr_serialized\") || { }\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"fileHash\" => lambda {|n| @file_hash = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"attribution\" => lambda {|n| @attribution = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImageInfo.create_from_discriminator_value(pn) }) },\n \"backgroundColor\" => lambda {|n| @background_color = n.get_string_value() },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayText\" => lambda {|n| @display_text = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"detectionType\" => lambda {|n| @detection_type = n.get_string_value() },\n \"method\" => lambda {|n| @method = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n \"weight\" => lambda {|n| @weight = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"maxImageSize\" => lambda {|n| @max_image_size = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"timeout\" => lambda {|n| @timeout = n.get_duration_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"contentData\" => lambda {|n| @content_data = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"applicationVersion\" => lambda {|n| @application_version = n.get_string_value() },\n \"headerValue\" => lambda {|n| @header_value = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"callEndSubReason\" => lambda {|n| @call_end_sub_reason = n.get_number_value() },\n \"callType\" => lambda {|n| @call_type = n.get_string_value() },\n \"calleeNumber\" => lambda {|n| @callee_number = n.get_string_value() },\n \"callerNumber\" => lambda {|n| @caller_number = n.get_string_value() },\n \"correlationId\" => lambda {|n| @correlation_id = n.get_string_value() },\n \"duration\" => lambda {|n| @duration = n.get_number_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"failureDateTime\" => lambda {|n| @failure_date_time = n.get_date_time_value() },\n \"finalSipCode\" => lambda {|n| @final_sip_code = n.get_number_value() },\n \"finalSipCodePhrase\" => lambda {|n| @final_sip_code_phrase = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"inviteDateTime\" => lambda {|n| @invite_date_time = n.get_date_time_value() },\n \"mediaBypassEnabled\" => lambda {|n| @media_bypass_enabled = n.get_boolean_value() },\n \"mediaPathLocation\" => lambda {|n| @media_path_location = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"signalingLocation\" => lambda {|n| @signaling_location = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"successfulCall\" => lambda {|n| @successful_call = n.get_boolean_value() },\n \"trunkFullyQualifiedDomainName\" => lambda {|n| @trunk_fully_qualified_domain_name = n.get_string_value() },\n \"userDisplayName\" => lambda {|n| @user_display_name = n.get_string_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isCourseActivitySyncEnabled\" => lambda {|n| @is_course_activity_sync_enabled = n.get_boolean_value() },\n \"learningContents\" => lambda {|n| @learning_contents = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningContent.create_from_discriminator_value(pn) }) },\n \"learningCourseActivities\" => lambda {|n| @learning_course_activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LearningCourseActivity.create_from_discriminator_value(pn) }) },\n \"loginWebUrl\" => lambda {|n| @login_web_url = n.get_string_value() },\n \"longLogoWebUrlForDarkTheme\" => lambda {|n| @long_logo_web_url_for_dark_theme = n.get_string_value() },\n \"longLogoWebUrlForLightTheme\" => lambda {|n| @long_logo_web_url_for_light_theme = n.get_string_value() },\n \"squareLogoWebUrlForDarkTheme\" => lambda {|n| @square_logo_web_url_for_dark_theme = n.get_string_value() },\n \"squareLogoWebUrlForLightTheme\" => lambda {|n| @square_logo_web_url_for_light_theme = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"dataType\" => lambda {|n| @data_type = n.get_string_value() },\n \"isSyncedFromOnPremises\" => lambda {|n| @is_synced_from_on_premises = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"targetObjects\" => lambda {|n| @target_objects = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"detectionStatus\" => lambda {|n| @detection_status = n.get_enum_value(MicrosoftGraph::Models::SecurityDetectionStatus) },\n \"imageFile\" => lambda {|n| @image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"mdeDeviceId\" => lambda {|n| @mde_device_id = n.get_string_value() },\n \"parentProcessCreationDateTime\" => lambda {|n| @parent_process_creation_date_time = n.get_date_time_value() },\n \"parentProcessId\" => lambda {|n| @parent_process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"parentProcessImageFile\" => lambda {|n| @parent_process_image_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityFileDetails.create_from_discriminator_value(pn) }) },\n \"processCommandLine\" => lambda {|n| @process_command_line = n.get_string_value() },\n \"processCreationDateTime\" => lambda {|n| @process_creation_date_time = n.get_date_time_value() },\n \"processId\" => lambda {|n| @process_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"userAccount\" => lambda {|n| @user_account = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityUserAccount.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::OperationStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"progress\" => lambda {|n| @progress = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::DataPolicyOperationStatus) },\n \"storageLocation\" => lambda {|n| @storage_location = n.get_string_value() },\n \"submittedDateTime\" => lambda {|n| @submitted_date_time = n.get_date_time_value() },\n \"userId\" => lambda {|n| @user_id = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"completedUnits\" => lambda {|n| @completed_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"progressObservationDateTime\" => lambda {|n| @progress_observation_date_time = n.get_date_time_value() },\n \"totalUnits\" => lambda {|n| @total_units = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"units\" => lambda {|n| @units = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"provisioningStepType\" => lambda {|n| @provisioning_step_type = n.get_enum_value(MicrosoftGraph::Models::ProvisioningStepType) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::ProvisioningResult) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"downloadUri\" => lambda {|n| @download_uri = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fulfilledDateTime\" => lambda {|n| @fulfilled_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodEndDateTime\" => lambda {|n| @review_history_period_end_date_time = n.get_date_time_value() },\n \"reviewHistoryPeriodStartDateTime\" => lambda {|n| @review_history_period_start_date_time = n.get_date_time_value() },\n \"runDateTime\" => lambda {|n| @run_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::AccessReviewHistoryStatus) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"check32BitOn64System\" => lambda {|n| @check32_bit_on64_system = n.get_boolean_value() },\n \"comparisonValue\" => lambda {|n| @comparison_value = n.get_string_value() },\n \"fileOrFolderName\" => lambda {|n| @file_or_folder_name = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppFileSystemOperationType) },\n \"operator\" => lambda {|n| @operator = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppRuleOperator) },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n })\n end",
"def read_object\n if @version == 0\n return amf0_deserialize\n else\n return amf3_deserialize\n end\n end",
"def get_field_deserializers()\n return {\n \"destinationFileName\" => lambda {|n| @destination_file_name = n.get_string_value() },\n \"sourceFile\" => lambda {|n| @source_file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"newText\" => lambda {|n| @new_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"numBytes\" => lambda {|n| @num_bytes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"oldText\" => lambda {|n| @old_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"startNum\" => lambda {|n| @start_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioDeviceName\" => lambda {|n| @audio_device_name = n.get_string_value() },\n \"bookingType\" => lambda {|n| @booking_type = n.get_enum_value(MicrosoftGraph::Models::BookingType) },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"capacity\" => lambda {|n| @capacity = n.get_number_value() },\n \"displayDeviceName\" => lambda {|n| @display_device_name = n.get_string_value() },\n \"emailAddress\" => lambda {|n| @email_address = n.get_string_value() },\n \"floorLabel\" => lambda {|n| @floor_label = n.get_string_value() },\n \"floorNumber\" => lambda {|n| @floor_number = n.get_number_value() },\n \"isWheelChairAccessible\" => lambda {|n| @is_wheel_chair_accessible = n.get_boolean_value() },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"nickname\" => lambda {|n| @nickname = n.get_string_value() },\n \"tags\" => lambda {|n| @tags = n.get_collection_of_primitive_values(String) },\n \"videoDeviceName\" => lambda {|n| @video_device_name = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"targetType\" => lambda {|n| @target_type = n.get_enum_value(MicrosoftGraph::Models::FeatureTargetType) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"platform\" => lambda {|n| @platform = n.get_enum_value(MicrosoftGraph::Models::DetectedAppPlatformType) },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"sizeInByte\" => lambda {|n| @size_in_byte = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"activationUrl\" => lambda {|n| @activation_url = n.get_string_value() },\n \"activitySourceHost\" => lambda {|n| @activity_source_host = n.get_string_value() },\n \"appActivityId\" => lambda {|n| @app_activity_id = n.get_string_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"contentInfo\" => lambda {|n| @content_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"fallbackUrl\" => lambda {|n| @fallback_url = n.get_string_value() },\n \"historyItems\" => lambda {|n| @history_items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ActivityHistoryItem.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::Status) },\n \"userTimezone\" => lambda {|n| @user_timezone = n.get_string_value() },\n \"visualElements\" => lambda {|n| @visual_elements = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VisualInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"malwareIdentifier\" => lambda {|n| @malware_identifier = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"lastActionDateTime\" => lambda {|n| @last_action_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operation\" => lambda {|n| @operation = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"details\" => lambda {|n| @details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DetailsInfo.create_from_discriminator_value(pn) }) },\n \"identityType\" => lambda {|n| @identity_type = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"dataLocationCode\" => lambda {|n| @data_location_code = n.get_string_value() },\n \"hostname\" => lambda {|n| @hostname = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"root\" => lambda {|n| @root = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Root.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"address\" => lambda {|n| @address = n.get_string_value() },\n \"itemId\" => lambda {|n| @item_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"relevanceScore\" => lambda {|n| @relevance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"selectionLikelihood\" => lambda {|n| @selection_likelihood = n.get_enum_value(MicrosoftGraph::Models::SelectionLikelihoodInfo) },\n }\n end",
"def get_field_deserializers()\n return {\n \"hashes\" => lambda {|n| @hashes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Hashes.create_from_discriminator_value(pn) }) },\n \"mimeType\" => lambda {|n| @mime_type = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"processingMetadata\" => lambda {|n| @processing_metadata = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"configurationVersion\" => lambda {|n| @configuration_version = n.get_number_value() },\n \"errorCount\" => lambda {|n| @error_count = n.get_number_value() },\n \"failedCount\" => lambda {|n| @failed_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"notApplicableCount\" => lambda {|n| @not_applicable_count = n.get_number_value() },\n \"pendingCount\" => lambda {|n| @pending_count = n.get_number_value() },\n \"successCount\" => lambda {|n| @success_count = n.get_number_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"format\" => lambda {|n| @format = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookChartDataLabelFormat.create_from_discriminator_value(pn) }) },\n \"position\" => lambda {|n| @position = n.get_string_value() },\n \"separator\" => lambda {|n| @separator = n.get_string_value() },\n \"showBubbleSize\" => lambda {|n| @show_bubble_size = n.get_boolean_value() },\n \"showCategoryName\" => lambda {|n| @show_category_name = n.get_boolean_value() },\n \"showLegendKey\" => lambda {|n| @show_legend_key = n.get_boolean_value() },\n \"showPercentage\" => lambda {|n| @show_percentage = n.get_boolean_value() },\n \"showSeriesName\" => lambda {|n| @show_series_name = n.get_boolean_value() },\n \"showValue\" => lambda {|n| @show_value = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"errorDetails\" => lambda {|n| @error_details = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::GenericError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n \"targetId\" => lambda {|n| @target_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"contentSource\" => lambda {|n| @content_source = n.get_string_value() },\n \"hitId\" => lambda {|n| @hit_id = n.get_string_value() },\n \"isCollapsed\" => lambda {|n| @is_collapsed = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"rank\" => lambda {|n| @rank = n.get_number_value() },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resultTemplateId\" => lambda {|n| @result_template_id = n.get_string_value() },\n \"summary\" => lambda {|n| @summary = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"assignedUserPrincipalName\" => lambda {|n| @assigned_user_principal_name = n.get_string_value() },\n \"groupTag\" => lambda {|n| @group_tag = n.get_string_value() },\n \"hardwareIdentifier\" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"importId\" => lambda {|n| @import_id = n.get_string_value() },\n \"productKey\" => lambda {|n| @product_key = n.get_string_value() },\n \"serialNumber\" => lambda {|n| @serial_number = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"audioRoutingGroups\" => lambda {|n| @audio_routing_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AudioRoutingGroup.create_from_discriminator_value(pn) }) },\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_string_value() },\n \"callOptions\" => lambda {|n| @call_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallOptions.create_from_discriminator_value(pn) }) },\n \"callRoutes\" => lambda {|n| @call_routes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CallRoute.create_from_discriminator_value(pn) }) },\n \"callbackUri\" => lambda {|n| @callback_uri = n.get_string_value() },\n \"chatInfo\" => lambda {|n| @chat_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatInfo.create_from_discriminator_value(pn) }) },\n \"contentSharingSessions\" => lambda {|n| @content_sharing_sessions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ContentSharingSession.create_from_discriminator_value(pn) }) },\n \"direction\" => lambda {|n| @direction = n.get_enum_value(MicrosoftGraph::Models::CallDirection) },\n \"incomingContext\" => lambda {|n| @incoming_context = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IncomingContext.create_from_discriminator_value(pn) }) },\n \"mediaConfig\" => lambda {|n| @media_config = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaConfig.create_from_discriminator_value(pn) }) },\n \"mediaState\" => lambda {|n| @media_state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallMediaState.create_from_discriminator_value(pn) }) },\n \"meetingInfo\" => lambda {|n| @meeting_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MeetingInfo.create_from_discriminator_value(pn) }) },\n \"myParticipantId\" => lambda {|n| @my_participant_id = n.get_string_value() },\n \"operations\" => lambda {|n| @operations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CommsOperation.create_from_discriminator_value(pn) }) },\n \"participants\" => lambda {|n| @participants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Participant.create_from_discriminator_value(pn) }) },\n \"requestedModalities\" => lambda {|n| @requested_modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Modality.create_from_discriminator_value(pn) }) },\n \"resultInfo\" => lambda {|n| @result_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResultInfo.create_from_discriminator_value(pn) }) },\n \"source\" => lambda {|n| @source = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ParticipantInfo.create_from_discriminator_value(pn) }) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::CallState) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"targets\" => lambda {|n| @targets = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::InvitationParticipantInfo.create_from_discriminator_value(pn) }) },\n \"tenantId\" => lambda {|n| @tenant_id = n.get_string_value() },\n \"toneInfo\" => lambda {|n| @tone_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ToneInfo.create_from_discriminator_value(pn) }) },\n \"transcription\" => lambda {|n| @transcription = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallTranscriptionInfo.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"teacherNumber\" => lambda {|n| @teacher_number = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"key\" => lambda {|n| @key = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"usage\" => lambda {|n| @usage = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"assignCategories\" => lambda {|n| @assign_categories = n.get_collection_of_primitive_values(String) },\n \"copyToFolder\" => lambda {|n| @copy_to_folder = n.get_string_value() },\n \"delete\" => lambda {|n| @delete = n.get_boolean_value() },\n \"forwardAsAttachmentTo\" => lambda {|n| @forward_as_attachment_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"forwardTo\" => lambda {|n| @forward_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"markAsRead\" => lambda {|n| @mark_as_read = n.get_boolean_value() },\n \"markImportance\" => lambda {|n| @mark_importance = n.get_enum_value(MicrosoftGraph::Models::Importance) },\n \"moveToFolder\" => lambda {|n| @move_to_folder = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"permanentDelete\" => lambda {|n| @permanent_delete = n.get_boolean_value() },\n \"redirectTo\" => lambda {|n| @redirect_to = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Recipient.create_from_discriminator_value(pn) }) },\n \"stopProcessingRules\" => lambda {|n| @stop_processing_rules = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"acceptMappedClaims\" => lambda {|n| @accept_mapped_claims = n.get_boolean_value() },\n \"knownClientApplications\" => lambda {|n| @known_client_applications = n.get_collection_of_primitive_values(UUIDTools::UUID) },\n \"oauth2PermissionScopes\" => lambda {|n| @oauth2_permission_scopes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PermissionScope.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preAuthorizedApplications\" => lambda {|n| @pre_authorized_applications = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::PreAuthorizedApplication.create_from_discriminator_value(pn) }) },\n \"requestedAccessTokenVersion\" => lambda {|n| @requested_access_token_version = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"createdByAppId\" => lambda {|n| @created_by_app_id = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"level\" => lambda {|n| @level = n.get_number_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PageLinks.create_from_discriminator_value(pn) }) },\n \"order\" => lambda {|n| @order = n.get_number_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSection\" => lambda {|n| @parent_section = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"userTags\" => lambda {|n| @user_tags = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"failedRuns\" => lambda {|n| @failed_runs = n.get_number_value() },\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulRuns\" => lambda {|n| @successful_runs = n.get_number_value() },\n \"totalRuns\" => lambda {|n| @total_runs = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_guid_value() },\n \"isEnabled\" => lambda {|n| @is_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"recommendedActions\" => lambda {|n| @recommended_actions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RecommendedAction.create_from_discriminator_value(pn) }) },\n \"resolvedTargetsCount\" => lambda {|n| @resolved_targets_count = n.get_number_value() },\n \"simulationEventsContent\" => lambda {|n| @simulation_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SimulationEventsContent.create_from_discriminator_value(pn) }) },\n \"trainingEventsContent\" => lambda {|n| @training_events_content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TrainingEventsContent.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return {\n \"customKeyIdentifier\" => lambda {|n| @custom_key_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"hint\" => lambda {|n| @hint = n.get_string_value() },\n \"keyId\" => lambda {|n| @key_id = n.get_guid_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"secretText\" => lambda {|n| @secret_text = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"locations\" => lambda {|n| @locations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LocationConstraintItem.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"suggestLocation\" => lambda {|n| @suggest_location = n.get_boolean_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"activityType\" => lambda {|n| @activity_type = n.get_string_value() },\n \"chainId\" => lambda {|n| @chain_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"previewText\" => lambda {|n| @preview_text = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"recipient\" => lambda {|n| @recipient = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkNotificationRecipient.create_from_discriminator_value(pn) }) },\n \"templateParameters\" => lambda {|n| @template_parameters = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValuePair.create_from_discriminator_value(pn) }) },\n \"topic\" => lambda {|n| @topic = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::TeamworkActivityTopic.create_from_discriminator_value(pn) }) },\n }\n end",
"def metadata\n self.class.metadata\n end",
"def get_field_deserializers()\n return {\n \"activityIdentifier\" => lambda {|n| @activity_identifier = n.get_string_value() },\n \"countEntitled\" => lambda {|n| @count_entitled = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEntitledForProvisioning\" => lambda {|n| @count_entitled_for_provisioning = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowed\" => lambda {|n| @count_escrowed = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countEscrowedRaw\" => lambda {|n| @count_escrowed_raw = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExported\" => lambda {|n| @count_exported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countExports\" => lambda {|n| @count_exports = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImported\" => lambda {|n| @count_imported = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedDeltas\" => lambda {|n| @count_imported_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"countImportedReferenceDeltas\" => lambda {|n| @count_imported_reference_deltas = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationError.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::SynchronizationTaskExecutionResult) },\n \"timeBegan\" => lambda {|n| @time_began = n.get_date_time_value() },\n \"timeEnded\" => lambda {|n| @time_ended = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"transportKey\" => lambda {|n| @transport_key = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"activeDeviceCount\" => lambda {|n| @active_device_count = n.get_number_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"modelAppHealthScore\" => lambda {|n| @model_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceAccess\" => lambda {|n| @resource_access = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ResourceAccess.create_from_discriminator_value(pn) }) },\n \"resourceAppId\" => lambda {|n| @resource_app_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"key\" => lambda {|n| @key = n.get_string_value() },\n \"volumeType\" => lambda {|n| @volume_type = n.get_enum_value(MicrosoftGraph::Models::VolumeType) },\n })\n end",
"def get_field_deserializers()\n return {\n \"anchor\" => lambda {|n| @anchor = n.get_boolean_value() },\n \"apiExpressions\" => lambda {|n| @api_expressions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::StringKeyStringValuePair.create_from_discriminator_value(pn) }) },\n \"caseExact\" => lambda {|n| @case_exact = n.get_boolean_value() },\n \"defaultValue\" => lambda {|n| @default_value = n.get_string_value() },\n \"flowNullValues\" => lambda {|n| @flow_null_values = n.get_boolean_value() },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },\n \"multivalued\" => lambda {|n| @multivalued = n.get_boolean_value() },\n \"mutability\" => lambda {|n| @mutability = n.get_enum_value(MicrosoftGraph::Models::Mutability) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"referencedObjects\" => lambda {|n| @referenced_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ReferencedObject.create_from_discriminator_value(pn) }) },\n \"required\" => lambda {|n| @required = n.get_boolean_value() },\n \"type\" => lambda {|n| @type = n.get_enum_value(MicrosoftGraph::Models::AttributeType) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"averageBlueScreens\" => lambda {|n| @average_blue_screens = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"averageRestarts\" => lambda {|n| @average_restarts = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"blueScreenCount\" => lambda {|n| @blue_screen_count = n.get_number_value() },\n \"bootScore\" => lambda {|n| @boot_score = n.get_number_value() },\n \"coreBootTimeInMs\" => lambda {|n| @core_boot_time_in_ms = n.get_number_value() },\n \"coreLoginTimeInMs\" => lambda {|n| @core_login_time_in_ms = n.get_number_value() },\n \"deviceCount\" => lambda {|n| @device_count = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"diskType\" => lambda {|n| @disk_type = n.get_enum_value(MicrosoftGraph::Models::DiskType) },\n \"groupPolicyBootTimeInMs\" => lambda {|n| @group_policy_boot_time_in_ms = n.get_number_value() },\n \"groupPolicyLoginTimeInMs\" => lambda {|n| @group_policy_login_time_in_ms = n.get_number_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"loginScore\" => lambda {|n| @login_score = n.get_number_value() },\n \"manufacturer\" => lambda {|n| @manufacturer = n.get_string_value() },\n \"model\" => lambda {|n| @model = n.get_string_value() },\n \"modelStartupPerformanceScore\" => lambda {|n| @model_startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"operatingSystemVersion\" => lambda {|n| @operating_system_version = n.get_string_value() },\n \"responsiveDesktopTimeInMs\" => lambda {|n| @responsive_desktop_time_in_ms = n.get_number_value() },\n \"restartCount\" => lambda {|n| @restart_count = n.get_number_value() },\n \"startupPerformanceScore\" => lambda {|n| @startup_performance_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return {\n \"connectingIP\" => lambda {|n| @connecting_i_p = n.get_string_value() },\n \"deliveryAction\" => lambda {|n| @delivery_action = n.get_string_value() },\n \"deliveryLocation\" => lambda {|n| @delivery_location = n.get_string_value() },\n \"directionality\" => lambda {|n| @directionality = n.get_string_value() },\n \"internetMessageId\" => lambda {|n| @internet_message_id = n.get_string_value() },\n \"messageFingerprint\" => lambda {|n| @message_fingerprint = n.get_string_value() },\n \"messageReceivedDateTime\" => lambda {|n| @message_received_date_time = n.get_date_time_value() },\n \"messageSubject\" => lambda {|n| @message_subject = n.get_string_value() },\n \"networkMessageId\" => lambda {|n| @network_message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"application\" => lambda {|n| @application = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"preventsDownload\" => lambda {|n| @prevents_download = n.get_boolean_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"webHtml\" => lambda {|n| @web_html = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"nextExpectedRanges\" => lambda {|n| @next_expected_ranges = n.get_collection_of_primitive_values(String) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"uploadUrl\" => lambda {|n| @upload_url = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceCountWithCrashes\" => lambda {|n| @device_count_with_crashes = n.get_number_value() },\n \"isLatestUsedVersion\" => lambda {|n| @is_latest_used_version = n.get_boolean_value() },\n \"isMostUsedVersion\" => lambda {|n| @is_most_used_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"attributeMappings\" => lambda {|n| @attribute_mappings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeMapping.create_from_discriminator_value(pn) }) },\n \"enabled\" => lambda {|n| @enabled = n.get_boolean_value() },\n \"flowTypes\" => lambda {|n| @flow_types = n.get_enum_value(MicrosoftGraph::Models::ObjectFlowTypes) },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectMappingMetadataEntry.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Filter.create_from_discriminator_value(pn) }) },\n \"sourceObjectName\" => lambda {|n| @source_object_name = n.get_string_value() },\n \"targetObjectName\" => lambda {|n| @target_object_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionLinks.create_from_discriminator_value(pn) }) },\n \"pages\" => lambda {|n| @pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenotePage.create_from_discriminator_value(pn) }) },\n \"pagesUrl\" => lambda {|n| @pages_url = n.get_string_value() },\n \"parentNotebook\" => lambda {|n| @parent_notebook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Notebook.create_from_discriminator_value(pn) }) },\n \"parentSectionGroup\" => lambda {|n| @parent_section_group = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appHangCount\" => lambda {|n| @app_hang_count = n.get_number_value() },\n \"crashedAppCount\" => lambda {|n| @crashed_app_count = n.get_number_value() },\n \"deviceAppHealthScore\" => lambda {|n| @device_app_health_score = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"deviceManufacturer\" => lambda {|n| @device_manufacturer = n.get_string_value() },\n \"deviceModel\" => lambda {|n| @device_model = n.get_string_value() },\n \"healthStatus\" => lambda {|n| @health_status = n.get_enum_value(MicrosoftGraph::Models::UserExperienceAnalyticsHealthState) },\n \"meanTimeToFailureInMinutes\" => lambda {|n| @mean_time_to_failure_in_minutes = n.get_number_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"messageId\" => lambda {|n| @message_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"replyChainMessageId\" => lambda {|n| @reply_chain_message_id = n.get_string_value() },\n \"threadId\" => lambda {|n| @thread_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isUsable\" => lambda {|n| @is_usable = n.get_boolean_value() },\n \"isUsableOnce\" => lambda {|n| @is_usable_once = n.get_boolean_value() },\n \"lifetimeInMinutes\" => lambda {|n| @lifetime_in_minutes = n.get_number_value() },\n \"methodUsabilityReason\" => lambda {|n| @method_usability_reason = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"temporaryAccessPass\" => lambda {|n| @temporary_access_pass = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"owner\" => lambda {|n| @owner = n.get_string_value() },\n \"properties\" => lambda {|n| @properties = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ExtensionSchemaProperty.create_from_discriminator_value(pn) }) },\n \"status\" => lambda {|n| @status = n.get_string_value() },\n \"targetTypes\" => lambda {|n| @target_types = n.get_collection_of_primitive_values(String) },\n })\n end",
"def get_field_deserializers()\n return {\n \"bargeInAllowed\" => lambda {|n| @barge_in_allowed = n.get_boolean_value() },\n \"clientContext\" => lambda {|n| @client_context = n.get_string_value() },\n \"initialSilenceTimeoutInSeconds\" => lambda {|n| @initial_silence_timeout_in_seconds = n.get_number_value() },\n \"maxRecordDurationInSeconds\" => lambda {|n| @max_record_duration_in_seconds = n.get_number_value() },\n \"maxSilenceTimeoutInSeconds\" => lambda {|n| @max_silence_timeout_in_seconds = n.get_number_value() },\n \"playBeep\" => lambda {|n| @play_beep = n.get_boolean_value() },\n \"prompts\" => lambda {|n| @prompts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Prompt.create_from_discriminator_value(pn) }) },\n \"stopTones\" => lambda {|n| @stop_tones = n.get_collection_of_primitive_values(String) },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"response\" => lambda {|n| @response = n.get_enum_value(MicrosoftGraph::Models::ResponseType) },\n \"time\" => lambda {|n| @time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"driveId\" => lambda {|n| @drive_id = n.get_string_value() },\n \"driveType\" => lambda {|n| @drive_type = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"shareId\" => lambda {|n| @share_id = n.get_string_value() },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"siteId\" => lambda {|n| @site_id = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"appCrashCount\" => lambda {|n| @app_crash_count = n.get_number_value() },\n \"appDisplayName\" => lambda {|n| @app_display_name = n.get_string_value() },\n \"appName\" => lambda {|n| @app_name = n.get_string_value() },\n \"appPublisher\" => lambda {|n| @app_publisher = n.get_string_value() },\n \"appVersion\" => lambda {|n| @app_version = n.get_string_value() },\n \"deviceDisplayName\" => lambda {|n| @device_display_name = n.get_string_value() },\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"processedDateTime\" => lambda {|n| @processed_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"activeMalwareDetectionCount\" => lambda {|n| @active_malware_detection_count = n.get_number_value() },\n \"category\" => lambda {|n| @category = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareCategory) },\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"distinctActiveMalwareCount\" => lambda {|n| @distinct_active_malware_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"issuerName\" => lambda {|n| @issuer_name = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CertificateStatus) },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n \"subjectName\" => lambda {|n| @subject_name = n.get_string_value() },\n \"uploadDateTime\" => lambda {|n| @upload_date_time = n.get_date_time_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"appId\" => lambda {|n| @app_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"servicePrincipalId\" => lambda {|n| @service_principal_id = n.get_string_value() },\n \"servicePrincipalName\" => lambda {|n| @service_principal_name = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"riskDetections\" => lambda {|n| @risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskDetection.create_from_discriminator_value(pn) }) },\n \"riskyServicePrincipals\" => lambda {|n| @risky_service_principals = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyServicePrincipal.create_from_discriminator_value(pn) }) },\n \"riskyUsers\" => lambda {|n| @risky_users = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RiskyUser.create_from_discriminator_value(pn) }) },\n \"servicePrincipalRiskDetections\" => lambda {|n| @service_principal_risk_detections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ServicePrincipalRiskDetection.create_from_discriminator_value(pn) }) },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return super.merge({\n })\n end",
"def get_field_deserializers()\n return {\n \"failedTasks\" => lambda {|n| @failed_tasks = n.get_number_value() },\n \"failedUsers\" => lambda {|n| @failed_users = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"successfulUsers\" => lambda {|n| @successful_users = n.get_number_value() },\n \"totalTasks\" => lambda {|n| @total_tasks = n.get_number_value() },\n \"totalUsers\" => lambda {|n| @total_users = n.get_number_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"durationInSeconds\" => lambda {|n| @duration_in_seconds = n.get_number_value() },\n \"joinDateTime\" => lambda {|n| @join_date_time = n.get_date_time_value() },\n \"leaveDateTime\" => lambda {|n| @leave_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_string_value() },\n \"changeType\" => lambda {|n| @change_type = n.get_string_value() },\n \"clientState\" => lambda {|n| @client_state = n.get_string_value() },\n \"creatorId\" => lambda {|n| @creator_id = n.get_string_value() },\n \"encryptionCertificate\" => lambda {|n| @encryption_certificate = n.get_string_value() },\n \"encryptionCertificateId\" => lambda {|n| @encryption_certificate_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"includeResourceData\" => lambda {|n| @include_resource_data = n.get_boolean_value() },\n \"latestSupportedTlsVersion\" => lambda {|n| @latest_supported_tls_version = n.get_string_value() },\n \"lifecycleNotificationUrl\" => lambda {|n| @lifecycle_notification_url = n.get_string_value() },\n \"notificationQueryOptions\" => lambda {|n| @notification_query_options = n.get_string_value() },\n \"notificationUrl\" => lambda {|n| @notification_url = n.get_string_value() },\n \"notificationUrlAppId\" => lambda {|n| @notification_url_app_id = n.get_string_value() },\n \"resource\" => lambda {|n| @resource = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"entityType\" => lambda {|n| @entity_type = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"onBehalfOfUserId\" => lambda {|n| @on_behalf_of_user_id = n.get_guid_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"actionName\" => lambda {|n| @action_name = n.get_string_value() },\n \"actionState\" => lambda {|n| @action_state = n.get_enum_value(MicrosoftGraph::Models::ActionState) },\n \"lastUpdatedDateTime\" => lambda {|n| @last_updated_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"azureAdUserId\" => lambda {|n| @azure_ad_user_id = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"domainName\" => lambda {|n| @domain_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n \"userSid\" => lambda {|n| @user_sid = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"items\" => lambda {|n| @items = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DocumentSetVersionItem.create_from_discriminator_value(pn) }) },\n \"shouldCaptureMinorVersion\" => lambda {|n| @should_capture_minor_version = n.get_boolean_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"uri\" => lambda {|n| @uri = n.get_string_value() },\n }\n end",
"def get_field_deserializers()\n return {\n \"callChainId\" => lambda {|n| @call_chain_id = n.get_guid_value() },\n \"cloudServiceDeploymentEnvironment\" => lambda {|n| @cloud_service_deployment_environment = n.get_string_value() },\n \"cloudServiceDeploymentId\" => lambda {|n| @cloud_service_deployment_id = n.get_string_value() },\n \"cloudServiceInstanceName\" => lambda {|n| @cloud_service_instance_name = n.get_string_value() },\n \"cloudServiceName\" => lambda {|n| @cloud_service_name = n.get_string_value() },\n \"deviceDescription\" => lambda {|n| @device_description = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"mediaLegId\" => lambda {|n| @media_leg_id = n.get_guid_value() },\n \"mediaQualityList\" => lambda {|n| @media_quality_list = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TeleconferenceDeviceMediaQuality.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"participantId\" => lambda {|n| @participant_id = n.get_guid_value() },\n }\n end",
"def _before_validation\n serialize_deserialized_values\n super\n end",
"def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isBuiltIn\" => lambda {|n| @is_built_in = n.get_boolean_value() },\n \"roleAssignments\" => lambda {|n| @role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RoleAssignment.create_from_discriminator_value(pn) }) },\n \"rolePermissions\" => lambda {|n| @role_permissions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::RolePermission.create_from_discriminator_value(pn) }) },\n })\n end",
"def get_field_deserializers()\n return super.merge({\n \"firstSeenDateTime\" => lambda {|n| @first_seen_date_time = n.get_date_time_value() },\n \"host\" => lambda {|n| @host = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityHost.create_from_discriminator_value(pn) }) },\n \"kind\" => lambda {|n| @kind = n.get_string_value() },\n \"lastSeenDateTime\" => lambda {|n| @last_seen_date_time = n.get_date_time_value() },\n \"value\" => lambda {|n| @value = n.get_string_value() },\n })\n end",
"def get_field_deserializers()\n return {\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"criterion1\" => lambda {|n| @criterion1 = n.get_string_value() },\n \"criterion2\" => lambda {|n| @criterion2 = n.get_string_value() },\n \"dynamicCriteria\" => lambda {|n| @dynamic_criteria = n.get_string_value() },\n \"filterOn\" => lambda {|n| @filter_on = n.get_string_value() },\n \"icon\" => lambda {|n| @icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookIcon.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"operator\" => lambda {|n| @operator = n.get_string_value() },\n \"values\" => lambda {|n| @values = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end"
] | [
"0.6510734",
"0.63224316",
"0.6322254",
"0.63094735",
"0.62954384",
"0.6238735",
"0.6232461",
"0.62155676",
"0.6200175",
"0.6199403",
"0.6173917",
"0.61733985",
"0.61705345",
"0.61631054",
"0.61620396",
"0.6158031",
"0.6156071",
"0.6142402",
"0.613998",
"0.6138061",
"0.61200523",
"0.6089013",
"0.60869795",
"0.6079146",
"0.60785794",
"0.6070405",
"0.6063533",
"0.60625833",
"0.6061235",
"0.60584134",
"0.6055769",
"0.6051312",
"0.60465735",
"0.6046329",
"0.6031944",
"0.6029311",
"0.6028314",
"0.60255736",
"0.6022033",
"0.60210633",
"0.6009887",
"0.5988654",
"0.59844214",
"0.59793943",
"0.5975247",
"0.5969614",
"0.5966432",
"0.5965554",
"0.596292",
"0.5951651",
"0.5950895",
"0.59456754",
"0.59448177",
"0.593984",
"0.59362113",
"0.5935833",
"0.59319806",
"0.59312665",
"0.59307545",
"0.5930406",
"0.5926444",
"0.5926136",
"0.59240156",
"0.5922303",
"0.591605",
"0.591336",
"0.5913327",
"0.59130335",
"0.5910617",
"0.5906052",
"0.5906045",
"0.59042066",
"0.5903306",
"0.5902868",
"0.59027255",
"0.5902389",
"0.5902219",
"0.5901496",
"0.58978146",
"0.5891392",
"0.5890228",
"0.5885622",
"0.5885429",
"0.5884738",
"0.5883899",
"0.5883899",
"0.5883899",
"0.58811784",
"0.5878516",
"0.5877111",
"0.5869185",
"0.5844199",
"0.58430207",
"0.58408237",
"0.58383596",
"0.58362466",
"0.5836192",
"0.5835942",
"0.5834559",
"0.583357"
] | 0.596824 | 46 |
Gets the linesForEditing property value. The size of the text box. | def lines_for_editing
return @lines_for_editing
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lines_for_editing=(value)\n @lines_for_editing = value\n end",
"def max_lines\n (contents.width / line_height) - 1\n end",
"def lines\n @lines ||= Vedeu::Editor::Lines.coerce(data)\n end",
"def height\n lines.size\n end",
"def height\n lines.size\n end",
"def size\n prompt_size + text_size\n end",
"def text_area_options\n { :cols => 30, :rows => 3 }\n end",
"def window_line_size\n lines - 2\n end",
"def line_height\n TDD::ABF::SETTINGS::OVERRIDE_LINE_HEIGHT[name] || @info[:lineHeight]\n end",
"def size\n line.size\n end",
"def height \n @height || text_area_height + 2*@vertical_padding\n end",
"def lines\n @message.size\n end",
"def text_area_height\n text_height = 0\n if @font_size\n @document.font_size(@font_size) do\n text_height = @document.height_of(@text, :width => text_area_width)\n end\n else\n text_height = @document.height_of(@text, :width => text_area_width)\n end\n text_height\n end",
"def line_items_count\n self.line_items.size\n end",
"def text_area_width\n width - 2*@horizontal_padding\n end",
"def lines\n 2 * @size + 3\n end",
"def num_lines_in_view()\n\t\tlast_line_in_view() - first_line_in_view() + 1\n\tend",
"def line_height\n return @common.lineHeight\n end",
"def height(lines=1)\n return @font.height * lines + 4 # Where's this magic '4' come from?\n end",
"def line_items_count\n self.line_items.size\n end",
"def lines\n @lines ||= text.map do |line|\n line.split /\\s{2}/\n end.flatten.reject!{|l| l == '' }\n #puts \"LINES? #{@lines}\"\n @lines\n end",
"def line_height\r\n 15\r\n end",
"def display_lines( text, rows = DEFAULT_ROWS_TEXTAREA, cols = DEFAULT_COLS_TEXTAREA )\n html = String.new\n html += \"<textarea class=\\\"form-control\\\" rows=\\\"#{ rows }\\\" cols=\\\"#{ cols }\\\" readonly>#{text}</textarea>\"\n html.html_safe\n end",
"def getLines\n\t\t@lines\n\tend",
"def line_max\n return @line_max if @line_max\n return @line_max = contents_height / line_height\n end",
"def length\n (lines.map do |line|\n Strings::Align.display_width(line)\n end << 0).max\n end",
"def line_count\n\t\tlines.size\n\tend",
"def line_count\n\t\tlines.size\n\tend",
"def box_height\n return line_height + 104 + line_height * (@params.size + 1)\n end",
"def size\n @messages_as_text.size\n end",
"def estimate_rows_for_text_area str, cols\n return 3 if str.nil?\n cols = cols.to_f\n str.split(\"\\n\").collect { |line| (line.length / cols).ceil }.collect { |v| v == 0 ? 1 : v }.sum\n end",
"def height\n @screenplay.line_height * @lines.size\n end",
"def lines\n @lines ||= build_lines\n end",
"def affected_lines_range\n (line_no..line_no + replaced_text.count(\"\\n\"))\n end",
"def default_line_height\n Fonts.line_height(current_layout.default_font)\n end",
"def default_line_height\n return Fonts.line_height(current_layout.default_font)\n end",
"def lines\n return [] unless @value && text\n\n text.split(/\\r\\n|\\r|\\n/)\n end",
"def vertical_grid_lines_len()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.GraphComponentState_vertical_grid_lines_len(@handle.ptr)\n result\n end",
"def tabsize=(value)\n\t\t\teditor.tabsize= value\n\t\tend",
"def lines\n @document.lines @line_numbers\n end",
"def getNumLines()\n contents.split(\"\\n\").length - 1\n end",
"def length\n (lines.max_by(&:length) || '').size\n end",
"def line_items_count\n self.line_items.count\n end",
"def lines\n @lines[oy...(oy + bordered_height)] || []\n end",
"def lines\n\t\t\[email protected](Ruvim::API::CR)\n\t\tend",
"def lines_remaining(font_size = nil)\n font_size ||= @font_size\n remaining = @y - @bottom_margin\n remaining / font_height(font_size).to_f\n end",
"def line_height(font_id)\n @line_heights[font_id] || 16\n end",
"def render_text_size(text = @text)\n lines = render_text_lines(text)\n width = lines.map(&:length).max\n height = lines.length\n { width: width, height: height }\n end",
"def lines=(v)\n Axlsx.validate_int v\n @lines = v\n end",
"def length\n @lines ? @lines.length : 0\n end",
"def length\n @lines ? @lines.length : 0\n end",
"def size\n\t\treturn @styles.size\n\tend",
"def width\n theWidth = 0\n @theLines.each { |l| theWidth = l.length if l.length > theWidth }\n theWidth\n end",
"def completed_lines\n lines\n end",
"def font_size\n @font_size ||= [cell_height, cell_width].sort.shift * 0.8\n end",
"def line_height; MA_IconItemList::RECT_HEIGHT; end",
"def cursor_height\n return Font.default_size\n end",
"def visible_line_number\n @ev_height\n end",
"def test_line_height\n w = Window_Selectable_Implemented.new(160,0,160,128,$data_items.compact, 48)\n @windows.push(w)\n end",
"def line_length_for(line_number)\n line_lengths[line_number]\n end",
"def num_lines() @line_indices.length + 1 end",
"def set_iline( string = \"\" )\n return if @testing\n Curses::curs_set 0\n @win_interaction.setpos( 0, 0 )\n @win_interaction.addstr( \"%-#{Curses::cols}s\" % string )\n @win_interaction.refresh\n Curses::curs_set 1\n string.length\n end",
"def rows\n layout_text.blank? ? 12 : layout.size\n end",
"def box_lines\n return [] if output.match NO_BOXES\n output.lines\n end",
"def lines\n @lines[oy...(oy + height)] || []\n end",
"def length\n return nil if self.nil?\n return @theLines.length\n end",
"def lines\n\t\tcontents.split(\"\\n\")\n\tend",
"def lines\n\t\tcontents.split(\"\\n\")\n\tend",
"def on_get_line_height(x); (@row_height || -1); end",
"def lines?\n @lines\n end",
"def row_size\n @delegate.getRowSize\n end",
"def size\n if back?\n back.lines.size\n\n elsif front?\n front.lines.size\n\n elsif previous?\n previous.lines.size\n\n else\n 0\n\n end\n end",
"def lines\n text.split(/(?<=[\\n\\f])/)\n end",
"def edit_size\n\t\tif (self.type == SECT_TYPE::OUTPUT || self.type == SECT_TYPE::CODE || self.type == SECT_TYPE::NOTES)\n\t\t\treturn \"large\"\n\t\telse\n\t\t\treturn \"small\"\n\t\tend\n\tend",
"def line_length(line)\n line.chomp.gsub(/\\e\\[[\\d;]*m/, '').length\n end",
"def edited_rows_count\n @edited_rows_codes.count\n end",
"def edited_rows_count\n @edited_rows_codes.count\n end",
"def edited_rows_count\n @edited_rows_codes.count\n end",
"def height\n rows\n end",
"def lines\n self\n end",
"def emotes_size(key)\n self.emotes.select { |e| e.emoji == key }.size\n end",
"def font_size\r\n @style.font_size || @default_font_size\r\n end",
"def lines\n return self.sale.file_content.lines[self.begins_at_line..self.ends_at_line]\n end",
"def length\n @line.length\n end",
"def line_length(line)\n line.chomp.gsub(/\\e\\[[\\d;]*m/, '').length\n end",
"def line_count\n\t\t\treturn @contents.nil? ? 0 : @contents.count\n\t\tend",
"def text_size s, f = font\n f.text_size s\n end",
"def text_size s, f = font\n f.text_size s\n end",
"def adjust_height\n self.height = fitting_height(1 + @max_lines)\n end",
"def outline_count\n outlines.count\n end",
"def num_inputs\n @char_width * @char_height\n end",
"def maatsf_total_line_width(y = 0)\n contents_width\n end",
"def lines\n content.lines.map(&:chomp)\n end",
"def line_length(line_index)\n @line_lengths[line_index]\n end",
"def size\n size = from_io_console\n size ||= from_readline\n size ||= from_tput\n size ||= from_stty\n size ||= from_env\n size ||= from_ansicon\n size || default_size\n end",
"def cursor_height(_viewport, item_size)\n return item_size\n end",
"def size\n console.winsize\n end",
"def max_text_width(text)\n text.split(/\\r\\n/).map {|t| t.length}.max\n end",
"def maatsf_total_line_width(y = 0)\n contents_width - new_line_x\n end",
"def line_width(value=nil)\n set RGhost::LineWidth.new(value)\n end"
] | [
"0.71317625",
"0.5916596",
"0.5855405",
"0.5706847",
"0.5706847",
"0.5629682",
"0.5605443",
"0.55275047",
"0.54887915",
"0.5383004",
"0.536081",
"0.53225744",
"0.52563536",
"0.52533966",
"0.5248578",
"0.521122",
"0.51969016",
"0.515944",
"0.51562744",
"0.5149807",
"0.51367706",
"0.5135419",
"0.5128822",
"0.51189715",
"0.5103073",
"0.508501",
"0.505237",
"0.505237",
"0.50501895",
"0.501006",
"0.4971976",
"0.49626088",
"0.49594676",
"0.49564108",
"0.4956074",
"0.4952449",
"0.49512082",
"0.4948807",
"0.49411717",
"0.4932154",
"0.4919617",
"0.49173847",
"0.48728368",
"0.4872311",
"0.48581278",
"0.48388293",
"0.48368096",
"0.48114482",
"0.4811149",
"0.4810709",
"0.4810709",
"0.4799631",
"0.47919068",
"0.47638443",
"0.47633505",
"0.47529137",
"0.4749428",
"0.47455174",
"0.47444624",
"0.47288594",
"0.47143862",
"0.47072107",
"0.4702965",
"0.47011048",
"0.4698423",
"0.46978673",
"0.46913502",
"0.46913502",
"0.46912095",
"0.46898586",
"0.46894485",
"0.4686221",
"0.46685788",
"0.466797",
"0.4665053",
"0.4661238",
"0.4661238",
"0.4661238",
"0.4659241",
"0.46241608",
"0.4624034",
"0.46239385",
"0.46170542",
"0.46120733",
"0.46094868",
"0.46065584",
"0.45987475",
"0.45987475",
"0.4587885",
"0.4580712",
"0.45672843",
"0.45618087",
"0.45616192",
"0.45566022",
"0.45434013",
"0.45393333",
"0.45265302",
"0.45241323",
"0.4519928",
"0.45067832"
] | 0.7022846 | 1 |
Sets the linesForEditing property value. The size of the text box. | def lines_for_editing=(value)
@lines_for_editing = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def lines_for_editing\n return @lines_for_editing\n end",
"def tabsize=(value)\n\t\t\teditor.tabsize= value\n\t\tend",
"def set_iline( string = \"\" )\n return if @testing\n Curses::curs_set 0\n @win_interaction.setpos( 0, 0 )\n @win_interaction.addstr( \"%-#{Curses::cols}s\" % string )\n @win_interaction.refresh\n Curses::curs_set 1\n string.length\n end",
"def lines=(v)\n Axlsx.validate_int v\n @lines = v\n end",
"def text_area_options\n { :cols => 30, :rows => 3 }\n end",
"def setMarginBottom(size)\n @textBox.set_margin_bottom(size)\n self\n end",
"def adjust_height\n self.height = fitting_height(1 + @max_lines)\n end",
"def display_lines( text, rows = DEFAULT_ROWS_TEXTAREA, cols = DEFAULT_COLS_TEXTAREA )\n html = String.new\n html += \"<textarea class=\\\"form-control\\\" rows=\\\"#{ rows }\\\" cols=\\\"#{ cols }\\\" readonly>#{text}</textarea>\"\n html.html_safe\n end",
"def set_lines\n set_line(:line_item, OLE_QA::Framework::OLEFS::Line_Item)\n end",
"def lines\n @lines ||= Vedeu::Editor::Lines.coerce(data)\n end",
"def max_lines\n (contents.width / line_height) - 1\n end",
"def multiline_lines=(multiline_lines)\n if !multiline_lines.nil? && multiline_lines < 0\n fail ArgumentError, 'invalid value for \"multiline_lines\", must be greater than or equal to 0.'\n end\n\n @multiline_lines = multiline_lines\n end",
"def line_height\n TDD::ABF::SETTINGS::OVERRIDE_LINE_HEIGHT[name] || @info[:lineHeight]\n end",
"def set_Size(value)\n set_input(\"Size\", value)\n end",
"def set_lines(lines:, align: \"left\")\n if lines.length >= @max_row\n set_string(row: 0, string: lines[0].to_s, align: align)\n set_string(row: 1, string: lines[1].to_s, align: align)\n else\n set_string(row: 0, string: lines[0].to_s, align: align)\n end\n end",
"def setRemoveEmptyLines(value)\n @fields['remove_empty_lines'] = value\n self\n end",
"def line_height=(line_height)\n set_line_height(line_height)\n generate_buffers\n end",
"def setCanvasSize(size)\n unless /(?i)^(A0|A1|A2|A3|A4|A5|A6|Letter)$/.match(size)\n raise Error.new(Pdfcrowd.create_invalid_value_message(size, \"setCanvasSize\", \"image-to-image\", \"Allowed values are A0, A1, A2, A3, A4, A5, A6, Letter.\", \"set_canvas_size\"), 470);\n end\n \n @fields['canvas_size'] = size\n self\n end",
"def setCanvasSize\n if @intTargetX.to_s.to_i > 20 and @intTargetY.to_s.to_i > 20\n puts('setting new dimetions')\n @canvasRefrance.resizeCanvas(@intTargetY.to_s.to_i,@intTargetX.to_s.to_i)\n else \n puts('setting defult dimentions')\n @canvasRefrance.resizeCanvas(@minDimensions,@minDimensions)\n end\n end",
"def line_width(value=nil)\n set RGhost::LineWidth.new(value)\n end",
"def set_line_style(width=1,dot_size=0)\n @line_width = width\n @line_dot_size = dot_size\n end",
"def allow_multiple_lines=(value)\n @allow_multiple_lines = value\n end",
"def setup_style\n self.read_only = true\n self.word_wrap_mode = Qt::TextOption::WrapAnywhere\n end",
"def reposition_entry\n prompt_width = @lines.last.text_width\n @text_entry.x = self.x + prompt_width - @text_entry.borderX/2\n @text_entry.y = @lines.last.y - 21\n @text_entry.width = self.width - @text_entry.x\n #@text_entry.recalculate_maxlength\n end",
"def set_lines\n create_data_line(1)\n end",
"def linewidth=(lineWidth)\n @elementHash[:linewidth] = lineWidth\n end",
"def screen_size=(new_screen_size)\n\t try_set_screen\n Klass.setScreenSize(@handle, Phidgets::FFI::TextLCDScreenSizes[new_screen_size])\n\t \n\t load_rows(@index) #readjust screen rows\n new_screen_size\n end",
"def SetFontSize(size)\n\t\t#Set font size in points\n\t\tif (@font_size_pt== size)\n\t\t\treturn;\n\t\tend\n\t\t@font_size_pt = size;\n\t\t@font_size = size.to_f / @k;\n\t\tif (@page > 0)\n\t\t\tout(sprintf('BT /F%d %.2f Tf ET', @current_font['i'], @font_size_pt));\n\t\tend\n\tend",
"def resize(nsize, opt = {})\n nsize = nsize.cap_x(opt[:max_width]) # Enforce max width.\n new_body = ''\n (0...nsize.y).each do |y|\n (0...nsize.x).each do |x|\n new_body += (lines[y] || {})[x] || FILL\n end\n new_body += \"\\n\"\n end\n @body = new_body\n end",
"def setContents(list, list_size)\n if !self.createList(list, list_size)\n return\n end\n\n # Set the information in the scrolling list.\n @scroll_field.set(@list, @list_size, false,\n @scroll_field.highlight, @scroll_field.box)\n\n # Clean out the entry field.\n self.setCurrentItem(0)\n @entry_field.clean\n\n # Redraw the widget.\n self.erase\n self.draw(@box)\n end",
"def set_focus\n\t\[email protected]\n\tend",
"def marker_font_size=(value)\n @marker_font.size = value\n end",
"def setWrap(bool)\n @textBox.wrap=bool\n self\n end",
"def rows=(rows)\n resize_field rows, @columns\n end",
"def default_line_height\n Fonts.line_height(current_layout.default_font)\n end",
"def edited(&block)\n self.listen_to :event => :lineupdated, &block\n end",
"def lines\n @lines ||= build_lines\n end",
"def size\n prompt_size + text_size\n end",
"def test_line_height\n w = Window_Selectable_Implemented.new(160,0,160,128,$data_items.compact, 48)\n @windows.push(w)\n end",
"def edit_line lineno=@current_index\n line = self[lineno]\n prompt = \"Edit: \"\n maxlen = 80\n config={}; \n oldline = line.dup\n config[:default] = line\n ret, str = rb_getstr(@form.window, $error_message_row, $error_message_col, prompt, maxlen, config)\n $log.debug \" rb_getstr returned #{ret} , #{str} \"\n return if ret != 0\n # we possibly cou;d have done []= but maybe in textpad or something that would replace a row pointer ??\n self[lineno].replace(str)\n fire_handler :CHANGE, InputDataEvent.new(0,oldline.length, self, :DELETE_LINE, lineno, oldline) # 2008-12-24 18:34 \n fire_handler :CHANGE, InputDataEvent.new(0,str.length, self, :INSERT_LINE, lineno, str)\n fire_row_changed lineno\n end",
"def set_lines\n set_line(:receiving_line,OLE_QA::Framework::OLEFS::Receiving_Line)\n end",
"def line_height\r\n 15\r\n end",
"def init_line_structures(minsize)\r\n if @invisible_line.nil? # initialize it\r\n if (@line_size < minsize)\r\n @line_size = minsize\r\n end\r\n @visible_line = 0.chr * @line_size\r\n @invisible_line = 0.chr * @line_size # 1.chr\r\n elsif (@line_size < minsize) # ensure it can hold MINSIZE chars\r\n @line_size *= 2\r\n if (@line_size < minsize)\r\n @line_size = minsize\r\n end\r\n @visible_line << 0.chr * (@line_size - @visible_line.length)\r\n @invisible_line << 1.chr * (@line_size - @invisible_line.length)\r\n end\r\n @visible_line[minsize,@line_size-minsize] = 0.chr * (@line_size-minsize)\r\n @invisible_line[minsize,@line_size-minsize] = 1.chr * (@line_size-minsize)\r\n\r\n if @vis_lbreaks.nil?\r\n @inv_lbreaks = []\r\n @vis_lbreaks = []\r\n @_rl_wrapped_line = []\r\n @inv_lbreaks[0] = @vis_lbreaks[0] = 0\r\n end\r\n end",
"def affected_lines_range\n (line_no..line_no + replaced_text.count(\"\\n\"))\n end",
"def editor_delete_line!\n Vedeu.bind(:_editor_delete_line_) do |name|\n Vedeu.documents.by_name(name).delete_line\n end\n end",
"def normalised_lines(lines)\n max_length = lines.collect(&:visual_length).max\n lines.map do |line|\n FTT::Text.new(line.to_s).right_pad(max_length)\n end\n end",
"def size=(size)\n @size = size\n resize\n end",
"def setBackgroundSize(width,height)\n @textBox.set_size_request(width,height)\n self\n end",
"def window_line_size\n lines - 2\n end",
"def change_font_size\n @font_size = 20*(@size_slider.value*2)+20\n #Use change_font_decor to maintain if font is bold or not\n change_font_decor\n end",
"def set_Height(value)\n set_input(\"Height\", value)\n end",
"def fontsize=(fontSize)\n @elementHash[:fontsize] = fontSize.to_f\n end",
"def line_max\n return @line_max if @line_max\n return @line_max = contents_height / line_height\n end",
"def textareas; end",
"def textarea(name = \"\", cols = 70, rows = 10) # :yield:\n attributes = if name.kind_of?(String)\n { \"NAME\" => name, \"COLS\" => cols.to_s,\n \"ROWS\" => rows.to_s }\n else\n name\n end\n super(attributes)\n end",
"def size=(size)\n self.width = self.height = @size = size\n end",
"def lines\n @document.lines @line_numbers\n end",
"def set_line_mode(data = \"\")\n @data_mode = :lines\n (@linebuffer ||= []).clear\n receive_data data.to_s\n end",
"def update_dimensions\n spacer=@hex_width # 3-char space between areas\n ui_width = @addr_width + (spacer*4) # addr sp sp hex sp ascii sp\n\n @columns = (client_size.width - ui_width) / (@hex_width + @asc_width*2)\n @columns = 1 if @columns < 1\n @rows = (@data.size / @columns)+1\n\n # calculate hex/ascii area boundaries\n @hex0 = @addr_width + spacer*2\n @hexN = @hex0 + (@columns * (@hex_width+@asc_width))\n @asc0 = @hexN + spacer\n @ascN = @asc0 + (@columns * @asc_width)\n @row_width = @ascN - @addr_width - @hex_width\n\n # update scroll-bar info\n old_pos=first_visible_line\n set_line_count(@rows)\n scroll_to_line(old_pos)\n end",
"def refresh(lines)\n @prompt.clear_lines(lines) +\n @prompt.cursor.clear_screen_down\n end",
"def height(lines=1)\n return @font.height * lines + 4 # Where's this magic '4' come from?\n end",
"def new_line\n biggest = @biggest_text_height > WLH ? @biggest_text_height : WLH\n @contents_x = 0 \n @contents_y += biggest\n @biggest_text_height = WLH\n end",
"def height\n lines.size\n end",
"def height\n lines.size\n end",
"def default_line_height\n return Fonts.line_height(current_layout.default_font)\n end",
"def line_style(data_set_index, options={})\n @line_styles[data_set_index] = \"#{options[:line_thickness]}\"\n @line_styles[data_set_index] += \",#{options[:length_segment]},#{options[:length_blank]}\" if options[:length_segment]\n end",
"def line_height(*args, &block)\n MARW_CONFIGURATION[:line_height] < 18 ? super(*args, &block) : MARW_CONFIGURATION[:line_height]\n end",
"def adjusts_font_size_to_fit_width ; view.adjustsFontSizeToFitWidth ; end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def line_items_count\n self.line_items.size\n end",
"def initialize form=nil, config={}, &block\n\n @editable = false\n @focusable = true\n @config = config\n @prow = @pcol = 0\n @startrow = 0\n @startcol = 0\n @list = []\n super\n\n # FIXME 0 as height craps out. need to make it LINES\n\n #@height = @height.ifzero(FFI::NCurses.LINES)\n #@width = @width.ifzero(FFI::NCurses.COLS)\n @rows = @height\n @cols = @width\n @startrow = @row\n @startcol = @col\n #@suppress_border = config[:suppress_border]\n @row_offset = @col_offset = 1\n unless @suppress_border\n @startrow += 1\n @startcol += 1\n @rows -=3 # 3 is since print_border_only reduces one from width, to check whether this is correct\n @cols -=3\n end\n @row_offset = @col_offset = 0 if @suppress_borders\n @top = @row\n @left = @col\n @lastrow = @row + 1\n @lastcol = @col + 1\n init_vars\n end",
"def size=(size)\n instance_set(:size, size)\n end",
"def set_Length(value)\n set_input(\"Length\", value)\n end",
"def update_size\n @max_x = @glade['drawingarea'].allocation.width - 1\n @max_y = @glade['drawingarea'].allocation.height - 1\n @glade['xvalue'].set_range(1,@max_x)\n @glade['yvalue'].set_range(1,@max_y)\n end",
"def change_font_size(font_size = 10)\n validate_worksheet\n raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)\n\n font = get_cell_font.dup\n font.set_size(font_size)\n update_font_references(font)\n end",
"def change_font_size(font_size = 10)\n validate_worksheet\n raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)\n\n font = get_cell_font.dup\n font.set_size(font_size)\n update_font_references(font)\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 set_textline\n @textline = Textline.find(params[:id])\n end",
"def text_area; end",
"def set_Width(value)\n set_input(\"Width\", value)\n end",
"def setcharheight(*)\n super\n end",
"def build_window\n max = @choices.size\n max = MaxChoice if max > MaxChoice\n self.height = max * default_line_height + window_builder[5] + window_builder[-1]\n refresh\n end",
"def paper_size=(size)\n RestrictionValidator.validate 'paper_size', (1..118), size\n @paper_size = size\n end",
"def update\n return unless @max_size\n return unless (text = Input.get_text)\n load_text(text)\n end",
"def row_height=(value)\n @row_height = value\n end",
"def columns=(columns)\n resize_field @rows, columns\n end",
"def display_lines(min, max); end",
"def max_length=(new_max_length)\n @max_length = new_max_length\n chars = @text.scan(/./m)\n @text = chars[0, @max_length].join if chars.size > @max_length\n self.cursor_move_to_end if @cursor_position > chars.size\n end",
"def num_lines_in_view()\n\t\tlast_line_in_view() - first_line_in_view() + 1\n\tend",
"def height \n @height || text_area_height + 2*@vertical_padding\n end",
"def initialize(parent = nil, name = nil) \n\t\tsuper(parent, name)\n\t\tviewport.set_w_flags(Qt::WNoAutoErase | Qt::WStaticContents)\n\t\tset_static_background(true)\n\n\t\t@invalid_rows = []\n\t\n\t\t@model = TextModel.new()\n\t\[email protected]_first_line_in_view_handler { first_line_in_view }\n\t\[email protected]_last_line_in_view_handler { last_line_in_view }\n\t\[email protected]_changed_handler { |invalid_rows| @invalid_rows = invalid_rows; repaint_contents(false) }\n\n\t\tset_enabled(true)\n\t\tset_focus_policy(Qt::Widget::StrongFocus)\n\n\t\tresize(500, 500)\n\tend",
"def resize width = max_width, height = max_height\n @form.resize width, height\n self.write Mine::Key.RESIZE\n end",
"def size\n line.size\n end",
"def Edit_GetLine(hwndCtl, line, lpch, cchMax)\n # ((*((int*)(lpch)) = (cchMax)),\n send_edit_message(hwndCtl, EM_GETLINE, line, lpch)\n end",
"def set_font_size size\n @font = @font_cache[size]\n return if (@font)\n @font = Gosu::Font.new(\n size,\n name: @settings.get(:font_name)\n )\n @font_cache[size] = @font\n end",
"def text_area_width\n width - 2*@horizontal_padding\n end",
"def window_update(oline)\n if oline != nil\n #text = \"\"\n @last_color = 0\n @contents_x = 0\n @contents_y = 0\n @biggest_text_height = 0\n @cControlsList.clear()\n for l in oline\n next if l == nil\n converted_line = convert_special_characters(l)\n generate_controls(converted_line)\n new_line\n end\n\n # Changes contents size for scrolling\n self.contents.dispose\n self.contents = Bitmap.new(self.width - 32, [self.height - 32, @contents_y].max)\n self.oy = 0\n end\n \n refresh()\n end"
] | [
"0.57657236",
"0.5531479",
"0.5376552",
"0.5371425",
"0.5370802",
"0.53644997",
"0.5220621",
"0.5202362",
"0.5171742",
"0.5160064",
"0.5160053",
"0.5148227",
"0.5131868",
"0.49475008",
"0.49388665",
"0.48577872",
"0.4838324",
"0.4826996",
"0.482041",
"0.4816033",
"0.4813137",
"0.47923338",
"0.47708195",
"0.47466248",
"0.47324383",
"0.47272658",
"0.47065634",
"0.4693071",
"0.4684133",
"0.466039",
"0.46545526",
"0.46394256",
"0.46371812",
"0.46258894",
"0.46211854",
"0.46202984",
"0.45998427",
"0.45866945",
"0.45590776",
"0.45535982",
"0.4540755",
"0.45394796",
"0.45341855",
"0.45332164",
"0.4511092",
"0.44975162",
"0.44850945",
"0.44820836",
"0.4477657",
"0.44751874",
"0.44599065",
"0.44533417",
"0.44387352",
"0.44278756",
"0.442649",
"0.44224656",
"0.44130346",
"0.44061947",
"0.44052264",
"0.4389674",
"0.43849266",
"0.43761382",
"0.43553066",
"0.43553066",
"0.4351053",
"0.4343076",
"0.4336512",
"0.43231803",
"0.43230578",
"0.43230578",
"0.43230578",
"0.43230578",
"0.43200314",
"0.4318064",
"0.43165267",
"0.43120992",
"0.4312033",
"0.43108916",
"0.43108916",
"0.4308919",
"0.43079478",
"0.43016228",
"0.4289652",
"0.42838138",
"0.42837408",
"0.42814758",
"0.42808735",
"0.42766014",
"0.42761743",
"0.4272594",
"0.42642486",
"0.42605466",
"0.42564926",
"0.42564192",
"0.42490482",
"0.4245484",
"0.4244551",
"0.42399484",
"0.42346573",
"0.42299795"
] | 0.76545715 | 0 |
Gets the maxLength property value. The maximum number of characters for the value. | def max_length
return @max_length
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def maximal_length\n if !self.value.blank? && self.maxLength\n errors.add(:value, 'is too long!') if self.value.length > self.maxLength\n end\n end",
"def max_length\n MAX_LENGTH\n end",
"def max_length=(value)\n @max_length = value\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def limit_value\n length\n end",
"def max_length(value, pdef)\n if(value.length <= pdef['MaxLength'].to_i)\n true\n else\n \"Value must not exceed #{pdef['MaxLength']} characters\"\n end\n end",
"def length\n @length.kind_of?(Range) ? @length.max : @length\n end",
"def length\n [default&.length, max_content_length].compact.max\n end",
"def max_field_length\n if fields.is_a? Array\n fields.map { |f| f.to_s.length }.max\n else\n fields.to_s.length\n end\n end",
"def max_length(max_size=0, options={}, &block)\n return length_between(0, max_size, options, &block)\n rescue Exception => e\n validation_error(\"#{e.message}\")\n end",
"def suggestedNumber\r\n return self.maxLength\r\n end",
"def text_field_max\n return nil unless hidden_field_max\n hidden_field_max.divmod(hidden_field_step).first * text_field_step\n # fetch_options('max', text_field_name) # default)\n end",
"def max=(length)\n @string_rule.max = length\n end",
"def value_length(value)\n value.length\n rescue NoMethodError\n value.to_s.length\n end",
"def max_size\n @max_size ||= options[:max_size] || [DEFAULT_MAX_SIZE, min_size].max\n end",
"def maxsize(value)\n merge(ormaxsize: value.to_s)\n end",
"def max_size_in_megabytes\n to_i description['MaxSizeInMegabytes']\n end",
"def max\n @max ||= map {|a| a[0].length}.max\n end",
"def get_max_char_value(codegen)\n maxval = 255 # codegen.grammar.get????();\n if (maxval <= 255)\n return 255\n else\n return maxval\n end\n end",
"def tag_content_max_length\n limits_yaml = YAML.load_data!(\"#{ECON_DATA_PATH}/limits.yml\")\n return limits_yaml['tag_content_max_length']\n end",
"def max_length(attribute)\n return 0 if items.empty?\n items.map(&attribute.to_sym).max_by(&:length).size\n end",
"def maxvalue\n MAXVALUE\n end",
"def max_node_value_length\n max_length = 0\n all_node_values_with_nil.each do |value|\n value_length = value.to_s.length\n max_length = value_length if value_length > max_length\n end\n return max_length\n end",
"def length\n (lines.max_by(&:length) || '').size\n end",
"def size\n @max\n end",
"def maximum\n return @maximum\n end",
"def max_value_size\n @max_value_size ||= options[:values].max { |a, b| a.size <=> b.size }.size\n end",
"def max_identifier_length\n @max_identifier_length ||= select_one('SHOW max_identifier_length', 'SCHEMA'.freeze)['max_identifier_length'].to_i\n end",
"def custom_command_content_max_length\n limits_yaml = YAML.load_data!(\"#{ECON_DATA_PATH}/limits.yml\")\n return limits_yaml['custom_command_content_max_length']\n end",
"def maxStringLength\n\t\tweight = @dictionaries.inject(1) { |x, d| x * d.length }\n\t\tbits = (Math.log(weight)/Math.log(2)).floor\n\t\tchars = bits/4\n\tend",
"def get_text_field_maxlength(object, attribute_name)\n ret = nil\n unless object.blank?\n klass = object.class\n if ActiveRecord::Base.check_for_model_class?(klass) and klass.table_exists?\n connection = ActiveRecord::Base.connection\n column = connection.columns(klass.table_name.to_sym).find do |c|\n c.name == \"#{attribute_name}\"\n end\n if column and column.type == :string and\n column.limit.to_s.is_numeric?({:decimals => false})\n ret = column.limit.to_i\n end\n end\n end\n return ret\n end",
"def max_size()\n AUTHENTICATION_REPLY_MAX_SIZE\n end",
"def length\n # TODO: add a default for length if not in params (instead of just 5!)\n @params[:length].to_i > 0 ? @params[:length].to_i : 5 # or use @cfg[:default][:length].to_i\n end",
"def max_size()\n ACCOUNTING_REPLY_MAX_SIZE\n end",
"def tag_name_max_length\n limits_yaml = YAML.load_data!(\"#{ECON_DATA_PATH}/limits.yml\")\n return limits_yaml['tag_name_max_length']\n end",
"def max\n if valid?\n max_value\n end\n end",
"def set_Length(value)\n set_input(\"Length\", value)\n end",
"def length\n value.length\n end",
"def max_size\n @group.max_size\n end",
"def max_length(attrs, length)\n Array(attrs).each do |attr|\n error(attr, \"is too long (maximum is #{length} characters)\") if @object.send(attr).size > length\n end\n end",
"def validates_max_length(max, atts, opts={})\n validatable_attributes(atts, opts){|a,v,m| (m || \"is longer than #{max} characters\") unless v && v.length <= max}\n end",
"def max_length=(new_max_length)\n @max_length = new_max_length\n chars = @text.scan(/./m)\n @text = chars[0, @max_length].join if chars.size > @max_length\n self.cursor_move_to_end if @cursor_position > chars.size\n end",
"def limit_size(str, max)\n if str.length > max\n return str[0...max]\n end\n str\n end",
"def limit_size(str, max)\n if str.length > max\n return str[0...max]\n end\n str\n end",
"def maximum (value = nil)\n\t\tif value\n\t\t\traise_if_error C.glyr_opt_number(to_native, value)\n\t\telse\n\t\t\tto_native[:number]\n\t\tend\n\tend",
"def maximum=(value)\n @maximum = value\n end",
"def max=(value)\r\n @max = value\r\n shift while @store.length > @max\r\n end",
"def max_folder_size\n @attributes[:max_folder_size]\n end",
"def maximum_limit\n 100\n end",
"def max_memory\n domain_info[:maxMem]\n end",
"def max_memory\n domain_info[:maxMem]\n end",
"def max_uses\n @attributes[:max_uses]\n end",
"def get_max\n @max\n end",
"def _unix_max_line_length\n # Based on autoconf's arg_max calculator, see\n # http://www.in-ulm.de/~mascheck/various/argmax/autoconf_check.html\n calc_line_max = 'i=0 max= new= str=abcd; \\\n while (test \"X\"`echo \"X$str\" 2>/dev/null` = \"XX$str\") >/dev/null 2>&1 && \\\n new=`expr \"X$str\" : \".*\" 2>&1` && \\\n test \"$i\" != 17 && \\\n max=$new; do \\\n i=`expr $i + 1`; str=$str$str;\\\n done; echo $max'\n line_max = session.shell_command_token(calc_line_max).to_i\n\n # Fall back to a conservative 4k which should work on even the most\n # restrictive of embedded shells.\n line_max = (line_max == 0 ? 4096 : line_max)\n vprint_status(\"Max line length is #{line_max}\")\n\n line_max\n end",
"def wordMax\n @wordMax\n end",
"def length\n @val.length\n end",
"def max_digits size\n (1..size).map{|x| x.to_s.size}.max\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def maximum_capacity\n read_attribute(:maximum_capacity) || room.try(:capacity)\n end",
"def max(value)\n opts[:max] = value\n end",
"def max_size; end",
"def limit(value)\n merge(wbeulimit: value.to_s)\n end",
"def item_max\n return @enumeration.length\n end",
"def longest_string_length\n longest_string.size\n end",
"def max_size()\n AUTHENTICATION_START_MAX_SIZE\n end",
"def maximum_duration\n return @maximum_duration\n end",
"def length_in_long_words\n return @bits.attr_length\n end",
"def max_age\n\t\t\t\t\tfind_integer_value(MAX_AGE)\n\t\t\t\tend",
"def length\n @config[:length]\n end",
"def get_max_field()\n 0\n end",
"def maximum_value\n @maximum_value || store.max\n end",
"def get_max_range\n return @maxRange\n end",
"def max_len_column(j)\n column_collect(j) {|x| x.to_s.length}.max\n end",
"def max\n @max ||= define_min_and_max && @max\n end",
"def find_longest_field\n\t\t\tcurrent_longest = nil\n\t\t\t@api_model.schema.each do |field|\n\t\t\t\tif current_longest == nil || field[0].length > current_longest\n\t\t\t\t\tcurrent_longest = field[0].length\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn current_longest\n\t\tend",
"def maximum_duration=(value)\n @maximum_duration = value\n end",
"def s_maxage\n\t\t\t\t\tfind_integer_value(S_MAXAGE)\n\t\t\t\tend",
"def max_memory\n configuration.max_memory\n end",
"def max_frame_size\n defined?(@max_frame_size) ? @max_frame_size : WebSocket.max_frame_size\n end",
"def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end",
"def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end",
"def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end",
"def max\n @max\n end",
"def max\n @max\n end",
"def max\n @maxNumber\n end",
"def max_key_age()\n\t\t\treturn @metadata.attributes[:max_key_age].to_i\n\t\tend",
"def findMax(a)\n\ta.length\nend",
"def max\n data.max\n end",
"def exceeds_max_length?\n input.match(Patterns::ALPHABETICAL_PATTERN) && input.length > 15\n end"
] | [
"0.8447109",
"0.82382596",
"0.80090624",
"0.7692626",
"0.7692626",
"0.7692626",
"0.7692626",
"0.7687205",
"0.7569953",
"0.7223672",
"0.7191999",
"0.7089905",
"0.703267",
"0.7024757",
"0.68754363",
"0.68093157",
"0.6791841",
"0.6719554",
"0.6642381",
"0.66059464",
"0.6605477",
"0.65698427",
"0.6566662",
"0.6513627",
"0.65020895",
"0.64842796",
"0.6477724",
"0.6388733",
"0.6382886",
"0.6378054",
"0.63762903",
"0.63676167",
"0.634052",
"0.633029",
"0.6325431",
"0.631259",
"0.6294837",
"0.62811524",
"0.627379",
"0.6252271",
"0.6242224",
"0.62154436",
"0.62093395",
"0.6199316",
"0.6190187",
"0.6176004",
"0.6176004",
"0.61615205",
"0.61120653",
"0.6103052",
"0.609611",
"0.6091378",
"0.6087235",
"0.6087235",
"0.607943",
"0.6069884",
"0.60693854",
"0.60369027",
"0.6032837",
"0.6028524",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6015943",
"0.6008748",
"0.6006117",
"0.60047233",
"0.6001468",
"0.60011613",
"0.59995556",
"0.5990288",
"0.59851193",
"0.59719235",
"0.59381914",
"0.5934462",
"0.59232605",
"0.5920479",
"0.5908777",
"0.59075713",
"0.59019",
"0.5898048",
"0.5896777",
"0.58801466",
"0.58790565",
"0.5869955",
"0.5864786",
"0.5864786",
"0.5864786",
"0.58646554",
"0.58646554",
"0.5860445",
"0.58487034",
"0.58347374",
"0.582666",
"0.5815223"
] | 0.8345751 | 1 |
Sets the maxLength property value. The maximum number of characters for the value. | def max_length=(value)
@max_length = value
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def set_MaxLength(value)\n set_input(\"MaxLength\", value)\n end",
"def maximal_length\n if !self.value.blank? && self.maxLength\n errors.add(:value, 'is too long!') if self.value.length > self.maxLength\n end\n end",
"def max=(length)\n @string_rule.max = length\n end",
"def max_length=(new_max_length)\n @max_length = new_max_length\n chars = @text.scan(/./m)\n @text = chars[0, @max_length].join if chars.size > @max_length\n self.cursor_move_to_end if @cursor_position > chars.size\n end",
"def set_Length(value)\n set_input(\"Length\", value)\n end",
"def max_length(value, pdef)\n if(value.length <= pdef['MaxLength'].to_i)\n true\n else\n \"Value must not exceed #{pdef['MaxLength']} characters\"\n end\n end",
"def max_length\n MAX_LENGTH\n end",
"def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end",
"def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end",
"def set_MaxRecords(value)\n set_input(\"MaxRecords\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def set_Max(value)\n set_input(\"Max\", value)\n end",
"def max_length\n return @max_length\n end",
"def max_length(max_size=0, options={}, &block)\n return length_between(0, max_size, options, &block)\n rescue Exception => e\n validation_error(\"#{e.message}\")\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxRows(value)\n set_input(\"MaxRows\", value)\n end",
"def set_MaxEntries(value)\n set_input(\"MaxEntries\", value)\n end",
"def limit_value\n length\n end",
"def set_Maximum(value)\n set_input(\"Maximum\", value)\n end",
"def validates_max_length(max, atts, opts={})\n validatable_attributes(atts, opts){|a,v,m| (m || \"is longer than #{max} characters\") unless v && v.length <= max}\n end",
"def length=(new_length) #:nodoc:\n if new_length == :unlimited\n @length = UNLIMITED_OCCURRENCES\n else\n @length = new_length\n end\n end",
"def set_max(max)\n self[:max] = (max > 0 ? max : 1)\n end",
"def maximum=(value)\n @maximum = value\n end",
"def set_maxsize(options)\n if options.has_key?(:maxsize) || options.has_key?('maxsize')\n maxsize = options[:maxsize] || options['maxsize']\n\n multiplier = 1\n if (maxsize =~ /\\d+KB/)\n multiplier = 1024\n elsif (maxsize =~ /\\d+MB/)\n multiplier = 1024 * 1024\n elsif (maxsize =~ /\\d+GB/)\n multiplier = 1024 * 1024 * 1024\n end\n\n _maxsize = maxsize.to_i * multiplier\n\n if _maxsize.class != Fixnum and _maxsize.class != Bignum\n raise TypeError, \"Argument 'maxsize' must be an Fixnum\", caller\n end\n if _maxsize == 0\n raise TypeError, \"Argument 'maxsize' must be > 0\", caller\n end\n @maxsize = _maxsize\n else\n @maxsize = 0\n end\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def set_Limit(value)\n set_input(\"Limit\", value)\n end",
"def max=(value)\r\n @max = value\r\n shift while @store.length > @max\r\n end",
"def max_length(attrs, length)\n Array(attrs).each do |attr|\n error(attr, \"is too long (maximum is #{length} characters)\") if @object.send(attr).size > length\n end\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_MaxId(value)\n set_input(\"MaxId\", value)\n end",
"def set_max( max )\n if IntegerOption.bounds_ok?( @min, max )\n @max = max\n else\n @max = nil\n raise \"invalid upper bound: #{ max.to_s }\"\n end\n end",
"def set_MaxID(value)\n set_input(\"MaxID\", value)\n end",
"def set_MaxID(value)\n set_input(\"MaxID\", value)\n end",
"def assert_max_length(model, attribute, max_length, message = nil, options = {})\n original_value = model.send(attribute)\n original_valid = model.valid?\n setter = :\"#{attribute}=\"\n\n if message.is_a?(Hash)\n options = message.merge(options || {})\n message = nil\n end\n\n pre = options[:start].to_s\n post = options[:end].to_s\n len = max_length - pre.length - post.length\n\n # try with maximum valid length.\n value = pre + ('a' * len) + post\n model.send setter, value\n assert model.valid?, message ? (message + \": !(#{value.length})\") : \"Should allow a string of #{value.length} characters.\"\n\n # try with one extra character.\n value = pre + ('a' * (len + 1)) + post\n model.send setter, value\n assert_not model.valid?, message ? (message + \": (#{value.length})\") : \"Should not allow a string of #{value.length} characters.\"\n\n model.send setter, original_value\n if original_valid\n assert model.valid?, message ? (message + \": !(#{original_value.inspect})\") : \"Should allow #{attribute} to be set back to '#{original_value.inspect}'.\"\n end\n end",
"def textarea_value_length_constraints_validation\n errors.add :value, I18n.t('errors.messages.too_short', count: value.size) if min_char_count && value.size < min_char_count\n errors.add :value, I18n.t('errors.messages.too_long', count: value.size) if max_char_count && value.size > max_char_count\n end",
"def max(value)\n opts[:max] = value\n end",
"def maxsize(value)\n merge(ormaxsize: value.to_s)\n end",
"def truncate(max)\n length = Math.min(max, length)\n self\n end"
] | [
"0.8746794",
"0.8746794",
"0.8746794",
"0.8746794",
"0.7654556",
"0.75876635",
"0.7441334",
"0.7243818",
"0.71112627",
"0.7097908",
"0.6882856",
"0.6882856",
"0.6882856",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6822817",
"0.6756118",
"0.6681912",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.668065",
"0.664459",
"0.664459",
"0.664459",
"0.664459",
"0.664459",
"0.664459",
"0.664459",
"0.664459",
"0.6623423",
"0.65915227",
"0.65790373",
"0.64881027",
"0.6428106",
"0.641899",
"0.6406492",
"0.64047277",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6388025",
"0.6382044",
"0.63735014",
"0.63323355",
"0.63323355",
"0.63323355",
"0.63323355",
"0.6331713",
"0.6331713",
"0.6331713",
"0.6331713",
"0.6330924",
"0.6330924",
"0.6330924",
"0.6328029",
"0.6258454",
"0.625649",
"0.6239442",
"0.6185641",
"0.6155977",
"0.6138204",
"0.6100351"
] | 0.85988724 | 4 |
Serializes information the current object | def serialize(writer)
raise StandardError, 'writer cannot be null' if writer.nil?
writer.write_boolean_value("allowMultipleLines", @allow_multiple_lines)
writer.write_boolean_value("appendChangesToExistingText", @append_changes_to_existing_text)
writer.write_number_value("linesForEditing", @lines_for_editing)
writer.write_number_value("maxLength", @max_length)
writer.write_string_value("@odata.type", @odata_type)
writer.write_string_value("textType", @text_type)
writer.write_additional_data(@additional_data)
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def serialize\n end",
"def serialize(object) end",
"def serialize; end",
"def serialize; end",
"def serialize\n \n end",
"def serialize\n raise NotImplementedError\n end",
"def serialize\n raise NotImplementedError\n end",
"def dump\r\n super + to_s\r\n end",
"def serialize\n self.to_hash.to_json\n end",
"def serialized\n serializer_class.new(self).serializable_hash\n end",
"def serialize\n @raw_data\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"identityType\", @identity_type)\n end",
"def serialize\n @serializer.serialize(self.output)\n end",
"def serialize(_object, data); end",
"def serialize(_object, data); end",
"def to_json\n\t\t\tself.instance_variable_hash\n\t\tend",
"def serializer; end",
"def serialize!\n end",
"def serialize(object)\n object.serializable_hash\n end",
"def serialize(object)\n object.to_s\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"device\", @device)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"keyStrength\", @key_strength)\n end",
"def marshal\n Marshal.dump self\n end",
"def marshal\n Marshal.dump self\n end",
"def marshal\n Marshal.dump self\n end",
"def inspect\n serialize.to_s\n end",
"def serialize\n YAML::dump(self)\n end",
"def inspect()\n serialize.to_s()\n end",
"def inspect()\n serialize.to_s()\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_collection_of_object_values(\"answers\", @answers)\n writer.write_object_value(\"assignment\", @assignment)\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionCalloutInstances\", @custom_extension_callout_instances)\n writer.write_enum_value(\"requestType\", @request_type)\n writer.write_object_value(\"requestor\", @requestor)\n writer.write_object_value(\"schedule\", @schedule)\n writer.write_enum_value(\"state\", @state)\n writer.write_string_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"initiator\", @initiator)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_date_time_value(\"visibleHistoryStartDateTime\", @visible_history_start_date_time)\n end",
"def inspect\n fields = serializable_hash.map { |k, v| \"#{k}=#{v}\" }\n \"#<#{self.class.name}:#{object_id} #{fields.join(' ')}>\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_primitive_values(\"aliases\", @aliases)\n writer.write_collection_of_object_values(\"countriesOrRegionsOfOrigin\", @countries_or_regions_of_origin)\n writer.write_object_value(\"description\", @description)\n writer.write_date_time_value(\"firstActiveDateTime\", @first_active_date_time)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_enum_value(\"kind\", @kind)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"targets\", @targets)\n writer.write_string_value(\"title\", @title)\n writer.write_object_value(\"tradecraft\", @tradecraft)\n end",
"def serialize(object, data); end",
"def serialize\n JSON.generate(to_h)\n end",
"def serialiaze\n Logger.d(\"Serializing the User object\")\n save_to_shared_prefs(@context, self.class, self)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"life\", @life)\n writer.write_object_value(\"per\", @per)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end",
"def inspect\n id_string = (respond_to?(:id) && !id.nil?) ? \" id=#{id}\" : ''\n \"#<#{self.class}:0x#{object_id.to_s(16)}#{id_string}> JSON: \" +\n Clever::JSON.dump(@values, pretty: true)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"owner\", @owner)\n writer.write_collection_of_object_values(\"properties\", @properties)\n writer.write_string_value(\"status\", @status)\n writer.write_collection_of_primitive_values(\"targetTypes\", @target_types)\n end",
"def write\n hash = attributes_hash\n write_value(serializer_class.dump(hash))\n @_cache = hash # set @_cache after the write\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_string_value(\"dataType\", @data_type)\n writer.write_boolean_value(\"isSyncedFromOnPremises\", @is_synced_from_on_premises)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_primitive_values(\"targetObjects\", @target_objects)\n end",
"def instance_to_json\n\t\t# byebug\n\t\t{\n\t\tid: self.id,\n\t\tname: self.name,\n\t\theight: self.height,\n\t\tlast_watered: self.last_watered,\n\t\tlast_watered_amount: self.last_watered_amount,\n\t\tgrow_zone: self.grow_zone,\n\t\tnotes: self.notes,\n\t\tplanted_date: self.planted_date,\n\t\tfarm: self.farm,\t\n\t\tsensor: self.sensor\n\t\t# farm: { \n\t\t# \tfarm: self.farm.name,\n\t\t# \tfarm: self.farm.id,\n\t\t# },\n\t\t}\n\tend",
"def _dump(depth)\n scrooge_fetch_remaining\n scrooge_invalidate_updateable_result_set\n scrooge_dump_flag_this\n str = Marshal.dump(self)\n scrooge_dump_unflag_this\n str\n end",
"def to_s\n \"#<#{self.class.name}:#{object_id} #{info}>\"\n end",
"def to_dump\n @time = Time.now\n Base64.encode64(Marshal.dump(self))\n end",
"def dump\n\t\t\t\tflatten!\n\t\t\t\t\n\t\t\t\tMessagePack.dump(@attributes)\n\t\t\tend",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def inspect\n serialize.to_s\n end",
"def serialize(options={})\n raise NotImplementedError, \"Please implement this in your concrete class\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"apiConnectorConfiguration\", @api_connector_configuration)\n writer.write_collection_of_object_values(\"identityProviders\", @identity_providers)\n writer.write_collection_of_object_values(\"languages\", @languages)\n writer.write_collection_of_object_values(\"userAttributeAssignments\", @user_attribute_assignments)\n writer.write_collection_of_object_values(\"userFlowIdentityProviders\", @user_flow_identity_providers)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"clientContext\", @client_context)\n writer.write_object_value(\"resultInfo\", @result_info)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_number_value(\"memberCount\", @member_count)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_enum_value(\"tagType\", @tag_type)\n writer.write_string_value(\"teamId\", @team_id)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_object_value(\"resource\", @resource)\n writer.write_object_value(\"weight\", @weight)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"comment\", @comment)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"deletedDateTime\", @deleted_date_time)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_boolean_value(\"hostOnly\", @host_only)\n writer.write_string_value(\"hostOrDomain\", @host_or_domain)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"path\", @path)\n writer.write_enum_value(\"sourceEnvironment\", @source_environment)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"category\", @category)\n writer.write_date_time_value(\"firstSeenDateTime\", @first_seen_date_time)\n writer.write_object_value(\"host\", @host)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_string_value(\"name\", @name)\n writer.write_string_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"large\", @large)\n writer.write_object_value(\"medium\", @medium)\n writer.write_object_value(\"small\", @small)\n writer.write_object_value(\"source\", @source)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"accessPackage\", @access_package)\n writer.write_enum_value(\"allowedTargetScope\", @allowed_target_scope)\n writer.write_object_value(\"automaticRequestSettings\", @automatic_request_settings)\n writer.write_object_value(\"catalog\", @catalog)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customExtensionStageSettings\", @custom_extension_stage_settings)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"expiration\", @expiration)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"questions\", @questions)\n writer.write_object_value(\"requestApprovalSettings\", @request_approval_settings)\n writer.write_object_value(\"requestorSettings\", @requestor_settings)\n writer.write_object_value(\"reviewSettings\", @review_settings)\n writer.write_collection_of_object_values(\"specificAllowedTargets\", @specific_allowed_targets)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"deviceId\", @device_id)\n writer.write_string_value(\"key\", @key)\n writer.write_enum_value(\"volumeType\", @volume_type)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"assignedTo\", @assigned_to)\n writer.write_date_time_value(\"closedDateTime\", @closed_date_time)\n writer.write_object_value(\"createdBy\", @created_by)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_object_value(\"dataSubject\", @data_subject)\n writer.write_enum_value(\"dataSubjectType\", @data_subject_type)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"history\", @history)\n writer.write_object_value(\"insight\", @insight)\n writer.write_date_time_value(\"internalDueDateTime\", @internal_due_date_time)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"notes\", @notes)\n writer.write_collection_of_primitive_values(\"regulations\", @regulations)\n writer.write_collection_of_object_values(\"stages\", @stages)\n writer.write_enum_value(\"status\", @status)\n writer.write_object_value(\"team\", @team)\n writer.write_enum_value(\"type\", @type)\n end",
"def serializable_hash\n self.attributes\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_string_value(\"joinWebUrl\", @join_web_url)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_collection_of_object_values(\"modalities\", @modalities)\n writer.write_object_value(\"organizer\", @organizer)\n writer.write_collection_of_object_values(\"participants\", @participants)\n writer.write_collection_of_object_values(\"sessions\", @sessions)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_enum_value(\"type\", @type)\n writer.write_object_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"axes\", @axes)\n writer.write_object_value(\"dataLabels\", @data_labels)\n writer.write_object_value(\"format\", @format)\n writer.write_object_value(\"height\", @height)\n writer.write_object_value(\"left\", @left)\n writer.write_object_value(\"legend\", @legend)\n writer.write_string_value(\"name\", @name)\n writer.write_collection_of_object_values(\"series\", @series)\n writer.write_object_value(\"title\", @title)\n writer.write_object_value(\"top\", @top)\n writer.write_object_value(\"width\", @width)\n writer.write_object_value(\"worksheet\", @worksheet)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_object_value(\"details\", @details)\n writer.write_string_value(\"name\", @name)\n writer.write_enum_value(\"scenarios\", @scenarios)\n end",
"def serialize\n JSON.dump(@hash)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_boolean_value(\"isUsable\", @is_usable)\n writer.write_boolean_value(\"isUsableOnce\", @is_usable_once)\n writer.write_number_value(\"lifetimeInMinutes\", @lifetime_in_minutes)\n writer.write_string_value(\"methodUsabilityReason\", @method_usability_reason)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n writer.write_string_value(\"temporaryAccessPass\", @temporary_access_pass)\n end",
"def to_s\r\n dump\r\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"callee\", @callee)\n writer.write_object_value(\"caller\", @caller)\n writer.write_date_time_value(\"endDateTime\", @end_date_time)\n writer.write_object_value(\"failureInfo\", @failure_info)\n writer.write_collection_of_object_values(\"media\", @media)\n writer.write_date_time_value(\"startDateTime\", @start_date_time)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_number_value(\"deviceCount\", @device_count)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"managedDevices\", @managed_devices)\n writer.write_enum_value(\"platform\", @platform)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_object_value(\"sizeInByte\", @size_in_byte)\n writer.write_string_value(\"version\", @version)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_collection_of_object_values(\"members\", @members)\n writer.write_string_value(\"roleTemplateId\", @role_template_id)\n writer.write_collection_of_object_values(\"scopedMembers\", @scoped_members)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"options\", @options)\n writer.write_boolean_value(\"protected\", @protected)\n end",
"def serialize(io)\n Encoder.encode(io, self)\n io\n end",
"def _dump() end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"authenticationConfiguration\", @authentication_configuration)\n writer.write_object_value(\"clientConfiguration\", @client_configuration)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_object_value(\"endpointConfiguration\", @endpoint_configuration)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"container\", @container)\n writer.write_string_value(\"containerId\", @container_id)\n writer.write_object_value(\"lastModifiedBy\", @last_modified_by)\n writer.write_object_value(\"member\", @member)\n writer.write_string_value(\"memberId\", @member_id)\n writer.write_enum_value(\"outlierContainerType\", @outlier_container_type)\n writer.write_enum_value(\"outlierMemberType\", @outlier_member_type)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_object_value(\"body\", @body)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"imageUrl\", @image_url)\n writer.write_collection_of_object_values(\"indicators\", @indicators)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_date_time_value(\"lastUpdatedDateTime\", @last_updated_date_time)\n writer.write_object_value(\"summary\", @summary)\n writer.write_collection_of_primitive_values(\"tags\", @tags)\n writer.write_string_value(\"title\", @title)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_date_time_value(\"completedDateTime\", @completed_date_time)\n writer.write_object_value(\"progress\", @progress)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"storageLocation\", @storage_location)\n writer.write_date_time_value(\"submittedDateTime\", @submitted_date_time)\n writer.write_string_value(\"userId\", @user_id)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"accessPackages\", @access_packages)\n writer.write_enum_value(\"catalogType\", @catalog_type)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_collection_of_object_values(\"customWorkflowExtensions\", @custom_workflow_extensions)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_boolean_value(\"isExternallyVisible\", @is_externally_visible)\n writer.write_date_time_value(\"modifiedDateTime\", @modified_date_time)\n writer.write_collection_of_object_values(\"resourceRoles\", @resource_roles)\n writer.write_collection_of_object_values(\"resourceScopes\", @resource_scopes)\n writer.write_collection_of_object_values(\"resources\", @resources)\n writer.write_enum_value(\"state\", @state)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"bundles\", @bundles)\n writer.write_string_value(\"driveType\", @drive_type)\n writer.write_collection_of_object_values(\"following\", @following)\n writer.write_collection_of_object_values(\"items\", @items)\n writer.write_object_value(\"list\", @list)\n writer.write_object_value(\"owner\", @owner)\n writer.write_object_value(\"quota\", @quota)\n writer.write_object_value(\"root\", @root)\n writer.write_object_value(\"sharePointIds\", @share_point_ids)\n writer.write_collection_of_object_values(\"special\", @special)\n writer.write_object_value(\"system\", @system)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"classification\", @classification)\n writer.write_string_value(\"feature\", @feature)\n writer.write_string_value(\"featureGroup\", @feature_group)\n writer.write_string_value(\"impactDescription\", @impact_description)\n writer.write_boolean_value(\"isResolved\", @is_resolved)\n writer.write_enum_value(\"origin\", @origin)\n writer.write_collection_of_object_values(\"posts\", @posts)\n writer.write_string_value(\"service\", @service)\n writer.write_enum_value(\"status\", @status)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"connectors\", @connectors)\n writer.write_boolean_value(\"hasPhysicalDevice\", @has_physical_device)\n writer.write_boolean_value(\"isShared\", @is_shared)\n writer.write_date_time_value(\"lastSeenDateTime\", @last_seen_date_time)\n writer.write_date_time_value(\"registeredDateTime\", @registered_date_time)\n writer.write_collection_of_object_values(\"shares\", @shares)\n writer.write_collection_of_object_values(\"taskTriggers\", @task_triggers)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_collection_of_object_values(\"deviceStates\", @device_states)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_object_value(\"installSummary\", @install_summary)\n writer.write_object_value(\"largeCover\", @large_cover)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_date_time_value(\"publishedDateTime\", @published_date_time)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_collection_of_object_values(\"userStateSummary\", @user_state_summary)\n end",
"def inspect\n attributes = [\n \"name=#{name.inspect}\",\n \"key=#{key.inspect}\",\n \"data_type=#{data_type.inspect}\",\n ]\n \"#<#{self.class.name}:#{object_id} #{attributes.join(', ')}>\"\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"assignments\", @assignments)\n writer.write_collection_of_object_values(\"categories\", @categories)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_string_value(\"description\", @description)\n writer.write_string_value(\"developer\", @developer)\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"informationUrl\", @information_url)\n writer.write_boolean_value(\"isFeatured\", @is_featured)\n writer.write_object_value(\"largeIcon\", @large_icon)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_string_value(\"notes\", @notes)\n writer.write_string_value(\"owner\", @owner)\n writer.write_string_value(\"privacyInformationUrl\", @privacy_information_url)\n writer.write_string_value(\"publisher\", @publisher)\n writer.write_enum_value(\"publishingState\", @publishing_state)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_enum_value(\"platformType\", @platform_type)\n writer.write_number_value(\"settingCount\", @setting_count)\n writer.write_collection_of_object_values(\"settingStates\", @setting_states)\n writer.write_enum_value(\"state\", @state)\n writer.write_number_value(\"version\", @version)\n end",
"def _dump()\n #This is a stub, used for indexing\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"displayName\", @display_name)\n writer.write_string_value(\"templateId\", @template_id)\n writer.write_collection_of_object_values(\"values\", @values)\n end",
"def marshal_dump\n { \n :klass => self.class.to_s, \n :values => @attribute_values_flat, \n :joined => @joined_models\n }\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"containers\", @containers)\n writer.write_object_value(\"controller\", @controller)\n writer.write_collection_of_object_values(\"ephemeralContainers\", @ephemeral_containers)\n writer.write_collection_of_object_values(\"initContainers\", @init_containers)\n writer.write_object_value(\"labels\", @labels)\n writer.write_string_value(\"name\", @name)\n writer.write_object_value(\"namespace\", @namespace)\n writer.write_object_value(\"podIp\", @pod_ip)\n writer.write_object_value(\"serviceAccount\", @service_account)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_enum_value(\"detectionStatus\", @detection_status)\n writer.write_object_value(\"imageFile\", @image_file)\n writer.write_string_value(\"mdeDeviceId\", @mde_device_id)\n writer.write_date_time_value(\"parentProcessCreationDateTime\", @parent_process_creation_date_time)\n writer.write_object_value(\"parentProcessId\", @parent_process_id)\n writer.write_object_value(\"parentProcessImageFile\", @parent_process_image_file)\n writer.write_string_value(\"processCommandLine\", @process_command_line)\n writer.write_date_time_value(\"processCreationDateTime\", @process_creation_date_time)\n writer.write_object_value(\"processId\", @process_id)\n writer.write_object_value(\"userAccount\", @user_account)\n end",
"def inspect\n self.to_hash.inspect\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_collection_of_object_values(\"administrativeUnits\", @administrative_units)\n writer.write_collection_of_object_values(\"attributeSets\", @attribute_sets)\n writer.write_collection_of_object_values(\"customSecurityAttributeDefinitions\", @custom_security_attribute_definitions)\n writer.write_collection_of_object_values(\"deletedItems\", @deleted_items)\n writer.write_collection_of_object_values(\"federationConfigurations\", @federation_configurations)\n writer.write_collection_of_object_values(\"onPremisesSynchronization\", @on_premises_synchronization)\n end",
"def inspect\n \"#<#{self.class}:0x#{object_id.to_s(16)}> JSON: \" +\n JSON.pretty_generate(@data)\n end",
"def encode\n raise Errors::SerializerNotConfigured if serializer_missing?\n\n serializer.encode(self)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n super\n writer.write_string_value(\"activationUrl\", @activation_url)\n writer.write_string_value(\"activitySourceHost\", @activity_source_host)\n writer.write_string_value(\"appActivityId\", @app_activity_id)\n writer.write_string_value(\"appDisplayName\", @app_display_name)\n writer.write_object_value(\"contentInfo\", @content_info)\n writer.write_string_value(\"contentUrl\", @content_url)\n writer.write_date_time_value(\"createdDateTime\", @created_date_time)\n writer.write_date_time_value(\"expirationDateTime\", @expiration_date_time)\n writer.write_string_value(\"fallbackUrl\", @fallback_url)\n writer.write_collection_of_object_values(\"historyItems\", @history_items)\n writer.write_date_time_value(\"lastModifiedDateTime\", @last_modified_date_time)\n writer.write_enum_value(\"status\", @status)\n writer.write_string_value(\"userTimezone\", @user_timezone)\n writer.write_object_value(\"visualElements\", @visual_elements)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize\n super(ATTR_NAME_ARY)\n end",
"def serialize(writer)\n raise StandardError, 'writer cannot be null' if writer.nil?\n writer.write_object_value(\"basis\", @basis)\n writer.write_object_value(\"cost\", @cost)\n writer.write_object_value(\"datePurchased\", @date_purchased)\n writer.write_object_value(\"firstPeriod\", @first_period)\n writer.write_object_value(\"period\", @period)\n writer.write_object_value(\"rate\", @rate)\n writer.write_object_value(\"salvage\", @salvage)\n writer.write_additional_data(@additional_data)\n end",
"def serialize(writer) \n super\n writer.write_collection_of_primitive_values(\"categories\", @categories)\n writer.write_string_value(\"changeKey\", @change_key)\n writer.write_date_value(\"createdDateTime\", @created_date_time)\n writer.write_date_value(\"lastModifiedDateTime\", @last_modified_date_time)\n end"
] | [
"0.7951372",
"0.7645999",
"0.7579812",
"0.7579812",
"0.7440032",
"0.720861",
"0.720861",
"0.7207583",
"0.7016516",
"0.70007193",
"0.6992252",
"0.69838214",
"0.69723576",
"0.69666415",
"0.69666415",
"0.6942002",
"0.69417155",
"0.6933786",
"0.6913977",
"0.6891677",
"0.68810964",
"0.687664",
"0.687664",
"0.687664",
"0.6875119",
"0.68510306",
"0.68364877",
"0.68364877",
"0.6825542",
"0.6815931",
"0.68061364",
"0.68006235",
"0.67944074",
"0.67717844",
"0.67341864",
"0.67289317",
"0.66964674",
"0.66828746",
"0.6673492",
"0.6668077",
"0.6666333",
"0.6659732",
"0.6656788",
"0.66513675",
"0.6635875",
"0.66275525",
"0.66275525",
"0.66275525",
"0.6627384",
"0.66165835",
"0.66141444",
"0.6611379",
"0.6597342",
"0.65968686",
"0.6594517",
"0.6592636",
"0.6583964",
"0.6580536",
"0.65803635",
"0.6575503",
"0.65716475",
"0.65712893",
"0.6566952",
"0.6560253",
"0.65554273",
"0.65410006",
"0.65378475",
"0.65346783",
"0.6527361",
"0.6525178",
"0.65242875",
"0.65235287",
"0.65174305",
"0.65141636",
"0.6508169",
"0.6499713",
"0.6498714",
"0.6496881",
"0.6486202",
"0.6482482",
"0.64814615",
"0.6479782",
"0.6476621",
"0.6475453",
"0.64677024",
"0.64633876",
"0.64619535",
"0.6461202",
"0.6457243",
"0.64497435",
"0.6439583",
"0.6433183",
"0.643078",
"0.6424316",
"0.6420337",
"0.6420337",
"0.6420337",
"0.6420337",
"0.6420337",
"0.6418776",
"0.64156514"
] | 0.0 | -1 |
Gets the textType property value. The type of text being stored. Must be one of plain or richText | def text_type
return @text_type
end | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"def text_type=(value)\n @text_type = value\n end",
"def text_type\n @@text_type_ord_to_text_type[self.text_type_ord]\n end",
"def text_type=(value)\n self.text_type_ord = @@text_type_to_text_type_ord[value]\n end",
"def is_texttype?(); @type == GRT_TEXTTYPE; end",
"def text?\n type == :text\n end",
"def is_text?(); @type == GRT_TEXT; end",
"def mime_type_text\n mt = MIME::Types[content_type]&.first if content_type.present?\n\n mt.present? && (mt.friendly || mt.sub_type || mt.media_type) || UnknownMimeTypeText\n end",
"def text?\n [:ascii, :text].include?(type)\n end",
"def type_is_text\n self.stimulus_type=\"text\"\n end",
"def type\n @node[\"type\"] || \"text\"\n end",
"def control_type \n 'text'\n end",
"def value_field\n \"text\"\n end",
"def text\n\t find { |b| b.content_type == 'text/plain' }\n\tend",
"def mime_type\n _mime_type ? _mime_type.to_s : 'text/plain'\n end",
"def get_data_type\n get_field_config['type']\n end",
"def is_text_message?\n type == 'TextMessage'\n end",
"def document_type\n @document_type ||= @options[:document_type] ||\n __get_class_value(:document_type)\n end",
"def text?\n type == TEXT_NODE\n end",
"def content_type\n 'text/plain'\n end",
"def getContenttype\r\n\t\t\t\t\treturn @contenttype\r\n\t\t\t\tend",
"def document_type=(name)\n @document_type = name\n end",
"def document_type=(name)\n @document_type = name\n end",
"def data_type\n if @data_type\n @data_type\n else\n (@is_string ? String : nil)\n end\n end",
"def data_type\n MtkField.field_to_datatype(grid.file.file_name, grid.grid_name, field_name)\n end",
"def type\n field[:type]\n end",
"def type\n case text\n when /^#/\n :inline\n when /^=begin/\n :document\n end\n end",
"def editor_for_attr_type(type)\n attr_type_to_editor_map[type] || :textfield\n end",
"def text_exporter\n self.class.exporter_by_type(:text)\n end",
"def text_exporter\n self.class.exporter_by_type(:text)\n end",
"def document_type\n instance.class.tire.document_type\n end",
"def rendered_format\n Mime[:text]\n end",
"def text_exporter\n self.class.exporter_by_type(:text)\n end",
"def text?\n node_type == TEXT_NODE\n end",
"def type\n @type.to_s\n end",
"def content_type\n @record.send( :\"#{@column}_content_type\" ) rescue ''\n end",
"def mime_type\n parser_for(:variable_mime_type, variable_attributes) || \"text/plain\"\n end",
"def document_type\n FileUtility.get_file_type(@file_name)\n end",
"def allows_text?\n case kind\n when TEXT, IMAGE1, AUDIO, VIDEO1 then true\n else false\n end\n end",
"def field_type(key)\n pdf_field(key).getFormType.toString\n end",
"def field_type\n if self.type == 'Button'\n if push_button?\n 'push_button'\n elsif radio_button?\n 'radio_button'\n else\n 'check_box'\n end\n elsif self.type == 'Text'\n if file?\n 'file_field'\n elsif password?\n 'password_field'\n elsif multiline?\n 'text_area'\n else\n 'text_field'\n end\n elsif self.type == 'Choice'\n 'select'\n else\n self.type.downcase\n end\n end",
"def type\n if new_record? || image?\n 'image'\n elsif video?\n 'video'\n else\n 'text'\n end\n end",
"def mime_type\n \"text/plain\"\n end",
"def text?; mediatype == 'text' || child_of?('text/plain'); end",
"def insert_text_mode\n attributes.fetch(:insertTextMode)\n end",
"def text= t\n self.criterion_type = \"text\"\n write_attribute \"text\", t\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def type\n return @type\n end",
"def getText\n @text\n end",
"def getText\n @text\n end",
"def getvalue\n #@text_variable && @text_variable.value || @text\n @text\n end",
"def getvalue\n #@text_variable && @text_variable.value || @text\n @text\n end",
"def get_content_type\n self.content_type\n end",
"def type\n\t\t\t@data[\"type\"]\n\t\tend",
"def data_type\n return @data_type\n end",
"def content_type\n return @content_type\n end",
"def get_html_type\n TYPE_TO_HTML_TYPE_MAP[get_data_type]\n end",
"def content_type\n @content_type || object.content_type\n end",
"def content_type\n instance_read(:content_type)\n end",
"def type\n document._type = document.class.name if typed?\n end",
"def type\n @props[:type]\n end",
"def name_of_content_type\n if self.content_type == 'application/vnd.ms-word'\n return \"Word document\"\n elsif self.content_type == 'application/pdf'\n return \"PDF file\"\n end\n end",
"def text?\n @contents[0] == :text\n end",
"def type\n @type.name\n end",
"def text?\n @grpc.type == :PLAIN_TEXT\n end",
"def type\n self[:type]\n end",
"def data_type\n @options[:data_type].presence\n end",
"def document_type name=nil\n @document_type = name if name\n @document_type || klass.model_name.to_s.underscore\n end",
"def text\n @value[:text].to_s\n end",
"def to_content(type, value)\n Content.new(type: \"text/#{type}\", value: value)\n end",
"def content_type\n ::MIME::Types.type_for(name).first.try(:content_type) || 'text/html'\n end",
"def to_s\n @content_type\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n @type\n end",
"def type\n @type || @document.root.attributes[\"type\"] || @document.root.name\n end",
"def document_type\n @document_type ||= params['documentType']\n end",
"def type\n @data['type']\n end",
"def type\n @data['type']\n end",
"def get_field_type(content)\n type, type_format = content.values_at(:type, :format)\n return content if type.nil? && type_format.nil?\n # formats have priority over type\n field_type = sanitise_string(type_format ? type_format : type, true)\n result = @types[field_type] if @types.key?(field_type)\n \"#{result}\"\n end",
"def content_type\n reader.format.content_type if valid?\n end",
"def content_type\n return @content_type unless @content_type.blank?\n if has_attachments?\n return \"multipart/mixed\"\n elsif !body(:plain).blank? && !body(:html).blank?\n return \"multipart/alternative\"\n elsif body(:html)\n return \"text/html\"\n else\n return \"text/plain\"\n end\n end",
"def type\n content.split(' ', 2).first\n end",
"def engine_content_type\n engine_extensions.each do |ext|\n if mime_type = environment.engine_mime_types[ext]\n return mime_type\n end\n end\n nil\n end",
"def type\n return @type\n end",
"def to_str\n @content_type\n end",
"def text\n @text\n end",
"def content_type=(value)\n @content_type = value\n end",
"def getText\n return getProperty('text').to_s\n end",
"def type\n self[:type]\n end",
"def data_type=(value)\n @data_type = value\n end",
"def type\n read_attr :type, :to_sym\n end",
"def content_type\n raise MissingFileMapping.new if mapping.blank?\n raise NodesMissing.new if mapping.nodes.blank?\n\n retrieve_meta!\n\n return self.meta['content_type'].to_s\n end",
"def getType(gType)\r\n return @langProfile.getType(gType)\r\n end"
] | [
"0.83617353",
"0.831395",
"0.7824582",
"0.7276367",
"0.6920246",
"0.68734324",
"0.6691693",
"0.6578273",
"0.6530198",
"0.6499831",
"0.63302773",
"0.61271894",
"0.6106904",
"0.5977403",
"0.589898",
"0.5881678",
"0.5789869",
"0.57623094",
"0.57556695",
"0.5728864",
"0.5725433",
"0.5725433",
"0.57178843",
"0.57118785",
"0.57085764",
"0.569725",
"0.56965184",
"0.5689652",
"0.5689652",
"0.56814396",
"0.5679718",
"0.56745696",
"0.5660018",
"0.56478184",
"0.5646846",
"0.56447244",
"0.5640496",
"0.56347674",
"0.56297135",
"0.55918014",
"0.5575982",
"0.5538477",
"0.553332",
"0.55225414",
"0.54865754",
"0.5481992",
"0.5481992",
"0.5481992",
"0.5481992",
"0.5481992",
"0.5481992",
"0.5481992",
"0.54805267",
"0.54805267",
"0.5474755",
"0.5474755",
"0.5466713",
"0.54622805",
"0.54602146",
"0.5459634",
"0.5436161",
"0.543287",
"0.5429265",
"0.54210454",
"0.54158854",
"0.5413906",
"0.5413263",
"0.54099345",
"0.5393492",
"0.5388848",
"0.53818935",
"0.5381682",
"0.53815037",
"0.53798175",
"0.53743887",
"0.53721446",
"0.5372004",
"0.53602636",
"0.53590953",
"0.53590953",
"0.53590953",
"0.5353311",
"0.5344539",
"0.5342653",
"0.53317106",
"0.5327366",
"0.53256583",
"0.53210783",
"0.531506",
"0.53091514",
"0.530454",
"0.5301727",
"0.5297318",
"0.52943593",
"0.5291154",
"0.5290233",
"0.52879685",
"0.5285723",
"0.528174",
"0.5280386"
] | 0.86564493 | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.