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 |
|---|---|---|---|---|---|---|
Never trust parameters from the scary internet, only allow the white list through.
|
def event_params
params.require(:event).permit(:title, :description, :event_date, :location)
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 /gig_rosters GET /gig_rosters.json
|
def index
@gig_rosters = GigRoster.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end",
"def index\n @rosters = Roster.all\n end",
"def index\n @rosters = Roster.all\n end",
"def index\n @rosters = Roster.all\n end",
"def index\n @riggings = Rigging.all\n end",
"def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end",
"def show\n @gig_request = GigRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gig_request }\n end\n end",
"def show\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_grappt }\n end\n end",
"def show\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golfer }\n end\n end",
"def index\n @rogues = Rogue.all\n end",
"def index\n @rogues = Rogue.all\n end",
"def get_genres(options = {})\n object_from_response(GogoKit::PagedResource,\n GogoKit::CategoriesRepresenter,\n :get,\n get_root.links['viagogo:genres'].href,\n options)\n end",
"def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def index\n @gamers = Gamer.all\n end",
"def index\n @shots = Shot.all\n\n render json: @shots\n end",
"def index\n\t\t@gig = Gig.all\n\tend",
"def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end",
"def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"def get_all_monsters\n render :json => {:success => \"true\",\n :data => {\n :monsters => @user.monsters.blank? ? Array.new : @user.monsters.map { |mon| {:id => mon.id, :name => mon.name, :team_count => mon.teams.size} }\n }}\n end",
"def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end",
"def index\n @players = Player.order(:gamertag_lower).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"def show\n @rooster = Rooster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rooster }\n end\n end",
"def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end",
"def index\n @ugroupes = Ugroupe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ugroupes }\n end\n end",
"def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end",
"def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end",
"def show\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotel }\n end\n end",
"def index\n @gifs = Gif.sorted.paginate(page: params[:page], per_page: 12)\n\n respond_to do |format|\n format.html\n format.json { render json: @gifs }\n end\n end",
"def index\n @glasses = Glass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @glasses }\n end\n end",
"def json\n url = 'http://api.dribbble.com/players/' + @user + '/shots?per_page=' + @shots_per_page.to_s + '&page=' + @page.to_s\n resp = Net::HTTP.get_response(URI.parse(url))\n return resp.body\n end",
"def index\n @in_game_gifts = InGameGift.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @in_game_gifts }\n end\n end",
"def index\n @pugs = Pug.all\n\n render json: @pugs\n end",
"def show\n @grm_dog = GrmDog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_dog }\n end\n end",
"def index\n @textures = Texture.find(:all, :limit => 20, :order=> 'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @textures }\n end\n end",
"def index\n @pictures = Picture.where(foodscape_id: params[:foodscape_id])\n render json: @pictures\n end",
"def movie_data\n response = RestClient.get(\"critics.api.mks.io/movie-genres\")\n JSON.parse(response)\nend",
"def show\n @gig = Gig.find(params[:id])\n end",
"def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @genotypes }\n end\n end",
"def index\n if params[:floor_id]\n data = {Image: [{id: params[:floor_id], Tags: Tag.find_by(floor: params[:floor_id])}]}\n else\n data = Tag.all\n end\n render json: data\n end",
"def games( gamer )\n @path = gamer.match(/[0-9]{17}/) ? \"profiles/\" : \"id/\"\n @gamer = gamer\n res = self.make_request\n res\n end",
"def index\n @gigapans = Gigapan.all\n end",
"def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end",
"def index\n @battle_rosters = BattleRoster.all\n end",
"def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end",
"def show\n @grm_pic = GrmPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_pic }\n end\n end",
"def show\n render json: @shot\n end",
"def show\n @grm = Grm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm }\n end\n end",
"def get_genres\n \tRails.cache.fetch(\"tmdb/genres_list\", expires_in: 24.hours) do\n \t\taction = \"genre/movie/list\"\n \t\targument = \"&language=en-US\"\n\t\t\tresponse = call_api(action, argument)\n\t\t\t@result = Hash.new\n\t\t\tresponse[\"genres\"].each do |genre|\n\t\t\t\t@result[genre[\"id\"]] = genre[\"name\"]\n\t\t\tend\n\t\t\t@result\n\t\tend\n\tend",
"def index\n @grams = Gram.all #if we wanted to make an app so that user can only see their own pin make = current_user.pins.all if not Gram.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @grams }\n end\n end",
"def index\n @socio_rgs = SocioRg.all\n end",
"def index\n # # if page value a param, use that, else ...\n # page = 3\n # request_url = MOVIE_DB_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n genre_request_url = GENRE_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n # request_url += \"&page=#{page}\"\n # if sort by release date\n # request_url += RELEASE_DATE_DESC_URL\n # if sort by title\n # request_url += RELEASE_DATE_DESC_URL;\n # @movies = Unirest.get(request_url).body[\"results\"]\n @genres = Unirest.get(genre_request_url).body[\"genres\"]\n # puts @genres\n end",
"def index\n @lugars = Lugar.all\n\n render json: @lugars\n end",
"def show\n @gist = Gist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gist }\n end\n end",
"def index\n @gravities = Gravity.all\n end",
"def show\n @gmap = Gmap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gmap }\n end\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def index\n @gig_types = GigType.all\n end",
"def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end",
"def index\n @grapes = Grape.all\n end",
"def get_monster_info\n monster_string = RestClient.get('http://www.dnd5eapi.co/api/monsters/')\n monster_hash = JSON.parse(monster_string)\n monster_info = monster_hash[\"results\"]\n monster_info\nend",
"def get_monsters\n @all_monsters\n end",
"def index\n @book_genres = BookGenre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_genres }\n end\n end",
"def index\n @mugshots = Mugshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mugshots }\n end\n end",
"def get_nearby_food_pictures\n if params[:lat] and params[:lng]\n @restaurants = Restaurant.all\n # @buildings = Building.find( :all, :conditions => [ 'name LIKE ?', '%' + params[:q].downcase + '%'], :limit => 20)\n \n end\n\n render :json => @restaurants\n end",
"def show\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gasto }\n end\n end",
"def index\n @gentres = Gentre.all\n end",
"def index\n @src_gsts = SrcGst.where(hotel_src_id: current_user.hotel_src_id).page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @src_gsts }\n end\n end",
"def index\n @q = Galaxy.search(params[:q])\n @q.sorts = 'id asc' if @q.sorts.empty?\n if params[:page] != \"false\"\n @galaxies = @q.result(distinct: true).page(params[:page])\n else\n @galaxies = @q.result(distinct: true)\n end\n\n respond_to do |format|\n format.html { render :index }\n format.json { render :json => @galaxies.to_json(\n :only => [:id, :galaxy_name, :galaxy_type, :distance, :luminosity, :scale_length,\n :mass_hydrogen, :mass_disk, :velocities_citation, :luminosity_citation, :mass_hydrogen_citation, :scale_length_citation],\n :methods => [:citation_ids_array, :r_last, :vrot_data_last, :velocities_count]\n )\n }\n end\n end",
"def index\n\t\tparams[:search] ? @genres=Genre.search(params[:search]) : @genres=Genre.where(\"user_id = ?\", current_user.id).order(\"name\")\n\t\t@genres = @genres.paginate(page: params[:page], per_page: 18) if @genres\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @genres }\n\t\t\tformat.js\n\t\tend\n\tend",
"def index\n @riffblobs = current_user.riffblobs\n respond_to do |format|\n format.json { render json: @riffblobs.as_json }\n end\n end",
"def index\n @gifts = Gift.all\n end",
"def index\n @gifts = Gift.all\n end",
"def show\n @gitem = Gitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gitem }\n end\n end",
"def get_all\n\t\trender json: {quests: Quest.all.as_json(include: :images)}\n\tend",
"def index\n @goods = Good.where(user: current_user.building.users)\n respond_to do |format|\n format.html\n format.json do\n render json: {\n goods: @goods.map{|g|g.attributes.merge(image: url_for(g.user.profile.pic), ownerId: g.user.id)}\n }\n end\n end\n end",
"def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def show\n @tagg = Tagg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tagg }\n end\n end",
"def index\n @gruas = Grua.all\n end",
"def show\n @galeria = Galeria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @galeria }\n end\n end",
"def gist(id)\n get \"/gists/#{id}\"\n end",
"def show\n @grocery = Grocery.find(params[:id])\n\n render json: @grocery\n end",
"def show\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @galaxies_lenticular_galaxy }\n end\n end",
"def index\n respond_with Genre.all\n end",
"def show\n @client = Client.find(params[:id])\n @pets = @client.pets\n @json = @client.to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def get_dogs\n user_dog = User.find(params[:id]).dog\n if user_dog\n render json: user_dog.to_json(include: :dog_photos)\n else\n render json: []\n end\n end",
"def show\n @user = current_user\n @avatar = @user.avatar\n @count_chest = 0\n @count_monster = 0\n @monsters = []\n @avatarItems = @avatar.inventory.items\n\n @donjon.rooms.each do |r|\n @count_chest += r.chests.count\n @count_monster += r.monsters.count\n r.monsters.each do |monster|\n hydratedMonster = {}\n hydratedMonster[\"id\"] = monster.id\n hydratedMonster[\"name\"] = monster.name\n hydratedMonster[\"hp\"] = monster.hp\n hydratedMonster[\"strong\"] = monster.strong\n hydratedMonster[\"agility\"] = monster.agility\n hydratedMonster[\"exp\"] = monster.exp\n hydratedMonster[\"items\"] = monster.inventory.items.clone()\n hydratedMonster[\"defence\"] = monster.defence\n hydratedMonster[\"gold\"] = monster.gold\n\n @monsters << hydratedMonster\n end\n end\n respond_to do |format|\n format.html\n format.json { render :json => {donjon: @donjon, rooms: @donjon.rooms, monsters: @monsters, avatar: @avatar, avatarItems: @avatarItems} }\n end\n end",
"def index\n @regiones = Region.all\n\n render json: @regiones\n end",
"def index\n @groomsmen = Groomsman.all\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @galleries }\n end\n end",
"def show\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ginasio }\n end\n end",
"def index\n @universes = Universe.all.page(params[:page]).per(25)\n respond_to do |format|\n format.html\n format.json { render json: @universes }\n end\n end",
"def show\n # proxy to GET /roi/id\n @result = ImageServer.get('/roi/'+params[:id]);\n render :json => @result\n end",
"def index\n @wigs = Wig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wigs }\n end\n end",
"def index\n @recipies = Recipy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipies }\n end\n end",
"def show\n @gravity = Gravity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gravity }\n end\n end"
] |
[
"0.65916413",
"0.64172494",
"0.64172494",
"0.64172494",
"0.6379612",
"0.6309769",
"0.60598445",
"0.60334337",
"0.6032572",
"0.6008764",
"0.6003748",
"0.6003748",
"0.5969598",
"0.596937",
"0.5965246",
"0.59634304",
"0.59591174",
"0.59420156",
"0.59392005",
"0.5916362",
"0.59130645",
"0.5899998",
"0.5898486",
"0.58767295",
"0.586748",
"0.5814946",
"0.5806363",
"0.57913417",
"0.5785555",
"0.57835186",
"0.57767445",
"0.57741606",
"0.57638127",
"0.5759436",
"0.57584184",
"0.5757509",
"0.5750557",
"0.5749988",
"0.57444453",
"0.5739837",
"0.5730432",
"0.57248056",
"0.5715773",
"0.5713277",
"0.57056093",
"0.5704596",
"0.56796736",
"0.5675572",
"0.56692505",
"0.5664533",
"0.566136",
"0.5661147",
"0.56568575",
"0.5653243",
"0.56519485",
"0.5642968",
"0.56420743",
"0.5638536",
"0.5637344",
"0.5629925",
"0.5627111",
"0.5620332",
"0.5616709",
"0.5611907",
"0.56045973",
"0.56007916",
"0.5599901",
"0.5591203",
"0.5576123",
"0.5575656",
"0.5575579",
"0.55743355",
"0.5573146",
"0.5573146",
"0.5568378",
"0.5566335",
"0.5562714",
"0.5561071",
"0.5559107",
"0.55490834",
"0.5540174",
"0.5537405",
"0.5524092",
"0.55204016",
"0.5518448",
"0.55156523",
"0.55117446",
"0.55091286",
"0.55090255",
"0.55085045",
"0.55081636",
"0.55081636",
"0.55081636",
"0.55066574",
"0.55057096",
"0.55027163",
"0.5500664",
"0.5497721",
"0.5495682",
"0.5486341"
] |
0.72896755
|
0
|
GET /gig_rosters/1 GET /gig_rosters/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @gig_rosters = GigRoster.all\n end",
"def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end",
"def show\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @golfer }\n end\n end",
"def index\n @rosters = Roster.all\n end",
"def index\n @rosters = Roster.all\n end",
"def index\n @rosters = Roster.all\n end",
"def index\n @riggings = Rigging.all\n end",
"def show\n @gig_request = GigRequest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gig_request }\n end\n end",
"def show\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_grappt }\n end\n end",
"def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end",
"def show\n @rooster = Rooster.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rooster }\n end\n end",
"def index_by_user\n @gifts = @current_user.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end",
"def index_by_age\n @age = Age.find(params[:age_id])\n @gifts = @age.gifts\n render json: @gifts, include: :ages, status: :ok\n end",
"def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def show\n @grm_dog = GrmDog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_dog }\n end\n end",
"def index\n @cartridges = Cartridge.all\n\n respond_to do |format|\n format.html\n format.json { render json: @cartridges }\n end\n end",
"def show\n @gid2name = Gid2name.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gid2name }\n end\n end",
"def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end",
"def index\n @shots = Shot.all\n\n render json: @shots\n end",
"def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end",
"def show\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotel }\n end\n end",
"def show\n # proxy to GET /roi/id\n @result = ImageServer.get('/roi/'+params[:id]);\n render :json => @result\n end",
"def show\n @grm_pic = GrmPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_pic }\n end\n end",
"def index\n @rogues = Rogue.all\n end",
"def index\n @rogues = Rogue.all\n end",
"def index\n @gamers = Gamer.all\n end",
"def show\n @grm = Grm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm }\n end\n end",
"def show\n @gist = Gist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gist }\n end\n end",
"def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end",
"def index_single_gift\n render json: @gift, include: :ages, status: :ok\n end",
"def show\n @gig = Gig.find(params[:id])\n end",
"def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end",
"def show\n @grocery = Grocery.find(params[:id])\n\n render json: @grocery\n end",
"def show\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ginasio }\n end\n end",
"def index\n @textures = Texture.find(:all, :limit => 20, :order=> 'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @textures }\n end\n end",
"def show\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gasto }\n end\n end",
"def index\n @pictures = Picture.where(foodscape_id: params[:foodscape_id])\n render json: @pictures\n end",
"def show\n @galeria = Galeria.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @galeria }\n end\n end",
"def movie_data\n response = RestClient.get(\"critics.api.mks.io/movie-genres\")\n JSON.parse(response)\nend",
"def show\n render json: @shot\n end",
"def show\n @genre_type = GenreType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genre_type }\n end\n end",
"def show\n @gitem = Gitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gitem }\n end\n end",
"def index\n @genotypes = Genotype.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @genotypes }\n end\n end",
"def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end",
"def get_genres(options = {})\n object_from_response(GogoKit::PagedResource,\n GogoKit::CategoriesRepresenter,\n :get,\n get_root.links['viagogo:genres'].href,\n options)\n end",
"def index\n @ugroupes = Ugroupe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ugroupes }\n end\n end",
"def index\n @players = Player.order(:gamertag_lower).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @players }\n end\n end",
"def index\n @glasses = Glass.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @glasses }\n end\n end",
"def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end",
"def show\n @garment_image = GarmentImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @garment_image }\n end\n end",
"def show\n @glass = Glass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glass }\n end\n end",
"def index\n\t\t@gig = Gig.all\n\tend",
"def get_monster_info\n monster_string = RestClient.get('http://www.dnd5eapi.co/api/monsters/')\n monster_hash = JSON.parse(monster_string)\n monster_info = monster_hash[\"results\"]\n monster_info\nend",
"def index\n # # if page value a param, use that, else ...\n # page = 3\n # request_url = MOVIE_DB_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n genre_request_url = GENRE_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n # request_url += \"&page=#{page}\"\n # if sort by release date\n # request_url += RELEASE_DATE_DESC_URL\n # if sort by title\n # request_url += RELEASE_DATE_DESC_URL;\n # @movies = Unirest.get(request_url).body[\"results\"]\n @genres = Unirest.get(genre_request_url).body[\"genres\"]\n # puts @genres\n end",
"def index\n if params[:floor_id]\n data = {Image: [{id: params[:floor_id], Tags: Tag.find_by(floor: params[:floor_id])}]}\n else\n data = Tag.all\n end\n render json: data\n end",
"def show\n @gmap = Gmap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gmap }\n end\n end",
"def show\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @galaxies_lenticular_galaxy }\n end\n end",
"def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end",
"def show\n @tagg = Tagg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tagg }\n end\n end",
"def show\n @gravity = Gravity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gravity }\n end\n end",
"def index\n base_url = 'https://www.googleapis.com/books/v1/volumes?q=fiction&maxResults=20'\n and_key = '&key='\n key = ENV['GOOGLE_BOOKS_API_KEY'] \n googleurl = base_url + and_key + key\n\n response = RestClient.get(googleurl)\n @books = JSON.parse(response)\n\n respond_to do |format|\n format.html\n format.json { render json: @books }\n end\n\nend",
"def show\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gauge }\n end\n end",
"def show\n @retro = Retro.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @retro }\n end\n end",
"def games( gamer )\n @path = gamer.match(/[0-9]{17}/) ? \"profiles/\" : \"id/\"\n @gamer = gamer\n res = self.make_request\n res\n end",
"def json\n url = 'http://api.dribbble.com/players/' + @user + '/shots?per_page=' + @shots_per_page.to_s + '&page=' + @page.to_s\n resp = Net::HTTP.get_response(URI.parse(url))\n return resp.body\n end",
"def index\n @gifs = Gif.sorted.paginate(page: params[:page], per_page: 12)\n\n respond_to do |format|\n format.html\n format.json { render json: @gifs }\n end\n end",
"def index\n @lugars = Lugar.all\n\n render json: @lugars\n end",
"def gist(id)\n get \"/gists/#{id}\"\n end",
"def show\n @program_genre = ProgramGenre.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @program_genre }\n end\n end",
"def index\n @recipies = Recipy.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recipies }\n end\n end",
"def get_all_monsters\n render :json => {:success => \"true\",\n :data => {\n :monsters => @user.monsters.blank? ? Array.new : @user.monsters.map { |mon| {:id => mon.id, :name => mon.name, :team_count => mon.teams.size} }\n }}\n end",
"def show\n @renter = Renter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @renter }\n end\n end",
"def show\n @gene_name = GeneName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gene_name }\n end\n end",
"def index\n @book_genres = BookGenre.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @book_genres }\n end\n end",
"def show\n @razmer_go = RazmerGo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @razmer_go }\n end\n end",
"def show\n @gnode = Gnode.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gnode }\n end\n end",
"def show\n @gastracker = Gastracker.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gastracker }\n end\n end",
"def index\n @pugs = Pug.all\n\n render json: @pugs\n end",
"def show\n @gram = Gram.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gram }\n end\n end",
"def show\n @galaxy = Galaxy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @galaxy }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @graphic }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @graphic }\n end\n end",
"def show\n @rayon = Rayon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rayon }\n end\n end",
"def index\n @brags = Brag.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brags }\n end\n end",
"def index\n @in_game_gifts = InGameGift.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @in_game_gifts }\n end\n end",
"def show\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @redpack }\n end\n end",
"def index\n @mugshots = Mugshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mugshots }\n end\n end",
"def show\n @roof = Roof.find(params[:roof_id])\n @status = @roof.statuses.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status }\n end\n end",
"def index\n @grapes = Grape.all\n end",
"def index\n @riffblobs = current_user.riffblobs\n respond_to do |format|\n format.json { render json: @riffblobs.as_json }\n end\n end",
"def show\n @client = Client.find(params[:id])\n @pets = @client.pets\n @json = @client.to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"def new\n @rooster = Rooster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rooster }\n end\n end",
"def show\n render json: @rock\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end",
"def index\n url = \"https://data.cityofchicago.org/resource/x2n5-8w5q.json\"\n options = { :body => {:status => text}, :basic_auth => @auth }\n @response = HTTParty.get(url, options)\n\n @crime = Hash.new\n\n #@crime['block'] = @response[0]['block']\n @crime = @response\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gittos }\n end\n end",
"def show\n @photographer = Photographer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @photographer }\n end\n end"
] |
[
"0.6990739",
"0.67363274",
"0.62975204",
"0.6267945",
"0.6267945",
"0.6267945",
"0.6252503",
"0.62397003",
"0.6185698",
"0.6144007",
"0.61423606",
"0.6142068",
"0.6090699",
"0.604706",
"0.60177773",
"0.6002566",
"0.6001811",
"0.59938943",
"0.5991962",
"0.59916234",
"0.5974791",
"0.5958502",
"0.59538937",
"0.5946992",
"0.5925363",
"0.5925363",
"0.5905092",
"0.59041655",
"0.5892615",
"0.5890268",
"0.5875968",
"0.58714294",
"0.5869519",
"0.58564824",
"0.5837709",
"0.5827335",
"0.5826636",
"0.58223504",
"0.5804396",
"0.5799676",
"0.5787649",
"0.57798535",
"0.57693845",
"0.57676566",
"0.57629395",
"0.5761212",
"0.5757179",
"0.5756319",
"0.57536685",
"0.57502794",
"0.5749411",
"0.5743543",
"0.5732267",
"0.5727364",
"0.5724443",
"0.57140374",
"0.57116914",
"0.5705503",
"0.57035965",
"0.56859624",
"0.56837434",
"0.5683171",
"0.5676859",
"0.5670426",
"0.56689334",
"0.5658895",
"0.5656063",
"0.5651635",
"0.56501365",
"0.5650114",
"0.56459534",
"0.5644308",
"0.56442636",
"0.56229776",
"0.5622075",
"0.5620193",
"0.5617709",
"0.56166285",
"0.56163275",
"0.56143194",
"0.560905",
"0.56087923",
"0.5601127",
"0.5601127",
"0.55951065",
"0.55932444",
"0.5592254",
"0.55786675",
"0.5575325",
"0.5570233",
"0.5563283",
"0.5559071",
"0.55577457",
"0.55561703",
"0.55482745",
"0.5543825",
"0.5543825",
"0.5543825",
"0.55430436",
"0.5542768",
"0.5540669"
] |
0.0
|
-1
|
POST /gig_rosters POST /gig_rosters.json
|
def create
@gig_roster = GigRoster.new(gig_roster_params)
respond_to do |format|
if @gig_roster.save
format.html { redirect_to @gig_roster, notice: 'Gig roster was successfully created.' }
format.json { render :show, status: :created, location: @gig_roster }
else
format.html { render :new }
format.json { render json: @gig_roster.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @rigging = Rigging.new(rigging_params)\n\n respond_to do |format|\n if @rigging.save\n format.html { redirect_to @rigging, notice: 'Rigging was successfully created.' }\n format.json { render :show, status: :created, location: @rigging }\n else\n format.html { render :new }\n format.json { render json: @rigging.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n gig = Gig.new()\n respond_to do |format|\n if update_gig(gig)\n format.html { render json: gig, status: :created, location: gig }\n format.json { render json: gig, status: :created, location: gig }\n else\n format.html { render action: \"new\" }\n format.json { render json: gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gig_type = GigType.new(gig_type_params)\n\n respond_to do |format|\n if @gig_type.save\n format.html { redirect_to @gig_type, notice: 'Gig type was successfully created.' }\n format.json { render :show, status: :created, location: @gig_type }\n else\n format.html { render :new }\n format.json { render json: @gig_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grape = Grape.new(grape_params)\n\n respond_to do |format|\n if @grape.save\n format.html { redirect_to @grape, notice: \"Grape was successfully created.\" }\n format.json { render :show, status: :created, location: @grape }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @grape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gig_request = GigRequest.new(params[:gig_request])\n\n respond_to do |format|\n if @gig_request.save\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully created.' }\n format.json { render json: @gig_request, status: :created, location: @gig_request }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @gig_rosters = GigRoster.all\n end",
"def create\n #@gig = Gig.new(gig_params)\n\n @gig = current_user.gigs.build(gig_params)\n\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: \"Gig was successfully created.\" }\n format.json { render :show, status: :created, location: @gig }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @groep = Groep.new(params[:groep])\n @lesgevers = Lesgever.order('name').all\n @dags = Dag.all\n @niveaus = Niveau.order('position').all\n respond_to do |format|\n if @groep.save\n format.html { redirect_to @groep, notice: 'Groep werd succesvol aangemaakt.' }\n format.json { render json: @groep, status: :created, location: @groep }\n else\n format.html { render action: \"new\" }\n format.json { render json: @groep.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shot = Shot.new(shot_params)\n\n if @shot.save\n render json: @shot, status: :created, location: @shot\n else\n render json: @shot.errors, status: :unprocessable_entity\n end\n end",
"def create\n @rig = Rig.new(params[:rig])\n\n respond_to do |format|\n if @rig.save\n flash[:notice] = 'Rig was successfully created.'\n format.html { redirect_to(@rig) }\n format.xml { render :xml => @rig, :status => :created, :location => @rig }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @rig.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @rooster = Rooster.new(params[:rooster])\n\n respond_to do |format|\n if @rooster.save\n format.html { redirect_to @rooster, notice: 'Rooster was successfully created.' }\n format.json { render json: @rooster, status: :created, location: @rooster }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rooster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rogue = Rogue.new(rogue_params)\n\n respond_to do |format|\n if @rogue.save\n format.html { redirect_to @rogue, notice: \"Rogue was successfully created.\" }\n format.json { render :show, status: :created, location: @rogue }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @rogue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @golfer = Golfer.new(params[:golfer])\n\n respond_to do |format|\n if @golfer.save\n format.html { redirect_to @golfer, notice: 'Golfer was successfully created.' }\n format.json { render json: @golfer, status: :created, location: @golfer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @socio_rg = SocioRg.new(socio_rg_params)\n\n respond_to do |format|\n if @socio_rg.save\n format.html { redirect_to @socio_rg, notice: 'Socio rg was successfully created.' }\n format.json { render action: 'show', status: :created, location: @socio_rg }\n else\n format.html { render action: 'new' }\n format.json { render json: @socio_rg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @scratcher = Scratcher.new(permitted_params)\n\n if @scratcher.save\n render json: @scratcher, status: :created, location: @scratcher\n else\n render json: @scratcher.errors, status: :unprocessable_entity\n end\n end",
"def create\n @gig = current_user.gigs.new(gig_params)\n location = Location.find_or_create_by({\n postcode_address: params[:location][:postcode_address],\n street_address: params[:location][:street_address]\n })\n @gig.location = location\n respond_to do |format|\n if @gig.save\n format.html { redirect_to @gig, notice: 'Gig was successfully created.' }\n format.json { render :show, status: :created, location: @gig }\n else\n format.html { render :new }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rogue = Rogue.new(rogue_params)\n\n respond_to do |format|\n if @rogue.save\n format.html { redirect_to @rogue, notice: 'Rogue was successfully created.' }\n format.json { render :show, status: :created, location: @rogue }\n else\n format.html { render :new }\n format.json { render json: @rogue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @bracket_golfer = BracketGolfer.new(bracket_golfer_params)\n\n respond_to do |format|\n if @bracket_golfer.save\n format.json { respond_with @bracket_golfer }\n else\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gentre = Gentre.new(gentre_params)\n\n respond_to do |format|\n if @gentre.save\n format.json { render :show, status: :created, location: @gentre }\n else\n format.json { render json: @gentre.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grooming = Grooming.new(grooming_params)\n\n respond_to do |format|\n if @grooming.save\n format.html { redirect_to @grooming, notice: 'Visit was successfully created.' }\n format.json { render :show, status: :created, location: @grooming }\n else\n format.html { render :new }\n format.json { render json: @grooming.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gig_set = GigSet.new(gig_set_params)\n @gig_set.number = (@gig_set.gig.gig_sets.map(&:number).compact.max || 0) + 1\n\n respond_to do |format|\n if @gig_set.save\n format.html { redirect_to edit_gig_path(@gig_set.gig) }\n format.json { redirect_to edit_gig_path(@gig_set.gig) }\n else\n format.html { redirect_to edit_gig_path(@gig_set.gig), error: \"Couldn't add a new set\" }\n format.json { redirect_to edit_gig_path(@gig_set.gig), status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grape = Composition.new(grape_params)\n @grape.grapename = Grape.find( params[ :grapename ] )\n respond_to do |format|\n if @grape.save\n format.html { redirect_to @grape, notice: 'Composition was successfully created.' }\n format.json { render :show, status: :created, location: @grape }\n else\n format.html { render :new }\n format.json { render json: @grape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @dragon = Dragon.new(params[:dragon])\n\n respond_to do |format|\n if @dragon.save\n format.html { redirect_to @dragon, :notice => 'Dragon was successfully created.' }\n format.json { render :json => @dragon, :status => :created, :location => @dragon }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @dragon.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @grumble = Grumble.new(grumble_params)\n\n respond_to do |format|\n if @grumble.save\n format.html { redirect_to @grumble, notice: 'Grumble was successfully created.' }\n format.json { render :show, status: :created, location: @grumble }\n else\n format.html { render :new }\n format.json { render json: @grumble.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grua = Grua.new(grua_params)\n\n respond_to do |format|\n if @grua.save\n format.html { redirect_to gruas_url, notice: 'Grua Se creó correctamente.' }\n format.json { render :index, status: :created, location: @grua }\n else\n format.html { render :new }\n format.json { render json: @grua.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sundry_grn = SundryGrn.new(params[:sundry_grn])\n\n respond_to do |format|\n if @sundry_grn.save\n format.html { redirect_to @sundry_grn, :notice => 'Sundry grn was successfully created.' }\n format.json { render :json => @sundry_grn, :status => :created, :location => @sundry_grn }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @sundry_grn.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n #@gift = Gift.new(gift_params)\n #create(giftname, gifturl, username)\n @id = gift_params[:giver]\n @user = Users.find_by(id: @id)\n puts params\n output = Gift.create(gift_params[:name], gift_params[:url], @user.username, params[:bio])\n render json: output\n # respond_to do |format|\n # if @gift.save\n # format.html { redirect_to @gift, notice: 'Gift was successfully created.' }\n # format.json { render :show, status: :created, location: @gift }\n # else\n # format.html { render :new }\n # format.json { render json: @gift.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"def create\n @gamer = Gamer.new(gamer_params)\n\n respond_to do |format|\n if @gamer.save\n format.html { redirect_to @gamer, notice: 'Gamer was successfully created.' }\n format.json { render :show, status: :created, location: @gamer }\n else\n format.html { render :new }\n format.json { render json: @gamer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def criar_sobrevivente\n @suvivor = Sobrevivente.create(\n name: params[:name], genero: params[:genero], idade: params[:idade],\n lat: params[:lat], lon: params[:lon],\n agua: params[:agua], comida: params[:comida], medicamento: params[:medicamento],\n municao: params[:municao]\n )\n render json: @suvivor\n end",
"def gig_params\n params.require(:gig).permit(:name, :price, :photo_url, :start_time, :gig_image, :remote_gig_image_url, :user_id, :location_id)\n end",
"def create\n @grm_dog = GrmDog.new(params[:grm_dog])\n\n respond_to do |format|\n if @grm_dog.save\n format.html { redirect_to @grm_dog, notice: 'Dog was succesfully created.' }\n format.json { render json: @grm_dog, status: :created, location: @grm_dog }\n else\n format.html { render action: \"new\" }\n format.json { render json: @grm_dog.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @raindrop = Raindrop.new(raindrop_params)\n\n respond_to do |format|\n if @raindrop.save\n format.html { redirect_to @raindrop, notice: 'Raindrop was successfully created.' }\n format.json { render :show, status: :created, location: @raindrop }\n else\n format.html { render :new }\n format.json { render json: @raindrop.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rayon = Rayon.new(params[:rayon])\n\n respond_to do |format|\n if @rayon.save\n format.html { redirect_to @rayon, notice: 'Rayon was successfully created.' }\n format.json { render json: @rayon, status: :created, location: @rayon }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rayon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @gig = Gig.new()\n @gig.build_attachment\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig }\n end\n end",
"def create\n @wager = Wager.new(params[:wager])\n\n if @wager.save\n render json: @wager, status: :created, location: @wager\n else\n render json: @wager.errors, status: :unprocessable_entity\n end\n end",
"def new\n @gig_request = GigRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gig_request }\n end\n end",
"def post_new_gist content \n\t\t\t\turl = GITHUB_API_GIST_LINK \n\t\t\t\tresponse = https_open_for ({url: url, mthd:\"post\", content: content})\n \t\t\t\tJSON.parse response.body\n\t\t\tend",
"def create\n @battle = Battle.new(battle_params)\n @battle.user_id = current_user.id\n @battle.start_date = Time.now.utc\n date_end = Chronic.parse(params[:battle][:end_date])\n @battle.end_date = date_end.nil? ? nil : date_end.utc.to_s\n debugger\n if params[:character_ids]\n char_ids = params[:character_ids]\n char_ids.shift\n end\n if char_ids.nil? || (char_ids.length < 2)\n @battle.errors.add(:battle_rosters, \"A battle must have at least two characters.\")\n end\n respond_to do |format|\n if @battle.errors.empty? && @battle.save\n char_ids.each do |char_id|\n @battle.battle_rosters.create(character_id: char_id.to_i)\n end\n format.html { redirect_to @battle, notice: 'Battle was successfully created.' }\n format.json { render action: 'show', status: :created, location: @battle }\n else\n flash[:error] = @battle.errors.full_messages\n format.html { render action: 'new' }\n format.json { render json: @battle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gigapan = Gigapan.new(gigapan_params)\n\n respond_to do |format|\n if @gigapan.save\n format.html { redirect_to @gigapan, notice: 'Gigapan was successfully created.' }\n format.json { render :show, status: :created, location: @gigapan }\n else\n format.html { render :new }\n format.json { render json: @gigapan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rigging_params\n params.require(:rigging).permit(:rigging)\n end",
"def create\n @gosok = Gosok.new(gosok_params)\n\n respond_to do |format|\n if @gosok.save\n format.html { redirect_to gosoks_url, notice: 'Gosok was successfully created.' }\n format.json { render :show, status: :created, location: @gosok }\n else\n format.html { render :new }\n format.json { render json: @gosok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @fridge = Fridge.new(params[:fridge])\n\n respond_to do |format|\n if @fridge.save\n format.html { redirect_to @fridge, notice: 'Fridge was successfully created.' }\n format.json { render json: @fridge, status: :created, location: @fridge }\n else\n format.html { render action: \"new\" }\n format.json { render json: @fridge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gig_request = GigRequest.new(gig_request_params)\n \n #@gig_request.name = encode(@gig_request.name)\n #@gig_request.address = encode(@gig_request.address)\n #@gig_request.email = encode(@gig_request.email)\n\n respond_to do |format|\n if @gig_request.save\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully created.' }\n format.json { render :show, status: :created, location: @gig_request }\n else\n format.html { render :new }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n #flash[:error] = @gig_request.errors.full_messages[0]\n #render 'new'\n end\n end\n end",
"def create\n @regraponto = Regraponto.new(regraponto_params)\n\n respond_to do |format|\n if @regraponto.save\n format.html { redirect_to @regraponto, notice: 'Regraponto was successfully created.' }\n format.json { render :show, status: :created, location: @regraponto }\n else\n format.html { render :new }\n format.json { render json: @regraponto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @game = Game.new(game_params)\n @game.user_id = current_user.id \n @game.img_url_small = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"image\"][\"screen_url\"]\n @game.img_url_large = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"image\"][\"small_url\"]\n @game.deck = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"deck\"]\n @game.developers = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"developers\"][0][\"name\"]\n @game.genre = APIS::Giantbomb.new.game_by_id(@game.game_id)[\"results\"][\"genres\"][0][\"name\"]\n\n respond_to do |format|\n if @game.save\n format.html { redirect_to search_index_path, notice: 'Game was successfully created.' }\n format.json { render :show, status: :created, location: @game }\n else\n format.html { render :new }\n format.json { render json: @game.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @groupe_aile = GroupeAile.new(groupe_aile_params)\n\n respond_to do |format|\n if @groupe_aile.save\n format.html { redirect_to @groupe_aile, notice: 'Groupe aile was successfully created.' }\n format.json { render action: 'show', status: :created, location: @groupe_aile }\n else\n format.html { render action: 'new' }\n format.json { render json: @groupe_aile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rebateable = find_rebateable\n @rebate = @rebateable.rebates.build(params[:rebate])\n @sector_names = params[:sector_names] || []\n @industry_names = params[:industry_names] || []\n @rebate.tag_names = @sector_names.join(',') + \",\" + @industry_names.join(',')\n\n respond_to do |format|\n if @rebate.save\n format.html { redirect_to :id => nil }\n format.json { render json: @rebate, status: :created, location: @rebate }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rebate.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @garrison = Garrison.new(garrison_params)\n @garrison.kingdom_id = current_user.current_kingdom.id\n @garrison.recruted = true\n\n respond_to do |format|\n if @garrison.save\n format.html { redirect_to @garrison, notice: 'Garrison was successfully created.' }\n format.json { render action: 'show', status: :created, location: @garrison }\n else\n format.html { render action: 'new' }\n format.json { render json: @garrison.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gasto = Gasto.new(params[:gasto])\n\n respond_to do |format|\n if @gasto.save\n format.html { redirect_to @gasto, notice: 'Gasto was successfully created.' }\n format.json { render json: @gasto, status: :created, location: @gasto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gasto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gesture = Gesture.new(gesture_params)\n\n if @gesture.save\n render json: @gesture, status: :created, location: @gesture\n else\n render json: @gesture.errors, status: :unprocessable_entity\n end\n end",
"def create\n @game_genre = GameGenre.new(game_genre_params)\n\n respond_to do |format|\n if @game_genre.save\n format.html { redirect_to @game_genre, notice: 'Game genre was successfully created.' }\n format.json { render :show, status: :created, location: @game_genre }\n else\n format.html { render :new }\n format.json { render json: @game_genre.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rock = Rock.new(rock_params)\n\n if @rock.save\n render json: @rock, status: :created\n else\n render json: @rock.errors, status: :unprocessable_entity\n end\n end",
"def create\n @gnode = Gnode.new(params[:gnode])\n\n respond_to do |format|\n if @gnode.save\n format.html { redirect_to @gnode, notice: 'Gnode was successfully created.' }\n format.json { render json: @gnode, status: :created, location: @gnode }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gnode.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @stilage = Stilage.new(stilage_params)\n respond_to do |format|\n if @stilage.save\n format.html { redirect_to @stilage, notice: 'Stilage was successfully created.' }\n format.json { render :show, status: :created, location: @stilage }\n else\n format.html { render :new }\n format.json { render json: @stilage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @garment_image = GarmentImage.new(params[:garment_image])\n\n respond_to do |format|\n if @garment_image.save\n format.html { redirect_to @garment_image, notice: 'Garment image was successfully created.' }\n format.json { render json: @garment_image, status: :created, location: @garment_image }\n else\n format.html { render action: \"new\" }\n format.json { render json: @garment_image.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @redpack = Redpack.new(params[:redpack])\n\n respond_to do |format|\n if @redpack.save\n format.html { redirect_to @redpack, notice: 'Redpack was successfully created.' }\n format.json { render json: @redpack, status: :created, location: @redpack }\n else\n format.html { render action: \"new\" }\n format.json { render json: @redpack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grocery = Grocery.new(grocery_params)\n\n if @grocery.save\n render json: @grocery, status: :created, location: @grocery\n else\n render json: @grocery.errors, status: :unprocessable_entity\n end\n end",
"def create\n @garrage = Garrage.new(garrage_params)\n @garrage.user_id = current_user.id\n\n respond_to do |format|\n if @garrage.save\n format.html { redirect_to garrage_stuffs_path(@garrage), notice: 'Garrage was successfully created.' }\n format.json { render :show, status: :created, location: @garrage }\n else\n format.html { render :new }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def to_json_monsters2\n File.open(\"./db/Monstres_des_plaines_herbeuses.json\", 'w') do |file|\n file.write(@type)\n end\n puts \"...ecriture dans le fichier Monstres_des_plaines_herbeuses.json... success!\"\n end",
"def create\n @winding = Winding.new(winding_params)\n #Codigo para gerar gcode a 90 graus\n generate_gcode\n\n respond_to do |format|\n if @winding.save\n format.html { redirect_to @winding, notice: 'Winding was successfully created.' }\n format.json { render :show, status: :created, location: @winding }\n else\n format.html { render :new }\n format.json { render json: @winding.errors, status: :unprocessable_entity }\n end\n end\n end",
"def gig_roster_params\n params.require(:gig_roster).permit(:gig_id, :roster_id, :uniform, :in_time, :out_time, :accepted)\n end",
"def create\n @stone = Stone.new(stone_params)\n\n \n if @stone.save\n respond_with @stone\n else\n render json: @stone.errors, status: :unprocessable_entity \n end\n \n \n end",
"def create\n @gym_rat = GymRat.new(gym_rat_params)\n\n respond_to do |format|\n if @gym_rat.save\n format.html { redirect_to @gym_rat, notice: \"Gym rat was successfully created.\" }\n format.json { render :show, status: :created, location: @gym_rat }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @gym_rat.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grant_round = GrantRound.new(grant_round_params(params[:grant_round]))\n\n if @grant_round.save\n render json: @grant_round, status: :created, location: @grant_round\n else\n render json: @grant_round.errors, status: :unprocessable_entity\n end\n end",
"def create\n @sighting = Sighting.new(sighting_params)\n\n if @sighting.save\n render json: @sighting, status: :created, location: @sighting\n else\n render json: @sighting.errors, status: :unprocessable_entity\n end\n end",
"def create\n @shot = Shot.new(shot_params)\n @shot.save\n respond_with @shot\n end",
"def create\n s = Spooge.new()\n create_status = s.save\n n = generate_random_name\n s.name = n\n s.email = \"#{n}@gmail.com\"\n s.touch_date = DateTime.now\n s.status = STATUS[rand(STATUS.length)]\n\n resp = {:create_status => create_status, :record => s}\n render :json => resp\n end",
"def create\n @grm_grappt = GrmGrappt.new(params[:grm_grappt])\n\n respond_to do |format|\n if @grm_grappt.save\n format.html { redirect_to @grm_grappt, notice: 'Grooming appointment was successfully created.' }\n format.json { render json: @grm_grappt, status: :created, location: @grm_grappt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @grm_grappt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.new(params[:galaxies_lenticular_galaxy])\n\n respond_to do |format|\n if @galaxies_lenticular_galaxy.save\n format.html { redirect_to @galaxies_lenticular_galaxy, :notice => 'Lenticular galaxy was successfully created.' }\n format.json { render :json => @galaxies_lenticular_galaxy, :status => :created, :location => @galaxies_lenticular_galaxy }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @galaxies_lenticular_galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @gonullu = Gonullu.new(gonullu_params)\n\n respond_to do |format|\n if @gonullu.save\n format.html { redirect_to @gonullu, notice: 'Gonullu was successfully created.' }\n format.json { render :show, status: :created, location: @gonullu }\n else\n format.html { render :new }\n format.json { render json: @gonullu.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @roster = Roster.new(params[:roster])\n\n respond_to do |format|\n if @roster.save\n format.html { redirect_to @roster, :notice => 'Roster was successfully created.' }\n format.json { render :json => @roster, :status => :created, :location => @roster }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @roster.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n gethotelstaticdatagd = Gethotelstaticdatagd.get_hotel_static_data_gds(params)\n\n respond_to do |format|\n if gethotelstaticdatagd.body.include?(\"<boolean xmlns=\\\"http://www.reconline.com/\\\">true</boolean>\")\n flash[:notice] = 'Gethotelstaticdatagd was successfully created.'\n format.html { redirect_to :action=>:index }\n format.json { render json: @gethotelstaticdatagd, status: :created, location: @gethotelstaticdatagd }\n else\n flash[:notice] = gethotelstaticdatagd.body\n format.html { render action: \"new\" }\n format.json { render json: @gethotelstaticdatagd.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @shot = Shot.new(params[:shot])\n\n respond_to do |format|\n if @shot.save\n format.html { redirect_to @shot, notice: 'Shot was successfully created.' }\n format.json { render json: @shot, status: :created, location: @shot }\n else\n format.html { render action: \"new\" }\n format.json { render json: @shot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @litter = Litter.new(params[:litter])\n @pig = Pig.find(@litter.sow_id)\n @no_of_piglets = params[:no_of_piglets].to_i\n \n @no_of_piglets.times do\n Pig.create(name: @pig.name + ' piglet', status: alive_id, dob: Time.now, litter: @litter)\n end\n\n respond_to do |format|\n if @litter.save\n format.html { redirect_to @litter, notice: 'Litter was successfully created with ' + @no_of_piglets.to_s + ' piglets' }\n format.json { render json: @litter, status: :created, location: @litter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @litter.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @groomsman = Groomsman.new(groomsman_params)\n\n respond_to do |format|\n if @groomsman.save\n format.html { redirect_to @groomsman, notice: 'Groomsman was successfully created.' }\n format.json { render :show, status: :created, location: @groomsman }\n else\n format.html { render :new }\n format.json { render json: @groomsman.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gid2name = Gid2name.new(params[:gid2name])\n\n respond_to do |format|\n if @gid2name.save\n format.html { redirect_to @gid2name, notice: 'Gid2name was successfully created.' }\n format.json { render json: @gid2name, status: :created, location: @gid2name }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gid2name.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gua = Gua.new(gua_params)\n\n respond_to do |format|\n if @gua.save\n format.html { redirect_to @gua, notice: 'Gua was successfully created.' }\n format.json { render :show, status: :created, location: @gua }\n else\n format.html { render :new }\n format.json { render json: @gua.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # JSONファイルから文字列を抽出する\n file = params['stage']['file']# Upされたファイルにアクセス\n \n p(\"file params:\")\n\n @jsonstring = file.read\n p(@jsonstring)\n @stage = Stage.new(:scene_data => @jsonstring, :title => params[:stage][:title])\n p(\"stage.scene_data:\")\n p(@stage.scene_data)\n #p(@stage.nothing)\n \n if params[:stage][:texture] != nil\n @textures = Texture.new(:data => params[:stage][:texture]['data'])\n @stage.textures << @textures\n end\n\n respond_to do |format|\n if @stage.save!\n format.html { redirect_to @stage, notice: 'Stage was successfully created.' }\n format.json { render action: 'show', status: :created, location: @stage }\n else\n format.html { render action: 'new' }\n format.json { render json: @stage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @grass_allocation = GrassAllocation.new(grass_allocation_params)\n\n respond_to do |format|\n if @grass_allocation.save\n format.html { redirect_to @grass_allocation, notice: 'Grass allocation was successfully created.' }\n format.json { render :show, status: :created, location: @grass_allocation }\n else\n format.html { render :new }\n format.json { render json: @grass_allocation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gpost = Gpost.new(gpost_params)\n\n respond_to do |format|\n if @gpost.save\n format.html { redirect_to @gpost, notice: 'Gpost was successfully created.' }\n format.json { render :show, status: :created, location: @gpost }\n else\n format.html { render :new }\n format.json { render json: @gpost.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gang = Gang.new(gang_params)\n\n respond_to do |format|\n if @gang.save\n format.html { redirect_to @gang, notice: 'Gang was successfully created.' }\n format.json { render :show, status: :created, location: @gang }\n else\n format.html { render :new }\n format.json { render json: @gang.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gmap = Gmap.new(params[:gmap])\n\n respond_to do |format|\n if @gmap.save\n format.html { redirect_to @gmap, notice: 'Gmap was successfully created.' }\n format.json { render json: @gmap, status: :created, location: @gmap }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gmap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gatineo = Gatineo.new(gatineo_params)\n\n respond_to do |format|\n if @gatineo.save\n format.html { redirect_to @gatineo, notice: 'Gatineo criado com sucesso!' }\n format.json { render :show, status: :created, location: @gatineo }\n else\n format.html { render :new }\n format.json { render json: @gatineo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rower = Rower.new(rower_params)\n\n respond_to do |format|\n if @rower.save\n format.html { redirect_to @rower, notice: 'Rower was successfully created.' }\n format.json { render :show, status: :created, location: @rower }\n else\n format.html { render :new }\n format.json { render json: @rower.errors, status: :unprocessable_entity }\n end\n end\n end",
"def grape_params\n params.require(:grape).permit(:name)\n end",
"def create\n @ugroupe = Ugroupe.new(params[:ugroupe])\n respond_to do |format|\n if @ugroupe.save\n format.html { redirect_to ugroupes_path }\n format.json { render json: @ugroupe, status: :created, location: @ugroupe }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ugroupe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @regra = Regra.new(regra_params)\n\n respond_to do |format|\n if @regra.save\n format.html { redirect_to @regra, notice: 'Regra was successfully created.' }\n format.json { render :show, status: :created, location: @regra }\n else\n format.html { render :new }\n format.json { render json: @regra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @location = Geolocation.new(params[:geolocation])\n @scene = Scene.new(:title => params[:title])\n @location.scenes << @scene\n @location.save\n @scene.save\n\n respond_to do |format|\n if @location.save\n format.html { redirect_to @location, notice: 'Location was successfully create.'}\n format.json { render json: @location, status: :created, location: @location }\n else\n format.html { render action: \"new\"}\n format.json { render json: @location.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @rum = Rum.new(params[:rum])\n\n respond_to do |format|\n if @rum.save\n format.html { redirect_to @rum, notice: 'Rum was successfully created.' }\n format.json { render json: @rum, status: :created, location: @rum }\n else\n format.html { render action: \"new\" }\n format.json { render json: @rum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @galletum = Galletum.new(galletum_params)\n\n respond_to do |format|\n if @galletum.save\n format.html { redirect_to @galletum, notice: 'Galletum was successfully created.' }\n format.json { render :show, status: :created, location: @galletum }\n else\n format.html { render :new }\n format.json { render json: @galletum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def gun_params\n params.require(:gun).permit(:name, :caliber, :brand_id)\n end",
"def semesters\n uni_year = UniYear.find_by_id(params[:uni_year_id])\n @semesters = uni_year ? uni_year.semesters : []\n \n respond_to do |format|\n format.json { render json: @semesters }\n end\n end",
"def create\n megam_rest.post_promos(to_hash) #WONT BE USED AS OF NOW\n end",
"def create\n @gpath = Gpath.new(params[:gpath])\n\n respond_to do |format|\n if @gpath.save\n format.html { redirect_to @gpath, notice: 'Gpath was successfully created.' }\n format.json { render json: @gpath, status: :created, location: @gpath }\n else\n format.html { render action: \"new\" }\n format.json { render json: @gpath.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @gig = Gig.new(params[:gig])\n @venue = Venue.new(params[:venue])\n respond_to do |format|\n if @gig.save\n @gig.venue_id = @venue\n @venue.save\n format.html { redirect_to(@gig) }\n format.xml { render :xml => @gig, :status => :created, :location => @gig }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @gig.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n resort = Resort.new(resort_params)\n\n if resort.save\n render json: ResortSerializer.new(resort).serialized_json\n else \n render json: { error: resort.errors.messages }, status: 422\n end\n end",
"def create\n @battle_roster = BattleRoster.new(battle_roster_params)\n\n respond_to do |format|\n if @battle_roster.save\n format.html { redirect_to @battle_roster, notice: 'Battle roster was successfully created.' }\n format.json { render action: 'show', status: :created, location: @battle_roster }\n else\n format.html { render action: 'new' }\n format.json { render json: @battle_roster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @retro = Retro.new(params[:retro])\n\n respond_to do |format|\n if @retro.save\n format.html { redirect_to @retro, notice: 'Retro was successfully created.' }\n format.json { render json: @retro, status: :created, location: @retro }\n else\n format.html { render action: \"new\" }\n format.json { render json: @retro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @svgpost = Svgpost.new(params[:svgpost])\n\n respond_to do |format|\n if @svgpost.save\n format.html { redirect_to @svgpost, notice: 'Svgpost was successfully created.' }\n format.json { render json: @svgpost, status: :created, location: @svgpost }\n else\n format.html { render action: \"new\" }\n format.json { render json: @svgpost.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sighting = Sighting.new(sighting_params)\n\n if @sighting.save\n render json: @sighting, status: :created, location: @sighting\n else\n render json: @sighting.errors, status: :unprocessable_entity\n end\n end"
] |
[
"0.6435959",
"0.6203761",
"0.57345134",
"0.5713185",
"0.57082677",
"0.56806153",
"0.5640973",
"0.5598938",
"0.5576061",
"0.5535237",
"0.55335325",
"0.5497338",
"0.5493931",
"0.54831547",
"0.5470487",
"0.5462567",
"0.5458965",
"0.5448089",
"0.544026",
"0.5428171",
"0.5377553",
"0.5368064",
"0.5348461",
"0.53461236",
"0.53459996",
"0.5345016",
"0.53316355",
"0.53306687",
"0.5319209",
"0.53157765",
"0.53155476",
"0.5306892",
"0.5293791",
"0.52933943",
"0.52926207",
"0.5290897",
"0.5283697",
"0.52830344",
"0.5281806",
"0.52801245",
"0.52736133",
"0.5273417",
"0.52708155",
"0.5267521",
"0.526692",
"0.52640176",
"0.5261378",
"0.523658",
"0.5235469",
"0.5230592",
"0.5207261",
"0.5203017",
"0.519802",
"0.51937884",
"0.5191905",
"0.51872855",
"0.5182264",
"0.51815796",
"0.5179762",
"0.5166938",
"0.51583856",
"0.51561934",
"0.5139437",
"0.5139182",
"0.51361984",
"0.5124266",
"0.5121305",
"0.51184374",
"0.511676",
"0.51141095",
"0.51140815",
"0.5105405",
"0.51039904",
"0.5099128",
"0.50932187",
"0.5089913",
"0.5088993",
"0.5082347",
"0.5080247",
"0.5077469",
"0.5076471",
"0.50763345",
"0.5072833",
"0.50683546",
"0.5067761",
"0.50572073",
"0.50564003",
"0.505623",
"0.5045159",
"0.5044885",
"0.5041819",
"0.5040043",
"0.50390846",
"0.5037821",
"0.5037192",
"0.50278866",
"0.502771",
"0.50226647",
"0.5019764",
"0.5014495"
] |
0.6308921
|
1
|
PATCH/PUT /gig_rosters/1 PATCH/PUT /gig_rosters/1.json
|
def update
respond_to do |format|
if @gig_roster.update(gig_roster_params)
format.html { redirect_to @gig_roster, notice: 'Gig roster was successfully updated.' }
format.json { render :show, status: :ok, location: @gig_roster }
else
format.html { render :edit }
format.json { render json: @gig_roster.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n respond_to do |format|\n if @rigging.update(rigging_params)\n format.html { redirect_to @rigging, notice: 'Rigging was successfully updated.' }\n format.json { render :show, status: :ok, location: @rigging }\n else\n format.html { render :edit }\n format.json { render json: @rigging.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n if update_gig(@gig)\n format.html { redirect_to @gig, notice: 'Gig was successfully updated.' }\n format.json { render json: @gig, status: :ok, location: @gig }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n if @golfer.update_attributes(params[:golfer])\n format.html { redirect_to @golfer, notice: 'Golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grape.update(grape_params)\n format.html { redirect_to @grape, notice: \"Grape was successfully updated.\" }\n format.json { render :show, status: :ok, location: @grape }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @grape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gig_set.update(gig_set_params)\n format.html { redirect_to edit_gig_path(@gig_set.gig) }\n format.json { redirect_to edit_gig_path(@gig_set.gig) }\n else\n format.html { redirect_to edit_gig_path(@gig_set.gig), error: \"Couldn't update set\" }\n format.json { redirect_to edit_gig_path(@gig_set.gig), status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grape.update(grape_params)\n format.html { redirect_to @grape, notice: 'Composition was successfully updated.' }\n format.json { render :show, status: :ok, location: @grape }\n else\n format.html { render :edit }\n format.json { render json: @grape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gig_request = GigRequest.find(params[:id])\n\n respond_to do |format|\n if @gig_request.update_attributes(params[:gig_request])\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gig_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gig.update(gig_params)\n format.html { redirect_to @gig, notice: \"Gig was successfully updated.\" }\n format.json { render :show, status: :ok, location: @gig }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @gig.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @socio_rg.update(socio_rg_params)\n format.html { redirect_to @socio_rg, notice: 'Socio rg was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @socio_rg.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fridge = Fridge.find(params[:id])\n\n respond_to do |format|\n if @fridge.update_attributes(params[:fridge])\n format.html { redirect_to @fridge, notice: 'Fridge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fridge.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 respond_to do |format|\n if @gig_request.update(gig_request_params)\n format.html { redirect_to @gig_request, notice: 'Gig request was successfully updated.' }\n format.json { render :show, status: :ok, location: @gig_request }\n else\n format.html { render :edit }\n format.json { render json: @gig_request.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 @glass = Glass.find(params[:id])\n\n respond_to do |format|\n if @glass.update_attributes(params[:glass])\n format.html { redirect_to @glass, notice: 'Glass was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @glass.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @bracket_golfer.update(bracket_golfer_params)\n format.html { redirect_to @bracket_golfer, notice: 'Bracket golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bracket_golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch!\n request! :patch\n end",
"def update\n respond_to do |format|\n if @gear.update(gear_params)\n format.html { redirect_to @gear, notice: 'Gear was successfully updated.' }\n format.json { render :show, status: :ok, location: @gear }\n else\n format.html { render :edit }\n format.json { render json: @gear.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gear.update(gear_params)\n format.html { redirect_to @gear, notice: 'Gear was successfully updated.' }\n format.json { render :show, status: :ok, location: @gear }\n else\n format.html { render :edit }\n format.json { render json: @gear.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n @rooster = Rooster.find(params[:id])\n\n respond_to do |format|\n if @rooster.update_attributes(params[:rooster])\n format.html { redirect_to @rooster, notice: 'Rooster was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rooster.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gig_type.update(gig_type_params)\n format.html { redirect_to @gig_type, notice: 'Gig type was successfully updated.' }\n format.json { render :show, status: :ok, location: @gig_type }\n else\n format.html { render :edit }\n format.json { render json: @gig_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gist.update(gist_params)\n format.html { redirect_to @gist, notice: 'Gist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @allergy.update(allergy_params)\n format.html { redirect_to @allergy, notice: t('allergies.update_success') }\n format.json { render :show, status: :ok, location: @allergy }\n else\n format.html { render :edit }\n format.json { render json: @allergy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @fucker = Fucker.find(params[:id])\n\n respond_to do |format|\n if @fucker.update_attributes(params[:fucker])\n format.json { head :no_content }\n else\n format.json { render json: @fucker.errors, status: :internal_server_error }\n end\n end\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n respond_to do |format|\n if @gamer.update(gamer_params)\n format.html { redirect_to @gamer, notice: 'Gamer was successfully updated.' }\n format.json { render :show, status: :ok, location: @gamer }\n else\n format.html { render :edit }\n format.json { render json: @gamer.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 @shot = Shot.find(params[:id])\n\n if @shot.update(shot_params)\n head :no_content\n else\n render json: @shot.errors, status: :unprocessable_entity\n end\n end",
"def update\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n if @gig.update_attributes(params[:gig])\n flash[:notice] = 'Gig was successfully updated.'\n format.html { redirect_to(@gig) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gig.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @restroom.update(restroom_params)\n format.html { redirect_to @restroom, notice: 'Restroom was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @restroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @groupe_aile.update(groupe_aile_params)\n format.html { redirect_to @groupe_aile, notice: 'Groupe aile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @groupe_aile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n if @genotype.update_attributes(params[:genotype])\n format.html { redirect_to @genotype, notice: 'Genotype was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @genotype.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @grocery = Grocery.find(params[:id])\n\n if @grocery.update(grocery_params)\n head :no_content\n else\n render json: @grocery.errors, status: :unprocessable_entity\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 @gist = Gist.find(params[:id])\n\n respond_to do |format|\n if @gist.update_attributes(params[:gist])\n format.html { redirect_to @gist, notice: 'Gist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gist.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @golf.update(golf_params)\n format.html { redirect_to @golf, notice: 'Golf was successfully updated.' }\n format.json { render :show, status: :ok, location: @golf }\n else\n format.html { render :edit }\n format.json { render json: @golf.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gosok.update(gosok_params)\n format.html { redirect_to gosoks_url, notice: 'Gosok was successfully updated.' }\n format.json { render :show, status: :ok, location: @gosok }\n else\n format.html { render :edit }\n format.json { render json: @gosok.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @rayon = Rayon.find(params[:id])\n\n respond_to do |format|\n if @rayon.update_attributes(params[:rayon])\n format.html { redirect_to @rayon, notice: 'Rayon was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rayon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def put!\n request! :put\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 @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n if @gasto.update_attributes(params[:gasto])\n format.html { redirect_to @gasto, notice: 'Gasto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gasto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gabinete_object.update(gabinete_object_params)\n format.html { redirect_to creation_gabinete_objects_path, notice: 'Gabinete object was successfully updated.' }\n format.json { render :show, status: :ok, location: @gabinete_object }\n else\n format.html { render :edit }\n format.json { render json: @gabinete_object.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grooming.update(grooming_params)\n format.html { redirect_to @grooming, notice: 'Visit was successfully updated.' }\n format.json { render :show, status: :ok, location: @grooming }\n else\n format.html { render :edit }\n format.json { render json: @grooming.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch\n end",
"def update\n respond_to do |format|\n if @gato.update(gato_params)\n format.html { redirect_to @gato, notice: 'Gato was successfully updated.' }\n format.json { render :show, status: :ok, location: @gato }\n else\n format.html { render :edit }\n format.json { render json: @gato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @rig = Rig.find(params[:id])\n\n respond_to do |format|\n if @rig.update_attributes(params[:rig])\n flash[:notice] = 'Rig was successfully updated.'\n format.html { redirect_to(@rig) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @rig.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @galaxies_lenticular_galaxy = Galaxies::LenticularGalaxy.find(params[:id])\n\n respond_to do |format|\n if @galaxies_lenticular_galaxy.update_attributes(params[:galaxies_lenticular_galaxy])\n format.html { redirect_to @galaxies_lenticular_galaxy, :notice => 'Lenticular galaxy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @galaxies_lenticular_galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gentre.update(gentre_params)\n format.json { render :show, status: :ok, location: @gentre }\n else\n format.json { render json: @gentre.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @galaxies_elliptical_galaxy.update(galaxies_elliptical_galaxy_params)\n format.html { redirect_to @galaxies_elliptical_galaxy, notice: 'Elliptical galaxy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galaxies_elliptical_galaxy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @voxel.update(voxel_params)\n format.html { redirect_to @voxel, notice: '更新されました!' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @voxel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @shot = Shot.find(params[:id])\n\n respond_to do |format|\n if @shot.update_attributes(params[:shot])\n format.html { redirect_to @shot, notice: 'Shot was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @shot.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @galaxy.update(galaxy_params)\n format.html { redirect_to @galaxy, notice: 'Galaxy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @galaxy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @galaxy = Galaxy.find(params[:id])\n\n respond_to do |format|\n if @galaxy.update_attributes(params[:galaxy])\n format.html { redirect_to @galaxy, :notice => 'Galaxy was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @galaxy.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n if @ginasio.update_attributes(params[:ginasio])\n format.html { redirect_to @ginasio, :flash => { :success => 'Dados do ginasio alterados com successo!' } }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @ginasio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n if @grm_grappt.update_attributes(params[:grm_grappt])\n format.html { redirect_to @grm_grappt, notice: 'Grooming appointment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grm_grappt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n @gear = Gear.find(params[:id])\n\n respond_to do |format|\n if @gear.update_attributes(params[:gear])\n flash[:notice] = 'Gear was successfully updated.'\n format.html { redirect_to('/gears') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @gear.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gameroom.update(gameroom_params)\n format.html { redirect_to @gameroom, notice: 'Gameroom was successfully updated.' }\n format.json { render :show, status: :ok, location: @gameroom }\n else\n format.html { render :edit }\n format.json { render json: @gameroom.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n require 'rest-client'\n response = RestClient.put('localhost:3001/colores/'+@color.id.to_s, color_params.as_json, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'})\n if response.code == 200\n @color = JSON.parse(response.body)\n\n format.html { redirect_to @color, notice: \"Color was successfully updated.\" }\n format.json { render :show, status: :ok, location: @color }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @color.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @goofball.update(goofball_params)\n format.html { redirect_to @goofball, notice: 'Goofball was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goofball.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rogue.update(rogue_params)\n format.html { redirect_to @rogue, notice: 'Rogue was successfully updated.' }\n format.json { render :show, status: :ok, location: @rogue }\n else\n format.html { render :edit }\n format.json { render json: @rogue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end",
"def update\n respond_to do |format|\n if @grumble.update(grumble_params)\n format.html { redirect_to @grumble, notice: 'Grumble was successfully updated.' }\n format.json { render :show, status: :ok, location: @grumble }\n else\n format.html { render :edit }\n format.json { render json: @grumble.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end",
"def update\n @shot = Shot.find(params[:id])\n @shot.update_attributes(shot_params)\n respond_with @shot\n end",
"def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end",
"def update\n respond_to do |format|\n if @robo.update(robo_params)\n format.html { redirect_to @robo, notice: 'Robo was successfully updated.' }\n format.json { render :show, status: :ok, location: @robo }\n else\n format.html { render :edit }\n format.json { render json: @robo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @garply.update(garply_params)\n format.html { redirect_to @garply, notice: 'Garply was successfully updated.' }\n format.json { render :show, status: :ok, location: @garply }\n else\n format.html { render :edit }\n format.json { render json: @garply.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @dragon = Dragon.find(params[:id])\n\n respond_to do |format|\n if @dragon.update_attributes(params[:dragon])\n format.html { redirect_to @dragon, :notice => 'Dragon was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @dragon.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 @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n if @gethotel.update_attributes(params[:gethotel])\n format.html { redirect_to @gethotel, notice: 'Gethotel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gethotel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rogue.update(rogue_params)\n format.html { redirect_to @rogue, notice: \"Rogue was successfully updated.\" }\n format.json { render :show, status: :ok, location: @rogue }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @rogue.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @redpack = Redpack.find(params[:id])\n\n respond_to do |format|\n if @redpack.update_attributes(params[:redpack])\n format.html { redirect_to @redpack, notice: 'Redpack was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @redpack.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @garrage.update(garrage_params)\n format.html { redirect_to @garrage, notice: 'Garrage was successfully updated.' }\n format.json { render :show, status: :ok, location: @garrage }\n else\n format.html { render :edit }\n format.json { render json: @garrage.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n if @gauge.update_attributes(params[:gauge])\n format.html { redirect_to @gauge, notice: 'Gauge was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gauge.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @grave.updated_by_id = current_user.id\n respond_to do |format|\n if @grave.update(grave_params)\n format.html { redirect_to graves_url, notice: 'Grave was successfully updated.' }\n format.json { render :show, status: :ok, location: @grave }\n else\n format.html { render :edit }\n format.json { render json: @grave.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n if @gopy.update_attributes(params[:gopy])\n format.html { redirect_to @gopy, notice: 'Gopy was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @gopy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @g_file.update(g_file_params)\n format.html { redirect_to @g_file, notice: 'G file was successfully updated.' }\n format.json { render :show, status: :ok, location: @g_file }\n else\n format.html { render :edit }\n format.json { render json: @g_file.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gato.update(gato_params)\n format.html { redirect_to gatos_url, notice: 'Gato actualizado.' }\n format.json { render :show, status: :ok, location: @gato }\n else\n format.html { render :edit }\n format.json { render json: @gato.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @grua.update(grua_params)\n format.html { redirect_to @grua, notice: 'Grua editada exitosamente.' }\n format.json { render :show, status: :ok, location: @grua }\n else\n format.html { render :edit }\n format.json { render json: @grua.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @roast.update(roast_params)\n format.html { redirect_to @roast, notice: 'Roast was successfully updated.' }\n format.json { render :show, status: :ok, location: @roast }\n else\n format.html { render :edit }\n format.json { render json: @roast.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gallery.update(gallery_params)\n format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @gallery.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @crag.update(crag_params)\n format.html { redirect_to @crag, notice: 'Crag was successfully updated.' }\n format.json { render :show, status: :ok, location: @crag }\n else\n format.html { render :edit }\n format.json { render json: @crag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @kota_stone.update(kota_stone_params)\n format.html { redirect_to kota_stones_url, notice: 'Kota stone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @kota_stone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @jogo.update(jogo_params)\n format.html { redirect_to @jogo, notice: 'Jogo was successfully updated.' }\n format.json { render :show, status: :ok, location: @jogo }\n else\n format.html { render :edit }\n format.json { render json: @jogo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @greffe.update(greffe_params)\n format.html { redirect_to administration_greffe_path(@greffe), notice: 'Greffe was successfully updated.' }\n format.json { render :show, status: :ok, location: @greffe }\n else\n format.html { render :edit }\n format.json { render json: @greffe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit_gist(id, files={}, options={:public => true})\n options.merge!(files)\n patch \"/gists/#{id}\", :body => options\n end",
"def update\n respond_to do |format|\n if @gruop.update(gruop_params)\n format.html { redirect_to [@user,@gruop], notice: 'Gruop was successfully updated.' }\n format.json { render :show, status: :ok, location: @gruop }\n else\n format.html { render :edit }\n format.json { render json: @gruop.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @jugadore.update( jugadore_params )\n format.html { redirect_to @jugadore, notice: 'Jugadore was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @jugadore.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @garrison.update(garrison_params)\n format.html { redirect_to @garrison, notice: 'Garrison was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @garrison.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"def update\n @grm = Grm.find(params[:id])\n\n respond_to do |format|\n if @grm.update_attributes(params[:grm])\n format.html { redirect_to @grm, notice: 'Grm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @grm.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @glo_collection.update(glo_collection_params)\n format.html { redirect_to @glo_collection, notice: 'Glo collection was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @glo_collection.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 respond_to do |format|\n if @genero.update(genero_params)\n flash[:success] = \"Gênero #{@genero.nome} foi editado com sucesso!\"\n format.html { redirect_to @genero }\n format.json { render :show, status: :ok, location: @genero }\n else\n flash.now[:danger] = \"Gênero #{@genero.nome} não foi editado com sucesso!\"\n format.html { render :edit }\n format.json { render json: @genero.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @gonullu.update(gonullu_params)\n format.html { redirect_to @gonullu, notice: 'Gonullu was successfully updated.' }\n format.json { render :show, status: :ok, location: @gonullu }\n else\n format.html { render :edit }\n format.json { render json: @gonullu.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end"
] |
[
"0.64761394",
"0.6422662",
"0.6358383",
"0.6266577",
"0.6238321",
"0.6231431",
"0.62157834",
"0.619248",
"0.61745423",
"0.6137368",
"0.61289",
"0.60328996",
"0.6001447",
"0.5999661",
"0.5976048",
"0.5971105",
"0.59478647",
"0.59478647",
"0.5945901",
"0.59276575",
"0.5902739",
"0.5901453",
"0.5876783",
"0.58670306",
"0.58447737",
"0.58293426",
"0.5819635",
"0.5803107",
"0.58017147",
"0.5799222",
"0.57947284",
"0.5793938",
"0.57888806",
"0.57845235",
"0.57820123",
"0.5774646",
"0.57623756",
"0.5757697",
"0.5755639",
"0.57540625",
"0.57540625",
"0.5744842",
"0.57399505",
"0.5725281",
"0.5716068",
"0.5711404",
"0.5703171",
"0.569971",
"0.5690269",
"0.56882375",
"0.56826264",
"0.56800264",
"0.56787205",
"0.5678316",
"0.5671661",
"0.5667602",
"0.5666155",
"0.5665536",
"0.566249",
"0.5659698",
"0.5655146",
"0.5650739",
"0.56493556",
"0.56461155",
"0.564522",
"0.56450397",
"0.56387687",
"0.5638117",
"0.5622562",
"0.562176",
"0.5615305",
"0.5615305",
"0.5610111",
"0.5609777",
"0.56083703",
"0.56053877",
"0.560304",
"0.5601277",
"0.5598958",
"0.5598663",
"0.55984557",
"0.5596724",
"0.559192",
"0.55898076",
"0.55834275",
"0.55769145",
"0.55764824",
"0.5574637",
"0.5574372",
"0.55715865",
"0.5567899",
"0.5567537",
"0.55654824",
"0.5564868",
"0.55643547",
"0.556275",
"0.55624837",
"0.55623084",
"0.5557523",
"0.55560666"
] |
0.6115092
|
11
|
DELETE /gig_rosters/1 DELETE /gig_rosters/1.json
|
def destroy
@gig_roster.destroy
respond_to do |format|
format.html { redirect_to gig_rosters_url, notice: 'Gig roster was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @gig = Gig.find(params[:id])\n @gig.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { render json: nil, status: :ok }\n end\n end",
"def destroy\n @rigging.destroy\n respond_to do |format|\n format.html { redirect_to riggings_url, notice: 'Rigging was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig_request = GigRequest.find(params[:id])\n @gig_request.destroy\n\n respond_to do |format|\n format.html { redirect_to gig_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @golfer = Golfer.find(params[:id])\n @golfer.destroy\n\n respond_to do |format|\n format.html { redirect_to golfers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @graveyard.destroy\n respond_to do |format|\n format.html { redirect_to graveyards_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig.destroy\n respond_to do |format|\n format.html { redirect_to gigs_url, notice: 'Gig was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig.destroy\n respond_to do |format|\n format.html { redirect_to gigs_url, notice: \"Gig was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gasto = Gasto.find(params[:id])\n @gasto.destroy\n\n respond_to do |format|\n format.html { redirect_to gastos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @crag.destroy\n respond_to do |format|\n format.html { redirect_to crags_url, notice: 'Crag was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @gpath = Gpath.find(params[:id])\n @gpath.destroy\n\n respond_to do |format|\n format.html { redirect_to gpaths_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n @gethotelstaticdatagd.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotelstaticdatagds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @groupe_aile.destroy\n respond_to do |format|\n format.html { redirect_to groupe_ailes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @socio_rg.destroy\n respond_to do |format|\n format.html { redirect_to socio_rgs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig = Gig.find(params[:id])\n @gig.destroy\n\n respond_to do |format|\n format.html { redirect_to(gigs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @fridge = Fridge.find(params[:id])\n @fridge.destroy\n\n respond_to do |format|\n format.html { redirect_to fridges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig_request.destroy\n respond_to do |format|\n format.html { redirect_to gig_requests_url, notice: 'Gig request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gig_type.destroy\n respond_to do |format|\n format.html { redirect_to gig_types_url, notice: 'Gig type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @bracket_golfer.destroy\n respond_to do |format|\n format.html { redirect_to bracket_golfers_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gentre.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @rig = Rig.find(params[:id])\n @rig.destroy\n\n respond_to do |format|\n format.html { redirect_to(rigs_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @gruop.destroy\n respond_to do |format|\n format.html { redirect_to gruops_url, notice: 'Gruop was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gist.destroy\n respond_to do |format|\n format.html { redirect_to gists_url }\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 @grape.destroy\n respond_to do |format|\n format.html { redirect_to grapes_url, notice: \"Grape was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grm_dog = GrmDog.find(params[:id])\n @grm_dog.destroy\n\n respond_to do |format|\n format.html { redirect_to grm_dogs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @galeria = Galeria.find(params[:id])\n @galeria.destroy\n\n respond_to do |format|\n format.html { redirect_to galerias_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @green = Green.find(params[:id])\n @green.destroy\n\n respond_to do |format|\n format.html { redirect_to scaffold_greens_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @grumble.destroy\n respond_to do |format|\n format.html { redirect_to grumbles_url, notice: 'Grumble was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @genotype = Genotype.find(params[:id])\n @genotype.destroy\n\n respond_to do |format|\n format.html { redirect_to genotypes_url }\n format.json { head :ok }\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 @gauge = Gauge.find(params[:id])\n @gauge.destroy\n\n respond_to do |format|\n format.html { redirect_to gauges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @garply.destroy\n respond_to do |format|\n format.html { redirect_to garplies_url, notice: 'Garply was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @dragon = Dragon.find(params[:id])\n @dragon.destroy\n\n respond_to do |format|\n format.html { redirect_to dragons_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @grave.destroy\n respond_to do |format|\n format.html { redirect_to graves_url, notice: 'Grave was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gatha.destroy\n respond_to do |format|\n format.html { redirect_to gathas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gravity = Gravity.find(params[:id])\n @gravity.destroy\n\n respond_to do |format|\n format.html { redirect_to gravities_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @razmer_go = RazmerGo.find(params[:id])\n @razmer_go.destroy\n\n respond_to do |format|\n format.html { redirect_to razmer_gos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grm_grappt = GrmGrappt.find(params[:id])\n @grm_grappt.destroy\n\n respond_to do |format|\n format.html { redirect_to grm_grappts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @red.destroy\n respond_to do |format|\n format.html { redirect_to reds_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @regraponto.destroy\n respond_to do |format|\n format.html { redirect_to regrapontos_url, notice: 'Regraponto was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hoge = Hoge.find(params[:id])\n @hoge.destroy\n\n respond_to do |format|\n format.html { redirect_to hoges_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @gadget_file.destroy\n respond_to do |format|\n format.html { redirect_to gadget_files_url, notice: 'Gadget file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brag = Brag.find(params[:id])\n @brag.destroy\n\n respond_to do |format|\n format.html { redirect_to brags_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shot = Shot.find(params[:id])\n @shot.destroy\n\n respond_to do |format|\n format.html { redirect_to shots_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gl.destroy\n respond_to do |format|\n format.html { redirect_to gls_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 @kota_stone.destroy\n respond_to do |format|\n format.html { redirect_to kota_stones_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gravity.destroy\n respond_to do |format|\n format.html { redirect_to gravities_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gethotel = Gethotel.find(params[:id])\n @gethotel.destroy\n\n respond_to do |format|\n format.html { redirect_to gethotels_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rayon = Rayon.find(params[:id])\n @rayon.destroy\n\n respond_to do |format|\n format.html { redirect_to rayons_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gid2name = Gid2name.find(params[:id])\n @gid2name.destroy\n\n respond_to do |format|\n format.html { redirect_to gid2names_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gatineo.destroy\n respond_to do |format|\n format.html { redirect_to gatineos_url, notice: 'Gatineo apagado com sucesso!' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gonzo.destroy\n respond_to do |format|\n format.html { redirect_to gonzos_url, notice: 'Gonzo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @stilage.destroy\n respond_to do |format|\n format.html { redirect_to stilages_url, notice: 'Stilage was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @garrison.destroy\n respond_to do |format|\n format.html { redirect_to garrisons_path_for(@garrison) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @specific_gravity.destroy\n respond_to do |format|\n format.html { redirect_to @batch, notice: 'Specific gravity was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gear.destroy\n respond_to do |format|\n format.html { redirect_to gears_url, notice: 'Gear was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gear.destroy\n respond_to do |format|\n format.html { redirect_to gears_url, notice: 'Gear was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gopy = Gopy.find(params[:id])\n @gopy.destroy\n\n respond_to do |format|\n #format.html { redirect_to gopies_url }\n format.html { redirect_to hienthi_gopies_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grua.destroy\n respond_to do |format|\n format.html { redirect_to gruas_url, notice: 'Grua eliminada exitosamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @shot.destroy\n\n head :no_content\n end",
"def destroy\n @gastronomium.destroy\n respond_to do |format|\n format.html { redirect_to gastronomia_url, notice: 'Gastronomium was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gage = Gage.find(params[:id])\n @gage.destroy\n\n respond_to do |format|\n format.html { redirect_to gages_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gato.destroy\n respond_to do |format|\n format.html { redirect_to gatos_url, notice: 'Gato was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grcrd.destroy\n respond_to do |format|\n format.html { redirect_to grcrds_url, notice: 'Grcrd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gamer.destroy\n respond_to do |format|\n format.html { redirect_to gamers_url, notice: 'Gamer was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @grocery = Grocery.find(params[:id])\n @grocery.destroy\n\n head :no_content\n end",
"def destroy\n @g_file.destroy\n respond_to do |format|\n format.html { redirect_to g_files_url, notice: 'G file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @garbage = Garbage.find(params[:id])\n @garbage.destroy\n\n respond_to do |format|\n format.html { redirect_to garbages_url }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def destroy\n @grooming.destroy\n respond_to do |format|\n format.html { redirect_to :back, notice: 'Visit was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @house = House.find(params[:id])\n @house.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gameroom = Gameroom.find(params[:id])\n if @gameroom.destroy\n render json: @gameroom, status: :accepted\n else\n render json: {errors: @gameroom.errors.full_messages}, status: :unprocessable_entity\n end\n end",
"def destroy\n @gua.destroy\n respond_to do |format|\n format.html { redirect_to guas_url, notice: 'Gua 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 @galinha.destroy\n respond_to do |format|\n format.html { redirect_to galinhas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @retro = Retro.find(params[:id])\n @retro.destroy\n\n respond_to do |format|\n format.html { redirect_to retros_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @brave_burst.destroy\n respond_to do |format|\n format.html { redirect_to brave_bursts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @rooster = Rooster.find(params[:id])\n @rooster.destroy\n\n respond_to do |format|\n format.html { redirect_to roosters_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @riesgo.destroy\n respond_to do |format|\n format.html { redirect_to riesgos_url, notice: 'Riesgo was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gato.destroy\n respond_to do |format|\n format.html { redirect_to gatos_url, notice: 'Gato eliminado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @monster.destroy\n respond_to do |format|\n format.html { redirect_to monsters_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @goofball.destroy\n respond_to do |format|\n format.html { redirect_to goofballs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @ginasio = Ginasio.find(params[:id])\n @ginasio.destroy\n\n respond_to do |format|\n format.html { redirect_to ginasios_url, :flash => { :notice => 'Ginasio apagado.' } }\n format.json { head :ok }\n end\n end",
"def destroy\n @gear = Gear.find(params[:id])\n @gear.destroy\n\n respond_to do |format|\n format.html { redirect_to(gears_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @galaxy = Galaxy.find(params[:id])\n @galaxy.destroy\n\n respond_to do |format|\n format.html { redirect_to galaxies_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @shot.destroy\n respond_to do |format|\n format.html { redirect_to shots_url, notice: 'Shot was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @allergy.destroy\n respond_to do |format|\n format.html { redirect_to allergies_url, notice: t('allergies.destroy_success') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @great.destroy\n respond_to do |format|\n format.html { redirect_to greats_url, notice: 'Great was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @asteroid.destroy\n respond_to do |format|\n format.html { redirect_to asteroids_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @galaxy.destroy\n respond_to do |format|\n format.html { redirect_to galaxies_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @gin.destroy\n respond_to do |format|\n format.html { redirect_to gins_url, notice: 'Gin was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @redpack = Redpack.find(params[:id])\n @redpack.destroy\n\n respond_to do |format|\n format.html { redirect_to redpacks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cartridge.destroy\n respond_to do |format|\n format.html { redirect_to cartridges_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n gig = @gig_set.gig\n @gig_set.destroy\n gig.gig_sets.each_with_index do |set, ix|\n set.number = ix + 1\n set.save!\n end\n\n respond_to do |format|\n format.html { redirect_to edit_gig_path(gig) }\n format.json { head :no_content }\n end\n end",
"def delete!\n Recliner.delete(uri)\n end"
] |
[
"0.70874345",
"0.7072451",
"0.69721663",
"0.6918801",
"0.6892003",
"0.6892003",
"0.68843687",
"0.6880985",
"0.68417174",
"0.6837426",
"0.6835648",
"0.68214744",
"0.68024623",
"0.6779224",
"0.67733085",
"0.67506975",
"0.6744599",
"0.6730223",
"0.6730102",
"0.67246675",
"0.6708603",
"0.6685253",
"0.66721994",
"0.6616592",
"0.6616573",
"0.66145515",
"0.66072124",
"0.6602953",
"0.6595741",
"0.65928465",
"0.6587128",
"0.65870154",
"0.6582501",
"0.65822476",
"0.65767264",
"0.656723",
"0.6567054",
"0.65613115",
"0.6559752",
"0.65550494",
"0.6553445",
"0.65525645",
"0.6550539",
"0.65419066",
"0.65417695",
"0.6538697",
"0.6535129",
"0.65338534",
"0.65306586",
"0.65263504",
"0.6525946",
"0.6523344",
"0.6518101",
"0.65119165",
"0.6511517",
"0.65084237",
"0.6507461",
"0.6503411",
"0.6499428",
"0.6499428",
"0.6499397",
"0.6498411",
"0.649457",
"0.6493636",
"0.6490287",
"0.64870375",
"0.6486453",
"0.6485757",
"0.6484195",
"0.64794934",
"0.6473163",
"0.6471613",
"0.6470341",
"0.6468396",
"0.6468324",
"0.6466798",
"0.6465526",
"0.64653635",
"0.64641976",
"0.64634925",
"0.6461683",
"0.6460794",
"0.6459631",
"0.64551884",
"0.6453904",
"0.64519185",
"0.64499146",
"0.6449367",
"0.64483464",
"0.6446559",
"0.64425015",
"0.6440034",
"0.64328957",
"0.64325535",
"0.6431765",
"0.64289606",
"0.6428918",
"0.6427672",
"0.64217967",
"0.6421551"
] |
0.6836711
|
10
|
Use callbacks to share common setup or constraints between actions.
|
def set_gig_roster
@gig_roster = GigRoster.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 gig_roster_params
params.require(:gig_roster).permit(:gig_id, :roster_id, :uniform, :in_time, :out_time, :accepted)
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
|
TODO Make sure help blocks work correctly.
|
def to_html
bootstrap_wrapping do
hidden_field_for_all << # Might need to remove this guy.
collection.map { |choice|
choice_html(choice)
}.join("\n").html_safe
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def help\n \n end",
"def help; end",
"def help; end",
"def help; end",
"def help\r\n end",
"def help\r\n end",
"def help\n end",
"def help\n end",
"def help\n end",
"def help\n end",
"def help\n end",
"def help\n end",
"def help\n end",
"def help\n end",
"def help\n puts 'add help'\n end",
"def need_help \n end",
"def help\n\nend",
"def help\n\tusage\n\tputs \"This tool is oriented to separate web pages into segments called blocks, based on the structural and visual properties\"\nend",
"def help\n\t\tself.usage(false)\n\t\texit EX_OK\n\tend",
"def show_help\n display banner\n display \"\"\n display short_help\n display \"\"\n end",
"def get_help\n nil\n end",
"def help\n lines = []\n end",
"def show_help\n puts HELP_MESSAGE\n end",
"def show_help\n puts HELP_MESSAGE\n end",
"def help_help\t# :nodoc:\n\t\t\"#{@program_name} -cmd help\\n\\tShow this message\\n\"\n\tend",
"def get_help_info\n 'See the documentation here - https://github.com/blockfrost/blockfrost-ruby'\n end",
"def help_text\n build_html do\n p <<-P1\n Not much needed here.\n P1\n end\n end",
"def help; @form.help_manager.display_help; end",
"def help\n [['some command', 'description of some command'],\n ['some other command', 'description of some other command']]\n end",
"def help\n send_command \"--help\"\n end",
"def useHelp\r\n\t\t@usedHelp += 1\r\n\t\treturn self\r\n\tend",
"def help\n self.helplink.click\n end",
"def help(&block)\n help = block || lambda { puts self; exit 1 }\n on \"-h\", \"--help\", \"Show this message\", &help\n end",
"def extended_help\n\t\t\t{\n\t\t\t\t\"fun_fake_cmd\" => \"This is a fake command. It's got its own special docs.\" +\n\t\t\t\t\t (\" \" * longest_cmd_size) + \"It might be long so so deal with formatting somehow.\"\n\t\t\t}\n\t\tend",
"def command_help\n display_possible_actions\n end",
"def help\n [['help', \"this message\"]]\n end",
"def dump_help_if_requested\n return unless self[:help]\n dump_help\n exit\n end",
"def action\n puts \"\\nHelp menu\"\n puts '=' * 'Help menu'.length + \"\\n\\n\"\n puts \" Command \\t Description\"\n puts \" \" + '-' * 'Command'.length + \" \\t \" + '-' * 'Description'.length\n commands.map {|cmd , desc| puts \" #{cmd} \\t #{desc}\"}\n puts \"\\n\\n\"\n end",
"def help_text\n build_html do\n p <<P1\nThis page is a simple presentation of the paths that match the file\nthat was searched for an the fileset that the file was shipped in.\nP1\n end\n end",
"def how_to_help # :nologin:\n end",
"def help(some, arg)\n say \"Bootic CLI v#{BooticCli::VERSION}\\n\\n\", :bold\n super\n\n examples if respond_to?(:examples)\n end",
"def help\n prettify(description)\n end",
"def help_message\n make_response %(*Usage:*\n\n To get stats about all players:\n `foosey stats`\n\n To do anything else:\n http://foosey.futbol)\nend",
"def get_help\n @help\n end",
"def short_help\n execute_string(\"-help\")\n end",
"def setup_help(opts)\n opts.separator ''\n opts.separator <<-USAGE\nUsage:\n travis repositories|repos|rep|r {options}\n travis status|stat|s {options}\n USAGE\n opts.separator ''\n opts.separator <<-FURTHER_HELP\nFurhter Help:\n travis {command} --help\n FURTHER_HELP\n\n yield(opts)\n end",
"def help_info\n \"\"\n end",
"def help\n @t.say(\"The available commands are: BUY, SELL, RECENT, BALANCE\")\nend",
"def get_help\n [self.class::DESCRIPTION, self.class::USAGE]\n end",
"def help\n\t puts \"\"\n\t puts Rainbow(\":doc\").color(\"#D65200\")+\" Open documentation online\"\n\t puts Rainbow(\":open\").color(\"#D65200\")+\" Open file or folder\"\n\t puts Rainbow(\":new\").color(\"#D65200\")+\" Create file or directory\"\n\t puts Rainbow(\":destroy\").color(\"#D65200\")+\" Destroy Params file or current directory\"\n\t puts Rainbow(\":clean\").color(\"#D65200\")+\" Clean the trash\"\n\t puts Rainbow(\":calendar\").color(\"#D65200\")+\" Show current month\"\n\t puts Rainbow(\":today\").color(\"#D65200\")+\" Show date of day\"\n\t puts \"\"\n\t end",
"def long_help\n execute_string(\"-longhelp\")\n end",
"def help\n Helper.instance\n end",
"def help\n Helper.instance\n end",
"def help\n Helper.instance\n end",
"def help\n Helper.instance\n end",
"def do_help(commands)\n return commands.usage\n end",
"def help(m)\n m.reply \"See: !help learning\"\n end",
"def help\n @@help\n end",
"def help\n \n render :patial=>\"_help\"\n end",
"def help\n command_object.display_usage(cli.command)\n exit\n end",
"def help_message()\n\t\treturn 'If you say (for example) \"help dance\", I\\'ll tell you what the dance command does.'\n\tend",
"def help\n #render(text: \"Help method in StaticPages controller class\");\n end",
"def on_help(menu)\n end",
"def cmd_help argv\n help\n end",
"def cmd_help argv\n help\n end",
"def help()\n\tputs \"Hier is een lijst handige commando's die je gaan helpen met je quest:\"\n\tputs \"ga (richting): Ga in de gespecificeerde richting\"\n\tputs \"open: open deuren, kisten, je hart, etc\"\n\tputs \"kijk: Krijg een beschrijving van de kamer waar je nu bent\"\n\tputs \"neem: Neem een item en stop het in je inventory\"\n\tputs \"gebruik X op X: Gebruik een item uit je inventory op een object\"\n\tputs \"inventory: Bekijk je inventory\"\n\tputs \"stop: Stop de game\"\nend",
"def help\n puts 'Here is a list of available commands:\n new - Create a new contact\n list - List all contacts\n show - Show a contact\n search - Search contacts'\n end",
"def help\n help = <<HEREDOC \nreset - creates a new game\nrock - throws rock\npaper - throws paper\nscissors - throws scissors\nhelp - shows this screen\ngame - shows the results from this game\nuser - shows your results from all your games\nglobal - shows the global results from all users\nexit - quit the game\nHEREDOC\n end",
"def show_help\n\tputs \"These are the following commands that this application accepts:\"\n\tputs \"\\t 'add' (child name) (toy name) - gives a child a new toy\"\n\tputs \"\\t 'remove' (toy name) (child name) - takes away the child's toy\"\n\tputs \"\\t 'ls' - lists all children and the toys they are receiving\"\n\tputs \"\\t 'ls' (child name) - lists all the toys that one child is receiving\"\n\tputs \"\\t 'delivered' (child name) - marks that the toys have been delivered to the child\"\n\tputs \"\\t 'help' - shows all of the available commands that this application accepts\"\n\n\nend",
"def user_help\n puts \"\"\n puts \"-l and --list\"\n puts \"Write either 'moodbooster -l' or 'moodbooster --list' in the command line to view your week's moods\"\nend",
"def help\n \n \"Here is a list of available commands:\n new - Create a new contact\n list - List all contacts\n show - Show a contact\n find - Find a contact\"\n\nend",
"def help\n slop.help\n end",
"def help\n slop.help\n end",
"def help\r\n\tputs \"-to add new student: add student\"\r\n\tputs \"-to display all students: display students\"\r\n\tputs \"-to display all subjects: display subjects\"\r\n\tputs \"-to update a grade: update grade\"\r\n\tputs \"-to display grades of a student: check grade\"\r\n\tputs \"-to quit: done, exit\"\r\nend",
"def initialize \n self.help = false\n end",
"def help\n # url = Qt::Url.new(\"file:///#{Coll::HELP_FILE}\")\n # Qt::DesktopServices.openUrl(url)\n end",
"def command_help(m)\n m.user.send [\n \"!next - When's the next live show?\",\n \"!schedule - What shows are being recorded live in the next seven days?\",\n \"!suggest - Be heard. Suggest a title for the live show.\",\n \"!link - Know the link for that? Suggest it and make the show better.\",\n \"!current - What's playing on #{shared[:Live_Url]}? I've got you covered.\",\n \"!last_status - The last tweet by @#{shared[:Twitter_User].join(\", @\")} delievered to you in IRC. Sweet.\",\n \"!about - Was #{shared[:Bot_Nick]} coded or did it spontaniously come into existence?\",\n \"!help - Uh, this.\",\n ].join(\"\\n\")\n end",
"def help(m)\n m.reply \"See: !help karma\"\n end",
"def help(cmd)\n %{\n h[elp]\\t\\tprint this help\n h[elp] command\\tprint help on command\n }\n end",
"def help\n\t\tHandler.instance_methods(false)\n\tend",
"def help\n puts \"To add a task, type 'add task'.\"\n puts \"To update a task, type 'update'.\"\n puts \"To delete a task, type 'complete'.\"\n puts \"To view the To Do List, type 'view'.\"\n puts \"To quit, type 'done'.\"\nend",
"def help\n puts <<-HEREDOC\n I accept the following commands:\n - help : displays this help message\n - list : displays a list of songs you can play\n - play : lets you choose a song to play\n - exit : exits this program\n HEREDOC\nend",
"def print_help\n puts 'Here is a list of available commands:'\n puts '- new - Create a new contact'\n puts '- list - List all contacts'\n puts '- show - Show a contact'\n puts '- find - Find a contact'\n end",
"def show_help\n system 'clear'\n puts HELP_COMMANDS\n end",
"def help(m)\n p = self.class.prefix.call(m)\n m.reply(\"See: #{p}help karma\")\n end",
"def help\n Help.new\n end",
"def help\n Help.new\n end",
"def help(shell)\n shell.say \"Usage:\"\n shell.say \" #{banner}\\n\"\n shell.say\n class_options_help(shell)\n shell.say desc if desc\n end",
"def display_text_result_help result\n help_link(\"Help?\", result.help_id) \n end",
"def help #:nodoc:\n Writer.help( { :banner => @@banner, :header => @@header,\n :options => @@options, :footer => @@footer },\n output_to, exit_on_help? )\n end",
"def learning_help(m)\n m.reply \"Learning module\"\n m.reply \"===========\"\n m.reply \"Description: Teach the bot about things, and have it repeat that info back later.\"\n m.reply \"Usage: [botname] [thing] is [information] (to store additional [information] under the keyword [thing].)\"\n m.reply \"[botname] [thing] (to get whatever the bot knows about [thing].)\"\n end",
"def usage; end",
"def usage; end",
"def action_help\n log @help\n\n true\n end",
"def help\n puts @option_parser\n exit\n end",
"def help\n puts \"Usage: #{@name} #{@generator_name} [options] [args]\"\n puts ''\n puts @generator_class.desc\n puts ''\n puts @options[:opts]\n puts ''\n exit\n end",
"def print_help\n File.read(__FILE__).lines[1..-1].each do |line|\n if line =~ /\\A#/\n puts line[2..-1]\n else\n break\n end\n end\nend",
"def print_help\n File.read(__FILE__).lines[1..-1].each do |line|\n if line =~ /\\A#/\n puts line[2..-1]\n else\n break\n end\n end\nend",
"def help(s=nil)\n puts send_cmd \"help #{s}\\n\\n\"\n end",
"def cmd_cli_help argv\n setup argv\n msg run_cmd(\"help\")\n end",
"def help\n\t\tputs \"Commands: pick up (weapons/items) , move to, drop, examine myself, describe me, look at me, inventory, look\"\n\t\tputs \"Commands: grab (food items), examine food (details about your food), eat (food), drink (beverages)\" \n\tend"
] |
[
"0.8030844",
"0.80230457",
"0.80230457",
"0.80230457",
"0.80125",
"0.80125",
"0.800298",
"0.79321665",
"0.79321665",
"0.79321665",
"0.79321665",
"0.79321665",
"0.79321665",
"0.79321665",
"0.77064776",
"0.76954746",
"0.7622786",
"0.7534276",
"0.74402016",
"0.74223685",
"0.7376034",
"0.7247318",
"0.72357243",
"0.72357243",
"0.7222915",
"0.7141216",
"0.7103092",
"0.7075054",
"0.7043765",
"0.7020838",
"0.7004336",
"0.6987357",
"0.6948718",
"0.694787",
"0.6943143",
"0.6940657",
"0.6939304",
"0.6933394",
"0.6930302",
"0.6928711",
"0.6923415",
"0.69204843",
"0.6907436",
"0.6903178",
"0.6883551",
"0.6883333",
"0.6880371",
"0.68673486",
"0.6863105",
"0.68527544",
"0.6850578",
"0.68425083",
"0.68425083",
"0.68425083",
"0.68425083",
"0.6826014",
"0.6820844",
"0.681726",
"0.6814093",
"0.68135065",
"0.6809182",
"0.68091744",
"0.6805976",
"0.6803286",
"0.6803286",
"0.67970175",
"0.6793858",
"0.6789507",
"0.67846656",
"0.6778489",
"0.67595387",
"0.67516875",
"0.6751117",
"0.6746841",
"0.6732517",
"0.67304474",
"0.67266756",
"0.6724438",
"0.67225796",
"0.67130876",
"0.6704065",
"0.67029804",
"0.66934854",
"0.66921103",
"0.6677841",
"0.66737574",
"0.66737574",
"0.6666788",
"0.6661359",
"0.6655132",
"0.6641252",
"0.66405404",
"0.66405404",
"0.6634616",
"0.66214216",
"0.6616545",
"0.66052616",
"0.66052616",
"0.6577166",
"0.65742576",
"0.6572502"
] |
0.0
|
-1
|
Pure Ruby instance methods
|
def show_decimal_budget()
return Money.convert_to_decimal_string(@budget)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def instance_method(p0) end",
"def instance; end",
"def instance; end",
"def instance; end",
"def methods() end",
"def instance_methods; end",
"def class() end",
"def method_of_instance; end",
"def method_of_instance; end",
"def method_of_instance; end",
"def method_of_instance; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def methods; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def method; end",
"def public_method; end",
"def instance_variables() end",
"def internal; end",
"def wrapper; end",
"def singleton_methods; end",
"def implementation; end",
"def implementation; end",
"def internal_methods; end",
"def methods=(_arg0); end",
"def an_instance_method\n puts \"I am an instance method\"\n end",
"def private; end",
"def instance_variables; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call; end",
"def call(object); end",
"def instance_methods(include_super=true) end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize(*) end",
"def initialize(*) end",
"def public_instance_methods(include_super=true) end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def object; end",
"def reflection; end",
"def reflection; end",
"def instance_helper\n\tend",
"def instances; end",
"def instances; end",
"def __getobj__; end",
"def magic\n self.class.magic(self)\n end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def member; end",
"def invoke; end",
"def run; new.run; end",
"def public; end",
"def public; end",
"def instance_eval\n end",
"def public_class_method(*rest) end",
"def __getobj__\n end",
"def overload; end",
"def initialize(*) \n end",
"def class; end",
"def class; end",
"def call(*) end",
"def call(*) end",
"def class=(_arg0); end",
"def singleton_methods(all=true) end",
"def call\n # implement in subclasses\n end",
"def myAnotherInstance = new ObjectOrientedProgramming()",
"def method=(_); end",
"def method_missing(code, *args, &blk); end"
] |
[
"0.69663507",
"0.688563",
"0.688563",
"0.688563",
"0.68223846",
"0.6749521",
"0.66748625",
"0.66111577",
"0.66111577",
"0.66111577",
"0.66111577",
"0.6534621",
"0.6534621",
"0.6534621",
"0.6534621",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.6515938",
"0.64185524",
"0.63978165",
"0.6291285",
"0.6252106",
"0.62471646",
"0.62462735",
"0.62462735",
"0.62459576",
"0.6245046",
"0.62031907",
"0.6186084",
"0.61010146",
"0.6063344",
"0.6063344",
"0.6063344",
"0.6063344",
"0.6063344",
"0.6063344",
"0.6063344",
"0.6063344",
"0.6028494",
"0.6020121",
"0.60154635",
"0.60154635",
"0.60154635",
"0.60154635",
"0.60154635",
"0.6004871",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6003793",
"0.6001698",
"0.6001698",
"0.59791726",
"0.5967654",
"0.5967654",
"0.5961545",
"0.59546596",
"0.5948561",
"0.5948561",
"0.5948561",
"0.5948561",
"0.5948561",
"0.5938241",
"0.589565",
"0.58940756",
"0.58940756",
"0.58846676",
"0.5882378",
"0.5879852",
"0.5849597",
"0.5830413",
"0.5830383",
"0.5830383",
"0.58055204",
"0.58055204",
"0.57713014",
"0.5771269",
"0.57615554",
"0.57613564",
"0.574073",
"0.5728022"
] |
0.0
|
-1
|
GET /operating_hours GET /operating_hours.json
|
def index
@operating_hours = OperatingHour.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hours\n render json: Pings::Selector.new.hours(params)\n end",
"def hours\n response[\"hours\"]\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @office_hours }\n end\n end",
"def venue_hours venue_id\n response = get(\"/venues/#{venue_id}/hours\")[\"response\"][\"hours\"]\n end",
"def show\n @officehour = Officehour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @officehour }\n end\n end",
"def hours\n \n end",
"def index\n @hours = Hour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hours }\n end\n end",
"def show\n @operation_hour = OperationHour.find(params[:id])\n end",
"def index\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def get_hourly(response)\n response['hourly']\n end",
"def index\n @open_hours = OpenHour.all\n end",
"def opening_hours\n hours = @data[:godziny_pracy]\n keys = {weekdays: :dni_robocze, saturdays: :soboty, sundays: :niedz_i_sw}\n Hash[\n keys.map do |h, x|\n value = unless hours[x].nil?\n [hours[x][:godziny].to_s, hours[x][:uwagi].to_s]\n end\n\n [h, value]\n end\n ]\n end",
"def index\r\n @officehours = Officehour.all\r\n end",
"def set_operating_hour\n @operating_hour = OperatingHour.find(params[:id])\n end",
"def venue_hours(id)\n get(\"venues/#{id}/hours\").hours\n end",
"def index\n @office_hour_details = OfficeHourDetail.all\n end",
"def index\n @working_hours = WorkingHour.all\n end",
"def hourly(query)\n get_json(\"#{api_url}/hourly/q/#{parse_query(query)}.#{@options[:format]}\")\n end",
"def hours\n\n today = Date.today\n hours = {}\n #if @traveler.is_visitor? or @traveler.is_api_guest? #Return a wide range of hours\n if not @traveler or not @traveler.registered?\n (0..30).each do |n|\n hours[(today + n).to_s] = {open: \"07:00\", close: \"22:00\"}\n end\n\n else # This is not a guest, check to see if the traveler is registered with a service\n\n # NOTE(wilsonj806) For now this implementation does not let registered users\n #...book trips on weekends. Eventually we want to change that so they can do so\n\n if @traveler.booking_profiles.count > 0 #This user is registered with a service\n booking_profile = @traveler.booking_profiles.first\n service = booking_profile.service\n\n min_notice_days = (service.booking_details[:min_days] || 2).to_i\n max_notice_days = (service.booking_details[:max_days] || 14).to_i\n\n \n if service.booking_details[:trusted_users] and booking_profile.external_user_id.in? service.booking_details.try(:[], :trusted_users).split(',').map{ |x| x.strip }\n (1..21).each do |n|\n hours[(today + n).to_s] = {open: \"00:00\", close: \"23:59\"}\n end\n elsif service.schedules.count > 0 #This user's service has listed hours. This is the most common case.\n \n #Find out if we are past the cutoff for today. If so, start counting from tomorrow\n if service.booking_details[:cutoff_time] and (Time.now.in_time_zone.seconds_since_midnight > service.booking_details[:cutoff_time].to_i)\n day = Time.now + 1.days \n else\n day = Time.now\n end\n \n biz_days_count = 0\n (0..max_notice_days).each do |n|\n if service.open_on_day? day\n if biz_days_count >= min_notice_days\n schedule = service.schedules.where(day: day.wday).first\n if schedule\n hours[day.strftime('%Y-%m-%d')] = {open: schedule.schedule_time_to_military_string(schedule.start_time), \n close: schedule.schedule_time_to_military_string(schedule.end_time)}\n end\n end\n biz_days_count += 1\n end\n day = day + 1.days \n end\n\n else #This user is registered with a service, but that service has not entered any hours\n\n (min_notice_days..max_notice_days).each do |n|\n unless (today + n).saturday? or (today + n).sunday?\n hours[(today + n).to_s] = {open: \"08:00\", close: \"17:00\"}\n end\n end\n\n end\n\n else #This user is logged in but isn't registered with a service\n\n (1..14).each do |n|\n unless (today + n).saturday? or (today + n).sunday?\n hours[(today + n).to_s] = {open: \"08:00\", close: \"17:00\"}\n end\n end\n\n end # if #traveler.user_profile.user_services.count > 0\n end # if @travler.is_visitor\n\n render status: 200, json: hours\n\n end",
"def show\n @hour = Hour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hour }\n end\n end",
"def create\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @operation_hour = OperationHour.create(params[:operation_hour])\n end",
"def hours\n _nudge[0]\n end",
"def index\n @timecard = Timecard.find(params[:timecard_id])\n render :json => Hour.timecard_hours(@timecard)\n end",
"def create\n @operating_hour = OperatingHour.new(operating_hour_params)\n\n respond_to do |format|\n if @operating_hour.save\n format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully created.' }\n format.json { render :show, status: :created, location: @operating_hour }\n else\n format.html { render :new }\n format.json { render json: @operating_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def get_hours()\n\n return self.hours\n\nend",
"def index\n @day_hours = DayHour.all\n end",
"def index\n @happy_hours = HappyHour.all\n end",
"def operating_hour_params\n params.require(:operating_hour).permit(:monday_from, :monday_to, :tuesday_from, :tuesday_to, :wednesday_from, :wednesday_to, :thursday_from, :thursday_to, :friday_from, :friday_to, :sat_from, :sat_to, :sunday_from, :sunday_to, :warehouse_id)\n end",
"def index\n @worked_hours = @worked_hours.not_extra\n\n respond_with(@worked_hours)\n end",
"def index\n @transport_hours = TransportHour.all\n end",
"def twenty_four_hour(options)\n request :public, :get, :twenty_four_hour, options\n end",
"def index\n @estimated_hours = Estimated_hour.all\n end",
"def weekly_hours\n worked_hours\n end",
"def index\n @location_hours = current_merchant.location_hours\n end",
"def update\n respond_to do |format|\n if @operating_hour.update(operating_hour_params)\n format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @operating_hour }\n else\n format.html { render :edit }\n format.json { render json: @operating_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_hours_by_aircraft\n result = @current_user.flights.group(:aircraft).sum(:flight_time)\n render json: [{name: 'Flight Hours', data: result}]\n end",
"def new\n @officehour = Officehour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @officehour }\n end\n end",
"def office_hour_detail_params\n params.require(:office_hour_detail).permit(:office_hour_id, :agent_id, :turno_hora, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :domingo, :total_hours, :rest_hours)\n end",
"def index\n @add_hours = AddHour.all\n end",
"def hours(num)\n t = current_time + num * SECONDS_IN_HOUR\n {\n type: :datetime,\n value: t.iso8601\n }\n end",
"def destroy\n @operating_hour.destroy\n respond_to do |format|\n format.html { redirect_to operating_hours_url, notice: 'Operating hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @vhours = Vhour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vhours }\n end\n end",
"def opening_hour\n 11\n end",
"def create\n @officehour = Officehour.new(params[:officehour])\n\n respond_to do |format|\n if @officehour.save\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully created.' }\n\tformat.json { render json: @officehour, status: :created, location: @officehour }\n else\n\tformat.html { render action: \"new\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @employee_workinghours = EmployeeWorkinghour.all\n end",
"def index\n @clock = @employee.clock_in_out\n render json: @clock\n end",
"def index\n @hour_logs = HourLog.all\n render json: @hour_logs, status: 200\n end",
"def working_hours=(value)\n @working_hours = value\n end",
"def hour()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Hour::HourRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def index\n @delivery_hours = DeliveryHour.all\n end",
"def index\n @learning_hours = LearningHour.where(user_id: current_user.id)\n end",
"def index\n @forecast_hours = ForecastHour.all\n end",
"def hours(user_id)\n return self.user_events.find_by(user_id: user_id).hours || 0\n end",
"def index\n # Get all work days in the actual month\n currentTime = Time.now\n @user = current_user\n @work_days = @user.work_days.order(\"date\").where(date: currentTime.at_beginning_of_month..currentTime.at_end_of_month)\n \n # Gets sum of all the work hours\n @work_days_total_hours = @work_days.inject(0.0){|sum, item| sum+item.work_hours} || 0\n @work_days_extra_hours = @work_days_total_hours - (@work_days.count * @user.daily_hours)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_days }\n end\n end",
"def create\n if(params[:oper] && params[:oper] != '')\n timecard = Timecard.find(params[:timecard_id])\n # the hour the we should use\n if(params[:oper] == 'edit')\n hour = timecard.hours.find(params[:id])\n # save a historical\n old_information = \"Description:#{hour.description}-----Initial Time:#{hour.initial_time}-----End Time:#{hour.end_time}\" if(hour)\n else\n hour = Hour.new\n end\n if(hour)\n hour.description = params[:description]\n hour.date = params[:date]\n hour.intime = params[:initial_time]\n hour.entime = params[:end_time]\n hour.timecard = timecard\n if(hour.save)\n if(old_information)\n new_value = \"Description:#{hour.description}-----Initial Time:#{hour.initial_time}-----End Time:#{hour.end_time}\" \n HistoricalHour.create(:old_value=>old_information, :new_value=>new_value, :hour_id=>hour.id, :user=>current_member)\n end\n render :json=>\"{\\\"success\\\":true,\\\"message\\\":\\\"Great! you just added an hour in your timesheet.\\\"}\"\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"#{first_error(hour)}\\\"}\"\n end\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"Oops, you tried to do an invalid operation.\\\"}\"\n end\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"Oops, you tried to do an invalid operation.\\\"}\"\n end\n end",
"def hour\n @hour\n end",
"def show\n @open_hours = Hash.new\n @place.open_times.each do |schedule|\n @open_hours[schedule.day] = \"#{schedule.open_time.strftime('%l:%M %P')} - #{schedule.close_time.strftime('%l:%M %P')}\"\n end\n end",
"def extra\n @worked_hours = @worked_hours.extra\n\n respond_with(@worked_hours)\n end",
"def set_office_hour_detail\n @office_hour_detail = OfficeHourDetail.find(params[:id])\n end",
"def index\n @pharmacy = Pharmacy.find(params[:pharmacy_id])\n @business_hours = @pharmacy.business_hours\n end",
"def update\n @operation_hour = OperationHour.find(params[:id])\n @operation_hour.update_attributes(params[:operation_hour])\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def hours( calculator )\n a = []\n a << terse_hours( calculator.total ) if ( @report.include_totals )\n a << terse_hours( calculator.committed ) if ( @report.include_committed )\n a << terse_hours( calculator.not_committed ) if ( @report.include_not_committed )\n return a\n end",
"def index\n @booked_hours = BookedHour.all\n end",
"def formatted_hours\n as_hours hours\n end",
"def formatted_hours\n as_hours hours\n end",
"def get_price(hours)\n if hours < 24\n price = (self.class.price_hr*hours)+self.class.price_base\n else\n days = hours/24\n price = (self.class.price_day*days)+self.class.price_base\n end\n\n return price\n end",
"def hours\n self.to_i * 3_600\n end",
"def hours\n value_parts[0]\n end",
"def hours\n value_parts[0]\n end",
"def show\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_hour_requirement }\n end\n end",
"def hour\n self.range('hour')\n end",
"def index\n @station_hours = StationHour.all\n end",
"def grouped_office_hours\n merged_hours.map { |hash_list|\n days = if hash_list.length == 1\n hash_list.first[:day]\n elsif hash_list.length > 1\n \"#{hash_list.first[:day]} - #{hash_list.last[:day]}\"\n end\n {:hours => hash_list.first[:hours],\n :day => days }\n }.delete_if {|hash| hash[:hours].blank? }\n end",
"def index\n @log_hours = LogHour.all\n end",
"def delete\n @operation_hour = OperationHour.find(params[:operation_hour_id])\n end",
"def hours?\n @name == :hourly\n end",
"def set_officehour\r\n @officehour = Officehour.find(params[:id])\r\n end",
"def set_open_hour\n @open_hour = OpenHour.find(params[:id])\n end",
"def set_open_hour\n @open_hour = OpenHour.find(params[:id])\n end",
"def destroy\n @officehour = Officehour.find(params[:id])\n @officehour.destroy\n\n respond_to do |format|\n format.html { redirect_to officehours_url }\n format.json { head :no_content }\n end\n end",
"def officehour_params\r\n params.require(:officehour).permit(:course_id, :ta_id, :start, :end, :online)\r\n end",
"def hour() end",
"def full_load_hours\n @producer.node_api.full_load_hours\n end",
"def day\n @client = Client.new\n @title = @current_user.name\n @view = 'day'\n # TODO is Date.parse in current time zone? If not add.\n @date = params[:date].nil? ? Date.current : Date.parse(params[:date])\n # TODO: brakeman is warning of security problem with this line\n @nav_title = @date.strftime(NAV_TITLE[@view.to_sym])\n # TODO: should employees stay or go?\n @employees = [1]\n\n @appointments_by_hour = Hash.new\n r = Appointment.where(time: @date.in_time_zone.beginning_of_day..@date.in_time_zone.end_of_day).order(:time).includes(:client)\n r.each do |appointment| #.order(:time).group_by(&:time)\n k = appointment.time.hour\n if @appointments_by_hour.has_key?(k)\n @appointments_by_hour[k].push(appointment)\n else\n @appointments_by_hour[k] = [appointment]\n end\n end\n\n render 'index'\n end",
"def hours\n self * SECONDS_IN_HOUR\n end",
"def weather_hourly(city, state)\n request = \"http://api.wunderground.com/api/747e267558954ba9/hourly/q/#{state}/#{city}.json\"\n hourly = HTTParty.get(request)\n hourly[\"hourly_forecast\"].each do |hour| \n puts \"#{hour[\"FCTTIME\"][\"civil\"]}: #{hour[\"temp\"][\"english\"]}F\"\n end\nend",
"def happy_hours\n @entries = HappyHour.includes(:combo_package, :outlet).where(\"location_id=? #{@outlet_query}\", params[:location_id].to_i).paginate(:page => params[:page]) if request.xhr? \n end",
"def update\n @officehour = Officehour.find(params[:id])\n\n respond_to do |format|\n if @officehour.update_attributes(params[:officehour])\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully updated.' }\n\tformat.json { head :no_content }\n else\n\tformat.html { render action: \"edit\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @hour = Hour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hour }\n end\n end",
"def new\n @hour = Hour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hour }\n end\n end",
"def hours\n fail \"A value is required for #{__method__}\" unless @value\n return \"0/#{@value}:0:0\"\n end",
"def remaining_hours\n \n end",
"def hour_of_day(hours, *extras)\n merge(hour: hours.array_concat(extras))\n end",
"def hours; self * HOUR; end",
"def hours; self * HOUR; end",
"def hour_of_day(*hours)\n merge(hour: hours)\n end",
"def working_hours\n return @working_hours\n end",
"def hours\n @hours ||= []\n return @hours if !@hours.empty?\n src['hours'].each{|h| @hours << Stormglass::Hour.new(h) }\n @hours\n end",
"def index\n\t\tselect_service\n\t\t@proposal_hour_extras = ProposalHourExtra.all\n\tend",
"def opening_hour\n 11 # 11am\n end"
] |
[
"0.77675194",
"0.6915026",
"0.6870751",
"0.6722812",
"0.6709238",
"0.66452754",
"0.6640017",
"0.663736",
"0.6567424",
"0.6560896",
"0.65436554",
"0.64627033",
"0.64618456",
"0.6422234",
"0.63852084",
"0.6296425",
"0.6276442",
"0.62562305",
"0.6254565",
"0.6218148",
"0.62036157",
"0.61494064",
"0.6131586",
"0.610197",
"0.6054985",
"0.60373414",
"0.6036822",
"0.60302126",
"0.60290295",
"0.6025461",
"0.59811336",
"0.597329",
"0.5971267",
"0.59652233",
"0.59370416",
"0.591538",
"0.5911535",
"0.590068",
"0.58951217",
"0.5868523",
"0.5851998",
"0.58426917",
"0.58356166",
"0.58221066",
"0.58144534",
"0.57980496",
"0.57864195",
"0.5784219",
"0.57510716",
"0.5748089",
"0.5737483",
"0.5700647",
"0.56955945",
"0.56899875",
"0.5685303",
"0.5670823",
"0.5667082",
"0.5663528",
"0.5653722",
"0.56471",
"0.56469375",
"0.5640673",
"0.564059",
"0.563108",
"0.563108",
"0.56224394",
"0.5622129",
"0.56153613",
"0.56153613",
"0.56147224",
"0.5608679",
"0.56073695",
"0.5601767",
"0.5590454",
"0.5584744",
"0.55838656",
"0.5580753",
"0.55788356",
"0.55788356",
"0.5570065",
"0.5562671",
"0.55617476",
"0.55477273",
"0.5536962",
"0.5534861",
"0.5530884",
"0.55267286",
"0.5516155",
"0.55156356",
"0.55156356",
"0.5514945",
"0.55125093",
"0.55123276",
"0.55104524",
"0.5509219",
"0.5499731",
"0.5499258",
"0.549555",
"0.5494911",
"0.54915494"
] |
0.73309386
|
1
|
GET /operating_hours/1 GET /operating_hours/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hours\n render json: Pings::Selector.new.hours(params)\n end",
"def index\n @operating_hours = OperatingHour.all\n end",
"def show\n @officehour = Officehour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @officehour }\n end\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @office_hours }\n end\n end",
"def show\n @operation_hour = OperationHour.find(params[:id])\n end",
"def index\n @hours = Hour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @hours }\n end\n end",
"def show\n @hour = Hour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hour }\n end\n end",
"def get_hourly(response)\n response['hourly']\n end",
"def set_operating_hour\n @operating_hour = OperatingHour.find(params[:id])\n end",
"def index\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def index\n @open_hours = OpenHour.all\n end",
"def venue_hours venue_id\n response = get(\"/venues/#{venue_id}/hours\")[\"response\"][\"hours\"]\n end",
"def hours\n response[\"hours\"]\n end",
"def hours\n \n end",
"def index\r\n @officehours = Officehour.all\r\n end",
"def create\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @operation_hour = OperationHour.create(params[:operation_hour])\n end",
"def hourly(query)\n get_json(\"#{api_url}/hourly/q/#{parse_query(query)}.#{@options[:format]}\")\n end",
"def index\n @office_hour_details = OfficeHourDetail.all\n end",
"def index\n @working_hours = WorkingHour.all\n end",
"def index\n @timecard = Timecard.find(params[:timecard_id])\n render :json => Hour.timecard_hours(@timecard)\n end",
"def new\n @officehour = Officehour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @officehour }\n end\n end",
"def create\n @operating_hour = OperatingHour.new(operating_hour_params)\n\n respond_to do |format|\n if @operating_hour.save\n format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully created.' }\n format.json { render :show, status: :created, location: @operating_hour }\n else\n format.html { render :new }\n format.json { render json: @operating_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @vhours = Vhour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vhours }\n end\n end",
"def show\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_hour_requirement }\n end\n end",
"def venue_hours(id)\n get(\"venues/#{id}/hours\").hours\n end",
"def index\n @happy_hours = HappyHour.all\n end",
"def index\n @worked_hours = @worked_hours.not_extra\n\n respond_with(@worked_hours)\n end",
"def index\n @clock = @employee.clock_in_out\n render json: @clock\n end",
"def update\n respond_to do |format|\n if @operating_hour.update(operating_hour_params)\n format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @operating_hour }\n else\n format.html { render :edit }\n format.json { render json: @operating_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @hour_logs = HourLog.all\n render json: @hour_logs, status: 200\n end",
"def opening_hours\n hours = @data[:godziny_pracy]\n keys = {weekdays: :dni_robocze, saturdays: :soboty, sundays: :niedz_i_sw}\n Hash[\n keys.map do |h, x|\n value = unless hours[x].nil?\n [hours[x][:godziny].to_s, hours[x][:uwagi].to_s]\n end\n\n [h, value]\n end\n ]\n end",
"def new\n @hour = Hour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hour }\n end\n end",
"def new\n @hour = Hour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hour }\n end\n end",
"def hours\n _nudge[0]\n end",
"def index\n @transport_hours = TransportHour.all\n end",
"def index\n @day_hours = DayHour.all\n end",
"def twenty_four_hour(options)\n request :public, :get, :twenty_four_hour, options\n end",
"def index\n @estimated_hours = Estimated_hour.all\n end",
"def show\n @last_hour = LastHour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @last_hour }\n end\n end",
"def show\n @vhour = Vhour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vhour }\n end\n end",
"def hours\n\n today = Date.today\n hours = {}\n #if @traveler.is_visitor? or @traveler.is_api_guest? #Return a wide range of hours\n if not @traveler or not @traveler.registered?\n (0..30).each do |n|\n hours[(today + n).to_s] = {open: \"07:00\", close: \"22:00\"}\n end\n\n else # This is not a guest, check to see if the traveler is registered with a service\n\n # NOTE(wilsonj806) For now this implementation does not let registered users\n #...book trips on weekends. Eventually we want to change that so they can do so\n\n if @traveler.booking_profiles.count > 0 #This user is registered with a service\n booking_profile = @traveler.booking_profiles.first\n service = booking_profile.service\n\n min_notice_days = (service.booking_details[:min_days] || 2).to_i\n max_notice_days = (service.booking_details[:max_days] || 14).to_i\n\n \n if service.booking_details[:trusted_users] and booking_profile.external_user_id.in? service.booking_details.try(:[], :trusted_users).split(',').map{ |x| x.strip }\n (1..21).each do |n|\n hours[(today + n).to_s] = {open: \"00:00\", close: \"23:59\"}\n end\n elsif service.schedules.count > 0 #This user's service has listed hours. This is the most common case.\n \n #Find out if we are past the cutoff for today. If so, start counting from tomorrow\n if service.booking_details[:cutoff_time] and (Time.now.in_time_zone.seconds_since_midnight > service.booking_details[:cutoff_time].to_i)\n day = Time.now + 1.days \n else\n day = Time.now\n end\n \n biz_days_count = 0\n (0..max_notice_days).each do |n|\n if service.open_on_day? day\n if biz_days_count >= min_notice_days\n schedule = service.schedules.where(day: day.wday).first\n if schedule\n hours[day.strftime('%Y-%m-%d')] = {open: schedule.schedule_time_to_military_string(schedule.start_time), \n close: schedule.schedule_time_to_military_string(schedule.end_time)}\n end\n end\n biz_days_count += 1\n end\n day = day + 1.days \n end\n\n else #This user is registered with a service, but that service has not entered any hours\n\n (min_notice_days..max_notice_days).each do |n|\n unless (today + n).saturday? or (today + n).sunday?\n hours[(today + n).to_s] = {open: \"08:00\", close: \"17:00\"}\n end\n end\n\n end\n\n else #This user is logged in but isn't registered with a service\n\n (1..14).each do |n|\n unless (today + n).saturday? or (today + n).sunday?\n hours[(today + n).to_s] = {open: \"08:00\", close: \"17:00\"}\n end\n end\n\n end # if #traveler.user_profile.user_services.count > 0\n end # if @travler.is_visitor\n\n render status: 200, json: hours\n\n end",
"def destroy\n @operating_hour.destroy\n respond_to do |format|\n format.html { redirect_to operating_hours_url, notice: 'Operating hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def index\n @add_hours = AddHour.all\n end",
"def set_office_hour_detail\n @office_hour_detail = OfficeHourDetail.find(params[:id])\n end",
"def create\n @officehour = Officehour.new(params[:officehour])\n\n respond_to do |format|\n if @officehour.save\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully created.' }\n\tformat.json { render json: @officehour, status: :created, location: @officehour }\n else\n\tformat.html { render action: \"new\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @location_hours = current_merchant.location_hours\n end",
"def show\n @working_time = WorkingTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @working_time }\n end\n end",
"def create\n if(params[:oper] && params[:oper] != '')\n timecard = Timecard.find(params[:timecard_id])\n # the hour the we should use\n if(params[:oper] == 'edit')\n hour = timecard.hours.find(params[:id])\n # save a historical\n old_information = \"Description:#{hour.description}-----Initial Time:#{hour.initial_time}-----End Time:#{hour.end_time}\" if(hour)\n else\n hour = Hour.new\n end\n if(hour)\n hour.description = params[:description]\n hour.date = params[:date]\n hour.intime = params[:initial_time]\n hour.entime = params[:end_time]\n hour.timecard = timecard\n if(hour.save)\n if(old_information)\n new_value = \"Description:#{hour.description}-----Initial Time:#{hour.initial_time}-----End Time:#{hour.end_time}\" \n HistoricalHour.create(:old_value=>old_information, :new_value=>new_value, :hour_id=>hour.id, :user=>current_member)\n end\n render :json=>\"{\\\"success\\\":true,\\\"message\\\":\\\"Great! you just added an hour in your timesheet.\\\"}\"\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"#{first_error(hour)}\\\"}\"\n end\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"Oops, you tried to do an invalid operation.\\\"}\"\n end\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"Oops, you tried to do an invalid operation.\\\"}\"\n end\n end",
"def hour()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Hour::HourRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"def show\n @service_time = ServiceTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_time }\n end\n end",
"def index\n @employee_workinghours = EmployeeWorkinghour.all\n end",
"def opening_hour\n 11\n end",
"def set_open_hour\n @open_hour = OpenHour.find(params[:id])\n end",
"def set_open_hour\n @open_hour = OpenHour.find(params[:id])\n end",
"def get_hours()\n\n return self.hours\n\nend",
"def new\n @atom.hours = 24\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @atom }\n end\n end",
"def show\n @hour = Hour.find(params[:id])\n if @hour.event_id != session[:current_event_id].to_i\n flash[:error] = t(:not_correspond)\n redirect_to hours_path and return\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hour }\n end\n end",
"def set_officehour\r\n @officehour = Officehour.find(params[:id])\r\n end",
"def update\n @operation_hour = OperationHour.find(params[:id])\n @operation_hour.update_attributes(params[:operation_hour])\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def index\n @pharmacy = Pharmacy.find(params[:pharmacy_id])\n @business_hours = @pharmacy.business_hours\n end",
"def index\n @forecast_hours = ForecastHour.all\n end",
"def show\n @time_off_request = TimeOffRequest.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @time_off_request }\n end\n end",
"def delete\n @operation_hour = OperationHour.find(params[:operation_hour_id])\n end",
"def set_opening_hour\n if params[:id].present?\n @opening_hour = OpeningHour.find(params[:id])\n end\n end",
"def show\n @hurdle_time = HurdleTime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hurdle_time }\n end\n end",
"def destroy\n @officehour = Officehour.find(params[:id])\n @officehour.destroy\n\n respond_to do |format|\n format.html { redirect_to officehours_url }\n format.json { head :no_content }\n end\n end",
"def index\n @learning_hours = LearningHour.where(user_id: current_user.id)\n end",
"def office_hour_detail_params\n params.require(:office_hour_detail).permit(:office_hour_id, :agent_id, :turno_hora, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :domingo, :total_hours, :rest_hours)\n end",
"def show\n @time_section = TimeSection.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @time_section }\n end\n end",
"def index\n @delivery_hours = DeliveryHour.all\n end",
"def show\n @daytime = Daytime.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daytime }\n end\n end",
"def operating_hour_params\n params.require(:operating_hour).permit(:monday_from, :monday_to, :tuesday_from, :tuesday_to, :wednesday_from, :wednesday_to, :thursday_from, :thursday_to, :friday_from, :friday_to, :sat_from, :sat_to, :sunday_from, :sunday_to, :warehouse_id)\n end",
"def show\n @dayoff = Dayoff.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dayoff }\n end\n end",
"def show\n if current_user.is_not_member?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @repair_hours_entry = RepairHoursEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @repair_hours_entry }\n end\n end",
"def create\n @hour = Hour.new(params[:hour])\n\n respond_to do |format|\n if @hour.save\n format.html { redirect_to @hour, notice: 'Hour was successfully created.' }\n format.json { render json: @hour, status: :created, location: @hour }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n # Get all work days in the actual month\n currentTime = Time.now\n @user = current_user\n @work_days = @user.work_days.order(\"date\").where(date: currentTime.at_beginning_of_month..currentTime.at_end_of_month)\n \n # Gets sum of all the work hours\n @work_days_total_hours = @work_days.inject(0.0){|sum, item| sum+item.work_hours} || 0\n @work_days_extra_hours = @work_days_total_hours - (@work_days.count * @user.daily_hours)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_days }\n end\n end",
"def index\n @log_hours = LogHour.all\n end",
"def extra\n @worked_hours = @worked_hours.extra\n\n respond_with(@worked_hours)\n end",
"def hours(num)\n t = current_time + num * SECONDS_IN_HOUR\n {\n type: :datetime,\n value: t.iso8601\n }\n end",
"def index\n @station_hours = StationHour.all\n end",
"def update\n @officehour = Officehour.find(params[:id])\n\n respond_to do |format|\n if @officehour.update_attributes(params[:officehour])\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully updated.' }\n\tformat.json { head :no_content }\n else\n\tformat.html { render action: \"edit\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show\n @daily_horoscope = DailyHoroscope.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_horoscope }\n end\n end",
"def weather_hourly(city, state)\n request = \"http://api.wunderground.com/api/747e267558954ba9/hourly/q/#{state}/#{city}.json\"\n hourly = HTTParty.get(request)\n hourly[\"hourly_forecast\"].each do |hour| \n puts \"#{hour[\"FCTTIME\"][\"civil\"]}: #{hour[\"temp\"][\"english\"]}F\"\n end\nend",
"def day\n @client = Client.new\n @title = @current_user.name\n @view = 'day'\n # TODO is Date.parse in current time zone? If not add.\n @date = params[:date].nil? ? Date.current : Date.parse(params[:date])\n # TODO: brakeman is warning of security problem with this line\n @nav_title = @date.strftime(NAV_TITLE[@view.to_sym])\n # TODO: should employees stay or go?\n @employees = [1]\n\n @appointments_by_hour = Hash.new\n r = Appointment.where(time: @date.in_time_zone.beginning_of_day..@date.in_time_zone.end_of_day).order(:time).includes(:client)\n r.each do |appointment| #.order(:time).group_by(&:time)\n k = appointment.time.hour\n if @appointments_by_hour.has_key?(k)\n @appointments_by_hour[k].push(appointment)\n else\n @appointments_by_hour[k] = [appointment]\n end\n end\n\n render 'index'\n end",
"def user_hours_by_aircraft\n result = @current_user.flights.group(:aircraft).sum(:flight_time)\n render json: [{name: 'Flight Hours', data: result}]\n end",
"def weekly_hours\n worked_hours\n end",
"def create\n @open_hour = OpenHour.new(open_hour_params)\n\n respond_to do |format|\n if @open_hour.save\n format.html { redirect_to [:admin, @open_hour], notice: 'Open hour was successfully created.' }\n format.json { render action: 'show', status: :created, location: @open_hour }\n else\n format.html { render action: 'new' }\n format.json { render json: @open_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n @booked_hours = BookedHour.all\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clock_time }\n end\n end",
"def hour\n self.range('hour')\n end",
"def happy_hours\n @entries = HappyHour.includes(:combo_package, :outlet).where(\"location_id=? #{@outlet_query}\", params[:location_id].to_i).paginate(:page => params[:page]) if request.xhr? \n end",
"def index\n\t\tselect_service\n\t\t@proposal_hour_extras = ProposalHourExtra.all\n\tend",
"def show\n @work_day = WorkDay.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_day }\n end\n end",
"def show\n @hour_entry = HourEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @hour_entry }\n end\n end",
"def get_price(hours)\n if hours < 24\n price = (self.class.price_hr*hours)+self.class.price_base\n else\n days = hours/24\n price = (self.class.price_day*days)+self.class.price_base\n end\n\n return price\n end",
"def hour() end",
"def show\n @open_hours = Hash.new\n @place.open_times.each do |schedule|\n @open_hours[schedule.day] = \"#{schedule.open_time.strftime('%l:%M %P')} - #{schedule.close_time.strftime('%l:%M %P')}\"\n end\n end",
"def getdifficulty\n @api.request 'getdifficulty'\n end",
"def set_hour\n @hour = Hour.find(params[:id])\n end",
"def destroy\n @hour = Hour.find(params[:id])\n @hour.destroy\n\n respond_to do |format|\n format.html { redirect_to hours_url }\n format.json { head :no_content }\n end\n end",
"def index\n @hour_types = HourType.all\n @instances = @hour_types\n @model = \"hour_type\"\n @icon = \"fa-cogs\"\n end"
] |
[
"0.7644183",
"0.7159949",
"0.69849145",
"0.69371396",
"0.69145554",
"0.6780261",
"0.66310656",
"0.6533028",
"0.6525139",
"0.6504493",
"0.6438296",
"0.63622314",
"0.6361963",
"0.63285553",
"0.6315946",
"0.62583035",
"0.6250996",
"0.62372184",
"0.62236947",
"0.6169397",
"0.6158665",
"0.6128216",
"0.60622454",
"0.60542",
"0.6026461",
"0.6000715",
"0.60003805",
"0.59486663",
"0.5942048",
"0.5940196",
"0.59315914",
"0.590884",
"0.590884",
"0.59049755",
"0.5899627",
"0.5893454",
"0.5891254",
"0.5887952",
"0.5885722",
"0.58617824",
"0.58501637",
"0.58430195",
"0.58388966",
"0.58343506",
"0.58260155",
"0.57927656",
"0.579144",
"0.5775669",
"0.5774394",
"0.57502455",
"0.5743728",
"0.5731501",
"0.57213587",
"0.57213587",
"0.5714804",
"0.5709904",
"0.5706028",
"0.57016164",
"0.56927955",
"0.5682013",
"0.5675441",
"0.56710196",
"0.56627375",
"0.56574714",
"0.56424206",
"0.564048",
"0.5637986",
"0.5628582",
"0.56206876",
"0.5619696",
"0.5613781",
"0.561204",
"0.55902123",
"0.55872613",
"0.5584955",
"0.5573644",
"0.55727226",
"0.5558372",
"0.55530685",
"0.5548298",
"0.5545115",
"0.5542098",
"0.55358636",
"0.55301076",
"0.55282",
"0.5525279",
"0.55230844",
"0.5517946",
"0.5516309",
"0.5516284",
"0.5509119",
"0.54920423",
"0.5490523",
"0.54879224",
"0.5487032",
"0.5480162",
"0.5472385",
"0.5465602",
"0.54645455",
"0.5458306",
"0.5448271"
] |
0.0
|
-1
|
POST /operating_hours POST /operating_hours.json
|
def create
@operating_hour = OperatingHour.new(operating_hour_params)
respond_to do |format|
if @operating_hour.save
format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully created.' }
format.json { render :show, status: :created, location: @operating_hour }
else
format.html { render :new }
format.json { render json: @operating_hour.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @operation_hour = OperationHour.create(params[:operation_hour])\n end",
"def operating_hour_params\n params.require(:operating_hour).permit(:monday_from, :monday_to, :tuesday_from, :tuesday_to, :wednesday_from, :wednesday_to, :thursday_from, :thursday_to, :friday_from, :friday_to, :sat_from, :sat_to, :sunday_from, :sunday_to, :warehouse_id)\n end",
"def create\n @officehour = Officehour.new(params[:officehour])\n\n respond_to do |format|\n if @officehour.save\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully created.' }\n\tformat.json { render json: @officehour, status: :created, location: @officehour }\n else\n\tformat.html { render action: \"new\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def office_hour_detail_params\n params.require(:office_hour_detail).permit(:office_hour_id, :agent_id, :turno_hora, :lunes, :martes, :miercoles, :jueves, :viernes, :sabado, :domingo, :total_hours, :rest_hours)\n end",
"def hours\n render json: Pings::Selector.new.hours(params)\n end",
"def set_operating_hour\n @operating_hour = OperatingHour.find(params[:id])\n end",
"def create\n if(params[:oper] && params[:oper] != '')\n timecard = Timecard.find(params[:timecard_id])\n # the hour the we should use\n if(params[:oper] == 'edit')\n hour = timecard.hours.find(params[:id])\n # save a historical\n old_information = \"Description:#{hour.description}-----Initial Time:#{hour.initial_time}-----End Time:#{hour.end_time}\" if(hour)\n else\n hour = Hour.new\n end\n if(hour)\n hour.description = params[:description]\n hour.date = params[:date]\n hour.intime = params[:initial_time]\n hour.entime = params[:end_time]\n hour.timecard = timecard\n if(hour.save)\n if(old_information)\n new_value = \"Description:#{hour.description}-----Initial Time:#{hour.initial_time}-----End Time:#{hour.end_time}\" \n HistoricalHour.create(:old_value=>old_information, :new_value=>new_value, :hour_id=>hour.id, :user=>current_member)\n end\n render :json=>\"{\\\"success\\\":true,\\\"message\\\":\\\"Great! you just added an hour in your timesheet.\\\"}\"\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"#{first_error(hour)}\\\"}\"\n end\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"Oops, you tried to do an invalid operation.\\\"}\"\n end\n else\n render :json=>\"{\\\"success\\\":false,\\\"message\\\":\\\"Oops, you tried to do an invalid operation.\\\"}\"\n end\n end",
"def create\n @office_hour_detail = OfficeHourDetail.new(office_hour_detail_params)\n\n respond_to do |format|\n if @office_hour_detail.save\n format.html { redirect_to @office_hour_detail, notice: 'Office hour detail was successfully created.' }\n format.json { render :show, status: :created, location: @office_hour_detail }\n else\n format.html { render :new }\n format.json { render json: @office_hour_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hour = Hour.new(params[:hour])\n\n respond_to do |format|\n if @hour.save\n format.html { redirect_to @hour, notice: 'Hour was successfully created.' }\n format.json { render json: @hour, status: :created, location: @hour }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @day_hour = DayHour.new(day_hour_params)\n respond_to do |format|\n if @day_hour.save\n format.html { redirect_to root_url }\n format.json { render :show, status: :created, location: @day_hour }\n else\n format.html { render :new }\n format.json { render json: @day_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @open_hour = OpenHour.new(open_hour_params)\n\n respond_to do |format|\n if @open_hour.save\n format.html { redirect_to [:admin, @open_hour], notice: 'Open hour was successfully created.' }\n format.json { render action: 'show', status: :created, location: @open_hour }\n else\n format.html { render action: 'new' }\n format.json { render json: @open_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @add_hour = AddHour.new(add_hour_params)\n\n respond_to do |format|\n if @add_hour.save\n format.html { redirect_to @add_hour, notice: 'Add hour was successfully created.' }\n format.json { render :show, status: :created, location: @add_hour }\n else\n format.html { render :new }\n format.json { render json: @add_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @worked_hour.save\n\n respond_with(@worked_hour)\n end",
"def business_hour_params\n params.require(:business_hour).permit(:pharmacy_id, :day, :open_time, :close_time)\n end",
"def create\n @time_off_instance = TimeOffInstance.new(time_off_instance_params)\n #@time_off_instance.employee.hours_left -= @time_off_instance.hours_used\n respond_to do |format|\n if @time_off_instance.save\n self.use_pto_hours\n #print \"HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE\"\n format.html { redirect_to @time_off_instance, notice: 'Time off instance was successfully created.' }\n format.json { render :show, status: :created, location: @time_off_instance }\n else\n format.html { render :new }\n format.json { render json: @time_off_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @working_hour = WorkingHour.new(working_hour_params)\n\n respond_to do |format|\n if @working_hour.save\n format.html { redirect_to @working_hour, notice: 'Working hour was successfully created.' }\n format.json { render :show, status: :created, location: @working_hour }\n else\n format.html { render :new }\n format.json { render json: @working_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @location_hour = current_merchant.location_hours.build(location_hour_params)\n\n respond_to do |format|\n if @location_hour.save\n format.html { redirect_to location_hours_path, notice: 'Business hour was successfully created.' }\n format.json { render :show, status: :created, location: @location_hour }\n else\n format.html { render :new }\n format.json { render json: @location_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @operating_hour.update(operating_hour_params)\n format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @operating_hour }\n else\n format.html { render :edit }\n format.json { render json: @operating_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def officehour_params\r\n params.require(:officehour).permit(:course_id, :ta_id, :start, :end, :online)\r\n end",
"def add_hour_params\n params.require(:add_hour).permit(:name, :email, :Hourly_Wage, :NHour, :Paid, :client_id)\n end",
"def postEntityOpening_times( entity_id, monday, tuesday, wednesday, thursday, friday, saturday, sunday, closed, closed_public_holidays)\n params = Hash.new\n params['entity_id'] = entity_id\n params['monday'] = monday\n params['tuesday'] = tuesday\n params['wednesday'] = wednesday\n params['thursday'] = thursday\n params['friday'] = friday\n params['saturday'] = saturday\n params['sunday'] = sunday\n params['closed'] = closed\n params['closed_public_holidays'] = closed_public_holidays\n return doCurl(\"post\",\"/entity/opening_times\",params)\n end",
"def create\n @work_hour = WorkHour.new(work_hour_params)\n\n respond_to do |format|\n if @work_hour.save\n format.html { redirect_to @work_hour, notice: 'Work hour was successfully created.' }\n format.json { render :show, status: :created, location: @work_hour }\n else\n format.html { render :new }\n format.json { render json: @work_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @delivery_hour = DeliveryHour.new(delivery_hour_params)\n\n respond_to do |format|\n if @delivery_hour.save\n format.html { \n flash[:notice] = 'La hora de entrega se creó satisfactoriamente.'\n redirect_to delivery_hours_path\n }\n format.json { render :show, status: :created, location: @delivery_hour }\n else\n format.html { render :new }\n format.json { render json: @delivery_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @employee_workinghour = EmployeeWorkinghour.new(employee_workinghour_params)\n\n respond_to do |format|\n if @employee_workinghour.save\n format.html { redirect_to @employee_workinghour, notice: 'Employee workinghour was successfully created.' }\n format.json { render :show, status: :created, location: @employee_workinghour }\n else\n format.html { render :new }\n format.json { render json: @employee_workinghour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def working_hour_params\n params.require(:working_hour).permit(:date, :name, :hours, :project)\n end",
"def location_hour_params\n params.require(:location_hour).permit(:name, :location_ids, :_destroy, hours_attributes: [:id, :day, :start_time, :end_time, :closed, :_destroy])\n end",
"def happy_hour_params\n params.require(:happy_hour).permit(:id, :place_id, :start_time, :end_time, :day, :deal)\n end",
"def index\n @operating_hours = OperatingHour.all\n end",
"def create\n @happy_hour = HappyHour.new(happy_hour_params)\n\n respond_to do |format|\n if @happy_hour.save\n format.html { redirect_to @happy_hour, notice: 'Happy hour was successfully created.' }\n format.json { render action: 'show', status: :created, location: @happy_hour }\n else\n format.html { render action: 'new' }\n format.json { render json: @happy_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hour_entry = HourEntry.new(params[:hours])\n\n respond_to do |format|\n if @hour_entry.save\n flash[:notice] = 'HourEntry was successfully created.'\n format.html { redirect_to(@hour_entry) }\n format.xml { render :xml => @hour_entry, :status => :created, :location => @hour_entry }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @hour_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def estimated_hour_params\n params.require(:estimated_hour).permit(:hours, :feature_id)\n end",
"def open_hour_params\n params.required(:open_hour).permit(:event_id, :day_of_the_week, :open_hour, :close_hour)\n end",
"def new\n @officehour = Officehour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @officehour }\n end\n end",
"def update\n params[:office_hour].delete \"day\"\n\n respond_to do |format|\n if @office_hour.update_attributes(params[:office_hour])\n format.html { redirect_to action: \"index\", notice: 'Offnungszeit erfolgreich geändert.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def hour_params\n params.require(:hour).permit(:name, :user_id, :amount, :group_id)\n end",
"def workhour_params\n params.require(:workhour).permit(:weekday, :start, :finish, :work_id)\n end",
"def create\n @transport_hour = TransportHour.new(transport_hour_params)\n\n respond_to do |format|\n if @transport_hour.save\n format.html { redirect_to @transport_hour, notice: 'Transport hour was successfully created.' }\n format.json { render :show, status: :created, location: @transport_hour }\n else\n format.html { render :new }\n format.json { render json: @transport_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def destroy\n @operating_hour.destroy\n respond_to do |format|\n format.html { redirect_to operating_hours_url, notice: 'Operating hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def create\n\n unless params[:hour][:start_date].nil?\n params[:hour][:start_date] = DateTime.strptime(params[:hour][:start_date], \"%d/%m/%Y %I:%M%p\") unless ((DateTime.parse(params[:hour][:start_date]) rescue ArgumentError) == ArgumentError)\n end\n \n unless params[:hour][:end_date].nil?\n params[:hour][:end_date] = DateTime.strptime(params[:hour][:end_date], \"%d/%m/%Y %I:%M%p\") unless ((DateTime.parse(params[:hour][:end_date]) rescue ArgumentError) == ArgumentError)\n end\n \n p params[:hour][:start_date]\n p params[:hour][:end_date]\n sleep 5\n @hour = Hour.new(params[:hour])\n\n respond_to do |format|\n if @hour.save\n format.html { redirect_to @hour, notice: t(:successfully_created) }\n format.json { render json: @hour, status: :created, location: @hour }\n else\n format.html { render action: \"new\" }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def hours_registration_params\n params.require(:hours_registration).permit(:colaborator_id, :date, :entrance1, :exit1, :entrance2, :exit2, :entrance3, :exit3, :justify)\n end",
"def create\n @workhour = Workhour.new(workhour_params)\n @workhour.start = @workhour.start.change(day: 1, month: 1, year: 2000)\n @workhour.finish = @workhour.finish.change(day: 1, month: 1, year: 2000)\n\n respond_to do |format|\n if @workhour.save\n format.html { redirect_to @workhour, notice: 'Workhour was successfully created.' }\n format.json { render :show, status: :created, location: @workhour }\n else\n @works = Work.where(doctor_id: current_user.doctor.id)\n @weekdays = {:monday=>1, :tuesday=>2, :wednesday=>3, :thursday=>4, :friday=>5, :saturday=>6, :sunday=>0}\n format.html { render :new }\n format.json { render json: @workhour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @hour = Hour.new(hour_params)\n @current_user ||= User.find_by_remember_token(cookies[:remember_token])\n @hour.user_id = @current_user.id\n @group_options = Group.all.map { |u| [u.name, u.id] }\n\n respond_to do |format|\n if @hour.save\n format.html { redirect_to @hour, notice: 'Hour was successfully created.' }\n format.json { render :show, status: :created, location: @hour }\n else\n format.html { render :new }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @time_of_day = TimeOfDay.new(time_of_day_params)\n\n respond_to do |format|\n if @time_of_day.save\n format.html { redirect_to @time_of_day, notice: 'Time of day was successfully created.' }\n format.json { render :show, status: :created, location: @time_of_day }\n else\n format.html { render :new }\n format.json { render json: @time_of_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def work_hour_params\n params.require(:work_hour).permit(:project, :date, :hour)\n end",
"def planned_hour_params\n params.require(:planned_hour).permit(:number, :client_id, :user_id, :month)\n end",
"def employee_workinghour_params\n params.require(:employee_workinghour).permit(:employee_id, :working_hour_id)\n end",
"def hours\n\n today = Date.today\n hours = {}\n #if @traveler.is_visitor? or @traveler.is_api_guest? #Return a wide range of hours\n if not @traveler or not @traveler.registered?\n (0..30).each do |n|\n hours[(today + n).to_s] = {open: \"07:00\", close: \"22:00\"}\n end\n\n else # This is not a guest, check to see if the traveler is registered with a service\n\n # NOTE(wilsonj806) For now this implementation does not let registered users\n #...book trips on weekends. Eventually we want to change that so they can do so\n\n if @traveler.booking_profiles.count > 0 #This user is registered with a service\n booking_profile = @traveler.booking_profiles.first\n service = booking_profile.service\n\n min_notice_days = (service.booking_details[:min_days] || 2).to_i\n max_notice_days = (service.booking_details[:max_days] || 14).to_i\n\n \n if service.booking_details[:trusted_users] and booking_profile.external_user_id.in? service.booking_details.try(:[], :trusted_users).split(',').map{ |x| x.strip }\n (1..21).each do |n|\n hours[(today + n).to_s] = {open: \"00:00\", close: \"23:59\"}\n end\n elsif service.schedules.count > 0 #This user's service has listed hours. This is the most common case.\n \n #Find out if we are past the cutoff for today. If so, start counting from tomorrow\n if service.booking_details[:cutoff_time] and (Time.now.in_time_zone.seconds_since_midnight > service.booking_details[:cutoff_time].to_i)\n day = Time.now + 1.days \n else\n day = Time.now\n end\n \n biz_days_count = 0\n (0..max_notice_days).each do |n|\n if service.open_on_day? day\n if biz_days_count >= min_notice_days\n schedule = service.schedules.where(day: day.wday).first\n if schedule\n hours[day.strftime('%Y-%m-%d')] = {open: schedule.schedule_time_to_military_string(schedule.start_time), \n close: schedule.schedule_time_to_military_string(schedule.end_time)}\n end\n end\n biz_days_count += 1\n end\n day = day + 1.days \n end\n\n else #This user is registered with a service, but that service has not entered any hours\n\n (min_notice_days..max_notice_days).each do |n|\n unless (today + n).saturday? or (today + n).sunday?\n hours[(today + n).to_s] = {open: \"08:00\", close: \"17:00\"}\n end\n end\n\n end\n\n else #This user is logged in but isn't registered with a service\n\n (1..14).each do |n|\n unless (today + n).saturday? or (today + n).sunday?\n hours[(today + n).to_s] = {open: \"08:00\", close: \"17:00\"}\n end\n end\n\n end # if #traveler.user_profile.user_services.count > 0\n end # if @travler.is_visitor\n\n render status: 200, json: hours\n\n end",
"def forecast_hour_params\n params.require(:forecast_hour).permit(:disruption_level, :probability_of_occurence, :forecast_day_id)\n end",
"def update\n @operation_hour = OperationHour.find(params[:id])\n @operation_hour.update_attributes(params[:operation_hour])\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def create\n @forecast_hour = ForecastHour.new(forecast_hour_params)\n\n respond_to do |format|\n if @forecast_hour.save\n format.html { redirect_to @forecast_hour, notice: 'Forecast hour was successfully created.' }\n format.json { render :show, status: :created, location: @forecast_hour }\n else\n format.html { render :new }\n format.json { render json: @forecast_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def open_hour_params\n params.require(:open_hour).permit(:store_id, :day, :open, :close, :valid_from, :valid_through)\n end",
"def delivery_hour_params\n params.require(:delivery_hour).permit(:name)\n end",
"def create\n @estimated_hour = @current_user.estimated_hours.new(estimated_hour_params)\n @estimated_hour.price_quote_id = params[:price_quote_id] if params[:price_quote_id].present?\n @estimated_hour.feature_id = params[:feature_id] if params[:feature_id].present?\n\n respond_to do |format|\n if @estimated_hour.save!\n format.html { redirect_to :back, notice: 'Estimated_hour was successfully created.' }\n format.json { render action: 'show', status: :created, location: @estimated_hour }\n else\n format.html { render action: 'new' }\n format.json { render json: @estimated_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n set_user\n @time_off = TimeOff.new(time_off_params)\n\n respond_to do |format|\n if @time_off.save\n format.html { redirect_to user_time_off_path(@user, @time_off), notice: 'Time off was successfully created.' }\n format.json { render action: 'show', status: :created, location: @time_off }\n else\n format.html { render action: 'new' }\n format.json { render json: @time_off.errors, status: :unprocessable_entity }\n end\n end\n end",
"def opening_hour_params\n params.require(:opening_hour).permit :id,\n :place_id,\n :day_of_week,\n shifts_attributes:[:id, :start_at, :end_at]\n end",
"def create\n @hour_type = HourType.new(hour_type_params)\n\n respond_to do |format|\n if @hour_type.save\n format.html { redirect_to hour_types_path, notice: 'Hour type was successfully created.' }\n format.json { render :show, status: :created, location: @hour_type }\n else\n set_html_elements\n format.html { render :new }\n format.json { render json: @hour_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def hours\n \n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @office_hours }\n end\n end",
"def create\n @hour_log = HourLog.new(hour_log_params)\n if @hour_log.save\n render json: @hour_log, status: 201\n else\n render json: { error: \"Please make sure to fill all required fields.\" }, status: 400\n end\n end",
"def bussines_hour_params\n params.require(:setting).permit(:id, business_hours_attributes: [:id, :day, :h_start, :h_end, :h_start2, :h_end2, :is_active, :active, :_destroy])\n end",
"def create\n @station_hour = StationHour.new(station_hour_params)\n\n respond_to do |format|\n if @station_hour.save\n format.html { redirect_to @station_hour, notice: 'Station hour was successfully created.' }\n format.json { render :show, status: :created, location: @station_hour }\n else\n format.html { render :new }\n format.json { render json: @station_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @off_day = OffDay.new(off_day_params)\n\n respond_to do |format|\n if @off_day.save\n format.html { redirect_to @off_day, notice: 'Off day was successfully created.' }\n format.json { render :show, status: :created, location: @off_day }\n else\n format.html { render :new }\n format.json { render json: @off_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @booked_hour = BookedHour.new(booked_hour_params)\n\n respond_to do |format|\n if @booked_hour.save\n format.html { redirect_to @booked_hour }\n format.json { render :show, status: :created, location: @booked_hour }\n else\n format.html { render :new }\n format.json { render json: @booked_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def vacation_hours_event_params\n params.require(:vacation_hours_event).permit(:vacation_hours_used, :vacation_hours_gained, :vacation_hours_adj_date)\n end",
"def create\n\t\t@proposal_hour_extra = ProposalHourExtra.new(proposal_hour_extra_params)\n\t\t@proposal_hour_extra.admin = current_admin\n\t\t@proposal_hour_extra.user_criate=current_admin.nome\n\t\tselect_calculation\n\t\tselect_city\n\t\tselect_rotation\n\t\tselect_role\n\t\tselect_company\n\t\tselect_calculation\n\t\tselected_role\n\t\tselected_service\n\t\tselect_service\n\t\trespond_to do |format|\n\t\t\tif @proposal_hour_extra.save\n\t\t\t\t#format.html { redirect_to @proposal_hour_extra_params, notice: 'Proposal hour extra was successfully created.' }\n\t\t\t\tformat.html { redirect_to \"/services/#{@proposal_hour_extra.hour_extra_roles[0].role.service_id}/proposal_hour_extras/#{@proposal_hour_extra.id}\", notice: 'Proposal was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @proposal_hour_extra }\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @proposal_hour_extra.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def opening_hours\n hours = @data[:godziny_pracy]\n keys = {weekdays: :dni_robocze, saturdays: :soboty, sundays: :niedz_i_sw}\n Hash[\n keys.map do |h, x|\n value = unless hours[x].nil?\n [hours[x][:godziny].to_s, hours[x][:uwagi].to_s]\n end\n\n [h, value]\n end\n ]\n end",
"def create\n @working_time = WorkingTime.new(params[:working_time])\n\n respond_to do |format|\n if current_user.time_tables[0].working_times << @working_time\n format.html { redirect_to time_tables_path }\n format.json { render json: @working_time, status: :created, location: @working_time }\n else\n format.html { render action: \"new\" }\n format.json { render json: @working_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def overtime_params\n params.require(:overtime).permit(:start_date, :end_date, :employee_id, :report_id, :hours)\n end",
"def update\n respond_to do |format|\n if @add_hour.update(add_hour_params)\n format.html { redirect_to @add_hour, notice: 'Add hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @add_hour }\n else\n format.html { render :edit }\n format.json { render json: @add_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @providers_opening_time = Providers::OpeningTime.new(providers_opening_time_params)\n\n respond_to do |format|\n if @providers_opening_time.save\n format.html { redirect_to providers_opening_times_path, notice: 'Opening time was successfully created.' }\n format.json { render :show, status: :created, location: @providers_opening_time }\n else\n format.html { render :new }\n format.json { render json: @providers_opening_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @log_hour = LogHour.new(log_hour_params)\n\n respond_to do |format|\n if @log_hour.save\n format.html { redirect_to root_path, notice: 'Successfully logged your hours.' }\n format.json { render :show, status: :created, location: @log_hour }\n else\n format.html { render :new }\n format.json { render json: @log_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def build_hash hash, date, worked_hours, departur_hour\n hash[\"#{date.strftime(\"%F\")}\"] = {total: worked_hours, arrival_hour: date, departur_hour: departur_hour}\n hash[:total_worked] += worked_hours\n hash[:total_days] += 1\n return hash\n end",
"def create_payroll(options={})\n post(\"hours-wages\", options)\n end",
"def hospitalization_day_params\n params.require(:hospitalization_day).permit(:qty, :price, :subtotal, :date, :adverse_event_id, :service_id)\n end",
"def update\n @officehour = Officehour.find(params[:id])\n\n respond_to do |format|\n if @officehour.update_attributes(params[:officehour])\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully updated.' }\n\tformat.json { head :no_content }\n else\n\tformat.html { render action: \"edit\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n self.unuse_pto_hours\n if @time_off_instance.update(time_off_instance_params)\n self.use_pto_hours\n format.html { redirect_to @time_off_instance, notice: 'Time off instance was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_off_instance }\n else\n format.html { render :edit }\n format.json { render json: @time_off_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @vacation_hours_event = VacationHoursEvent.new(vacation_hours_event_params)\n\n respond_to do |format|\n if @vacation_hours_event.save\n format.html { redirect_to vacation_hours_events_path, notice: 'Vacation hours event was successfully created.' }\n format.json { render :show, status: :created, location: @vacation_hours_event }\n else\n format.html { render :new }\n format.json { render json: @vacation_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_officehour\r\n @officehour = Officehour.find(params[:id])\r\n end",
"def create\n @last_hour = LastHour.new(params[:last_hour])\n\n respond_to do |format|\n if @last_hour.save\n format.html { redirect_to(@last_hour, :notice => 'LastHour was successfully created.') }\n format.xml { render :xml => @last_hour, :status => :created, :location => @last_hour }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @last_hour.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @user_hour_requirement = UserHourRequirement.new(params[:user_hour_requirement])\n\n respond_to do |format|\n if @user_hour_requirement.save\n format.html { redirect_to @user_hour_requirement, :notice => 'User hour requirement was successfully created.' }\n format.json { render :json => @user_hour_requirement, :status => :created, :location => @user_hour_requirement }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @user_hour_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @work_order_time = WorkOrderTime.new(work_order_time_params)\n\n respond_to do |format|\n if @work_order_time.save\n format.html { redirect_to @work_order_time, notice: 'Work order time was successfully created.' }\n format.json { render :show, status: :created, location: @work_order_time }\n else\n format.html { render :new }\n format.json { render json: @work_order_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @worked_hour.update_attributes(params[:worked_hour])\n\n respond_with(@worked_hour)\n end",
"def create\n @staffhour = Staffhour.new(staffhour_params)\n \n @accruel_rate = Accruel_rate.find(@staffhour.accruel_rate_id).rate\n @wk_accrued_hrs = @staffhour.hours * @accruel_rate\n \n @staffhour.update(wk_accrued_hours: @wk_accrued_hrs)\n @staffhour.save!\n\n respond_to do |format|\n if @staffhour.save\n format.html { redirect_to @staffhour, notice: 'Staffhour was successfully created.' }\n format.json { render :show, status: :created, location: @staffhour }\n else\n format.html { render :new }\n format.json { render json: @staffhour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def log_hour_params\n params.require(:log_hour).permit(:hours).merge(user_id: current_user.id)\n end",
"def new\n @atom.hours = 24\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @atom }\n end\n end",
"def working_hours=(value)\n @working_hours = value\n end",
"def create\n @poi_time = PoiTime.new(poi_time_params)\n\n respond_to do |format|\n if @poi_time.save\n format.html { redirect_to @poi_time, notice: 'Poi time was successfully created.' }\n format.json { render :show, status: :created, location: @poi_time }\n else\n format.html { render :new }\n format.json { render json: @poi_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def delete\n @operation_hour = OperationHour.find(params[:operation_hour_id])\n end",
"def create\n @daytime = Daytime.new(params[:daytime])\n\n respond_to do |format|\n if @daytime.save\n format.html { redirect_to @daytime, notice: 'Daytime was successfully created.' }\n format.json { render json: @daytime, status: :created, location: @daytime }\n else\n format.html { render action: \"new\" }\n format.json { render json: @daytime.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_opening_hour\n if params[:id].present?\n @opening_hour = OpeningHour.find(params[:id])\n end\n end",
"def transport_hour_params\n params.require(:transport_hour).permit(:transport_id, :hour_id)\n end",
"def update\n respond_to do |format|\n if @office_hour_detail.update(office_hour_detail_params)\n format.html { redirect_to @office_hour_detail, notice: 'Office hour detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @office_hour_detail }\n else\n format.html { render :edit }\n format.json { render json: @office_hour_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @hour = Hour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hour }\n end\n end",
"def new\n @hour = Hour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hour }\n end\n end",
"def modificar_hora\n # Hacemos la resta de horas que se solicita\n @tiempo = @tiempo + @zone.hour\n # Formateamos para el standar que se solicita\n @tiempo = @tiempo.strftime(\"%H:%M:%S\")\n # Devolvemos el json con un status 200\n render json: {response:{time: @tiempo, timezone: \"utc\"}}, status: :ok\n end",
"def set_office_hour_detail\n @office_hour_detail = OfficeHourDetail.find(params[:id])\n end",
"def create\n @planned_hour = PlannedHour.new(planned_hour_params)\n\n respond_to do |format|\n if @planned_hour.save\n format.js\n format.html { redirect_to action: \"index\", notice: 'Planned hour was successfully created.' }\n format.json { render action: 'show', status: :created, location: @planned_hour }\n else\n format.html { render action: 'new' }\n format.json { render json: @planned_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_open_hour\n @open_hour = OpenHour.find(params[:id])\n end",
"def set_open_hour\n @open_hour = OpenHour.find(params[:id])\n end",
"def day_hour_params\n day_hour_params = params.require(:day_hour).permit(:venue_id, :opening_time, :closing_time, :day)\n day_hour_params[:opening_time].sub!(/\\..*/,'')\n day_hour_params[:closing_time].sub!(/\\..*/,'')\n day_hour_params[:day].downcase!\n day_hour_params\n end"
] |
[
"0.7029278",
"0.6969807",
"0.696099",
"0.668269",
"0.66538256",
"0.6569062",
"0.65684414",
"0.6528205",
"0.6489911",
"0.64667356",
"0.6458775",
"0.645536",
"0.63673955",
"0.6336778",
"0.6315144",
"0.6312436",
"0.62817925",
"0.6260089",
"0.62549",
"0.62451255",
"0.6218185",
"0.61821795",
"0.61064667",
"0.60873187",
"0.60865974",
"0.6072146",
"0.6045197",
"0.6029082",
"0.6012877",
"0.60109574",
"0.5993381",
"0.59646034",
"0.5930142",
"0.59042144",
"0.5896136",
"0.58908767",
"0.5877225",
"0.58757144",
"0.58722675",
"0.5869975",
"0.5866626",
"0.5865971",
"0.586044",
"0.5834231",
"0.58222675",
"0.581869",
"0.5814506",
"0.5809348",
"0.58061576",
"0.5784023",
"0.5783439",
"0.57779115",
"0.57541764",
"0.57505137",
"0.57472116",
"0.57430434",
"0.5715782",
"0.56998545",
"0.5694764",
"0.5693525",
"0.5675945",
"0.56738895",
"0.567361",
"0.5666527",
"0.56503963",
"0.5642424",
"0.5638006",
"0.5631036",
"0.5607766",
"0.56059664",
"0.5591199",
"0.55910957",
"0.55773884",
"0.55749995",
"0.5564854",
"0.5560995",
"0.55577266",
"0.5557551",
"0.5551753",
"0.5543924",
"0.5535507",
"0.5534089",
"0.5512965",
"0.5475211",
"0.54734325",
"0.54727775",
"0.546485",
"0.5464188",
"0.5462303",
"0.54568493",
"0.5454468",
"0.54523736",
"0.5443093",
"0.5443093",
"0.54320484",
"0.5427878",
"0.54132706",
"0.53941923",
"0.53941923",
"0.5391822"
] |
0.7498469
|
0
|
PATCH/PUT /operating_hours/1 PATCH/PUT /operating_hours/1.json
|
def update
respond_to do |format|
if @operating_hour.update(operating_hour_params)
format.html { redirect_to @operating_hour, notice: 'Operating hour was successfully updated.' }
format.json { render :show, status: :ok, location: @operating_hour }
else
format.html { render :edit }
format.json { render json: @operating_hour.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @officehour = Officehour.find(params[:id])\n\n respond_to do |format|\n if @officehour.update_attributes(params[:officehour])\n\tformat.html { redirect_to @officehour, notice: 'Officehour was successfully updated.' }\n\tformat.json { head :no_content }\n else\n\tformat.html { render action: \"edit\" }\n\tformat.json { render json: @officehour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @open_hour.update(open_hour_params)\n format.html { redirect_to [:admin, @open_hour], notice: 'Open hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @open_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @operation_hour = OperationHour.find(params[:id])\n @operation_hour.update_attributes(params[:operation_hour])\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end",
"def update\n respond_to do |format|\n if @office_hour_detail.update(office_hour_detail_params)\n format.html { redirect_to @office_hour_detail, notice: 'Office hour detail was successfully updated.' }\n format.json { render :show, status: :ok, location: @office_hour_detail }\n else\n format.html { render :edit }\n format.json { render json: @office_hour_detail.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @hour = Hour.find(params[:id])\n\n respond_to do |format|\n if @hour.update_attributes(params[:hour])\n format.html { redirect_to @hour, notice: 'Hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n params[:office_hour].delete \"day\"\n\n respond_to do |format|\n if @office_hour.update_attributes(params[:office_hour])\n format.html { redirect_to action: \"index\", notice: 'Offnungszeit erfolgreich geändert.' }\n else\n format.html { render action: \"edit\" }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hour.update(hour_params)\n format.html { redirect_to @hour, notice: 'Hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @hour }\n else\n format.html { render :edit }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @worked_hour.update_attributes(params[:worked_hour])\n\n respond_with(@worked_hour)\n end",
"def update\n respond_to do |format|\n self.unuse_pto_hours\n if @time_off_instance.update(time_off_instance_params)\n self.use_pto_hours\n format.html { redirect_to @time_off_instance, notice: 'Time off instance was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_off_instance }\n else\n format.html { render :edit }\n format.json { render json: @time_off_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n\n respond_to do |format|\n if @user_hour_requirement.update_attributes(params[:user_hour_requirement])\n format.html { redirect_to @user_hour_requirement, :notice => 'User hour requirement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @user_hour_requirement.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_operating_hour\n @operating_hour = OperatingHour.find(params[:id])\n end",
"def update\n respond_to do |format|\n if @add_hour.update(add_hour_params)\n format.html { redirect_to @add_hour, notice: 'Add hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @add_hour }\n else\n format.html { render :edit }\n format.json { render json: @add_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @happy_hour.update(happy_hour_params)\n format.html { redirect_to @happy_hour, notice: 'Happy hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @happy_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @estimated_hour.update(estimated_hour_params)\n format.html { redirect_to @estimated_hour, notice: 'Estimated_hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @estimated_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @business_hour.update(business_hour_params)\n format.html { redirect_to @business_hour, notice: 'Business hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @business_hour }\n else\n format.html { render :edit }\n format.json { render json: @business_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @working_hour.update(working_hour_params)\n format.html { redirect_to @working_hour, notice: 'Working hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @working_hour }\n else\n format.html { render :edit }\n format.json { render json: @working_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @location_hour.update(location_hour_params)\n format.html { redirect_to location_hours_path, notice: 'Business hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @location_hour }\n else\n format.html { render :edit }\n format.json { render json: @location_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n self.set_workflow\n \n if @hours_record.update(hours_record_params)\n format.html { redirect_to @hours_record, notice: 'Hours record was successfully updated.' }\n format.json { render :show, status: :ok, location: @hours_record }\n else\n format.html { render :edit }\n format.json { render json: @hours_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @work_hour.update(work_hour_params)\n format.html { redirect_to @work_hour, notice: 'Work hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_hour }\n else\n format.html { render :edit }\n format.json { render json: @work_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @employee_workinghour.update(employee_workinghour_params)\n format.html { redirect_to @employee_workinghour, notice: 'Employee workinghour was successfully updated.' }\n format.json { render :show, status: :ok, location: @employee_workinghour }\n else\n format.html { render :edit }\n format.json { render json: @employee_workinghour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @hour_entry = HourEntry.find(params[:id])\n\n respond_to do |format|\n if @hour_entry.update_attributes(params[:hours])\n flash[:notice] = 'HourEntry was successfully updated.'\n format.html { redirect_to(@hour_entry) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @hour_entry.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @day_hour.update(day_hour_params)\n format.html { redirect_to @day_hour, notice: 'Day hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @day_hour }\n else\n format.html { render :edit }\n format.json { render json: @day_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @workhour.update(workhour_params)\n format.html { redirect_to @workhour, notice: 'Workhour was successfully updated.' }\n format.json { render :show, status: :ok, location: @workhour }\n else\n format.html { render :edit }\n format.json { render json: @workhour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n Hour.action = \"update\"\n @hour = Hour.find(params[:id])\n\n respond_to do |format|\n \n unless params[:hour][:start_date].nil?\n params[:hour][:start_date] = DateTime.strptime(params[:hour][:start_date], \"%d/%m/%Y %I:%M%p\") unless ((DateTime.parse(params[:hour][:start_date]) rescue ArgumentError) == ArgumentError)\n end\n \n unless params[:hour][:end_date].nil?\n params[:hour][:end_date] = DateTime.strptime(params[:hour][:end_date], \"%d/%m/%Y %I:%M%p\") unless ((DateTime.parse(params[:hour][:end_date]) rescue ArgumentError) == ArgumentError)\n end\n \n if @hour.update_attributes(params[:hour])\n format.html { redirect_to @hour, notice: t(:successfully_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n operation = params[:operation]\n case operation\n when 'set_best_time'\n resp = @@serv.set_best_time(params['escape_room_id'], params['best_time'])\n render json: { success: resp.success, message: resp.message }, status: :ok\n else\n render json: { success: false, message: 'Operation can not be preformed' }, status: :bad_request\n end\n end",
"def update!(**args)\n @hours = args[:hours] if args.key?(:hours)\n @hours_fprint = args[:hours_fprint] if args.key?(:hours_fprint)\n end",
"def update\n respond_to do |format|\n if @hour_type.update(hour_type_params)\n format.html { redirect_to hour_types_path, notice: 'Hour type was successfully updated.' }\n format.json { render :show, status: :ok, location: @hour_type }\n else\n format.html { render :edit }\n format.json { render json: @hour_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @working_time = WorkingTime.find(params[:id])\n\n respond_to do |format|\n if @working_time.update_attributes(params[:working_time])\n format.html { redirect_to time_tables_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @working_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @time_off_request = TimeOffRequest.find(params[:id])\n respond_to do |format|\n if @time_off_request.update_attributes(params[:time_off_request])\n format.html { redirect_to admin_time_off_requests_url, notice: 'Time off request was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_off_request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @delivery_hour.update(delivery_hour_params)\n format.html { \n flash[:notice] = 'La hora de entrega se actualizó satisfactoriamente.'\n redirect_to delivery_hours_path\n }\n format.json { render :show, status: :ok, location: @delivery_hour }\n else\n format.html { render :edit }\n format.json { render json: @delivery_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\t\tselect_calculation\n\t\tselect_city\n\t\tselect_rotation\n\t\tselect_role\n\t\tselect_company\n\t\tselect_calculation\n\t\tselected_role\n\t\tselected_service\n\t\tselect_service\n @proposal_hour_extra.user_update=current_admin.nome\n\n\t\trespond_to do |format|\n\t\t\tif @proposal_hour_extra.update(proposal_hour_extra_params)\n\t\t\t\tformat.html { redirect_to \"/services/#{@proposal_hour_extra.hour_extra_roles[0].role.service_id}/proposal_hour_extras/#{@proposal_hour_extra.id}\", notice: 'Proposal was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @proposal_hour_extra }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @proposal_hour_extra.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"def update\n\t respond_to do |format|\n\t\t\tparams[:timetable].each do |day, hours|\n\t\t\t\texisting = Timetable.first :conditions => {\n\t\t\t\t\t\t:employer_id => selected_employer_id,\n\t\t\t\t\t\t:user_id => current_user.id,\n\t\t\t\t :day => day\n\t\t\t\t}\n\n\t\t\t\tif (existing) then\n\t\t\t\t\tsuccess = existing.update :hours => hours unless hours.empty?\n\t\t\t\t\tsuccess = existing.delete if hours.empty?\n\t\t\t\telsif not hours.empty? then\n\t\t\t\t\tt = Timetable.new :employer_id => selected_employer_id,\n\t\t\t\t\t\t:user_id => current_user.id, :day => day, :hours => hours\n\t\t\t\t\tsuccess = t.save\n\t\t\t else\n\t\t\t\t\tsuccess = true\n\t\t\t\tend\n\n\t\t\t\tunless success then\n\t\t\t\t\tformat.html { render action: 'show', error: sprintf(\"%s has wrong format.\", I18n.t('date.day_names')[day]) }\n\t\t\t\t\tformat.json { render json: sprintf(\"%s has wrong format.\", I18n.t('date.day_names')[day]), status: :unprocessable_entity }\n\t\t\t\tend\n\t\t\tend\n\t\t\tformat.html { redirect_to timetable_path, notice: 'Timetable was successfully updated.' }\n\t\t\tformat.json { head :no_content }\n end\n end",
"def update\n \trespond_to do |format|\n \t\tif @recurring_available_hour.update(recurring_available_hour_params)\n \t\t\tformat.html { redirect_to instructor_recurring_available_hours_path(@instructor), notice: 'Non recurring hour was successfully updated.' }\n \t\t\tformat.json { render :show, status: :ok, location: instructor_recurring_available_hour_path(@instructor, @recurring_available_hour) }\n \t\telse\n \t\t\tformat.html { render :edit }\n \t\t\tformat.json { render json: @recurring_available_hour.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n end",
"def update\n respond_to do |format|\n if @vacation_hours_event.update(vacation_hours_event_params)\n format.html { redirect_to vacation_hours_events_path, notice: 'Vacation hours event was successfully updated.' }\n format.json { render :show, status: :ok, location: @vacation_hours_event }\n else\n format.html { render :edit }\n format.json { render json: @vacation_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @vhour = Vhour.find(params[:id])\n\n respond_to do |format|\n if @vhour.update_attributes(params[:vhour])\n format.html { redirect_to @vhour, notice: 'Vhour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @vhour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @last_hour = LastHour.find(params[:id])\n\n respond_to do |format|\n if @last_hour.update_attributes(params[:last_hour])\n format.html { redirect_to(@last_hour, :notice => 'LastHour was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @last_hour.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @transport_hour.update(transport_hour_params)\n format.html { redirect_to @transport_hour, notice: 'Transport hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @transport_hour }\n else\n format.html { render :edit }\n format.json { render json: @transport_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @providers_opening_time.update(providers_opening_time_params)\n format.html { redirect_to providers_opening_times_path, notice: 'Opening time was successfully updated.' }\n format.json { render :show, status: :ok, location: @providers_opening_time }\n else\n format.html { render :edit }\n format.json { render json: @providers_opening_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @time_clock = TimeClock.find(params[:id])\n respond_to do |format|\n if @time_clock.update(time_clock_params)\n format.html { redirect_to @time_clock.user }\n format.json { render :show, status: :ok, location: @time_clock }\n else\n format.html { render :edit }\n format.json { render json: @time_clock.errors, status: :unprocessable_entity }\n end\n @time_clock.billed = 0\n @time_clock.hours = time_diff(@time_clock.clock_in, @time_clock.clock_out)\n @time_clock.save!\n end\n end",
"def update\n respond_to do |format|\n if @time_of_day.update(time_of_day_params)\n format.html { redirect_to @time_of_day, notice: 'Time of day was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_of_day }\n else\n format.html { render :edit }\n format.json { render json: @time_of_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @meeting_time.update(meeting_time_params)\n format.html { redirect_to @meeting_time, notice: 'Meeting time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @meeting_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @time_section = TimeSection.find(params[:id])\n\n respond_to do |format|\n if @time_section.update_attributes(params[:time_section])\n format.html { redirect_to @time_section, notice: 'Time section was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @time_section.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @time_clock.update(time_clock_params)\n format.html { redirect_to time_sheet_index_path(@time_clock), notice: 'Time clock entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @time_clock.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @sick_hours_event.update(sick_hours_event_params)\n format.html { redirect_to sick_hours_events_path, notice: 'Sick hours event was successfully updated.' }\n format.json { render :show, status: :ok, location: @sick_hours_event }\n else\n format.html { render :edit }\n format.json { render json: @sick_hours_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @forecast_hour.update(forecast_hour_params)\n format.html { redirect_to @forecast_hour, notice: 'Forecast hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @forecast_hour }\n else\n format.html { render :edit }\n format.json { render json: @forecast_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @poi_time.update(poi_time_params)\n format.html { redirect_to @poi_time, notice: 'Poi time was successfully updated.' }\n format.json { render :show, status: :ok, location: @poi_time }\n else\n format.html { render :edit }\n format.json { render json: @poi_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n set_user\n set_time_off\n respond_to do |format|\n if @time_off.update(time_off_params)\n format.html { redirect_to user_time_off_path(@user, @time_off), notice: 'Time off was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @time_off.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @operating_procedure.update(operating_procedure_params)\n render :show, status: :ok, location: @operating_procedure\n else\n render json: @operating_procedure.errors, status: :unprocessable_entity\n end\n end",
"def update\n @service_time = ServiceTime.find(params[:id])\n\n respond_to do |format|\n if @service_time.update_attributes(params[:service_time])\n format.html { redirect_to @service_time, notice: 'Service time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @service_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @order_break_time.update(order_break_time_params)\n format.html { redirect_to @order_break_time, notice: 'Order break time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render 'edit' }\n format.json { render json: @order_break_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @planned_hour.update(planned_hour_params)\n format.js\n format.html { redirect_to @planned_hour, notice: 'Planned hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @planned_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n result = V1::StudyHour::Update.(params, current_user: @current_user)\n if result.success?\n render json: result['model'], status: :ok\n elsif result['result.policy.failure']\n render json: { 'errors': [] }, status: :unauthorized\n else\n render json: {\n 'errors': result['contract.default'].errors.full_messages\n }, status: :unprocessable_entity\n end\n end",
"def update\n \trespond_to do |format|\n\t\tformat.html {\n\t\t\tgatherEntries\n\t\t\terrorMsg = nil\n\t\t\tTimeEntry.transaction do\n\t\t\t\tbegin\n\t\t\t\terrorMsg = l(:error_wktime_save_nothing) if @entries.blank?\n\t\t\t\t@entries.each do |entry|\n\t\t\t\t\t\tif entry.hours.blank?\n\t\t\t\t\t\t\t# delete the time_entry\n\t\t\t\t\t\t\t# if the hours is empty but id is valid\n\t\t\t\t\t\t\t# entry.destroy() unless ids[i].blank?\n\t\t\t\t\t\t\tif !entry.id.blank?\n\t\t\t\t\t\t\t\tif !entry.destroy()\n\t\t\t\t\t\t\t\t\terrorMsg = entry.errors.full_messages.join('\\n')\n\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t#if id is there it should be update otherwise create\n\t\t\t\t\t\t\tif !entry.save()\n\t\t\t\t\t\t\t\terrorMsg = entry.errors.full_messages.join('\\n')\n\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\tend\t\t\t\t\t\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\trescue Exception => e\n\t\t\t\t\terrorMsg = e.message\n\t\t\t\tend\n\t\t\t\tif errorMsg.nil?\n\t\t\t\t\tflash[:notice] = l(:notice_successful_update)\n\t\t\t\t\tredirect_back_or_default :action => 'index'\n\t\t\t\telse\n\t\t\t\t\tflash[:error] = l(:error_wktime_save_failed, errorMsg)\n\t\t\t\t\trender_edit\n\t\t\t\t\traise ActiveRecord::Rollback\n\t\t\t\tend\n\t\t\tend\n\t\t} \n\t\tformat.api {\n\t\t}\n\tend \n end",
"def update\n authorize! :update, HoursRegistration\n respond_to do |format|\n if @hours_registration.update(hours_registration_params)\n format.html { redirect_to @hours_registration, notice: 'Hours registration was successfully updated.' }\n format.json { render :show, status: :ok, location: @hours_registration }\n else\n format.html { render :edit }\n format.json { render json: @hours_registration.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @station_hour.update(station_hour_params)\n format.html { redirect_to @station_hour, notice: 'Station hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @station_hour }\n else\n format.html { render :edit }\n format.json { render json: @station_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cal_time.update(cal_time_params)\n format.html { redirect_to @cal_time, notice: 'Cal time was successfully updated.' }\n format.json { render :show, status: :ok, location: @cal_time }\n else\n format.html { render :edit }\n format.json { render json: @cal_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @time_punch.update(time_punch_params)\n format.html { redirect_to @time_punch, notice: 'Time punch was successfully updated.' }\n format.json { render :show, status: :ok, location: @time_punch }\n else\n format.html { render :edit }\n format.json { render json: @time_punch.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @working_start_time.update(working_start_time_params)\n format.html { redirect_to @working_start_time, notice: 'Working start time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @working_start_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @place.update(place_params)\n format.html { redirect_to @place, notice: 'Place was successfully updated.' }\n format.json { render :show, status: :ok, location: @place }\n else\n format.html { render :edit }\n format.json { render json: @place.errors, status: :unprocessable_entity }\n end\n end\n @place.cuisine_type_ids = params[:place][:cuisine_type_ids]\n @place.highlight_ids = params[:place][:highlight_ids]\n @place.dining_type_ids = params[:place][:dining_type_ids]\n 7.times { @place.opening_hours.build }\n end",
"def update\n respond_to do |format|\n if @booked_hour.update(booked_hour_params)\n format.html { redirect_to @booked_hour }\n format.json { render :show, status: :ok, location: @booked_hour }\n else\n format.html { render :edit }\n format.json { render json: @booked_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @operation.update(operation_params)\n format.html { redirect_to @operation, notice: 'Operation was successfully updated.' }\n format.json { render :json => @operation.to_json(:include => :task) }\n else\n format.html { render json: @operation.errors, status: :unprocessable_entity }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @work_order_time.update(work_order_time_params)\n format.html { redirect_to @work_order_time, notice: 'Work order time was successfully updated.' }\n format.json { render :show, status: :ok, location: @work_order_time }\n else\n format.html { render :edit }\n format.json { render json: @work_order_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @operation = Operation.find(params[:id])\n\n respond_to do |format|\n if @operation.update_attributes(operation_params)\n format.html { redirect_to @operation, notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thirtyeight.update(thirtyeight_params)\n format.html { redirect_to @thirtyeight, notice: 'Thirtyeight was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thirtyeight.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @offset_time = OffsetTime.find(params[:id])\n\n respond_to do |format|\n if @offset_time.update_attributes(params[:offset_time])\n format.html { redirect_to @offset_time, notice: 'Offset time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @offset_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @one_time_stop = OneTimeStop.find(params[:id])\n\n respond_to do |format|\n if @one_time_stop.update_attributes(params[:one_time_stop])\n format.html { redirect_to @one_time_stop, notice: 'One time stop was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @one_time_stop.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @off_day.update(off_day_params)\n format.html { redirect_to @off_day, notice: 'Off day was successfully updated.' }\n format.json { render :show, status: :ok, location: @off_day }\n else\n format.html { render :edit }\n format.json { render json: @off_day.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @open_now = args[:open_now] if args.key?(:open_now)\n @periods = args[:periods] if args.key?(:periods)\n @secondary_hours_type = args[:secondary_hours_type] if args.key?(:secondary_hours_type)\n @special_days = args[:special_days] if args.key?(:special_days)\n @weekday_descriptions = args[:weekday_descriptions] if args.key?(:weekday_descriptions)\n end",
"def update\n if @can_edit\n\n # Clear out all other blocks\n @timetable.free_times.destroy_all\n times = JSON::Parser.new(params[:times]).parse\n\n # There's an array for each day of the week\n times.each_with_index do |day, i|\n # Each day of the week then has a list of blocks\n day.each_with_index do |block, j|\n unless block.empty?\n # Each block has a start time and an end time for a free block\n @timetable.free_times.create(:start_time => block[0], :end_time => block[1], :day_of_week => i, :weight => block[2], :css_class => block[3])\n end\n end\n end\n\n @person ||= get_person\n @timetable.update_attributes(:updated_by_person_id => @my.id)\n @timetable.touch\n return if @signup\n\n flash[:notice] = I18n.t('timetable.save_confirm')\n\n elsif !@can_edit\n flash[:notice] = I18n.t('timetable.not_allowed_update')\n end\n\n respond_to do |format|\n format.html { redirect_to(person_timetable_path(@timetable.person, @timetable)) }\n format.js\n format.xml { head :ok }\n end\n end",
"def update!(**args)\n @exception = args[:exception] if args.key?(:exception)\n @regular_hours = args[:regular_hours] if args.key?(:regular_hours)\n end",
"def update\n @hour_bank_employee = HourBankEmployee.find(params[:id])\n\n respond_to do |format|\n if @hour_bank_employee.update_attributes(params[:hour_bank_employee])\n format.html { redirect_to employees_path, notice: 'Hour bank employee was successfully updated.' }\n format.json { head :no_content }\n else\n\trender action:\"edit\"\n end\n end\n end",
"def update\n respond_to do |format|\n if @log_hour.update(log_hour_params)\n format.html { redirect_to @log_hour, notice: 'Log hour was successfully updated.' }\n format.json { render :show, status: :ok, location: @log_hour }\n else\n format.html { render :edit }\n format.json { render json: @log_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @getoff_info = GetoffInfo.find(params[:id])\n\n respond_to do |format|\n if @getoff_info.update_attributes(params[:getoff_info])\n format.html { redirect_to @getoff_info, :notice => 'Getoff info was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @getoff_info.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 @downtime.update(downtime_params)\n format.html { redirect_to @downtime, notice: 'Downtime was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @downtime.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hospice.update(hospice_params)\n format.html { redirect_to @hospice, notice: 'Hospice was successfully updated.' }\n format.json { render :show, status: :ok, location: @hospice }\n else\n format.html { render :edit }\n format.json { render json: @hospice.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @operation.update(operation_params)\n format.html { redirect_to admin_operations_path, notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @time_control.update(time_control_params)\n format.html { redirect_to @time_control, notice: 'Time control was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @time_control.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @task.update(task_params)\n @task.whenever_reset unless task_params[:every].blank? && task_params[:at].blank?\n format.html { redirect_to @task, notice: 'Task was successfully updated.' }\n format.json { render :show, status: :ok, location: @task }\n else\n format.html { render :edit }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @supermarket.update(supermarket_params)\n format.html { redirect_to @supermarket, notice: 'Supermarket was successfully updated.' }\n format.json { render :show, status: :ok, location: @supermarket }\n else\n format.html { render :edit }\n format.json { render json: @supermarket.errors, status: :unprocessable_entity }\n end\n end\n @supermarket.supermarket_highlight_ids = params[:supermarket][:supermarket_highlight_ids]\n 7.times { @supermarket.opening_hours.build }\n end",
"def update\n respond_to do |format|\n if @bmet_labor_hour.update(bmet_labor_hour_params)\n format.html { redirect_to @bmet_labor_hour.bmet_work_order, notice: 'Bmet Labor Hour was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bmet_labor_hour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @operation.update(operation_params)\n format.html { redirect_to @operation, notice: 'Operation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @operation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @houmon.update(houmon_params)\n format.html { redirect_to @houmon, notice: 'Houmon was successfully updated.' }\n format.json { render :show, status: :ok, location: @houmon }\n else\n format.html { render :edit }\n format.json { render json: @houmon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @job = @shift.job\n # @employee = @shift.employee\n # time = @shift.time_out || @shift.time_in\n # @shift.week = time.to_datetime\n\n respond_to do |format|\n if @shift.update(shift_params)\n format.html { redirect_to company_shift_path(@shift), notice: 'Shift was successfully updated.' }\n format.json { render :show, status: :ok, location: @shift }\n else\n format.html { render :edit }\n format.json { render json: @shift.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @single_housing.update(single_housing_params)\n format.html { redirect_to @single_housing, notice: 'Single housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @single_housing }\n else\n format.html { render :edit }\n format.json { render json: @single_housing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @housing.update(housing_params)\n format.html {\n redirect_to housings_url, notice: 'Housing was successfully updated.' }\n format.json {\n render json: {}, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @housing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @daily_horoscope = DailyHoroscope.find(params[:id])\n\n respond_to do |format|\n if @daily_horoscope.update_attributes(params[:daily_horoscope])\n format.html { redirect_to @daily_horoscope, notice: 'Daily horoscope was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @daily_horoscope.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hackathon.update(hackathon_params)\n format.html { redirect_to @hackathon, notice: 'Hackathon was successfully updated.' }\n format.json { render :show, status: :ok, location: @hackathon }\n else\n format.html { render :edit }\n format.json { render json: @hackathon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @hackathon.update(hackathon_params)\n format.html { redirect_to @hackathon, notice: 'Hackathon was successfully updated.' }\n format.json { render :show, status: :ok, location: @hackathon }\n else\n format.html { render :edit }\n format.json { render json: @hackathon.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update!(**args)\n @hours_type_id = args[:hours_type_id] if args.key?(:hours_type_id)\n @periods = args[:periods] if args.key?(:periods)\n end",
"def update\n respond_to do |format|\n if @special_holiday.update(special_holiday_params)\n format.html { redirect_to @special_holiday, notice: 'Special holiday was successfully updated.' }\n format.json { render :show, status: :ok, location: @special_holiday }\n else\n format.html { render :edit }\n format.json { render json: @special_holiday.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thirtyone.update(thirtyone_params)\n format.html { redirect_to @thirtyone, notice: 'Thirtyone was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thirtyone.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @office = Office.find(params[:id])\n\n respond_to do |format|\n if @office.update_attributes(params[:office])\n format.html { redirect_to offices_path, notice: 'Office was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @office.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @power_order.update(power_order_params)\n render json: @power_order\n end",
"def update\n\n price_schedule_params[:basis] = price_schedule_params[:basis].to_i\n price_schedule_params[:break_type] = price_schedule_params[:break_type].to_i\n price_schedule_params[:qualifier] = price_schedule_params[:qualifier].to_i\n price_schedule_params[:fee_calculation_type] = price_schedule_params[:fee_calculation_type].to_i\n price_schedule_params[:usual_customary_calculation] = price_schedule_params[:usual_customary_calculation].to_i\n price_schedule_params[:customer_assigned_schedule] = price_schedule_params[:customer_assigned_schedule].to_i\n price_schedule_params[:percentage_fee_type] = price_schedule_params[:percentage_fee_type].to_i\n price_schedule_params[:amount_fee_type] = price_schedule_params[:amount_fee_type].to_i\n\n respond_to do |format|\n if @price_schedule.update(price_schedule_params)\n format.html { redirect_to @price_schedule, notice: 'Price Schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @price_schedule }\n else\n format.html { render :edit }\n format.json { render json: @price_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @housing.update(housing_params)\n format.html { redirect_to @housing, notice: 'Housing was successfully updated.' }\n format.json { render :show, status: :ok, location: @housing }\n else\n format.html { render :edit }\n format.json { render json: @housing.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @operations_check = OperationsCheck.find(params[:id])\n\n respond_to do |format|\n if @operations_check.update_attributes(operations_check_params)\n format.html { redirect_to @operations_check, \n notice: 'Operations check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @operations_check.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @entry = @time_sheet.entries.find(params[:id])\n\n respond_to do |format|\n if @entry.update_attributes(params[:entry])\n format.html { redirect_to [@user, @time_sheet, @entry], notice: 'Hours were successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @entry.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @cooking_time.update(cooking_time_params)\n format.html { redirect_to cooking_times_path, notice: 'Cooking time was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cooking_time.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @order.single?\n if( (Time.now + 1.hour <= Time.parse(@order.place_date + ' ' + @order.timeslot.start)) && (!@order.completed? ) && @order.update(update_order_params) )\n render json: @order, status: 200\n else\n render json: {'errorrs': ['Order can not be updated']}, status: :unprocessable_entity\n end\n else\n if(@order.update(update_order_params))\n render json: @order, status: 200\n else\n render json: {'errorrs': ['Order can not be updated']}, status: :unprocessable_entity\n end\n end\n end"
] |
[
"0.6957177",
"0.6809584",
"0.67332685",
"0.6700032",
"0.66670865",
"0.6665308",
"0.65441567",
"0.65397495",
"0.65312797",
"0.6507327",
"0.64885247",
"0.64714897",
"0.6471246",
"0.64312595",
"0.64300615",
"0.6399684",
"0.6390729",
"0.6374497",
"0.63423795",
"0.6340942",
"0.6237158",
"0.62183684",
"0.62164205",
"0.6206996",
"0.6203837",
"0.616626",
"0.6155643",
"0.6143375",
"0.6121397",
"0.61129886",
"0.60902375",
"0.6083098",
"0.6067256",
"0.6066504",
"0.6063636",
"0.6029772",
"0.60015595",
"0.59923667",
"0.59736395",
"0.5956402",
"0.59555376",
"0.5954572",
"0.59489024",
"0.594665",
"0.5937426",
"0.59358674",
"0.5935763",
"0.59297544",
"0.5928226",
"0.5925198",
"0.59162784",
"0.5913571",
"0.5900643",
"0.5889026",
"0.5861086",
"0.5855832",
"0.58503765",
"0.5840891",
"0.58356744",
"0.58317506",
"0.582375",
"0.5823176",
"0.58077776",
"0.5806633",
"0.5800784",
"0.57974637",
"0.5790387",
"0.5788921",
"0.57813257",
"0.5780822",
"0.57764536",
"0.57764226",
"0.57744825",
"0.57733357",
"0.5763555",
"0.57630557",
"0.575667",
"0.57521504",
"0.57511723",
"0.57446814",
"0.57436556",
"0.5741891",
"0.57384187",
"0.57373166",
"0.57208014",
"0.5719474",
"0.5719082",
"0.5718703",
"0.5718703",
"0.5717202",
"0.57168293",
"0.5713795",
"0.5713534",
"0.5709647",
"0.5708435",
"0.57030225",
"0.56993586",
"0.56967884",
"0.56932205",
"0.5690105"
] |
0.7313313
|
0
|
DELETE /operating_hours/1 DELETE /operating_hours/1.json
|
def destroy
@operating_hour.destroy
respond_to do |format|
format.html { redirect_to operating_hours_url, notice: 'Operating hour was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def delete\n @operation_hour = OperationHour.find(params[:operation_hour_id])\n end",
"def destroy\n @officehour = Officehour.find(params[:id])\n @officehour.destroy\n\n respond_to do |format|\n format.html { redirect_to officehours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estimated_hour.destroy\n respond_to do |format|\n format.html { redirect_to estimated_hours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @open_hour.destroy\n respond_to do |format|\n format.html { redirect_to admin_open_hours_url, notice: 'Open hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hour = Hour.find(params[:id])\n @hour.destroy\n\n respond_to do |format|\n format.html { redirect_to hours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @office_hour_detail.destroy\n respond_to do |format|\n format.html { redirect_to office_hour_details_url, notice: 'Office hour detail was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @officehour.destroy\r\n respond_to do |format|\r\n format.html { redirect_to officehours_url, notice: 'Officehour was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @happy_hour.destroy\n respond_to do |format|\n format.html { redirect_to happy_hours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hour = Hour.find(params[:id])\n @hour.destroy\n render :json=>\"{\\\"success\\\":true}\"\n end",
"def destroy\n @add_hour.destroy\n respond_to do |format|\n format.html { redirect_to add_hours_url, notice: 'Add hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operation_hours = OperationHour.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n @operation_hour = OperationHour.find(params[:id])\n @error = nil\n\n begin\n @operation_hour.destroy\n rescue ActiveRecord::DeleteRestrictionError => e\n @error = e.message\n end\n end",
"def destroy\n @hour.destroy\n respond_to do |format|\n format.html { redirect_to hours_url, notice: 'Hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @business_hour.destroy\n respond_to do |format|\n format.html { redirect_to business_hours_url, notice: 'Business hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vhour = Vhour.find(params[:id])\n @vhour.destroy\n\n respond_to do |format|\n format.html { redirect_to vhours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @last_hour = LastHour.find(params[:id])\n @last_hour.destroy\n\n respond_to do |format|\n format.html { redirect_to(last_hours_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @day_hour.destroy\n respond_to do |format|\n format.html { redirect_to day_hours_url, notice: 'Day hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @user_hour_requirement = UserHourRequirement.find(params[:id])\n @user_hour_requirement.destroy\n\n respond_to do |format|\n format.html { redirect_to user_hour_requirements_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @delivery_hour.destroy\n respond_to do |format|\n format.html { \n flash[:notice] = 'La hora de entrega se eliminó satisfactoriamente.'\n redirect_to delivery_hours_path\n }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daytime = Daytime.find(params[:id])\n @daytime.destroy\n\n respond_to do |format|\n format.html { redirect_to daytimes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hours_record.destroy\n respond_to do |format|\n format.html { redirect_to hours_records_url, notice: 'Hours record was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hour = Hour.find(params[:id])\n @deleted = @hour.destroy\n flash[:error] = t(\"hour.hour_cant_be_destroyed\") if !@deleted\n\n respond_to do |format|\n format.html { redirect_to hours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n self.unuse_pto_hours\n @time_off_instance.destroy\n respond_to do |format|\n format.html { redirect_to time_off_instances_url, notice: 'Time off instance was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_of_day.destroy\n respond_to do |format|\n format.html { redirect_to time_of_days_url, notice: 'Time of day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @location_hour.destroy\n respond_to do |format|\n format.html { redirect_to location_hours_url, notice: 'Location hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_clock.destroy\n respond_to do |format|\n format.html { redirect_to time_sheet_index_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hour_type.destroy\n respond_to do |format|\n format.html { redirect_to hour_types_url, notice: 'Hour type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_section = TimeSection.find(params[:id])\n @time_section.destroy\n\n respond_to do |format|\n format.html { redirect_to time_sections_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @log_hour.destroy\n respond_to do |format|\n format.html { redirect_to log_hours_url, notice: 'Log hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @working_hour.destroy\n respond_to do |format|\n format.html { redirect_to working_hours_url, notice: 'Working hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hurdle_time = HurdleTime.find(params[:id])\n @hurdle_time.destroy\n\n respond_to do |format|\n format.html { redirect_to hurdle_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_period.destroy\n format.json { head :no_content }\n end",
"def destroy\n @service_time = ServiceTime.find(params[:id])\n @service_time.destroy\n\n respond_to do |format|\n format.html { redirect_to service_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @booked_hour.destroy\n respond_to do |format|\n format.html { redirect_to booked_hours_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_off_request = TimeOffRequest.find(params[:id])\n @time_off_request.destroy\n \n respond_to do |format|\n format.html { redirect_to admin_time_off_requests_url}\n format.json { head :ok }\n end\n end",
"def destroy\n @work_hour.destroy\n respond_to do |format|\n format.html { redirect_to work_hours_url, notice: 'Work hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @transport_hour.destroy\n respond_to do |format|\n format.html { redirect_to transport_hours_url, notice: 'Transport hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timetable = Timetable.find(params[:id])\n \n if @timetable != nil\n \n res_day = Day.where(:TIMETABLE_ID => @timetable.ID)\n res_day.each do |day|\n res_hour = Hour.where(:DAY_ID => day.ID)\n res_hour.each do |hour|\n hour.destroy\n end\n day.destroy\n end\n \n @timetable.destroy\n \n end\n \n respond_to do |format|\n format.html { redirect_to timetables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @poi_time.destroy\n respond_to do |format|\n format.html { redirect_to poi_times_url, notice: 'Poi time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @forecast_hour.destroy\n respond_to do |format|\n format.html { redirect_to forecast_hours_url, notice: 'Forecast hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hour_entry = HourEntry.find(params[:id])\n @hour_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to(hour_entry_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @dayoff = Dayoff.find(params[:id])\n @dayoff.destroy\n\n respond_to do |format|\n format.html { redirect_to dayoffs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @working_time = WorkingTime.find(params[:id])\n @working_time.destroy\n\n respond_to do |format|\n format.html { redirect_to time_tables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @workhour.destroy\n respond_to do |format|\n format.html { redirect_to workhours_url, notice: 'Workhour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @station_hour.destroy\n respond_to do |format|\n format.html { redirect_to station_hours_url, notice: 'Station hour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @downtime.destroy\n respond_to do |format|\n format.html { redirect_to downtimes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @off_day.destroy\n respond_to do |format|\n format.html { redirect_to off_days_url, notice: 'Off day was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @order_break_time.destroy\n respond_to do |format|\n format.html { redirect_to order_break_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meeting_time.destroy\n respond_to do |format|\n format.html { redirect_to meeting_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hospitalization_day.destroy\n respond_to do |format|\n format.html { redirect_to hospitalization_days_url, notice: 'Día de estancia eliminado satisfactoriamente.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @worked_hour.destroy\n\n respond_with(@worked_hour)\n end",
"def destroy\n @employee_workinghour.destroy\n respond_to do |format|\n format.html { redirect_to employee_workinghours_url, notice: 'Employee workinghour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cal_time.destroy\n respond_to do |format|\n format.html { redirect_to cal_times_url, notice: 'Cal time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @planned_hour.destroy\n respond_to do |format|\n format.js\n format.html { redirect_to planned_hours_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @elective_day.destroy\n respond_to do |format|\n format.html { redirect_to elective_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n set_user\n @time_off.destroy\n respond_to do |format|\n format.html { redirect_to user_time_offs_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @historial_odt = HistorialOdt.find(params[:id])\n @historial_odt.destroy\n\n respond_to do |format|\n format.html { redirect_to historial_odts_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_horoscope = DailyHoroscope.find(params[:id])\n @daily_horoscope.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_horoscopes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n \t@recurring_available_hour.destroy\n \trespond_to do |format|\n \t\tformat.html { redirect_to instructor_recurring_available_hours_url(@instructor), notice: 'Non recurring hour was successfully destroyed.' }\n \t\tformat.json { head :no_content }\n \tend\n end",
"def destroy\n @daily_exercise = DailyExercise.find(params[:id])\n @daily_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @offset_time = OffsetTime.find(params[:id])\n @offset_time.destroy\n\n respond_to do |format|\n format.html { redirect_to offset_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_gap = TimeGap.find(params[:id])\n @time_gap.destroy\n\n respond_to do |format|\n format.html { redirect_to time_gaps_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @time_entry = TimeEntry.with_deleted.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @staffhour = Staffhour.find(params[:id])\n \n @staffhour.destroy\n respond_to do |format|\n format.html { redirect_to staffhours_url, notice: 'Staffhour was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @section_time.destroy\n respond_to do |format|\n format.html { redirect_to section_times_url, notice: 'Section time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @vacation_hours_event.destroy\n respond_to do |format|\n format.html { redirect_to vacation_hours_events_url, notice: 'Vacation hours event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @punch_clock.destroy\n respond_to do |format|\n format.html { redirect_to punch_clocks_url, notice: t('punch_clocks.deleted_ok') }\n format.json { head :no_content }\n end\n end",
"def destroy\n @theory_day.destroy\n respond_to do |format|\n format.html { redirect_to theory_days_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_entry = TimeEntry.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to time_entries_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @working_start_time.destroy\n respond_to do |format|\n format.html { redirect_to working_start_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_happiness.destroy\n respond_to do |format|\n format.html { redirect_to daily_happinesses_url, notice: 'Daily happiness was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @thirtyeight.destroy\n respond_to do |format|\n format.html { redirect_to thirtyeights_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekday = Weekday.find(params[:id])\n @weekday.destroy\n\n respond_to do |format|\n format.html { redirect_to weekdays_url }\n format.json { head :ok }\n end\n end",
"def deleteEntityOpening_times( entity_id)\n params = Hash.new\n params['entity_id'] = entity_id\n return doCurl(\"delete\",\"/entity/opening_times\",params)\n end",
"def destroy\n @day_timeslot.destroy\n respond_to do |format|\n format.html { redirect_to day_timeslots_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @hospitalization = Hospitalization.find(params[:id])\n @hospitalization.destroy\n\n respond_to do |format|\n format.html { redirect_to client_hospitalizations_url(@client) }\n format.json { head :ok }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @time_table.destroy\n respond_to do |format|\n format.html { redirect_to time_tables_url, notice: 'Time table was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meal_time = MealTime.find(params[:id])\n @meal_time.destroy\n\n respond_to do |format|\n format.html { redirect_to meal_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @unique_whiteline.destroy\n respond_to do |format|\n format.html { redirect_to unique_whitelines_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @energy_datum = EnergyDatum.find(params[:id])\n @energy_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to energy_data_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n if current_user.is_not_member?\n flash[:error] = \"You do not have permissions to access that feature.\"\n redirect_to root_path and return\n end\n \n @repair_hours_entry = RepairHoursEntry.find(params[:id])\n @repair_hours_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to repair_hours_entries_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @heat_type = HeatType.find(params[:id])\n @heat_type.destroy\n\n respond_to do |format|\n format.html { redirect_to heat_types_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @matchday.destroy\n respond_to do |format|\n format.html { redirect_to matchdays_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_line.destroy\n respond_to do |format|\n format.html { redirect_to time_lines_url, notice: 'Time line was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @operations_check = OperationsCheck.find(params[:id])\n @operations_check.destroy\n\n respond_to do |format|\n format.html { redirect_to operations_checks_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @providers_opening_time.destroy\n respond_to do |format|\n format.html { redirect_to providers_opening_times_url, notice: 'Opening time was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_entry.destroy\n respond_to do |format|\n format.html { redirect_to time_entries_url, notice: 'Time entry was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @time_entry = current_firm.all_time_entries.find(params[:id])\n @time_entry.destroy\n\n respond_to do |format|\n format.html { redirect_to params[:ret] || firm_time_entries_path(current_firm) }\n format.json { head :ok }\n end\n end",
"def destroy\n @getoff_info = GetoffInfo.find(params[:id])\n @getoff_info.destroy\n\n respond_to do |format|\n format.html { redirect_to getoff_infos_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @sick_hours_event.destroy\n respond_to do |format|\n format.html { redirect_to sick_hours_events_url, notice: 'Sick hours event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @cooking_time.destroy\n respond_to do |format|\n format.html { redirect_to cooking_times_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timetable = Timetable.find(params[:id])\n @timetable.destroy\n\n respond_to do |format|\n format.html { redirect_to timetables_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @electoral_unit = ElectoralUnit.find(params[:id])\n @electoral_unit.destroy\n\n respond_to do |format|\n format.html { redirect_to electoral_units_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def destroy\n @hogar_temporal.destroy\n respond_to do |format|\n format.html { redirect_to hogar_temporals_url, notice: 'Hogar temporal Eliminado.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @weekly_expectation = WeeklyExpectation.find(params[:id])\n @weekly_expectation.destroy\n\n respond_to do |format|\n format.html { redirect_to weekly_expectations_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @heartbeat = Heartbeat.find(params[:id])\n @heartbeat.destroy\n\n respond_to do |format|\n format.html { redirect_to heartbeats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @timetable_entry.destroy\n respond_to do |format|\n format.html { redirect_to timetable_entries_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.7393105",
"0.73661083",
"0.7305524",
"0.72960526",
"0.71667707",
"0.71382725",
"0.7083069",
"0.70824856",
"0.70786387",
"0.7032269",
"0.6990246",
"0.6966996",
"0.69027466",
"0.6892751",
"0.68895733",
"0.68853384",
"0.6829551",
"0.68104416",
"0.68099415",
"0.6790999",
"0.67793465",
"0.6766113",
"0.6755412",
"0.6749232",
"0.6746895",
"0.67465746",
"0.6723547",
"0.67233866",
"0.67149043",
"0.67096245",
"0.667704",
"0.6673775",
"0.6664342",
"0.66633254",
"0.6637114",
"0.66350144",
"0.66273016",
"0.661047",
"0.6598458",
"0.6591614",
"0.6580917",
"0.65775734",
"0.65711766",
"0.65702146",
"0.65609396",
"0.6559112",
"0.6558975",
"0.6557348",
"0.65492433",
"0.65423733",
"0.65338624",
"0.6521707",
"0.65066195",
"0.6506292",
"0.6505922",
"0.6497181",
"0.6495499",
"0.64902127",
"0.64867306",
"0.6481428",
"0.6479977",
"0.6472739",
"0.64646566",
"0.6460814",
"0.644747",
"0.644559",
"0.64430475",
"0.644085",
"0.644085",
"0.64329803",
"0.642485",
"0.64208853",
"0.64205164",
"0.64202714",
"0.64154667",
"0.6413826",
"0.63932824",
"0.6392512",
"0.6373966",
"0.6372986",
"0.63686466",
"0.6365073",
"0.6352075",
"0.6349706",
"0.6342815",
"0.6337022",
"0.6334287",
"0.6333556",
"0.6333455",
"0.6327309",
"0.63264424",
"0.63231146",
"0.6321605",
"0.63100386",
"0.6309198",
"0.62938637",
"0.62887913",
"0.6284881",
"0.6281009",
"0.6275023"
] |
0.7612083
|
0
|
Use callbacks to share common setup or constraints between actions.
|
def set_operating_hour
@operating_hour = OperatingHour.find(params[:id])
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_required_actions\n # TODO: check what fields change to asign required fields\n end",
"def action_hook; end",
"def run_actions; end",
"def define_action_hook; end",
"def actions; end",
"def define_action_helpers\n if super && action == :save\n @instance_helper_module.class_eval do\n define_method(:valid?) do |*args|\n self.class.state_machines.fire_event_attributes(self, :save, false) { super(*args) }\n end\n end\n end\n end",
"def add_actions; end",
"def callbacks; end",
"def callbacks; end",
"def setup *actions, &proc\n (@setup_procs ||= []) << [proc, actions.size > 0 ? actions : [:*]]\n end",
"def define_action_helpers; end",
"def post_setup\n end",
"def action_methods; end",
"def action_methods; end",
"def action_methods; end",
"def before_setup; end",
"def action_run\n end",
"def execute(setup)\n @action.call(setup)\n end",
"def define_action_helpers?; end",
"def set_actions\n actions :all\n end",
"def action_done(action)\n dispatch = { :migrate => :done_migrating, :map => :done_mapping, :reduce =>\n :done_reducing, :finalize => :done_finalizing } \n self.send dispatch[action[:action]], action\n end",
"def dependencies action, &block\n @actions.each do |other|\n if action[:requires].include? other[:provide]\n block.call other\n end\n end\n end",
"def setup!\n return unless @setup_procs\n http_actions = actions\n @setup_procs.each do |setup_proc|\n proc, actions = setup_proc\n @setup__actions = actions.map do |action|\n\n action.is_a?(Regexp) ?\n http_actions.select { |a| a.to_s =~ action } :\n action.is_a?(String) && action =~ /\\A\\./ ?\n http_actions.map { |a| a.to_s << action if format?(a).include?(action) }.compact :\n action\n\n end.flatten\n self.class_exec &proc\n @setup__actions = nil\n end\n @setup_procs = nil\n end",
"def setup_handler\n end",
"def before_actions(*logic)\n self.before_actions = logic\n end",
"def set_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"def setup(action)\n @targets.clear\n unless action.item.target_filters.empty?\n @targets = SES::TargetManager.make_targets(action)\n else\n item = action.item\n if item.for_opponent?\n @targets = $game_troop.alive_members\n elsif item.for_dead_friend?\n @targets = $game_party.battle_members.select { |actor| actor.dead? }\n else\n $game_party.battle_members.select { |actor| actor.alive? }\n end\n end\n @item_max = @targets.size\n create_contents\n refresh\n show\n activate\n end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def action; end",
"def revisable_shared_setup(args, block)\n class << self\n attr_accessor :revisable_options\n end\n options = args.extract_options!\n self.revisable_options = Options.new(options, &block)\n \n self.send(:include, Common)\n self.send(:extend, Validations) unless self.revisable_options.no_validation_scoping?\n self.send(:include, WithoutScope::QuotedColumnConditions)\n end",
"def workflow\n end",
"def setup\n @action = SampleActionAndroid.new(os_name: 'android',\n app_name: APP_PATH)\n end",
"def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"def process_action(...)\n send_action(...)\n end",
"def before_dispatch(env); end",
"def setup\n # override and do something appropriate\n end",
"def after_actions(*logic)\n self.after_actions = logic\n end",
"def setup(client)\n return unless @setup\n actions = @setup['setup'].select { |action| action['do'] }.map { |action| Action.new(action['do']) }\n actions.each do |action|\n action.execute(client)\n end\n self\n end",
"def setup(_context)\n end",
"def setup(resources) ; end",
"def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end",
"def setup\n @resource_config = {\n :callbacks => {\n :before_create => nil,\n :after_create => nil,\n :before_update => nil,\n :after_update => nil,\n :before_destroy => nil,\n :after_destroy => nil,\n },\n :child_assoc => nil,\n :model => nil,\n :parent => nil,\n :path => nil,\n :permission => {},\n :properties => {},\n :relation => {\n :create => nil,\n :delete => nil,\n },\n :roles => nil,\n }\n end",
"def determine_valid_action\n\n end",
"def 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 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 setup\n #implement in subclass;\n end",
"def after_set_callback; end",
"def lookup_action; end",
"def setup &block\n if block_given?\n @setup = block\n else\n @setup.call\n end\n end",
"def setup_action\n return TSBS.error(@acts[0], 1, @used_sequence) if @acts.size < 2\n actions = TSBS::AnimLoop[@acts[1]]\n if actions.nil?\n show_action_error(@acts[1])\n end\n @sequence_stack.push(@acts[1])\n @used_sequence = @acts[1]\n actions.each do |acts|\n @acts = acts\n execute_sequence\n break if @break_action\n end\n @sequence_stack.pop\n @used_sequence = @sequence_stack[-1]\n end",
"def release_actions; end",
"def setup(easy)\n super\n easy.customrequest = @verb\n end",
"def around_hooks; 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 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 shared_action(name, &block)\n @controller.shared_actions[name] = block\n end",
"def setup_initial_state\n\n state_a = State.new(\"a\", 0)\n state_b = State.new(\"b\", 0)\n state_c = State.new(\"c\", 10)\n\n move_to_b = Action.new(\"move_to_b\", 1, state_b)\n\n move_to_c = Action.new(\"move_to_c\", 1, state_c)\n\n state_a.actions = [move_to_b, move_to_c]\n\n return state_a\n \nend",
"def before_action action, &block\n @audience[:before][action] ||= Set.new\n @audience[:before][action] << block\n end",
"def duas1(action)\n action.call\n action.call\nend"
] |
[
"0.6165152",
"0.60463154",
"0.59467196",
"0.5917112",
"0.5890387",
"0.58345735",
"0.57773316",
"0.56991524",
"0.56991524",
"0.565454",
"0.5622282",
"0.54232633",
"0.54119074",
"0.54119074",
"0.54119074",
"0.53937256",
"0.53801376",
"0.5358599",
"0.53412294",
"0.5340814",
"0.53314966",
"0.53114754",
"0.52984965",
"0.52977055",
"0.5296272",
"0.5260649",
"0.5245076",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.52388334",
"0.5235081",
"0.52321917",
"0.5228592",
"0.5220735",
"0.52198535",
"0.52139324",
"0.5208539",
"0.5206585",
"0.5178542",
"0.5175199",
"0.5173538",
"0.5167041",
"0.51614195",
"0.51577675",
"0.5153909",
"0.51528823",
"0.5152225",
"0.51429904",
"0.5141399",
"0.51345575",
"0.51145",
"0.5114052",
"0.5114052",
"0.5110216",
"0.5108656",
"0.50935394",
"0.5089196",
"0.5081936",
"0.5079627",
"0.50675833",
"0.5056105",
"0.5053687",
"0.5050475",
"0.5050475",
"0.503471",
"0.5028311",
"0.501982",
"0.50157547",
"0.5013552",
"0.50014806",
"0.50011593",
"0.49976763",
"0.4990292",
"0.4990292",
"0.49882022",
"0.4981269",
"0.49792367",
"0.49766538",
"0.4967978",
"0.49667212",
"0.4958987",
"0.49572337",
"0.49550423",
"0.4954479",
"0.4952353",
"0.494726",
"0.4944055",
"0.4935437",
"0.4931248",
"0.49283475",
"0.49281213",
"0.49268973",
"0.4921738",
"0.49204507",
"0.4918924",
"0.49182287",
"0.4916538",
"0.49158585",
"0.49156788"
] |
0.0
|
-1
|
Never trust parameters from the scary internet, only allow the white list through.
|
def operating_hour_params
params.require(:operating_hour).permit(:monday_from, :monday_to, :tuesday_from, :tuesday_to, :wednesday_from, :wednesday_to, :thursday_from, :thursday_to, :friday_from, :friday_to, :sat_from, :sat_to, :sunday_from, :sunday_to, :warehouse_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 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
|
The "window" for this object
|
def gtk_window
@gtk_main_window
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def window\r\n return $window\r\n end",
"def get_window; @window; end",
"def window\n @win\n end",
"def window\n Window\n end",
"def window\n Window_Base.new(0, 0, 0, 0)\n end",
"def window\n @window || create_window\n end",
"def window\n self\n end",
"def element\n window\n end",
"def window\n @window ||= UIWindow.alloc.initWithFrame(UIScreen.mainScreen.bounds)\n end",
"def window\n @session.request(:vim_get_current_window)\n end",
"def win\n @win\n end",
"def window_handle; end",
"def get_window_area()\n get_children_area(\"WINDOW\")\n end",
"def get_window_area()\n get_children_area(\"WINDOW\")\n end",
"def window_handle\n bridge.window_handle\n end",
"def window\n WIN[:find].call 'ConsoleWindowClass', title\n end",
"def window\n WIN[:find].call 'ConsoleWindowClass', title\n end",
"def current_window_builder\n return UI::Window.window_builder(current_windowskin)\n end",
"def current_window_builder\n return UI::Window.window_builder(current_windowskin)\n end",
"def active_window\n current_terminal.current_session\n end",
"def inspect # :nodoc:\n \"<Window: #{title} (#{handle})>\"\n end",
"def panel_window\n Panel.panel_window(pointer)\n end",
"def browser_window\n IITBrowserWindow.new(@ole.BrowserWindow)\n end",
"def active_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_active @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end",
"def panel_window\n FFI::NCurses.panel_window(@pointer)\n end",
"def usable_window\n window = @windows.last\n window if window.loaded?\n end",
"def window_rect\n manage.window.rect\n end",
"def window_rect\n manage.window.rect\n end",
"def window_rect\n manage.window.rect\n end",
"def 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 original_window\n @original_window ||= window\n end",
"def eq_window\n IITWindow.new(@ole.EQWindow)\n end",
"def current_window\n @driver.window_handle\n rescue Selenium::WebDriver::Error::NoSuchWindowError\n nil\n end",
"def windows?; end",
"def get_window_object()\n driver.manage.window\nend",
"def get_window_object()\n driver.manage.window\nend",
"def current_window_builder(skin)\n Window.window_builder(skin)\n end",
"def current_name_window_builder\n return UI::Window.window_builder(current_name_windowskin)\n end",
"def info_window; @info_window; end",
"def gold_window; @gold_window; end",
"def window\n @gtk_socket\n end",
"def window_handle\n driver.window_handle\n end",
"def window_controller\n @window_controller ||= begin\n window_controller = UIWindowController.new\n window_controller.window = UIWindow.alloc.initWithContentRect(\n [[0, 0], [300, 200]],\n styleMask: NSTitledWindowMask | NSClosableWindowMask | NSMiniaturizableWindowMask | NSResizableWindowMask,\n backing: NSBackingStoreBuffered,\n defer: false\n )\n window_controller.window.title = \"Hello World\"\n window_controller\n end\n end",
"def window_width\n return WINDOW_WIDTH\n end",
"def window_width\n return WINDOW_WIDTH\n end",
"def window_width\n return WINDOW_WIDTH\n end",
"def window_width\n return WINDOW_WIDTH\n end",
"def window_width\n return WINDOW_WIDTH\n end",
"def createWindow\r\n \r\n end",
"def url()\r\n @window_url\r\n end",
"def window_size\n manage.window.size\n end",
"def window_size\n manage.window.size\n end",
"def window_size\n manage.window.size\n end",
"def window(id); end",
"def windows\n IITWindowCollection.new(@ole.Windows)\n end",
"def hwnd\n Functions.control_hwnd(@window.hwnd, @locators)\n end",
"def selected_window\n list_windows[@command_window.item]\n end",
"def windows\n @driver.getWindowList.map do |java_window|\n QuickWindow.new(self,java_window)\n end.to_a\n end",
"def focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end",
"def hash\n _window.hash\n end",
"def window_width\n end",
"def real_focused_window\n window_pointer = FFI::MemoryPointer.new :ulong, 1\n XDo::FFILib.xdo_window_sane_get_focus @_pointer, window_pointer\n XDo::Window.new self, window_pointer.read_ulong\n end",
"def get_window_number()\r\n $jssh_socket.send(\"getWindows().length;\\n\", 0)\r\n @@current_window = read_socket().to_i - 1\r\n \r\n # Derek Berner 5/16/08 \r\n # If at any time a non-browser window like the \"Downloads\" window \r\n # pops up, it will become the topmost window, so make sure we \r\n # ignore it.\r\n @@current_window = js_eval(\"getWindows().length\").to_i - 1\r\n while js_eval(\"getWindows()[#{@@current_window}].getBrowser\") == ''\r\n @@current_window -= 1;\r\n end\r\n\r\n # This will store the information about the window.\r\n #@@window_stack.push(@@current_window)\r\n #puts \"here in get_window_number window number is #{@@current_window}\"\r\n return @@current_window\r\n end",
"def window_width\r\n @options[:window_width]\r\n end",
"def window name, cwd, cmd\n tab name, cwd, cmd\n end",
"def window_width\n Graphics.width / 2\n end",
"def window(name, opts)\n clone(:window=>((@opts[:window]||EMPTY_ARRAY) + [[name, SQL::Window.new(opts)].freeze]).freeze)\n end",
"def window_id\n -1\n end",
"def window_id\n -1\n end",
"def main_window\r\n super\r\n # Make help window, status window, and skill window\r\n @help_window = Window_Help.new\r\n @status_window = Window_SkillStatus.new(@actor)\r\n @skill_window = Window_Skill.new(@actor)\r\n # Associate help window\r\n @skill_window.help_window = @help_window\r\n # Make target window (set to invisible / inactive)\r\n @target_window = Window_Target.new\r\n @target_window.visible = false\r\n @target_window.active = false\r\n end",
"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 window name, cwd, cmd\n raise NotImplementedError.new(\n \"window should be implemented to open new window\")\n end",
"def show_window\n end",
"def window_params\n params[:window]\n end",
"def new_window(type); end",
"def setwindow(*)\n super\n end",
"def active_window\n windows = @terminal.windows.get\n windows.detect do |window|\n window.properties_.get[:frontmost] rescue false\n end\n end",
"def active_window\n windows = @terminal.windows.get\n windows.detect do |window|\n window.properties_.get[:frontmost] rescue false\n end\n end",
"def title()\r\n @window_title\r\n end",
"def main_window\r\n super\r\n # Make actor command window\r\n s1 = $data_system.words.attack\r\n s2 = $data_system.words.skill\r\n s3 = $data_system.words.guard\r\n s4 = $data_system.words.item\r\n @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])\r\n @actor_command_window.y = 160\r\n @actor_command_window.back_opacity = 160\r\n @actor_command_window.active = false\r\n @actor_command_window.visible = false\r\n # Make other windows\r\n @party_command_window = Window_PartyCommand.new\r\n @help_window = Window_Help.new\r\n @help_window.back_opacity = 160\r\n @help_window.visible = false\r\n @status_window = Window_BattleStatus.new\r\n @message_window = Window_Message.new\r\n end",
"def window\n\n\t#TODO Make this more robust to handle multiple configuration files\n\tunless ARGV[1].nil?\n\t\t@this_window ||= AnalysisWindowImport.new(config: ARGV[1]) #Pass the configuration in\n\telse\n\t\traise ArgumentError.new(\"A valid configuration file must be defined\")\n\tend\n\n\treturn @this_window\nend",
"def get_window_count\n return @browser.windows.count\n end",
"def window(name)\n Tk.execute_only(:tkwait, :window, name)\n end",
"def active_quick_window_id\n driver.getActiveQuickWindowID()\n end",
"def windows(window = nil)\n @windows ||= []\n if window\n @windows << window\n @windows.uniq!\n end\n @windows\n end",
"def window=(win)\n @window = win\n @snippet_loader.current_snippets.each do |snippet|\n snippet.window = win \n end\n @manipulators.each { |man| man.window = win }\n end",
"def main_window\r\n super\r\n # Make status window\r\n @status_window = Window_Status.new(@actor)\r\n end",
"def document_window(name)\n Window.new {\n title \"Document: \" + name\n\t\t\n text = TextArea.new {\n ...\n }\n }\nend",
"def get_status_window\n return @status_window if @status_window.is_a?(Window_BattleStatus)\n return nil\n end",
"def info_window=(window); @info_window = window; end",
"def local_window_size; end",
"def main_window\r\n super\r\n # Make help window, item window\r\n @help_window = Window_Help.new\r\n @item_window = Window_Item.new\r\n # Associate help window\r\n @item_window.help_window = @help_window\r\n # Make target window (set to invisible / inactive)\r\n @target_window = Window_Target.new\r\n @target_window.visible = false\r\n @target_window.active = false\r\n end",
"def window(name_or_handle)\n logger.info 'EyesTargetLocator.window()'\n logger.info 'Making preparaions...'\n on_will_switch.will_switch_to_window name_or_handle\n logger.info 'Done! Switching to window..'\n __getobj__.window name_or_handle\n logger.info 'Done!'\n driver\n end",
"def window_width() Graphics.width - 128 end",
"def window_by_id(id)\n @windows.ID(id)\n end",
"def window_by_id(id)\n @windows.ID(id)\n end",
"def window_by_id(id)\n @windows.ID(id)\n end",
"def main_window ; end"
] |
[
"0.87045443",
"0.85526675",
"0.83218944",
"0.83094686",
"0.8062539",
"0.79717994",
"0.7877534",
"0.76322734",
"0.7568737",
"0.73934984",
"0.73577327",
"0.72826767",
"0.72357786",
"0.72145176",
"0.71585894",
"0.71442235",
"0.71442235",
"0.7065718",
"0.7065718",
"0.7063512",
"0.7035394",
"0.70230085",
"0.6861733",
"0.6827171",
"0.6733084",
"0.67311573",
"0.67289764",
"0.67289764",
"0.67289764",
"0.67146534",
"0.67146534",
"0.67146534",
"0.6692709",
"0.66657895",
"0.66212267",
"0.66098773",
"0.6562869",
"0.6533529",
"0.6527697",
"0.65199125",
"0.6493415",
"0.6483937",
"0.64799124",
"0.64776415",
"0.6455415",
"0.6420324",
"0.6420324",
"0.6420324",
"0.6420324",
"0.6420324",
"0.6401822",
"0.63823444",
"0.6347391",
"0.6347391",
"0.6347391",
"0.6340727",
"0.6329251",
"0.62903935",
"0.6272106",
"0.62719655",
"0.6261369",
"0.6247288",
"0.62068826",
"0.6189292",
"0.6180882",
"0.61800545",
"0.6166763",
"0.6141461",
"0.61347735",
"0.61271185",
"0.61271185",
"0.6123986",
"0.6120006",
"0.6115979",
"0.60844165",
"0.6068998",
"0.60608673",
"0.6028043",
"0.6020949",
"0.6020949",
"0.6020032",
"0.60089433",
"0.60078865",
"0.60049427",
"0.6003344",
"0.59939116",
"0.5967153",
"0.59664834",
"0.59663635",
"0.59642524",
"0.5956764",
"0.5956304",
"0.5954761",
"0.5938425",
"0.5926591",
"0.5914318",
"0.5912327",
"0.5912327",
"0.5912327",
"0.5909519"
] |
0.645807
|
44
|
Show the window and start the main loop. Also starts the window given in parameters. (Used for VimWindow)
|
def start(start_window)
gtk_window.show_all
start_window.start
Gtk.main_with_queue
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def start!\n @window = Window.new width, height, fullscreen?\n window.caption = name\n window.scene = Scenes.generate(first_scene)\n window.show\n end",
"def start\n display = Swt::Widgets::Display.get_current\n \n # until the window (the Shell) has been closed\n while !@shell.isDisposed\n # check for and dispatch new gui events\n display.sleep unless display.read_and_dispatch\n end\n display.dispose\n end",
"def start\n display = Swt::Widgets::Display.get_current\n \n # until the window (the Shell) has been closed\n while !@shell.isDisposed\n \n # check for and dispatch new gui events\n display.sleep unless display.read_and_dispatch\n end\n\n display.dispose\n end",
"def start\n display = Swt::Widgets::Display.get_current\n \n # until the window (the Shell) has been closed\n while !@shell.isDisposed\n \n # check for and dispatch new gui events\n display.sleep unless display.read_and_dispatch\n end\n\n display.dispose\n end",
"def start\n display = ::Swt::Widgets::Display.get_current\n \n # until the window (the Shell) has been closed\n while !@shell.isDisposed\n # check for and dispatch new gui events\n display.sleep unless display.read_and_dispatch\n end\n \n display.dispose\n end",
"def start\n display = Swt::Widgets::Display.get_current\n while !@shell.isDisposed\n display.sleep unless display.read_and_dispatch\n end\n\n display.dispose\n end",
"def start(options={})\n in_xterm_state(options) do\n initialize_screen\n yield self\n event_loop\n end\n end",
"def start() @root.mainloop end",
"def start\n restart\n update\n Tk.mainloop\n end",
"def main\n\t\tstart\n\t\twhile self == SceneManager.scene\n\t\t\tGraphics.update\n\t\t\tController.keyboard.update\n\t\t\tupdate\n\t\t\tController.wait_next_frame\n\t\tend\n\t\tterminate\n\tend",
"def show_window\n end",
"def Main\n #Begin preinitialization\n preInit()\n\n #Render Game Window and begin drawing onto the screen.\n\n DEBUG.cout(\"Initializing Game Window...\", 0, false)\n window = GameWindow.new\n window.show\n\n #End game and return to desktop\n return nil\nend",
"def start\n @window = Window.new(slide_deck)\n @window.show\n end",
"def show\n @showing = true\n window.show\n end",
"def run\n Gtk.main\n end",
"def startGame\n\tif !$running\n\t\t$gui.hide_info()\n\t\t$gui.hide_scored()\n\t\t$p1.reset_position()\n\t\t$p2.reset_position()\n\t\t$ball.reset_position()\n\t\t$ball.start()\n\t\t$running = true\n\tend\nend",
"def open_window(options = nil)\n window = terminal.make( :new => :terminal )\n window.launch_ :session => 'New session'\n end",
"def start!(scene)\n raise \"The game has already started.\" if showing?\n\n Gamework::ENV ||= 'development'\n make_logger(@log_file)\n @logger.info 'Starting the game'\n\n make_window\n add_scene(scene)\n show\n end",
"def game_start\n game_setup\n @console_delegate.show\n end",
"def main_window ; end",
"def start\n main_loop\n end",
"def main_window\r\n super\r\n # Make command window\r\n s1 = \"New Game\"\r\n s2 = \"Continue\"\r\n s3 = \"Shutdown\"\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.back_opacity = 160\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 288\r\n # If continue is enabled, move cursor to \"Continue\"\r\n # If disabled, display \"Continue\" text in gray\r\n if @continue_enabled\r\n @command_window.index = 1\r\n else\r\n @command_window.disable_item(1)\r\n end\r\n end",
"def run\n Curses.init_screen\n\n init_style\n\n Curses.noecho\n Curses.curs_set 0 # invisible\n\n @message = RDoc::RI::Browser::Message.new\n\n @display = RDoc::RI::Browser::Display.new self\n @display.show HELP, nil, false\n\n trap_resume do\n event_loop\n end\n end",
"def show_window\n\t\tif self.visible?\n\t\t\tself.bring_to_front\n\t\telse\n\t\t\t# We use set_file here to prevent Macs loading the whole dialog when the\n\t\t\t# plugin loads. No need to populate the dialog and use extra resources\n\t\t\t# if it will never be used.\n\t\t\tfilepath = File.join(PATH, 'webdialog/ui_manager.html')\n\t\t\tself.set_file(filepath)\n\t\t\tif PLUGIN.is_mac?\n\t\t\t\tself.show_modal\n\t\t\telse\n\t\t\t\tself.show\n\t\t\tend\n\t\tend\n\tend",
"def show_window\r\n if visible?\r\n bring_to_front()\r\n else\r\n show_modal()\r\n end\r\n end",
"def open\n @is_running = true\n run_interpreter\n end",
"def run\n quit_on_delete!\n Gtk.main\n end",
"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 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 main_window\r\n super\r\n # Make command window\r\n s1 = SDK::Scene_Commands::Scene_Title::New_Game\r\n s2 = SDK::Scene_Commands::Scene_Title::Continue\r\n s3 = SDK::Scene_Commands::Scene_Title::Shutdown\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.back_opacity = 160\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 288\r\n # If continue is enabled, move cursor to \"Continue\"\r\n # If disabled, display \"Continue\" text in gray\r\n if @continue_enabled\r\n @command_window.index = 1\r\n else\r\n @command_window.disable_item(1)\r\n end\r\n end",
"def main_window\r\n super\r\n # Make windows\r\n @left_window = Window_DebugLeft.new\r\n @right_window = Window_DebugRight.new\r\n @help_window = Window_Base.new(192, 352, 448, 128)\r\n @help_window.contents = Bitmap.new(406, 96)\r\n # Restore previously selected item\r\n @left_window.top_row = $game_temp.debug_top_row\r\n @left_window.index = $game_temp.debug_index\r\n @right_window.mode = @left_window.mode\r\n @right_window.top_id = @left_window.top_id\r\n end",
"def withcurses\n begin \n self.start\n yield\n ensure\n close_screen\n end\n end",
"def run\r\n # Evaluate any launch params\r\n if ARGV.any?\r\n # Set data text to params joined by spaces\r\n @data_edit.set_text(ARGV.join ' ')\r\n end\r\n # Show main widget and execute application\r\n @main_widget.show\r\n self.exec\r\n end",
"def start\n return if @vim_started\n return unless @gtk_socket\n @vim_started = true\n listen\n fork do\n #exec %Q[#{Executable} --servername #{@vim_server_name} --socketid #{@gtk_socket.id} -nb:localhost:#{port}:#{Password} -S #{extras_source_path}]\n exec %Q[#{Executable} --servername #{@vim_server_name} --socketid #{@gtk_socket.id} -S #{extras_source_path}]\n end\n self\n end",
"def run\r\n @log.debug \"Run the tester...\"\r\n @dlg_box = CupSingleGameWin.new(@options)\r\n @dlg_box.create\r\n end",
"def main_window\r\n super\r\n # Make actor command window\r\n s1 = $data_system.words.attack\r\n s2 = $data_system.words.skill\r\n s3 = $data_system.words.guard\r\n s4 = $data_system.words.item\r\n @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])\r\n @actor_command_window.y = 160\r\n @actor_command_window.back_opacity = 160\r\n @actor_command_window.active = false\r\n @actor_command_window.visible = false\r\n # Make other windows\r\n @party_command_window = Window_PartyCommand.new\r\n @help_window = Window_Help.new\r\n @help_window.back_opacity = 160\r\n @help_window.visible = false\r\n @status_window = Window_BattleStatus.new\r\n @message_window = Window_Message.new\r\n end",
"def start_game\n @new_prompt.title_screen\n @new_commands.create_new_board(5)\n select_mode\n end",
"def start\n begin\n Ui.print_formatted WELCOME_MESSAGE\n loop do\n choice = UserInputHandler.request_input @options_msg.join(\"\\n\")\n execute_choice(choice)\n end\n rescue StandardError => e\n handle_error(e)\n end\n end",
"def open\n init_screen\n init_colors\n init_keys\n\n curs_set 0 # hide the cursor\n cbreak # turn off line buffering\n\n yield\n\n close\n end",
"def create\r\n super # Create the windows\r\n show(PLACEMENT_SCREEN) # Make the main window appear\r\n end",
"def main_loop(fps = 60)\n self.fps = fps\n @ran_main_loop_p = true\n init_sync\n drive_mainloop do\n poll_event\n if block_given?\n screen.fill_rect(0, 0, screen.w, screen.h, background_color) if background_color\n yield(screen)\n end\n sync\n screen.flip\n end\n end",
"def main_window\r\n super\r\n # Make command window\r\n s1 = \"To Title\"\r\n s2 = \"Shutdown\"\r\n s3 = \"Cancel\"\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 240 - @command_window.height / 2\r\n end",
"def run!\n @queue = []\n queue do\n @controller = Controller.new\n end\n catch :exit do\n while true\n tick\n FFI::NCurses.refresh\n end\n end\n rescue Exception => e\n Logger.log(e.message)\n Logger.log(e.backtrace.join(\"\\n\"))\n FFI::NCurses.clear\n FFI::NCurses.endwin\n raise\n end",
"def open_window(options = nil)\n terminal_process.keystroke(\"n\", :using => :command_down)\n # Options of the first tab must be set before window options, \n # because change of the first tab options causes change of window size\n if options \n set_options(return_last_tab, allowed_options(:tab, options))\n set_options(active_window, allowed_options(:window, options))\n end\n return_last_tab\n end",
"def run_gui\n require 'ps2/gui'\n \n GUI.run\n end",
"def run\n start_key = self.display_instructions\n exit if start_key.downcase == \"q\"\n self.play_round until @board.won? || @board.lost?\n @board.lost? ? self.display_loss : self.display_win\n end",
"def go()\n\n if block_given? then\n\n @window.activate(); sleep 1; yield(self); carriage_return()\n\n end\n\n end",
"def window name, cwd, cmd\n raise NotImplementedError.new(\n \"window should be implemented to open new window\")\n end",
"def StartScreen(start)\n puts ' __ ______ _____________________ __ ________ ______ '.center(CONSOLE_WIDTH)\n puts ' / |/ / | / ___/_ __/ ____/ __ \\/ |/ / _/ | / / __ \\ '.center(CONSOLE_WIDTH)\n puts ' / /|_/ / /| | \\__ \\ / / / __/ / /_/ / /|_/ // // |/ / / / /'.center(CONSOLE_WIDTH)\n puts ' / / / / ___ |___/ // / / /___/ _, _/ / / // // /| / /_/ / '.center(CONSOLE_WIDTH)\n puts '/_/ /_/_/ |_/____//_/ /_____/_/ |_/_/ /_/___/_/ |_/_____/ '.center(CONSOLE_WIDTH)\n if start\n puts \"├─────────────────────────────┤\".center(CONSOLE_WIDTH)\n puts \"│ ENTER to start │\".center(CONSOLE_WIDTH)\n puts \"└─────────────────────────────┘\".center(CONSOLE_WIDTH)\n print \"\".center(CONSOLE_WIDTH / 2)\n STDIN.getc\n system \"clear\" or system \"cls\" # Clears the terminal screen so it doesn't look cluttered\n else\n puts \"├─────┬─────┬─────┬─────┬─────┤\".center(CONSOLE_WIDTH)\n end\nend",
"def start()\r\n\t\t\t@output.puts(\"Welcome to Mastermind!\")\r\n\t\t\t@output.puts(\"Created by: #{created_by} (#{student_id})\")\r\n\t\t\t@output.puts(\"Starting game...\")\r\n\t\t\t@output.puts('Enter \"1\" to run the game in the command-line window or \"2\" to run it in a web browser')\r\n\t\tend",
"def run\n greet_screen\n exit_screen\n end",
"def start\n init_screen\n crmode\n setpos 0,0\n \n ## Start main loop of GOL update pieces, clear the board, replace new board, and sleep\n while true\n updateboard\n clear\n addstr(outboard)\n refresh\n sleep(0.25)\n break if @exit\n end\n end",
"def show_windows\n end",
"def start\n logfile.say(\"Starting #{name}\")\n\n if @@system.windows\n # Windows\n say \"Starting [[#{cmd}]] in window\"\n @cmd = \"start cmd /C #{cmd}\"\n run(true)\n else\n say \"Starting [[#{name}]] in background, output to #{logfile}\"\n pid = fork { run(true) }\n PidFile.new(name, @logdir).pid = pid\n ::Process.detach(pid)\n end\n end",
"def main_window\r\n super\r\n # Make help window\r\n @help_window = Window_Help.new\r\n # Make command window\r\n @command_window = Window_ShopCommand.new\r\n # Make gold window\r\n @gold_window = Window_Gold.new\r\n @gold_window.x = 480\r\n @gold_window.y = 64\r\n # Make dummy window\r\n @dummy_window = Window_Base.new(0, 128, 640, 352)\r\n # Make buy window\r\n @buy_window = Window_ShopBuy.new($game_temp.shop_goods)\r\n @buy_window.active = false\r\n @buy_window.visible = false\r\n @buy_window.help_window = @help_window\r\n # Make sell window\r\n @sell_window = Window_ShopSell.new\r\n @sell_window.active = false\r\n @sell_window.visible = false\r\n @sell_window.help_window = @help_window\r\n # Make quantity input window\r\n @number_window = Window_ShopNumber.new\r\n @number_window.active = false\r\n @number_window.visible = false\r\n # Make status window\r\n @status_window = Window_ShopStatus.new\r\n @status_window.visible = false\r\n end",
"def main_window\r\n super\r\n # Make actor command window\r\n s1 = SDK::Scene_Commands::Scene_Battle::Attack\r\n s2 = SDK::Scene_Commands::Scene_Battle::Skill\r\n s3 = SDK::Scene_Commands::Scene_Battle::Guard\r\n s4 = SDK::Scene_Commands::Scene_Battle::Item\r\n @actor_command_window = Window_Command.new(160, [s1, s2, s3, s4])\r\n @actor_command_window.y = 160\r\n @actor_command_window.back_opacity = 160\r\n @actor_command_window.active = false\r\n @actor_command_window.visible = false\r\n # Make other windows\r\n @party_command_window = Window_PartyCommand.new\r\n @help_window = Window_Help.new\r\n @help_window.back_opacity = 160\r\n @help_window.visible = false\r\n @status_window = Window_BattleStatus.new\r\n @message_window = Window_Message.new\r\n end",
"def start\n register unless registered?\n \n VirtualBox.run_command! ['VBoxManage', '--nologo', 'startvm', uid,\n '--type', gui ? 'gui' : 'headless']\n self\n end",
"def main_window\r\n super\r\n # Make command window\r\n s1 = SDK::Scene_Commands::Scene_End::To_Title\r\n s2 = SDK::Scene_Commands::Scene_End::Shutdown\r\n s3 = SDK::Scene_Commands::Scene_End::Cancel\r\n @command_window = Window_Command.new(192, [s1, s2, s3])\r\n @command_window.x = 320 - @command_window.width / 2\r\n @command_window.y = 240 - @command_window.height / 2\r\n end",
"def run_commands(window_type, &block)\n window_types = {:new => '(make new terminal)', :current => 'current terminal'}\n raise ArgumentError, \"ItermWindow#run_commands should be passed :new or :current.\" unless window_types.keys.include? window_type\n output \"tell application 'iTerm'\"\n output \"activate\"\n output \"set myterm to #{window_types[window_type]}\"\n output \"tell myterm\"\n self.instance_eval(&block) if block_given?\n output \"end tell\"\n output \"end tell\"\n end",
"def open_start\r\n\r\n @simulator = WIN32OLE.new('AutoItX3.Control')\r\n\r\n Dir.chdir(@sim_gui_path)\r\n Dir.pwd\r\n \r\n @simulator.Run(\"V4SingleSimulatorGUI.exe\")\r\n @simulator.WinWaitActive(\"Emerson (Copyright 2012)\")\r\n @simulator.ControlClick(\"Emerson (Copyright 2012)\",\"Remote Control on Port:\",\"WindowsForms10.BUTTON.app.0.bb8560_r15_ad11\")\r\n @simulator.Send(\"{F1}\")\r\n @simulator.WinWaitActive(\"Open\")\r\n @simulator.ControlSetText(\"Open\", \"\",\"Edit1\",@sim_path)\r\n @simulator.ControlClick(\"Open\",\"&Open\",\"Button1\")\r\n @simulator.WinWaitActive(\"SelectIPAddress\")\r\n @simulator.ControlClick(\"SelectIPAddress\",\"Select\",\"WindowsForms10.BUTTON.app.0.bb8560_r15_ad12\")\r\n \r\n #Start simulator\r\n @simulator.Send(\"{F5}\")\r\n\r\n end",
"def start\n loop do\n run\n end\n end",
"def initialize(param = {})\n super(param) ;\n\n @drawMutex = Mutex::new() ;\n @drawMutex.synchronize(){\n setupWindow(param) ;\n @exitWhenQuit = true ;\n }\n\n end",
"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 run\n send Rainbow('Running cpgui...').aqua\n @run = true\n input while @run\n end",
"def start\n @old_display = ENV['DISPLAY']\n ENV['DISPLAY'] = \":#{display}\"\n end",
"def start\n super\n create_menu_background()\n if MENU_CONFIG::IMAGE_BG != \"\"\n @bg = Sprite.new\n @bg.bitmap = Cache.picture(MENU_CONFIG::IMAGE_BG)\n @bg.opacity = MENU_CONFIG::IMAGE_BG_OPACITY\n end\n \n @title_window = Window_Outline_Title.new(0, 0, 640, 56)\n @content_window = Window_Outline.new(0, 56, 640, 424)\n \n # Create Window \n @list_window = Window_Outline_List.new(0, 0, 400, 400, Vocab::tutorials_strings)\n width_remain = (640 - @list_window.width)/2\n @list_window.x = width_remain.floor\n height_remain = (480 - @list_window.height)/2\n @list_window.y = height_remain.floor\n end",
"def main_window\r\n super\r\n # Make windows\r\n @help_window = Window_Help.new\r\n @left_window = Window_EquipLeft.new(@actor)\r\n @right_window = Window_EquipRight.new(@actor)\r\n @item_window1 = Window_EquipItem.new(@actor, 0)\r\n @item_window2 = Window_EquipItem.new(@actor, 1)\r\n @item_window3 = Window_EquipItem.new(@actor, 2)\r\n @item_window4 = Window_EquipItem.new(@actor, 3)\r\n @item_window5 = Window_EquipItem.new(@actor, 4)\r\n # Associate help window\r\n @right_window.help_window = @help_window\r\n @item_window1.help_window = @help_window\r\n @item_window2.help_window = @help_window\r\n @item_window3.help_window = @help_window\r\n @item_window4.help_window = @help_window\r\n @item_window5.help_window = @help_window\r\n # Set cursor position\r\n @right_window.index = @equip_index\r\n refresh\r\n end",
"def start\n greeting\n console_search\n goodbye\n end",
"def start\n Vedeu.trigger(:_drb_start_)\n\n Vedeu::Terminal.open do\n Vedeu::Terminal.set_cursor_mode\n\n Vedeu.trigger(:_initialize_)\n\n runner { main_sequence }\n end\n end",
"def initialize name = 'CamStudio - Custom Build'\n sleep 0.2 while (@h_cam = @@find_window.call nil, name ) <= 0\n set_window_pos\n\n # TODO: raise exception if can not find\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 init_window\n self.z = 10_000\n lock\n @name_window.visible = false\n @name_window.lock\n @name_text.text = ''\n update_windowskin\n init_pause_coordinates\n self.pauseskin = RPG::Cache.windowskin(PauseSkin)\n self.back_opacity = ($game_system.message_frame == 0 ? 255 : 0)\n unlock\n @name_window.unlock\n end",
"def helloWindows\n puts \"Hello\"\n sleep(0.5)\n puts \"Axel is gone\"\n sleep(1)\n puts \"It's just you and me\"\n sleep(1)\n puts \"Shall we start the real tutorial now?\"\n sleep(1)\n end",
"def start\n ucommand(:start)\n end",
"def initialize(window = Curses::stdscr)\n Curses::cbreak #Capture raw keys, but pass control keys to system\n Curses::noecho #Don't echo key presses\n\n @window = window\n @window.keypad(true) #Enable arrow keys and enter, etc.\n @cursor = Cursor.new\n start_new_game\n end",
"def setwindow(*)\n super\n end",
"def run\n greet\n menu\n end",
"def main_window\r\n super\r\n # Make help window, status window, and skill window\r\n @help_window = Window_Help.new\r\n @status_window = Window_SkillStatus.new(@actor)\r\n @skill_window = Window_Skill.new(@actor)\r\n # Associate help window\r\n @skill_window.help_window = @help_window\r\n # Make target window (set to invisible / inactive)\r\n @target_window = Window_Target.new\r\n @target_window.visible = false\r\n @target_window.active = false\r\n end",
"def createWindow\n windowMask = NSTitledWindowMask |\n NSClosableWindowMask |\n NSMiniaturizableWindowMask |\n NSResizableWindowMask\n self.window = NSWindow.alloc\n .initWithContentRect( WINDOW_RECT,\n styleMask: windowMask,\n backing: NSBackingStoreBuffered,\n defer: true)\n self.window.contentMinSize = WINDOW_MIN_SIZE\n self.window.preventsApplicationTerminationWhenModal = false\n self.window.allowsConcurrentViewDrawing = true\n self.window.hasShadow = true\n end",
"def start\n DataManager.create_game_objects\n $game_party.setup_starting_members\n $game_map.setup(Config::Starting_Map_ID)\n $game_player.moveto(Config::X_Pos, Config::Y_Pos)\n $game_player.followers.visible = false\n $game_player.refresh\n $game_player.make_encounter_count\n\n @character_name = $game_player.character_name\n @character_index = $game_player.character_index\n $game_player.set_graphic('', 0)\n\n $game_system.menu_disabled = true\n Graphics.frame_count = 0\n\n super\n create_foreground\n create_background\n create_command_window\n play_title_music\n end",
"def start\n return if initialized\n puts copyright\n argv = ARGV\n ARGV.clear\n IRB.start\n ARGV.replace(argv)\n end",
"def start_repl\n @in_repl = true\n @help[:exit] = 'exit this utility'\n version\n print 'tanuki>'\n begin\n print \"\\ntanuki>\" while gets && execute(split_args($_))\n rescue Interrupt\n puts \"\\nBye bye!\"\n end\n end",
"def main_window\r\n super\r\n # Make windows\r\n @edit_window = Window_NameEdit.new(@actor, $game_temp.name_max_char)\r\n @input_window = Window_NameInput.new\r\n end",
"def start_mastermind_prompt\n sleep 0.5\n\n line\n tab_title; puts create_title(\"MAIN MENU\") << \"\\n\"\n puts_tabbed(\"txt/menu.txt\", 12)\n tab(12); \" >> \".typing\n gets.chomp.downcase\n end",
"def run &block\n begin\n\n # check if user has passed window coord in config, else root window\n @window = Canis::Window.root_window\n awin = @window\n catch(:close) do\n @form = Form.new @window\n #@form.bind_key(KEY_F1, 'help'){ display_app_help } # NOT REQUIRED NOW 2012-01-7 since form does it\n @form.bind_key([?q,?q], 'quit' ){ throw :close } if $log.debug?\n\n #@message = Variable.new\n #@message.value = \"\"\n $status_message ||= Variable.new # remember there are multiple levels of apps\n $status_message.value = \"\"\n #$error_message.update_command { @message.set_value($error_message.value) }\n if block\n begin\n yield_or_eval &block if block_given? \n # how the hell does a user trap exception if the loop is hidden from him ? FIXME\n loop\n rescue => ex\n $log.debug( \"APP.rb rescue reached \")\n $log.debug( ex) if ex\n $log.debug(ex.backtrace.join(\"\\n\")) if ex\n ensure\n close\n # putting it here allows it to be printed on screen, otherwise it was not showing at all.\n if ex\n puts \"========== EXCEPTION ==========\"\n p ex \n puts \"===============================\"\n puts(ex.backtrace.join(\"\\n\")) \n end\n end\n nil\n else\n #@close_on_terminate = true\n self\n end #if block\n end # :close\n end\n end",
"def setup_gui\n \n end",
"def initialize\n # Get game window title from Game.ini\n ini = Win32API.new('kernel32', 'GetPrivateProfileString','PPPPLP', 'L')\n @title = \"\\0\" * 256\n ini.call('Game', 'Title', '', @title, 256, '.\\\\Game.ini')\n @title.delete!(\"\\0\")\n # Set game window to an instance variable, using the title we found.\n @main = Win32API.new('user32', 'FindWindowA', 'PP', 'L').call('RGSS Player', @title)\n # Set variables to call for creating showing, and destroying the window.\n @create_window = Win32API.new('user32','CreateWindowEx','lpplllllllll','l')\n @show_window = Win32API.new('user32','ShowWindow',%w(l l),'l')\n @destroy_window = Win32API.new('user32','DestroyWindow','p','l')\n # Set variables to get the window size, position, text, etc, etc.\n @window_text = Win32API.new('user32','GetWindowText',%w(n p n ),'l') \n @metrics = Win32API.new('user32', 'GetSystemMetrics', 'I', 'I')\n @set_window_pos = Win32API.new('user32', 'SetWindowPos', 'LLIIIII', 'I')\n @window_rect = Win32API.new('user32','GetWindowRect',%w(l p),'i')\n # Define the coordinates to display the window.\n @x = (@metrics.call(0) - 576) / 2\n @y = (@metrics.call(1) - 22) / 2 \n # Updates the client area of the window.\n @update_window = Win32API.new('user32','UpdateWindow','p','i') \n # Set a button that will register when button is pressed.\n @input = Win32API.new('user32','GetAsyncKeyState','i','i')\n end",
"def run\n Signal.trap('EXIT') do\n reset_terminal\n exit\n end\n Signal.trap('WINCH') do\n screen_settings\n redraw\n place_cursor\n end\n\n setup_terminal\n config_read\n parse_ls_colors\n set_bookmark '0'\n\n redraw true\n place_cursor\n\n # do we need this, have they changed after redraw XXX\n @patt = nil\n @sta = 0\n\n # forever loop that prints dir and takes a key\n loop do\n key = get_char\n\n unless resolve_key key # key did not map to file name, so don't redraw\n place_cursor\n next\n end\n\n break if @quitting\n\n next if only_cursor_moved?\n\n next unless @redraw_required # no change, or ignored key\n\n redraw rescan?\n place_cursor\n\n end\n write_curdir\n puts 'bye'\n config_write if @writing\n @log&.close\nend",
"def interactive_generator\n webGui = WebGui.new(\"\")\n webGui.start\nend",
"def start\n puts \"Press Ctrl-C to close.\"\n @server.start\n end",
"def launch!\n introduction\n # action loop\n result = nil\n until result == :quit do\n action, args = get_action\n result = do_action(action, args)\n end\n conclusion\n end",
"def start\n Signal.trap('INT') do # SIGINT = control-C\n game.stop!\n end\n\n <<-HINT.strip_heredoc.freeze\n Play the game with <QPlayer>. Lean back and watch the algorithm to learn playing the game.\n Quit game: [ctrl]+[c]\n HINT\n end",
"def start\n @start.call\n @on_start.each(&:call)\n @on_start.clear\n io_initialize\n frame_reset\n @no_mouse = (PSDK_CONFIG.mouse_disabled && !PARGV[:tags])\n init_sprite\n end",
"def new_game\n # Start again!\n puts \"\\n\\n\"\n\t\n\t# Clears output from last game\n Gem.win_platform? ? (system \"cls\") : (system \"clear\")\n \n puts \"Beginning new game:\"\n puts \"\"\n start\nend",
"def window(name)\n Tk.execute_only(:tkwait, :window, name)\n end",
"def start\n if options.master?\n start_master(options)\n elsif options.slave?\n start_slave(options)\n else\n invoke :help, [:start]\n end\n end",
"def start\n puts \"Welcome! Let's play Tic-Tac-Toe\"\n print_board\n play\n end",
"def set_windows\n set_title \"R-Bloggyn::#{@usuario.alias}\" #nombre de la ventana\n set_default_size 640, 480 #tamaño de la ventana\n set_skip_taskbar_hint true\n set_window_position Gtk::Window::POS_CENTER #posicion de la ventana\n self.set_attributes\n add @hbox\n show_all #muestra todo\n end",
"def run\n @main_frame.destroy\n @main_frame = TkFrame.new(@root).pack('padx'=>10, 'pady'=>10)\n self.make_header\n self.make_footer\n self.make_hand\n self.make_discards\n Thread.new{Tk.mainloop()}\n end",
"def run\n @music.play(:repeats => -1)\n\thook_run()\n\thook_quit()\n\t# Handling input\n\tloop do\n\t @queue.each do |event|\n\t\thandle(event)\n end\n\t# Draw the image to screen\n\t@intro_screen.blit(@screen,[0,0])\n\t@screen.flip()\n end\n end"
] |
[
"0.7169551",
"0.70637137",
"0.7041796",
"0.7041715",
"0.70123523",
"0.65191764",
"0.63550496",
"0.6334149",
"0.6309114",
"0.6265318",
"0.62008744",
"0.61828953",
"0.6163721",
"0.6139799",
"0.61134076",
"0.6090274",
"0.60805815",
"0.605429",
"0.60373545",
"0.6036179",
"0.5993326",
"0.5966891",
"0.5935583",
"0.59174615",
"0.58857507",
"0.5873153",
"0.58612156",
"0.5854886",
"0.57926416",
"0.5775753",
"0.5771325",
"0.576332",
"0.5727378",
"0.5710488",
"0.5703281",
"0.56562907",
"0.5646937",
"0.5630504",
"0.5624522",
"0.5615406",
"0.5595603",
"0.55926174",
"0.5584798",
"0.5577718",
"0.55768275",
"0.55416894",
"0.554061",
"0.5534817",
"0.5510052",
"0.5504426",
"0.55015785",
"0.5493171",
"0.54842347",
"0.54816437",
"0.5481347",
"0.5478258",
"0.5472603",
"0.5463951",
"0.5455516",
"0.5451819",
"0.54307187",
"0.5429652",
"0.5425242",
"0.5417261",
"0.5411524",
"0.5409934",
"0.5403517",
"0.5394723",
"0.53784883",
"0.5373515",
"0.5363763",
"0.5359001",
"0.5344526",
"0.5327466",
"0.531056",
"0.52958465",
"0.52859664",
"0.5258024",
"0.52563137",
"0.52521443",
"0.52501774",
"0.52483475",
"0.52465993",
"0.52375895",
"0.5234068",
"0.52281034",
"0.5220337",
"0.52177423",
"0.5217137",
"0.52145976",
"0.52120745",
"0.52048534",
"0.5203023",
"0.52029634",
"0.51976836",
"0.51967806",
"0.5196413",
"0.51918507",
"0.5188141",
"0.51856077"
] |
0.73490226
|
0
|
Takes a number and checks to see if it is in any of the ranges given
|
def in_ranges?(num, ranges)
result = false
ranges.each do |range|
if range.include?(num)
result = true
end
end
return result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def all_in_ranges?(nums, ranges)\n if nums.empty?\n return false\n end\n nums.each do |num|\n if !in_ranges?(num, ranges)\n return false\n end\n end\n true\nend",
"def included?(range, number)\n if range.exclude_end?\n number >= range.begin && number < range.end\n else\n number >= range.begin && number <= range.end\n end\nend",
"def ranges_include?(value)\n any? { |range| Array(range).include?(value) }\n end",
"def in_range(a, b, c)\n return ((a >= 1 && a <= 10) || (b >= 1 && b <= 10) || (c >= 1 && c <= 10));\t\nend",
"def check_range(a,b)\n if (20..30).include?(a)\n puts \"a is in the range (20..30).\"\n else\n puts \"a is not in the range (20..30).\"\n end\n if (20..30).include?(b)\n puts \"b is in the range (20..30).\"\n else\n puts \"b is not in the range (20..30).\"\n end\nend",
"def check_num(number)\n if (1..10).include? number\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend",
"def in_range?( val )\n val = val.to_i\n (@above.nil? or val > @above) and\n (@below.nil? or val < @below) and\n (@valid_range.nil? or @valid_range.include?(val))\n end",
"def in_range?( val )\n val = val.to_i\n (@above.nil? or val > @above) and\n (@below.nil? or val < @below) and\n (@valid_range.nil? or @valid_range.include?(val))\n end",
"def valid_range?\n (0..@max_num).cover?(@number)\n end",
"def in_range(a, b)\n return ((a >= 20 && a <= 30) || (b >= 20 && b <= 30));\t\nend",
"def within?(val, lower, upper)\n check_pre((\n (val.int?) and\n (lower.int?) and\n (upper.int?)\n ))\n\n ((val >= lower) and (val <= upper))\nend",
"def integer?(range: (1..))\n proc do |o|\n o.is_a? String and o.is_i? and range.include?(o.to_i)\n end\n end",
"def in_range(num)\n (0..PINS) === num\n end",
"def valid?(range)\n range[0] < range[1]\nend",
"def between?(num, x, y)\n\nend",
"def within?(in_val, in_lower, in_upper)\n\tcheck_pre(((in_val.int?) and (in_lower.int?) and (in_upper.int?)))\n\t(in_lower..in_upper) === in_val\nend",
"def limitcheck(num, lower, upper)\n (num >= lower and num <= upper) && num\n end",
"def limitcheck(num, lower, upper)\n (num >= lower and num <= upper) && num\n end",
"def in_range\n\t\trange = Set[1, 2, 3, 4, 5,\n\t\t\t\t\t\t\t\t6, 7, 8, 9, 10,\n\t\t\t\t\t\t\t 11, 12, 13, 14, 15,\n\t\t\t\t\t\t\t\t16, 17, 18, 19, 20,\n\t\t\t\t\t\t\t\t21, 22, 23, 24, 25,\n\t\t\t\t\t\t\t\t26, 27, 28, 29, 30]\n\n\t\tif @landmarks.subset?(range)\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\tend",
"def is_a_3_dot_range?(range)\n a = range.first\n b = range.last\n range != (a..b)\nend",
"def validate_range(address_arr)\n address_arr.all? do |number|\n number.to_i <= 255 && number.to_i >= 0\n end\nend",
"def validate_range(address_arr)\n address_arr.all? do |number|\n number.to_i <= 255 && number.to_i >= 0\n end\nend",
"def in_range (n)\n\tif n <1 || n> 10 \n\t\tfalse\n\telse\n\t\ttrue\n\tend\nend",
"def within_range(coordinates)\r\n return true if coordinates[0].between?(0, 7) && coordinates[1].between?(0, 7)\r\n return false\r\n end",
"def within?(val,lower,upper)\n\n check_pre((\n (val.nat?) and\n (lower.nat?) and\n (upper.nat?)\n ))\n\n (val >= lower) and (val <= upper)\n\n end",
"def between?(x,y) end",
"def in_range?(val, range)\n return true unless range\n\n if range.is_a?(Hash)\n result = true\n result &= ( val < range[:before] ) if range[:before]\n result &= ( val > range[:after] ) if range[:after]\n result &= ( val <= range[:max] ) if range[:max]\n result &= ( val >= range[:min] ) if range[:min]\n result &= ( val < range[:less_than] ) if range[:less_than]\n result &= ( val <= range[:less_than_or_equal_to] ) if range[:less_than_or_equal_to]\n result &= ( val > range[:greater_than] ) if range[:greater_than]\n result &= ( val >= range[:greater_than_or_equal_to] ) if range[:greater_than_or_equal_to]\n result\n else\n range = [range] unless range.respond_to?(:include?)\n range.include?(val)\n end\n end",
"def verify_range(value)\n a = (20...30) === value\n if a != true\n puts \"#{value} is not in range of 20 to 30\"\n else\n puts \"#{value} is in range of to 20 to 30\"\n end\nend",
"def in_ranged_array?(ranged_ary, num)\n !!ranged_ary.find {|n| n === num }\n end",
"def in_range?\n return self.range.include?([@x, @y])\n end",
"def check_range(a)\n answer = case \n when (0 < a) && (a<= 50)\n \"Number is between 0 to 50\"\n when (51 < a) && (a <= 100)\n \"Number is between 51 to 100\"\n when (100 < a )\n \"Number is above 100\" \n else\n \"invalid\" \n end\n answer\nend",
"def between(numb, lower, higher)\n return true if numb >= lower && numb <= higher\n return false\nend",
"def between(num, min, max)\n if min <= num && max >= num\n return true\n else \n return false\n end\nend",
"def between?(p0, p1) end",
"def in_range?\n self > LOWER_BOUND && self <= UPPER_BOUND\n end",
"def check_include(value)\n (1..10).include?(value)\nend",
"def is_within(number, lower, upper)\n RangeAssertion.new(number, lower, upper)\n end",
"def number_value_checker(number)\n if number >= 1 && number <= 10\n puts true\n else\n puts false\n end\nend",
"def between(num1, num2, num3)\n if num1 >= num2 && num1 <= num3\n return true\n else\n return false\n end\nend",
"def between(num1, num2, num3)\n if num1 >= num2 && num1 <= num3\n return true\n else\n return false\n end\nend",
"def test_bounds(val, min, max)\n val >= min && val <= max\n end",
"def between(num1,num2,num3)\n return num1 <= num2 && num2 <= num3\nend",
"def within?(value)\n value >= @lower and value <= @upper\n end",
"def between(n1, n2, n3)\n if n1 >= n2 && n1 <= n3\n return true\n else\n return false\n end\nend",
"def inclusive(num)\n if num >= 1 && num <= 10\n \"#{num} is between 1 & 10\"\n else\n \"#{num} in invalid\"\n end\nend",
"def not_within_hypothetical_range?(dest)\n\t(dest[0] < 0 || dest[1] < 0) || (dest[0] > 7 || dest[1] > 7)\nend",
"def check_range(name, range, value, unit = '')\n grace = (-0.00001..0.00001)\n str = value.to_s\n value = value.value if value.is_a?(Sass::Script::Value::Number)\n return value if range.include?(value)\n return range.first if grace.include?(value - range.first)\n return range.last if grace.include?(value - range.last)\n raise ArgumentError.new(\n \"#{name} #{str} must be between #{range.first}#{unit} and #{range.last}#{unit}\")\n end",
"def between(num1, num2, num3)\n if num2 <= num1 && num1 <= num3\n return true\n elsif num2 >= num1 && num1 >= num3\n return true\n end\n return false\nend",
"def check(range, value)\n result = true\n unless range.nil?\n if range.class == Range\n result = (range === value)\n elsif range.class == Fixnum\n result = (value >= range)\n end\n end\n result\n end",
"def between(num1, num2, num3)\n if num1 >= num2 && num1 <= num3\n return true\n elsif num1 <= num2 && num1 >= num3\n return true\n end\n return false\nend",
"def available_on_board?(num)\n if num.between?(0, 8) == true #if the number is between\n return true\n else\n return false\n end\nend",
"def check\n if @number >= @lower && @number <= @upper\n @message = \"Number '#{@number}' is within range '#{@lower}-#{@upper}'.\"\n true\n else\n @message = \"Number '#{@number}' is not within range '#{@lower}-#{@upper}'.\"\n false\n end\n end",
"def check_bounds(value)\n return value >= self.bound.lower_bound && value <= self.bound.upper_bound\n end",
"def between(min, max, &block)\n return false unless (1..min).all? { try(&block) }\n (min..max).all? { try(&block) } # only using all?'s shortcut property\n true\n end",
"def check_number(num)\n if num < 0 || num > 100\n puts \"Your number has to be between 0 and 100\"\n elsif num <= 50\n puts \"#{num} is between 0 and 50\"\n elsif num <= 100\n puts \"#{num} is beween 51 and 100\"\n end\nend",
"def out_of_bound?(value, min, max)\n return value > max || value < min\n end",
"def number_in_range(num)\n if num < 0\n puts \"Number is negative!\"\n elsif num > 100\n puts \"Number is greater than 100\"\n else\n case num\n when 0..50\n puts \"number is between 0 and 50\"\n else\n puts \"number is between 51 and 100\"\n end\n end\nend",
"def check_number(number)\n #Evaluates number given and returns string\n case number\n when 0..50\n \"Your number is between 0-50\"\n when 51..100\n \"Your number is between 51-100\"\n else\n \"Your number is above 100\"\n end\nend",
"def between(number1,number2,number3)\n output = false\n if number1 < number3 && number2 < number1\n output = true\n end\n return output\nend",
"def number_check2(number)\n case number\n when 0..50\n puts \"#{number} is between 0 and 50\"\n when 51..100\n puts \"#{number} is between 51 and 100\"\n else\n if number < 0\n puts \"Number must be greater than zero.\"\n else number > 100\n puts \"#{number} is greater than 100\"\n end\n end\nend",
"def check_range(x, lo=0.0, hi=1.0)\n raise ArgumentError.new(\"x cannot be nil\") if x.nil?\n if x < lo or x > hi\n raise ArgumentError.new(\"x must be greater than lo (#{lo}) and less than hi (#{hi})\") \n end\n end",
"def check_valid_num(index)\n (0..8).any?(index)\nend",
"def valid?(value)\n return value >= 0 && value <= 19\n end",
"def is_a_3_dot_range?(range)\n\trange.exclude_end?\nend",
"def range1d?(o)\n o.int_range?\nend",
"def range_includes_item?(range, item)\n range.begin <= item && item <= range.end\n end",
"def numrange(num)\n if num < 0\n puts \"Your number is negative\"\n elsif num <51\n puts \"Your number is between 0 and 50 inclusive\"\n elsif num <101\n puts \"Your number is between 51 and 100 inclusive\"\n else\n puts \"Your number is greater than 100\"\n end\nend",
"def valid_number?(str, min, max)\n num = str.to_i\n (num.to_s == str && num.between?(min, max))\nend",
"def between?(min, max)\n #This is a stub, used for indexing\n end",
"def is_a_3_dot_range?(range)\n range.exclude_end?\nend",
"def check_range(x, y)\n !(x < 1 || y < 1 || x > width || y > height)\n end",
"def number_range(number)\n if number.to_i.to_s == number \n puts \"Here we go.\" \n else \n puts \"This is not a number, good bye!\"\n return\n end \n\n case \n when number.to_i > 100\n puts \"The number is greater than 100\"\n when number.to_i >= 51 && number.to_i <= 100\n puts \"The number is between 51 and 100\"\n when number.to_i >= 0 && number.to_i <= 50\n puts \"The number is between 0 and 50\"\n else\n puts \"Negative number\"\n end\nend",
"def is_between_strict(num,first,second)\n if num > first && num < second || num < first && num > second\n return true\n end\n return false\nend",
"def range_include?(ranges, addr)\n\t\t\tranges.each do |range|\n\t\t\t\treturn true if range.include? addr\n\t\t\tend\n\t\t\tfalse\n\t\tend",
"def include?(i)\n @range.include?(i)\n end",
"def in? a, b, c\r\n a[0]>=b[0] && a[1]>=b[1] && a[0]<=c[0] && a[1]<=c[1]\r\n end",
"def is_effective?(value)\n @range_lower <= value && value <= @range_upper\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\ncount = 0\nrange_array = *(lower_bound..upper_bound)\nlist_of_integers.each do |i|\nif range_array.include?(i) == true\ncount += 1\nend\nend\nreturn count\nend",
"def between_100(number)\n if number >= 0 && number <= 50\n puts \"#{number} is between 0 and 50\"\n\n elsif number > 50 && number < 101\n puts \"#{number} is between 51 and 100\"\n\n else\n puts \"#{number} is not from 0 to 100.\"\n end\nend",
"def _bit_in_range?(bits, max, min)\n upper = bits.position + bits.size - 1\n lower = bits.position\n !((lower > max) || (upper < min))\n end",
"def between_strict(num1, num2, num3)\n if num1 > num2 and num1 < num3\n return true\n end\n return false\nend",
"def checkcondition(min, max, num)\n if(min<=num and max >= num)\n return true\n else\n return false\n end\n end",
"def number_range(num)\n if num < 0\n puts \"Please enter a positive number only\"\n elsif num <= 50\n puts \"Range 0 - 50\"\n elsif num <= 100\n puts \"Range 51 - 100\"\n else\n puts \"Above 100\"\n end\nend",
"def range_include?(zelf, other)\n # 1...10 includes 1..9 but it does not include 1..10.\n operator = zelf.exclude_end? && !other.exclude_end? ? :< : :<=\n zelf.include?(other.first) && other.last.send(operator, zelf.last)\nend",
"def include?(addr)\n\t\treturn false if not @ranges\n\t\tif (addr.is_a? String)\n\t\t\taddr = Rex::Socket.addr_atoi(addr)\n\t\tend\n\t\t@ranges.map { |r| \n\t\t\tif r.start <= addr and addr <= r.stop\n\t\t\t\treturn true\n\t\t\tend\n\t\t}\n\t\treturn false\n\tend",
"def prime_range(lower_bound, higher_bound)\n Prime.each(higher_bound).select {|prime| prime >= lower_bound}\nend",
"def in_move_range?(v)\n (20..500).include? v\n end",
"def boundaries(x, y)\n return false if x > 7 || x < 0 || y > 7 || y < 0\n return true\n\n end",
"def overlaps?(range)\n !(completely_left_of?(range) || completely_right_of?(range))\n end",
"def number_range2 (number)\n\t \tcase number\n\t\twhen 0..50\n\t\tputs \"your number is between 0 and 50\"\n\t\twhen 51..100\n\t\tputs \"your number is between 51 and 100\"\n\t\telse\n\t\t\tif number < 0\n\t\t\t\tputs \"can't enter a negative number\"\n\t\t\telsif number > 100\n\t\t\t\tputs \"over 100\"\n\t\t\tend\n\t\tend\n\tend",
"def between?(value, min = nil, max = nil)\n if min and value < min\n return false\n elsif max and value > max\n return false\n end\n return true\n end",
"def numEvaluator(number_in)\n if (number_in >= 0) && (number_in <= 50)\n puts 'between 0 and 50'\n elsif (number_in >= 51) && (number_in <= 100)\n puts 'between 51 and 100'\n elsif (number_in >= 101) \n puts '>100'\n else\n puts '<0'\n end\n end",
"def number_check(number)\n if number < 0\n puts \"Your number is less than 0\"\n elsif number <= 50\n puts \"Your number is between 0 and 50\"\n elsif number <= 100\n puts \"Your number is between 50 and 100\"\n else\n puts \"Your number is greater than 100\"\n end\nend",
"def number_range(num)\n case \n when num < 0\n puts \"ERROR: You cannot enter a negative number\"\n when number <= 50\n puts \"#{num} is between 0 and 50\"\n when number <= 100\n puts \"#{num} is between 51 and 100\"\n else\n puts \"#{num} is above 100\"\n end\nend",
"def include?(value)\n candidate = intervals\n .find { |min, max| max >= value }\n candidate && (candidate[0] <= value)\n end",
"def in_range?(key)\n (key>=range_start) && (range_end==LAST_POSSIBLE_KEY || key < range_end)\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\n\treturn 0 if list_of_integers.length == 0 || upper_bound<lower_bound\n\trange = (lower_bound..upper_bound).to_a\n\tlist_of_integers.count {|v| (lower_bound..upper_bound).include? (v)}\n\n # Your code goes here!\nend",
"def meets?(*args)\n other = coerce_range(*args)\n self.begin == other.end or other.begin == self.end\n end",
"def out_of_range?(v)\n v < 1 || v > 12\n end",
"def is_winner_on_range?(range)\n return false unless range.uniq.size == 1 && !range.first.nil?\n\n @winner = range.first\n return true\n end"
] |
[
"0.77839947",
"0.77281946",
"0.7620122",
"0.75642455",
"0.75542367",
"0.7548862",
"0.7440546",
"0.7440546",
"0.7386601",
"0.73120075",
"0.7290764",
"0.7260176",
"0.7239734",
"0.7208907",
"0.7207142",
"0.71877927",
"0.7149205",
"0.7149205",
"0.71406585",
"0.7124057",
"0.71207136",
"0.71207136",
"0.7119783",
"0.71173495",
"0.7085007",
"0.70754904",
"0.70440376",
"0.7034894",
"0.7017088",
"0.7016305",
"0.7003288",
"0.6975051",
"0.69727767",
"0.6939632",
"0.69287574",
"0.6895497",
"0.6867589",
"0.68657106",
"0.6839973",
"0.6839973",
"0.6835846",
"0.68137485",
"0.6808662",
"0.67888176",
"0.6765892",
"0.676466",
"0.6731824",
"0.6727531",
"0.6720696",
"0.6715651",
"0.6682544",
"0.66610396",
"0.6658371",
"0.6625468",
"0.66155636",
"0.65880704",
"0.6578909",
"0.6578073",
"0.6568458",
"0.65613043",
"0.6558169",
"0.6540634",
"0.65334654",
"0.65268046",
"0.651639",
"0.65141785",
"0.65093195",
"0.6487601",
"0.6472557",
"0.6471739",
"0.6465455",
"0.6451876",
"0.64512247",
"0.6433023",
"0.64322364",
"0.6430476",
"0.6424651",
"0.6403966",
"0.64032996",
"0.6402619",
"0.6396365",
"0.63950676",
"0.6382626",
"0.63777345",
"0.637699",
"0.63732195",
"0.6360221",
"0.63566643",
"0.63564885",
"0.6347764",
"0.6341079",
"0.63409156",
"0.6338781",
"0.6333107",
"0.6326635",
"0.6323011",
"0.6318864",
"0.6309844",
"0.63039917",
"0.6301358"
] |
0.85276127
|
0
|
Checks to see if every num in nums is in the ranges given
|
def all_in_ranges?(nums, ranges)
if nums.empty?
return false
end
nums.each do |num|
if !in_ranges?(num, ranges)
return false
end
end
true
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def in_ranges?(num, ranges)\n result = false\n ranges.each do |range|\n if range.include?(num)\n result = true\n end\n end\n return result\nend",
"def in_ranged_array?(ranged_ary, num)\n !!ranged_ary.find {|n| n === num }\n end",
"def OverlappingRanges(arr)\n first_num = arr[0]\n second_num = arr[1]\n third_num = arr[2]\n forth_num = arr[3]\n first_arr = (first_num..second_num).to_a\n second_arr = (third_num..forth_num).to_a\n merged_array = first_arr.concat(second_arr)\n (merged_array.size - merged_array.uniq.size == arr[4]) ? true : false\nend",
"def included?(range, number)\n if range.exclude_end?\n number >= range.begin && number < range.end\n else\n number >= range.begin && number <= range.end\n end\nend",
"def is_a_3_dot_range?(range)\n a = range.first\n b = range.last\n range != (a..b)\nend",
"def OverlappingRanges(arr)\n ((arr[0]..arr[1]).to_a & (arr[2]..arr[3]).to_a).size >= arr[4]\nend",
"def check_non_overlapping?(indexes, range)\n return true if indexes.empty?\n\n indexes.each do |val|\n return false if val.cover?(range.begin) || val.cover?(range.end)\n end\n true\n end",
"def OverlappingRanges(arr)\n intersection = (arr[0]..arr[1]).to_a & (arr[2]..arr[3]).to_a\n intersection.size >= arr[4] ? 'true' : 'false'\nend",
"def valid?(range)\n range[0] < range[1]\nend",
"def ranges_include?(value)\n any? { |range| Array(range).include?(value) }\n end",
"def in_range\n\t\trange = Set[1, 2, 3, 4, 5,\n\t\t\t\t\t\t\t\t6, 7, 8, 9, 10,\n\t\t\t\t\t\t\t 11, 12, 13, 14, 15,\n\t\t\t\t\t\t\t\t16, 17, 18, 19, 20,\n\t\t\t\t\t\t\t\t21, 22, 23, 24, 25,\n\t\t\t\t\t\t\t\t26, 27, 28, 29, 30]\n\n\t\tif @landmarks.subset?(range)\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\tend",
"def check_range(a,b)\n if (20..30).include?(a)\n puts \"a is in the range (20..30).\"\n else\n puts \"a is not in the range (20..30).\"\n end\n if (20..30).include?(b)\n puts \"b is in the range (20..30).\"\n else\n puts \"b is not in the range (20..30).\"\n end\nend",
"def split_array(nums)\n n = nums.size\n return false if n < 7\n sum = nums.inject([]) { |a, n| a << (a[-1]||0)+n } << 0\n range_sum = ->(i, j) { sum[j] - sum[i-1] }\n (3..n-4).each do |j|\n st = Set.new\n (1..j-2).each do |i|\n st << range_sum[0, i-1] if range_sum[0, i-1] == range_sum[i+1, j-1]\n end\n (j+2..n-2).each do |k|\n return true if range_sum[k+1, n-1] == range_sum[j+1, k-1] &&\n st.include?(range_sum[j+1, k-1])\n end\n end\n false\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\ncount = 0\nrange_array = *(lower_bound..upper_bound)\nlist_of_integers.each do |i|\nif range_array.include?(i) == true\ncount += 1\nend\nend\nreturn count\nend",
"def find_range(arr,low,high)\n arr.find_all{|item| item >=low && item <= high}.length\nend",
"def range_include?(ranges, addr)\n\t\t\tranges.each do |range|\n\t\t\t\treturn true if range.include? addr\n\t\t\tend\n\t\t\tfalse\n\t\tend",
"def expand_ranges(nums)\n values = []\n nums = nums.split(\",\").each {|x| x.strip!}\n nums.each do |range|\n if range.match(/-/)\n range = range.split(\"-\")\n (range[0].to_i..range[1].to_i).each {|num| values.push(num)}\n else\n values.push(range.to_i)\n end\n end\n return values.uniq\n end",
"def within_range(coordinates)\r\n return true if coordinates[0].between?(0, 7) && coordinates[1].between?(0, 7)\r\n return false\r\n end",
"def within?(in_val, in_lower, in_upper)\n\tcheck_pre(((in_val.int?) and (in_lower.int?) and (in_upper.int?)))\n\t(in_lower..in_upper) === in_val\nend",
"def validate_range(address_arr)\n address_arr.all? do |number|\n number.to_i <= 255 && number.to_i >= 0\n end\nend",
"def validate_range(address_arr)\n address_arr.all? do |number|\n number.to_i <= 255 && number.to_i >= 0\n end\nend",
"def in_range?\n return self.range.include?([@x, @y])\n end",
"def in_range(a, b, c)\n return ((a >= 1 && a <= 10) || (b >= 1 && b <= 10) || (c >= 1 && c <= 10));\t\nend",
"def in_range(num)\n (0..PINS) === num\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\n\treturn 0 if list_of_integers.length == 0 || upper_bound<lower_bound\n\trange = (lower_bound..upper_bound).to_a\n\tlist_of_integers.count {|v| (lower_bound..upper_bound).include? (v)}\n\n # Your code goes here!\nend",
"def in_range(a, b)\n return ((a >= 20 && a <= 30) || (b >= 20 && b <= 30));\t\nend",
"def search_range(nums, target)\n range_helper(nums, target, 0, nums.length)\nend",
"def valid_range?\n (0..@max_num).cover?(@number)\n end",
"def overlaps?(range)\n !(completely_left_of?(range) || completely_right_of?(range))\n end",
"def in? a, b, c\r\n a[0]>=b[0] && a[1]>=b[1] && a[0]<=c[0] && a[1]<=c[1]\r\n end",
"def meets?(*args)\n other = coerce_range(*args)\n self.begin == other.end or other.begin == self.end\n end",
"def range_includes_item?(range, item)\n range.begin <= item && item <= range.end\n end",
"def range_intersect?(s1, s2)\n s1range = s1.to_a.min..s1.to_a.max\n s2range = s2.to_a.min..s2.to_a.max\n return s1range.include?(s2range.first) || s2range.include?(s1range.first)\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\nin_bounds = []\n\n list_of_integers.each do |num|\n if num >= lower_bound && num <= upper_bound\n in_bounds << num\n else\n \"out of bounds\"\n end\n end\n\n p in_bounds.length\n\nend",
"def covers?(*args)\n other = coerce_range(*args)\n\n if other.instant?\n self.begin <= other.begin and other.end < self.end\n else\n self.begin <= other.begin and other.end <= self.end\n end\n end",
"def solve(nums)\n arr = nums.map {|num| num * num}\n arr.each_with_index do |el1, idx1|\n arr.each_with_index do |el2, idx2|\n if idx2 > idx1\n if arr.include?(el1 + el2)\n if (arr.index(el1 + el2) != idx1) && (arr.index(el1 + el2) != idx2)\n return true\n end\n end\n end\n end\n end\n false\nend",
"def is_a_3_dot_range?(range)\n\trange.exclude_end?\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\n\treturn list_of_integers.count {|x| x >= lower_bound && x <= upper_bound}\nend",
"def within?(val, lower, upper)\n check_pre((\n (val.int?) and\n (lower.int?) and\n (upper.int?)\n ))\n\n ((val >= lower) and (val <= upper))\nend",
"def in_range?( val )\n val = val.to_i\n (@above.nil? or val > @above) and\n (@below.nil? or val < @below) and\n (@valid_range.nil? or @valid_range.include?(val))\n end",
"def in_range?( val )\n val = val.to_i\n (@above.nil? or val > @above) and\n (@below.nil? or val < @below) and\n (@valid_range.nil? or @valid_range.include?(val))\n end",
"def nums(target, *array)\n\tarray.each_with_index do |a, x|\n\t\tarray.each_with_index do |b, y|\n\t\t\tif x > y\n\t\t\t\tif a + b == target\n\t\t\t\t\treturn true\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\n\treturn false\nend",
"def in_range?(val, range)\n return true unless range\n\n if range.is_a?(Hash)\n result = true\n result &= ( val < range[:before] ) if range[:before]\n result &= ( val > range[:after] ) if range[:after]\n result &= ( val <= range[:max] ) if range[:max]\n result &= ( val >= range[:min] ) if range[:min]\n result &= ( val < range[:less_than] ) if range[:less_than]\n result &= ( val <= range[:less_than_or_equal_to] ) if range[:less_than_or_equal_to]\n result &= ( val > range[:greater_than] ) if range[:greater_than]\n result &= ( val >= range[:greater_than_or_equal_to] ) if range[:greater_than_or_equal_to]\n result\n else\n range = [range] unless range.respond_to?(:include?)\n range.include?(val)\n end\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\n count = 0\n list_of_integers.each do |int|\n if (lower_bound..upper_bound).include? int\n count = count + 1\n end\n end\n return count\nend",
"def range_cover?(outer, inner)\n outer.cover?(inner.begin) && outer.cover?(inner.end)\nend",
"def between(num, min, max)\n if min <= num && max >= num\n return true\n else \n return false\n end\nend",
"def _index_in_range?(i, max, min)\n !((i > max) || (i < min))\n end",
"def in_spec?(num)\n Utils.in_ranged_array?(spec, num)\n end",
"def between(num1, num2, num3)\n if num2 <= num1 && num1 <= num3\n return true\n elsif num2 >= num1 && num1 >= num3\n return true\n end\n return false\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\n list_of_integers.count {|x| x>= lower_bound && x <= upper_bound}\nend",
"def within?(val,lower,upper)\n\n check_pre((\n (val.nat?) and\n (lower.nat?) and\n (upper.nat?)\n ))\n\n (val >= lower) and (val <= upper)\n\n end",
"def between(num1,num2,num3)\n return num1 <= num2 && num2 <= num3\nend",
"def verify_range(value)\n a = (20...30) === value\n if a != true\n puts \"#{value} is not in range of 20 to 30\"\n else\n puts \"#{value} is in range of to 20 to 30\"\n end\nend",
"def check_num(number)\n if (1..10).include? number\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\n if list_of_integers.nil?\n return 0\n end\n list_of_integers.count do |integer|\n (lower_bound..upper_bound).include?(integer)\n end\nend",
"def test_ranges\r\n assert_equal(@range.begin.to_f, @p2.to_f)\r\n assert(@range.cover?(@p5))\r\n assert(@range.end == @p8)\r\n assert(@range2.exclude_end?)\r\n assert_false(@range.exclude_end?)\r\n assert(@range.include?(@p3))\r\n assert(@range.max == @p8)\r\n assert(@range2.max == @p7)\r\n assert(@range.last(3) == [@p6, @p7, @p8])\r\n assert(@range.size == nil)\r\n end",
"def between(num1, num2, num3)\n if num1 >= num2 && num1 <= num3\n return true\n else\n return false\n end\nend",
"def between(num1, num2, num3)\n if num1 >= num2 && num1 <= num3\n return true\n else\n return false\n end\nend",
"def integer?(range: (1..))\n proc do |o|\n o.is_a? String and o.is_i? and range.include?(o.to_i)\n end\n end",
"def is_a_3_dot_range?(range)\n range.exclude_end?\nend",
"def between(num1, num2, num3)\n if num1 >= num2 && num1 <= num3\n return true\n elsif num1 <= num2 && num1 >= num3\n return true\n end\n return false\nend",
"def check_range(rng)\n new(rng).results\n end",
"def include?(addr)\n\t\treturn false if not @ranges\n\t\tif (addr.is_a? String)\n\t\t\taddr = Rex::Socket.addr_atoi(addr)\n\t\tend\n\t\t@ranges.map { |r| \n\t\t\tif r.start <= addr and addr <= r.stop\n\t\t\t\treturn true\n\t\t\tend\n\t\t}\n\t\treturn false\n\tend",
"def in_range?\n self > LOWER_BOUND && self <= UPPER_BOUND\n end",
"def intersect? (range1,range2)\n if range1.begin < range2.begin\n if range1.end < range2.begin\n nil\n else\n (range2.begin..range1.end)\n end\n else\n if range2.end < range1.begin\n nil\n else\n (range1.begin..range2.end)\n end\n end\nend",
"def test_bounds(val, min, max)\n val >= min && val <= max\n end",
"def include?(i)\n @range.include?(i)\n end",
"def prime_range(lower_bound, higher_bound)\n Prime.each(higher_bound).select {|prime| prime >= lower_bound}\nend",
"def repeated_number_ranges(arr)\n\n\nend",
"def in_range (n)\n\tif n <1 || n> 10 \n\t\tfalse\n\telse\n\t\ttrue\n\tend\nend",
"def not_within_hypothetical_range?(dest)\n\t(dest[0] < 0 || dest[1] < 0) || (dest[0] > 7 || dest[1] > 7)\nend",
"def on(numbers)\n sorted_numbers = numbers.sort\n\n sorted_numbers.each_with_index do |number, index|\n return true if number == sorted_numbers[index + 1]\n end\n\n false\n end",
"def between(numb, lower, higher)\n return true if numb >= lower && numb <= higher\n return false\nend",
"def between(n1, n2, n3)\n if n1 >= n2 && n1 <= n3\n return true\n else\n return false\n end\nend",
"def count_between(list_of_integers,lower_bound,upper_bound)\nr = Range.new(lower_bound,upper_bound)\nnew_array=[]\nlist_of_integers.each do |x|\n if r.include?(x)\n new_array.push(x)\n end\n\nend\n\nreturn new_array.length\nend",
"def search_range(nums, target)\n return [-1,-1] if nums.empty? || !nums.include?(target)\n output = [*nums.each_with_index]\n all_targets = output.find_all do |tuple|\n tuple[0] == target\n end\n [all_targets.first[1], all_targets.last[1]]\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\n new_array = []\n \n list_of_integers.each do |num|\n if num >= lower_bound && num <= upper_bound\n new_array.push(num)\n end\n end\n new_array.length\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\n if (list_of_integers.size != 0) && (upper_bound >= lower_bound)\n #puts \"Array size greater than 0 and upper_bound is greater than lower_bound!\"\n i = 0\n nums_between = 0\n #puts \"size of array: \" + list_of_integers.size.to_s\n for i in 0...list_of_integers.size\n num = list_of_integers[i]\n #puts \"array at index #{i} is #{num}\"\n if (lower_bound <= num) && (num <= upper_bound)\n nums_between += 1\n #puts nums_between\n end\n i += 1\n end\n return nums_between\n else\n #puts \"Array empty\"\n return 0\n end\nend",
"def check_nums(num1, num2)\r\n\r\nend",
"def is_within(number, lower, upper)\n RangeAssertion.new(number, lower, upper)\n end",
"def x_in_list_of_y(x,y)\n y.any? do |range|\n if range.respond_to?(\"include?\")\n range.include?(x)\n else\n range == x\n end\n end\n end",
"def checkbounds (var1, var2 , var3, arr)\n # get array of all the indexes possible\n acheck = (0..(arr.length()-1)).to_a\n # set the variable\n tf = true\n\n # check each variable if it is not in this range\n unless acheck.include? var1\n tf = false\n puts 'Card 1 is out of bounds'\n end\n\n unless acheck.include? var2\n tf = false\n puts 'Card 2 is out of bounds'\n end\n\n unless acheck.include? var3\n tf = false\n puts 'Card 3 is out of bounds'\n end\n # return the boolean check\n tf\nend",
"def is_winner_on_range?(range)\n return false unless range.uniq.size == 1 && !range.first.nil?\n\n @winner = range.first\n return true\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\n\n list_of_integers.each do |n|\n answer = 0\n if n >= lower_bound && n <= upper_bound\n answer = answer + 1\n else\n end\n\n end\nend",
"def _bit_in_range?(bits, max, min)\n upper = bits.position + bits.size - 1\n lower = bits.position\n !((lower > max) || (upper < min))\n end",
"def between(min, max, &block)\n return false unless (1..min).all? { try(&block) }\n (min..max).all? { try(&block) } # only using all?'s shortcut property\n true\n end",
"def possible_fields(map, nums)\n result = Set.new()\n map.each do |field, ranges|\n if all_in_ranges?(nums, ranges)\n result << field \n end\n end\n result\nend",
"def search_range(array, range=nil, &block)\n lower = search_lower_boundary(array, range, &block)\n upper = search_upper_boundary(array, range, &block)\n return lower ... upper\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\n # Your code goes here!\n return 0 if list_of_integers.length == 0 || upper_bound < lower_bound\n\n numbers_between = 0\n\n list_of_integers.each { |this_integer| \n if this_integer >= lower_bound && this_integer <= upper_bound\n numbers_between += 1\n end\n }\n\n return numbers_between\nend",
"def between?(p0, p1) end",
"def between?(x,y) end",
"def between?(num, x, y)\n\nend",
"def count_between(list_of_integers, lower_bound, upper_bound)\n if list_of_integers == []\n return 0\n end\n\n counter = 0\n list_of_integers.each { |x|\n if (x >= lower_bound) && (x <= upper_bound)\n counter += 1\n elsif\n counter += 0\n end\n }\n p counter\nend",
"def limitcheck(num, lower, upper)\n (num >= lower and num <= upper) && num\n end",
"def limitcheck(num, lower, upper)\n (num >= lower and num <= upper) && num\n end",
"def count_between(list_of_integers, lower_bound, upper_bound)\n\tarray_length = list_of_integers.sort!.length\n\tcounter = 0\n\tlist_of_integers.each {|element| counter += 1 if element >= lower_bound && element <= upper_bound}\n\tcounter\nend",
"def in_bounds(pos)\n pos.all? { |coord| coord.between?(0, 7) }\n end",
"def multiple_of_any_base?(num, base_numbers)\n base_numbers.each do |base|\n return true if multiple?(num, base)\n end\n return false\n end",
"def check_possibility(nums)\n counter = 0\n \n nums.each_with_index do |n, i|\n unless i == nums.length-1\n if n > nums[i+1]\n counter +=1\n return false if counter == 2\n return false if nums[i-1] > nums[i+1]-1 && (nums[i] > nums[i+2] unless i==nums.length-2) unless i-1 < 0\n end\n end\n end\n \n true\nend",
"def overlap? range\n !(self & range).nil?\n end"
] |
[
"0.85513437",
"0.7055554",
"0.6961255",
"0.68587863",
"0.6835786",
"0.68346953",
"0.6824846",
"0.67745215",
"0.67015386",
"0.6700452",
"0.6654732",
"0.6644599",
"0.65470695",
"0.65087354",
"0.647819",
"0.645934",
"0.64191777",
"0.64030087",
"0.63996524",
"0.6397252",
"0.6397252",
"0.6377475",
"0.63498336",
"0.6221126",
"0.62113637",
"0.61866516",
"0.6174265",
"0.6164914",
"0.6163392",
"0.61591786",
"0.6141295",
"0.612608",
"0.6110766",
"0.61062056",
"0.6102602",
"0.6094009",
"0.60840917",
"0.607627",
"0.60681605",
"0.6060102",
"0.6060102",
"0.6059668",
"0.6048414",
"0.6044695",
"0.602616",
"0.60030496",
"0.59969085",
"0.59889764",
"0.5987857",
"0.59845155",
"0.59830433",
"0.59818685",
"0.59617347",
"0.5953632",
"0.5934371",
"0.59287107",
"0.5925288",
"0.5925288",
"0.5923939",
"0.5921659",
"0.5919477",
"0.5913697",
"0.59038967",
"0.58694476",
"0.5866451",
"0.5860508",
"0.5855626",
"0.5854235",
"0.5852287",
"0.58455884",
"0.584499",
"0.5842031",
"0.58319724",
"0.58266854",
"0.58212644",
"0.5809679",
"0.58031297",
"0.5797395",
"0.57933426",
"0.57894933",
"0.57826596",
"0.57801414",
"0.5775967",
"0.5761647",
"0.575758",
"0.57380795",
"0.5730641",
"0.5727119",
"0.57254314",
"0.5719386",
"0.57157785",
"0.5710589",
"0.5703869",
"0.57022995",
"0.57022995",
"0.5692913",
"0.56911904",
"0.5672516",
"0.5671222",
"0.5660567"
] |
0.87066746
|
0
|
Takes a map of fields to ranges and an array of numbers and returns a set of fields are possible candidates for the numbers
|
def possible_fields(map, nums)
result = Set.new()
map.each do |field, ranges|
if all_in_ranges?(nums, ranges)
result << field
end
end
result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_valid_numbers(fields)\n bounds = fields.map { |line| line.scan(/\\d+/).map(&:to_i) }\n valid_numbers = []\n bounds.each do |set|\n pair = []\n (0..set.length - 1).step(2) { |ind| pair += (set[ind]..set[ind + 1]).to_a }\n valid_numbers << pair\n end\n valid_numbers\n end",
"def compressible_ranges(fields, start)\n ranges = []\n\n i = start\n while i < 8 && fields[i] != 0 ; i += 1 ; end\n\n if i\n li = i\n\n while i < 8\n while i < 8 && fields[i] == 0 ; i += 1 ; end\n if i > li + 1\n ranges << (li...i)\n end\n\n while i < 8 && fields[i] != 0 ; i += 1 ; end\n\n li = i\n end\n end\n\n ranges.sort! { |a,b| b.count <=> a.count }\n ranges\n end",
"def maps_for_range(range)\n last = (range.exclude_end?) ? range.last : range.last + 1\n maps.select { |m| m.start_addr >= range.first and m.max < last }\n end",
"def combine_ranges(code, ranges); end",
"def _reduce_528(val, _values, result)\n result = @builder.range_inclusive(val[0], val[1], val[2])\n\n result\nend",
"def _reduce_518(val, _values, result)\n result = @builder.range_inclusive(val[0], val[1], val[2])\n \n result\nend",
"def _reduce_516(val, _values, result)\n result = @builder.range_inclusive(val[0], val[1], val[2])\n \n result\nend",
"def folding_ranges; end",
"def match_range(range, match); end",
"def solution1(input)\n valid_numbers = parse_ranges(input[0])\n tickets = parse_tickets(input[2])\n error = 0\n\n tickets.each do |ticket|\n ticket.each do |field|\n error += field unless valid_numbers.include? field\n end\n end\n\n error\nend",
"def normalize_range_values(params, field_name, values)\n normalized = Array(values).map(&:presence).compact\n params[field_name] = (normalized.present? && values.length == 2) && (values.first...values.last) || nil\n end",
"def to_ranges args = Hash.new\n min = args[:min] || -Infinity\n max = args[:max] || Infinity\n collapse = args[:collapse]\n \n ranges = Array.new\n self.split(%r{\\s*,\\s*}).each do |section|\n md = section.match(RANGE_REGEXP)\n next unless md\n \n from = _matchdata_to_number md, 1, min\n to = _has_matchdata?(md, 2) ? _matchdata_to_number(md, 3, max) : from\n\n prevrange = ranges[-1]\n\n if collapse && prevrange && prevrange.include?(from - 1) && prevrange.include?(to - 1)\n ranges[-1] = (prevrange.first .. to)\n else\n ranges << (from .. to)\n end\n end\n\n ranges\n end",
"def id_fields\n until @field_pos.keys.length == @fields.length\n # iterate through each field range\n @f_ranges.each_with_index do |f_r, f_ind|\n possibles = []\n # see if positional values for unknown fall within the field range\n @positional_values.each_with_index do |p_v, p_ind|\n next if @field_pos.values.include?(p_ind)\n\n possibles.push(p_ind) if in_range?(p_v, f_r)\n end\n # assign field to position if it is the only possible combination\n @field_pos[@fields[f_ind]] = possibles[0] if possibles.length == 1\n end\n end\n end",
"def repeated_number_ranges(arr)\n\n\nend",
"def _reduce_523(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n \n result\nend",
"def expand_ranges(nums)\n values = []\n nums = nums.split(\",\").each {|x| x.strip!}\n nums.each do |range|\n if range.match(/-/)\n range = range.split(\"-\")\n (range[0].to_i..range[1].to_i).each {|num| values.push(num)}\n else\n values.push(range.to_i)\n end\n end\n return values.uniq\n end",
"def matching_rules(number, rules)\n result = []\n rules.each do |rule, ranges|\n ranges.each do |range|\n next if number < range[0] || number > range[1]\n\n result.append(rule)\n break\n end\n end\n result\nend",
"def range_map\n @range_map ||= ranges.inject({}) do |res, (key, value)|\n range = value.split('-').map(&:to_i)\n res.merge! key => Range.new(range.first, range.last)\n end\n end",
"def ranges_to_models(clazz, *ranges)\n ranges.collect do |min, max|\n clazz.create! min: min, max: max\n end\nend",
"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 _reduce_513(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n \n result\nend",
"def in_ranges?(num, ranges)\n result = false\n ranges.each do |range|\n if range.include?(num)\n result = true\n end\n end\n return result\nend",
"def process_field_range(forall)\n forall.range = range_from_field(forall.range)\n process_forall_statement(forall)\n end",
"def _reduce_513(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n\n result\nend",
"def _reduce_535(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n\n result\nend",
"def filter_fields\n @fields_by_range = FIELDS\n @fields_by_index = @fields_by_range.each_with_index.inject({}) do |col,((k,v),i)|\n col[k] = i\n col\n end\n return @fields_by_range,@fields_by_index\n end",
"def expand_ranges(ranges)\n result = []\n ranges = ranges.split(',')\n ranges.each do |range|\n if(range.include? '-')\n range = range.split('-')\n a = range[0].to_i\n b = range[1].to_i\n [a..b].each do |i|\n result.push(i)\n end\n else\n result.push(range)\n end\n end\n\n return result\n end",
"def find_possible_passwords(range:)\n min = range.split('-')[0].to_i\n max = range.split('-')[1].to_i\n\n valid_passwords = (min..max).map do |possible_password|\n # eg 103_080 => [1, 0, 3, 0, 8, 0]\n digits_array = possible_password.to_s.split('').map(&:to_i)\n\n # Six-digit numbers only\n next if digits_array.length != 6\n\n # Must be in ascending order\n next if digits_array.sort != digits_array\n\n # Special filtering specific to each part of the puzzle\n next if !yield(digits_array)\n\n # Found one!\n possible_password\n end.compact\n\n valid_passwords\nend",
"def find_possibilities\n (0..@field_count-1).reduce({}) do |acc, i|\n acc[i] = @rules\n .select do |rule|\n ticket_values_at(i).all? { |v| rule.valid?(v) }\n end\n .map(&:name)\n\n acc\n end\n end",
"def _reduce_525(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n \n result\nend",
"def _reduce_510(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n \n result\nend",
"def e123_include_intersect (n, min, max)\n end",
"def _reduce_533(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n \n result\nend",
"def suitable_age_range_lists(offer)\n\n list = []\n\n if offer[:from] <= 24 && offer[:to] >= 18\n list = [*list, AgeRangeList.find_or_create_by(description: '18 - 24')]\n end\n\n if offer[:from] <= 34 && offer[:to] >= 25\n list = [*list, AgeRangeList.find_or_create_by(description: '25 - 34')]\n end\n\n if offer[:from] <= 44 && offer[:to] >= 35\n list = [*list, AgeRangeList.find_or_create_by(description: '35 - 44')]\n end\n\n if && offer[:from] <= 54 && offer[:to] >= 45\n list = [*list, AgeRangeList.find_or_create_by(description: '45 - 54')]\n end\n\n if offer[:to] >= 54\n list = [*list, AgeRangeList.find_or_c\n reate_by(description: 'más de 54')]\n end\n\n if list.empty?\n list = [AgeRangeList.find_or_create_by(description: 'Indiferente')]\n end\n\n list\nend",
"def map_values\n @data.each do |code,value|\n fit = false\n @ranges.each do |r|\n if value.between?(r[:range][0],r[:range][1])\n self.paint_country(code,r[:color])\n fit = true\n break\n end\n end\n raise \"Unexpected error! Value #{value} doesn't fit in any range!\" unless fit\n end\n end",
"def _reduce_508(val, _values, result)\n result = @builder.range_inclusive(nil, val[0], val[1])\n \n result\nend",
"def query_range(left, right)\n \n end",
"def query_range(left, right)\n \n end",
"def process_array_range(forall)\n constraints = Array.new\n range = order_range(forall)\n\n range.each do |obj|\n new_constraint = Yarpler::Models::Constraint.new\n new_constraint.expression = forall.expression.clone\n new_constraint.expression = replace_selector(new_constraint.expression, forall.variable, obj.to_s,\n forall.range)\n\n constraints << new_constraint if where(forall, obj)\n end\n constraints\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 any_of(*field_names)\n [].tap do |list|\n any_num = any_of_number(*field_names)\n self.each_value { |num| list << num if (num & any_num) > 0 }\n end\n end",
"def restrict(value, range)\n [[value, range.first].max, range.last].min\n end",
"def make_ranges_linear\n min, max = @data.values.sort.first, @data.values.sort.last\n value = ( ( max - min ) / File.open(@palette).readlines.size ).to_i + 1\n offset = (( value / 10 ** (value.to_s.size - 1) ).round + 1)* 10 ** (value.to_s.size - 1)\n last = offset > min ? offset : min\n @ranges = [ { :range => [1, last-1] } ]\n while last < max do\n @ranges << { :range => [last, last + offset - 1] }\n last += offset\n end\n @ranges << { :range => [last, last + offset] }\n end",
"def instead_of(*field_names)\n [].tap do |list|\n none_num = any_of_number(*field_names)\n self.each_value { |num| list << num if (num & none_num) != none_num }\n end\n end",
"def validate_range(address_arr)\n address_arr.all? do |number|\n number.to_i <= 255 && number.to_i >= 0\n end\nend",
"def validate_range(address_arr)\n address_arr.all? do |number|\n number.to_i <= 255 && number.to_i >= 0\n end\nend",
"def valid_tickets\n @nearby_tickets.filter_map do |ticket|\n in_ranges = ticket.map do |val|\n merged_rules.map {|val_range| val_range.include?(val)}.include?(true)\n end\n ticket unless in_ranges.include?(false)\n end\n end",
"def all_in_ranges?(nums, ranges)\n if nums.empty?\n return false\n end\n nums.each do |num|\n if !in_ranges?(num, ranges)\n return false\n end\n end\n true\nend",
"def bounds(values)\n q1 = values.percentile(25)\n q3 = values.percentile(75)\n iqr = q3 - q1\n lower = q1 - (iqr * 1.5)\n upper = q3 + (iqr * 1.5)\n inrange = values.select { |v| v >= lower && v <= upper }\n lower = [lower, inrange.min].max\n upper = [upper, inrange.max].min\n belowrange = values.select { |v| v < lower }\n aboverange = values.select { |v| v > upper }\n [belowrange, lower, upper, aboverange]\nend",
"def test_to_15_advanced\n validate_to_15_map(to_15_advanced_map)\n end",
"def test_ranges\r\n assert_equal(@range.begin.to_f, @p2.to_f)\r\n assert(@range.cover?(@p5))\r\n assert(@range.end == @p8)\r\n assert(@range2.exclude_end?)\r\n assert_false(@range.exclude_end?)\r\n assert(@range.include?(@p3))\r\n assert(@range.max == @p8)\r\n assert(@range2.max == @p7)\r\n assert(@range.last(3) == [@p6, @p7, @p8])\r\n assert(@range.size == nil)\r\n end",
"def add_range_limit_params(solr_params, req_params) \n ranged_facet_configs = \n blacklight_config.facet_fields.select { |key, config| config.range } \n # In ruby 1.8, hash.select returns an array of pairs, in ruby 1.9\n # it returns a hash. Turn it into a hash either way. \n ranged_facet_configs = Hash[ ranged_facet_configs ] unless ranged_facet_configs.kind_of?(Hash)\n\n ranged_facet_configs.each_pair do |solr_field, config|\n solr_params[\"stats\"] = \"true\"\n solr_params[\"stats.field\"] ||= []\n solr_params[\"stats.field\"] << solr_field \n \n hash = req_params[\"range\"] && req_params[\"range\"][solr_field] ?\n req_params[\"range\"][solr_field] :\n {}\n \n if !hash[\"missing\"].blank?\n # missing specified in request params\n solr_params[:fq] ||= []\n solr_params[:fq] << \"-#{solr_field}:[* TO *]\"\n \n elsif !(hash[\"begin\"].blank? && hash[\"end\"].blank?)\n # specified in request params, begin and/or end, might just have one\n start = hash[\"begin\"].blank? ? \"*\" : hash[\"begin\"]\n finish = hash[\"end\"].blank? ? \"*\" : hash[\"end\"]\n \n solr_params[:fq] ||= []\n solr_params[:fq] << \"#{solr_field}: [#{start} TO #{finish}]\"\n \n if (config.segments != false && start != \"*\" && finish != \"*\")\n # Add in our calculated segments, can only do with both boundaries.\n add_range_segments_to_solr!(solr_params, solr_field, start.to_i, finish.to_i)\n end\n \n elsif (config.segments != false &&\n boundaries = config.assumed_boundaries)\n # assumed_boundaries in config\n add_range_segments_to_solr!(solr_params, solr_field, boundaries[0], boundaries[1])\n end\n end\n \n return solr_params\n end",
"def range_collection\n ranges.sort_by { |_, range| range.priority }.collect { |key, range_thing| [collection_label(range_thing), key] }\n end",
"def search_range(array, range=nil, &block)\n lower = search_lower_boundary(array, range, &block)\n upper = search_upper_boundary(array, range, &block)\n return lower ... upper\n end",
"def bounds(arr)\n min, max = arr.min(), arr.max()\n range = max - min\n # how many figures in the range\n range_digits = Math.log10(range).ceil()\n range_scale = 10.0**(range_digits-1)\n min_bound = ((min / range_scale) - 1) * range_scale\n max_bound = ((max / range_scale) + 1) * range_scale\n return min_bound, max_bound, range_scale\n end",
"def e123_include_intersect (n, min, max)\n ranges = []\n # loop i=1 a N\n (1..n).each { |i|\n # generate Ri with start = rand(min, max), end = (start, max) -> Note if start == max, then Range.length = 1\n start = rand(max - min) + min\n finish = rand(max - start) + start\n range = start..finish\n ranges.push(range)\n }\n\n intersected = []\n contained = []\n # loop Ri to Rn, i=1 to N\n ranges.each_with_index { |range_i, i|\n # loop Rj to Rn, j=i+1 to N\n ranges.drop(i+1).each { |range_j|\n # Ri intersects Rj?\n if range_i.intersects? range_j\n # push [Ri,Rj] to I\n intersected.push([range_i, range_j])\n # Ri contains? Rj or Rj contains? Ri\n if range_i.contains? range_j or range_i.is_contained_by? range_j\n # push [Ri, Rj] to C\n contained.push([range_i, range_j])\n end\n end\n }\n }\n\n return ranges, intersected, contained\n end",
"def missing_ranges(array, lower = 0, upper = 99)\n ranges = []\n\n i = 0\n prev = lower - 1\n\n while i <= array.size\n curr = (i == array.size) ? upper + 1 : array[i]\n\n if curr - prev > 1\n ranges << get_range(prev + 1, curr - 1)\n end\n\n prev = curr\n i += 1\n end\n\n ranges\nend",
"def extract_integer_bounds(set)\r\n return nil if set.empty?\r\n match = (set.attr('bounds').to_s.match(/\\[(\\d+),(\\d+)\\]\\[(\\d+),(\\d+)\\]/))\r\n #puts \"extract_integer_bounds => match.captures => #{match.captures.collect(&:to_i)}\"\r\n match.captures.collect(&:to_i)\r\nend",
"def make_ranges(ids)\n \tint_array = ids.collect{|s| s.to_i}\n\n\tint_array = int_array.sort\n\tnew_ids = []\n\tr = []\n\tz = int_array[0].to_i\n\tr[0] = z\n\tint_array.each do |n|\n\t if n > z+1\n\t \tnew_ids << r\n\t \tr = [n]\n\t else\n\t r[1] = n\n\t \tend\n\t \tz = n\n\tend\n\tnew_ids << r\n\tnew_ids\n end",
"def best_compressible_range(fields, start)\n cr = compressible_ranges(fields, start)\n\n if cr[0]\n if cr[1]\n if cr[0].count == cr[1].count\n compress = cr[0].first < cr[1].first ? cr[1] : cr[0]\n else\n compress = cr[0]\n end\n else\n compress = cr[0]\n end\n else\n compress = nil\n end\n end",
"def get_ranges(spectrum)\n res = []\n BAND_LOWER_FREQ.each do |lf|\n hf = lf + BAND_WIDTH\n res.push spectrum.keys\n .select{|f| (lf..hf).include?(f.to_f) }\n .reduce(0) {|memo, k| memo += MIN_POWER + spectrum[k]}\n end\n return res\nend",
"def normalize_ranges(ranges)\n registers = ranges.map { |r| Array(r) }.flatten.sort.uniq\n result = []\n totals = []\n run_start = nil\n count = 0\n registers.each_with_index do |r, i|\n run_start ||= r\n next unless i + 1 == registers.length ||\n r + 1 != registers[i + 1] ||\n (r - run_start) == 100 ||\n REGISTER_BREAKPOINTS.include?(r + 1)\n\n if r == run_start\n result << r\n if (count += 1) == 100\n totals << result\n result = []\n count = 0\n end\n else\n range = run_start..r\n if count + range.count > 100\n totals << result unless result.empty?\n result = []\n count = 0\n end\n count += range.count\n result << range\n end\n run_start = nil\n end\n totals << result unless result.empty?\n totals\n end",
"def search(criteria, field, query)\n criteria.where(\"#{field}.ranges.#{query}\" => true)\n end",
"def range(range)\n opts[:min] = range.begin\n opts[:max] = range.end\n end",
"def solve(range)\n valid_passwords = range.filter do |n|\n never_decrease?(n) && any_adj_group(n) { |grp| yield grp }\n end\n valid_passwords.count\nend",
"def add_range_opts(fkey, lkey)\n @oparse.on(\"-r\", \"--range=START[:END]\", \n \"Start and optional end range\") do |r|\n\n raise \"-x and -r are mutually exclusive\" if @parser_got_range\n @parser_got_range=true\n\n unless m=/^(-?[0-9]+)(?::(-?[0-9]+))?$/.match(r)\n raise \"invalid range #{r.inspect}\"\n end\n\n @opts[fkey] = $1.to_i\n @opts[lkey] = $2.to_i if $2\n end\n\n @oparse.on(\"-x\", \"--hexrange=START[:END]\", \n \"Start and optional end range in hex\") do |r|\n\n raise \"-x and -r are mutually exclusive\" if @parser_got_range\n @parser_got_range=true\n\n unless m=/^(-?[0-9a-f]+)(?::(-?[0-9a-f]+))?$/i.match(r)\n raise \"invalid range #{r.inspect}\"\n end\n\n @opts[fkey] = \n if ($1[0,1] == '-')\n ($1[1..-1]).hex_to_num * -1\n else\n $1.hex_to_num\n end\n\n if $2\n @opts[lkey] = \n if($2[0,1] == '-')\n $2[1..-1].hex_to_num * -1\n else\n $2.hex_to_num\n end\n end\n end\n end",
"def change_ranges(params)\n @min = params.fetch(:min, 0).to_f\n @max = params.fetch(:max, 100).to_f\n end",
"def range_distribution\n nil_values_count = values.count(nil)\n values_without_nils = values.reject(&:nil?)\n\n distr = ranges.map do |range|\n freq = values_without_nils.select{|value| value >= range}.length\n values_without_nils.reject!{|value| value >= range}\n\n [range, freq]\n end.to_h\n\n distr.merge!({nil => nil_values_count}) if nil_values_count > 0\n distr\n end",
"def sudoku_clauses\n res = []\n\n #ensure each cell contains a digit\n (1..9).each do |i|\n (1..9).each do |j|\n #must contains at least one of 9 digits\n res << (1..9).map {|d| variable(i, j, d) }\n\n (1..9).each do |d|\n ((d+1)..9).each do |dp|\n #can not contain two digits at once\n res << [-variable(i, j, d), -variable(i, j, dp)]\n end\n end\n end\n end\n\n #ensure each rows and columns contain distinct values\n (1..9).each do |i|\n res += valid( (1..9).map{|j| [i, j]} )\n res += valid( (1..9).map{|j| [j, i]} )\n end\n\n #ensure 3x3 sub-grids regions have distinct values\n [1, 4, 7].each do |i|\n [1, 4, 7].each do |j|\n res += valid((0..8).map{|k| [i + k%3, j+k / 3]})\n end\n end\n\n res\n end",
"def range(range)\n assert_range range\n schema do |s|\n s.type range.begin.is_a?(Integer) ? 'integer' : 'number'\n s.minimum range.begin\n s.maximum range.end, exclusive: range.exclude_end? unless range.end.nil?\n end\n end",
"def test_009_ranges()\n TestVals.each do |sVal|\n bs = BitString.new(sVal)\n length = sVal.length\n (length - 2).times do |width|\n width += 2\n #\n # Test subranging n bits at a time\n #\n (length - width + 1).times do |i|\n excerpt = sVal[length-width-i,width].to_i(2)\n assert_equal(excerpt,\n bs[i,width].to_i,\n 'Test bitstring subrange ' +\n \"'#{bs.to_s}'[#{i},#{width}] =>'#{excerpt}'\")\n end\n end\n end\n end",
"def excise(ranges)\n if ranges.class != Array\n raise RuntimeError, \"Argument should be an array of ranges\"\n end\n ranges.each do |r|\n if r.class != Range\n raise RuntimeError, \"Argument should be an array of ranges\"\n end\n end\n\n answer = Array.new\n previous_excised_stop = self.start - 1\n ranges.sort_by{|r| r.first}.each do |r|\n subslice_start = previous_excised_stop + 1\n if subslice_start <= r.first - 1\n answer.push(Slice.new(self.seq_region, subslice_start, r.first - 1))\n end\n previous_excised_stop = r.last\n if r.last > self.stop\n return answer\n end\n end\n subslice_start = previous_excised_stop + 1\n answer.push(Slice.new(self.seq_region, subslice_start, self.stop))\n return answer\n end",
"def ranges\n pairs.map { |b, e| (b...e) }\n end",
"def install_order(arr)\n new_range = (arr.min.min..arr.max.max).to_a\n result_arr = []\n tup_hash = {}\n arr.each do |subarr|\n if tup_hash[subarr[0]]\n tup_hash[subarr[0]] = tup_hash[subarr[0]].push(subarr[1])\n else\n tup_hash[subarr[0]] = [subarr[1]]\n end\n new_range.delete(subarr[0])\n end\n until tup_hash.keys.empty?\n tup_hash.keys.each do |tup|\n if tup_hash[tup].any? { |el| tup_hash.keys.include?(el) }\n\n else\n result_arr.push(tup)\n tup_hash.delete(tup)\n end\n end\n end\n\n\n new_range.concat(result_arr)\n p new_range\n return new_range\nend",
"def prime_range(lower_bound, higher_bound)\n Prime.each(higher_bound).select {|prime| prime >= lower_bound}\nend",
"def folding_ranges(filename); end",
"def rangify_gids(values)\n start_gid = 0\n\n [].tap do |ranges|\n values.each_cons(2) do |(_, first_idx), (sec_gid, sec_idx)|\n if first_idx != sec_idx\n ranges << [start_gid, first_idx]\n start_gid = sec_gid\n end\n end\n\n ranges << [start_gid, values.last[1]]\n end\n end",
"def map_range(a, b, s)\n af, al, bf, bl = a.first, a.last, b.first, b.last\n bf + (s - af)*(bl - bf).quo(al - af)\n end",
"def excise(ranges)\r\n if ranges.class != Array\r\n raise RuntimeError, \"Argument should be an array of ranges\"\r\n end\r\n ranges.each do |r|\r\n if r.class != Range\r\n raise RuntimeError, \"Argument should be an array of ranges\"\r\n end\r\n end\r\n\r\n answer = Array.new\r\n previous_excised_stop = self.start - 1\r\n ranges.sort_by{|r| r.first}.each do |r|\r\n subslice_start = previous_excised_stop + 1\r\n if subslice_start <= r.first - 1\r\n answer.push(Slice.new(self.seq_region, subslice_start, r.first - 1))\r\n end\r\n previous_excised_stop = r.last\r\n if r.last > self.stop\r\n return answer\r\n end\r\n end\r\n subslice_start = previous_excised_stop + 1\r\n answer.push(Slice.new(self.seq_region, subslice_start, self.stop))\r\n return answer\r\n end",
"def add_date_range_limit_params(solr_params)\n ranged_facet_configs = \n blacklight_config.facet_fields.select { |key, config| config.range } \n # In ruby 1.8, hash.select returns an array of pairs, in ruby 1.9\n # it returns a hash. Turn it into a hash either way. \n ranged_facet_configs = Hash[ ranged_facet_configs ] unless ranged_facet_configs.kind_of?(Hash)\n \n ranged_facet_configs.each_pair do |solr_field, config|\n solr_params[\"stats\"] = \"true\"\n solr_params[\"stats.field\"] ||= []\n solr_params[\"stats.field\"] << solr_field \n \n hash = blacklight_params[\"range\"] && blacklight_params[\"range\"][solr_field] ?\n blacklight_params[\"range\"][solr_field] :\n {}\n \n if !hash[\"missing\"].blank?\n # missing specified in request params\n solr_params[:fq] ||= []\n solr_params[:fq] << \"-#{solr_field}:[* TO *]\"\n \n elsif !(hash[\"begin\"].blank? && hash[\"end\"].blank?)\n # specified in request params, begin and/or end, might just have one\n start = hash[\"begin\"].blank? ? \"*\" : hash[\"begin\"]\n finish = hash[\"end\"].blank? ? \"*\" : hash[\"end\"]\n \n solr_params[:fq] ||= []\n solr_params[:fq] << \"#{solr_field}: [#{start} TO #{finish}]\"\n \n if (config.segments != false && start != \"*\" && finish != \"*\")\n # Add in our calculated segments, can only do with both boundaries.\n add_date_range_segments_to_solr!(solr_params, solr_field, start.to_i, finish.to_i)\n end\n \n elsif (config.segments != false &&\n boundaries = config.assumed_boundaries)\n # assumed_boundaries in config\n add_date_range_segments_to_solr!(solr_params, solr_field, boundaries[0], boundaries[1])\n end\n end\n \n return solr_params\n end",
"def bound(n,options={})\n min=(options[:min]||1).to_i\n max=(options[:max]||5).to_i\n default=(options[:default]||min).to_i\n [[(n||default).to_i,min].max,max].min\n end",
"def OverlappingRanges(arr)\n ((arr[0]..arr[1]).to_a & (arr[2]..arr[3]).to_a).size >= arr[4]\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 _reduce_193(val, _values, result)\n result = new_irange(val[0], val[1], val[2])\n \n result\nend",
"def _reduce_193(val, _values, result)\n result = new_irange(val[0], val[1], val[2])\n \n result\nend",
"def validate_modules_ranges\n message = []\n campaign.modules.each do |campaign_module|\n if campaign.range_module_settings?(campaign_module[0])\n settings = campaign_module[1]['settings']\n\n case campaign_module[1]['name']\n when 'photos'\n items = photos.active.count\n when 'expenses'\n items = event_expenses.count\n when 'comments'\n items = comments.count\n end\n\n min_result = settings['range_min'].blank? || (items >= settings['range_min'].to_i)\n max_result = settings['range_max'].blank? || (items <= settings['range_max'].to_i)\n\n if !min_result || !max_result\n message.push(I18n.translate(\"invalid_submit_messages.#{campaign_module[1]['name']}.min\", range_min: settings['range_min'])) if settings['range_min'].present? && !settings['range_max'].present?\n message.push(I18n.translate(\"invalid_submit_messages.#{campaign_module[1]['name']}.max\", range_max: settings['range_max'])) if !settings['range_min'].present? && settings['range_max'].present?\n message.push(I18n.translate(\"invalid_submit_messages.#{campaign_module[1]['name']}.min_max\", range_min: settings['range_min'], range_max: settings['range_max'])) if settings['range_min'].present? && settings['range_max'].present?\n end\n end\n end if campaign.modules.present?\n\n errors.add :base, message.to_sentence(last_word_connector: ' and ') if message.present?\n\n errors.empty?\n end",
"def test_to_15_basic\n validate_to_15_map(to_15_basic_map)\n end",
"def allowed_numbers\n allowed = @board.map { |n| n.nil? ? 511 : 0 }\n coordinate_systems.each do |c|\n (0..8).each do |x|\n bits = axis_missing(x, c)\n (0..8).each { |y| allowed[index_for(x, y, c)] &= bits }\n end\n end\n allowed\n end",
"def values(range = nil)\n result_unflatten = if !::RANGES_JRUBY_BUG\n map { |x| x.v }\n else\n self.v\n end\n result = result_unflatten.flatten\n if range\n relevant_result = []\n result.each_with_index { |row_or_column, i| relevant_result << row_or_column if range.include?(i) }\n relevant_result\n else\n result\n end\n end",
"def _reduce_199(val, _values, result)\n result = new_irange(val[0], val[1], val[2])\n \n result\nend",
"def getIndexRange()\n rangeTime = { :min => nil, :max => nil} ;\n rangeX = { :min => nil, :max => nil} ;\n rangeY = { :min => nil, :max => nil} ;\n rangeZ = { :min => nil, :max => nil} ;\n @sumGridTable.keys.sort.each{|index|\n rangeTime[:min] = safeMin(index[0], rangeTime[:min]) ;\n rangeTime[:max] = safeMax(index[0], rangeTime[:max]) ;\n rangeX[:min] = safeMin(index[1][0], rangeX[:min]) ;\n rangeX[:max] = safeMax(index[1][0], rangeX[:max]) ;\n rangeY[:min] = safeMin(index[1][1], rangeY[:min]) ;\n rangeY[:max] = safeMax(index[1][1], rangeY[:max]) ;\n rangeZ[:min] = safeMin(index[1][2], rangeZ[:min]) ;\n rangeZ[:max] = safeMax(index[1][2], rangeZ[:max]) ;\n }\n return [rangeTime, rangeX, rangeY, rangeZ] ;\n end",
"def make_ranges_log(base = 10)\n min, max = @data.values.sort.first, @data.values.sort.last\n last = base ** min.to_s.size\n @ranges = [ { :range => [last / base, last-1] } ]\n while last < max do\n @ranges << { :range => [last, last * base - 1] }\n last = last * base\n end\n @ranges << { :range => [last, last * 10] }\n end",
"def ids_between_values(min_value, max_value, options = {:subject => :placeholder} )\n matching_recipes = []\n if [:price, :kcal].include?(options[:subject])\n if min_value > max_value\n tmp = min_value\n min_value = max_value\n max_value = tmp\n end\n \n if options[:subject] == :price\n if min_value > 0\n matching_recipes = self.all.reject {|recipe| (min_value..max_value).include?(recipe.calculated_price) == false }\n else\n matching_recipes = self.all.reject {|recipe| recipe.calculated_price < max_value }\n end\n else\n if min_value > 0\n matching_recipes = self.all.reject {|recipe| (min_value..max_value).include?(recipe.number_of_kcal_per_meal) == false }\n else\n matching_recipes = self.all.reject {|recipe| recipe.number_of_kcal_per_meal < max_value }\n end\n end \n end\n matching_recipes.collect(&:id)\n end",
"def syntetic_step_thresholds(values_range)\n return ->(idx) { values_range[idx] } if values_range.count == GRADES.count\n\n max, min = values_range.map(&:to_i)\n step = ((max - min) / GRADES.count.to_f).round(2)\n max.step(min, -step).to_a\n end",
"def utf8_ranges( range )\n ranges = []\n UTF8_BOUNDARIES.each do |max|\n if range.begin <= max\n return ranges << range if range.end <= max\n\n ranges << range.begin .. max\n range = (max + 1) .. range.end\n end\n end\n ranges\nend",
"def range_numerals\n [ range(:numerals) ]\n end",
"def in_range(a, b, c)\n return ((a >= 1 && a <= 10) || (b >= 1 && b <= 10) || (c >= 1 && c <= 10));\t\nend",
"def find_in_range *args\n if args[0].respond_to?(:first) && args[0].respond_to?(:last)\n\tt_start = args[0].first\n\tt_end = args[0].last\n else\n\tt_start = args[0]\n\tt_end = args[1]\n end\n opts = args.last if args.last.respond_to?(:keys)\n if opts\n\tlimit = opts[:limit]\n end\n result = []\n count = 1\n loop do\n rnext = find_next t_start\n break if count > limit if limit\n\tbreak if rnext > t_end\n result << rnext\n t_start = rnext + 1\n\tcount += 1\n end\n result\n end",
"def from_ranges\n attributes.fetch(:fromRanges)\n end",
"def initialize(ranges, string, exclude_end = false)\n unless ranges.is_a?(Array)\n lb = GtEqRange.new(ranges)\n if exclude_end\n ub = LtRange.new(string)\n string = \">=#{string} <#{ranges}\"\n else\n ub = LtEqRange.new(string)\n string = \"#{string} - #{ranges}\"\n end\n ranges = [MinMaxRange.create(lb, ub)]\n end\n ranges.compact!\n\n merge_happened = true\n while ranges.size > 1 && merge_happened\n # merge ranges if possible\n merge_happened = false\n result = []\n until ranges.empty?\n unmerged = []\n x = ranges.pop\n result << ranges.reduce(x) do |memo, y|\n merged = memo.merge(y)\n if merged.nil?\n unmerged << y\n else\n merge_happened = true\n memo = merged\n end\n memo\n end\n ranges = unmerged\n end\n ranges = result.reverse!\n end\n\n ranges = [LtRange::MATCH_NOTHING] if ranges.empty?\n @ranges = ranges\n @string = string.nil? ? ranges.join(' || ') : string\n end"
] |
[
"0.72231054",
"0.6411788",
"0.634999",
"0.60745585",
"0.5802601",
"0.57660764",
"0.5691889",
"0.56850946",
"0.5672138",
"0.5663853",
"0.5661722",
"0.56319577",
"0.56286985",
"0.5620134",
"0.5618506",
"0.5618176",
"0.5602175",
"0.5592634",
"0.55566716",
"0.55435187",
"0.55339277",
"0.5526314",
"0.5525866",
"0.55126387",
"0.550553",
"0.55038244",
"0.5499232",
"0.54867965",
"0.54837364",
"0.5463852",
"0.545776",
"0.544538",
"0.54408306",
"0.54392004",
"0.5434051",
"0.5430774",
"0.54198736",
"0.54198736",
"0.5381261",
"0.53607035",
"0.53449243",
"0.5334818",
"0.5304972",
"0.52963185",
"0.52924645",
"0.52924645",
"0.524315",
"0.5239175",
"0.5222792",
"0.52195483",
"0.52102375",
"0.5197927",
"0.519791",
"0.5185858",
"0.51818836",
"0.51768154",
"0.5162027",
"0.5150628",
"0.5149954",
"0.5133968",
"0.5130955",
"0.5104759",
"0.50989556",
"0.50809914",
"0.5063374",
"0.5054161",
"0.5040214",
"0.50189584",
"0.5016348",
"0.4990882",
"0.49896634",
"0.49840668",
"0.4982362",
"0.49803612",
"0.49798837",
"0.49751997",
"0.49453628",
"0.49393082",
"0.493584",
"0.49159542",
"0.49125534",
"0.49105892",
"0.49073592",
"0.49070653",
"0.49070653",
"0.49039212",
"0.49005446",
"0.48869166",
"0.48827443",
"0.48787856",
"0.48604718",
"0.4857423",
"0.48561665",
"0.48523968",
"0.48498803",
"0.48494476",
"0.48457944",
"0.48439094",
"0.48415107",
"0.48332316"
] |
0.87087697
|
0
|
Takes a 2D matrix and returns the transpose
|
def transpose(matrix)
if matrix.empty? || matrix.first.empty?
raise ArgumentError
end
result = Array.new(matrix.first.length) { Array.new(matrix.length, 0) }
matrix.each_with_index do |row, x|
row.each_with_index do |val, y|
result[y][x] = val
end
end
result
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def transpose_of_matrix matrix\n\treturn Matrix.new(matrix.line, matrix.col, matrix.values.transpose)\nend",
"def transpose(matrix)\n size = matrix.first.size\n matrix.each_with_index.with_object(Array.new(size) {[]}) do |(arr, idx), trans_arr|\n arr.each_with_index do |el, i|\n trans_arr[i] << el\n end\n end\nend",
"def transpose(matrix)\n first_array = [matrix[0][0], matrix[1][0], matrix[2][0]]\n second_array = [matrix[0][1], matrix[1][1], matrix[2][1]]\n third_array = [matrix[0][2], matrix[1][2], matrix[2][2]]\n final_array = [first_array, second_array, third_array]\nend",
"def transpose(matrix)\n row = matrix.length\n col = matrix[0].length\n res = Array.new(col) { Array.new(row)}\n (0...col).each do |i|\n (0...row).each do |j|\n res[i][j] = matrix[j][i]\n end\n end\n return res\nend",
"def my_transpose(matrix)\n raise \"Not a two dimensional array\" unless matrix.length > 1 && matrix[0].is_a?(Array)\n result = Array.new(matrix.length) {Array.new(matrix.length)}\n\n result.each_index do |row|\n result[row].each_index do |col|\n result[row][col] = matrix[col][row]\n end\n end\n\n result\nend",
"def transpose(matrix)\n new_matrix = []\n (0...matrix.size).each { |index| new_matrix << column(matrix, index) }\n new_matrix\nend",
"def transpose\n Matrix[self.to_a]\n end",
"def transpose(arr) # transpose matrix\n column1, column2, column3 = [arr[0][0], arr[1][0], arr[2][0]],\n [arr[0][1], arr[1][1], arr[2][1]],\n [arr[0][2], arr[1][2], arr[2][2]]\n [column1, column2, column3]\nend",
"def transpose\n Matrix.columns(@rows)\n end",
"def my_transpose(matrix)\n transposed = []\n matrix.each_with_index do |row, i|\n new_row = []\n row.each_with_index do |ele, j|\n new_row << matrix[j][i]\n end\n transposed << new_row\n end\n transposed\nend",
"def transpose(matrix)\n result = []\n (0..2).each do |column_index|\n new_row = (0..2).map { |row_index| matrix[row_index][column_index] }\n result << new_row\n end\n result\nend",
"def transpose(matrix)\n new_matrix = []\n\n new_matrix_size = matrix[0].size\n\n new_matrix_size.times do |old_column|\n new_row = []\n\n matrix.size.times do |old_row|\n new_row << matrix[old_row][old_column]\n end\n\n new_matrix << new_row\n end\n\n new_matrix\nend",
"def matrix_transpose(matrix)\r\n m_row = 0\r\n t_col = 0\r\n result = []\r\n while matrix[m_row]\r\n m_col = 0\r\n t_row = 0\r\n while matrix[m_row][m_col]\r\n result.push([])\r\n result[t_row][t_col] = matrix[m_row][m_col]\r\n m_col += 1\r\n t_row += 1\r\n end\r\n m_row += 1\r\n t_col += 1\r\n end\r\n return result\r\nend",
"def my_transpose\n raise 'needs to be a square matrix' unless length == self[0].length\n\n transposed = []\n col = []\n\n each_index do |row_idx|\n temp_arr = []\n each do |sub_arr|\n temp_arr << sub_arr[row_idx]\n end\n transposed << temp_arr\n end\n\n transposed\n end",
"def transpose(matrix)\n transposed = []\n num_columns = matrix.first.length\n num_rows = matrix.length\n\n (0...num_columns).each do |col|\n row_to_add = []\n (0...num_rows).each do |row|\n row_to_add << matrix[row][col]\n end\n transposed << row_to_add\n end\n\n # another version:\n # (0...num_columns).each do |column_index|\n # new_row = (0...num_rows).map do |row_index|\n # matrix[row_index][column_index]\n # end\n # result << new_row\n # end\n\n transposed\nend",
"def transpose!(matrix)\n (0..2).each do |i1|\n (i1..2).each do |i2|\n matrix[i1][i2], matrix[i2][i1] = matrix[i2][i1], matrix[i1][i2]\n end\n end\n matrix\nend",
"def transpose!(matrix)\n copy_matrix = []\n matrix.each_with_index { |row, ind| copy_matrix[ind] = row }\n matrix[0].length.times { matrix.unshift([]) }\n copy_matrix.length.times { matrix.pop }\n matrix.each_with_index do |_, n_ind|\n copy_matrix.each_with_index do |_, ind|\n matrix[ind] << copy_matrix[n_ind][ind]\n end\n end\nend",
"def transpose(matrix)\n matrix[0][0], matrix[1][0], matrix[2][0], matrix[0][1], matrix[1][1], \n matrix[2][1], matrix[0][2], matrix[1][2], matrix[2][2] = \n matrix[0][0], matrix[0][1], matrix[0][2], matrix[1][0], \n matrix[1][1], matrix[1][2], matrix[2][0], matrix[2][1], matrix[2][2] \nend",
"def transpose(matrix)\n new_matrix = []\n\n column = 0\n while column < matrix.size\n new_row = []\n\n row = 0\n while row < matrix.size\n new_row << matrix[row][column]\n row += 1\n end\n\n new_matrix << new_row\n column += 1\n end\n\n new_matrix\nend",
"def my_transpose(matrix)\n #algorithm\n for i in 0...matrix[0].length\n for j in (i + 1)...matrix[0].length\n temp = matrix[i][j]\n matrix[i][j] = matrix[j][i]\n matrix[j][i] = temp\n end\n end\n\n #printer\n for k in (0..(matrix[0].length-1))\n puts matrix[k].join(\" \")\n end\n matrix\nend",
"def transpose!(matrix)\n (0...matrix.size).each do |i|\n (i...matrix.size).each do |j|\n matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]\n end\n end\nend",
"def transpose(matrix)\n new_matrix = []\n matrix[0].size.times { |_| new_matrix.push(Array.new) }\n matrix.each do |array|\n # while iterating through array,\n # the next spot in each item in new_matrix gets successive items from array.\n array.size.times do |i|\n new_matrix[i] << array[i]\n end\n end\n new_matrix\nend",
"def transpose(matrix)\n new_matrix = Array.new(3) { Array.new }\n matrix.each_with_index do |row, row_index|\n row.each_with_index do |element, element_index|\n # binding.pry\n new_matrix[element_index][row_index] = element\n end\n end\n new_matrix\nend",
"def transpose!(matrix)\n (0...matrix.size).each do |row|\n (0...matrix.size).each do |col|\n matrix[row][col], matrix[col][row] =\n matrix[col][row], matrix[row][col] if row < col\n end\n end\nend",
"def my_transpose(arr) \n new_arr = []\n (0...arr.length).each do |outer_el| # the second dimension of a matrix\n outer_arr = []\n (0...arr.length).each do |inner_el| \n outer_arr << arr[inner_el][outer_el] # flip everything inside the array and place in the outer_arr\n end\n new_arr << outer_arr # nest that outer_arr inside the new_arr\n end\n new_arr\nend",
"def transpose(arr)\n columns = arr.max.length-1\n\n (0..columns).map do |column|\n (0..arr.length-1).map do |row|\n arr[row][column]\n end\n\n end\nend",
"def transpose(matrix)\n new_row_0 = []\n new_row_1 = []\n new_row_2 = []\n\n matrix.each do |row|\n new_row_0 << row[0] \n new_row_1 << row[1]\n new_row_2 << row[2]\n end\n p [new_row_0, new_row_1, new_row_2]\nend",
"def transpose\n return Matrix.new @rows.transpose\n end",
"def transpose(matrix)\n results = Array.new(3){Array.new(3)}\n\n m = 0\n n = 0\n\n 3.times do \n results[m][n], results[m + 1][n], results[m + 2][n] = matrix[n]\n n += 1\n end\n\n results\nend",
"def transpose() end",
"def transpose(matrix)\n new_matrix = [[], [], []]\n matrix.each do |array|\n 3.times do |i|\n new_matrix[i] << array[i]\n end\n end\n new_matrix\nend",
"def transpose; end",
"def transpose\n FMatrix.new(@cols, @rows) do |matrix, row, col|\n matrix.set!(row, col, self.get(col, row))\n end\n end",
"def transpose(arr)\n col_size = arr.size # the number of rows in the original array\n row_size = arr[0].size # the number of cols in the original array\n new_arr = Array.new(row_size) { Array.new(col_size) } # create a nil-filled row_size-by-col_size array\n arr.each_with_index do |sub_arr, row|\n sub_arr.each_with_index { |elem, col| new_arr[col][row] = elem }\n end\n new_arr\nend",
"def transpose(a)\n # get the number of rows and columns\n # create empty matrix where # of rows = # of columns, and vice versa\n rows = a.length\n cols = a[0].length\n newA = Array.new(cols) {Array.new(rows)}\n\n i = j = 0\n while i < rows\n while j < cols\n # swap them\n newA[j][i] = a[i][j]\n j += 1\n end\n i += 1\n # don't forget to reset j after every column\n j = 0\n end\n\n newA\nend",
"def transposed(matrix, size)\n # TODO (Step 2): Implement on CPU\n return [1.0, 2.0, 3.0, 4.0]\nend",
"def transpose(arr)\n transposed = Array.new([[], [], []])\n arr.each_index do |outer_i|\n arr.each_index do |inner_i|\n transposed[inner_i][outer_i] = arr[outer_i][inner_i]\n end\n end\n transposed\nend",
"def transpose(mtrx)\n new_mtrx = Array.new(3) { Array.new(3) }\n new_mtrx.each_with_index do |sub_arr, idx|\n sub_arr.each_with_index do |element, inner_idx|\n new_mtrx[idx][inner_idx] = mtrx[inner_idx][idx]\n end\n end\n new_mtrx\nend",
"def transpose(matrix)\n result = Array.new(matrix[0].length, []) #HARD - PASS BY REFERENCE ISSUE\n matrix.each do |row|\n row.each_with_index do |el, col_idx|\n result[col_idx] << el\n end\n end\n result\nend",
"def transpose(array)\n return [] if array.empty?\n result = []\n array.first.length.times do |i|\n array.each_with_index do |inner, inner_index|\n result[i] ||= []\n result[i] << array[inner_index][i]\n end\n end\n result\nend",
"def transpose(before)\n after = [[],[]]\n\n before.each_with_index do |n1, i|\n n1.each_with_index do |n2, j|\n after[i][j] = before[j][i]\n end\n end\n\n after\nend",
"def transpose(matrix)\narray1 = []\narray2 = []\narray3 = []\nretrun_matrix = []\n\nmatrix.each do |element_1, element_2, element_3|\n array1 << element_1\n array2 << element_2\n array3 << element_3\n end \n retrun_matrix << array1 \n retrun_matrix << array2\n retrun_matrix << array3 \n return retrun_matrix\nend",
"def transpose(matrix)\n\t#\n\t# your code goes here\n result = [] #empty arr as accumulator\n i = 0\n while i < matrix.length #iterates trhough matrix\n array = []\n matrix.each do |sub_matrix| #iterates through sub_matrix\n array << sub_matrix[i] #sends elements to array\n end\n result << array #sends new sub-array to result\n i += 1\n end\n\n result\nend",
"def my_transpose\n row_length = length\n col_length = first.length\n transposed = Array.new(col_length) { Array.new(row_length) }\n\n (0...row_length).each do |row|\n (0...col_length).each do |col|\n transposed[col][row] = self[row][col]\n end\n end\n transposed\n end",
"def transpose(matrix)\n #\n # your code goes here\n #\n i = 0\n while i < matrix.length\n j = i\n while j < matrix.length\n if i != j\n temp_value = matrix[i][j]\n matrix[i][j] = matrix[j][i]\n matrix[j][i] = temp_value\n end\n j += 1\n end\n i += 1\n end\n matrix\nend",
"def my_transpose\n ret = []\n i=0\n while i < self.length\n j=0\n ret2 = []\n while j < self[i].length\n ret2 << self[j][i]\n j += 1\n end\n ret << ret2\n i += 1\n end\n ret\n end",
"def My_Transpose(nums) \n transposed_matrix=[]\n givens_0=nums[0]\n givens_1=nums[1]\n givens_2=nums[2]\n \n transposed_matrix[0]=[givens_0[0],givens_1[0],givens_2[0]]\n transposed_matrix[1]=[givens_0[1],givens_1[1],givens_2[1]]\n transposed_matrix[2]=[givens_0[2],givens_1[2],givens_2[2]]\n \n puts(\"the first row of the transposed_matrix[0] is #{transposed_matrix[0]}\")\nend",
"def transpose(matrix)\n transpose_matrix = []\n matrix.each_with_index do |row, row_index|\n row.each_with_index do |item, col_index|\n if transpose_matrix[col_index] == nil\n transpose_matrix[col_index] = [] # cannot use a[index] << [] as it will raise error as a[index] return nil which do not have << method\n end\n transpose_matrix[col_index][row_index] = item\n end\n end\n \n transpose_matrix\nend",
"def my_transpose(trans_arr)\n i, j = 0, 1\n array_copy = trans_arr.dup\n (i...trans_arr.length-1).each do |index_one|\n (j...trans_arr.length).each do |index_two|\n array_copy[index_one][index_two], array_copy[index_two][index_one] =\n array_copy[index_two][index_one], array_copy[index_one][index_two]\n end\n end\n array_copy\n end",
"def transpose\n gather { [] }.\n map(element_type: :array) { |a| a.transpose }.\n scatter(element_type: :array)\n end",
"def transpose\n gather { [] }.\n map(element_type: :array) { |a| a.transpose }.\n scatter(element_type: :array)\n end",
"def my_transpose\n result = Array.new(length) { Array.new(length) }\n self.each_with_index do |row, r|\n row.each_with_index do |num, c|\n result[r][c] = self[c][r]\n end\n end\n result\n end",
"def my_transpose\n output = Array.new(self.length) {Array.new(self.length)}\n\n self.each_with_index do |row, row_i|\n row.each_with_index do |col, col_i|\n output[col_i][row_i] = self[row_i][col_i]\n end\n end\n output\n end",
"def my_transpose\n transpose_arr = Array.new(self.length){Array.new(self.length)}\n self.each_with_index do |arr, idx1|\n arr.each_with_index do |ele, idx2|\n transpose_arr[idx2][idx1] = ele\n end\n end\n transpose_arr\n end",
"def do_transpose(character_matrix)\n replace_nil_with_space = ->(char) { char || ' ' }\n\n character_matrix\n .each_with_index\n .each_with_object([]) { |row_pair, arr| transpose_row_to_column(row_pair, arr) }\n .map { |row| row.map(&replace_nil_with_space) }\n end",
"def transpose(array)\n result = []\n number = array.count\n if array.empty?\n single_array = array\n else\n single_array = [array[0]]\n end\n single_array.each do |val|\n val.each do |v|\n new_array = []\n number.times do\n new_array << v\n end\n result << new_array\n end\n end\n result\nend",
"def transpose(dim_a, dim_b)\r\n FlexArray.new_from_array(self).transpose!(dim_a, dim_b)\r\n end",
"def rotate(matrix)\n n = matrix.length\n matrix = transpose(matrix, n)\n reverse_columns(matrix, n)\nend",
"def transpose(tensor, perm = nil, name: \"transpose\")\n _op(:transpose, tensor, perm, name: name)\n end",
"def my_transpose\n new_array = []\n\n (0...self.length).each do |row|\n new_row = []\n\n (0...self.length).each do |col|\n new_row << self[col][row]\n \n end\n new_array << new_row\n end\n new_array\n end",
"def transpose!\n raise NotImplementedError\n end",
"def transpose(permute = nil)\n if permute.nil?\n if self.dim == 1\n return self.clone\n elsif self.dim == 2\n new_shape = [self.shape[1], self.shape[0]]\n else\n raise(ArgumentError, \"need permutation array of size #{self.dim}\")\n end\n elsif !permute.is_a?(Array) || permute.sort.uniq != (0...self.dim).to_a\n raise(ArgumentError, \"invalid permutation array\")\n else\n # Figure out the new shape based on the permutation given as an argument.\n new_shape = permute.map { |p| self.shape[p] }\n end\n\n if self.dim > 2 # FIXME: For dense, several of these are basically equivalent to reshape.\n\n # Make the new data structure.\n t = self.reshape_clone_structure(new_shape)\n\n self.each_stored_with_indices do |v,*indices|\n p_indices = permute.map { |p| indices[p] }\n t[*p_indices] = v\n end\n t\n elsif self.list? # TODO: Need a C list transposition algorithm.\n # Make the new data structure.\n t = self.reshape_clone_structure(new_shape)\n\n self.each_column.with_index do |col,j|\n t[j,:*] = col.to_flat_array\n end\n t\n else\n # Call C versions of Yale and List transpose, which do their own copies\n if jruby?\n nmatrix = NMatrix.new :copy\n nmatrix.shape = [@shape[1],@shape[0]]\n twoDMat = self.twoDMat.transpose\n nmatrix.s = ArrayRealVector.new(ArrayGenerator.getArrayDouble(twoDMat.getData(), shape[1],shape[0]))\n return nmatrix\n else\n self.clone_transpose\n end\n end\n end",
"def transpose(tensor, perm: nil, name: 'transpose')\n _op(:transpose, tensor, nil, perm: perm, name: name)\n end",
"def transpose\n # So. Pointless. Blerg.\n IterableArray.new(@array.transpose.map do |x|\n IterableArray.new x\n end)\n end",
"def transpose\n t = super()\n t.flip!\n end",
"def my_transpose\n\n end",
"def my_transpose\n transposed = []\n\n i = 0\n until transposed.length == length\n current = []\n self.each do |arr|\n current << arr[i]\n end\n i += 1\n transposed << current\n end\n\n transposed\n end",
"def transpose(transformation)\n a = transformation.to_a\n\n Geom::Transformation.new([\n a[0], a[4], a[8], 0,\n a[1], a[5], a[9], 0,\n a[2], a[6], a[10], 0,\n 0, 0, 0, a[15]\n ])\n end",
"def rotate(matrix) \n rows, cols = matrix.size, matrix[0].size\n Array.new(cols) {|i| Array.new(rows) {|j| matrix[j][cols - i - 1]}}\n end",
"def transpose(array)\n\ttransposed = []\n\n\tfor item in array\n\t\tif item.kind_of?(Array)\n\t\t\tfor i in (0... item.count)\n\t\t\t\tif i < transposed.count\n\t\t\t\t\ttransposed[i].push(item[i]) \n\t\t\t\telse \n\t\t\t\t\ttransposed.push([item[i]])\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\ttransposed.push([item])\n\t\tend\n\tend\n\n\treturn transposed\nend",
"def transpose\n\n # pre-conditions and invariants\n _invariants\n\n newDelegate = @delegate.clone\n newDelegate.transpose\n\n newMatrix = SparseMatrix.new(newDelegate)\n\n # post-conditions and invariants\n _invariants\n assert_equal(self.row_size,newMatrix.column_size,\"post-condition\")\n assert_equal(self.column_size,newMatrix.row_size,\"post-condition\")\n (0..self.row_size-1).each { |i|\n (0..self.column_size-1).each { |j|\n assert_equal(self[i,j],newMatrix[j,i],\"post-condition\")\n }\n }\n\n return newMatrix\n end",
"def trans(input)\n\trows, columns = input.count, input.first.count\n\tx, y = [], []\n\ti = j = 0\n\twhile j < columns do\n\t\twhile i <= rows - 1 do\n\t\t\tx.push(input[i][j])\n\t\t\ti += 1\n\t\tend\n\t\tj += 1 #go to next column\n\t\ti = 0 #reset the inner counter to go back to 1st array\n\tend\n\tx.each_slice(rows).each.map{|e| y.push(e)}\n\treturn y\nend",
"def rotate(matrix, direction)\n if direction == \"clockwise\"\n matrix.transpose.map{|i| i.reverse}\n else\n rotated = []\n matrix.transpose.map{|i| i.reverse}.flatten.reverse.each_slice(matrix.size){\n |a| rotated << a}\n rotated\n end\nend",
"def flip_horizontal(matrix)\n matrix.map(&:reverse)\n end",
"def rotate matrix, direction\n direction == 'clockwise' ? matrix.reverse.transpose : matrix.transpose.reverse\nend",
"def transpose\n result = self.class.new(cols, rows)\n _transpose_memcpy(result.gsl, self.gsl)\n result\n end",
"def rotate_matrix(arr)\n flipped_array = [] # initialize empty array\n transposed_arr = my_transpose(arr) # flip the rows with columns inside using a transpose method\n transposed_arr.each { |row| flipped_array << row.reverse } # once we reverse the new rows, it goes from 45 to 90 degrees rotation\n flipped_array\nend",
"def get_transpose()\n transpose_graph = Graph.new(26)\n\n for i in 0..@number_of_vertices -1 do\n @adjacent_list[i].each do |x|\n transpose_graph.add_edge(x, i)\n end\n end\n\n transpose_graph\n end",
"def flip_vertical(matrix)\n matrix.reverse\n end",
"def rotate_matrix(image_matrix)\n reverse_matrix = image_matrix.reverse\n rotated_matrix = []\n (0...image_matrix.length).each do |i|\n col = reverse_matrix.map { |row| row[i] }\n rotated_matrix[i] = col\n end\n rotated_matrix\nend",
"def transpose!\n super()\n self.flip!\n end",
"def rotate_a(matrix)\n res = []\n n = matrix.size\n\n n.times do |row|\n new_row = []\n\n n.times do |col|\n new_row[col] = matrix[n - col - 1][row]\n end\n\n res[row] = new_row\n end\n\n res\nend",
"def transpose_row_to_column(row_pair, arr)\n row, row_index = row_pair\n\n row.each_with_index.each_with_object(arr) do |column_pair, arr|\n char, column_index = column_pair\n\n arr[column_index] ||= []\n arr[column_index][row_index] = char\n end\n end",
"def symmetrize(array)\n\t\tfirst_matrix = Matrix.rows(array)\n\t\tfirst_matrix.each_with_index do |e, row, col|\n\n\t\t\tunless e == first_matrix[col, row]\n\t\t\t\tif e == 0\n\t\t\t\t\t# puts row, col\n\t\t\t\t\t# puts our_matrix[col,row]\n\t\t\t\t\tarray[col][row] = 0\n\t\t\t\telsif e == 1\n\t\t\t\t\tarray[row][col] = 0\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tsecond_matrix = Matrix.rows(array)\n\t\treturn second_matrix\n\tend",
"def rotate_matrix(matrix)\n (0...matrix.length).each do |row|\n col = row + 1\n while col < matrix.length\n matrix[row][col], matrix[col][row] = matrix[col][row], matrix[row][col]\n col += 1\n end\n end\n\n (0...matrix.length).each do |row|\n start_col = 0\n end_col = matrix.length - 1\n\n while start_col < end_col\n matrix[row][start_col], matrix[row][end_col] = matrix[row][end_col], matrix[row][start_col]\n start_col += 1\n end_col -= 1\n end\n end\n\n matrix\nend",
"def rotate(matrix)\n newMatrix, finalMatrix, i = [], [], 0\n (matrix.length > matrix[0].length ? matrix.length : matrix[0].length).times do\n matrix.map { |row| row[i] != nil ? newMatrix << row[i] : nil }\n i+=1\n end\n newMatrix.each_slice(matrix.length).to_a.reverse\n end",
"def rotate_matrix(array)\n\n\nend",
"def Matrix3dTranspose(arg0)\n ret = _invoke(1610743899, [arg0], [VT_BYREF | VT_DISPATCH])\n @lastargs = WIN32OLE::ARGV\n ret\n end",
"def t\n return Matrix.new(@cols, @rows) {|i,j| self[j,i]}\n end",
"def conjugate_transpose\n self.transpose.complex_conjugate!\n end",
"def t\n return Matrix.new(@rows, @cols) {|i,j| self[j,i]}\n end",
"def rotate(matrix, num_rotations=1)\n num_rotations.times.inject(matrix) { |result, transpose| result.transpose.map(&:reverse) }\n end",
"def transpose\n first_row = @list[0]\n other_rows = @list[1..-1]\n @list = first_row.zip(*other_rows)\n self\n end",
"def rotate90(matrix)\n new_matrix = Array.new(matrix[0].size) { Array.new }\n matrix.each_with_index do |sub_array, row|\n matrix[0].size.times do |col|\n new_matrix[col][matrix.size - row - 1] = sub_array[col]\n end\n end\n\n new_matrix\nend",
"def transpose(ciphertexts)\n max = ciphertexts.max_by(&:size).size # The maximum (and necessarily common) column size is that of the lengthiest ciphertext.\n ciphertexts.map { |c| c.chars.values_at(0...max) }.transpose.map(&:join)\nend",
"def rotate90(matrix, degrees = 90)\n rotated = matrix\n (degrees / 90).times { rotated = rotated.transpose.map(&:reverse) }\n rotated\nend",
"def rotate_matrix(arr)\n\nend",
"def challenge137(input)\n # Using the built-in transpose method.\n # Could have used the 'safe transpose' method found in http://www.matthewbass.com/2009/05/02/how-to-safely-transpose-ruby-arrays/\n # but I figured I'd go the padding route to learn something (I'm new to ruby).\n transposed_array = normalize_array(input.lines).transpose\n transposed_array.each { |line| p line }\nend",
"def normalized_transpose(pad='')\n sizes = row_sizes\n min_size = sizes.min\n max_size = sizes.max\n source = if min_size != max_size # Multiple row sizes\n map{|row| row + [pad]*(max_size - row.size)}\n else\n source = self\n end\n source.transpose\n end",
"def rotateAndFlip(image)\n return image.transpose.flip\nend"
] |
[
"0.8549761",
"0.8145293",
"0.8130179",
"0.8044132",
"0.8036772",
"0.80194366",
"0.78922045",
"0.78857267",
"0.78701156",
"0.7835674",
"0.77904093",
"0.7743675",
"0.7709621",
"0.7679929",
"0.76343864",
"0.7625317",
"0.7614516",
"0.76110506",
"0.75981283",
"0.75806314",
"0.7516613",
"0.749987",
"0.74874204",
"0.7485529",
"0.7460738",
"0.7393313",
"0.73365605",
"0.7314088",
"0.72874606",
"0.727756",
"0.7270874",
"0.71815014",
"0.7172938",
"0.7167914",
"0.715495",
"0.70915204",
"0.70832586",
"0.7068164",
"0.70522135",
"0.700167",
"0.69981885",
"0.695897",
"0.69548786",
"0.6949749",
"0.69323605",
"0.692985",
"0.6904378",
"0.68818486",
"0.68786573",
"0.68772244",
"0.68772244",
"0.68420434",
"0.6738274",
"0.67050695",
"0.667631",
"0.6660729",
"0.6598438",
"0.6510593",
"0.6472431",
"0.6465394",
"0.6456934",
"0.6445404",
"0.64432716",
"0.64286894",
"0.6428587",
"0.6424735",
"0.64166147",
"0.63774574",
"0.6357737",
"0.62904495",
"0.6277656",
"0.62724626",
"0.6270268",
"0.6262654",
"0.6211279",
"0.6155778",
"0.6150647",
"0.6067933",
"0.6037705",
"0.5990432",
"0.59878224",
"0.5909621",
"0.583223",
"0.5794819",
"0.57841",
"0.57732123",
"0.5699707",
"0.5698499",
"0.5693641",
"0.5664912",
"0.5656559",
"0.5638775",
"0.55977887",
"0.5593111",
"0.5578214",
"0.5539104",
"0.5500274",
"0.54686844",
"0.5459631",
"0.54578024"
] |
0.82158756
|
1
|
Prints a 2D matrix
|
def print_matrix(matrix)
matrix.each do |row|
p row
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def print_matrix\n @matrix.each do |m|\n print \"#{m}\\n\"\n end\n end",
"def print_matrix\n width = @rows.flatten.max.to_s.size\n if width > 4 then\n width = width - 0.5\n end\n puts @rows.map { |a|\n \"|#{ a.map { |i|\n outp = \"\"\n num, den = i.to_fraction\n if den == 1 then\n outp += \"#{num}\"\n else\n outp += \"#{num}/#{den}\"\n end\n \"#{outp.rjust(width)} |\"\n }.join }\"\n }\n puts \"↓\"\n end",
"def print_matrix\n for i in 0...@number_of_rows\n for j in 0...@number_of_columns\n print @matrix[i][j]\n end\n puts ''\n end\n end",
"def print_matrix(m)\n (0...m.length).each do |i|\n step = 0\n (0..i).each do |_j|\n print \"#{m[i - step][step]} \"\n step += 1\n end\n puts ''\n end\nend",
"def print\n @maze[:matrix].each do |line|\n puts line.join\n end\n end",
"def print_matrix(matrix)\n puts separator = '-' * matrix.first.length * 6 + '--'\n\n matrix.each do |row|\n line = ''\n row.each do |col|\n line += col.to_s.rjust(3).ljust(6)\n end\n puts \"|#{line}|\".yellow\n end\n\n puts separator\nend",
"def print_matrix(m, row = nil, col = nil, rbold = nil)\n print \"\\n\"\n for i in 0..m.size-1\n print \"|\\t\"\n for j in 0..m[i].size-1\n n = m[i][j]\n if n.is_a? Numeric\n n = n.round(2)\n #n = n.to_r.rationalize(Rational('0.005')) #printar em fração\n #n = n.numerator if n.denominator == 1\n\n if row==i&&col==j\n print n.to_s.reverse_color\n elsif rbold == i\n print n.to_s.bold.bg_blue\n else\n print n\n end\n else\n print n\n end\n print \"\\t\" \n end\n puts \"|\"\n end\n print \"\\n\"\nend",
"def pp_matrix(matrix)\n matrix.each { |x| puts x.map { |y| y.inspect[1...-1].split('').join(' ') + ' , ' }.join[0...-3] }\n print_new_line\nend",
"def paintMatrix(a)\n\t\n\tputs \" | 1 | 2 | 3 | 4 | 5 | 6\".green\n\tputs \"\"\n\tfor i in 0..5\n\t\tif ( i != 0 )\n\t\tputs \" \"\n\t\tend\n\t\tfor j in 0..5\n\t\t\t\tprint \" | \".blue\n\t\t\t\tprint \"#{a[i][j]}\"\n\t\tend\n\t\tputs \"\"\n\tend\n\tputs\"\"\n\tend",
"def display\t\n \tstring = \"\\n +-----------------------+\".green\n \t@matrix.each_index{ |i|\n \tstring += \"\\n |\".green\n v = @matrix[i]\n \tv.each_index{|j|\n \t\tif (v[j] != 0)\n \t\t\tstring += \" \" + v[j].to_s\n \t\telse \n \t\t\tstring += \" .\"\n \t\tend\n \t\t\t\t\n \t\tif (j == 2 || j == 5 || j == 8)\n \t\t\tstring += \" |\".green\n \t\tend\n \t\t}\n \t\tif (i == 2 || i == 5)\n \t\t\tstring += \"\\n |-------+-------+-------|\".green\n \t\tend\n \t}\n \tstring += \"\\n +-----------------------+\".green\n\tend",
"def puts2DArray(my2DArray)\r\n puts '['\r\n my2DArray.each do |row|\r\n puts \"[#{row.join(\", \\t\")}]\"\r\n end\r\n puts ']'\r\n end",
"def dump_matrix(*arg)\n matrix = self.to_matrix(*arg)\n sorted = @index.sort {|a,b| a[1] <=> b[1]}\n \"[# \" + sorted.collect{|x| x[0]}.join(\", \") + \"\\n\" +\n matrix.to_a.collect{|row| ' ' + row.inspect}.join(\",\\n\") + \"\\n]\"\n end",
"def dump_matrix(*arg)\n matrix = self.to_matrix(*arg)\n sorted = @index.sort {|a,b| a[1] <=> b[1]}\n \"[# \" + sorted.collect{|x| x[0]}.join(\", \") + \"\\n\" +\n\tmatrix.to_a.collect{|row| ' ' + row.inspect}.join(\",\\n\") + \"\\n]\"\n end",
"def print_matrix\n persons = unique_points.to_a.sort{|x, y| x.id <=> y.id}\n print \"\\t \"\n #persons.each{ |p| print(\" #{p.id} \") }\n persons.each do |p|\n len = p.id.to_s.length\n len == 1 ? print(\" #{p.id} \") : print(\" #{p.id} \")\n end\n puts\n (0...persons.count).each do |i|\n p = persons[i]\n puts\n row = am[i]\n print(\"#{p.name} \")\n if p.name.length < 7\n print(\"\\t \")\n elsif p.name.length == 7\n print(\" \")\n else\n print(\"\")\n end\n row.each do |cell|\n len = cell.to_s.length\n if cell.nil?\n print(\" -- \")\n else\n len == 1 ? print(\" #{cell} \") : print(\" #{cell} \")\n end\n end\n print(\" #{p.id}\")\n end\n nil\n end",
"def print\n board_print = \"\"\n\n for x in 0..@matrix.length - 1\n for y in 0..@matrix[x].length - 1\n if @matrix[x][y] == \"KK\"\n board_print << @matrix[x][y]\n else\n board_print << format('%02d', @matrix[x][y]).to_s\n end\n\n board_print << \" \"\n end\n\n board_print << \"\\n\"\n end\n\n board_print << \"\\n\"\n puts board_print\n end",
"def printmatrices\n count = 0;\n @matrices.each do |matrix|\n puts \"Matrix \" + count.to_s\n count += 1\n for i in 0..3\n for o in 0..3\n print matrix[i][o]\n print \" \"\n end\n print \"\\n\"\n end\n print \"\\n\"\n end\nend",
"def visualize_array\n(0...ROWS).each { |row|\n (0...COLS).each { |col|\n print row.to_s + \" \" + col.to_s + \" \"\n print \"(\" + (COLS*row + col).to_s + \") \" # index into board array\n }\n puts\n}\nend",
"def print_grid grid = @grid\n puts (('+-' * grid.first.length) + '+').black\n @y.times do |y|\n @x.times do |x|\n print '|'.black\n print text_representation(grid[x][y])\n end\n print '|'.black\n puts (\"\\n\" + ('+-' * grid[y].length) + '+').black\n end\n end",
"def print_board\n\t\tprint \"\\n\"\n\t\t(0..2).each do |row|\n\t\t\t(0..2).each do |column|\n\t\t\t\tprint @board[row][column]\n\t\t\t\tprint \" | \" unless column == 2\n\t\t\tend\n\t\t\t\n\t\t\tprint \"\\n---------\\n\" unless row == 2\n\t\tend\n\t\tprint \"\\n\\n\"\n\tend",
"def display_board(matrix, message = [])\n message.each{ |m| puts m }\n\n puts <<-eos\n A B C D E F G H I J\n +---------------------------------------+\n eos\n matrix.each_with_index do |x, i|\n puts <<-eos\n #{i+1} #{\" \" if i != 9}| #{x[0]} | #{x[1]} | #{x[2]} | #{x[3]} | #{x[4]} | #{x[5]} | #{x[6]} | #{x[7]} | #{x[8]} | #{x[9]} |\n |---|---|---|---|---|---|---|---|---|---|\n eos\n end\n\n puts <<-eos\n +---------------------------------------+\n eos\nend",
"def output_matrices(p)\n m = matrixjson(p)\n m.each do |d|\n puts d[0]\n d[1].each do |mr|\n mr.each do |c|\n print \"#{c}#{c.to_s == \" \" || c < 10 ? ' ' : ''} \"\n end\n puts\n end\n puts\n end\nend",
"def display\n print \"\\n\"\n @x.times{ |r|\n @y.times{|c| \n print @mat[r][c].is_alive ? \"X \" : \"- \"\n }\n print \"\\n\"\n }\n end",
"def to_s\n s = \"\"\n i = 0\n while(i < @col)\n j = 0\n while(j < @fil)\n s += \"#{@matrix[i][j].to_s}\\t\"\n j += 1\n end\n s += \"\\n\"\n i += 1\n end\n s\n end",
"def show_board\n \t@y.times do |y|\n \t\tputs ' '\n \t\t@x.times do |x|\n \t\t\tprint \"#{@board[y][x]} \"\n \t\tend\n \tend \n \tputs ' '\n end",
"def print_mat(matrix, delim=nil)\n puts matrix.map{|x| delim ? x.join(delim) : x.inspect}\nend",
"def display()\n\t\tmaze.each do|x| \n\t\t\tx.each {|j| print j}\n\t\t\tputs\n\t\tend\n\tend",
"def display\n @mat.each do | _ ,row|\n row.each do |ele|\n if ele == \"1\"\n print ele\n else\n print \" \"\n end\n end\n puts \"\\n\"\n end\n end",
"def imprimir_Matriz\n\t\tx,y = 0,0\n\t\t\n\t\twhile x < row\n\t\t\twhile y < col\n\t\t\t\tprint(\"#{matriz[x][y]} \\t\")\n\t\t\t\tprint(\"\") \n\t\t\t\ty= y + 1\t\t\t\n\t\t\tend\n\t\t\tputs\n \t\t\tx = x + 1\n \t\t\ty = 0\n\t\tend\n\t\tputs \n\tend",
"def display\n\t\tputs \"\\n\"\n\t\t(0..2).each do |row|\n\t\t\t(0..2).each do |col|\n\t\t\t\tprint \" \" + @board[row][col].to_s + \" \"\n\t\t\t\tprint \"|\" unless col == 2\n\t\t\tend\n\t\t\tputs row == 2 ? \"\\n\\n\" : \"\\n-----------\\n\"\n\t\tend\n\tend",
"def show \n for i in 0...size\n for j in 0...size\n print @grid[i][j] + \" \"\n end\n print \"\\n\"\n end\n print \"\\n\"\n end",
"def print_board\n @tablero.row_vectors().each_with_index { |row, i|\n print \"#{row.component(i)}\\n\"\n }\n #Imprime los numeros de las columnas\n (1..@tablero.row_vectors.size).each { |n|\n print \" #{n} \"\n }\n puts\n #Imprime las letras de las filas\n letras = (\"A\"..\"Z\").to_a\n (0...@tablero.row_vectors.size).each do |i|\n print \"#{letras[i]} \"\n @tablero.row_vectors()[i].each do |fila|\n print \" #{fila} | \"\n end\n puts\n print \" ----\" * @tablero.row_count\n puts\n end\n end",
"def to_s\n cad = \" \"\n for i in 0...nfil\n cad << \" [ \"\n for j in 0...ncol\n\tcad << \"#{mat[i][j]} \"\n end\n cad << \"]\"\n cad << \"\\n \"\n end\n return cad\n end",
"def print\n @cell_board.each do |row|\n string_row_separator = '-'\n string_row = '|'\n row.each do |element|\n string_row += \" #{element.to_s} |\"\n string_row_separator += '----'\n end\n puts string_row\n puts string_row_separator\n end\n end",
"def display ()\n @maze_table.each_with_index do |row, i|\n (0..row.size-1).each do |index|\n print \"+\" if row[index] == \"1\" && i % 2 == 0 && index % 2 == 0\n print \"-\" if row[index] == \"1\" && i % 2 == 0 && index % 2 == 1\n print \"|\" if row[index] == \"1\" && i % 2 == 1 \n print \" \" if row[index] == \"0\"\n end\n print \"\\n\"\n end\n end",
"def output_image\n @transformed_matrix.each do |element|\n puts element.join\n end\n end",
"def display_print\n @grid.each_with_index do |row, row_idx|\n row.each_with_index do |element, column_idx|\n separator = (column_idx % 3 == 2) ? \" \" : \" \"\n print element.to_s + separator\n end\n puts\n puts if (row_idx % 3 == 2)\n end\n nil\n end",
"def print_board\r\n @squares.each do | i |\r\n print \" \"\r\n puts \"-\" * 33\r\n i.each do | val |\r\n print \" | \"\r\n print val\r\n end\r\n puts \" |\"\r\n end\r\n print \" \"\r\n puts \"-\" * 33\r\n puts \"\\n\"\r\n end",
"def print_board\n col_numbers = [' ']\n (1..8).each do |row|\n row_items = []\n\n col_numbers << ' ' + row.to_s + ' '\n row_items << row\n \n (1..8).each do |col|\n row_items << @board[[row,col]].console_rep\n end\n\n puts row_items.join(' ')\n end\n puts col_numbers.join(' ')\n end",
"def display_board\n col_separator = ' | '\n row_separator = '--+---+--'\n\n @rows.each_with_index do |row, row_number|\n row.each_with_index do |col, col_number|\n print col.to_s\n print col_separator unless col_number + 1 >= row.length\n end\n puts ''\n puts row_separator unless row_number + 1 >= @rows.length\n end\n end",
"def to_s\n @matrix.inject('') do |combined_rows, row|\n formatted_row =\n row.inject('') { |combined_cells, cell| \"#{combined_cells} #{cell}\" }\n \"#{combined_rows}\\n#{formatted_row}\"\n end\n end",
"def print_board\n\n\t\t@board.each_with_index do |row, i|\n\n\t\t\trow.each do |space|\n\n\t\t\t\tprint \"|#{space}|\"\n\n\t\t\tend\n\n\t\t\tif i == 2\n\t\t\t\tputs \"\"\n\t\t\telse\n\t\t\t\tputs \"\"\n\t\t\t\tputs \"---------\"\n\t\t\tend\n\n\t\tend\n\n\tend",
"def print_table\n dimension_length = (@numbers_to_multiply.length)\n topColumn = \"\"\n for i in 0..dimension_length\n topColumn += \" #{@multiplication_table[0][i]} |\"\n end\n for x in 0..dimension_length \n rowValues = \"\"\n for y in 0..dimension_length\n nextEntry = @multiplication_table[x][y]\n rowValues << \" #{nextEntry} |\"\n end\n puts rowValues\n end\n end",
"def print_grid\n rows = @grid.map do |row|\n row.join(\" \")\n end\n print rows.join(\"\\n\")\n end",
"def display_matrix( matrix )\n return if ! matrix.keys[0]\n\n state_names = matrix.keys\n event_names = matrix[matrix.keys[0]].keys\n len_ev = 8\n event_names.each { |k| len_ev = k.length if k.length > len_ev }\n\n printf( \"%*s \", len_ev, \"\" )\n state_names.each { |st| printf( \"%-6s \", st ) }\n printf( \"\\n\" )\n\n event_names.each do |ev|\n printf( \"%-*s \", len_ev, ev )\n state_names.each do |st|\n w = st.length > 6 ? st.length : 6\n printf( \"%-*s \", w, matrix[st][ev] )\n end\n printf( \"\\n\" )\n end\nend",
"def to_s\n matS = \"\"\n for i in 0...@nF do\n for j in 0...@nC do\n matS = matS + @matriz[i][j].to_s + \" \"\n end\n matS = matS + \"\\n\"\n end\n matS\n end",
"def printBoard\n for i in 0..(row.to_i - 1)\n for j in 0..(column.to_i - 1)\n print board[i][j]\n end\n puts \"\"\n end \n \n column.times do\n print \"=\"\n end\n puts \"\"\n end",
"def display\n i=0\n print \" \"\n 0.upto(9) do |x|\n print\" #{x} \"\n end\n 10.upto(@cols-1) do |x|\n print\" #{x}\"\n end\n print \"\\n\"\n print \" \"\n 0.upto(@cols-1) do\n print\"---\"\n end\n print \"\\n\"\n 0.upto(9) do |x|\n\t\t\tprint\" #{x}\"\n\t\t\t0.upto(@rows-1) do |y|\n \t\t \tprint @map[x][y].value\n\t\t\tend\n\t\t\t\tprint \"\\n\"\n \t\tend\n 10.upto(@rows-1) do |x|\n\t\t\tprint\"#{x}\"\n\t\t\t0.upto(@rows-1) do |y|\n \t\t \tprint @map[x][y].value\n\t\t\tend\n\t\t\t\tprint \"\\n\"\n end\n return nil\n\tend",
"def show\n 1.upto(width).each { |x| print \" \" + \"#{x}\"}\n print \"\\n\"\n\n grid.each_with_index do |row, index|\n print \"#{index + 1} #{row} \\n\"\n end\n end",
"def to_s\n set_current_position!\n matrix.reverse.map { |row| row.join(' ') }.join(\"\\n\")\n end",
"def print_grid\n for i in 0..@height-1\n for j in 0..@width-1\n print @grid[i][j]\n print \" \"\n end\n print \"\\n\"\n end\n end",
"def print_graph()\n puts \"Adjacency Matrix\"\n @adjacent_list.each_with_index {|value, index| puts \"#{index} #{value} \\n\" }\n\n puts \"Indegree Matrix\"\n @indegree.each_with_index {|value, index| puts \"#{index} #{value} \\n\" }\n end",
"def print_2d_array(a)\r\n\r\n max_word_length = 0 # keeps track of the longest string in layout\r\n flattened = a.flatten\r\n flattened.each{|x| if x.length > max_word_length\r\n max_word_length = x.length \r\n end}\r\n max_word_length += 1 # we want a space in front when printing\r\n \r\n # insert a row of numbers into layout for printing\r\n max_no_columns = 0\r\n a.each{|x| if x.length > max_no_columns\r\n max_no_columns = x.length\r\n end}\r\n counter_array = [*0...max_no_columns] # [0, 1, 2, 3....max_no_columns]\r\n \r\n # clone, insert numbers into array, then print\r\n temp = Marshal.load(Marshal.dump(a))\r\n temp.unshift(counter_array) # insert in front\r\n print_array(temp, max_word_length) \r\nend",
"def print_grid\n puts \"Generation: #{@generation}\"\n @width.times do |x|\n @height.times do |y|\n print \"#{@current_generation[x][y]}\" + \" \"\n end\n puts\n end\n puts \"-------------------------------------------------\"\n end",
"def print\n displayBoard = []\n @board.each_with_index { |elem, index|\n if index % @columns == 0\n displayBoard.push(\"\\n\")\n end\n displayBoard.push(elem)\n }\n puts displayBoard.join\n end",
"def print_maze(maze)\n $debug ? maze.each { |row| row.each { |col| print col.to_s.ljust(3)};puts} : maze.each { |row| row.each { |col| print col.to_s};puts}\nend",
"def print_board\n print to_s\n # @board.each do |row|\n # row.each do |square|\n # print \" #{square.number} \"\n # end\n # puts \"\"\n # end\n end",
"def print_board\n puts\n @board.each_with_index do |row, index|\n print \" \"\n row.each_with_index do |element, index|\n print \" \" + element.to_s.center(3, \" \") + \" \"\n if(index < row.length - 1)\n print \"|\"\n else\n print \"\\n\"\n end\n end\n\n if(index < @board.length - 1)\n print \" \"\n row.each_with_index do |element, index|\n print \"-----\"\n if(index < row.length - 1)\n print \"+\"\n else\n print \"\\n\"\n end\n end\n end\n end\n puts\n end",
"def display\n #if the user haven't load the maze\n if maze_mat[0][0].nil?\n puts \"empty maze! please load a maze!\"\n return\n end\n n.times do |i|\n m.times do |j|\n if i % 2 == 0 && j % 2 == 1\n print_char(i, j, \"-\")\n elsif i % 2 == 1 && j % 2 == 1\n print_char(i, j, \" \")\n elsif i % 2 == 1 && j % 2 == 0\n print_char(i, j, \"|\")\n else\n print\"+\"\n end\n end\n puts\n end\n end",
"def print_board\n horizontal_rule = \" -------------\"\n row_one = \" 1 2 3 \"\n row_two = \" a | #{@array[0][0]} | #{@array[0][1]} | #{@array[0][2]} |\"\n row_three = \" b | #{@array[1][0]} | #{@array[1][1]} | #{@array[1][2]} |\"\n row_four = \" c | #{@array[2][0]} | #{@array[2][1]} | #{@array[2][2]} |\"\n \n print row_one + \"\\n\", row_two + \"\\n\", horizontal_rule + \"\\n\", \n row_three + \"\\n\", horizontal_rule + \"\\n\", row_four + \"\\n\"\n end",
"def print_board(board)\n # See http://cl.ly/image/3t450Y271d25 for expected output\n\n\tfor i in 0..board.rows-1\n\t\tprint '|'\n\t\tfor j in 0..board.columns-1\n\t\t\tprint board.at(i,j)\n\t\t\tprint '|'\n\t\tend\n\t\tputs \"\\n\"\n\tend \nend",
"def print_grid\n @grid.each do |arr|\n puts arr.join(\" \")\n end\n end",
"def show_board\n i = 0\n while i < board.length\n j = 0\n while j < board[i].length\n print board[i][j]\n j += 1\n end\n print \"\\n\"\n i += 1\n end\n end",
"def latex_matrix(matrix)\n output = \"\\\\begin{tabular}{|#{'r|' * matrix.first.length}}\\n\"\n output << \"\\\\hline\\n\"\n output << matrix.map { |line| line.join(' & ') }.join(\"\\\\\\\\\\n\\\\hline\\n\")\n output << \"\\\\\\\\\\n\"\n output << \"\\\\hline\\n\"\n output << \"\\\\end{tabular}\\n\"\n output\nend",
"def output\n\tputs \" #{@array_map[0][0]} | #{@array_map[0][1]} | #{@array_map[0][2]} \" \n\tputs \"------------\"\n\tputs \" #{@array_map[1][0]} | #{@array_map[1][1]} | #{@array_map[1][2]} \"\n\tputs \"------------\"\n\tputs \" #{@array_map[2][0]} | #{@array_map[2][1]} | #{@array_map[2][2]} \"\n\tend",
"def test_with_irregular_array2D2; show([[0.5], [0.1,0.9]]) end",
"def print_maze\n # Special handling: print the top line.\n puts @columns.times.inject(\"+\") {|str, x| str << \"---+\" }\n\n # For each cell, print the right and bottom wall, if it exists.\n @rows.times do |y|\n line = @columns.times.inject(\"|\") do |str, x|\n str << (@path[x][y] ? \" * \" : \" \") << (@vertical_walls[x][y] ? \"|\" : \" \")\n end\n puts line\n puts @columns.times.inject(\"+\") {|str, x| str << (@horizontal_walls[x][y] ? \"---+\" : \" +\")}\n end\n end",
"def printInfo(adjacencyMatrix, degreeArray)#print the details of the matrix and its degrees\n\tputs\"M A T R I X :\"\n\tputs adjacencyMatrix.to_a.map(&:inspect) #print out the adjacency matrix *adapted from stack overflow*\n\tputs \"D E G R E E S OF N O D E S :\"\n\tputs degreeArray.inspect #print out all degrees in the array\n\tputs \"\\n\"\nend",
"def print_board\n for num in 0..4 do\n print \" \" + @top_row[num].to_s + \" \"\n end\n puts \"\"\n for num in 0..4 do\n puts \"#{@left_column[num].to_s} #{@board[num]}\"\n end\nend",
"def test_with_irregular_array2D1; show([[0.1,0.9], [0.5]]) end",
"def print_coordinates\n\t\tsample_board=[1,2,3,4],[5,6,7,8],[9,10,11,12],[13,14,15,16]\n\t\t(0..(sample_board.length)-1).each do |i| #we are assigning the count of each row of the array sample_board \n\t\t\t#(0,1,2,3) to the variable i\n\t\t\t(0..(sample_board[i].length)-1).each do |j| #we are assigning the count of each column of the array sample_board\n\t\t\t\t#(0,1,2,3) to the variable j\n\t\t\t\tif(sample_board[i][j]<10) #adds extra space after single digit numbers to make them the same width as double digits\n\t\t\t\t\tmarker=sample_board[i][j].to_s + \" \" #.to_s converts the output of sample_board[i][j] to a string\n\t\t\t\telse\n\t\t\t\t\tmarker=sample_board[i][j]\n\t\t\t\tend\n\t\t\t\tprint \"#{marker}\"\n\t\t\t\tprint \"|\" unless j==sample_board.length-1 #prints \"|\" after each element in the \"secondary\" arrays (i.e. rows) \n\t\t\t\t#except after the last element in each \"secondary\" array (i.e. each row). \n\t\t\tend\n\t\t\tputs \"\"\n\t\tend\n\tend",
"def render_matrix\n Matrix.rows render_rows\n end",
"def print\n grid_array = []\n @height.times do |r|\n grid_array << @grid[r * @width, @width].split('') * ' '\n end\n grid_array\n end",
"def print_output_matrix(useMatrixLabel = false)\r\n if useMatrixLabel == true then label = 'outputs' end\r\n BatchMultipleRegression.print_matrix(@outputs, label, 3, ', ')\r\n end",
"def display_board_pretty\r\n\r\n # Display header letters\r\n @cols.each do |header|\r\n print ' ' + header + ' '\r\n end\r\n puts\r\n\r\n # Display board numbers\r\n for col_index in 0..4\r\n for row_index in 0..4\r\n\r\n board_num = @bingo_board[row_index][col_index]\r\n\r\n # Pretty print: print filler spaces if number has fewer digits\r\n if board_num.to_s.length == 1\r\n print ' '\r\n end\r\n if board_num.to_s.length == 2\r\n print ' '\r\n end\r\n\r\n print board_num.to_s + ' '\r\n\r\n end\r\n puts\r\n end\r\n\r\n end",
"def to_s\n \"Matrix[\" + @rows.collect{\n |row|\n \"[\" + row.collect{|e| e.to_s}.join(\", \") + \"]\" # no yield\n }.join(\", \")+\"]\"\n end",
"def print_neighbours\n @x.times{ |r|\n @y.times{|c| \n #+1,+1 0,+1 +1,0\n print @mat[r+1].nil? || @mat[r+1][c+1].nil? ? \"x \" : \"- \"\n print @mat[r].nil? || @mat[r][c+1].nil? ? \"x \" : \"- \"\n print @mat[r+1].nil? || @mat[r+1][c].nil? ? \"x \" : \"- \"\n \n #-1,-1 0,-1 -1,0\n print @mat[r-1].nil? || @mat[r-1][c-1].nil? ? \"x \" : \"- \"\n print @mat[r-1].nil? || @mat[r-1][c].nil? ? \"x \" : \"- \"\n print @mat[r].nil? || @mat[r][c-1].nil? ? \"x \" : \"- \"\n \n #+1,-1 -1,+1\n print @mat[r-1].nil? || @mat[r-1][c+1].nil? ? \"x \" : \"- \"\n print @mat[r+1].nil? || @mat[r+1][c-1].nil? ? \"x \" : \"- \"\n print \"\\n\"\n \n }\n \n } \n end",
"def to_s\n\t\t@tam_alto.times do |i|\n\t\t\t@tam_ancho.times do |j|\n\t\t\t\tprint @plano[i][j].to_s + \" \"\n\t\t\tend\n\t\t\tprint \"\\n\"\n\t\tend\n\tend",
"def print_map\n (@height).times do |y|\n (@width).times do |x|\n if(is_solid?(x, y))\n print(\"#\")\n else\n print(\".\")\n end\n end\n print(\"\\n\")\n end\n end",
"def to_s\n matString = \"\"\n for i in 0...@nFil do\n for j in 0...@mCol do\n matString = matString + @matriz[i][j].to_s + \" \"\n end\n matString = matString + \"\\n\"\n end\n matString\n end",
"def to_s\n for i in 0..@max_row - 1\n for j in 0..@max_column - 1\n print \"| \" + @board[i][j] + \" \"\n end\n\n puts \"|\"\n end\n end",
"def print_board(board)\n board.each do |row|\n row.each do |column|\n print column\n end\n print \"\\n\"\n end\nend",
"def print_board(array)\n system('cls')\n puts\n puts \"\\033[33m 1 2 3 4 5 6 7 8 \\033[0m\"\n array.each do |row|\n puts\"\\033[33m│\\033[0m #{(row.join\" \\033[33m││\\033[0m \")} \\033[33m│\\033[0m\"\n puts \"#{\"\\033[33m╞---╡\\033[0m\"*row.count}\"\n end\n puts \"\\033[33m╘─-─╛╘─-─╛╘─-─╛╘─-─╛╘─-─╛╘─-─╛╘─-─╛╘─-─╛\\033[0m\"\nend",
"def render\n print \"\\n\"\n @board.each do |row|\n row.each do |col|\n print \"#{col.nil? ? '.' : col} \"\n end\n print \"\\n\"\n end\n print \"\\n\"\n end",
"def print_to_terminal\n grid.each do |row|\n row.each do |element|\n print \"O \" if(element==1)\n print \"X \" if(element==-1)\n print \"- \" if(element==0)\n end\n print \"\\n\"\n end\n end",
"def print_grid # prints 3 X 3 grid with values\n puts \"\\n\"\n @grid.each_slice(3) { |row| puts row.join(' | ') }\n puts \"\\n\"\n end",
"def view\n @board.each do |row|\n print \"|#{row}|\"\n puts\n end\n puts \" 1 2 3 4 5 6 7\"\n end",
"def print_board\n\t\tputs \"**********************************\"\n\t\tputs \"| ♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟ |\"\n\t\tputs \"| Actual board |\"\n\t\tputs \"| ♔ ♚ ♕ ♛ ♖ ♜ ♗ ♝ ♘ ♞ ♙ ♟ |\"\n\t\tputs \"**********************************\"\n\t\t@board.each_index do |i|\n\t\t\t@board[i].each_index do |y|\n\t\t\t\tif y == 0\n\t\t\t\t\tprint 8 - i\n\t\t\t\tend\n\n\t\t\t\tif @board[i][y] == nil\n\t\t\t\t\tprint \"#{@board[i][y]} --\"\n\t\t\t\telse\n\t\t\t\t\tprint \" #{@board[i][y].piecename}\"\n\t\t\t\tend\n\n\t\t\tend\n\t\t\tputs \"\\n\"\n\t\tend\n\t\tputs \" a b c d e f g h\"\n\t\tputs \"\\n\\n\\n\\n\"\n\tend",
"def print_maze\n\t\tcount = 1\n\t\t@maze.each do |x|\n\t\t\tputs x.to_s\n\t\tend\n\tend",
"def print_neighbours_count\n @x.times{ |r|\n @y.times{|c| \n print @mat[r][c].count_neighbours.to_s + \" \"\n }\n print \"\\n\"\n }\n end",
"def print_cell(x,y)\n puts @maze[x][y]\n end",
"def print_board\n\t\tputs \"\"\n\t\tputs \" 1 2 3 4 5 6 7 8\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" A ||\"\n\t\tprint_row 0\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" B ||\"\n\t\tprint_row 1\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" C ||\"\n\t\tprint_row 2\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" D ||\"\n\t\tprint_row 3\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" E ||\"\n\t\tprint_row 4\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" F ||\"\n\t\tprint_row 5\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" G ||\"\n\t\tprint_row 6\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\"\n\t\tprint \" H ||\"\n\t\tprint_row 7\n\t\tputs \"|\"\n\t\tputs \" |-------------------------|\\n\\n \"\n\tend",
"def another_display(mtx)\n mtx.transpose.each do |file|\n file.each.with_index do |elemental, index|\n if file.size == index + 1\n print elemental + ' ' + \"\\n\"\n else\n print elemental + ' '\n end\n end\n end\nend",
"def pretty_print(q) #:nodoc:\n if self.shape.size > 1 and self.shape[1] > 100\n self.inspect.pretty_print(q)\n elsif self.dim > 3 || self.dim == 1\n self.to_a.pretty_print(q)\n else\n # iterate through the whole matrix and find the longest number\n longest = Array.new(self.shape[1], 0)\n self.each_column.with_index do |col, j|\n col.each do |elem|\n elem_len = elem.inspect.size\n longest[j] = elem_len if longest[j] < elem_len\n end\n end\n\n if self.dim == 3\n q.group(0, \"\\n{ layers:\", \"}\") do\n self.each_layer.with_index do |layer,k|\n q.group(0, \"\\n [\\n\", \" ]\\n\") do\n layer.each_row.with_index do |row,i|\n q.group(0, \" [\", \"]\\n\") do\n q.seplist(self[i,0...self.shape[1],k].to_flat_array, lambda { q.text \", \"}, :each_with_index) { |v,j| q.text v.inspect.rjust(longest[j]) }\n end\n end\n end\n end\n end\n else # dim 2\n q.group(0, \"\\n[\\n \", \"]\") do\n self.each_row.with_index do |row, i|\n q.group(1, \" [\", \"]\\n\") do\n q.seplist(row.to_a, -> { q.text \", \" }, :each_with_index) do |v,j|\n q.text v.inspect.rjust(longest[j])\n end\n end\n q.breakable unless i + 1 == self.shape[0]\n end\n end\n end\n end\n end",
"def displayframecolumnvalues\r\n\t\t\ttitle = \" 1 2 3 4 5 6 7\"\r\n\t\t\t@output.puts(\"#{title}\")\r\n\t\t\t@matrix.each do |row|\r\n\t\t\t\tnew_row='|'+row.join('|')+'|'\r\n\t\t\t\t@output.puts(new_row)\r\n\t\t\tend\r\n\t\tend",
"def display(joiner=\"][\",left=\"[[\",right=\"]]\",size=nil)\n\t\tDisplay.Matrix(self,joiner,left,right,size)\n\tend",
"def my_display(grid)\n grid.map {|x| \"#{x}\\n\"}\n #grid.transpose.map {|x| \"#{x}\\n\"}\n #grid.map {|x| \"#{x.reverse}\\n\"}\nend",
"def output(board)\n max_x = board.first.size - 1\n max_y = board.size - 1\n\n (0..max_y).each do |y|\n (0..max_x).each do |x|\n panel = board[y][x]\n\n panel == 1 ? print('0') : print('.')\n end\n puts\n end\nend",
"def show_board\n puts\n @board.each_with_index do |square, i|\n print \" #{square} \"\n puts \"\\n\\n\" if (i == 2 || i == 5 || i == 8)\n end\n end",
"def matrix\n end",
"def display\n system 'clear'\n print \"\\n\"\n i = 0\n @size.times do |y|\n @size.times do |x|\n print \"#{tile_to_s(i)} \"\n i += 1\n end\n print \"\\n\"\n end\n print \"\\n\"\n end"
] |
[
"0.8365684",
"0.83364475",
"0.80127895",
"0.77586156",
"0.76027465",
"0.7550865",
"0.74663484",
"0.7452271",
"0.72738564",
"0.7190153",
"0.7120935",
"0.71123135",
"0.70747215",
"0.7028918",
"0.6994751",
"0.6969398",
"0.69626296",
"0.69481415",
"0.6877916",
"0.6870029",
"0.68370557",
"0.68346107",
"0.68146247",
"0.67931694",
"0.67787933",
"0.6777863",
"0.67634666",
"0.67259175",
"0.6703273",
"0.6699347",
"0.66991884",
"0.66960025",
"0.6671866",
"0.6663465",
"0.66285336",
"0.66155124",
"0.65953",
"0.6594336",
"0.6593737",
"0.6593033",
"0.65805984",
"0.657798",
"0.6571362",
"0.6567388",
"0.65673715",
"0.6566",
"0.656494",
"0.65554196",
"0.6546431",
"0.6525564",
"0.65228766",
"0.6515712",
"0.65066946",
"0.65039486",
"0.6502595",
"0.65002745",
"0.6500146",
"0.6488853",
"0.6486668",
"0.64861697",
"0.6475676",
"0.64679277",
"0.6453891",
"0.64535683",
"0.645327",
"0.6449354",
"0.6446378",
"0.643977",
"0.6439393",
"0.6380811",
"0.6373576",
"0.6361193",
"0.63551044",
"0.63480663",
"0.6343789",
"0.63325393",
"0.63244706",
"0.6322227",
"0.6318871",
"0.6310842",
"0.6308913",
"0.6307281",
"0.63042825",
"0.63012433",
"0.6290072",
"0.62900656",
"0.6284722",
"0.6283074",
"0.6282753",
"0.6272867",
"0.62666535",
"0.6263807",
"0.62571824",
"0.6250871",
"0.6249281",
"0.6247569",
"0.62230843",
"0.62103456",
"0.62061507",
"0.6205272"
] |
0.74614334
|
7
|
controls application logs transaction calculates balance use class instead of hash !
|
def print_statement
account_statement = StatementDisplay.new(@transaction)
account_statement.print_statment_header
account_statement.display
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def balance\n super\n end",
"def balance\n super\n end",
"def balance_hash\n @money\n end",
"def balance\n balance = 0.00\n @transactions.each do | transaction|\n balance += transaction[:amount]\n end\n return balance\n end",
"def balance\n\t\tbalance = 0.00\n\t\t@transactions.each do |transaction|\n\t\t\tbalance += transaction[:amount]\n\t\tend\t\n\n\t\treturn balance\n\tend",
"def balance\n\t\tbalance = 0\n\t\t@transactions.each do |transaction|\n\t\t\tbalance += transaction[:amount]\n\t\tend\n\t\treturn balance\n\tend",
"def balance\n transactions.inject(0) do |sum, transaction|\n sum + transaction.amount\n end\n end",
"def balance\n @balance ||= starting_balance + transactions.inject(0) do |result, element|\n result + element.amount\n end\n end",
"def get_balance\n return balance\n end",
"def balance\n txns.inject(Amount::ZERO) { |sum, t| sum + t.amount }\n end",
"def balance\n transactions.inject(:+)\n end",
"def current_balance\n starting_balance + transactions.sum(:amount)\n end",
"def balance\n @balance\n end",
"def balance #same as attr_reader :balance\n @balance\n end",
"def balance\n # accounts.reduce(0){|sum, account| sum + account.balance}\n accounts.sum{|account| account.balance} \n end",
"def test_transaction\n hash = {\"balance\" => 0}\n test = Account.new(hash)\n test.transaction(10)\n assert_equal(10, test.balance)\n end",
"def balance(address)\n json = get_json(\"/rawaddr/#{address}\")\n info(\"Total transactions: #{json['n_tx']}\")\n info(\"Received/sent: #{json['total_received']}/#{json['total_sent']}\")\n json['final_balance']\n end",
"def balance\n return @balance\n end",
"def balance\n self.ledger_entries.sum(:value)\n end",
"def get_balance(address)\n #res = get(\"addr/\"+address+\"?noCache=1\")\n #(res['balance'] + res['unconfirmedBalance']).to_BTCFloat\n get(\"addr/\"+address+\"?noCache=1\")['balance'].to_BTCFloat\n end",
"def initialize\n @balance = 0 # software won't be as pure with exposed balance\n @transactions = [] # object calisthenics? primitive obsession -> array is suspect, some sort of collection object\n # store as hash instead?\n end",
"def account_balance\n @account_balance\n end",
"def balance(account)\n net_deposits(account) - net_withdraws(account)\n end",
"def balance(address)\n json = Sibit::Json.new(http: @http, log: @log).get(\n URI(\"https://blockchain.info/rawaddr/#{address}\")\n )\n @log.info(\"Total transactions: #{json['n_tx']}\")\n @log.info(\"Received/sent: #{json['total_received']}/#{json['total_sent']}\")\n json['final_balance']\n end",
"def starting_balance\n @balance\n end",
"def account_balance\n balance = 0\n deposits.each {|deposit| balance += deposit.amount}\n\n transactions.each do |transaction|\n amount = transaction.price * transaction.num_shares\n transaction.order_type == 'BUY' ? balance -= amount : balance += amount\n end\n return balance.round(2)\n end",
"def balance\n exception = Exception.new(\"Invalid call\")\n\n Rollbar.error(exception, user: self)\n raise exception\n end",
"def balance\n parse_balance(post('/api/1/generic/info'))\n end",
"def actual_balance\n if previous.present?\n previous.balance_amount_with_sign\n else\n 0\n end\n end",
"def real_new_balance()\n Bankjob.string_to_float(new_balance, @decimal)\n end",
"def calculate_balance\n update_sender\n update_receiver\n end",
"def get_balance\n\t\treturn @balance.balance\n\tend",
"def initialize\n @balance = 0\n end",
"def balance_for(account)\n @accounts[account]\n end",
"def balance\n body = { action: \"balance\", key: @@access_key }\n post_request(body).to_i\n end",
"def current_balance_active_only\n starting_balance + transactions.active.sum(:amount)\n end",
"def get_account_balance\n submit GetAccountBalance.new\n end",
"def balance(query = nil)\n Ledger::Balance.get(query)\n end",
"def balance() @address.balance; end",
"def total_balance\n return @checking_account_balance + @saving_account_balance\n end",
"def balance\n @client.balance(name)\n end",
"def balance\n # accounts.reduce(0) {|sum, account| sum + account.balance}\n accounts.sum {|account| account.balance}\n\n # total = 0\n # accounts.each {|account| total += account.balance}\n # total\n end",
"def calculate_current_balance\n if transactionmode == \"Credit\"\n savingsdeposit.current_balance += self.transaction_amount.to_i\n elsif transactionmode == \"Debit\"\n savingsdeposit.current_balance -= self.transaction_amount.to_i\n else\n :savingsdeposits\n end\n savingsdeposit.save\n\nend",
"def total_balance\n\t\tputs \"Total Balance: #{@@accounts.total}\"\n\tend",
"def balance\n rest.get(:getbalance)['data']\n end",
"def balance\n b = read_attribute(:balance)\n if User.current and User.current.currency\n b.to_d * User.current.currency.exchange_rate.to_d\n else\n b.to_d\n end\n end",
"def balance(account)\n return balances[account] || infer_balance(account) # need to infer the balance if the account is not in ledger's output\n end",
"def balance\n self.all_benefits - self.all_pays\n end",
"def balance\n wallet = Fyb.private.getaccinfo.perform.parse\n btc_label = 'btcBal'\n money_label = Fyb::Configuration.currency.to_s + 'Bal'\n\n btc = BigDecimal.new wallet[btc_label]\n real_money = BigDecimal.new wallet[money_label]\n\n { :btc => btc, Fyb::Configuration.currency => real_money }\n end",
"def saldo\n balance\n end",
"def balance\n return false unless Account.exists?(@account_id)\n\n Trade.where(account_id: @account_id).pluck(:amount).reduce(:+) || 0.0\n end",
"def balances\n return @balances_hash if @balances_hash\n ledger_balances = cmd 'bal --balance-format \"%A | %(display_total)\\n\"'\n @balances_hash = Hash[*(ledger_balances.split(\"\\n\")).map{|line| parse_account_line(line)}.flatten]\n end",
"def show_balance\n\t\t\treturn @balance\n\t\tend",
"def account_balance\n response = execute_command('getbalance')\n parse_response(response)['Credit'].to_f\n end",
"def account_cash_balance(investor)\n cash_balance = 0\n @hash_row_array.each do |hash|\n price = hash[\"TXN_PRICE\"]\n price[0] = ''\n price_float = price.to_f\n cash_total = price_float * hash[\"TXN_SHARES\"].to_f\n if hash[\"INVESTOR\"] == investor && hash[\"TXN_TYPE\"] == \"BUY\"\n cash_balance += cash_total\n end\n end\n return cash_balance.round(2)\nend",
"def balance\n if @options[:verbose]\n warning = \"Coinbase doesn't provide a USD balance because\"\n warning << \" it connects to your bank account. Be careful, \"\n warning << \"because this will withdraw directly from your accounts\"\n warning << \"when you trade live.\"\n logger.warn warning\n end\n @balance ||= [max_float, max_float]\n end",
"def update_balance\n if(@transaction.sender)\n @transaction.sender.balance -= @transaction.amount\n @transaction.sender.save\n end\n\n if(@transaction.receiver)\n @transaction.receiver.balance += Monetize.parse(convert(Money.new(@transaction.amount,findCurrency(@transaction.sender_id, @transaction.receiver_id, 'sent')), @transaction.receiver.currency)).fractional\n @transaction.receiver.save\n end\n end",
"def update_balance(transaction)\n if transaction.succeeded?\n sign = transaction.payment? ? 1 : -1\n self.balance.update_attributes!(amount: (self.balance.amount + (transaction.amount * sign)))\n end\n end",
"def calculate_control(transaction_id, amount)\n Digest::MD5.hexdigest(\"#{@x_login}#{transaction_id}#{amount}\")\n end",
"def initialize(balance)\n @balance = balance\n end",
"def balance\n @balance ||= starting_balance + flights.inject(0) do |result, element|\n result + element.profit\n end\n end",
"def balance\n entries = @@ledgers.find(\"owner\" => @sender).first['entries']\n\n sum = 0\n entries.each do |entry|\n value = entry['value'].gsub(\"$\",\"\")\n\n if entry['value'][0] == '('\n value = value[1..-2]\n sum = sum - value.to_i\n else\n sum = sum + value.to_i\n end\n end\n\n @t.say(\"The balance is $#{sum}\")\nend",
"def balance\n JSON.parse(response.body).fetch('balance')\n end",
"def balance(_address)\n raise Sibit::NotSupportedError, 'balance() doesn\\'t work here'\n end",
"def balance\n @accounts.values.first\n end",
"def balance\n request_params = params.permit(:account_id)\n\n balance ||= Actions.new.balance(request_params['account_id'])\n\n return render status: balance[0], json: balance[1]\n end",
"def statement_balance\n @stmt_balance\n end",
"def check_balance\n return @balance\n end",
"def balance(ending_at=nil)\n return @balance if !!@balance && !ending_at\n if ending_at\n balance_cents = self.transactions.sum(:cents,\n :conditions => [\"created_at < ? AND action NOT IN (?)\", ending_at, ['authorize', 'void']]\n )\n @balance = nil\n Money.new(balance_cents || 0, self.currency)\n else\n @balance = Money.new(self.cents, self.currency)\n end\n end",
"def balance\n @balance ||= total - amount_paid\n end",
"def balance(*tags)\n\t # debugger\n\t income_estimation(tags) - rollup\n\tend",
"def checking_account_balance\n return @checking_account_balance\n end",
"def low_whitelister_balance_template\n 'low_whitelister_balance'\n end",
"def balance(currency)\n\t\treturn @balance[currency]\n\tend",
"def balance\n return nil unless (temp_extended_balance = read_attribute(:balance))\n # logger.debug2 \"temp_extended_balance = #{temp_extended_balance}\"\n temp_balance = YAML::load encrypt_remove_pre_and_postfix(temp_extended_balance, 'balance', 11)\n temp_balance[BALANCE_KEY] = nil unless temp_balance.has_key?(BALANCE_KEY)\n temp_balance\n end",
"def balance\n return nil unless (temp_extended_balance = read_attribute(:balance))\n # logger.debug2 \"temp_extended_balance = #{temp_extended_balance}\"\n temp_balance = YAML::load encrypt_remove_pre_and_postfix(temp_extended_balance, 'balance', 11)\n temp_balance[BALANCE_KEY] = nil unless temp_balance.has_key?(BALANCE_KEY)\n temp_balance\n end",
"def create_history\n # @hash = Hash.new{ |h,k| h[k]=[] }\n # params[\"/buy_btc\"].each{ |k,v| @hash[k] << v }\n\n # @btc_amount = @hash['btc_amount'][0].to_f\n # @inr_amount = @hash['inr_amount'][0].to_f\n puts \"@@@@@ model @@@@@@\"\n puts \"#{self.btc_balance}\"\n puts \"inr_amount in model = #{@inr_amount}\"\n puts \"btc_amount in model = #{@btc_amount}\"\n puts \"inr_balance in model = #{@inr_balance}\"\n puts \"btc_balance in model = #{@btc_balance}\"\n if self.btc_balance_changed?\n \n\n TransactionHistory.create(currency_type: \"inr\", inr_amount: @inr_amount, inr_balance: @inr_balance, inr_status: 'debit', user_id: user.id, wallet_id: self.id)\n TransactionHistory.create(currency_type: \"btc\", btc_amount: @btc_amount, btc_balance: @btc_balance, btc_status: 'credit', user_id: user.id, wallet_id: self.id)\n\n # elsif self.inr_balance_changed?\n # TransactionHistory.create(currency_type: \"inr\", inr_amount: @inr_amount, inr_balance: @inr_balance, inr_status: 'debit', user_id: current_user.id, wallet_id: self.id)\n # TransactionHistory.create(currency_type: \"btc\", btc_amount: @btc_amount, btc_balance: @btc_balance, btc_status: 'credit', user_id: current_user.id, wallet_id: self.id)\n\n end\n end",
"def balance(address)\n json = Sibit::Json.new(http: @http, log: @log).get(\n Iri.new('https://api.blockchair.com/bitcoin/dashboards/address').append(address).fragment(the_key)\n )['data'][address]\n if json.nil?\n @log.info(\"Address #{address} not found\")\n return 0\n end\n a = json['address']\n b = a['balance']\n @log.info(\"The balance of #{address} is #{b} satoshi\")\n b\n end",
"def transaction(ex, exchange_rate, balance_crypto, balance_fiat, value_crypto, crypto_percentage, fiat_percentage, type, amount)\n text = \"[#{Time.now}] #{ex['exchange']} #{exchange_rate} #{ex['fiat']}/#{ex['crypto']}\" +\n \" - #{balance_crypto.round(4)} #{ex['crypto']} (#{value_crypto.round(0)} #{ex['fiat']}, #{crypto_percentage.round(1)}%)\" +\n \", #{balance_fiat.round(0)} #{ex['fiat']} (#{fiat_percentage.round(1)}%)\" +\n \" => #{type.upcase} #{amount} #{ex['crypto']}\" +\n \" | portfolio: #{(balance_fiat+value_crypto).round(0)} #{ex['fiat']}\"\n puts text if @level_stdout <= TRANSACTION\n append_log_file text if @level_file <= TRANSACTION\n if @level_web <= TRANSACTION\n txdata = {\n 'timestamp' => Time.now.to_s,\n 'type' => type,\n 'amount' => amount,\n 'exchange_rate' => exchange_rate,\n 'balance_crypto' => balance_crypto,\n 'balance_fiat' => balance_fiat\n }\n append_file(get_file(ex), txdata.to_json)\n end\n end",
"def balances\n accounts.with_balance\n end",
"def balance\n Money.new(\n Revenue.to_account(self).joins(:virtual_revenues).sum('\"virtual_revenues\".\"cents\"').to_i +\n Transfer.to_account(self).sum(:cents) - Transfer.from_account(self).sum(:cents) - \n Purchase.from_account(self).joins(:virtual_purchases).sum('\"virtual_purchases\".\"cents\"').to_i +\n self.initial_balance_in_cents\n )\n end",
"def saving_account_balance\n return @saving_account_balance\n end",
"def outstanding_balance\n loan.funded_amount - loan.payments.amount\n end",
"def balance\n sum = 0\n @money.each do |k, v|\n sum += k * v\n end\n sum\n end",
"def gettransactionamount\r\n @transactionamount\r\n end",
"def invoice_balance\n BigDecimal.new(self.freshbooks_invoice['amount_outstanding']) rescue nil\n end",
"def getbalance(account = nil, minconf = 1)\n request :getbalance, account, minconf\n end",
"def balance_btc_ui\n balance_btc.to_f * 10 ** -8\n end",
"def balance\n # If in development, return a mocked amount\n return 1234 if Rails.env.development?\n\n # If in production, fetch the user's balance from Tab.\n @balance || begin\n headers = {\n \"Authorization\" => \"Token token=#{Rails.application.secrets.tab_api_key}\",\n \"Content-type\" => \"application/json\"\n }\n result = HTTParty.get(File.join(Rails.application.config.api_url, \"users\", \"#{name}.json\"), headers: headers)\n\n JSON.parse(result.body)[\"balance\"] if result.code == 200\n rescue StandardError # rubocop:disable Lint/SuppressedException\n end\n end",
"def getbalance(account = nil, minconf = 1)\n coind.getbalance account, minconf\n end",
"def hash\n [returned_balances, tags, transaction_type, token, ref_transaction, node, network, sub_network, mid, tid, stan, ca_name, ca_street, ca_zip, ca_city, ca_region, ca_country, function_code, reason_code, response_code, approval_number, display_message, date, transmission_date, local_transaction_date, capture_date, settlement_date, itc, irc, currency_code, amount, additional_amount, acquirer_fee, issuer_fee, rc, extrc, duration, cardholder, acting_cardholder, card, account, account2, mcc, network_reference_id, acquirer_reference_id, retrieval_reference_number, forwarding_inst_id, network_mid, request_amount, transaction_state, remote_host, response_amount, expiration_time, incoming_network_request_itc, digital_wallet_token, tranlog_attributes, payload, layer, transaction_name, originator, acquirer, gpaorder, gateway_log].hash\n end",
"def gateway_balance opts={}\n params = {\n account: opts.delete(:account) || client_account,\n strict: true, \n hotwallet: [],\n ledger_index: 'validated'\n }.merge!(opts)\n post(:gateway_balance, params)\n end",
"def balances\n # Very inefficient at this point for a large network...\n self.network_as_users.map { |user|\n {:balance => self.balance_with(user), :user => user}\n }.select {|balance| balance[:balance].to_f != 0.0}\n end",
"def balance(address)\n best_of('balance') do |api|\n api.balance(address)\n end\n end",
"def pending_balance\n transactions.where(pending: true).sum(:amount)\n end",
"def balances?(tk); end",
"def trial_balance\n @data = TrialBalance.new(@ledger).return_general_ledger\n end",
"def calculate_balance(at=nil)\n if at.nil?\n bal = self.credits.calculate(:sum,:cents) - self.debits.calculate(:sum,:cents)\n self.update_attributes(:cents => bal, :saved_balance_on => Time.zone.now)\n else\n before_balance_date = {:conditions => [\"made_on < ?\",at]}\n bal = self.credits.calculate(:sum,:cents,before_balance_date) - self.debits.calculate(:sum,:cents,before_balance_date)\n end\n return Money.new(bal,self.currency)\n end",
"def set_transaction\n #@accounts.user = current_user\n @transaction = Transaction.find(params[:id])\n # @accounts = Account.find(current_user).balance\n end",
"def balance client\n puts \"Estimado Sr./Sra #{client.name} #{client.last_name}\"\n puts \"Su saldo es:\"\n puts \"Cuentas de ahorros: Bs. #{client.saving_amount}\".colorize(:blue)\n puts \"Cuentas de corriente: Bs. #{client.check_amount}\".colorize(:blue)\n end",
"def balance\n credit = FineBalance.sum('AMOUNT', :conditions=>{:INCURRED_ID=>self.CHARGE_INCURRED_ID})\n return self.AMOUNT-credit\n end"
] |
[
"0.7183701",
"0.7183701",
"0.7072086",
"0.69360226",
"0.6920141",
"0.6919485",
"0.69194645",
"0.6882263",
"0.68309087",
"0.68242",
"0.67880034",
"0.67547977",
"0.6688635",
"0.66851866",
"0.66739845",
"0.66623527",
"0.66584",
"0.6655751",
"0.660038",
"0.65990794",
"0.6546211",
"0.654322",
"0.652752",
"0.65231174",
"0.64993846",
"0.6484907",
"0.64832103",
"0.6454369",
"0.64223397",
"0.6419495",
"0.6416196",
"0.6413253",
"0.6393903",
"0.6390536",
"0.63743424",
"0.6374042",
"0.6364932",
"0.6362112",
"0.63559973",
"0.6333779",
"0.63235897",
"0.6310363",
"0.6290282",
"0.6285834",
"0.62767065",
"0.62740034",
"0.62523204",
"0.6231691",
"0.6211872",
"0.6178571",
"0.617471",
"0.61728996",
"0.61725765",
"0.61715925",
"0.61706126",
"0.615588",
"0.61552745",
"0.614814",
"0.61475396",
"0.61467654",
"0.6133471",
"0.61330676",
"0.6126655",
"0.61182165",
"0.61138076",
"0.6112275",
"0.6109922",
"0.6101772",
"0.6098309",
"0.6083481",
"0.60825723",
"0.6075495",
"0.6075324",
"0.6072606",
"0.6072195",
"0.6072195",
"0.6058398",
"0.60373825",
"0.6031271",
"0.6008109",
"0.60004395",
"0.6000384",
"0.59911597",
"0.5989453",
"0.5975796",
"0.5974492",
"0.59567297",
"0.59538513",
"0.5953237",
"0.5952032",
"0.59438944",
"0.59340984",
"0.59279716",
"0.5923075",
"0.59149617",
"0.5909806",
"0.5903212",
"0.5901142",
"0.5900331",
"0.5897903",
"0.5896063"
] |
0.0
|
-1
|
If plugins successfully installed, restart vagrant to detect changes.
|
def continue
exec("vagrant #{ARGV[0]}")
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def install_plugins(plugins)\n plugins.each do |plugin|\n needs_restart = false\n unless Vagrant.has_plugin? plugin\n system \"vagrant plugin install #{ plugin }\"\n needs_restart = true\n end\n exec \"vagrant #{ ARGV.join ' ' }\" if needs_restart\n end\nend",
"def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.installed_plugins\n next if plugin_hash.has_key?(p)\n result = true\n logger.warn(\"Installing plugin #{p}\")\n system(\"vagrant plugin install #{p}\")\n end\n if result\n logger.warn('Reloading vagrant now that plugins are installed')\n system(\"vagrant halt; vagrant up;\")\n exit\n end\nend",
"def checkForVagrantPlugins(plugins_list)\n # Install required vagrant plugins if necessary\n plugins_list.each do |plugin|\n need_restart = false\n unless Vagrant.has_plugin? plugin\n system \"vagrant plugin install #{plugin}\"\n need_restart = true\n end\n exec \"vagrant #{ARGV.join(' ')}\" if need_restart\n end\nend",
"def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.installed_plugins\n next if plugin_hash.has_key?(p)\n result = true\n logger.warn(\"Installing plugin #{p}\")\n pm.install_plugin(p)\n end\n if result\n logger.warn('Re-run vagrant up now that plugins are installed')\n exit\n end\nend",
"def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.installed_plugins\n next if plugin_hash.has_key?(p)\n result = true\n logger.warn(\"Installing plugin #{p}\")\n pm.install_plugin(p)\n end\n if result\n logger.warn('Re-run vagrant up now that plugins are installed')\n exit\n end\nend",
"def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.installed_plugins\n next if plugin_hash.has_key?(p)\n result = true\n logger.warn(\"Installing plugin #{p}\")\n pm.install_plugin(p)\n end\n if result\n logger.warn('Re-run vagrant up now that plugins are installed')\n exit\n end\nend",
"def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.installed_plugins\n next if plugin_hash.has_key?(p)\n result = true\n logger.warn(\"Installing plugin #{p}\")\n pm.install_plugin(p)\n end\n if result\n logger.warn('Re-run vagrant up now that plugins are installed')\n exit\n end\nend",
"def ensure_plugins(plugins)\n logger = Vagrant::UI::Colored.new\n result = false\n plugins.each do |p|\n pm = Vagrant::Plugin::Manager.new(\n Vagrant::Plugin::Manager.user_plugins_file\n )\n plugin_hash = pm.installed_plugins\n next if plugin_hash.has_key?(p)\n result = true\n logger.warn(\"Installing plugin #{p}\")\n pm.install_plugin(p)\n end\n if result\n logger.warn('Re-run vagrant up now that plugins are installed')\n exit\n end\nend",
"def check_plugins\n required_plugins = %w(vagrant-vbguest vagrant-triggers vagrant-reload)\n missing_plugins = required_plugins.reject { |plugin| Vagrant.has_plugin? plugin }.join(\" \")\n unless missing_plugins.empty?\n puts \"The following required plugins are not installed on the HOST machine:\\n#{missing_plugins.tr(' ', ', ')}\"\n puts \"\\nRun following command to install missing plugins:\\nvagrant plugin install #{missing_plugins}\"\n # Halt the provisioning process\n abort\n end\nend",
"def install_missing_plugins(plugins_to_install:)\r\n plugins_to_install.select! { |plugin| not Vagrant.has_plugin? plugin }\r\n puts \"Missing plugins are: #{plugins_to_install}\" unless plugins_to_install.empty?\r\n plugins_to_install.each { |plugin|\r\n if system \"vagrant plugin install #{plugin}\"\r\n exec \"vagrant #{ARGV.join(' ')}\"\r\n else\r\n abort \"Installation of plugin #{plugin} has failed. Aborting.\"\r\n end\r\n }\r\nend",
"def activate_plugins\n Vagrant.plugin(\"1\").registered.each do |plugin|\n plugin.activate!\n end\n end",
"def vagrant_plugin_installed(name)\n run_cmd(\"vagrant plugin list\").should match(\"#{name}\")\n end",
"def ensure_plugin(name)\n unless Vagrant.has_plugin?(name)\n system(\"vagrant plugin install #{name}\")\n end\nend",
"def delete_vagrant_plugins\n `vagrant -v`\n rescue Errno::ENOENT\n @ui.info('Vagrant in not installed')\n else\n vagrant_plugin_list = run_command('vagrant plugin list')\n return if vagrant_plugin_list[:output] =~ /No plugins installed/\n\n plugin_regexp = /(\\S+) \\([0-9.]+.*\\)/\n plugins = vagrant_plugin_list[:output].split(\"\\n\").each_with_object([]) do |line, acc|\n acc.push(line.match(plugin_regexp)[1]) if line =~ plugin_regexp\n acc\n end\n run_command(\"vagrant plugin uninstall #{plugins.join(' ')}\") unless plugins.empty?\n end",
"def install_plugin(plugin)\n system \"vagrant plugin install #{plugin}\" unless Vagrant.has_plugin? plugin\nend",
"def install_plugin(plugin)\n system \"vagrant plugin install #{plugin}\" unless Vagrant.has_plugin? plugin\nend",
"def plugin_installed?(name)\n return if Vagrant.has_plugin?(name)\n puts \"Vagrant plugin '#{name}' is NOT installed.\"\n puts 'Please run:'\n puts \"\\tvagrant plugin install #{name}\"\n exit(1)\nend",
"def install_vagrant_plugins\n install_libvirt_plugin = \"vagrant plugin install vagrant-libvirt --plugin-version #{VAGRANT_LIBVIRT_PLUGIN_VERSION}\"\n result = run_command(install_libvirt_plugin)[:value]\n unless result.success?\n @ui.error('Regular vagrant-libvirt installation failed. Retrying with additional options.')\n result = run_command(\"CONFIGURE_ARGS='with-ldflags=-L/opt/vagrant/embedded/lib \"\\\n \"with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib' \"\\\n 'GEM_HOME=~/.vagrant.d/gems GEM_PATH=$GEM_HOME:/opt/vagrant/embedded/gems '\\\n \"PATH=/opt/vagrant/embedded/bin:$PATH #{install_libvirt_plugin}\")[:value]\n end\n if result.success?\n Result.ok('Successfully installed vagrant plugins')\n else\n Result.error('Could not install vagrant plugins')\n end\n end",
"def vagrant_provision\n if @env\n puts \"Running vagrant provision.\"\n @env.cli(\"provision\") && FileUtils.touch('.vagrant_last_provisioned')\n else\n puts \"Setting up vagrant environment.\"\n setup_vagrant && FileUtils.touch('.vagrant_last_provisioned')\n end\nend",
"def is_plugin(name)\n if Vagrant.has_plugin?(name)\n puts \"using #{name}\"\n else\n puts \"please run vagrant plugin install #{name}\"\n exit(1)\n end\nend",
"def plugin_check(plugin_name)\n unless Vagrant.has_plugin?(plugin_name)\n raise \"#{plugin_name} is not installed, please run: vagrant plugin \" \\\n \"install #{plugin_name}\"\n end\nend",
"def installed_plugins(required_plugins)\n required_plugins.reduce([]) do |missing, plugin|\n if Vagrant.has_plugin?(plugin)\n missing\n else\n puts \"#{plugin} plugin is missing. Installing...\"\n %x(set -x; vagrant plugin install #{plugin})\n missing << plugin\n end\n end\nend",
"def required(*plugins)\n if Vagrant.in_installer?\n for plugin in plugins\n unless Vagrant.has_plugin?(plugin)\n raise Vagrant::Errors::PluginNotInstalled.new :name => plugin\n end\n end\n end\nend",
"def plugins\n @plugins ||= Vagrant.plugin(\"2\").manager.synced_folders\n end",
"def plugins\n @plugins ||= Vagrant.plugin(\"2\").manager.synced_folders\n end",
"def register_plugins\n @pluginmanager.register_plugins(@config.get(PROVISIONER_SERVER_URI))\n if @pluginmanager.load_errors?\n log.error 'There was at least one provisioner plugin load failure'\n exit(1)\n end\n if @pluginmanager.register_errors?\n log.error 'There was at least one provisioner plugin register failure'\n exit(1)\n end\n exit(0)\n end",
"def restart()\n stopwatch = Stopwatch.new\n event(\"Pre\")\n if agree(\"Should all the databases be cleared? <%= color('[y/n]', :bold) %>\")\n self.clean_db()\n system( \"vagrant reload --provision\" ) \n else\n system( \"vagrant reload\" )\n end\n event(\"Post\")\n stopwatch.end(\"restarted in:\")\n end",
"def install_vagrant\n return SUCCESS_RESULT unless should_install_vagrant?\n\n FileUtils.rm_rf(File.expand_path('~/.vagrant.d'))\n downloaded_file = generate_downloaded_file_path('rpm')\n result = run_sequence([\n \"wget #{VAGRANT_URL}.rpm -O #{downloaded_file}\",\n \"sudo yum install -y #{downloaded_file}\"\n ])\n FileUtils.rm(downloaded_file)\n result[:value].success?\n end",
"def require_plugin(name, version='>= 0')\n unless Vagrant.has_plugin?(name, version)\n # This displays the error twice. I'm not sure how to fix that. I don't want to\n # use raise because that throws up a huge stack-trace which is overwhelming.\n abort \"'#{name} is not installed!\"\n end\nend",
"def configure_plugins_state(\n plugin_settings = nil,\n source_file = nil,\n install_state_default = 'present',\n install_states = [\n 'ignore',\n 'installed',\n 'uninstalled'\n ],\n manage_plugins_state_default = true,\n version_default = 'latest'\n)\n\n managed_plugins = lookup_values_yaml(plugin_settings, ['managed_plugins'])\n\n return false unless managed_plugins\n\n manage_plugins_state = [\n lookup_values_yaml(plugin_settings, ['defaults', 'manage_plugins_state']),\n manage_plugins_state_default\n ].find { |i| !i.nil? }\n validate_value(manage_plugins_state)\n\n return unless manage_plugins_state\n\n plugins_managed = []\n\n managed_plugins.each do |plugin_name, plugin_info|\n\n exit_with_message(\"plugin [#{plugin_name}] defined more than once in [#{source_file}].\") if plugins_managed.include?(plugin_name)\n\n plugins_managed.push(plugin_name)\n\n # Reserve for future as we may wish to error if a plugin is defined more than once across plugin files.\n $plugins_managed_state.push(plugin_name) unless $plugins_managed_state.include?(plugin_name)\n\n install_state = [\n lookup_values_yaml(plugin_info, ['install_state']),\n lookup_values_yaml(plugin_settings, ['defaults', 'install_state']),\n install_state_default\n ].find { |i| !i.nil? }\n validate_value(install_state, install_states)\n\n if !Vagrant.has_plugin?(plugin_name) and install_state == 'installed'\n\n version = [\n lookup_values_yaml(plugin_info, ['version']),\n version_default\n ].find { |i| !i.nil? }\n\n if version == 'latest'\n version = ''\n else\n version = \"--plugin-version #{version}\"\n end\n\n system_command = Thread.new do\n system(\"vagrant plugin install #{version} #{plugin_name}\")\n end\n\n system_command.join\n\n elsif Vagrant.has_plugin?(plugin_name) and install_state == 'uninstalled'\n\n system_command = Thread.new do\n system(\"vagrant plugin uninstall #{plugin_name}\")\n end\n\n system_command.join\n\n elsif install_states.include?(install_state)\n # No other cases require actions but this prevents error failthrough\n else\n exit_with_message(\"plugin [#{plugin_name}] install_state [#{install_state}] value unsupported.\")\n end\n end\nend",
"def should_install_vagrant?\n vagrant_v_output = run_command('vagrant -v')[:output]\n installed_version = vagrant_v_output.match(/^Vagrant ([0-9.]+)\\s*$/)[1]\n SemVersion.new(VAGRANT_VERSION) > SemVersion.new(installed_version)\n rescue Errno::ENOENT\n true\n end",
"def install_plugins\n ::Revenant.plugins.each do |name, plugin|\n plugin.install(self)\n end\n end",
"def forcereload\n run \"#{try_sudo} /sbin/service puppet force-reload\"\n end",
"def __load_local_plugins\n ARGV.each do |arg|\n if !arg.start_with?(\"-\") && arg == 'bindler'\n bindler_debug 'bindler command detected, setting VAGRANT_NO_PLUGINS to 1'\n ENV[\"VAGRANT_NO_PLUGINS\"] = \"1\"\n break\n end\n end\n\n if ENV['VAGRANT_NO_PLUGINS']\n bindler_debug 'VAGRANT_NO_PLUGINS is set to true, skipping local plugins manifest parsing'\n return\n end\n\n # Prepend our local gem path and reset the paths that Rubygems knows about.\n bindler_debug 'Tweaking GEM_HOME'\n ENV[\"GEM_PATH\"] = \"#{local_data_path.join('gems')}#{::File::PATH_SEPARATOR}#{ENV[\"GEM_PATH\"]}\"\n ::Gem.clear_paths\n\n bindler_debug \"#{bindler_plugins_file} data: #{bindler_plugins.inspect}\"\n bindler_plugins.each do |plugin|\n if plugin.is_a?(String)\n __load_plugin plugin\n else\n __load_plugin *plugin.first\n end\n end\n\n if @__failed_to_load\n plugins = @__failed_to_load.map do |plugin, version|\n \" -> #{plugin} (#{version || \">= 0\"})\"\n end\n raise VagrantPlugins::Bindler::PluginNotFoundError, plugins: plugins.join(\"\\n\")\n end\n end",
"def load_plugins\n return if @plugins_loaded\n Bgo::Application::PluginManager.init\n Bgo::Application::PluginManager.startup(self)\n @plugins_loaded = true\n end",
"def load_plugins\n @plugins.each do |plugin|\n plugin.activate! if plugin.enabled?\n end\n end",
"def install_deps!(node)\n node.vm.provision \"shell\", inline: \"cp -f /vagrant/hosts /etc/hosts\"\n deps = [\n 'java-1.8.0-openjdk',\n 'ed',\n\n # * purely for convenience\n 'the_silver_searcher',\n 'vim',\n 'zip'\n ]\n node.vm.provision \"shell\", inline: \"yum install -y #{deps.join(' ')}\"\nend",
"def reload_plugins?\n !!@reload_plugins\n end",
"def setup\n create_vagrantfile()\n\n teardown()\n\n output << bold(color(\"localhost$\", :green)) << \" vagrant up\\n\"\n vagrant(\"up\")\n\n # Establish ssh connectivity\n nodes.each do |k,v|\n output << bold(color(\"localhost$\", :green)) << \" ssh #{k}\\n\"\n chan = Net::SSH.start(k, 'vagrant', :config => ssh_config)\n\n RSpec.configuration.rspec_storage[:nodes][k] = {\n :ssh => chan,\n }\n end\n\n nil\n end",
"def apt_update(vm)\n vm.provision \"shell\", inline: <<-SHELL\n if [ ! -f /root/apt.updated ]; then\n apt-get -y update\n apt-get -y purge exim4-*\n apt-get -y autoremove\n apt-get -y upgrade\n apt-get -y dist-upgrade\n apt-get -y install htop tree vim aufs-tools\n touch /root/apt.updated\n fi\n SHELL\nend",
"def check_vagrant_version\n Vagrant.require_version \">= 2.1.1\"\nend",
"def reload\n run \"#{try_sudo} /sbin/service puppet reload\"\n end",
"def vagrant(args)\n Dir.chdir(@vagrant_path) do\n system(\"vagrant #{args}\")\n end\n nil\n end",
"def vagrant(args)\n Dir.chdir(@vagrant_path) do\n system(\"vagrant #{args}\")\n end\n nil\n end",
"def install_plugins\n download_plugins\n generate_goodies_includes\nend",
"def installed_plugins\n PluginList.installed(@client)\n end",
"def create_libvirt_pool\n delete_libvirt_pool if run_command('sudo virsh pool-info default')[:value].success?\n images_dir = \"#{ENV['HOME']}/libvirt-images\"\n all_commands = [\n \"sudo mkdir -p #{images_dir}\",\n \"sudo virsh pool-create-as default dir --target #{images_dir}\"\n ].concat(allow_others_recursively_commands(images_dir))\n result = run_sequence(all_commands)[:value]\n if result.success?\n Result.ok('Successfully installed vagrant plugins')\n else\n Result.error('Could not install vagrant plugins')\n end\n end",
"def apt_update(vm)\n vm.provision \"shell\", inline: <<-SHELL\n if [ ! -f /root/apt.updated ]; then\n apt-get -y update\n apt-get -y purge exim4-* libcairo*\n apt-get -y autoremove\n #apt-get -y upgrade\n #apt-get -y dist-upgrade\n apt-get -y install htop tree vim aufs-tools screen curl\n touch /root/apt.updated\n fi\n SHELL\nend",
"def mockup_providers!\n require 'log4r'\n logger = Log4r::Logger.new(\"vagrant::validate\")\n logger.debug(\"Overriding all registered provider classes for validate\")\n\n # Without setting up a tmp Environment, Vagrant will completely\n # erase the local data dotfile and you can lose state after the\n # validate command completes.\n tmp_data_dir = Dir.mktmpdir(\"vagrant-validate-\")\n @env = Vagrant::Environment.new(\n cwd: @env.cwd,\n home_path: @env.home_path,\n ui_class: @env.ui_class,\n vagrantfile_name: @env.vagrantfile_name,\n local_data_path: tmp_data_dir,\n data_dir: tmp_data_dir\n )\n\n Vagrant.plugin(\"2\").manager.providers.each do |key, data|\n data[0].class_eval do\n def initialize(machine)\n end\n\n def machine_id_changed\n end\n\n def self.installed?\n true\n end\n\n def self.usable?(raise_error=false)\n true\n end\n\n def state\n state_id = Vagrant::MachineState::NOT_CREATED_ID\n short = :not_created\n long = :not_created\n Vagrant::MachineState.new(state_id, short, long)\n end\n end\n end\n tmp_data_dir\n end",
"def install\n result = @dependency_manager.install_dependencies\n if @dependency_manager.should_install?('libvirt')\n result = result.and_then { install_vagrant_plugins }\n .and_then { create_libvirt_pool }\n .and_then { export_libvirt_default_uri }\n end\n if @dependency_manager.should_install?('terraform')\n result = result.and_then { install_terraform }\n end\n if result.error?\n @ui.error(result.error)\n else\n @ui.info('Dependencies successfully installed.')\n @ui.info('Please restart your computer in order to apply changes.')\n end\n result\n end",
"def with_plugin(plugin, &block)\n if Vagrant.has_plugin?(plugin)\n yield if block\n else\n log sprintf(ERR_MISSINGPLUGIN, plugin, plugin), :warning\n end\nend",
"def on_restart(&block); end",
"def prepare_reconfiguration\n unless @prepared\n # cmd = \"/etc/init.d/puppetmaster restart\"\n # run_command_on(cmd, master)\n @prepared = true\n end\n end",
"def configure_plugin_vagrant_vbguest(\n plugin_info = nil,\n auto_update_default = false,\n no_remote_default = true,\n iso_path_default = nil\n)\n\n Vagrant.configure(VAGRANT_VERSION) do |config|\n\n config.vbguest.auto_update = [\n validate_value(lookup_values_yaml(plugin_info, ['settings', 'auto_update'])),\n auto_update_default\n ].find { |i| !i.nil? }\n\n config.vbguest.no_remote = [\n validate_value(lookup_values_yaml(plugin_info, ['settings', 'no_remote'])),\n no_remote_default\n ].find { |i| !i.nil? }\n\n iso_path = [\n lookup_values_yaml(plugin_info, ['settings', 'iso_path']),\n iso_path_default\n ].find { |i| !i.nil? }\n config.vbguest.iso_path = iso_path if iso_path\n\n end\nend",
"def load_plugins\n # Add our private gem path to the gem path and reset the paths\n # that Rubygems knows about.\n ENV[\"GEM_PATH\"] = \"#{@gems_path}#{::File::PATH_SEPARATOR}#{ENV[\"GEM_PATH\"]}\"\n ::Gem.clear_paths\n\n # Load the plugins\n rc_path = File.expand_path(ENV[\"VAGRANT_RC\"] || DEFAULT_RC)\n if File.file?(rc_path) && @@loaded_rc.add?(rc_path)\n @logger.debug(\"Loading RC file: #{rc_path}\")\n load rc_path\n else\n @logger.debug(\"RC file not found. Not loading: #{rc_path}\")\n end\n end",
"def reinstall\n end",
"def list\n logger.info \"Retrieving Vagrant plugin list for #{description}\"\n output = instance.execute!(:plugin, \"list\").stdout\n Derelict::Parser::PluginList.new(output).plugins\n end",
"def __load_global_plugins\n # If we're in a Bundler environment, don't load plugins. This only\n # happens in plugin development environments.\n if defined?(Bundler)\n require 'bundler/shared_helpers'\n if Bundler::SharedHelpers.in_bundle?\n @logger.warn(\"In a bundler environment, not loading environment plugins!\")\n return\n end\n end\n\n # Load the plugins\n plugins_json_file = @home_path.join(\"global-plugins.json\")\n bindler_debug(\"Loading plugins from: #{plugins_json_file}\")\n if plugins_json_file.file?\n data = YAML.parse(plugins_json_file.read).to_ruby\n data[\"installed\"].each do |plugin|\n bindler_info(\"Loading plugin from global-plugin.json: #{plugin}\")\n begin\n Vagrant.require_plugin(plugin)\n rescue Vagrant::Errors::PluginLoadError => e\n @ui.error(e.message + \"\\n\")\n rescue Vagrant::Errors::PluginLoadFailed => e\n @ui.error(e.message + \"\\n\")\n end\n end\n end\n end",
"def force_reload\n\t\t\tcall(:on_unload)\n\t\t\t@plugins.clear\n\t\t\treload\n\t\tend",
"def register_plugin\n plugin = Class.new(Vagrant.plugin(\"1\"))\n plugin.name(\"Test Plugin #{plugin.inspect}\")\n yield plugin if block_given?\n @_plugins << plugin\n plugin\n end",
"def basic_config(vm)\n hosts = NODES.map { |hostname, array| \"#{array[0]} #{hostname}\" }.join(\"\\n\")\n bashrc=\"/home/vagrant/.bashrc\"\n vm.provision \"shell\", inline: <<-SHELL\n if ! grep -q \"git-core\" #{bashrc} ; then \n echo \"customizing ~/bashrc\"\n echo \"\\n\\n# Customizations from Vagrantfile:\" >> #{bashrc}\n echo \"export PS1='\\\\[\\\\033[31;1m\\\\]\\\\h\\\\[\\\\033[0;32m\\\\] \\\\w\\\\[\\\\033[00m\\\\]: '\" >> #{bashrc}\n echo export PATH=\"\\$PATH:/usr/lib/git-core:/home/vagrant/teleport/build\" >> #{bashrc}\n echo export GREP_OPTIONS=\"--color=auto\" >> #{bashrc}\n echo \"alias ll='ls -lh'\" >> #{bashrc}\n echo \"alias tsh='tsh --insecure'\" >> #{bashrc}\n fi\n if ! grep -q \"Teleport\" /etc/hosts ; then \n echo \"# Teleport entries added by Vagrant:\" >> /etc/hosts\n echo -e \"#{hosts}\" >> /etc/hosts\n fi\n mkdir -p /var/lib/teleport\n chown vagrant:vagrant /var/lib/teleport\n SHELL\nend",
"def enable\n run \"#{try_sudo} /sbin/chkconfig puppet on\"\n end",
"def setup_dns(node)\n # Set up /etc/hosts\n node.vm.provision \"setup-hosts\", :type => \"shell\", :path => \"ubuntu/vagrant/setup-hosts.sh\" do |s|\n s.args = [\"enp0s8\", node.vm.hostname]\n end\n # Set up DNS resolution\n node.vm.provision \"setup-dns\", type: \"shell\", :path => \"ubuntu/update-dns.sh\"\nend",
"def load_plugins\n Gem.find_latest_files(\"pantry/init.rb\").each do |path|\n begin\n gem_path = path.gsub(\"#{Gem.dir}/gems/\", '')\n Pantry.logger.debug(\"Installing plugin from #{gem_path}\")\n require path\n rescue Exception => ex\n Pantry.logger.warn(\"Unable to load plugin at #{gem_path}, #{ex.message}\")\n end\n end\n end",
"def activate\n plugins.each do |plugin|\n plugin.load! unless plugin.enabled?\n end\n end",
"def provisioned?(vm_name=\"default\", provider=\"virtualbox\")\n File.exist?(\".vagrant/machines/#{vm_name}/#{provider}/action_provision\")\nend",
"def provisioned?(vm_name='default', provider='virtualbox')\n File.exist?(\".vagrant/machines/#{vm_name}/#{provider}/action_provision\")\nend",
"def run\n metadata_file = build_metadata\n install_version = case\n when @date\n releases.detect(&date_proc)[1]\n when @sha\n releases.detect(&sha_proc)[1]\n when @version\n releases.detect(&version_proc)[1]\n end\n\n vagrant_cmd = %w[vagrant box add]\n vagrant_cmd += [\"--box-version\", install_version] if install_version\n vagrant_cmd << metadata_file.path\n\n if @options[:dry_run]\n puts vagrant_cmd.inspect\n else\n system *vagrant_cmd\n end\n ensure\n metadata_file.unlink if metadata_file\n end",
"def update_fs(plugin_name_or_path, plugin_version = nil)\n if plugin_name_or_path.nil?\n @logger.warn('Unable to update the filesystem: no name or path specified')\n return\n end\n\n p = if plugin_version.nil?\n plugin_name_or_path\n else\n @plugins_dir.join('*').join(plugin_name_or_path).join(plugin_version == :all ? '*' : plugin_version)\n end\n\n modified = []\n Dir.glob(p).each do |plugin_dir_path|\n plugin_dir = Pathname.new(plugin_dir_path)\n tmp_dir = plugin_dir.join('tmp')\n FileUtils.mkdir_p(tmp_dir)\n\n yield(tmp_dir) if block_given?\n\n modified << plugin_dir\n end\n\n if modified.empty?\n if plugin_version.nil?\n @logger.warn(\"No plugin found with name #{plugin_name_or_path}. Installed plugins: #{Dir.glob(@plugins_dir.join('*').join('*'))}\")\n else\n @logger.warn(\"No plugin found with name #{plugin_name_or_path} and version #{plugin_version}. Installed plugins: #{Dir.glob(@plugins_dir.join('*').join('*').join('*'))}\")\n end\n end\n\n modified\n end",
"def basic_config(vm)\n bashrc=\"/home/vagrant/.bashrc\"\n vm.provision \"shell\", inline: <<-SHELL\n if ! grep -q \"git-core\" #{bashrc} ; then \n echo \"customizing ~/bashrc\"\n echo \"\\n\\n# Customizations from Vagrantfile:\" >> #{bashrc}\n echo \"export PS1='\\\\[\\\\033[31;1m\\\\]\\\\h\\\\[\\\\033[0;32m\\\\] \\\\w\\\\[\\\\033[00m\\\\]: '\" >> #{bashrc}\n echo export PATH=\"\\$PATH:/usr/lib/git-core:/home/vagrant/teleport/build\" >> #{bashrc}\n echo export GREP_OPTIONS=\"--color=auto\" >> #{bashrc}\n echo \"alias ll='ls -lh'\" >> #{bashrc}\n fi\n SHELL\nend",
"def delete_packages\n return unless ask_confirmation\n\n delete_libvirt_pool\n delete_vagrant_plugins\n delete_terraform\n @dependency_manager.delete_dependencies\n end",
"def apt_get_update hosts\n block_on hosts do |host|\n host.exec(Command.new(\"apt-get update\")) if /ubuntu|debian|cumulus/.match?(host[:platform])\n end\n end",
"def destroy\n getnodes.each{|node|\n Sys.exec(\"vagrant destroy #{node.name} -f\")\n }\n end",
"def load_plugins; end",
"def camaleon_spree_on_upgrade(plugin)\n end",
"def prepare_master_kubeconfig(config)\n\n config.vm.provision \"shell\", inline: <<-SHELL\n mkdir -p /home/vagrant/.kube\n cp -i /etc/kubernetes/admin.conf /home/vagrant/.kube/config\n chown vagrant:vagrant /home/vagrant/.kube/config\n mkdir -p $HOME/.kube\n cp -i /etc/kubernetes/admin.conf $HOME/.kube/config\n chown $(id -u):$(id -g) $HOME/.kube/config\n SHELL\n\nend",
"def vagrant_status\n out = \"\"\n Bundler.with_clean_env do\n out = `vagrant status --machine-readable`\n unless $CHILD_STATUS.exitstatus.zero?\n raise StandardError, \"Failed to run vagrant status\"\n end\n end\n out\nend",
"def configure_vagrant_machine(hostname, vm, cpus, memory)\n is_windows = (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)\n\n vm.box = 'bento/ubuntu-16.04'\n vm.hostname = hostname\n\n vm.provider 'virtualbox' do |vb, override|\n # NAT settings so network isn't super slow\n override.vm.network :private_network, ip: \"192.168.100.50\"\n vb.customize ['modifyvm', :id, '--natdnshostresolver1', 'on']\n vb.customize ['modifyvm', :id, '--natdnsproxy1', 'on']\n vb.cpus = cpus\n vb.memory = memory\n vb.name = \"vagrant-#{hostname}\"\n\n if is_windows\n override.vm.synced_folder \".\", \"/vagrant\", mount_options: [\"fmode=700\"]\n end\n end\n\n vm.provider 'parallels' do |prl, override|\n override.vm.network :private_network, ip: \"192.168.100.50\"\n prl.update_guest_tools = true\n prl.optimize_power_consumption = false\n prl.cpus = cpus\n prl.memory = memory\n prl.name = \"vagrant-#{hostname}\"\n end\nend",
"def ansible_provision(vm_object)\n vm_object.vm.provision :ansible_local do |ansible|\n ansible.install_mode = \"pip\"\n ansible.version = \"2.3\"\n ansible.playbook = \"provision.yml\"\n # ansible.verbose = \"-vvvv\"\n ansible.extra_vars = {\n :backend => vm_object.vm.hostname\n }\n end\nend",
"def installed?\n File.exist?(\"/etc/munin/plugins/#{name}\")\n end",
"def phased_restart; end",
"def configure_ssh(vm)\n vm.provision \"shell\", inline: <<-SHELL\n mkdir -p /home/vagrant/.ssh\n rm -rf /home/vagrant/.ssh/id_rsa*\n chown vagrant:vagrant /home/vagrant/.ssh\n SHELL\n vm.provision \"file\", source: '~/.ssh/id_rsa', destination: '~/.ssh/id_rsa'\n vm.provision \"file\", source: '~/.ssh/id_rsa.pub', destination: '~/.ssh/id_rsa.pub'\n vm.provision \"file\", source: '~/.ssh/id_rsa.pub', destination: '~/.ssh/authorized_keys'\n vm.provision \"file\", source: '~/.screenrc', destination: '~/' if File.exists? \"~/.screnrc\"\nend",
"def vagrant?\n @vagrant ||= `id vagrant 2>&1`.index 'uid'\n end",
"def provision_system(node)\n node.vm.provision :hosts, :sync_hosts => true\n node.vm.provision :ansible do |ansible|\n ansible.playbook = 'ansible/site.yml'\n ansible.become = true\n ansible.verbose = false\n ansible.limit = :all\n ansible.groups = {\n 'master' => [fqdn(1)],\n 'node' => [fqdn(2)]\n }\n end\nend",
"def update_plugins\n @plugin_list = @plugins.to_a.map { |i| i[1] }\n cell_view_paths = [File.join(Rails.root.to_s, 'app', 'cells')]\n cell_view_paths = cell_view_paths + plugins.map { |plugin| File.join(plugin.root_path, 'app', 'cells') }\n Cell::Rails.view_paths = cell_view_paths\n end",
"def recover_plugin(plugin)\n plugin.each do |plug|\n p = Plugin.new(name:plug.name, checks_id: plug.checks_id)\n\n logger.info(\"p :#{p}\")\n begin \n p.save\n rescue => e\n logger.error(\"recover plugin error, #{e}\")\n return\n end\n end\n end",
"def plugins; end",
"def plugins; end",
"def plugins; end",
"def plugins; end",
"def upgrade_vps(hosts=nil)\n\n log { \"Upgrading vps\" }\n if hosts\n if hosts.is_a?(Array)\n hosts=hosts.to_h(true)\n end\n issue_command_on_hosts(hosts,{ :retry => true, :maxalert => EMAIL, :timeout => 30}){|vp| vp.check_for_update}\n else\n probe_from_all_w_opt_retry(30,true){|vp| vp.check_for_update}\n end\n end",
"def post_install\n end",
"def refresh \n if (@parameters[:ensure].value == :running)\n provider.restart\n else\n debug \"Skipping restart; service is not running\"\n end\n end",
"def initiate_nodes_upgrade\n upgrade_nodes = Node.all.reject do |node|\n node.admin? || node[:platform] == \"windows\" || node.state != \"crowbar_upgrade\"\n end\n check_if_nodes_are_available upgrade_nodes\n admin_node = Node.admin_node\n upgrade_nodes_failed = []\n\n upgrade_nodes.each do |node|\n node[\"target_platform\"] = admin_node[\"provisioner\"][\"default_os\"]\n node.save\n node.set_state(\"os-upgrading\")\n end\n\n # wait for the pxe_config to be updated, then reboot the nodes\n discovery_dir = \"#{Node.admin_node[:provisioner][:root]}/discovery/\"\n pxecfg_subdir = \"bios/pxelinux.cfg\"\n\n upgrade_nodes.each do |node|\n boot_ip_hex = node[\"crowbar\"][\"boot_ip_hex\"]\n node_arch = node[\"kernel\"][\"machine\"]\n pxe_conf = \"#{discovery_dir}/#{node_arch}/#{pxecfg_subdir}/#{boot_ip_hex}\"\n ready_for_reboot = false\n\n while Time.now.to_i < Time.now.to_i + 120 && !ready_for_reboot\n Rails.logger.debug(\"waiting for pxe configuration to be updated for #{node.name}\")\n if File.file?(pxe_conf)\n File.open(pxe_conf).each_line do |line|\n line.chomp!\n if line =~ /^DEFAULT\\s+.+_install$/\n ready_for_reboot = true\n end\n end.close\n end\n sleep(5) unless ready_for_reboot\n end\n if ready_for_reboot\n Rails.logger.debug(\"Rebooting node #{node.name} for operating system upgrade\")\n ssh_status = node.ssh_cmd(\"/sbin/reboot\")\n if ssh_status[0] != 200\n Rails.logger.error(\"Upgrade failed for machine #{node.name}. Could not ssh.\")\n upgrade_nodes_failed.push(node.name)\n end\n else\n Rails.logger.error(\"Upgrade failed for #{node.name}. Node not ready for reboot\")\n upgrade_nodes_failed.push(node.name)\n end\n end\n # If list is empty, this method was successful.\n upgrade_nodes_failed\n end",
"def provisioned?(vm_name='default', provider='virtualbox')\n File.exist?(\".vagrant/machines/#{vm_name}/#{provider}/action_provision\")\n end",
"def post_install; end",
"def all_plugins; end",
"def install_python(config)\n config.vm.provision \"shell\",\n inline: \"which python > /dev/null || sudo apt-get -y install python\"\nend",
"def load_gem_plugins; end",
"def setup_plugin\n if options[:list] || plugin_file.nil?\n list_plugins\n else # executing the plugin instructions\n self.destination_root = options[:root]\n if in_app_root?\n self.behavior = :revoke if options[:destroy]\n execute_runner(:plugin, plugin_file)\n else\n say \"You are not at the root of a Padrino application! (config/boot.rb not found)\"\n end\n end\n end"
] |
[
"0.79404646",
"0.7931553",
"0.79290783",
"0.77577674",
"0.77577674",
"0.77577674",
"0.77577674",
"0.77577674",
"0.7479775",
"0.7350261",
"0.728334",
"0.71197504",
"0.71009606",
"0.707834",
"0.70095354",
"0.70095354",
"0.69671136",
"0.68325543",
"0.6677157",
"0.6558509",
"0.65469635",
"0.6534797",
"0.6282743",
"0.61685306",
"0.61685306",
"0.6114089",
"0.6040772",
"0.599901",
"0.5957336",
"0.59198534",
"0.5857668",
"0.5751983",
"0.57510716",
"0.5731672",
"0.5654183",
"0.5651153",
"0.5637563",
"0.56334555",
"0.55466926",
"0.5528888",
"0.55149937",
"0.55021137",
"0.55008745",
"0.55008745",
"0.54978126",
"0.54885507",
"0.54832804",
"0.547098",
"0.5468048",
"0.5466392",
"0.54522026",
"0.5442972",
"0.54266953",
"0.54266244",
"0.5423581",
"0.538951",
"0.5376112",
"0.53734976",
"0.5359637",
"0.5355678",
"0.53462785",
"0.52954185",
"0.5285988",
"0.5285066",
"0.52749085",
"0.52662396",
"0.52617764",
"0.5218898",
"0.5182379",
"0.5172707",
"0.5163421",
"0.5161106",
"0.515359",
"0.51535875",
"0.51482403",
"0.51430297",
"0.5120613",
"0.5117902",
"0.51148397",
"0.51104945",
"0.5085184",
"0.5079316",
"0.5074666",
"0.5073713",
"0.5059608",
"0.50575024",
"0.5056336",
"0.5056336",
"0.5056336",
"0.5056336",
"0.5053061",
"0.5052171",
"0.5044115",
"0.50396734",
"0.5031071",
"0.50277823",
"0.5026886",
"0.50236577",
"0.5023654",
"0.50230753"
] |
0.54581404
|
50
|
you want to find the product of every integer except the integer at that index. Write a function get_products_of_all_ints_except_at_index() that takes an array of integers and returns an array of the products. O(n2)
|
def product(array)
products = []
current = 0
while (current < array.length)
i = 0
product = 1
while (i < array.length)
if i != current
product *= array[i]
end
i += 1
end
products << product
current += 1
end
products
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_products_of_all_ints_except_at_index_brute(arr)\n result = []\n arr.each_with_index do |el, i|\n arr.delete_at(i)\n product = arr.inject(1) {|product, int| product*int}\n arr.insert(i, el)\n result << product\n end\n result\nend",
"def get_products_of_all_ints_except_at_index(array)\n\n if array.length < 2\n raise IndexError, 'You need more than 2 integers to get the products'\n end\n\n products_of_integers_except_current_index = []\n\n product_so_far = 1\n i = 0\n while i < array.length\n products_of_integers_except_current_index[i] = product_so_far\n product_so_far *= array[i]\n i += 1\n end\n\n product_so_far = 1\n i = array.length - 1\n while i >= 0\n products_of_integers_except_current_index[i] *= product_so_far\n product_so_far *= array[i]\n i -= 1\n end\n\n return products_of_integers_except_current_index\nend",
"def get_products_of_all_ints_except_at_index(array)\n\t# Make sure there are atleast two integers in the array\n\tif array.length < 2\n\t\traise IndexError, \"Two or more integers are required\"\n\tend\n\n\tproducts_of_all_ints_except_at_index = []\n\n\t# For each integer we find the product of all the integers before it, storing the total product so far each time\n\tproduct_so_far = 1\n\ti = 0\n\twhile i < array.length\n\t\tproducts_of_all_ints_except_at_index[i] = product_so_far\n\t\tproduct_so_far *= array[i]\n\t\ti += 1\n\tend\n\n\t# For each integer, find the product of all the integers after it. Since each index in products already has the product of all the integers before it, now store the total product of all other integers\n\tproduct_so_far = 1\n\ti = array.length - 1\n\twhile i >= 0\n\t\tproducts_of_all_ints_except_at_index[i] *= product_so_far\n\t\tproduct_so_far *= array[i]\n\t\ti -= 1\n\tend\n\n\treturn products_of_all_ints_except_at_index\nend",
"def get_products_of_all_ints_except_at_index(arr)\n result = Array.new(arr.length, 1)\n\n product_so_far_before_index = 1\n arr.each_with_index do |int, i|\n result[i] = product_so_far_before_index\n product_so_far_before_index *= int\n end\n\n product_so_far_after_index = 1\n i = arr.length-1\n while i >= 0\n result[i] *= product_so_far_after_index\n product_so_far_after_index *= arr[i]\n i -= 1\n end\n result\nend",
"def get_products_of_all_ints_except_at_index(array)\n result_array = []\n array.each do |num|\n working_array = array.dup\n working_array.delete(num)\n product = working_array.reduce {|sum, num| sum * num}\n result_array << product\n end\n\n return result_array\nend",
"def get_products_of_all_ints_except_at_index(array)\n before_prod = 1\n prod = []\n \n after_prod = 1\n after = []\n after[array.length - 1] = 1\n\n i = array.length - 1\n while (i > 0)\n\n # find products after\n after_prod *= array[i]\n after[i - 1] = after_prod\n\n i -= 1\n end\n\n i = 0\n while (i < array.length)\n\n # find products before\n prod[i] = after[i] * before_prod\n before_prod *= array[i]\n\n i += 1\n end \nend",
"def get_products_of_all_ints_except_at_index(array)\n combos = []\n\n array.each_with_index do |a, index|\n temp = array.each_with_index.map do |i, mapindex|\n if index != mapindex\n i\n end\n end\n combos.push(temp.compact)\n end\n\n new_array = []\n (combos.length).times do |a|\n final = 1\n combos[a].each { |i| final *= i }\n new_array.push(final)\n end\n\n puts new_array.to_s\n\nend",
"def products_of_all_ints_except_index_on2(int_arr=[])\n\t\tproducts = []\n\t\t# iterate over int_array\n\t\t# calculate the products except index and shuffle in\n\t\t#[1, 7, 3, 4]\n\n\t\tint_arr.each_with_index do |outer_int, outer_index|\n\t\t\t#[1, 7, 3, 4]\n\t\t\tproduct = 1\n\t\t\tint_arr.each_with_index do |inner_int, inner_index|\n\t\t\t\tnext if outer_index == inner_index\n\t\t\t\tproduct *= inner_int\n\t\t\tend\n\t\t\tproducts << product\n\t\tend\n\t\tproducts\n\tend",
"def get_products_of_all_ints_except_index(arr)\n products_array = []\n \n arr.each_with_index do |num, index|\n # new array with number at the current index removed\n \n removed_num = arr.delete_at(index)\n\n # multiply the other numbers\n # push that into the products array\n products_array << arr.reduce(:*)\n\n # reinsert removed number\n arr.insert(index, removed_num)\n \n end\n puts products_array\nend",
"def products_except_me(numbers)\n numbers.map.with_index do |num,idx|\n sub_array=numbers[0...idx] + numbers[idx+1..-1]\n array_product(sub_array)\n end\nend",
"def products_of_all_ints_except_index_on1(int_arr=[])\n\t\traise ArgumentError, \"Argument must be an Array\" unless int_array.is_a? Array\n\t\t# save space by storing products for each index in one array\n\t\tproducts_of_all_ints_except_index = []\n\n\t\t# get the products of all ints before index\n\t\tproduct_so_far = 1\n\t\tfor i in (0...int_arr.length)\n\t\t\tproducts_of_all_ints_except_index[i] = product_so_far\n\t\t\tproduct_so_far *= int_arr[i]\n\t\tend\n\n\t\t# multiply the product of all ints after each index by the products before each index\n\t\ti = int_arr.length - 1\n\t\tproduct_so_far = 1\n\t\twhile i >= 0\n\t\t\tproducts_of_all_ints_except_index[i] *= product_so_far\n\t\t\tproduct_so_far *= int_arr[i]\n\t\t\ti -= 1\n\t\tend\n\t\tproducts_of_all_ints_except_index\n\tend",
"def products_except_me(numbers)\n numbers.map.with_index do |num, idx|\n sub_arr = numbers[0...idx] + numbers[idx + 1..-1]\n sub_arr.reduce(:*)\n end\nend",
"def products_except_me(numbers)\n\n result = []\n numbers.each_index do |i|\n subarr = numbers[0...i] + numbers[i+1..-1]\n result << subarr.reduce(:*)\n\n end\n result\nend",
"def get_products_of_all_ints_except_at_index_with_div(arr)\n result = Array.new(arr.length, 0)\n\n if arr.include? 0\n index_of_0 = arr.find_index(0)\n else\n product = arr.inject(1) {|product, int| product*int}\n arr.each_with_index do |int, i|\n result[i] = product / int\n end\n end\n p result\nend",
"def integer_products integers\n\t# use each with index to loop through integers and find product of all other integers\n\t# better solution:\n\t# create an array that corresponds to the product of each integer before each index, and an array of the product of each integer after each index\n\tproduct_so_far = 1\n\tproducts_before_index = []\n\tintegers.each_with_index do |int, index|\n\t\tproducts_before_index[index] = product_so_far\n\t\tproduct_so_far*= integers[index]\n\tend\n\n\tproducts_after_index = []\n\tproduct_so_far = 1\n\ti = integers.length - 1\n\twhile i >= 0\n\t\tproducts_after_index[i] = product_so_far\n\t\tproduct_so_far*= integers[i]\n\t\ti-= 1\n\tend\n\n\treturn [products_before_index, products_after_index]\n\nend",
"def product_array(num_array)\n product_arr = []\n num_array.each_with_index do |num1, i|\n product = 1\n num_array.each_with_index do |num2, j|\n product *= num2 unless i == j\n end\n product_arr.push(product)\n end\n product_arr\nend",
"def get_products_before_index(int_array)\n product_so_far = 1\n all_products_before = []\n for index in (0...int_array.length)\n #product before the first element in array is 1\n #therefore we don't want to calculate the produce\n #until we have pushed the product into the array\n all_products_before[index] = product_so_far\n product_so_far *= int_array[index]\n end\n all_products_before\nend",
"def get_product_integers(array_of_integers)\n\n results = []\n array_of_integers.each_with_index do |num1,index1|\n product = 1\n array_of_integers.each_with_index do |num2,index2|\n next if index1 == index2\n product *= num2\n end\n results << product\n end\n p results\n\n end",
"def product_array(input_array)\n return_array = []\n input_array.each_with_index do |x, i|\n # puts \"x is #{x} and i is #{i}\"\n product = 1\n input_array.each_with_index do |y,j|\n if i!=j\n product *= y\n end\n end\n return_array << product\n end\n return return_array\nend",
"def products_except_me(numbers)\n sum_of_products = []\n i = 0\n while i < numbers.length\n product_array = []\n j = 0\n while j < numbers.length\n if i != j\n product_array.push(numbers[j])\n end\n j += 1\n end\n sum_of_products.push(array_product(product_array))\n i += 1\n end\n sum_of_products\nend",
"def products_except_me(numbers)\n # get the products of all numbers\n product = 1\n numbers.each do |i|\n product *= i\n end\n\n results = []\n # remove the element in product by dividing\n numbers.each do |i|\n results << (product / i)\n end\n results\nend",
"def get_products(arr)\n current_idx = -1\n arr.map do |ele|\n current_idx += 1\n arr.reject { |e| arr[current_idx] == e }.inject(:*)\n end\nend",
"def array_product_bruteforce(a)\r\n\tprod = Array.new(a.size)\r\n\ti = 0\r\n\r\n\twhile i < a.size\r\n\t\tc = a[0..a.size]\r\n\t\tc.delete_at(i)\r\n\t\tprod[i] = c.inject(:*)\r\n\t\ti += 1\r\n\tend\r\n\treturn prod\r\nend",
"def get_other_products(nums)\n nums_copy = nums.dup\n other_products = Array.new(nums.length)\n\n nums.each_with_index do | num, curr_idx |\n nums_copy.delete_at(curr_idx)\n other_products[curr_idx] = nums_copy.reduce(:*)\n nums_copy = nums.dup\n end\n return other_products\nend",
"def get_products_improved(arr)\n product_array = Array.new(arr.length)\n product = 1\n\n i = 0\n while i < arr.length\n product_array[i] = product\n product *= arr[i]\n i += 1\n end\n\n product = 1\n i = arr.length - 1\n while i >= 0\n product_array[i] *= product\n product *= arr[i]\n i -= 1\n end\n\n product_array\n\nend",
"def get_products(arr)\n front_products_arr = [] # => [1, 1*7, 1*7*3, 1*7*3*4]\n back_products_arr = [] # => [4, 3*4, 7*3*4, 1*7*3*4]\n front_product = 1\n\n arr.each do |el|\n front_product *= el\n front_products_arr << front_product\n end\n\n back_product = 1\n (arr.length - 1).downto(0) do |el|\n back_product *= arr[el]\n back_products_arr << back_product\n end\n\n final_products = [] # => [7*3*4, 1*3*4, 1*7*4, 1*7*3]\n final_index = arr.length - 2 # => 2\n 0.upto(final_index) do |el| # upto 2\n if el == 0\n final_products << back_products_arr[final_index]\n else\n final_products << front_products_arr[el - 1] * back_products_arr[final_index - el]\n end\n end\n final_products << front_products_arr[final_index]\n\n final_products\nend",
"def calculate_products_of_all_other_elements(nums)\n product_of_other_elements = Array.new(nums.count, 1)\n\n nums.count.times do |i|\n nums.count.times do |j|\n next if i == j\n\n product_of_other_elements[i] = product_of_other_elements[i] * nums[j]\n end\n end\n\n product_of_other_elements\nend",
"def solution(arr)\n arr.map do |i|\n arr_without_i = arr.select { |item| item != i }\n arr_without_i.reduce { |n, acc| acc *= n }\n end\nend",
"def products(arr)\n\tproducts = []\n\tproduct = 1\n\tfor i in 0..arr.length-1\n\t\tproducts[i] = product\n\t\tproduct = product * arr[i]\n\tend\n\ti = arr.length - 1\n\tproduct = 1\n\twhile i >= 0\n\t\tproducts[i] = products[i] * product\n\t\tproduct = arr[i] * product\n\t\ti -= 1\n\tend\n\tproducts\nend",
"def multiply_arrnums_by_index(numbers) # array of ints\n new_array = [] # empty array\n i = 0 # start at indice 0\n while i < numbers.length\n new_array << numbers[i] * i # shovel value of int val of the indice * the indice\n # numb_to_mult = numbers[i]\n # numb_multd = numbers[i] * numb_to_mult\n # new_array << numb_multd\n i += 1 # next iteration\n end\n return new_array\nend",
"def other_nums(arr)\n current_product = 1\n products_arr = []\n for i in (0...arr.length)\n products_arr[i] = current_product\n current_product *= arr[i]\n end\n\n reverse_products_array = []\n reverse_product_so_far = 1\n len = arr.length - 1\n while len >= 0\n reverse_products_array[len] = reverse_product_so_far\n reverse_product_so_far *= arr[len]\n len -= 1\n end\n return [reverse_products_array, products_arr]\nend",
"def arr_product(arr)\n arr.map do |el|\n arr.select { |selector| arr.index(selector) != arr.index(el) }.reduce(:*)\n end\nend",
"def products_of_all_other_nums(array)\n\n\tresult = Array.new() { [] }",
"def prod_arr(x)\n len = x.length\n product = Array.new(len,1)\n\n for i in 0...len\n for j in 0...len\n next if i == j\n product[i] *= x[j]\n end\n end\n return product\nend",
"def element_times_index(numbers)\n multiplied_numbers = []\n \n i = 0\n while i < numbers.length\n multiplied_numbers << numbers[i] * i\n \n i += 1\n end\n \n return multiplied_numbers\nend",
"def product(int)\n (1..int).reduce(1,:*)\nend",
"def arr_product(arr)\n product = arr.reduce(:*)\n arr.map { |el| product / el }\nend",
"def my_function3(arr)\n final_arr = []\n first_product = 1\n last_half = []\n arr.each_with_index do |n, i|\n last_half = arr[i+1..-1]\n first_product *= arr[i-1] unless i == 0\n last_product = last_half.reduce(:*) || 1\n products = first_product * last_product\n final_arr.push(products)\n end\n return \"Products: #{final_arr}\"\nend",
"def sum_of_product(arr)\n sum = []\n arr.each_with_index {|element, index| sum << element * index}\n sum.sum\n end",
"def odd_product(arr)\n\tarr.filter! { |i| (i % 2 != 0) }\n\tx = arr.inject(:*)\n\treturn x\nend",
"def get_products_but_self(arr)\n # raise 'need more than itself to get all other products' if arr.length < 2\n # result = [] \n # #first just try to come up with a way that works even if it's slow \n # arr.each_with_index do |el,idx|\n # arr[idx] = 1 \n # result << arr.reduce(:*) O(n) in a O(n) loop \n # arr[idx] = el \n # end \n # result This works, Time: O(n^2) space:O(n), created 1 new array Now try to optimize \n \n # Faster way, trying greedy way, constanly update the variable\n products_before_el = [1] # when we are at the first el, the product before that we use 1\n products_after_el = [] #we know that product after the last el, we can use 1, and since\n #we can only multiply, we backwards from the last el for products after el\n end_idx = arr.length - 1 \n products_after_el[end_idx] = 1\n (1..end_idx).each do |i| # time O(n)\n products_before_el[i] = products_before_el[i-1]*arr[i-1]\n products_after_el[end_idx - i] = products_after_el[end_idx - i + 1]*arr[end_idx - i +1]\n end \n result = []\n arr.length.times do |i| \n result[i] = products_before_el[i] * products_after_el[i]\n end \n result \n\n # Can we improve on space? \nend",
"def find_product(nums)\n multiplication = 1\n\n new_array = []\n\n nums.each do |num|\n multiplication *= num\n end\n\n nums.each do |num|\n new_array << multiplication / num\n end\n\n return new_array\nend",
"def product_except_self(nums)\n answer = Array.new(nums.size)\n leftprod, rightprod = 1, 1\n\n nums.size.times do |i|\n answer[i] = leftprod\n leftprod *= nums[i]\n end\n# Ex: For nums.size = 4,\n# answer[0] = 1\n# answer[1] = nums[0]\n# answer[2] = nums[0] * nums[1]\n# answer[3] = nums[0] * nums[1] * nums[2]\n\n\n (nums.size - 2).downto(0).each do |i|\n rightprod *= nums[i + 1]\n answer[i] *= rightprod\n end\n# answer[2] = answer[2] * nums[3]\n# answer[1] = answer[1] * nums[2] * nums[3]\n# answer[0] = answer[0] * nums[1] * nums[2] * nums[3]\n\n answer\nend",
"def product(arr)\n product = 1\n for i in 0...arr.length\n product *= arr[i]\n end\n product\nend",
"def products(nums)\n return [] if nums.count < 2\n\n res = [1]\n\n # res[i] contains the product of all the elements to the left\n # Note: for the element at index '0', there are no elements to the left,\n # so the res[0] would be 1\n (0..(nums.count - 2)).each do |i|\n num = nums[i]\n res << num * res[i]\n end\n\n # product contains the product of all the elements to the right\n # Note: for the element at index 'length - 1', there are no elements to the right,\n # so the product would be 1\n product = 1\n\n (nums.count - 1).downto(1) do |i|\n num = nums[i]\n # For the index 'i', product would contain the\n # product of all elements to the right. We update product accordingly.\n res[i - 1] *= (product * num)\n product *= num\n end\n\n res\nend",
"def productify_easy(arr)\n product = arr.inject(:*)\n new_arr = []\n arr.each do |num|\n new_arr << product / num\n end\n new_arr\nend",
"def productify(arr)\n\n up_product = 1\n up_array = []\n arr.length.times do |idx|\n up_product *= arr[idx]\n up_array << up_product\n end\n\n down_product = 1\n down_array = Array.new(arr.length)\n (arr.length - 1).downto(0) do |idx|\n down_product *= arr[idx]\n down_array[idx] = down_product\n end\n\n result = []\n arr.length.times do |idx|\n product = 1\n up_idx = idx - 1\n down_idx = idx + 1\n if up_idx >= 0\n product *= up_array[up_idx]\n end\n if down_idx < arr.length\n product *= down_array[down_idx]\n end\n result[idx] = product\n end\n\n result\n\nend",
"def my_function4(arr)\n products_arr = []\n products_so_far = 1\n i = 0\n while i < arr.length\n products_arr[i] = products_so_far\n products_so_far *= arr[i]\n i += 1\n end\n\n products_so_far = 1\n i = arr.length - 1\n while i >= 0\n products_arr[i] *= products_so_far\n products_so_far *= arr[i]\n i -= 1\n end\n\n return \"Products: #{products_arr}\"\nend",
"def my_function2(arr)\n final_arr = []\n first_half = []\n first_product = 1\n last_half = []\n arr.each_with_index do |n, i|\n first_half = arr[0...i]\n last_half = arr[i+1..-1]\n first_product = first_half.reduce(:*) || 1\n last_product = last_half.reduce(:*) || 1\n products = first_product * last_product\n final_arr.push(products)\n end\n return \"Products: #{final_arr}\"\nend",
"def element_times_index(numbers)\n\tfor i in 0..numbers.length-1\n numbers[i] *= i\n end\n return numbers\nend",
"def product_except_self(nums)\n (nums)\n .each_cons(2)\n .inject([1]) { |acc, x|\n acc << acc.last * x[0]\n }\n .zip((nums\n .reverse)\n .each_cons(2)\n .inject([1]) { |acc, x|\n acc << acc.last * x[0]\n }\n .reverse)\n .map.with_index { |x, i|\n x[0] * x[1] \n }\nend",
"def find_solution(arr)\n arr.each_with_index do |e, i|\n rest = arr[0..i - 1] + arr[i + 1..-1]\n prod = rest.reduce(:*)\n arr[i] = prod\n end\n\n arr\nend",
"def multiply_me(array, int)\r\n\r\n arr = [] # empty array created\r\n\r\n i = 0 # iteration starts to multiply each item\r\n while i < array.length\r\n arr << array[i] * int # products collected\r\n i += 1\r\n end\r\n\r\n arr # result\r\nend",
"def index_multiplier_method\n #@multiplied_integer_array = []\n @reversed_array.each_with_index do |value, index|\n if index.odd? == true\n value = value * 2\n @multiplied_integer_array << value\n else\n value = value\n @multiplied_integer_array << value\n end\n end\n return @multiplied_integer_array\n end",
"def element_times_index(nums)\n indexed_nums = []\n i = 0\n\n while i < nums.length\n num_indexed = nums[i] * i\n indexed_nums << num_indexed\n i += 1\n end\n\n return indexed_nums\nend",
"def productify(array)\n prods = [1] * array.length\n current = array[0]\n (1...array.length).each do |i|\n prods[i] *= current\n current *= array[i]\n end\n current = array[-1]\n (array.length - 2).downto(0).each do |i|\n prods[i] *= current\n current *= array[i]\n end\n\n prods\nend",
"def product(number)\n (1..number).inject(:*)\nend",
"def odd_product(arr)\n product=1\n arr.each do |a|\n if a.odd?\n product=product*a\n end\n end\n return product\nend",
"def calculate_product_odd(arr)\n product = []\n arr.each { |x| x.odd? ? product << x : x }\n y = 1\n product.each { |x| y *= x }\n y\nend",
"def element_times_index(arr)\n result = []\n i = 0\n while i < arr.length\n result << arr[i] * i\n i+= 1\n end\n return result\nend",
"def productify(arr)\n products = Array.new(arr.length, 1)\n\n lower_prod = 1\n 0.upto(arr.size - 1) do |i|\n products[i] = products[i] * lower_prod\n lower_prod = lower_prod * arr[i]\n end\n\n upper_prod = 1\n (arr.size - 1).downto(0) do |i|\n products[i] = products[i] * upper_prod\n upper_prod = upper_prod * arr[i]\n end\n\n products\nend",
"def element_times_index(numbers)\n\tmulti = []\n \n\ti = 0\n\twhile i < numbers.length\n\t\titem = numbers[i]*i\n\t\tmulti << item\n\t\ti += 1\n end\n\n\treturn multi\nend",
"def element_times_index(numbers)\n \n new_arr = []\n\n i = 0 \n while i < numbers.length\n new_num = numbers[i] * i\n new_arr << new_num\n i += 1\n end\n\n return new_arr\nend",
"def my_product(array)\n return nil if array.length == 0\n\n product = 1\n array.each do |elem|\n product = product * elem\n end\n product\nend",
"def element_times_index(numbers)\n new_arry = []\n i = 0\n while i < numbers.length\n new_arry << numbers[i] * i\n i += 1\n end\n return new_arry\n\nend",
"def productify(arr)\n products = Array.new(arr.length, 1)\n\n lower_prod = 1\n\n 0.upto(arr.size - 1) do |i|\n products[i] = products[i] * lower_prod\n lower_prod = lower_prod * arr[i]\n end\n\n upper_prod = 1\n\n (arr.size - 1).downto(0) do |i|\n products[i] = products[i] * upper_prod\n upper_prod = upper_prod * arr[i]\n end\n\n products\nend",
"def naive_algorithm(arr)\n\tproduct = 0\n\tarr.each do |i|\n\t arr.each do |j|\n\t \tp = arr[i] * arr[j]\n\t \tproduct = p if product < p\n\t end\t\n\tend\t\t\n\tproduct\nend",
"def element_times_index(numbers)\n new_nums = []\n \n i = 0\n while i < numbers.length\n new_nums << numbers[i] * i\n \n i += 1\n end\n \n return new_nums\n end",
"def max_product(numbers, n)\n max_product = 0\n num_array = numbers.map( &:to_i )\n subset_size = 0..n-1\n\n while( num_array.length >= n )\n subset = num_array[subset_size]\n tmp_product = subset.reduce(:*)\n if tmp_product > max_product\n max_product = tmp_product \n end\n num_array.shift\n end\n max_product\nend",
"def highest_product_brute(array_of_ints)\n array_size = array_of_ints.size\n return \"Input array has to contain at least 3 integers.\" if array_size < 3\n highest_three_integers = array_of_ints.sort.slice(array_size-3, 3)\n result = highest_three_integers.inject(:*)\nend",
"def productify(array)\n len = array.length\n left = Array.new(len){1}\n right = Array.new(len){1}\n\n # step 1 create left array and right array O(n)\n array.each_index do |i|\n next if i == 0\n left[i] = left[i - 1] * array[i - 1]\n right[len - i - 1] = right[len - 1] * array[len - i]\n end\n\n # step 2 multiply products O(n)\n array.each_index do |i|\n array[i] = left[i] * right[i]\n end\n\n # step 3 return results\n array\n\n # time complexity O(n + n) => O(n)\nend",
"def pair_product(arr,num)\n arr.each_with_index do |ele, idx|\n arr.each_with_index do |e2, idy|\n if idx != idy\n if ele * e2 == num \n return true\n end\n end\n end\n end \n return false\nend",
"def multiplyArray (a)\n if (a.size == 0)\n return 1\n end\n\n total = 1\n\n return a.reject(&:zero?).inject(:*) # rejecting zero prevents the product from becoming zero\nend",
"def odd_product(arr)\n sum = 1\n for i in arr\n if i.odd?\n sum *= i\n end\n end\n sum\nend",
"def product(nums)\n nums.inject(1) { |product, n| product * n }\nend",
"def product_array(a)\n len=a.length\n product=Array.new(len,1) # Initilaize product array elements to 1\n temp=1\n\n #Loop to store product of left elements\n for i in 0...len\n product[i]=temp\n temp*=a[i]\n end\n\n temp=1 #reset temp variable to 1\n\n #Loop to multiply stored left products with right products\n for i in (len-1).downto(0)\n product[i]*=temp\n temp*=a[i]\n end\n\n return product\nend",
"def product_except_self(nums)\n ans = [1]\n # Calculate the left side values\n (1..(nums.length - 1)).each do |i|\n ans[i] = ans[i-1] * nums[i-1] \n end\n \n r = 1\n # Calculate right side values\n ((nums.length-1).downto(0)).each do |i|\n ans[i] *= r\n r *= nums[i]\n end\n ans\n end",
"def mutiply_all_element_of_an_array_excep_itself2(array_n)\n total_mutiplication_value = 1\n result_array = []\n \n array_n.each do |elm|\n total_mutiplication_value = elm * total_mutiplication_value\n end\n \n puts \"Total mutiplication : #{total_mutiplication_value}\"\n \n array_n.each do |elm|\n result = divide_by_bit_shift(total_mutiplication_value, elm)\n result_array.push(result[0])\n end\n \n\n return result_array\nend",
"def index_multiplier_method(reverse_integer_array)\n multiplied_integer_array = []\n reverse_integer_array.each_with_index do |value, index|\n if index.odd? == true\n value = value * 2\n multiplied_integer_array << value\n else\n value = value\n multiplied_integer_array << value\n end\n end\nreturn multiplied_integer_array\nend",
"def pair_product(arr, prod)\n \n arr.each.with_index do |num1, idx1|\n arr.each.with_index do |num2, idx2|\n if idx2 > idx1 && num1 * num2 == prod\n return true\n end\n end\n end\n\n false\nend",
"def element_times_index(nums)\n nums.map.with_index{|num, idx| num * idx}\nend",
"def product_except_self(nums)\n product = 1\n num_zeros = 0\n \n nums.each do |num|\n num_zeros += 1 if num == 0\n \n next if num == 0\n \n product *= num\n end\n \n nums.each_with_index do |num, index|\n if num_zeros > 1\n nums[index] = 0\n elsif num_zeros == 1 && num != 0\n nums[index] = 0\n elsif num_zeros == 1 && num == 0\n nums[index] = product\n else\n nums[index] = product / num \n end\n end\n \n nums\nend",
"def element_times_index(numbers)\n \n i = 0 # i represents to the index current index always\n \n new_array = []\n \n while i < numbers.length # We cant do less than or equal to here\n \n new_array << numbers[i] * i # You can shovel directly into a new array\n i += 1\n end\n return new_array\nend",
"def minProductSubset(a, n)\n\n if (n == 1)\n return a[0]\n end\n\n n-=1\n \n # Find count of negative numbers,\n # count of zeros, maximum valued\n # negative number, minimum valued\n # positive number and product\n # of non-zero numbers\n max_neg = -(2**30)\n min_pos = 2**30\n count_neg = 0\n count_zero = 0\n prod = 1\n\n for i in 0..n do\n\n # If number is 0, we don't\n # multiply it with product.\n if (a[i] == 0)\n count_zero = count_zero + 1\n continue\n end\n \n # Count negatives and keep\n # track of maximum valued\n # negative.\n if a[i].to_i < 0\n count_neg = count_neg + 1\n max_neg = [max_neg, a[i]].max\n end\n \n # Track minimum positive\n # number of array\n if a[i].to_i > 0\n min_pos = [min_pos, a[i]].min\n end\n\n prod = prod * a[i]\n end\n \n # If there are all zeros\n # or no negative number\n # present\n if count_zero == n or (count_neg == 0 and count_zero > 0)\n return 0\n end\n \n # If there are all positive\n if (count_neg == 0)\n return min_pos\n end\n \n # If there are even number of\n # negative numbers and count_neg\n # not 0\n if (count_neg & 1) == 0 and\n count_neg != 0\n \n # Otherwise result is product of\n # all non-zeros divided by\n # maximum valued negative.\n\n prod = int(prod / max_neg)\n end\n \n return prod\n\nend",
"def product_machine(array_input)\nindex = 0\nproduct = 1\nnumber_of_loops = array_input.length\n\nnumber_of_loops.times do\n product = product * array_input[index]\n index = index + 1\nend\noutput = product\nreturn output\nend",
"def calc_product(ary, index, len)\n prod = 1\n print \"1\"\n ((index-(len-1))..index).each{|d| \n prod = prod * ary[d]\n print \" x #{ary[d]}\" \n }\n puts \" = #{prod}\"\n prod\nend",
"def product_of_three2(arr)\n third, second, first = [arr[0], arr[1], arr[2]].sort\n max_product = first * second * third\n arr.each_with_index do |num, idx|\n next if [0,1,2].include?(idx)\n let sub_products = [[third, second], [second, first], [first, third]]\n sub_products.each do |product|\n if (product[0] * product[1] * num > max_product)\n max_product = product[0] * product[1] * num\n first, second, third =[product[0], product[1], num]\n end\n end\n end\n return max_product\nend",
"def pair_product(arr, n)\n arr.each_with_index do |ele, i|\n arr.each_with_index do |ele2, i2|\n if i > i2\n if ele * ele2 == n\n return true\n end\n end\n end\n end\n false\nend",
"def element_times_index(numbers)\n\tnumber_multiplied = []\n\ti = 0\n\n\twhile i < numbers.length\n\t\tnumber = numbers[i] * i\n\t\tnumber_multiplied << number\n\n\t\ti += \n\tend\n\n\treturn number_multiplied\t\nend\n\n\n# ---------- Their Solution ----------\n# Line 37 is better than what I did in line 20-21\n\n# def element_times_index(numbers)\n# new_nums = []\n\n# i = 0\n# while i < numbers.length\n# new_nums << numbers[i] * i\n\n# i += 1\n# end\n\n# return new_nums\n# end\n\n# ---------- Tests ----------\nprint element_times_index([4, 7, 6, 5]) # => [0, 7, 12, 15]\nputs\nprint element_times_index([1, 1, 1, 1, 1, 1]) # => [0, 1, 2, 3, 4, 5]",
"def pair_product(arr, num) \n\nend",
"def custom_multiply(array, number)\n result = []\n number.times { array.each { |element| result << element}}\n result\nend",
"def x_all_but_self(a)\n zero_qty = a.count(0)\n return products = Array.new(a.size,0) if zero_qty > 1\n total_x = 1\n products = []\n a.each { |e| total_x *= e if e != 0}\n if zero_qty == 1\n a.each { |e| products << (e != 0 ? 0 : total_x) }\n else\n a.each { |e| products << total_x / e}\n end\n return products\nend",
"def pair_product(numArr, product)\n numArr.each_with_index do |num, i|\n numArr.each_with_index do |num2, j|\n return true if j > i && (num * num2) == product\n end\n end\n false\nend",
"def element_times_index(numbers)\n i = 0\n count = 0\n while i < numbers.length\n numbers[i] = numbers[i] * count\n count += 1\n i += 1\n end\n return numbers\nend",
"def prime_products(n)\n n.is_a?(Float) || n <= 1 ? [] : n.prime_division.map {|pf,ex| pf ** ex}\nend",
"def pair_product(arr, product)\n arr.each_with_index do |num_1, idx_1|\n arr.each_with_index do |num_2, idx_2|\n return true if num_1 * num_2 == product && idx_2 > idx_1\n end\n end\n false\nend",
"def pair_product(arr, num)\n arr.each_with_index do |ele1, i|\n arr.each_with_index do |ele2, j|\n return true if i < j && ele1 * ele2 == num\n end\n end\n\n false\nend",
"def product_thirteen(array, index)\n\tprod = 1\n\ti = index\n\twhile i < index+13\n\t\tprod *= array[i]\n\t\ti+=1\n\tend\n\tputs prod\n\treturn prod\nend",
"def product_except_self(nums)\n output = []\n\n right = 1\n for i in 0...nums.length\n right *= nums[i]\n output[i] = right\n end\n\n left = 1\n (nums.length - 1).downto(1) do |i|\n output[i] = left * output[i - 1]\n left *= nums[i]\n end\n\n output[0] = left\n output\nend",
"def square_each_idx(array)\n final = Array.new(array.length)\n array.each_index { |i| final[i] = array[i]**2 }\n final\nend"
] |
[
"0.92594284",
"0.92340213",
"0.9224134",
"0.92037857",
"0.9174237",
"0.8993432",
"0.8820518",
"0.8685326",
"0.86513716",
"0.85306793",
"0.8448524",
"0.844002",
"0.823903",
"0.8217375",
"0.7987949",
"0.79485893",
"0.7917612",
"0.7874252",
"0.7739332",
"0.7612062",
"0.75830114",
"0.75818527",
"0.74914545",
"0.7454253",
"0.73429614",
"0.72752744",
"0.7230077",
"0.7201582",
"0.7136721",
"0.7106509",
"0.7082264",
"0.7067142",
"0.7027867",
"0.6979396",
"0.69266105",
"0.6921936",
"0.69044816",
"0.6888395",
"0.6877901",
"0.6870222",
"0.6837753",
"0.6832023",
"0.68304497",
"0.6779954",
"0.6777263",
"0.67592263",
"0.6757923",
"0.67378277",
"0.6732435",
"0.67227936",
"0.6697956",
"0.66806567",
"0.6664611",
"0.66515666",
"0.6622885",
"0.661832",
"0.6604873",
"0.6597726",
"0.6596385",
"0.6587243",
"0.6582713",
"0.6582266",
"0.6582256",
"0.65790135",
"0.6575775",
"0.6571252",
"0.65662354",
"0.6564144",
"0.6554348",
"0.65422404",
"0.6532765",
"0.653211",
"0.65171325",
"0.65119946",
"0.6510545",
"0.64688146",
"0.6441381",
"0.64336115",
"0.6419433",
"0.64059556",
"0.63959897",
"0.63842624",
"0.63830936",
"0.6373665",
"0.6365542",
"0.6354222",
"0.6353637",
"0.6320385",
"0.6314098",
"0.6307122",
"0.6273808",
"0.62533826",
"0.6249811",
"0.62493724",
"0.62473977",
"0.62418026",
"0.6236462",
"0.6232404",
"0.62278116",
"0.62258846"
] |
0.71233237
|
29
|
O(n) time and O(n) space
|
def get_products_of_all_ints_except_at_index(array)
before_prod = 1
prod = []
after_prod = 1
after = []
after[array.length - 1] = 1
i = array.length - 1
while (i > 0)
# find products after
after_prod *= array[i]
after[i - 1] = after_prod
i -= 1
end
i = 0
while (i < array.length)
# find products before
prod[i] = after[i] * before_prod
before_prod *= array[i]
i += 1
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_dublicate(array)\n sum = 1000000*(1000000+1)/2 # (n*(n+1))/2\n array.each do |el| \n sum -= el\n end\n return sum\nend",
"def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend",
"def my_min_2(list)\r\n min = 0 # O(1)\r\n \r\n list.each do |ele| # O(n) \r\n if ele < min # O(1)\r\n min = ele # O(1)\r\n end\r\n end\r\n min # O(1) \r\nend",
"def largest_subsum(list)\n max = list[0] # O(1)\n current_sum = list[0] # O(1)\n\n (1...list.length).each do |i| # O(n)\n # debugger\n if current_sum < 0 # O(1)\n current_sum = 0 # O(1)\n end \n current_sum += list[i] # O(1)\n if current_sum > max # O(1)\n max = current_sum # O(1)\n end\n end\n\n max # O(1)\n\nend",
"def find_duplicate_space(nums)\n # sort nums first (lgn), then check for dups by iterate over (n)\n last_seen = 0\n nums.sort!.each do |num|\n return num if last_seen == num\n last_seen = num\n end\nend",
"def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend",
"def my_min_2(array)#O(n)\n array.inject do |acc, ele|#O(n)\n if acc < ele\n acc\n else\n ele\n end\n end\nend",
"def two_sum?(array, target)\n #O(n)\n hash = Hash.new(0)\n i = 1\n array.each do |ele|\n hash[ele] = i \n i += 1\n end\n hash.each_key do |k|\n return true if hash.has_key?(target - k) && hash[k] != hash[target - k]\n end\n false \nend",
"def solution(a)\n # In production environment this will be my solution:\n # a.uniq.size\n #\n # But since this is a coding challenge, my assumption\n # is that you're looking for a by-hand O(N*logN) solution\n\n return 0 if a.empty?\n\n n = a.size\n ary = a.sort\n uniques = 1\n (1...n).each do |i|\n uniques += 1 if ary[i] != ary[i - 1]\n end\n uniques\nend",
"def my_min(list) \n\n list.each_with_index do |ele, i| #O(n)\n compare_arr = list[0...i] + list[i+1..-1] # O(2n) \n return ele if compare_arr.all? { |ele2| ele < ele2 } #O(n)\n end\n\n #time complexity = O(n^2) + O(2n)\n\nend",
"def solution(a)\n len = a.size\n unique = {}\n i = 0\n while i < len\n item = a[i]\n if unique.has_key?(item)\n unique[item] += 1\n else\n unique[item] = 1\n end\n i += 1\n end\n pairs = 0\n unique.each do |key,count|\n (1...count).step {|n| pairs += n }\n end\n return pairs > 1_000_000_000 ? 1_000_000_000 : pairs\nend",
"def find_duplicate(nums)\n if !nums or nums.size == 0\n return nil\n else\n fast = nums[ 0 ]\n slow = nums[ 0 ]\n while true\n fast = nums[ fast ]\n fast = nums[ fast ]\n slow = nums[ slow ]\n if fast == slow\n new_node = nums[ 0 ]\n while new_node != slow\n new_node = nums[ new_node ]\n slow = nums[ slow ]\n end\n return slow\n end\n end\n end\nend",
"def hash_two_sum(arr,target_sum)\n #creates a new hash with each element that is satisfying the target_sum\n hash = Hash.new(0) #{|h,k| h[k] = []}\n (0...arr.length).each { |i| hash[i] = arr[i]} #O(n)\nend",
"def sorted_squares(nums)\n # This takes O(n)\n nums.map! { |num| num**2 }\n # This can take Ο(n logn)\n bubble_sort(nums)\nend",
"def okay_two_sum?(arr, target)\n arr = arr.sort #n log n\n (0...arr.length).each do |i| #n\n search = bsearch(arr, target-arr[i]) # log n\n return true unless search.nil?\n end #n log n\n false\nend",
"def sub_sum(list)\n sub_arr = []\n (0...list.length).each do |i| #O(n)\n (i...list.length).each do |j| #O(n)\n sub_arr << list[i..j] if i <= j\n end\n end\n largest_continuous_sub_sum1(sub_arr)\nend",
"def equal(arr)\n size = arr.size\n hash = Hash.new{|h,k| h[k] = []}\n (0...size).each do |i|\n (i + 1...size - 1).each do |j|\n sum = arr[i] + arr[j]\n if hash.has_key?(sum)\n values = hash[sum]\n values << i\n values << j\n return values\n else\n hash[sum] = [i, j]\n end\n end\n end\nend",
"def fast_hash_additive_find(arr, target)\n lookup_table = Hash.new\n\n arr.each do |element|\n return true if lookup_table[target - element]\n if lookup_table[element]\n lookup_table[element] += 1\n else\n lookup_table[element] = 1\n end\n end\n\n return false\n end",
"def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend",
"def visit_all_rooms?(array) \n visited = {}\n queue = [] \n\n first = array.shift \n\n \n first.each do |key|\n queue << key //3, 0\n end\n\n\n # O(n) * o(m) => O(nm)\n while queue.length > 0 //O(n)\n current_key = queue.shift\n visited[current_key] = true\n array[current_key].each do |key| \n queue << key unless visited[key] == false // 3,0,1 \n end\n end\n\n visited.keys.length == array.length\n\nend",
"def seesaw?(arr)\n left_sum = 0\n arr.each_index do |i| #O(n)\n if i > 0\n left_sum = arr[0...i].reduce(:+) #O(n)\n end\n if i < arr.size-1\n right_sum = arr[i+1..-1].reduce(:+); #O(n)\n else\n right_sum = 0\n end\n if left_sum == right_sum\n return true\n end\n end\n return false\nend",
"def unique_items(arr) #O(n)\n hash = Hash.new(0)\n results = []\n arr.each do |el|\n hash[el] += 1\n end\n hash.select { |k, v| k if v == 1 }.keys\nend",
"def three_sum_fastest(arr)\n count = 0\n\n (0..arr.length - 2).each { |i|\n set = Set.new\n\n (i + 1..arr.length - 1).each { |j|\n if set.include?(-arr[i] - arr[j])\n count += 1\n end\n\n set.add(arr[j])\n }\n }\n count\nend",
"def largest_contiguous_subsum(arr) #BigO of O(n)\n max = 0 \n current_sum = 0\n arr.each_with_index do |el,idx|\n if current_sum + el >= el \n current_sum += el \n else \n current_sum = el \n end \n max = current_sum if current_sum > max \n end \n max\nend",
"def find3(a, X)\n # scan through array\n # build hash storing complement in each key\n complements = {}\n a.each_with_index do |val, ind|\n if complements[X - val]\n complements[X - val].push(ind)\n else\n complements[X - val] = [ind]\n end\n end\n\n # scan through the array again\n # get complement\n # for each value scan the remainder of the arrray\n # for a value such taht a + b = the complement\n\n # for each character we have built a dictionary such that, we can find\n # x = a + complement\n\n # [1, 2, 3]\n # 1 + 2 = 3\n # 1 + 3 = 4 =>\n\n # for each value in the array (a) look at all following values (b) and see if a + b\n # is in the dictionary, if it is, check that their indices do not collide with the index\n # stored at dict(a+b)\n\n a.each_with_index do |va, i|\n a.each_with_index do |vb, j|\n break if i == j\n\n complement = va + vb\n indices = complements[complement]\n\n indices.each do |z|\n # every index is unique\n return [i, j, z] unless z == i || z == j\n end\n end\n end\n\n return nil\nend",
"def move_zeros(array)\n zero_count = 0\n # O(n)\n array.each do |num|\n\n zero_count += 1 if num == 0\n end\n\n # O(n)\n array = array.select { |num| num != 0 }\n \n # O(1)\n zero_count.times do\n array += [0]\n end\n\n array\nend",
"def solution(a)\n n = a.size\n a.sort!\n\n count = 0\n for i in 0...n-2 do\n k = i+2\n for j in i+1...n-1 do\n while k < n and a[i] + a[j] > a[k] do\n k += 1\n end\n count += k - j - 1\n end\n end\n count\nend",
"def fibonacci(n)\n return fib_helper([0, 1], 2, n)\n # if you'd like to test what i THINK is an O(1) space complexity solution.....\n # i did run this through the tests and it SHOULD work:\n # return faster_fib_helper([0, 1], 2, n)\nend",
"def naive(array)\n max = -10000\n for i in (0..array.length - 1)\n for j in (i..array.length - 1)\n total = array[i..j].inject { |m,k| m + k }\n max = total if total > max\n end\n end\n max\nend",
"def fifth_anagram?(word1, word2) # O(n)\n \n p \"Running fifth_anagram...\" \n\n start = Time.now\n \n hash1 = Hash.new(0)\n # hash2 = Hash.new(0)\n\n word1.each_char {|char| hash1[char] += 1}\n word2.each_char {|char| hash1[char] += 1}\n\n hash1.values.all? {|v| v.even?}\n\n\n # puts \"Took #{Time.now - start} seconds\"\n\n \nend",
"def largest_contiguous_subsum_2(list)# [2, 3, -6, 7, -6, 7]\n largest_num = list[0]#2 O(1)\n running_sum = list[0]#2 - 5 after entering loop. O(1)\n\n (1...list.length).each do |i| #O(n) \n running_sum = 0 if running_sum < 0 #O(1)\n running_sum += list[i] #O(1)\n largest_num = running_sum if running_sum > largest_num #O(1)\n end\n return largest_num #O(1)\nend",
"def my_min_2(arr)\n\n smallest_value = arr[0] # O(1)\n\n arr.each do |ele1| # [ 0, 3, 5, 4, -5, 10, 1, 90 ] O(n)\n smallest_value = ele1 if ele1 <= smallest_value #O(1)\n end\n\n smallest_value #O(1)\n\nend",
"def third_anagram?(str1, str2)\n beginning_time = Time.now\n str1.split(\"\").sort == str2.split(\"\").sort #O(nlogn)\n \"Time complexity of first_anagram: #{(Time.now - beginning_time)}\"\nend",
"def arrayManipulation(n, queries)\n nums = Array.new(n+1, 0)\n queries.each do |query|\n nums[query[0]-1] += query[2]\n nums[query[1]] -= query[2]\n end\n\n max = nums.first\n (1..nums.length-1).each do |i|\n nums[i] += nums[i - 1]\n max = nums[i] if nums[i] > max && i < (nums.size - 1)\n end\n\n max\nend",
"def sort3(array, length)\n # O(k)\n length.times do |i|\n # clear hash\n hash = {}\n \n # O(n)\n array.each do |str|\n if hash[str[i]].nil?\n hash[str[i]] = [str]\n else\n hash[str[i]] += [str]\n end\n end\n\n array = []\n # O(n)\n hash.values.each do |val|\n array += val \n end\n end\n\n # overall time complexity O(kn)\n array\nend",
"def cache_intersection2(nums1, nums2)\n outer_cache = {}\n nums1.each do |n|\n next if outer_cache[n]\n outer_cache[n] = true\n end\n array = []\n inner_cache = {}\n nums2.each do |n|\n next if inner_cache[n]\n array << n if outer_cache[n]\n inner_cache[n] = true\n end\n array\nend",
"def canBeSum(n, array, cache)\n\ti = 0\n\twhile array[i] <= n / 2\n\t\tif cache[n-array[i]] # array.include?(n-array[i]) is OK, but very slow\n\t\t\treturn true\n\t\tend\n\n\t\ti += 1\n\tend\n\n\treturn false\nend",
"def second_anagram?(word_1, word_2) #O(n^2)\n matching_word = word_2.split(\"\")\n\n word_1.each_char do |ele|\n if matching_word.index(ele) #evaluating the conditional\n matching_word.delete_at(matching_word.index(ele)) #n many times, do this\n end\n end\n\n matching_word.empty? #constant O(1)\nend",
"def solution(a)\n # write your code in Ruby 2.2\n num_of_elements=a.length\n num_of_zeros=0\n tot_num_car_pairs=0\n a.each do |element|\n if element == 0\n num_of_zeros+=1\n else\n tot_num_car_pairs+=num_of_zeros\n end\n end\n return tot_num_car_pairs>1_000_000_000?-1:tot_num_car_pairs\nend",
"def intersect nums1, nums2\n result = []\n return result if nums1.size == 0 or nums2.size == 0\n\n counter_cache = {}\n counter_cache = nums1.inject({}) { |result, n|\n result[n] ||= 0\n result[n] += 1\n result\n }\n\n nums2.each do |n|\n if counter_cache[n] and counter_cache[n] > 0\n result << n\n counter_cache[n] -= 1\n end\n end\n result\nend",
"def largest_contiguous_subsum2(list)\n # O(N) ==> Time\n # O(1) ==> Space\n largest = list.first\n curr = list.first\n\n len = list.length\n (1...len).each do |i|\n curr = 0 if curr < 0 \n curr += list[i]\n largest = curr if curr > largest\n end\n largest\nend",
"def two_sum?(arr, target_sum) # O(N)\n hash = Hash.new(0)\n count = Hash.new(0)\n\n arr.each do |num|\n hash[num] = target_sum - num\n count[num] += 1\n end\n\n hash.each do |key, value|\n if hash.has_key?(value) \n if key == value \n if count[value] > 1\n return true\n end\n else\n return true\n end\n end\n end\n\n false\nend",
"def josephus_survivor(n,k)\n arr = (1..n).to_a\n\n while arr.length > 1\n idx = k % arr.length\n\n if arr.length > k\n arr = arr.drop(k) + arr.take(k - 1)\n elsif arr.length == k \n arr = arr[0...-1]\n else\n arr = arr.drop(idx) + arr.take(idx - 1)\n end\n end\n \n arr[0]\nend",
"def solution(a, k)\n # write your code in Ruby 2.2\n \n unless a.empty?\n for i in 1..k\n last = a.pop\n a.insert(0, last)\n end\n end\n \n return a\nend",
"def solution(a)\r\n # write your code in Ruby 2.2\r\n \r\n arr =[]\r\n a.each_with_index{|el,i|\r\n \r\n if !arr.index(el) \r\n arr << el\r\n end\r\n \r\n }\r\n arr.count\r\nend",
"def largest_contiguous_subsum_1(list) \n subs = [] #O(1)\n (0...list.length).each do |start_num| #O(n)\n (start_num...list.length).each do |end_num| #O(n)\n subs << list[start_num..end_num] #O(n)\n end\n end\n subs_sum = [] #O(1)\n subs.each do |sub| #O(n**2)\n sub_sum = 0 #O(1)\n sub.each {|s| sub_sum += s} #O(n)\n subs_sum << sub_sum #O(1)\n end\n subs_sum.inject do |acc,el| #O(n)\n if acc > el #O(1)\n acc #O(1)\n else\n el #O(1)\n end\n end\n end",
"def find_unique_elements(arr)\n \nend",
"def solution_slow_2(n, p, q)\n sieve = sieve_of_erathosteneses(n)\n # puts \"sieve:#{sieve}\"\n semi = semiprimes(n, sieve)\n # puts \"sp:#{semi}\"\n prefix = [0,0,0,0,1]\n 5.upto(n) do |x|\n if semi.include? x \n prefix << prefix.last + 1\n else\n prefix << prefix.last\n end\n end\n # puts \"prefix:#{prefix}\"\n\n queries = [p,q].transpose\n\n\n res = queries.map do |query|\n prefix[query.last] - prefix[query.first - 1]\n end\n\n # puts \"res:#{res}\"\n\n res\n end",
"def two_sum_v3?(arr, target) \n hash = Hash.new\n arr.each { |ele| hash[ele] = ele } #o(n)\n arr.each do |ele| #o(n)\n search_value = target - ele\n return true if !hash[search_value].nil? && hash[search_value] != ele\n end\n false\nend",
"def anagram4(str1, str2)\n count = Hash.new(0) #O(1)\n \n str1.each_char do |char| #O(n)\n count[char] += 1 #O(1)\n end\n\n str2.each_char do |char| #O(n)\n count[char] -= 1 #O(1)\n end\n\n # count.values.uniq.length == 1\n count.values.each do |v| #O(n)\n return false if v > 0\n end\n true\nend",
"def find_unsorted_subarray(nums)\n \nend",
"def amicable_numbers(n)\r\n numbers = Array.new\r\n 2.upto(n) do |x|\r\n y = d(x)\r\n if !numbers.include?(y)\r\n numbers.push(x,y) if d(y) == x && y != x\r\n end\r\n end\r\n return numbers\r\nend",
"def solution(a)\n counter = Hash.new(0)\n a.each do |elem|\n counter[elem] += 1\n end\n\n (1..a.size).each do |number|\n return 0 if counter[number] != 1\n end\n\n 1\nend",
"def efficient_contiguous_subsum(list)\n current_sum = list[0] #0\n largest_sum = list[0] #5\n # debugger\n (1...list.length).each do |i| \n if current_sum + list[i] > 0 \n current_sum += list[i] \n largest_sum = current_sum if current_sum > largest_sum\n else \n current_sum = 0\n end \n end \n largest_sum\nend",
"def second_anagram?(word1, word2)\n p \"Running second_anagram?...\" \n\n start = Time.now\n word2 = word2.split(\"\") #O(n)\n word1.each_char do |char| #O(n)\n char_index = word2.index(char) #O(n)\n if char_index.nil? #O(1)\n return false #O(1)\n else\n word2.delete_at(char_index) #O(1)\n end\n end\n word2.empty? #O(1)\n p \"Took #{Time.now - start} seconds\"\nend",
"def largest_contiguous_subsum1(list)\n p Time.now\n sub_arrays = []\n list.each_index do |i|\n list.each_index do |j|\n next if j < i\n sub_arrays << list[i..j]\n end\n end\n sub_arrays.map{|numbers| numbers.inject(:+)}.max\n p Time.now\nend",
"def find_unique(array)\n unique_id = 0\n\n array.each do |num|\n unique_id ^= num\n end\n\n unique_id\nend",
"def solution(a)\n n = a.size\n return 0 unless n > 2\n a.sort!\n\n (2..n - 1).each do |i|\n return 1 if a[i - 2] + a[i - 1] > a[i]\n end\n\n return 0\nend",
"def three_sum_fast(arr)\n arr = merge_sort(arr)\n count = 0\n\n (0..arr.length - 1).each { |i|\n (i + 1..arr.length - 1).each { |j|\n if bin_search(arr, -arr[i] - arr[j]) > j\n count += 1\n end\n }\n }\n count\nend",
"def solution(a)\n # write your code in Ruby 2.2\n n = a.length\n \n counter = Array.new(n+1, 0)\n \n a.each do |x|\n counter[x-1] += 1\n end\n \n return counter.index { |x| x == 0 } + 1\nend",
"def fourth_anagram?(str1, str2)\n hash1 = Hash.new(0)#O(1)\n beginning_time = Time.now\n str1.each_char {|char| hash1[char]+=1}#O(n)\n str2.each_char {|char| hash1[char]-=1}#O(n)\n hash1.all? {|_, v| v.zero?}#O(n)\n \"Time complexity of first_anagram: #{(Time.now - beginning_time)}\"\nend",
"def okay_two_sum?(arr, target)\n sorted = arr.sort # n log n => quicksort => is nlogn DOMINANT\n sorted.each_with_index do |num, i| # => O(n)\n # return true if sorted[i] + sorted[-1 - i] == target\n return true if sorted[i + 1 .. - 1].bsearch {|number| target - num <=> number} # => O(log(n))\n # ASK TA ABOUT BSEARCH\n # bsearch {|ele| pivot <=> ele}\n end\n false\nend",
"def uniq_pairs(array, target)\n return 0 if array.size <= 1\n array = array.sort\n ans = 0\n count = 0\n left = 0\n right = array.size - 1\n while left < right do \n if array[left] + array[right] == target\n count += 1\n left += 1\n right -= 1\n while left < right && array[left] == array[left - 1]\n left += 1\n end\n\n while left < right && array[right] == array[right + 1]\n right -= 1\n end\n elsif array[left] + array[right] < target\n left += 1\n else\n right -= 1\n end\n end\n count\nend",
"def solution(a)\n a.uniq.count\nend",
"def solve( n = 10_000 )\n (1..n).select {|i| i.amicable?}.reduce( :+ )\n end",
"def stones(n, a, b)\n ar=[0]\n (n-1).times do |val|\n tmp=[]\n ar.each do |v|\n tmp << v+a if !tmp.include?(v+a)\n tmp << v+b if !tmp.include?(v+b)\n end\n ar=tmp\n end\n ar.sort\nend",
"def two_sum(arr) #o(ns)\n set = Set.new\n arr.each{|el| set << el}\n arr.select{|el| set.include?(-1 * el)}\nend",
"def unique_in_order(iterable) \n# create an empty array\ncontent = []\n\n # check each letter/number of `iterable` \n for e in (0..iterable.length()-1) \n\n# compare current element to previous element\n# if array is empty\n if e == 0 or \n# \n# if current element is not the same with previous element, push current index to content array\n iterable[e] != iterable[e-1] \n content.push(iterable[e])\n end\n end\n# return new content array\n return content\nend",
"def solution(a)\n # write your code in Ruby 2.2\n seen = {}\n\n a.each do |number|\n seen[number] = true\n end\n\n max = a.max\n\n for i in 1..(max + 1)\n return i unless seen[i]\n end\n\n 1\nend",
"def solution(a)\n accessed = Array.new(a.size + 1, nil)\n caterpillar_back = 0\n count = 0\n\n a.each_with_index do |x, caterpillar_front|\n if accessed[x] == nil\n accessed[x] = caterpillar_front\n else\n new_caterpillar_back = accessed[x] + 1\n first_part_size = caterpillar_front - caterpillar_back\n second_part_size = caterpillar_front - new_caterpillar_back\n count += first_part_size * (first_part_size + 1) / 2\n count -= (second_part_size) * (second_part_size + 1) / 2\n caterpillar_back.upto(new_caterpillar_back - 1) { |n| accessed[a[n]] = nil}\n accessed[x] = caterpillar_front\n caterpillar_back = new_caterpillar_back\n end\n end\n\n remaining_size = a.size - caterpillar_back\n count += (remaining_size) * (remaining_size + 1) / 2\n end",
"def collisions(arr)\n new_arr = []\n result = []\n arr.each do |i|\n if i > 0\n new_arr << i\n else\n if new_arr.empty?\n result << i\n else\n if new_arr[-1] == -(i)\n new_arr.pop\n else\n while !new_arr.empty? && new_arr[-1] < -(i)\n new_arr.pop\n end\n if new_arr.empty?\n result << i\n end\n end\n end\n end\n end\n return (result.concat(new_arr))\nend",
"def better_sum1(arr, target) # this one is going to return true or false\n pairs = Set.new\n\n arr.each do |ele|\n if pairs.include?(ele)\n return true\n else\n pairs << target - ele\n end\n end\n false\nend",
"def arrayManipulation(n, queries)\n arr = Array.new(n + 2, 0)\n\n queries.each do |a, b, k|\n arr[a] += k\n arr[b + 1] -= k\n end\n\n max_sum = 0\n sum = 0\n arr.filter { |diff| diff != 0 }.each do |diff|\n sum += diff\n max_sum = [max_sum, sum].max\n end\n\n max_sum\nend",
"def fds(n)\n\n # arr = []\n # (n + 1).times.each{|e| arr << e if e > 0}\n # arr.flat_map.reduce(:*)\n # arr.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n (1..n).to_a.flat_map.reduce(:*).to_s.split(//).map(&:to_i).reduce(:+)\n\nend",
"def c v1, v2, o\n m = false\n d = []\n (0...v2.size).each{ |j|\n if !v1.include? v2[j] + o\n d << v2[j]\n m = true\n end\n }\n for x in d\n v2.delete x\n end\n m\nend",
"def sum_to_n? arr, n\n hash = Hash.new\n arr.each do |val|\n if hash.key? val\n return true\n else\n hash[n-val] = val\n end\n end\n return false\nend",
"def two_sum?(arr, target)\r\n hash = {}\r\n arr.each_with_index do |ele, i| #n\r\n hash[i] = ele\r\n end\r\n arr.each_with_index do |ele, i| #n \r\n value = target - ele\r\n if hash.has_value?(value) && hash.key(value) != i\r\n return true\r\n end\r\n # all the keys in has except i\r\n # if any of the value = value\r\n end\r\n false\r\nend",
"def my_solution(array)\n hash = {}\n\n array.each do |element|\n hash[element] = 0 if element > 0\n end\n\n (1..array.size).each do |i|\n return i if hash[i].nil?\n end\nend",
"def two_sum?(arr, target_sum)\n hash = {}\n arr.each do |ele|\n diff = target_sum - ele\n return true if hash.has_key?(diff) # O(1), or constant time\n hash[ele] = 0\n end\n false\nend",
"def solution(a)\n result = 0\n tmp_count = 0\n a.each_with_index do |val, idx|\n if val.zero?\n tmp_count += 1\n else\n result += tmp_count\n end\n end\n return result > 1000000000 ? -1 : result\nend",
"def cache_intersection(nums1, nums2)\n array = []\n outer_cache = {}\n inner_cache = {}\n nums1.each do |outer|\n next if outer_cache[outer]\n outer_cache[outer] = true\n nums2.each do |inner| \n next if inner_cache[inner]\n if outer == inner \n array << inner\n inner_cache[inner] = true\n end\n end\n end\n array\nend",
"def awesome(arr, target)\n hash = Hash.new(0)\n i = 0\n j = i + 1\n while i < arr.size\n hash[arr[i] + arr[j]] += 1 \n if j < arr.size\n j += 1\n else\n i += 1\n if j = i + 1 > arr.length\n j = i \n else\n j = i + 1\n \n end\n\n end\n \n end\n return true if hash[target] >= 1\n false\nend",
"def fast_intersection(array_one, array_two)\n count = {}\n array_one.each do |el|\n if count[el]\n count[el] += 1\n else\n count[el] = 1\n end\n end\n int = []\n array_two.each do |el|\n if count[el] && count[el] > 0\n count[el] -= 1\n int << el\n end\n end\n int\nend",
"def optimize(ary, total)\n return [] if ary.empty?\n table = []\n (ary.size+1).times { |i| table[i] = [] }\n (0..total).each { |zerg| table[0][zerg] = 0 }\n (1..ary.size).each do |base|\n table[base][0] = 0\n (1..total).each do |zerg|\n if ary[base-1].zerg <= zerg && (ary[base-1].minerals + table[base-1][zerg - ary[base-1].zerg] > table[base-1][zerg])\n table[base][zerg] = ary[base-1].minerals + table[base-1][zerg - ary[base-1][1]]\n else\n table[base][zerg] = table[base-1][zerg]\n end\n end\n end\n result = []\n i, k = ary.size, total\n while i > 0 && k > 0\n if table[i][k] != table[i-1][k]\n result << ary[i-1]\n k -= ary[i-1].zerg\n end\n i -= 1\n end\n result\nend",
"def twosum(array, target)\n return [] if array.length<=1\n cache = {}\n array.each.with_index do |e,i|\n if cache.include? (target-e)\n return [i,cache[target-e]]\n else\n cache[e] = i\n end\n end\n return []\nend",
"def solution(string) # \"ABCA\",\n # TIME O(N) + O(N) = O(2N) ~~ O(N)\n # SPACE O(N)\n\n array = string.split(\"\") # w[A B C A], O(N)\n array_exist = [] # [B C]\n array.each do |s| # O(N), N= 1000_000\n if array_exist.include?(s)\n array_exist.delete(s)\n else\n array_exist.push(s)\n end\n end\n array_exist[0]\nend",
"def my_min(array) # O(n) - Linear\n counter = array[0]\n\n (1...array.length).each do |i|\n if counter > array[i]\n counter = array[i]\n end\n end\n counter\nend",
"def fast\n ARRAY.bsearch { |num| num > 80_000_000 }\nend",
"def solution(a)\n # write your code in Ruby 2.2\n \n is_perm = 0\n \n n = a.length\n b = [0]*n\n \n \n a.each do |v|\n break if v > n \n break if b[v] == 1 \n b[v] = 1\n end\n \n sum = b.inject(:+)\n if sum == n\n is_perm = 1\n end\n \n is_perm\nend",
"def bf_inversions arr\n count = 0\n (0...arr.size).each do |i|\n ((i+1)...arr.size).each do |j|\n count+=1 if arr[i] > arr[j]\n end\n end\n count\nend",
"def find_duplicates(a)\n len=a.length\n n=len-2\n xor= 0\n x,y=0,0 #variables to store duplicates\n \n #xor of all numbers from 1 to n\n for i in 1..n \n xor^=i\n end\n #xor of all array elements\n for i in 0...len \n xor^=a[i]\n end\n #Rightmost set bit\n set_bit_pos= xor & ~(xor-1)\n #Divinding array in two sets ,one with set bit at set_bit_pos and other with 0.\n for i in 0...len\n if (a[i] & set_bit_pos == 0)\n x^=a[i] # XOR of first-set(with 0 at set_bit_pos) in array\n else\n y^=a[i] # XOR of second-set(with 1 at set_bit_pos) in array\n end\n end\n \n for i in 0..n\n if (i & set_bit_pos == 0)\n x^=i # XOR of first-set(with 0 at set_bit_pos) in range\n else\n y^=i # XOR of second-set(with 1 at set_bit_pos) in range\n end\n end\n print \"#{x} #{y}\"\n\treturn\nend",
"def two_sum_hash(numbers, target)\n n_index = {} \n (0...numbers.length).each do |i2|\n i1 = n_index[target - numbers[i2]] \n\n # We know that n[i2] > n[i1] because input array is sorted.\n return [i1 + 1, i2 + 1] if i1 && i1 != i2\n n_index[numbers[i2]] = i2\n end\nend",
"def fast_lcss(arr)\n i_arr = []\n biggest = 0\n max_sub_arr = []\n arr.length.times do |x|\n arr.map do |ele1|\n i_arr += [ele1]\n sum = i_arr.inject(0) do |a, b|\n a + b\n end\n max_sub_arr = i_arr if sum > biggest\n biggest = sum if sum > biggest \n end\n i_arr = []\n arr.shift\n end\n max_sub_arr\nend",
"def bad_two_sum?(arr, target)\n arr.each_with_index do |num1, idx1| #O(n)\n arr.each_with_index do |num2, idx2| #O(n)\n return true if idx2 > idx1 && num1 + num2 == target #O(1)\n end\n end\n false\nend",
"def seesaw2?(arr)\n left_sum = 0\n right_sum = arr.size > 1 ? arr[1..-1].reduce(:+) : 0\n\n arr.each_index do |i| #O(n)\n return true if left_sum == right_sum\n left_sum += arr[i]\n i < arr.size-1 ? right_sum -= arr[i+1] : right_sum = 0\n end\n return false\nend",
"def my_min_2(arr) #O(N)\n min_num = arr.first\n \n arr.each { |num| min_num = num if num < min_num }\n \n min_num\n end",
"def third_anagram?(word, goal)\n word = word.split('') # O(n)\n goal = goal.split('') # O(n)\n # O(n^2) + O(n^2) || O(n log(n)) + O(n log(n))\n word.sort == goal.sort\nend",
"def largest_contiguous_subsum(list)\n new_arr = []\n\n (0...list.length).each do |idx1| #O(n)\n (0...list.length).each do |idx2| #O(n)\n if idx2 >= idx1 #O(1)\n new_arr << list[idx1..idx2].sum #O(1)\n end \n end \n \n end \n \n return new_arr.max #O(n)\nend",
"def find_it(seq)\n uniqueInts=seq.uniq\n\n uniqueInts.each do |value|\n k=0\n seq.each do |mainSeq|\n k+=1 if mainSeq==value\n end\n return value if k%2==1\n end\nend",
"def remove_duplicates(nums)\n record_leng = 0\n uniq_arr = nums.uniq\n uniq_arr.each do |i|\n record_leng += 1 if count_great_two?(nums, i)\n end\n return (record_leng + uniq_arr.size)\nend",
"def move_duplicates(a)\n\n n = a.length\n\n h = Hash.new\n\n if a.length < 1\n return nil\n end\n\n if a.length < 2\n return a\n end\n\n dup_arr = []\n\n (0..n-1).each do |i|\n if h[a[i]]\n h[a[i]] = h[a[i]] + 1\n else\n h[a[i]] = 1\n end\n end\n\n h.each do |key,val|\n\n if h[key] > 1\n dup_arr.push(key)\n end\n end\n\n return dup_arr\n\n\nend"
] |
[
"0.6489874",
"0.618138",
"0.6124072",
"0.5913071",
"0.5838433",
"0.5814427",
"0.58132255",
"0.5784249",
"0.5779359",
"0.5776657",
"0.57710296",
"0.57705677",
"0.57591045",
"0.5752177",
"0.57371336",
"0.57119316",
"0.5689318",
"0.56884044",
"0.5640254",
"0.5633082",
"0.56311333",
"0.56302214",
"0.5619669",
"0.56085765",
"0.56077313",
"0.5589896",
"0.5584787",
"0.558215",
"0.5581663",
"0.55796385",
"0.5579063",
"0.5570847",
"0.55688477",
"0.55667555",
"0.5562773",
"0.55529344",
"0.55511177",
"0.55482113",
"0.5541507",
"0.55330414",
"0.5527244",
"0.5526839",
"0.55217856",
"0.5508067",
"0.5496394",
"0.548661",
"0.54852605",
"0.54727095",
"0.5469551",
"0.54597473",
"0.5455092",
"0.54486",
"0.54427767",
"0.54345596",
"0.54314107",
"0.5430503",
"0.5430229",
"0.5416606",
"0.5414463",
"0.54116684",
"0.5404865",
"0.53961194",
"0.53907555",
"0.5389562",
"0.5386972",
"0.5382962",
"0.538165",
"0.53794974",
"0.5379103",
"0.5371896",
"0.53696054",
"0.5365175",
"0.5364709",
"0.53635037",
"0.5359382",
"0.53536654",
"0.5346159",
"0.5343818",
"0.53326786",
"0.5332149",
"0.53260565",
"0.532142",
"0.5321194",
"0.5320451",
"0.5319812",
"0.5316743",
"0.5316441",
"0.5315911",
"0.5314901",
"0.5310762",
"0.5306522",
"0.53064704",
"0.53037065",
"0.5301857",
"0.5298537",
"0.52948165",
"0.5292591",
"0.5289397",
"0.52881217",
"0.5288039",
"0.5284938"
] |
0.0
|
-1
|
Einstieg in die Applikation, rendert nur das layout (default.rhtml), sonst nichts
|
def index
# Test ob sich client_key-Cookie entschlüsseln lässt
begin
database_helper_decrypt_value(cookies[:client_key])
rescue Exception
cookies.delete(:client_key) # Verwerfen des nicht entschlüsselbaren Cookies
cookies.delete(:client_salt)
end
unless cookies[:client_key] # Erster Zugriff in neu gestartetem Browser oder Cookie nicht mehr verfügbar
loop_count = 0
while loop_count < MAX_NEW_KEY_TRIES
loop_count = loop_count+1
new_client_key = rand(10000000)
unless get_client_info_store.exist?(new_client_key) # Dieser Key wurde noch nie genutzt
# Salt immer mit belegen bei Vergabe des client_key, da es genutzt wird zur Verschlüsselung des Client_Key im cookie
cookies[:client_salt] = { :value => rand(10000000000), :expires => 1.year.from_now } # Lokaler Schlüsselbestandteil im Browser-Cookie des Clients, der mit genutzt wird zur Verschlüsselung der auf Server gespeicherten Login-Daten
cookies[:client_key] = { :value => database_helper_encrypt_value(new_client_key), :expires => 1.year.from_now }
get_client_info_store.write(new_client_key, 1) # Marker fuer Verwendung des Client-Keys
break
end
end
raise "Cannot create client key after #{MAX_NEW_KEY_TRIES} tries" if loop_count >= MAX_NEW_KEY_TRIES
else
cookies[:client_salt] = { :value => cookies[:client_salt], :expires => 1.year.from_now } # Timeout neu setzen bei Benutzung
cookies[:client_key] = { :value => cookies[:client_key], :expires => 1.year.from_now } # Timeout neu setzen bei Benutzung
end
# Entfernen evtl. bisheriger Bestandteile des Session-Cookies
cookies.delete(:locale) if cookies[:locale]
cookies.delete(:last_logins) if cookies[:last_logins]
session.delete(:locale) if session[:locale]
session.delete(:last_used_menu_controller) if session[:last_used_menu_controller]
session.delete(:last_used_menu_action) if session[:last_used_menu_action]
session.delete(:last_used_menu_caption) if session[:last_used_menu_caption]
session.delete(:last_used_menu_hint) if session[:last_used_menu_hint]
session.delete(:database) if session[:database]
session.delete(:dbid) if session[:dbid]
session.delete(:version) if session[:version]
session.delete(:db_block_size) if session[:db_block_size]
session.delete(:wordsize) if session[:wordsize]
session.delete(:dba_hist_cache_objects_owner) if session[:dba_hist_cache_objects_owner]
session.delete(:dba_hist_blocking_locks_owner) if session[:dba_hist_blocking_locks_owner]
session.delete(:request_counter) if session[:request_counter]
session.delete(:instance) if session[:instance]
session.delete(:time_selection_start) if session[:time_selection_start]
session.delete(:time_selection_end) if session[:time_selection_end]
set_I18n_locale(get_locale) # ruft u.a. I18n.locale = get_locale auf
write_to_client_info_store(:last_used_menu_controller, 'env')
write_to_client_info_store(:last_used_menu_action, 'index')
write_to_client_info_store(:last_used_menu_caption, 'Start')
write_to_client_info_store(:last_used_menu_hint, t(:menu_env_index_hint, :default=>"Start of application without connect to database"))
rescue Exception=>e
set_current_database(nil) # Sicherstellen, dass bei naechstem Aufruf neuer Einstieg
raise e # Werfen der Exception
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def layout; end",
"def default_render\n render(html: \"\", layout: true)\n end",
"def layouts; end",
"def layouts; end",
"def default_layout\n 'default' if html?\n end",
"def set_layout\n if 1==1\n 'application'\n else\n 'dean'\n end\n end",
"def layout\n nil\n end",
"def layout\n nil\n end",
"def static_layout\n nil\n end",
"def layout\n self.class.layout || @app.layout\n end",
"def render_layout(output, layout, info); end",
"def layout\n @layout\n end",
"def init\n @title_page = 'Pine app'\n erb :welcome, layout: :template\nend",
"def introduction\n #DEFAULT ROUTE DO NOT DELETE\n render 'layouts/application'\n end",
"def set_layout\n\t \treturn \"landing\" if action_name == \"unregistered\"\n\t \tsuper\n\t end",
"def home #uses default admin layout\n end",
"def version\n render layout: \"layouts/full_page\"\n end",
"def version\n render layout: \"layouts/full_page\"\n end",
"def about_us\n render(:about_us, layout:false) and return\n end",
"def layout\n case @mode\n when :injector\n \"injector\"\n when :page\n \"application\"\n else\n false\n end\n end",
"def angular\n render \"layouts/application\", layout: false\n end",
"def place_in_layout?; end",
"def place_in_layout?; end",
"def admin_layout\n render layout: 'admin_layout'\n end",
"def layout\n \"application\"\n end",
"def default_layout\n @default_layout ||= (\n IO.read(LIBDIR + \"/templates/layouts/page.mustache\")\n )\n end",
"def render_site_layout(&block)\n render current_alchemy_site, &block\n rescue ActionView::MissingTemplate\n warning(\"Site layout for #{current_alchemy_site.try(:name)} not found. Please run `rails g alchemy:site_layouts`\")\n \"\"\n end",
"def index\n render template: 'layouts/application', layout: false\n end",
"def show\n #render template: \"hello_world/show\"\n render template: \"layouts/_commoncorelogo\"\n end",
"def process_default_render exp\n process_layout\n process_template template_name, nil\n end",
"def first_mandate\n # renders static page\n end",
"def index\n render :index, layout: 'basic'\n end",
"def set_layout\n if current_paciente != nil\n \"pacientes_pages\"\n else\n \"nutriologo_pages\"\n end\n end",
"def default_layout\n site.config.page_layout\n end",
"def layout \n return @layout\n end",
"def set_layout\n if request.xhr?\n self.class.layout false\n else\n self.class.layout \"application\"\n end\n end",
"def app_layout\n layout_content = read_view :application, :folder => 'layouts' #, :type => :erb\n\n [:alert, :notice].each{|name| insert_flash_displayer name}\n end",
"def render_page_layout\n render @page, page: @page\n rescue ActionView::MissingTemplate\n warning(\"PageLayout: '#{@page.page_layout}' not found. Rendering standard page_layout.\")\n render \"alchemy/page_layouts/standard\", page: @page\n end",
"def default\n html = @parent.render(partial: 'resources/menu', formats: [:html], locals: { parent: @parent })\n# render error messages and usage table\n html << dc_flash_messages << resources_usage\nend",
"def webpage\n render(:webpage, layout:false) and return\n end",
"def index\n render layout: false\n end",
"def index\n render layout: false\n end",
"def index\n render layout: false\n end",
"def default\r\n can_view, msg = dc_user_can_view(@parent, @page)\r\n return msg unless can_view\r\n\r\n html = \"<div class=\\\"#{@page.div_class} #{@opts[:div_class]}\\\">\"\r\n html << dc_page_edit_menu() if @opts[:edit_mode] > 1\r\n @parent.page_title = @page.title.blank? ? @page.subject : @page.title\r\n html << @page.body\r\n # render poll if defined\r\n if @page.dc_poll_id\r\n @opts.merge!(poll_id: @page.dc_poll_id, return_to: @parent.request.url, method: nil)\r\n comment = DcPollRenderer.new(@parent, @opts)\r\n html << \"<div class='wrap row'>#{comment.render_html}</div>\"\r\n @css << \"\\n#{comment.render_css}\"\r\n end\r\n # also add iframe\r\n html << iframe() << '</div>'\r\nend",
"def determine_layout\n 'akinu'\n end",
"def html_contents\n layout_contents\n end",
"def default_layout\n nil\n end",
"def index\n render layout: 'static_pages'\n end",
"def test\n\n render layout: 'views/index'\n\n end",
"def render_page_layout(options={})\n default_options = {\n :render_format => \"html\"\n }\n options = default_options.merge(options)\n if File.exists?(\"#{RAILS_ROOT}/app/views/page_layouts/_#{@page.page_layout.downcase}.#{options[:render_format]}.erb\") || File.exists?(\"#{RAILS_ROOT}/vendor/plugins/alchemy/app/views/page_layouts/_#{@page.page_layout.downcase}.#{options[:render_format]}.erb\")\n render :partial => \"page_layouts/#{@page.page_layout.downcase}.#{options[:render_format]}.erb\"\n else\n render :partial => \"page_layouts/standard\"\n end\n end",
"def angular\n \trender 'layouts/application'\n end",
"def view_renderer; end",
"def view_renderer; end",
"def frontend\n render 'frontend/index', layout: false\n end",
"def complement_revenu\n render layout: 'landing'\n end",
"def dashboard_h\n render :layout => 'application-h'\n end",
"def app_layout\n layout_content = read_view :layouts => :application \n [:alert, :notice].each{|name| insert_flash_displayer name, layout_content}\n end",
"def administration\n #render layout: 'administration'\n render layout: 'views/index'\n end",
"def site_layout\n File.join PATHS[:layouts], \"site_layout.html.erb\"\n end",
"def wiselinks_layout\n 'layouts/application'\n end",
"def show\n render layout: 'home'\n end",
"def layouts=(_arg0); end",
"def layouts=(_arg0); end",
"def _conditional_layout?; end",
"def layout\n lookup_layout\n end",
"def view(page, *)\n rails_render(action: page.tr(\"-\", \"_\"), layout: true) ||\n rails_render(html: super.html_safe, layout: true)\n end",
"def angular\n @angular_app = \"ErikGibbons\"\n render \"layouts/application\", layout: false\n end",
"def show\n render layout: \"shijiebang\"\n end",
"def set_layout\n response_code == 200 ? :\"layouts/application.#{@response.output_format}\" : nil\n end",
"def landing\n render :layout => 'landing'\n end",
"def about\n render :layout => 'centered_page'\n end",
"def layout_contents\n layout.render(self)\n end",
"def index \n render :layout => false\n end",
"def serviceShow\n render layout: 'template/login2'\n end",
"def no_layout?; end",
"def dynamic_layout\n # ALL THIS SUCKS, I KNOW..\n \n # No layout for AJAX calls\n @layout = if request.xhr? \n nil\n # dialog param = lightview popup\n elsif params[:dialog]\n 'dialog'\n # uses user 'role' name for layout ... bad\n elsif current_user && !current_user.role.nil?\n current_user.role.downcase\n # no user, check for 'about' action\n elsif controller_name == 'about'\n 'about'\n # none of the above, use Rails default\n else\n 'home'\n end\n return nil unless @layout\n \n Rails.logger.debug \"Dyamic layout = #{@layout}\"\n # Layouts further divided by site subdomain: www vs vault\n if current_subdomain == 'vault'\n # Then public vs logged in...ugh\n if current_user\n @layout = 'vault/private/' + @layout\n else\n @layout = 'vault/public/' + @layout\n end\n end\n @layout\n end",
"def layout_file_name\n layout = \"application\"\n fail unless Content::Aggregator.original_content\n prepare_layout(layout)\n end",
"def yelp\n #render layout: 'fylo'\n render layout: 'views/index'\n end",
"def show\n # render :layout => 'presentation'\n end",
"def middleman_layout(name, opts = {}, &block)\n locs = opts.delete(:locals) || {}\n opts[:layout] ||= name\n\n res = self.class.app_resource\n res.render(opts, res.locals.merge(locs), &block)\n end",
"def set_layout\n if devise_controller? #&& resource_class == Admin\n if params[:controller] == 'devise/registrations' and params[:action] == 'edit'\n \"application\"\n else\n \"devise_layout\"\n end\n end\n end",
"def app\n gem_root = File.expand_path '../../../..', __FILE__\n\n render file: \"#{gem_root}/public/unsakini/app/index.html\", layout: false\n end",
"def show_app\n # raise params[:id].to_yaml\n render :layout => \"application_responsive\"\n end",
"def set_layout\n params[:action] == 'index' ? 'admin' : (params[:layout] || 'realestate')\n end",
"def index\n render text: '', layout: true\n end",
"def layout\n return @layout if @layout\n return if no_layout?\n\n @layout = site.layouts[data.layout].tap do |layout|\n unless layout\n Bridgetown.logger.warn \"Generated Page:\", \"Layout '#{data.layout}' \" \\\n \"requested via #{relative_path} does not exist.\"\n end\n end\n end",
"def index\n # Render just the layout since this application is Angular driven\n # our layout/application has all the angular logic and our controllers\n # have no views for themselves. We just need a place to launch from\n # and this happens to be it. So we have no view (thus :nothing => true)\n # but we still want the layout (since it has the App bootstrap code)\n render :layout => 'application', :nothing => true\n end",
"def to_html\n layout = ENV['RONN_LAYOUT']\n layout_path = nil\n if layout\n layout_path = File.expand_path(layout)\n unless File.exist?(layout_path)\n warn \"warn: can't find #{layout}, using default layout.\"\n layout_path = nil\n end\n end\n\n template = Ronn::Template.new(self)\n template.context.push html: to_html_fragment(nil)\n template.render(layout_path || 'default')\n end",
"def body\n render layout: false\n end",
"def set_layout\n request.xhr? ? 'empty' : 'application'\n end",
"def inject_into_layout\n application_layout_path_prefix = 'app/views/layouts/application.html'\n\n api_key = ask 'What is your kit ID (leave blank to specify later):'\n api_key = '- YOUR KIT ID HERE -' if api_key.blank?\n\n layout_templates = { slim: { content: \" = typekit '#{api_key}'\", after: \"head\\n\" }}\n layout_templates[:erb] = { content: \" <%#{layout_templates[:slim][:content].lstrip} %>\", after: \"<head>\\n\" }\n\n layout_templates.each_pair do |lang,options|\n path = ::File.join(destination_root, \"#{application_layout_path_prefix}.#{lang}\")\n if ::File.exists?(path)\n inject_into_file path, after: options[:after] do\n \"#{options[:content]}\\n\"\n end\n end\n end\n end",
"def show_with_layout\n render :template => \"blog_posts/show\"\n end",
"def rendered_templates; end",
"def _implied_layout_name; end",
"def home\n render 'home.html.erb'\n end",
"def layout_for\n if devise_controller?\n 'full_page'\n else\n 'application'\n end\n end",
"def set_radiant_layout\n @content_for_header_content = header_content_for_page('diagnostics')\n @content_for_body_class = body_class_for_page('diagnostics')\n @content_for_title_tag = title_tag_for_page('diagnostics')\n \n @radiant_layout = \"Default Layout\"\n end",
"def show\n render :layout => \"presentation\"\n end",
"def layout\n html do\n head do\n title 'TrackTime'\n end\n body do\n h1 \"welcome to tracktime\"\n div.content do\n self << yield\n end\n end\n end\n end",
"def template_setup\n content_for :content_title, \"Dashboard\".html_safe\n end",
"def index\n super\n use_widgets do |root|\n root << jqg_top_widget('program')\n end\n render\n end"
] |
[
"0.7875126",
"0.7643069",
"0.76406586",
"0.76406586",
"0.7407023",
"0.72067815",
"0.7134122",
"0.71131593",
"0.69126964",
"0.6880035",
"0.6879067",
"0.68566036",
"0.6804666",
"0.6769785",
"0.6740734",
"0.67037",
"0.6691115",
"0.6691115",
"0.6683467",
"0.66799945",
"0.66655153",
"0.6651393",
"0.6651393",
"0.6613937",
"0.66044277",
"0.6603399",
"0.6598697",
"0.6593396",
"0.65856236",
"0.65822244",
"0.65821636",
"0.6580641",
"0.65628475",
"0.6552257",
"0.65446264",
"0.65430737",
"0.65427834",
"0.65387475",
"0.653601",
"0.6532378",
"0.653216",
"0.653216",
"0.653216",
"0.65235883",
"0.6514136",
"0.6505711",
"0.6492113",
"0.6492102",
"0.64849156",
"0.6458867",
"0.6446261",
"0.6446064",
"0.6446064",
"0.64368606",
"0.642274",
"0.64201486",
"0.64187723",
"0.641626",
"0.64150333",
"0.64127296",
"0.64006865",
"0.63807917",
"0.63807917",
"0.63665944",
"0.6365824",
"0.63557667",
"0.63547766",
"0.6342591",
"0.6330345",
"0.63282025",
"0.6309049",
"0.6305604",
"0.629615",
"0.6292143",
"0.6289462",
"0.627354",
"0.6271167",
"0.62664676",
"0.6262453",
"0.62608176",
"0.62559164",
"0.6246061",
"0.62455153",
"0.624348",
"0.624313",
"0.62429804",
"0.62307733",
"0.6228694",
"0.62286454",
"0.62252903",
"0.6223377",
"0.6222969",
"0.6213866",
"0.62122995",
"0.6208836",
"0.62043995",
"0.62003744",
"0.61977583",
"0.6194108",
"0.6193598",
"0.61929077"
] |
0.0
|
-1
|
Wechsel der Sprache in Anmeldedialog
|
def set_locale
set_I18n_locale(params[:locale]) # Merken in Client_Info_Cache
respond_to do |format|
format.js {render :js => "window.location.reload();" } # Reload der Sganzen Seite
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def sauvegarder(unNom)\n\t\tif nbSaves() >= 8\n\t\t\tdialog = Gtk::Dialog.new(\"Alerte\",\n \t $main_application_window,\n \t :destroy_with_parent,\n \t [ Gtk::Stock::OK, :none ])\n \t\t\tdialog.set_window_position(:center_always)\n\n \t # Ensure that the dialog box is destroyed when the user responds.\n \t dialog.signal_connect('response') { dialog.destroy }\n\n \t # Add the message in a label, and show everything we've added to the dialog.\n \t dialog.child.add(Gtk::Label.new( \"\\nImpossible:nombre maximum de sauvegardes atteint (8/8)!\\n\" ))\n \t dialog.show_all\n\t\telse\n\t\t\t# Serialisation des différentes classes\n\t\t\thypo = @hypo.to_yaml()\n\n\t\t\t# Ecriture dans le fichier\n\t\t\tmonFichier = File.open(\"../sauvegardes/\"+unNom, \"w\")\n\t\t\tmonFichier.write(hypo)\n\t\t\tmonFichier.write(\"***\\n\")\n\t\t\tmonFichier.write(@pseudo)\n\t\t\tmonFichier.write(\"\\n***\\n\")\n\t\t\tmonFichier.write(@inc)\n\t\t\tmonFichier.write(\"\\n***\\n\")\n\t\t\tmonFichier.write(@time)\n\t\t\tmonFichier.write(\"\\n***\\n\")\n\t\t\tmonFichier.write(@cheminMap)\n\t\t\tmonFichier.write(\"\\n***\\n\")\n\t\t\tmonFichier.write(@nbHypo)\n\t\t\tmonFichier.write(\"\\n***\\n\")\n\n\t\t\t# Fermeture du fichier\n\t\t\tmonFichier.close\n\t\tend\n\tend",
"def show_smazzata_end(best_pl_points )\r\n @log.debug \"Show smazzata end dialogbox\"\r\n str = \"** Segno terminato: vince #{best_pl_points.first[0]} col punteggio #{best_pl_points.first[1]} a #{best_pl_points[1][1]}\\n\"\r\n log str\r\n \r\n if @option_gfx[:use_dlg_on_core_info]\r\n @msgbox_smazzataend.show_message_box(\"Smazzata finita\", str.gsub(\"** \", \"\"), true)\r\n @msgbox_smazzataend.set_visible(true)\r\n end\r\n \r\n end",
"def show_smazzata_end(best_pl_points )\r\n @log.debug(\"scopetta smazzata end msgbox\")\r\n #@msgbox_smazzataend = SmazzataInfoMbox.new(\"Smazzata finita\", \r\n # 200,50, 400,350, @font_text_curr[:medium])\r\n @msgbox_smazzataend.SetShortcutsScopettta\r\n \r\n points_for_msg = []\r\n names_arr = []\r\n best_pl_points.each do |pp1_arr|\r\n name = pp1_arr[0]\r\n pp1 = pp1_arr[1]\r\n points_pl = { :tot => pp1[:tot], :carte => pp1[:carte], :scope => pp1[:scopa], \r\n :settedidenari => pp1[:setbel], :napoli => pp1[:napola], \r\n :denari => pp1[:denari],\r\n :primiera =>pp1[:primiera] \r\n }\r\n points_for_msg << points_pl\r\n names_arr << name\r\n end\r\n \r\n @msgbox_smazzataend.points[:p1] = points_for_msg[0]\r\n @msgbox_smazzataend.points[:p2] = points_for_msg[1]\r\n @msgbox_smazzataend.name_p1 = names_arr[0]\r\n @msgbox_smazzataend.name_p2 = names_arr[1]\r\n \r\n @msgbox_smazzataend.set_visible(true)\r\n end",
"def sigla; @nome; end",
"def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"def display_commandes\n puts <<-EOT\n\n(Taper 'aide' pour obtenir de l'aide)\n\n EOT\n end",
"def suivre; end",
"def afficheChoixSauvegarde()\n\t\tif(@window != nil)\n\t\t\t\t@window.hide()\n\t\tend\n\t\t@@builder.add_from_file(\"../Glade/Charger_sauvegarde.glade\")\n\t\t#déclaration de toute la page et des boutons\n\t\t@window = @@builder.get_object(\"fn_save\")\n\n\t\tbouton_retour = @@builder.get_object(\"btn_retour\")\n\t\tbouton_retour.signal_connect('clicked'){ |_widget| afficheChoixMode(nil)}\n\n\t\t@window.signal_connect('destroy') { |_widget| exit!() }\n\t\tscrl = @@builder.get_object(\"scrl_save\")\n\t\tfile = Dir[\"../data/save/\"+@nom_joueur+\"/*.snurikabe\"]\n\t\tbox_save = @@builder.get_object(\"box_liste_save\")\n\t\tbox_save.margin = 20\n\t\tbouton_charger = []\n\t\tbouton_supprimer = []\n\t\ti = 0\n\t\t#affichage si le joueur n'a aucune sauvegarde\n\t\tif(file.length == 0)\n\t\t\t\t\tlabel = Gtk::Label.new(\"Vous n'avez aucune sauvegarde.\")\n\t\t\t\t\tbox_save.add(label)\n\t\telse\n\t\t\t#créer une box contenant deux boutons, charger et supprimer, pour chaque sauvegarde\n\t\t\tfor n in file do\n\t\t\t\thbox = Gtk::Box.new(:horizontal, 0)\n\t\t\t\thbox.margin = 20\n\t\t\t\tnom_save = n.split(\"/\")\n\t\t\t\tlabel = Gtk::Label.new(\"Sauvegarde du \" + nom_save[4].split(\".\")[0])\n\t\t\t\tbouton_charger[i] = Gtk::Button.new(:label => \"Charger\")\n\t\t\t\tbouton_supprimer[i] = Gtk::Button.new(:label => \"Supprimer\")\n\t\t\t\tbouton_charger[i].signal_connect('clicked'){|_widget| charger_save(bouton_charger, file, _widget)}\n\t\t\t\tbouton_supprimer[i].signal_connect('clicked'){|_widget| supprimer_save(bouton_supprimer, file, _widget)}\n\t\t\t\thbox.pack_start(label,:expand => true, :fill => false, :padding => 0)\n\t\t\t\thbox.add(bouton_charger[i])\n\t\t\t\thbox.add(bouton_supprimer[i])\n\t\t\t\tbox_save.add(hbox)\n\t\t\t\ti+=1\n\t\t\tend\n\t\tend\n\t\t@window.show_all\n\t\tGtk.main()\n\tend",
"def on_button_gospodarstwo_dodaj_clicked()\n # tworzenie komunikatu\n dialog = Gtk::MessageDialog.new(nil, \n Gtk::Dialog::NO_SEPARATOR,\n Gtk::MessageDialog::INFO,\n Gtk::MessageDialog::BUTTONS_OK,\n \"Gospodarstwo zostało dodane\")\n dialog.run\n dialog.signal_connect('response') { dialog.hide }\n end",
"def show\r\n checar_super_agencia\r\n end",
"def zuruecksetzen()\n end",
"def aide1()\n indice = IndiceFaible.create(@map)\n dialog = Gtk::Dialog.new(\"Aide1\",\n $main_application_window,\n Gtk::DialogFlags::DESTROY_WITH_PARENT,\n [ Gtk::Stock::OK, Gtk::ResponseType::NONE ])\n\n # Ensure that the dialog box is destroyed when the user responds.\n dialog.signal_connect('response') { dialog.destroy }\n\n # Add the message in a label, and show everything we've added to the dialog.\n dialog.child.add(Gtk::Label.new(indice.envoyerIndice.indice))\n dialog.show_all\n @timer.add(15)\n\n end",
"def choose(choices, title)\n @dialog.title = \"\\\"#{title}\\\"\"\n res = @dialog.menu(title, choices)\n \n raise CancelPressed.new unless res\n \n res\n end",
"def sichtbar_machen()\n end",
"def ausschalten()\n @schirm.farbe_aendern('orange')\n @leuchtstrahl1.unsichtbar_machen()\n @leuchtstrahl2.unsichtbar_machen()\n @leuchtstrahl3.unsichtbar_machen()\n @leuchtstrahl4.unsichtbar_machen()\n end",
"def programmjetzt\ndoc = tvprogramm(doc)\ndob = tvprogrammsat(dob)\n if doc == NIL or doc == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n elsif dob == NIL or dob == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n else\n doc.encoding = 'utf-8'\n dob.encoding = 'utf-8'\n docs = doc.xpath('//title')\n dobs = dob.xpath('//title')\n i = 1\n while i < docs.length\n dos = docs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n if doss == \"ARD: \"\n dos = dosund(dos)\n orf1 = dos\n elsif doss == \"ZDF: \"\n dos = dosund(dos)\n orf2 = dos\n elsif doss == \"SAT.1\"\n dos = dosund(dos)\n orf3 = dos\n elsif doss == \"RTL: \"\n dos = dosund(dos)\n atv = dos\n elsif doss == \"PRO7:\"\n dos = dosund(dos)\n orfs = dos\n elsif doss == \"RTL2:\"\n dos = dosund(dos)\n puls4 = dos\n elsif doss == \"KABEL\"\n dos = dosund(dos)\n servus = dos\n else\n end\n i += 1\n end\n i = 1\n while i < dobs.length\n dos = dobs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n \n if doss == \"3SAT:\"\n dos = dosund(dos)\n sat = dos\n else\n end\n i += 1\n end\n say \"\", spoken: \"Das läuft gerade im Fernsehen\"\nobject = SiriAddViews.new\n object.make_root(last_ref_id)\n answer = SiriAnswer.new(\"TV Programm - aktuell\", [\n SiriAnswerLine.new(orf1),\n SiriAnswerLine.new(orf2),\n SiriAnswerLine.new(orf3),\n SiriAnswerLine.new(atv),\n SiriAnswerLine.new(sat),\n SiriAnswerLine.new(puls4),\n SiriAnswerLine.new(servus),\n SiriAnswerLine.new(orfs)\n ])\n object.views << SiriAnswerSnippet.new([answer])\n send_object object\n \n end\n request_completed\nend",
"def gestionDroite()\n\t\t#choix technique\n\t\t@tabTechnique.each{ |t|\n\t\t\t@list.append_text(\"#{t}\")\n\t\t}\n\n\t\t@list.signal_connect('changed'){ |widget|\n\t\t\tHeader.penalite()\n\t\t\t@techniqueChoisie=widget.active_text()\n\t\t\t@techniqueObjet=@Techniques.creer(@techniqueChoisie)\n\t\t\t@nbEtape= recuperationNbEtape()\n\t\t\t@etapeEnCours=1\n\t\t\tactualisation()\n\t\t}\n\n\t\t#etapes\n\t\t@boutonEtapePrec.signal_connect('clicked'){\n\t\t\tif @etapeEnCours-1 > 0\n\t\t\t\t@etapeEnCours=@etapeEnCours-1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boutonEtapeSuiv.signal_connect('clicked'){\n\t\t\tif @etapeEnCours+1 <= @nbEtape\n\t\t\t\t@etapeEnCours=@etapeEnCours+1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boxEtape.add(@boutonEtapePrec)\n\t\t@boxEtape.add(@labelEtape)\n\t\t@boxEtape.add(@boutonEtapeSuiv)\n\n\t\t#explication\n @boxExplication.set_hexpand(true)\n @boxExplication.set_vexpand(true)\n\n @texteContenu.set_line_wrap(true)\n @boxTexte.add(@texteContenu)\n @boxContour.pack_start(@boxTexte, :expand => true, :fill => true)\n @boxExplication.pack_start(@boxContour, :expand => true, :fill => true)\n\n\t\t#add a la box\n\t\t@boxInfo.add(@labelChoix)\n\t\t@boxInfo.add(@list)\n\t\t@boxInfo.add(@labelChoix2)\n\t\t@boxInfo.add(@boxEtape)\n\t\t@boxInfo.add(@boxExplication)\n\tend",
"def unsichtbar_machen()\n end",
"def on_click_aller_retour\n @pile_action.vers_dernier_point_de_retour\n end",
"def pantallaPuntosRondas\n\t\tpuntos = \"\"\n\t\trondas = \"\"\n\n\t\t# Limpiamos pantalla\n\t\t@app.clear\n\t\t@app.background \"fondo.jpg\"\n\n\t\t@boxes = @app.stack :top => \"180\", :left => \"330\"\n\t\t@boxes.para \"Rondas\"\n\t\t@r = @boxes.edit_line\n \t@boxes.para \"Puntos\"\n \t@pu = @boxes.edit_line\n \t@enviar = @boxes.button \"OK\"\n \t@enviar.click do\n\t \t@rondas = @r.text\n\t\t\t@puntos = @pu.text\n\t\t\tif (@rondas == \"\" and @puntos == \"\")\n\t\t\t\t@boxes.append \"Debe indicar un numero de rondas o puntos.\"\n\t\t\telse\n\t\t\t\tpantallaJuego\n\t\t\tend\n\t\tend\n \t\n\tend",
"def on_button_uboj_dodaj_clicked()\n # tworzenie komunikatu\n dialog = Gtk::MessageDialog.new(nil, \n Gtk::Dialog::NO_SEPARATOR,\n Gtk::MessageDialog::INFO,\n Gtk::MessageDialog::BUTTONS_OK,\n \"Uboj został dodany\")\n dialog.run\n dialog.signal_connect('response') { dialog.hide }\n end",
"def printMenu\n\t\tself.report(\"\n\t\tEscolha uma opção\n\t\t1 - Trocar palavra-chave.\n\t\t2 - Ver palavra-chave.\n\t\t3 - Ver arquivo.\n\t\t4 - Sair.\n\t\t? \", 1)\t\t\n\tend",
"def show \r\n end",
"def show\n if @input.devolucion\n @es_devolucion = \"Devolución\"\n else\n @es_devolucion = [\"Remito: \",@input.remito].join\n end\n end",
"def pessoavai(lugar)\n puts \"indo para \" + lugar\nend",
"def menu\n\t\tputs \"\\nQuelle action veux-tu effectuer ?\"\n\t\tputs \"a - chercher une meilleure arme\"\n\t\tputs \"s - chercher à se soigner\\n\"\n\n\t\tputs \"\\nattaquer un joueur en vue :\"\n\t\tif player1.life_points > 0 \n\t\t\tputs \"0 - Josiane a #{player1.life_points} points de vie\"\n\t\tend\n\t\tif player2.life_points > 0\n\t\t\tputs \"1 - José a #{player2.life_points} points de vie\"\n\t\tend\n\t\tif player3.life_points > 0\n\t\t\tputs \"2 - José a #{player3.life_points} points de vie\"\n\t\tend\n\t\tif player4.life_points > 0\n\t\t\tputs \"3 - José a #{player4.life_points} points de vie\"\n\t\tend\n\tend",
"def on_pou_ok\n @party_or_unit_win.hide\n @select_text_win.text = \"Select the items to give to #{@actor.name}\"\n @select_text_win.show\n @category_window.show\n deactivate_all_but(@category_window)\n @category_window.activate\n @item_window.show\n end",
"def sichtbar_machen()\n # TODO\n end",
"def show() end",
"def show() end",
"def show() end",
"def gestionDroite()\n\t\t#choix technique\n\t\t@tabTechnique.each{ |t|\n\t\t\t@list.append_text(\"#{t}\")\n\t\t}\n\n\t\t@list.signal_connect('changed'){ |widget|\n\t\t\t@techniqueChoisie=widget.active_text()\n\t\t\t@techniqueObjet=@Techniques.creer(@techniqueChoisie)\n\t\t\t@nbEtape= recuperationNbEtape()\n\t\t\t@etapeEnCours=1\n\t\t\tactualisation()\n\t\t}\n\n\t\t#etapes\n\t\t@boutonEtapePrec.signal_connect('clicked'){\n\t\t\tif @etapeEnCours-1 > 0\n\t\t\t\t@etapeEnCours=@etapeEnCours-1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boutonEtapeSuiv.signal_connect('clicked'){\n\t\t\tif @etapeEnCours+1 <= @nbEtape\n\t\t\t\t@etapeEnCours=@etapeEnCours+1\n\t\t\t\tactualisation()\n\t\t\tend\n\t\t}\n\n\t\t@boxEtape.add(@boutonEtapePrec)\n\t\t@boxEtape.add(@labelEtape)\n\t\t@boxEtape.add(@boutonEtapeSuiv)\n\n\t\t#explication\n @boxExplication.set_hexpand(true)\n @boxExplication.set_vexpand(true)\n\n @texteContenu.set_line_wrap(true)\n @boxTexte.add(@texteContenu)\n @boxContour.pack_start(@boxTexte, :expand => true, :fill => true)\n @boxExplication.pack_start(@boxContour, :expand => true, :fill => true)\n\n\t\t#add a la box\n\t\t@boxInfo.add(@labelChoix)\n\t\t@boxInfo.add(@list)\n\t\t@boxInfo.add(@labelChoix2)\n\t\t@boxInfo.add(@boxEtape)\n\t\t@boxInfo.add(@boxExplication)\n\tend",
"def lancementHudPresentationTutoriel(grille)\n\t\t@@fenetre.changerWidget(HudPresentationTutoriel.new(grille))\n\t\tself\n\tend",
"def sichtbar_machen\n @sichtbar = true\n zeichnen()\n puts(self) \n end",
"def show\n @operacao = 'Visualização'\n end",
"def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end",
"def display_details()\n puts \"Numele persoanei: #@nume\"\n puts \"Prenumele persoanei: #@prenume\"\n end",
"def choose(choices, title)\n res = @dialog.menu(title, choices)\n\n raise CancelPressed.new unless res\n\n res\nend",
"def konversiMenit(menit) \n # =================================\n # Area Kode Kode di sini\n \n \n \n # =================================\n end",
"def gestionBarreMenu()\n\t\tFenetre::boutonMenu_barre.signal_connect('clicked'){\n\t\t\tmessageQuestion = Fenetre::creerPopup(\"Voulez-vous vraiment abandonner l'apprentissage et revenir au menu principal?\", \"YES_NO\")\n\t\t if(messageQuestion.run() == Gtk::ResponseType::YES)\n\t\t \tCore::changeTo(\"Menu\", \"pseudo\": @pseudo)\n\t\t end\n\t\t messageQuestion.destroy()\n\t\t}\n\t\tFenetre::boutonSauvegarder_barre.signal_connect('clicked'){\n\t\t}\n\t\tFenetre::boutonReinit_barre.signal_connect('clicked'){\n\t\t}\n\t\tFenetre::boutonQuitter_barre.signal_connect('clicked'){\n\t\t\tmessageQuestion = Fenetre::creerPopup(\"Voulez-vous vraiment abandonner l'apprentissage et quitter l'application?\", \"YES_NO\")\n\t\t if(messageQuestion.run() == Gtk::ResponseType::YES)\n\t\t \tFenetre::detruire()\n\t\t end\n\t\t messageQuestion.destroy()\n\t\t}\n\t\tFenetre::boutonPauseChrono_barre.signal_connect('clicked'){\n\t\t\tHeader::pause = true\n\t\t}\n\t\tFenetre::boutonPlayChrono_barre.signal_connect('clicked'){\n\t\t\tHeader::pause = false\n\t\t}\n\t\tFenetre::boutonAnnuler_barre.signal_connect('clicked'){\n\t\t}\n\t\tFenetre::boutonRetablir_barre.signal_connect('clicked'){\n\t\t}\n\n\t\t#disabled\n\t\tFenetre::boutonSauvegarder_barre.set_sensitive(false)\n\t\tFenetre::boutonReinit_barre.set_sensitive(false)\n\t\tFenetre::boutonAnnuler_barre.set_sensitive(false)\n\t\tFenetre::boutonRetablir_barre.set_sensitive(false)\n\tend",
"def einschalten() \n @schirm.farbe_aendern('gelb')\n @leuchtstrahl1.sichtbar_machen()\n @leuchtstrahl2.sichtbar_machen()\n @leuchtstrahl3.sichtbar_machen()\n @leuchtstrahl4.sichtbar_machen()\n @leuchtstrahl1.farbe_aendern('gelb')\n @leuchtstrahl2.farbe_aendern('gelb')\n @leuchtstrahl3.farbe_aendern('gelb')\n @leuchtstrahl4.farbe_aendern('gelb')\n end",
"def show # shows the selected word of the day (redundant)\n end",
"def show\n #calculo de presupuesto\n \n end",
"def onClick(dialog, which)\n end",
"def letzte_komponente\n \n end",
"def show\n combo_producto\n combo_platillo\n end",
"def display_choices(monster) \n monster.display_moves << \"or type (Q)uit to give up.\"\n end",
"def jeuTermine\n\t\tlancementAventure(@tailleGrille+1)\n\tend",
"def lancementFinDeJeu\n\t\t@@hudPrecedent = self\n\t\t@@fenetre.changerWidget(HudFinDeJeu.new)\n\t\tself\n\tend",
"def gestionBarreMenu()\n\t\tFenetre::boutonMenu_barre.signal_connect('clicked'){\n\t\t\tmessageQuestion = Fenetre::creerPopup(\"1/2: Voulez-vous vraiment abandonner la partie et revenir au menu principal ?\", \"YES_NO\")\n\t\t if(messageQuestion.run() == Gtk::ResponseType::YES)\n\t\t \tmessageQuestion2 = Fenetre::creerPopup(\"2/2: Voulez-vous sauvegarder la partie actuelle?\", \"YES_NO\")\n\t\t \tif(messageQuestion2.run() == Gtk::ResponseType::YES)\n\t\t \t\tsauvegarder()\n\t\t \tend\n\n\t\t \tHeader.profil(@pseudo)\n\t\t \tCore::changeTo(\"Menu\", \"pseudo\": @pseudo)\n\t\t \tmessageQuestion2.destroy()\n\t\t end\n\t\t messageQuestion.destroy()\n\t\t}\n\t\tFenetre::boutonSauvegarder_barre.signal_connect('clicked'){\n\t\t\tsauvegarder()\n\t\t}\n\t\tFenetre::boutonReinit_barre.signal_connect('clicked'){\n\t\t\t# Réinitialise la grille (données)\n\t\t\t@controller.reinitialiser\n\t\t\t## Réinitialise la grille (affichage)\n\t\t\tself.reinitialiser\n\t\t\t@grilleDessin.redessiner\n\t\t}\n\t\tFenetre::boutonQuitter_barre.signal_connect('clicked'){\n\t\t\tmessageQuestion = Fenetre::creerPopup(\"1/2: Voulez-vous vraiment abandonner la partie et quitter l'application?\", \"YES_NO\")\n\n\t\t if(messageQuestion.run() == Gtk::ResponseType::YES)\n\t\t \tmessageQuestion2 = Fenetre::creerPopup(\"2/2: Voulez-vous sauvegarder la partie actuelle?\", \"YES_NO\")\n\t\t \tif(messageQuestion2.run() == Gtk::ResponseType::YES)\n\t\t \t\tsauvegarder()\n\t\t \tend\n\t\t \tFenetre::detruire()\n\t\t \tmessageQuestion2.destroy()\n\n\t\t end\n\t\t messageQuestion.destroy()\n\t\t}\n\t\tFenetre::boutonPauseChrono_barre.signal_connect('clicked'){\n\t\t\tHeader::pause = true\n\n\t\t}\n\t\tFenetre::boutonPlayChrono_barre.signal_connect('clicked'){\n\t\t\tif(Header::pause == true)\n\t\t\t\tHeader::pause = false\n\t\t\t\tHeader::chrono\n\t\t\tend\n\t\t}\n\t\t\n\t\tFenetre::boutonAnnuler_barre.signal_connect('clicked'){\n\t\t}\n\t\tFenetre::boutonRetablir_barre.signal_connect('clicked'){\n\t\t}\n\t\t#disabled\n\t\tFenetre::boutonAnnuler_barre.set_sensitive(false)\n\t\tFenetre::boutonRetablir_barre.set_sensitive(false)\n\tend",
"def schumann; end",
"def show\n set_encomenda\n end",
"def rafraichir\n\t\tj = @jeu.joueur\n\t\tpos = j.position\n\n\t\t@jeu.tourSuivant( @jeu.carte.vueJoueur(pos,15) )\n\t\t@interface.setVue( @jeu.carte.vueJoueur(pos,@interface.taille) )\n\t\t@interface.setPV( j.pointsDeVie, j.pointsDeVieMax )\n\t\t@interface.setED( j.endurance, j.enduranceMax )\n\t\t@interface.setScore( j.score )\n\t\t@interface.setNbTour( @jeu.nbTour )\n\t\t@interface.setOr( j.or )\n\t\tif j.position.objet\n\t\t\t@interface.setAction( \"Ramasser #{j.position.objet.getNom}\" )\n\t\telsif j.position.pnj\n\t\t\t@interface.setAction( j.position.pnj.actionNom )\n\t\telsif j.position.type.nom == \"herbe\"\n\t\t\t@interface.setAction( \"Regarder l'herbe pousser\" )\n\t\telsif j.position.type.nom == \"desert\"\n\t\t\t@interface.setAction( \"Compter les grains de sable\" )\n\t\telsif j.position.type.nom == \"eau\"\n\t\t\t@interface.setAction( \"Faire la planche\" )\n\t\telse\n\t\t\t@interface.setAction( \"Rien à faire\" )\n\t\tend\n\tend",
"def abendprogramm\ndoc = tvprogrammabend(doc)\ndob = tvprogrammsatabend(dob)\n if doc == NIL or doc == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n elsif dob == NIL or dob == \"\"\n say \"Es gab ein Problem beim Einlesen des Fernsehprogramms!\"\n else\n doc.encoding = 'utf-8'\n dob.encoding = 'utf-8'\n docs = doc.xpath('//title')\n dobs = dob.xpath('//title')\n i = 1\n while i < docs.length\n dos = docs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n if doss == \"ARD: \"\n dos = dosund(dos)\n orf1 = dos\n elsif doss == \"ZDF: \"\n dos = dosund(dos)\n orf2 = dos\n elsif doss == \"SAT.1\"\n dos = dosund(dos)\n orf3 = dos\n elsif doss == \"RTL: \"\n dos = dosund(dos)\n atv = dos\n elsif doss == \"PRO7:\"\n dos = dosund(dos)\n orfs = dos\n elsif doss == \"RTL2:\"\n dos = dosund(dos)\n puls4 = dos\n elsif doss == \"KABEL\"\n dos = dosund(dos)\n servus = dos\n else\n end\n i += 1\n end\n i = 1\n while i < dobs.length\n dos = dobs[i].to_s\n dos = cleanup(dos)\n doss = dos[0,5]\n \n if doss == \"3SAT:\"\n dos = dosund(dos)\n sat = dos\n else\n end\n i += 1\n end\n say \"\", spoken: \"Programm für 20 Uhr 15\"\n object = SiriAddViews.new\n object.make_root(last_ref_id)\n answer = SiriAnswer.new(\"TV Programm - 20:15\", [\n SiriAnswerLine.new(orf1),\n SiriAnswerLine.new(orf2),\n SiriAnswerLine.new(orf3),\n SiriAnswerLine.new(atv),\n SiriAnswerLine.new(sat),\n SiriAnswerLine.new(puls4),\n SiriAnswerLine.new(servus),\n SiriAnswerLine.new(orfs)\n ])\n object.views << SiriAnswerSnippet.new([answer])\n send_object object\n end\n request_completed\nend",
"def changerEnVide\n\t\t@couleur=-1\n\tend",
"def joue\n coup_valide = false\n until coup_valide do\n puts \"#{nom}, entrez le numero de la colonne: \"\n colonne = gets\n puts \"#{nom} entrez le numero de ligne : \"\n ligne = gets\n coup_valide = plateau.place(ligne.to_i ,colonne.to_i ,pion)\n end \n end",
"def editar\n end",
"def schubert; end",
"def pessoavaidois(lugar)\n \"indo para \" + lugar\nend",
"def display_reservations_menu\n puts \"-\"*50\n puts \" ¡¡¡Bienvenido!!!\"\n puts \"-\"*50\n puts \n puts \"1) Encuentra tu boleto de avión\"\n puts \"2) Salir\"\n puts \"Selecciona una opción:\"\n input = gets.chomp\n input\n end",
"def ajouterGrille(box)\n vBoxGrille = Gtk::Box.new(:vertical , 20)\n tabPartieEnCours = Sauvegardes.getInstance.getSauvegardePartie.getListPartieLibreEnCours\n\n # Si le bouton 'facile' est actif => affichage des scores pour les grilles du niveau 'facile'\n if @@easyActivated\n vBoxGrille.add( titleLabel( @@lg.gt(\"FACILE\") ) )\n i = 1\n while ( i <= SauvegardeGrille.getInstance.getNombreGrille / 3 )\n if i == SauvegardeGrille.getInstance.getNombreGrille / 3\n vBoxGrille.add( generateHbox( generateFrame( SauvegardeGrille.getInstance.getGrilleAt(i) , box ) , nil ) )\n else\n vBoxGrille.add( generateHbox( generateFrame(SauvegardeGrille.getInstance.getGrilleAt(i) , box ) ,generateFrame(SauvegardeGrille.getInstance.getGrilleAt(i + 1) , box )) )\n i+=1\n end\n i+=1\n end\n\n if(@@mediumActivated || @@hardActivated)\n vBoxGrille.add( Gtk::Separator.new(:horizontal) )\n end\n end\n\n # Si le bouton 'moyen' est actif => affichage des scores pour les grilles du niveau 'moyen'\n if @@mediumActivated\n vBoxGrille.add( titleLabel( @@lg.gt(\"MOYEN\") ) )\n i = 1 + SauvegardeGrille.getInstance.getNombreGrille / 3\n while ( i <= SauvegardeGrille.getInstance.getNombreGrille / 3 * 2 )\n if i == SauvegardeGrille.getInstance.getNombreGrille / 3 * 2\n vBoxGrille.add( generateHbox( generateFrame( SauvegardeGrille.getInstance.getGrilleAt(i) , box ) , nil ) )\n else\n vBoxGrille.add( generateHbox( generateFrame(SauvegardeGrille.getInstance.getGrilleAt(i) , box ) ,generateFrame(SauvegardeGrille.getInstance.getGrilleAt(i + 1) , box )) )\n i+=1\n end\n i+=1\n end\n\n if(@@hardActivated)\n vBoxGrille.add( Gtk::Separator.new(:horizontal) )\n end\n end\n\n # Si le bouton 'difficile' est actif => affichage des scores pour les grilles du niveau 'difficile'\n if @@hardActivated\n vBoxGrille.add( titleLabel( @@lg.gt(\"DIFFICILE\") ) )\n i = 1 + SauvegardeGrille.getInstance.getNombreGrille / 3 * 2\n while ( i <= SauvegardeGrille.getInstance.getNombreGrille )\n if i == SauvegardeGrille.getInstance.getNombreGrille\n vBoxGrille.add( generateHbox( generateFrame( SauvegardeGrille.getInstance.getGrilleAt(i) , box ) , nil ) )\n else\n vBoxGrille.add( generateHbox( generateFrame(SauvegardeGrille.getInstance.getGrilleAt(i) , box ) ,generateFrame(SauvegardeGrille.getInstance.getGrilleAt(i + 1) , box)) )\n i+=1\n end\n i+=1\n end\n end\n setmargin(vBoxGrille,15,15,0,0 )\n\n return vBoxGrille\n end",
"def show\n set_word\n end",
"def lancement(i)\nif i == 10\n puts \"Bravo vous avez gagné la partie!\"\n else\n puts \"Veuillez taper un caractère pour lancer le dé\" \n lancer_de=gets.chomp\n \nif lancer_de.empty?\n puts proba(i)\n else \n puts \"Il faut juste appuyer sur entrée!!!\"\n puts lancement(i)\n #dé_actuel=rand(1..6)\n \nend\nend \nend",
"def corrigir_mensagem\n\n @responsavel_envio = \"VERONIQUE\"\n corrigir_pasta.click\n numero_mensagem_corrigir.click\n corrigir_button.click\n responsavel_envio_select2.select(@responsavel_envio)\n assinatura_radio2[0].click\n sleep(0.5)\n providencia_textarea.set(@providencia)\n salvar_button.click\n end",
"def show_baptized_at_home_parish_radio\n true\n end",
"def menu\n puts \"Quelle action souhaites-tu effectuer : \"\n puts \"a - chercher une meilleure arme\"\n puts \"s - chercher à se soigner \"\n i=0\n puts \"Qui souhaites-tu attaquer?\"\n enemies_in_sight.each do |enemy| \n puts \"#{i} - #{enemies_in_sight[i].name} qui a #{enemies_in_sight[i].life_point} points de vie\" \n i=i+1 \n end\n end",
"def exibir_lojas()\n lojas.click\n end",
"def doOok\n idx = $fnamelist.curselection\n if idx.length==1\n idx = idx[0]\n $fnamelist.see idx\n\n $sent.value = \"Ook!\"\n end\nend",
"def ventanaRegistroPersona(app,nombreGrupo)\n\t\tventanaRegistro=FXDialogBox.new(app,\"Registra Integrantes\",:width=>600,:height=>400)\n\n\t\tbotones=FXVerticalFrame.new(ventanaRegistro,:opts => FRAME_RAISED|LAYOUT_SIDE_BOTTOM|LAYOUT_FILL_X)\n\t\tbotonAceptar=FXButton.new(botones, \"Guardar\",:opts => BUTTON_NORMAL|LAYOUT_CENTER_X|LAYOUT_FILL_X)\n\t\tsalida=FXButton.new(botones, \"Salir\",:target => ventanaRegistro,\n\t\t\t:selector => FXDialogBox::ID_CANCEL,:opts => BUTTON_NORMAL|LAYOUT_CENTER_X|LAYOUT_FILL_X)\n\n\t\t\tform = FXMatrix.new(ventanaRegistro, 2,\n\t\t\t :opts => MATRIX_BY_COLUMNS|LAYOUT_FILL_X)\n\t\t\t FXLabel.new(form, \"Nombre Artístico:\")\n\t\t\t nombreStage=FXTextField.new(form, 20,:opts => TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)\n\t\t\t\tFXLabel.new(form, \"Nombre Real:\")\n\t \t \tnombreReal=FXTextField.new(form, 20,:opts => TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)\n\t \t \tFXLabel.new(form, \"Fecha de Nacimiento:\")\n\t \t \tfechaNacimiento=FXTextField.new(form, 20,:opts => TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)\n\t \t \tFXLabel.new(form, \"Fecha de muerte:\")\n\t\t\tfechaMuerte=FXTextField.new(form, 20,:opts => TEXTFIELD_NORMAL|LAYOUT_FILL_X|LAYOUT_FILL_COLUMN)\n\t\t\tbotonAceptar.connect(SEL_COMMAND) do\n\t\t\t\tif(nombreStage.text==\"\")\n\t\t\t\t\tFXMessageBox.error(app,MBOX_OK,\"Entrada Invalida\",\"El Nombre artistico no debe ser vacio\")\n\t\t\t\t\tnombreStage.backColor=\"OrangeRed\"\n\t\t\t\telse\n\t\t\t\t\tbotonAceptar.hide\n\t\t\t\t\tnombreStage.backColor=\"Gray\"\n\t\t\t\t\tnombreReal.backColor=\"gray\"\n\t\t\t\t\tfechaNacimiento.backColor=\"gray\"\n\t\t\t\t\tfechaMuerte.backColor=\"Gray\"\n\t\t\t\t\tnombreStage.editable=false\n\t\t\t\t\tnombreReal.editable=false\n\t\t \t\tfechaNacimiento.editable=false\n\t\t\t\t\tfechaMuerte.editable=false\n\t\t\t\t\tControlDeBase.new.registrarPersona(nombreStage.text,nombreReal.text,fechaNacimiento.text,fechaMuerte.text)\n\t\t\t\t\tControlDeBase.new.personaEnGrupo(nombreStage.text,nombreGrupo)\n\t\t\t\tend\n\t\t\tend\n\t\tventanaRegistro.execute\n\tend",
"def p(*args)\r\n YDialog.ok(Yrgss.game.getName,args.inspect.to_s);\r\nend",
"def funktionsname\n\tanweisung\nend",
"def show\n\n @años =(@test.edad/12).truncate\n @meses = (@test.edad % 12).truncate\n\n if @test.ic > 115 then\n @a = \"El/la estudiante ha adquirido las habilidades verbales por encima de lo esperado para su edad.\"\n @b = \"Se sugieren las siguientes estrategias para reforzar los logros de su hijo/a:\"\n\n elsif @test.ic.between?(85, 115) then\n @a = \"El/la estudiante ha adquirido las habilidades verbales esperadas para su edad.\"\n @b = \"Se sugieren las siguientes estrategias para propiciar un mayor vocabulario de su hijo/a:\"\n\n elsif @test.ic < 85 then\n @a = \"El/la estudiante se encuentra en proceso de adquirir las habilidades verbales esperadas para\nsu edad.\"\n@b = \"Se sugieren las siguientes estrategias para incentivar un mayor vocabulario de su hijo/a y\nalcanzar el nivel esperado para su edad:\"\n end\n\n if @test.nivel == \"Inicial\" then \n @c = \"Conversar con sus hijos puede ser una buena forma de introducir vocabulario nuevo\nen ellos. Pregunte a sus hijos acerca de su día. Incluso los adultos pueden introducir\nnuevo vocabulario a los niños, actuando o ejemplificando el uso de las palabras\nnuevas.\"\n @d = \"Cuéntele y/o léale historias o cuentos a sus hijos. Esta puede ser una manera eficaz y\nentretenida de introducir nuevo vocabulario en ellos. Posteriormente, converse sobre\nlo que les ha leído.\"\n\nelsif @test.nivel == \"1\" then\n @c = \"Conversar con sus hijos puede ser una buena forma de introducir vocabulario nuevo\nen ellos. Pregunte a sus hijos acerca de su día. Incluso los adultos pueden introducir\nnuevo vocabulario a los niños, actuando o ejemplificando el uso de las palabras\nnuevas.\"\n @d = \"Propicie el hábito de lectura en sus hijos, complementariamente léale cuentos o\nhistorias, o lea con ellos. Esta puede ser una manera eficaz y entretenida de introducir\nnuevo vocabulario en ellos. Posteriormente, converse sobre lo que han leído.\"\n\nelsif @test.nivel == \"2\" then\n @c = \"Conversar con sus hijos puede ser una buena forma de introducir vocabulario nuevo\nen ellos. Pregunte a sus hijos acerca de su día. Incluso los adultos pueden introducir\nnuevo vocabulario a los niños, actuando o ejemplificando el uso de las palabras\nnuevas.\"\n @d = \"Propicie el hábito de lectura en sus hijos, complementariamente léale cuentos o\nhistorias, o lea con ellos. Esta puede ser una manera eficaz y entretenida de introducir\nnuevo vocabulario en ellos. Posteriormente, converse sobre lo que han leído.\"\n end \n\n\n# mate\n\n if @test.icm > 115 then\n @e = \"El/la estudiante ha adquirido las habilidades matemáticas aritméticas básicas por encima de lo\nesperado para su edad.\"\n\n elsif @test.icm.between?(85, 115) then\n @e = \"El/la estudiante ha adquirido las habilidades matemáticas aritméticas básicas esperadas para\nsu edad.\"\n\n elsif @test.icm < 85 then\n @e = \"El/la estudiante se encuentra en proceso de adquirir las habilidades matemáticas aritméticas\nbásicas esperadas para su edad.\"\n end\n\n# Numeración\n\n# 60 a 65\n\nif @test.edad.between?(60, 65) && @test.pi_num > 10 then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números. Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\n* Para que practiquen el conteo de 10 en 10 se puede jugar un juego en el que los niños tienen que contar con rapidez objetos agrupados en colecciones de diez. Si se prima la velocidad, los niños aprenden rápidamente a contar de 10 en 10.\n\"\n\nelsif @test.edad.between?(60, 65) && @test.pi_num.between?(8, 10) then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\nelsif @test.edad.between?(60, 65) && @test.pi_num < 8 then\n @f = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números. \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\n# 72 a 77\n\nelsif @test.edad.between?(66, 71) && @test.pi_num > 14 then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números. Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\n* Para que practiquen el conteo de 10 en 10 se puede jugar un juego en el que los niños tienen que contar con rapidez objetos agrupados en colecciones de diez. Si se prima la velocidad, los niños aprenden rápidamente a contar de 10 en 10.\n\"\n\nelsif @test.edad.between?(66, 71) && @test.pi_num.between?(10, 14) then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\nelsif @test.edad.between?(66, 71) && @test.pi_num < 10 then\n @f = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números. \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\n# 72 a 77 \n\nelsif @test.edad.between?(72, 77) && @test.pi_num > 16 then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9 o más, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\n* Para que practiquen el conteo de 10 en 10 se puede jugar un juego en el que los niños tienen que contar con rapidez objetos agrupados en colecciones de diez. Si se prima la velocidad, los niños aprenden rápidamente a contar de 10 en 10.\n\"\n\nelsif @test.edad.between?(72, 77) && @test.pi_num.between?(13, 16) then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9 o más, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\nelsif @test.edad.between?(72, 77) && @test.pi_num < 13 then\n @f = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n \n\n * Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números. \n \n * Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n \n * Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n \n * Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\n\n# 78 a 83\n\nelsif @test.edad.between?(78, 83) && @test.pi_num > 17 then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9 o más, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\n* Para que practiquen el conteo de 10 en 10 se puede jugar un juego en el que los niños tienen que contar con rapidez objetos agrupados en colecciones de diez. Si se prima la velocidad, los niños aprenden rápidamente a contar de 10 en 10.\n\"\n\nelsif @test.edad.between?(78, 83) && @test.pi_num.between?(15, 17) then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n\n* Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9 o más, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\nelsif @test.edad.between?(78, 83) && @test.pi_num < 15 then\n @f = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n \n\n * Se puede ayudar al niño a aprender la secuencia numérica (sobre todo los primeros 15 números que deben ser memorizados) con rimas infantiles e historias. Luego del 15 hay un patrón para los números y la idea es ayudar al niño a que aprenda las reglas para crear los números. \n \n * Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n \n * Jugar con el niño tirando un dado (para mayor complejidad pueden usar más dados) para determinar qué número de objetos han de seleccionarse de un conjunto mayor.\n \n * Jugar el “Número tapado”, consiste en colocar una serie de cartas del 1 al 9, se pide al niño que cierre los ojos y se le da la vuelta a una de ellas ocultando el número. Después, se les pide (señalando la carta anterior) que digan cuál es el número siguiente. Una versión más elaborada supone dar la vuelta a todas las cartas y levantar solo una de ellas. Entonces se pide al niño que diga cuál es el número que va después.\n\"\n\n\n# 84 a 95\n\nelsif @test.edad.between?(84, 95) && @test.pi_num > 18 then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Después de conocer las reglas de los números hasta el 99, la tarea principal de los estudiantes es aprender que el número siguiente es 100, y que se vuelven a aplicar el mismo tipo de reglas para producir los números superiores a 100. La regla básica es empezar con la etiqueta de las centenas (en este caso “ciento”), después se sigue con la etiqueta de las decenas (“veinte”, “treinta”, etc.) y se le añaden las unidades (uno, dos…). \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Practicar secuencias de conteo con un patrón establecido, de 4 en 4, de 6 en 6, etc.\n\"\n\nelsif @test.edad.between?(84, 95) && @test.pi_num.between?(16, 18) then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Después de conocer las reglas de los números hasta el 99, la tarea principal de los estudiantes es aprender que el número siguiente es 100, y que se vuelven a aplicar el mismo tipo de reglas para producir los números superiores a 100. La regla básica es empezar con la etiqueta de las centenas (en este caso “ciento”), después se sigue con la etiqueta de las decenas (“veinte”, “treinta”, etc.) y se le añaden las unidades (uno, dos…). \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Practicar secuencias de conteo con un patrón establecido, de 4 en 4, de 6 en 6, etc.\n\"\n\nelsif @test.edad.between?(84, 95) && @test.pi_num < 16 then\n @f = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Después de conocer las reglas de los números hasta el 99, la tarea principal de los estudiantes es aprender que el número siguiente es 100, y que se vuelven a aplicar el mismo tipo de reglas para producir los números superiores a 100. La regla básica es empezar con la etiqueta de las centenas (en este caso “ciento”), después se sigue con la etiqueta de las decenas (“veinte”, “treinta”, etc.) y se le añaden las unidades (uno, dos…). \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Para que practiquen el conteo de 10 en 10 se puede jugar un juego en el que los niños tienen que contar con rapidez objetos agrupados en colecciones de diez. Si se prima la velocidad, los niños aprenden rápidamente a contar de 10 en 10.\n\"\n\n\n\n# 96 a 101\n\nelsif @test.edad.between?(96, 101) && @test.pi_num > 19 then\n @f = \"El/la estudiante ha adquirido las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Después de conocer las reglas de los números hasta el 99, la tarea principal de los estudiantes es aprender que el número siguiente es 100, y que se vuelven a aplicar el mismo tipo de reglas para producir los números superiores a 100. La regla básica es empezar con la etiqueta de las centenas (en este caso “ciento”), después se sigue con la etiqueta de las decenas (“veinte”, “treinta”, etc.) y se le añaden las unidades (uno, dos…). \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Practicar secuencias de conteo con un patrón establecido, de 4 en 4, de 6 en 6, etc.\n\"\n\nelsif @test.edad.between?(96, 101) && @test.pi_num < 20 then\n @f = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de numeración de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Los niños deben aprender que después de un número terminado en 9, hay un cambio a la decena siguiente, y una vez que el cambio se ha producido, simplemente se añaden los números del 1 al 9.\n\n* Después de conocer las reglas de los números hasta el 99, la tarea principal de los estudiantes es aprender que el número siguiente es 100, y que se vuelven a aplicar el mismo tipo de reglas para producir los números superiores a 100. La regla básica es empezar con la etiqueta de las centenas (en este caso “ciento”), después se sigue con la etiqueta de las decenas (“veinte”, “treinta”, etc.) y se le añaden las unidades (uno, dos…). \n\n* Dar oportunidad a los niños para que identifiquen los errores de conteo de los adultos. Los niños pequeños encuentran sorprendente y divertido que los adultos cometan errores y disfrutan señalándolos. El adulto tiene que producir deliberadamente errores de conteo para que el niño los identifique y corrija.\n\n* Para que practiquen el conteo de 10 en 10 se puede jugar un juego en el que los niños tienen que contar con rapidez objetos agrupados en colecciones de diez. Si se prima la velocidad, los niños aprenden rápidamente a contar de 10 en 10.\n\"\nend\n\n# Comparación de cantidades\n\n# 60 a 71\n\nif @test.edad.between?(60, 71) && @test.pi_comp > 3 then\n @g= \"El/la estudiante ha adquirido las habilidades de comparación de cantidades por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente. Puede ir incrementando los números para que la tarea sea más compleja para el estudiante.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental. \n\"\n\nelsif @test.edad.between?(60, 71) && @test.pi_comp.between?(2, 3) then\n @g = \"El/la estudiante ha adquirido las habilidades de comparación de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Los objetos pueden alinearse uno al lado del otro, de esta manera, el estudiante puede aprender que la colección a la que le “sobra algo”, al ponerla en relación por correspondencia uno a uno, es la que tiene “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental. \n\"\n\nelsif @test.edad.between?(60, 71) && @test.pi_comp < 2 then\n @g = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de comparación de cantidades de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Los objetos pueden alinearse uno al lado del otro, de esta manera, el estudiante puede aprender que la colección a la que le “sobra algo”, al ponerla en relación por correspondencia uno a uno, es la que tiene “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente.\n\"\n\n\n# 72 a 77 \n\nelsif @test.edad.between?(72, 77) && @test.pi_comp > 4 then\n @g= \"El/la estudiante ha adquirido las habilidades de comparación de cantidades por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente. Puede ir incrementando los números para que la tarea sea más compleja para el estudiante o pedirle que diga dónde hay “menos”.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental. Una vez que el niño se haya familiarizado con esto, debería pasar a trabajar con números del 1 al 100. \n\"\n\nelsif @test.edad.between?(72, 77) && @test.pi_comp = 4 then\n @g = \"El/la estudiante ha adquirido las habilidades de comparación de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente. Puede ir incrementando los números para que la tarea sea más compleja para el estudiante o pedirle que diga dónde hay “menos”.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental. Una vez que el niño se haya familiarizado con esto, debería pasar a trabajar con números del 1 al 100. \n\"\n\nelsif @test.edad.between?(72, 77) && @test.pi_comp < 4 then\n @g = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de comparación de cantidades de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Los objetos pueden alinearse uno al lado del otro, de esta manera, el estudiante puede aprender que la colección a la que le “sobra algo”, al ponerla en relación por correspondencia uno a uno, es la que tiene “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental.\n\"\n\n\n# 78 a83\n\nelsif @test.edad.between?(78, 83) && @test.pi_comp > 3 then\n @g= \"El/la estudiante ha adquirido las habilidades de comparación de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente. Puede ir incrementando los números para que la tarea sea más compleja para el estudiante o pedirle que diga dónde hay “menos”.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental. Una vez que el niño se haya familiarizado con esto, debería pasar a trabajar con números del 1 al 100. \n\"\n\nelsif @test.edad.between?(78, 83) && @test.pi_comp < 4 then\n @g = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de comparación de cantidades de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Los objetos pueden alinearse uno al lado del otro, de esta manera, el estudiante puede aprender que la colección a la que le “sobra algo”, al ponerla en relación por correspondencia uno a uno, es la que tiene “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente.\n\n* Presentar al niño una línea numérica escrita en el piso (del 1 al 10, por ejemplo) y preguntarle dónde se necesitan más pasos: del 2 al 9 o del 2 al 4. También se podría utilizar una regla para realizar este ejercicio. Esta experiencia con líneas numéricas físicas le ayudará al niño a interiorizar la línea numérica mental.\n\"\n\n\n# 84 a 95\n\nelsif @test.edad.between?(84, 95) && @test.pi_comp > 3 then\n @g= \"El/la estudiante ha adquirido las habilidades de comparación de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Presentar al niño el juego “desapareciendo números”, el cual consiste en representar números del 1 al 10 como una escalera de bloques. Cada bloque puede representar un grupo de 10, de manera que los números implicados sean ahora el 10, 20, 30,... 100. Esto le permite al niño de manera gráfica saber “lo lejos” que están los números entre sí y permite calcular la distancia con facilidad. El siguiente paso supone considerar el conjunto global de números entre el 1 y el 100. Para esto se puede utilizar un metro. El niño tiene que llegar a valorar las distancias relativas entre varias posiciones en el metro. \n\"\n\nelsif @test.edad.between?(84, 95) && @test.pi_comp < 4 then\n @g = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de comparación de cantidades de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente. Puede ir incrementando los números para que la tarea sea más compleja para el estudiante o pedirle que diga dónde hay “menos”.\n\n* Presentar al niño el juego “desapareciendo números”, el cual consiste en representar números del 1 al 10 como una escalera de bloques. Cada bloque puede representar un grupo de 10, de manera que los números implicados sean ahora el 10, 20, 30,... 100. Esto le permite al niño de manera gráfica saber “lo lejos” que están los números entre sí y permite calcular la distancia con facilidad. \n\"\n\n\n# 96 a 101\n\nelsif @test.edad.between?(96, 101) && @test.pi_comp > 4 then\n @g= \"El/la estudiante ha adquirido las habilidades de comparación de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Presentar al niño el juego “desapareciendo números”, el cual consiste en representar números del 1 al 10 como una escalera de bloques. Cada bloque puede representar un grupo de 10, de manera que los números implicados sean ahora el 10, 20, 30,... 100. Esto le permite al niño de manera gráfica saber “lo lejos” que están los números entre sí y permite calcular la distancia con facilidad. El siguiente paso supone considerar el conjunto global de números entre el 1 y el 100. Para esto se puede utilizar un metro. El niño tiene que llegar a valorar las distancias relativas entre varias posiciones en el metro. \n\"\n\n\nelsif @test.edad.between?(96, 101) && @test.pi_comp < 5 then\n @g = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de comparación de cantidades de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Presentar al niño tareas de comparación de conjuntos de objetos y pedirle que diga dónde hay “más”. Una vez que el estudiante ha practicado durante un tiempo se debe prescindir de los objetos y plantear la tarea oralmente. Puede ir incrementando los números para que la tarea sea más compleja para el estudiante o pedirle que diga dónde hay “menos”.\n\n* Presentar al niño el juego “desapareciendo números”, el cual consiste en representar números del 1 al 10 como una escalera de bloques. Cada bloque puede representar un grupo de 10, de manera que los números implicados sean ahora el 10, 20, 30,... 100. Esto le permite al niño de manera gráfica saber “lo lejos” que están los números entre sí y permite calcular la distancia con facilidad. \n\"\n \nend\n\n\n\n\n# Cálculo Informal \n\n# 60 a 65\n\nif @test.edad.between?(60, 65) && @test.pi_cal > 3 then\n @h= \"El/la estudiante ha adquirido las habilidades de cálculo informal por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Deben aprender que contar es un buen método para sumar y después aprenderán la manera eficaz de hacerlo. Una vez dominado esto, hay que intentar que entienda que no es necesario contar todos los objetos. Es más eficaz contar a partir del número mayor. Una vez logrado esto, se puede retirar el material concreto y animar al niño a realizar la actividad mentalmente.\n\"\n\nelsif @test.edad.between?(60, 65) && @test.pi_cal.between?(2, 3) then\n @h = \"El/la estudiante ha adquirido las habilidades de cálculo informal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Las sumas pueden plantearse como historias sencillas, pero poniendo énfasis en que lo principal es la suma. Si la historia es sobre un niño que empieza con manzanas y consigue una más, debe enfatizarse que no es un asunto de cómo son las manzanas, sino que empieza con 2 cosas y se añade una más. También es importante que el niño aprenda que puede usar material concreto para resolver el problema. Cada bloque, dedo o ficha representa un objeto de la historia; después puede contar los objetos para hallar la solución. \n\n* El objetivo es demostrar al niño el uso del conteo en la resolución de problemas de suma. Es decir, primero deben aprender que contar es un buen método para sumar y después aprenderán la manera eficaz de hacerlo. Una vez logrado esto, se puede retirar el material concreto y animar al niño a realizar la actividad mentalmente. \n\"\n\nelsif @test.edad.between?(60, 65) && @test.pi_cal < 2 then\n @h = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de cálculo informal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Hacer que el niño cuente todos los objetos reales para sumar o restar. Por ejemplo, se le puede mostrar una colección de 3 carros y otra colección de 4 carros, y pedirle que las sume contando los carros para averiguar cuántos hay en total. También se le puede mostrar los 4 carros de una colección y pedirle que quite 1, y que después cuente para averiguar cuántos quedan. Poco a poco, y a medida que el niño vaya logrando algunos éxitos, se puede empezar a esconder uno de los conjuntos, y pedirle que haga la suma o la resta sin mirar ese conjunto.\n\n* Las sumas pueden plantearse como historias sencillas, pero poniendo énfasis en que lo principal es la suma. Si la historia es sobre un niño que empieza con manzanas y consigue una más, debe enfatizarse que no es un asunto de cómo son las manzanas, sino que empieza con 2 cosas y se añade una más. También es importante que el niño aprenda que puede usar material concreto para resolver el problema. Cada bloque, dedo o ficha representa un objeto de la historia; después puede contar los objetos para hallar la solución. \n\"\n\n\n# 66 a 71\n\nelsif @test.edad.between?(66, 71) && @test.pi_cal > 4 then\n @h= \"El/la estudiante ha adquirido las habilidades de cálculo informal por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Deben aprender que contar es un buen método para sumar y después aprenderán la manera eficaz de hacerlo. Una vez dominado esto, hay que intentar que entienda que no es necesario contar todos los objetos. Es más eficaz contar a partir del número mayor. Una vez logrado esto, se puede retirar el material concreto y animar al niño a realizar la actividad mentalmente.\n\"\n\nelsif @test.edad.between?(66, 71) && @test.pi_cal.between?(3, 4) then\n @h = \"El/la estudiante ha adquirido las habilidades de cálculo informal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Las sumas pueden plantearse como historias sencillas, pero poniendo énfasis en que lo principal es la suma. Si la historia es sobre un niño que empieza con manzanas y consigue una más, debe enfatizarse que no es un asunto de cómo son las manzanas, sino que empieza con 2 cosas y se añade una más. También es importante que el niño aprenda que puede usar material concreto para resolver el problema. Cada bloque, dedo o ficha representa un objeto de la historia; después puede contar los objetos para hallar la solución. \n\n* El objetivo es demostrar al niño el uso del conteo en la resolución de problemas de suma. Es decir, primero deben aprender que contar es un buen método para sumar y después aprenderán la manera eficaz de hacerlo. Una vez logrado esto, se puede retirar el material concreto y animar al niño a realizar la actividad mentalmente. \n\"\n\nelsif @test.edad.between?(66, 71) && @test.pi_cal < 3 then\n @h = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de cálculo informal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Hacer que el niño cuente todos los objetos reales para sumar o restar. Por ejemplo, se le puede mostrar una colección de 3 carros y otra colección de 4 carros, y pedirle que las sume contando los carros para averiguar cuántos hay en total. También se le puede mostrar los 4 carros de una colección y pedirle que quite 1, y que después cuente para averiguar cuántos quedan. Poco a poco, y a medida que el niño vaya logrando algunos éxitos, se puede empezar a esconder uno de los conjuntos, y pedirle que haga la suma o la resta sin mirar ese conjunto.\n\n* Las sumas pueden plantearse como historias sencillas, pero poniendo énfasis en que lo principal es la suma. Si la historia es sobre un niño que empieza con manzanas y consigue una más, debe enfatizarse que no es un asunto de cómo son las manzanas, sino que empieza con 2 cosas y se añade una más. También es importante que el niño aprenda que puede usar material concreto para resolver el problema. Cada bloque, dedo o ficha representa un objeto de la historia; después puede contar los objetos para hallar la solución. \n\"\n\n\n# 72 a 77 \n\nelsif @test.edad.between?(72, 77) && @test.pi_cal > 4 then\n @h= \"El/la estudiante ha adquirido las habilidades de cálculo informal por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Para ayudar al niño a realizar sumas mentales, primero se debe empezar por resolver la tarea de suma con material manipulable concreto, como bloques, fichas o dedos, de forma que el niño pueda contar objetos para obtener la solución. Hay que intentar que entienda que no es necesario contar todos los objetos. Es más eficaz contar a partir del número mayor. Una vez que lo haya superado, se retira el material concreto y la tarea debe realizarse de forma mental.\n\"\n\nelsif @test.edad.between?(72, 77) && @test.pi_cal = 4 then\n @h = \"El/la estudiante ha adquirido las habilidades de cálculo informal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Para ayudar al niño a realizar sumas mentales, primero se debe empezar por resolver la tarea de suma con material manipulable concreto, como bloques, fichas o dedos, de forma que el niño pueda contar objetos para obtener la solución. Hay que intentar que entienda que no es necesario contar todos los objetos. Es más eficaz contar a partir del número mayor. Una vez que lo haya superado, se retira el material concreto y la tarea debe realizarse de forma mental.\n\"\n\nelsif @test.edad.between?(72, 77) && @test.pi_cal < 4 then\n @h = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de cálculo informal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Las sumas pueden plantearse como historias sencillas, pero poniendo énfasis en que lo principal es la suma. Si la historia es sobre un niño que empieza con manzanas y consigue una más, debe enfatizarse que no es un asunto de cómo son las manzanas, sino que empieza con 2 cosas y se añade una más. También es importante que el niño aprenda que puede usar material concreto para resolver el problema. Cada bloque, dedo o ficha representa un objeto de la historia; después puede contar los objetos para hallar la solución. \n\n* El objetivo es demostrar al niño el uso del conteo en la resolución de problemas de suma. Es decir, primero deben aprender que contar es un buen método para sumar y después aprenderán la manera eficaz de hacerlo. Una vez logrado esto, se puede retirar el material concreto y animar al niño a realizar la actividad mentalmente. \n\"\n\n\n# 78 a83\n\nelsif @test.edad.between?(78, 83) && @test.pi_cal > 3 then\n @h= \"El/la estudiante ha adquirido las habilidades de cálculo informal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Para ayudar al niño a realizar sumas mentales, primero se debe empezar por resolver la tarea de suma con material manipulable concreto, como bloques, fichas o dedos, de forma que el niño pueda contar objetos para obtener la solución. Hay que intentar que entienda que no es necesario contar todos los objetos. Es más eficaz contar a partir del número mayor. Una vez que lo haya superado, se retira el material concreto y la tarea debe realizarse de forma mental.\n\"\n\n\nelsif @test.edad.between?(78, 83) && @test.pi_cal < 4 then\n @h = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de cálculo informal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Las sumas pueden plantearse como historias sencillas, pero poniendo énfasis en que lo principal es la suma. Si la historia es sobre un niño que empieza con manzanas y consigue una más, debe enfatizarse que no es un asunto de cómo son las manzanas, sino que empieza con 2 cosas y se añade una más. También es importante que el niño aprenda que puede usar material concreto para resolver el problema. Cada bloque, dedo o ficha representa un objeto de la historia; después puede contar los objetos para hallar la solución. \n\n* El objetivo es demostrar al niño el uso del conteo en la resolución de problemas de suma. Es decir, primero deben aprender que contar es un buen método para sumar y después aprenderán la manera eficaz de hacerlo. Una vez logrado esto, se puede retirar el material concreto y animar al niño a realizar la actividad mentalmente. \n\"\n\n\n\n\n# 84 a 101\n\nelsif @test.edad.between?(84, 101) && @test.pi_cal > 3 then\n @h= \"El/la estudiante ha adquirido las habilidades de cálculo informal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Practicar sumas y restas mentales con cantidades mayores. Una vez mejorado el cálculo mental les puede servir como base del escrito. Por ejemplo, supongamos que el niño resuelve un problema del tipo 16 + 12 pensando: “diez y diez son veinte, y seis y dos son ocho, la respuesta es veintiocho”. Sumando primero las decenas y después las unidades, están explotando las propiedades claves del sistema de base diez.\n\"\n\nelsif @test.edad.between?(84, 101) && @test.pi_cal < 4 then\n @h = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de cálculo informal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Para ayudar al niño a realizar sumas mentales, primero se debe empezar por resolver la tarea del cálculo con material manipulable concreto, como bloques, fichas o dedos, de forma que el niño pueda contar objetos para obtener la solución. Hay que intentar que entienda que no es necesario contar todos los objetos. Es más eficaz contar a partir del número mayor. Una vez que lo haya superado, se retira el material concreto y la tarea debe realizarse de forma mental. \n\n* Practicar sumas y restas mentales con diversas cantidades. Una vez mejorado el cálculo mental les puede servir como base del escrito. Por ejemplo, supongamos que el niño resuelve un problema del tipo 16 + 12 pensando: “diez y diez son veinte, y seis y dos son ocho, la respuesta es veintiocho”. Sumando primero las decenas y después las unidades, están explotando las propiedades claves del sistema de base diez.\n\"\n \nend\n\n\n\n\n# Convencionalismos\n\n# 60 a 71\n\nif @test.edad.between?(60, 71) && @test.pf_conv > 1 then\n @i= \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Proporcionar al niño práctica en la escritura de números. El niño puede aprender a escribir los números copiándolos de un cuaderno y libro. El niño disfrutará copiándolos y luego decorándolos con colores y motivos alegres y variados. Solo necesitan la oportunidad de dedicarse libremente a dibujar y copiar, sin la necesidad de una instrucción. \n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 18, el 1 de la izquierda indica “diez” y el 8 de la derecha indica “ocho”. \n\"\n\nelsif @test.edad.between?(60, 71) && @test.pf_conv < 2 then\n @i = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de lectura y escritura de cantidades de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Darle al niño la oportunidad de que vea los números dibujados en libros bonitos, así aprenderán a leerlos. Estos libros deben ser ilustrados, agradables y apropiados para niños pequeños. También se le puede presentar juegos en los que el niño tenga que leer los dígitos para, por ejemplos, avanzar su posición. \n\n* Proporcionar al niño práctica en la escritura de números. El niño puede aprender a escribir los números copiándolos de un cuaderno y libro. El niño disfrutará copiándolos y luego decorándolos con colores y motivos alegres y variados. Solo necesitan la oportunidad de dedicarse libremente a dibujar y copiar, sin la necesidad de una instrucción. \n\"\n\n\n# 72 a 77 \n\nelsif @test.edad.between?(72, 77) && @test.pf_conv > 4 then\n @i= \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 28, el 2 de la izquierda indica “veinte” y el 8 de la derecha indica “ocho”. \n\n* Pedirle al niño que con 2 dígitos construya el mayor número posible. Por ejemplo, dado el 2 y el 9, el niño puede escribir 29 o 92. \n\n* Una vez dominada la lectura y escritura de números con 2 dígitos, continuar con la lectura de números de 3 dígitos. El niño debe saber que la posición es crucial: los números que están a la derecha son las unidades, los que indican las decenas están al medio y los números que indican las centenas las que están a la izquierda. Así en 321, el 3 de la izquierda indica “trescientos”, el 2 del medio indica “veinte” y el 1 de la derecha indica “uno”. \n\n* Enseñar al niño con los errores que cometen otras personas. De esta manera, pueden ver que alguien escribe 200304 en lugar de 234 porque escriben los números como suenan. Normalmente resulta más fácil aprender del error cuando lo cometen otros. \n\"\n\nelsif @test.edad.between?(72, 77) && @test.pf_conv.between?(3, 4) then\n @i = \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 18, el 1 de la izquierda indica “diez” y el 8 de la derecha indica “ocho”. \n\"\n\nelsif @test.edad.between?(72, 77) && @test.pf_conv < 3 then\n @i = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de lectura y escritura de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Darle al niño la oportunidad de que vea los números dibujados en libros bonitos, así aprenderán a leerlos. Estos libros deben ser ilustrados, agradables y apropiados para niños pequeños. También se le puede presentar juegos en los que el niño tenga que leer los dígitos para, por ejemplos, avanzar su posición. \n\n* Proporcionar al niño práctica en la escritura de números. El niño puede aprender a escribir los números copiándolos de un cuaderno y libro. El niño disfrutará copiándolos y luego decorándolos con colores y motivos alegres y variados. Solo necesitan la oportunidad de dedicarse libremente a dibujar y copiar, sin la necesidad de una instrucción. \n\"\n\n\n# 78 a83\n\nelsif @test.edad.between?(78, 83) && @test.pf_conv > 5 then\n @i= \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 28, el 2 de la izquierda indica “veinte” y el 8 de la derecha indica “ocho”. \n\n* Pedirle al niño que con 2 dígitos construya el mayor número posible. Por ejemplo, dado el 2 y el 9, el niño puede escribir 29 o 92. \n\n* Una vez dominada la lectura y escritura de números con 2 dígitos, continuar con la lectura de números de 3 dígitos. El niño debe saber que la posición es crucial: los números que están a la derecha son las unidades, los que indican las decenas están al medio y los números que indican las centenas las que están a la izquierda. Así en 321, el 3 de la izquierda indica “trescientos”, el 2 del medio indica “veinte” y el 1 de la derecha indica “uno”. \n\n* Enseñar al niño con los errores que cometen otras personas. De esta manera, pueden ver que alguien escribe 200304 en lugar de 234 porque escriben los números como suenan. Normalmente resulta más fácil aprender del error cuando lo cometen otros. \n\"\n\nelsif @test.edad.between?(78, 83) && @test.pf_conv.between?(4, 5) then\n @i = \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 18, el 1 de la izquierda indica “diez” y el 8 de la derecha indica “ocho”. \n\"\n\nelsif @test.edad.between?(78, 83) && @test.pf_conv < 4 then\n @i = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de lectura y escritura de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Darle al niño la oportunidad de que vea los números dibujados en libros bonitos, así aprenderán a leerlos. Estos libros deben ser ilustrados, agradables y apropiados para niños pequeños. También se le puede presentar juegos en los que el niño tenga que leer los dígitos para, por ejemplos, avanzar su posición. \n\n* Proporcionar al niño práctica en la escritura de números. El niño puede aprender a escribir los números copiándolos de un cuaderno y libro. El niño disfrutará copiándolos y luego decorándolos con colores y motivos alegres y variados. Solo necesitan la oportunidad de dedicarse libremente a dibujar y copiar, sin la necesidad de una instrucción. \n\"\n\n\n# 84 a 89\n\nelsif @test.edad.between?(84, 89) && @test.pf_conv > 7 then\n @i= \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Una vez dominada la lectura y escritura de números con 2 dígitos, continuar con la lectura de números de 3 dígitos. El niño debe saber que la posición es crucial: los números que están a la derecha son las unidades, los que indican las decenas están al medio y los números que indican las centenas las que están a la izquierda. Así en 321, el 3 de la izquierda indica “trescientos”, el 2 del medio indica “veinte” y el 1 de la derecha indica “uno”. \n\n* Enseñar al niño con los errores que cometen otras personas. De esta manera, pueden ver que alguien escribe 200304 en lugar de 234 porque escriben los números como suenan. Normalmente resulta más fácil aprender del error cuando lo cometen otros. \n\n* Una vez dominada la lectura y escritura de números con 3 dígitos, continuar con la lectura de números de 3 dígitos siguiente los métodos descritos anteriormente. Nuevamente el niño debe saber que la posición es crucial: los números que están a la derecha de todo son las unidades, los que indican las decenas están justo a su izquierda, los números que indican las centenas están a la izquierda de las decenas y, por último, los números que indican los millares son los que están más a la izquierda. \n\"\n\nelsif @test.edad.between?(84, 89) && @test.pf_conv.between?(5, 7) then\n @i = \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 28, el 2 de la izquierda indica “veinte” y el 8 de la derecha indica “ocho”. \n\n* Pedirle al niño que con 2 dígitos construya el mayor número posible. Por ejemplo, dado el 2 y el 9, el niño puede escribir 29 o 92. \n\n* Una vez dominada la lectura y escritura de números con 2 dígitos, continuar con la lectura de números de 3 dígitos. El niño debe saber que la posición es crucial: los números que están a la derecha son las unidades, los que indican las decenas están al medio y los números que indican las centenas las que están a la izquierda. Así en 321, el 3 de la izquierda indica “trescientos”, el 2 del medio indica “veinte” y el 1 de la derecha indica “uno”. \n\n* Enseñar al niño con los errores que cometen otras personas. De esta manera, pueden ver que alguien escribe 200304 en lugar de 234 porque escriben los números como suenan. Normalmente resulta más fácil aprender del error cuando lo cometen otros. \n\"\n\nelsif @test.edad.between?(84, 89) && @test.pf_conv < 5 then\n @i = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de lectura y escritura de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 18, el 1 de la izquierda indica “diez” y el 8 de la derecha indica “ocho”. \n\"\n\n\n# 90 a 101\n\nelsif @test.edad.between?(90, 101) && @test.pf_conv > 5 then\n @i= \"El/la estudiante ha adquirido las habilidades de lectura y escritura de cantidades de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 28, el 2 de la izquierda indica “veinte” y el 8 de la derecha indica “ocho”. \n\n* Pedirle al niño que con 2 dígitos construya el mayor número posible. Por ejemplo, dado el 2 y el 9, el niño puede escribir 29 o 92. \n\n* Una vez dominada la lectura y escritura de números con 2 dígitos, continuar con la lectura de números de 3 dígitos. El niño debe saber que la posición es crucial: los números que están a la derecha son las unidades, los que indican las decenas están al medio y los números que indican las centenas las que están a la izquierda. Así en 321, el 3 de la izquierda indica “trescientos”, el 2 del medio indica “veinte” y el 1 de la derecha indica “uno”. \n\n* Enseñar al niño con los errores que cometen otras personas. De esta manera, pueden ver que alguien escribe 200304 en lugar de 234 porque escriben los números como suenan. Normalmente resulta más fácil aprender del error cuando lo cometen otros. \n\"\n\nelsif @test.edad.between?(90, 101) && @test.pf_conv < 6 then\n @i = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de lectura y escritura de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Ofrecer al niño varios juegos que le proporcionen práctica con la lectura de números. Primero se le debe incentivar a que lean números de un dígito (por ejemplo, en un libro o cuaderno), pero una vez dominado esto se le debe enseñar las reglas para leer números de 2 dígitos. El niño debe saber que la posición es crucial: los números que indican las unidades están a la derecha, los números que indican las decenas están a su izquierda. Así, en 18, el 1 de la izquierda indica “diez” y el 8 de la derecha indica “ocho”. \n\"\n \nend\n\n\n\n\n# Hechos Numéricos\n\n# 60 a 89\n\nif @test.edad.between?(60, 89) then\n @j= \"No se evalúa esta área para el rango de edad de su hijo/a.\"\n\n# 90 a 101\n\nelsif @test.edad.between?(90, 101) && @test.pf_hecho > 6 then\n @j= \"El/la estudiante ha adquirido las habilidades de realizar operaciones sencillas (suma, resta y multiplicación) sin necesidad de realizar el cálculo por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* En el caso de las restas como 10 - 3, la mejor técnica de solución es la estrategia de contar hacia atrás, es decir, comenzar en 10 y contar hacia atrás 3. También se le puede presentar al niño actividades para que capte la relación complementaria entre la suma y la resta. Esto puede encontrarse en la tabla de restar. Por ejemplo, si el niño mira la columna que muestra todos los números restados de 10, verá que los resultados van incrementándose en uno, consiguiendo al final la secuencia numérica:\no 10 - 10 = 0\no 10 - 9 = 1\no 10 - 8 = 2\no 10 - 7 = 3\no 10 - 6 = 4\no 10 - 5 = 5, y así sucesivamente. \n\n* En el caso de las sumas como 8 + 5, la estrategia más común es seguir contando a partir del número mayor (8 + 5 son “ocho, nueve, diez… trece”) o el uso de varios trucos como llegar hasta 10 y después añadir lo que falta contando (“8 + 5 son trece, porque ocho y dos son diez, y después con los tres que quedan son trece”). \n\n* En el caso de las multiplicaciones como N x 1, el patrón es fácil de ver y lleva al niño a la conclusión de que al multiplicar un número por uno, el resultado es ese mismo número. Esta regla se aplica a todos los números. También es importante darle al niño juegos con material concreto del concepto de multiplicación. Por ejemplo, puede ser útil la analogía de que 3x1 es como tener 3 canicas en una bolsa. Hay en total 3 canicas. La multiplicación 3x2 es como tener dos bolsas de 3 canicas, en total son 6 canicas y así sucesivamente. \n\n* En el caso de las multiplicaciones como N x 0, se puede utilizar un juego muy sencillo. Se trata de que el niño no meta nada en una bolsa, por ejemplo un gato de juguete, después debe mirar dentro de ella y asegurarse de que no hay ningún gato. Pedirle, a continuación, que haga lo mismo con otra bolsa y con otra: así se le da la oportunidad de ver, concretamente, que N x 0 es igual a 0. \n\n* En el caso de las multiplicaciones como 3 x 2, el niño puede descubrir el patrón: 3 x 2 es lo mismo que 3 + 3. Puede aprender que “multiplicar por dos” es lo mismo que sumar el mismo número dos veces o calcular el doble. Esta regla se aplica a todos los números. \n\"\n\nelsif @test.edad.between?(90, 101) && @test.pf_hecho.between?(4, 6) then\n @j = \"El/la estudiante ha adquirido las habilidades de realizar operaciones sencillas (suma, resta y multiplicación) sin necesidad de realizar el cálculo de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* En el caso de las sumas, como 3 + 4, la mejor estrategia de pensamiento es simplemente “seguir contando” desde el número mayor (“cuatro, cinco, seis y siete”). Este método les proporciona una estrategia útil para resolver problemas de suma cuando no recuerden los hechos numéricos correspondientes. Animar al niño a no adivinar las sumas en el caso de que no las sepan de memoria, sino animarlo a seguir contando. \n\n* En el caso de las multiplicaciones, como N x 1, el patrón es fácil de ver y lleva al niño a la conclusión de que al multiplicar un número por uno, el resultado es ese mismo número. Esta regla se aplica a todos los números. También es importante darle al niño juegos con material concreto del concepto de multiplicación. Por ejemplo, puede ser útil la analogía de que 3x1 es como tener 3 canicas en una bolsa. Hay en total 3 canicas. La multiplicación 3x2 es como tener dos bolsas de 3 canicas, en total son 6 canicas y así sucesivamente. \n\n* En el caso de las multiplicaciones como N x 0, se puede utilizar un juego muy sencillo. Se trata de que el niño no meta nada en una bolsa, por ejemplo un gato de juguete, después debe mirar dentro de ella y asegurarse de que no hay ningún gato. Pedirle, a continuación, que haga lo mismo con otra bolsa y con otra: así se le da la oportunidad de ver, concretamente, que N x 0 es igual a 0. \n\n* En el caso de las restas del tipo 2N - N, el patrón lleva a la conclusión de que la respuesta es la misma que el número que has quitado. Esta regla, después, se aplica a muchos números: aquellos en que la cantidad que se quita (el sustraendo) es la mitad de la cantidad de partida (minuendo), por ejemplo 6 - 3, 10 - 5, etc. También se le puede enseñar un juego con material concreto, utilizando objetos y una bolsa de plástico. Así, se introduce un número par de objetos en una bolsa, que previamente se ha dividido en dos partes (con una cinta adhesiva de un color, por ejemplo). Al niño se le muestra que el total se forma sumando las dos partes iguales. Además, se puede insistir en la relación inversa: si al total le quitamos una de las partes, nos queda la otra. También se le puede plantear ejercicios del tipo: \no 2 - 1 = 1 \no 4 - 2 = 2\no 6 - 3 = 3 \no 8 - 4 = 4\no ¿Cuál es el siguiente?\n\"\n\nelsif @test.edad.between?(90, 101) && @test.pf_hecho < 4 then\n @j = \"El/la estudiante se encuentra en proceso de adquirir las habilidades de realizar operaciones sencillas (suma, resta y multiplicación) sin necesidad de realizar el cálculo de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n* Enseñar al niño que en hechos numéricos como 2 - 2 (dos menos dos), se puede observar que si se resta un número de sí mismo el resultado es “cero”. El patrón es fácil y esta regla se aplica a todos los números. \n\n* En el caso de las sumas, como 3 + 4, la mejor estrategia de pensamiento es simplemente “seguir contando” desde el número mayor (“cuatro, cinco, seis y siete”). Este método les proporciona una estrategia útil para resolver problemas de suma cuando no recuerden los hechos numéricos correspondientes. Animar al niño a no adivinar las sumas en el caso de que no las sepan de memoria, sino animarlo a seguir contando. \n\"\n \nend\n\n\n\n# Cálculo FORMAL \n\n# 60 a 89\n\nif @test.edad.between?(60, 89) then\n @k= \"No se evalúa esta área para el rango de edad de su hijo/a.\"\n\n\n# 90 a 95\n\nelsif @test.edad.between?(90, 95) && @test.pi_comp > 5 then\n @k= \"El/la estudiante ha adquirido las habilidades de cálculo formal por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Ofrecer diferentes experiencias con el sistema decimal, puede hacer uso también de material concreto. Recordar que el sistema decimal es básico en la aritmética elemental pues es la base de la escritura de los números.\n\n* Si el niño presenta dificultades con el algoritmo de la resta escrita con “llevadas” es importante trabajar con materiales concretos (como el material multibase o regletas de Cuissinaire) con el fin de desarrollar una comprensión básica del método estándar. \n\n* Inventar problemas retadores con los niños de tal manera que se necesite hacer cálculos de suma o resta de forma escrita para resolverlos.\n\"\n\nelsif @test.edad.between?(90, 95) && @test.pi_comp.between?(2, 5) then\n @k = \"El/la estudiante ha adquirido las habilidades de cálculo formal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Fomentar la comprensión del valor posicional, el estudiante necesita aprender por qué los números han de ser alineados, para operar desde la derecha. Es recomendable enseñar el algoritmo estándar mediante actividades manipulativas.\n\n* Fomentar la comprensión del método, y no solo abordar de forma mecánica la resolución de la cuenta con la simple aplicación del algoritmo. Preguntar al niño cómo está realizando sus operaciones y por qué lo hace de esa forma.\n\n* Ofrecer diferentes experiencias con el sistema decimal mediante el trabajo con material concreto. Recordar que el sistema decimal es básico en la aritmética elemental pues es la base de la escritura de los números.\n\n* Inventar problemas con los niños de tal manera que se necesite hacer cálculos de suma o resta de forma escrita para resolverlos.\n\"\n\nelsif @test.edad.between?(90, 95) && @test.pi_comp < 2 then\n @k = \"El/la estudiante se encuentra en proceso de adquirir las habilidades cálculo formal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Fomentar la comprensión del valor posicional, el estudiante necesita aprender por qué los números han de ser alineados, para operar desde la derecha. Es recomendable enseñar el algoritmo estándar mediante actividades manipulativas.\n\n* Emplear juegos con material concreto para enseñar la suma y resta de 10 desde una decena. Se pueden usar cubitos (o palitos) unidos para formar las decenas y luego sumar o restar decenas con estos materiales.\n\n* Inventar problemas sencillos con los niños de tal manera que se necesite hacer cálculos de suma o resta de forma escrita para resolverlos.\n\"\n\n\n# 96 a 101\n\nelsif @test.edad.between?(96, 101) && @test.pi_comp > 7 then\n @k= \"El/la estudiante ha adquirido las habilidades de cálculo formal por encima de lo esperado para la edad que posee.\nAlgunas recomendaciones para practicar lo aprendido y/o generar nuevos aprendizajes:\n\n\n* Ofrecer diferentes experiencias con el sistema decimal, puede hacer uso también de material concreto. Recordar que el sistema decimal es básico en la aritmética elemental pues es la base de la escritura de los números.\n\n* Si el niño presenta dificultades con el algoritmo de la resta escrita con “llevadas” es importante trabajar con materiales concretos (como el material multibase o regletas de Cuissinaire) con el fin de desarrollar una comprensión básica del método estándar. \n\n* Inventar problemas retadores con los niños de tal manera que se necesite hacer cálculos de suma o resta de forma escrita para resolverlos.\n\"\n\nelsif @test.edad.between?(96, 101) && @test.pi_comp.between?(5, 7) then\n @k = \"El/la estudiante ha adquirido las habilidades de cálculo formal de acuerdo a lo esperado para su edad.\nAlgunas recomendaciones para mejorar lo aprendido:\n\n\n* Fomentar la comprensión del valor posicional, el estudiante necesita aprender por qué los números han de ser alineados, para operar desde la derecha. Es recomendable enseñar el algoritmo estándar mediante actividades manipulativas.\n\n* Fomentar la comprensión del método, y no solo abordar de forma mecánica la resolución de la cuenta con la simple aplicación del algoritmo. Preguntar al niño cómo está realizando sus operaciones y por qué lo hace de esa forma.\n\n* Ofrecer diferentes experiencias con el sistema decimal mediante el trabajo con material concreto. Recordar que el sistema decimal es básico en la aritmética elemental pues es la base de la escritura de los números.\n\n* Inventar problemas con los niños de tal manera que se necesite hacer cálculos de suma o resta de forma escrita para resolverlos.\n\"\n\nelsif @test.edad.between?(96, 101) && @test.pi_comp < 5 then\n @k = \"El/la estudiante se encuentra en proceso de adquirir las habilidades cálculo formal de acuerdo a lo esperado para la edad que posee.\nAlgunas recomendaciones para apoyar al estudiante:\n\n\n* Fomentar la comprensión del valor posicional, el estudiante necesita aprender por qué los números han de ser alineados, para operar desde la derecha. Es recomendable enseñar el algoritmo estándar mediante actividades manipulativas.\n\n* Emplear juegos con material concreto para enseñar la suma y resta de 10 desde una decena. Se pueden usar cubitos (o palitos) unidos para formar las decenas y luego sumar o restar decenas con estos materiales.\n\n* Inventar problemas sencillos con los niños de tal manera que se necesite hacer cálculos de suma o resta de forma escrita para resolverlos.\n\"\n \nend\n \n end",
"def discursarnolocal(pessoa, lugar)\n \"#{pessoa} discursou no #{lugar}\"\nend",
"def ligar #iniciando o método ligar\n puts 'O carro está ligado...' #imprime na tela a ação do método\n end",
"def affichage_bienvenue\nputs\"------------------------------------------------\n|Bienvenue sur 'ILS VEULENT TOUS MA POO' ! |\n|Le but du jeu est d'être le dernier survivant !|\n-------------------------------------------------\"\nend",
"def recuperationEtape()\n\t\tstring=@techniqueObjet.etape(@etapeEnCours)\n\t\t@texteContenu.set_text(string)\n\tend",
"def recuperationEtape()\n\t\tstring=@techniqueObjet.etape(@etapeEnCours)\n\t\t@texteContenu.set_text(string)\n\tend",
"def skier_quest; end",
"def show_rename_choice\n PFM::Text.set_pkname(@pokemon, 0)\n choice = display_message(text_get(36, 39), 1, text_get(11, 27), text_get(11, 28))\n return unless choice == 0 # No\n Graphics.freeze\n @pokemon.given_name = GamePlay::NameInput.new(@pokemon.given_name, 12, @pokemon).main.return_name\n end",
"def show\n \tputs \"Entré a shoow\"\n \t@rda = Rda.find(params[:id])\n \t@programas = Programa.all\n \t@flag = 1 # Para marcar una diferencia entre quien invoca al form_html\n end",
"def show\n #Hicbir sey yazmasa da olur!!!\n setComment\n end",
"def unsichtbar_machen\n loeschen()\n @sichtbar = false \n end",
"def saludanombre(nombre)\n\tputs \"Estimado Señor #{nombre}\"\nend",
"def harga(buah) # Dapat dilihat bahwa harga sebuah method dan buah sebagai parameter sebuah template pada variabel\n puts \"Mas buah #{buah} ini dijual?\"\nend",
"def final_menu\n puts \"\"\n puts \"\"\n puts \"Que veux tu faire ?\"\n puts \"\"\n puts \"\\u{1F3B2} on prend les mêmes et on recommence : 1\"\n puts \"\\u{1F3AE} on repart de zéro avec des nouveaux joueurs : 2\"\n puts \"\\u{1F914} sinon pour patienter le temps que tu réfléchisses je peux te proposer une citation ! : 3\"\n puts \"\\u{1F480} bye bye on ferme : 4\"\n puts \"\"\n print \">> \"\n final_answer = gets.chomp.to_i\n end",
"def show\n @titulo = \"Ver Pedido\"\n @clase = \"Pedidos\"\n end",
"def Com1\n @type = \"Texte\"\n @commande_window.deactivate\n if console_texte\n @x = 0\n @y = 0\n @commande_window.hide\n @window_command_command = Window_CommandTextSelect.new(@texte,@x,@y)\n @window_command_command.set_handler(:CT1, method(:ComText1))\n @window_command_command.set_handler(:CT2, method(:ComText2))\n @window_command_command.set_handler(:CT3, method(:ComText3))\n @window_command_command.set_handler(:cancel, method(:ComText4))\n @window_command_command.activate\n else\n @commande_window.activate\n end\n end",
"def show\r\n checar_egresso_empresa_super\r\n end",
"def cb_charged\n if combo_main.active==0 then\n cb_newPark\n else\n #Vidage des frames\n framePan.each{|child| framePan.remove(child)}\n framePar.each{|child| framePar.remove(child)}\n\n #Recuperation des vues panneau et parking utile\n nomPark =self.combo_main.active_text\n builder.get_object(\"label_nomPark1\").text=nomPark\n vues=self.ctrl.get_park_views nomPark #Recup des \n\n #Ajout des vues\n framePar.add_child(builder,vues[0],nil)\n framePan.add_child(builder,vues[1],nil)\n\n #Mise a jour des info du parking affichés\n _change_park_property(self.ctrl.get_park_info nomPark)\n end\n #Show all\n @window.show_all\n end",
"def dish; end",
"def multiples_facturas_confirmar_parciales\n @width_layout=1180\n @form_title = I18n.t('Sistema.Body.Modelos.OrdenDespachoDetalle.Mensajes.orden_despacho_insumos') \n @form_title_record = I18n.t('Sistema.Body.Modelos.OrdenDespachoDetalle.Mensajes.orden_despacho_insumo') \n end",
"def show_correct\n para \"Correct\"\n end",
"def hide_name\n str = \" utente Fiscosport n° \" + self.id.to_s\n if self.comune_id && self.comune\n str += \" - prov. di \" + self.comune.province.name + \" (\" + self.comune.province.sigla + \")\" unless self.comune.province.nil?\n end\n return (str.nil? || str.blank?) ? \"-\" : str\n end",
"def show_admin_menu\n puts \"-\"*80\n puts \"¿Que deseas hacer?\"\n puts \"-\"*80\n puts \"1) Mostrar todos los vuelos\"\n puts \"2) Mostrar todas las reservaciones\"\n puts \"3) Agrega un vuelo\"\n puts \"4) Salir\"\n # puts \"5) Borrar vuelos\"\n # puts \"6) Borrar reservaciones\"\n\n puts \n puts \"Selecciona opción:\"\n input = gets.chomp\n input\n end",
"def menu\n puts '1) Promedio de notas'\n puts '2) Inasistencia alumnos'\n puts '3) Alumnos aprobados'\n puts '4) Salir'\nend",
"def lancementInscription\n\t\t@@fenetre.changerWidget(HudInscription.new)\n\t\tself\n\tend",
"def pantallaEstrategias nombre\n\t\t\n\t\t# Esr¿trategia a escoger por el usuario\n\t\testrategia = \"\"\n\t\t\n\t\t# Limpiamos pantalla\n\t\t@app.clear\n\t\t@app.background \"fondo.jpg\"\n\n\t\t# stack de botones\n\t\t@estrategias = @app.stack :top => \"130\", :left => \"400\"\n\t\t\n\t\t@estrategias.caption \"Jugador #{nombre}\"\n\t\t@estrategias.caption \"Escoge una estrategia de juego\"\n\t\t\n\t\t# Estrategia manual\n\t\t@manual = @estrategias.button \"Manual\"\n\t\t@manual.click do\n\t\t\testrategia = \"manual\"\n\t\t\tif (nombre == \"1\")\n\t\t\t\t@s1 = estrategia\n\t\t\telse\n\t\t\t\t@s2 = estrategia\n\t\t\tend\n\t\tend\n\n\t\t# EStrategia uniforme\n\t\t@uni = @estrategias.button \"Uniforme\"\n\t\t@uni.click do\n\t\t\testrategia = \"uniforme\"\n\t\t\tif (nombre == \"1\")\n\t\t\t\t@s1 = estrategia\n\t\t\telse\n\t\t\t\t@s2 = estrategia\n\t\t\tend\n\t\tend\n\n\t\t# Estrategia sesgada\n\t\t@ses = @estrategias.button \"Sesgada\"\n\t\t@ses.click do\n\t\t\testrategia = \"sesgada\"\n\t\t\tif (nombre == \"1\")\n\t\t\t\t@s1 = estrategia\n\t\t\telse\n\t\t\t\t@s2 = estrategia\n\t\t\tend\n\t\tend\n\n\t\t# Estrategia copiar\n\t\t@copiar = @estrategias.button \"Copiar\"\n\t\t@copiar.click do\n\t\t\testrategia = \"copiar\"\n\t\t\tif (nombre == \"1\")\n\t\t\t\t@s1 = estrategia\n\t\t\telse\n\t\t\t\t@s2 = estrategia\n\t\t\tend\n\t\tend\n\n\t\t# Estrategia pensar\n\t\t@pensar = @estrategias.button \"Pensar\"\n\t\t@pensar.click do\n\n\t\t\testrategia = \"pensar\"\n\t\t\tif (nombre == \"1\")\n\t\t\t\t@s1 = estrategia\n\t\t\telse\n\t\t\t\t@s2 = estrategia\n\t\t\tend\n\t\tend\n\n\t\t\n\t\t\n\tend",
"def menu\n\tputs \"Quelle action veux-tu effectuer?\"\n\tputs \"\\n\"\n\tputs \"a - chercher une meilleure arme\"\n\tputs \"s - chercher à se soigner\"\n\tputs \"\\n\"\n\tputs \"attaquer un joueur en vue :\"\n\ti = 0\n\tenemies_in_sight.each do |enemy|\n\t\ti +=1\n\t\tputs \"#{i} - #{enemy.name} a #{enemy.life_points} points de vie.\"\n\tend\n\tputs \"Fais ton choix\"\n\tprint \">\"\n\tend",
"def ask(what, title)\n @dialog.title = \"\\\"#{title}\\\"\"\n \n res = @dialog.inputbox(\"'#{what}'\")\n \n raise CancelPressed.new unless res\n \n res\n end",
"def preencher(nome,data1,string,string2,data2, string3, string4, string8,descriao,status,related)\n tarefa_nova.set(nome)\n select string8, from: 'priority'\n descricao_bug.set(descriao) \n select status, from: 'status'\n find('#parent_type').find(\"option[value='\"+related+\"']\").select_option\n sleep 2\n savagem.click\n sleep 2 \n end",
"def sonido()\n return super << \" miaaauuu\"\n end"
] |
[
"0.6203741",
"0.6133549",
"0.5861024",
"0.5836665",
"0.5835097",
"0.5835097",
"0.58041936",
"0.5749358",
"0.5744608",
"0.5663621",
"0.56408346",
"0.5613051",
"0.556924",
"0.5554364",
"0.5528029",
"0.5527398",
"0.55240047",
"0.5521133",
"0.5511275",
"0.5509028",
"0.5507135",
"0.54824936",
"0.5470859",
"0.5468812",
"0.5457295",
"0.5450336",
"0.54379046",
"0.5419563",
"0.5415793",
"0.5415793",
"0.5415793",
"0.5415103",
"0.541381",
"0.5384336",
"0.53725266",
"0.5365843",
"0.5365843",
"0.5363441",
"0.5350236",
"0.5347623",
"0.5346024",
"0.53275836",
"0.5317212",
"0.53028965",
"0.5297141",
"0.52742654",
"0.52730066",
"0.5268176",
"0.5263583",
"0.52610534",
"0.52521515",
"0.5245572",
"0.5240781",
"0.5234003",
"0.52302426",
"0.5224713",
"0.5223654",
"0.5217114",
"0.5211215",
"0.5202304",
"0.51963395",
"0.5195496",
"0.51898",
"0.5188013",
"0.5187327",
"0.5185224",
"0.5179375",
"0.51748854",
"0.5173567",
"0.516309",
"0.5158358",
"0.5151957",
"0.5144845",
"0.51441026",
"0.5133511",
"0.5133477",
"0.5133477",
"0.5130909",
"0.51234037",
"0.51220614",
"0.5114941",
"0.5109575",
"0.51079804",
"0.5107255",
"0.5102849",
"0.50998306",
"0.5099711",
"0.5097967",
"0.5096003",
"0.50905716",
"0.50879234",
"0.50854266",
"0.50837547",
"0.5080014",
"0.5072548",
"0.5068537",
"0.5067057",
"0.5064729",
"0.50520253",
"0.503965",
"0.50389874"
] |
0.0
|
-1
|
Erstes Anmelden an DB
|
def set_database
# Test auf Lesbarkeit von X$-Tabellen
def x_memory_table_accessible?(table_name_suffix, msg)
begin
sql_select_all "SELECT /* Panorama Tool Ramm */ * FROM X$#{table_name_suffix} WHERE RowNum < 1"
return true
rescue Exception => e
msg << "<div>#{t(:env_set_database_xmem_line1, :user=>get_current_database[:user], :table_name_suffix=>table_name_suffix, :default=>'DB-User %{user} has no right to read on X$%{table_name_suffix} ! Therefore a very small number of functions of Panorama is not usable!')}<br/>"
msg << "<a href='#' onclick=\"jQuery('#xbh_workaround').show(); return false;\">#{t(:moeglicher, :default=>'possible')} workaround:</a><br/>"
msg << "<div id='xbh_workaround' style='display:none; background-color: lightyellow; padding: 20px;'>"
msg << "#{t(:env_set_database_xmem_line2, :default=>'Alternative 1: Connect with role SYSDABA')}<br/>"
msg << "#{t(:env_set_database_xmem_line3, :default=>'Alternative 2: Execute as user SYS')}<br/>"
msg << "> create view X_$#{table_name_suffix} as select * from X$#{table_name_suffix};<br/>"
msg << "> create public synonym X$#{table_name_suffix} for sys.X_$#{table_name_suffix};<br/>"
msg << t(:env_set_database_xmem_line4, :table_name_suffix=>table_name_suffix, :default=>'This way X$%{table_name_suffix} becomes available with role SELECT ANY DICTIONARY')
msg << "</div>"
msg << "</div>"
return false
end
end
def select_any_dictionary?(msg)
if sql_select_one("SELECT COUNT(*) FROM Session_Privs WHERE Privilege = 'SELECT ANY DICTIONARY'") == 0
msg << t(:env_set_database_select_any_dictionary_msg, :user=>get_current_database[:user], :default=>"DB-User %{user} doesn't have the grant 'SELECT ANY DICTIONARY'! Many functions of Panorama may be not usable!<br>")
false
else
true
end
end
write_to_client_info_store(:last_used_menu_controller, "env")
write_to_client_info_store(:last_used_menu_action, "set_database")
write_to_client_info_store(:last_used_menu_caption, "Login")
write_to_client_info_store(:last_used_menu_hint, t(:menu_env_set_database_hint, :default=>"Start of application after connect to database"))
current_database = params[:database].symbolize_keys # Puffern in lokaler Variable, bevor in client_info-Cache geschrieben wird
if params[:database][:modus] == 'tns' # TNS-Alias auswerten
tns_records = read_tnsnames # Hash mit Attributen aus tnsnames.ora für gesuchte DB
tns_record = tns_records[current_database[:tns]]
unless tns_record
respond_to do |format|
format.js {render :js => "$('#content_for_layout').html('#{j "Entry for DB '#{current_database[:tns]}' not found in tnsnames.ora"}'); $('#login_dialog').effect('shake', { times:3 }, 100);"}
end
set_dummy_db_connection
return
end
current_database[:host] = tns_record[:hostName] # Erweitern um Attribute aus tnsnames.ora
current_database[:port] = tns_record[:port] # Erweitern um Attribute aus tnsnames.ora
current_database[:sid] = tns_record[:sidName] # Erweitern um Attribute aus tnsnames.ora
current_database[:sid_usage] = tns_record[:sidUsage] # :SID oder :SERVICE_NAME
else # Host, Port, SID auswerten
current_database[:sid_usage] = :SID unless current_database[:sid_usage] # Erst mit SID versuchen, zweiter Versuch dann als ServiceName
current_database[:tns] = "#{current_database[:host]}:#{current_database[:port]}:#{current_database[:sid]}" # Evtl. existierenden TNS-String mit Angaben von Host etc. ueberschreiben
end
# Temporaerer Schutz des Produktionszuganges bis zur Implementierung LDAP-Autorisierung
if current_database[:host].upcase.rindex("DM03-SCAN") && current_database[:sid].upcase.rindex("NOADB")
if params[:database][:authorization]== nil || params[:database][:authorization]==""
respond_to do |format|
format.js {render :js => "$('#content_for_layout').html('#{j "zusätzliche Autorisierung erforderlich fuer NOA-Produktionssystem"}'); $('#login_dialog_authorization').show(); $('#login_dialog').effect('shake', { times:3 }, 100);"}
end
set_dummy_db_connection
return
end
if params[:database][:authorization]== nil || params[:database][:authorization]!="meyer"
respond_to do |format|
format.js {render :js => "$('#content_for_layout').html('#{j "Autorisierung '#{params[:database][:authorization]}' ungueltig fuer NOA-Produktionssystem"}'); $('#login_dialog').effect('shake', { times:3 }, 100);"}
end
set_dummy_db_connection
return
end
end
set_current_database(current_database) # Persistieren im Cache
current_database = nil # Diese Variable nicht mehr verwenden ab jetzt, statt dessen get_current_database verwenden
# First SQL execution opens Oracle-Connection
# Test der Connection und ruecksetzen auf vorherige wenn fehlschlaegt
begin
# Test auf Funktionieren der Connection
begin
sql_select_one "SELECT /* Panorama Tool Ramm */ SYSDATE FROM DUAL"
rescue Exception => e # 2. Versuch mit alternativer SID-Deutung
Rails.logger.error "Error connecting to database: URL='#{jdbc_thin_url}' TNSName='#{get_current_database[:tns]}' User='#{get_current_database[:user]}'"
Rails.logger.error e.message
Rails.logger.error 'Switching between SID and SERVICE_NAME'
database_helper_switch_sid_usage
begin
# Oracle-Connection aufbauen mit Wechsel zwischen SID und ServiceName
sql_select_one("SELECT /* Panorama Tool Ramm */ SYSDATE FROM DUAL") # Ruft implizit open_oracle_connection
rescue Exception => e # 3. Versuch mit alternativer SID-Deutung
Rails.logger.error "Error connecting to database: URL='#{jdbc_thin_url}' TNSName='#{get_current_database[:tns]}' User='#{get_current_database[:user]}'"
Rails.logger.error e.message
Rails.logger.error 'Error persists, switching back between SID and SERVICE_NAME'
database_helper_switch_sid_usage
# Oracle-Connection aufbauen mit Wechsel zurück zwischen SID und ServiceName, sql_select_all ruft implizit open_oracle_connection
sql_select_all "SELECT /* Panorama Tool Ramm */ SYSDATE FROM DUAL" # Provozieren der ursprünglichen Fehlermeldung wenn auch zweiter Versuch fehlschlägt
end
end
rescue Exception => e
set_dummy_db_connection
respond_to do |format|
format.js {render :js => "$('#content_for_layout').html('#{j "Fehler bei Anmeldung an DB: <br>
#{e.message}<br>
URL: '#{jdbc_thin_url}'<br>
Host: #{get_current_database[:host]}<br>
Port: #{get_current_database[:port]}<br>
SID: #{get_current_database[:sid]}"
}');
$('#login_dialog').effect('shake', { times:3 }, 100);
"
}
end
return # Fehler-Ausgang
end
set_current_database(get_current_database.merge({:database_name => ConnectionHolder.current_database_name})) # Merken interner DB-Name ohne erneuten DB-Zugriff
@dictionary_access_msg = "" # wird additiv belegt in Folge
@dictionary_access_problem = false # Default, keine Fehler bei Zugriff auf Dictionary
begin
@banners = [] # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable
@instance_data = [] # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable
@dbids = [] # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable
@platform_name = "" # Vorbelegung,damit bei Exception trotzdem valider Wert in Variable
# Einlesen der DBID der Database, gleichzeitig Test auf Zugriffsrecht auf DataDictionary
read_initial_db_values
@banners = sql_select_all "SELECT /* Panorama Tool Ramm */ Banner FROM V$Version"
@instance_data = sql_select_all ["SELECT /* Panorama Tool Ramm */ gi.*, i.Instance_Number Instance_Connected,
(SELECT n.Value FROM gv$NLS_Parameters n WHERE n.Inst_ID = gi.Inst_ID AND n.Parameter='NLS_CHARACTERSET') NLS_CharacterSet,
(SELECT n.Value FROM gv$NLS_Parameters n WHERE n.Inst_ID = gi.Inst_ID AND n.Parameter='NLS_NCHAR_CHARACTERSET') NLS_NChar_CharacterSet,
(SELECT p.Value FROM GV$Parameter p WHERE p.Inst_ID = gi.Inst_ID AND LOWER(p.Name) = 'cpu_count') CPU_Count,
d.Open_Mode, d.Protection_Mode, d.Protection_Level, d.Switchover_Status, d.Dataguard_Broker, d.Force_Logging,
ws.Snap_Interval_Minutes, ws.Snap_Retention_Days
FROM GV$Instance gi
JOIN v$Database d ON 1=1
LEFT OUTER JOIN v$Instance i ON i.Instance_Number = gi.Instance_Number
LEFT OUTER JOIN (SELECT DBID, MIN(EXTRACT(HOUR FROM Snap_Interval))*60 + MIN(EXTRACT(MINUTE FROM Snap_Interval)) Snap_Interval_Minutes, MIN(EXTRACT(DAY FROM Retention)) Snap_Retention_Days FROM DBA_Hist_WR_Control GROUP BY DBID) ws ON ws.DBID = ?
", get_dbid ]
@control_management_pack_access = sql_select_one "SELECT Value FROM V$Parameter WHERE name='control_management_pack_access'" # ab Oracle 11 belegt
@instance_data.each do |i|
if i.instance_connected
@instance_name = i.instance_name
@host_name = i.host_name
end
end
@dbids = sql_select_all ["SELECT s.DBID, MIN(Begin_Interval_Time) Min_TS, MAX(End_Interval_Time) Max_TS,
(SELECT MIN(DB_Name) FROM DBA_Hist_Database_Instance i WHERE i.DBID=s.DBID) DB_Name,
(SELECT COUNT(DISTINCT Instance_Number) FROM DBA_Hist_Database_Instance i WHERE i.DBID=s.DBID) Instances,
MIN(EXTRACT(MINUTE FROM w.Snap_Interval)) Snap_Interval_Minutes,
MIN(EXTRACT(DAY FROM w.Retention)) Snap_Retention_Days
FROM DBA_Hist_Snapshot s
LEFT OUTER JOIN DBA_Hist_WR_Control w ON w.DBID = s.DBID
GROUP BY s.DBID
ORDER BY MIN(Begin_Interval_Time)"]
@platform_name = sql_select_one "SELECT /* Panorama Tool Ramm */ Platform_name FROM v$Database" # Zugriff ueber Hash, da die Spalte nur in Oracle-Version > 9 existiert
rescue Exception => e
@dictionary_access_problem = true # Fehler bei Zugriff auf Dictionary
@dictionary_access_msg << "<div> User '#{get_current_database[:user]}' has no right for read on data dictionary!<br/>#{e.message}<br/>Functions of Panorama will not or not completely be usable<br/>
</div>"
end
@dictionary_access_problem = true unless select_any_dictionary?(@dictionary_access_msg)
@dictionary_access_problem = true unless x_memory_table_accessible?("BH", @dictionary_access_msg )
write_connection_to_last_logins
initialize_unique_area_id # Zaehler für eindeutige IDs ruecksetzen
timepicker_regional = ""
if get_locale == "de" # Deutsche Texte für DateTimePicker
timepicker_regional = "prevText: '<zurück',
nextText: 'Vor>',
monthNames: ['Januar','Februar','März','April','Mai','Juni', 'Juli','August','September','Oktober','November','Dezember'],
dayNamesMin: ['So','Mo','Di','Mi','Do','Fr','Sa'],
timeText: 'Zeit',
hourText: 'Stunde',
minuteText: 'Minute',
currentText: 'Jetzt',
closeText: 'Auswählen',"
end
respond_to do |format|
format.js {render :js => "$('#current_tns').html('#{j "<span title='TNS=#{get_current_database[:tns]},Host=#{get_current_database[:host]},Port=#{get_current_database[:port]},#{get_current_database[:sid_usage]}=#{get_current_database[:sid]}, User=#{get_current_database[:user]}'>#{get_current_database[:user]}@#{get_current_database[:tns]}</span>"}');
$('#main_menu').html('#{j render_to_string :partial =>"build_main_menu" }');
$.timepicker.regional = { #{timepicker_regional}
ampm: false,
firstDay: 1,
dateFormat: '#{timepicker_dateformat }'
};
$.timepicker.setDefaults($.timepicker.regional);
numeric_decimal_separator = '#{numeric_decimal_separator}';
var session_locale = '#{get_locale}';
$('#content_for_layout').html('#{j render_to_string :partial=> "env/set_database"}');
$('#login_dialog').dialog('close');
"
}
end
rescue Exception=>e
set_dummy_db_connection # Rückstellen auf neutrale DB
raise e
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def db; end",
"def db; end",
"def select(db); end",
"def select(db); end",
"def select_db(name)\n #This is a stub, used for indexing\n end",
"def orm; end",
"def getDB\n @db\n end",
"def select_db(db)\n query \"use #{db}\"\n self\n end",
"def db(*args)\n adapter = repository(:default).adapter\n args.first =~ /^select /i ? adapter.select(*args) : adapter.execute(*args)\n end",
"def db\n self.class.db\n end",
"def use_database(db)\n self.database = db\n end",
"def set_db\n @db = Db.find(params[:id])\n end",
"def db_info\n @conn.query({url_path: \"#{database}\", method: :get})\n end",
"def database\n @database ||= determine_database\n end",
"def flushdb; end",
"def db\n @db ||= find_or_create_database\n end",
"def db\n Doozer::Configs.db_conn\n end",
"def db\n Doozer::Configs.db_conn\n end",
"def db\n\t\tframework.db.active\n\tend",
"def database\n @@db\n end",
"def db\n @connection.pg rescue nil\n end",
"def db\n @db ||= Database.new\n end",
"def database\n @database\n end",
"def database\n @database\n end",
"def determine_database\n self.class.database \n end",
"def database\n \"--db='#{ name }'\"\n end",
"def database; datastore['DATABASE']; end",
"def update_db\n require \"#{File.dirname(__FILE__)}/../conf/db_schema.rb\"\n Knj::Db::Revision.new.init_db(\"debug\" => false, \"db\" => @db, \"schema\" => Openall_time_applet::DB_SCHEMA)\n end",
"def db\n @db ||= finder_result.connection\n end",
"def single_object_db; end",
"def database\n @database ||= self.class.database\n end",
"def set_DB()\n self.is_db = 1\n save()\n end",
"def flushdb\n end",
"def initialize( db )\n @db = db\n end",
"def database_name\n @dbi.db_name\n end",
"def database_name\n @dbi.db_name\n end",
"def db\n self.class.db\n end",
"def to_create_database_sql(db)\n db.send(:create_database_sql, self.name, {})\n end",
"def initialize(db)\n @db = db\n end",
"def initialize(db)\n @db = db\n end",
"def database\n \"--db='#{ name }'\" if name\n end",
"def create_db(database)\n @conn.query({url_path: database, method: :put})\n end",
"def initialize(db)\n @db = db\n end",
"def db\n collection.db\n end",
"def db\n collection.db\n end",
"def db\n collection.db\n end",
"def db\n @db == true ? TABLE : @db.try(:parameterize, separator: \"_\")\n end",
"def tes_load_db\n setup_clean_accounts\n Movements.create('any', '2013-01-01', 10, @cash, @income)\n\n SQLite.dbs_close_all\n Accounts.delete_all(true)\n SQLite.dbs_open_load\n\n Accounts.dump true\n end",
"def db\n framework.db.active\n end",
"def databases\n get '_all_dbs'\n end",
"def db\n self.config[:db]\n end",
"def db\n return self.class.db\n end",
"def db\n @db ||= new_connection\n end",
"def database\n database_name ? connection.db(database_name) : nil\n end",
"def get_db(dbname)\n Database.new(dbname, @socket, self)\n end",
"def setup_database\n Hanami::Model.load!\n end",
"def create_database!(name=nil)\n db = if name\n self.server.database!(db_name_with_prefix(name))\n else\n self.database!\n end\n create_rotation_filter(db)\n if self.respond_to?(:design_doc)\n design_doc.sync!(db)\n # or maybe this?:\n #self.design_docs.each do |design|\n # design.migrate(to_db)\n #end\n end\n return db\n end",
"def database\n Database.initialize_with(connection)\n end",
"def create_database(name)\n end",
"def _db\n @_db ||= Sequel::DATABASES.first || Sequel.sqlite\n end",
"def db\n \n ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n :database => \"prod1\",\n :user => \"root\",\n :password=>\"Sector@123\",\n :local_infile => true).connection()\n \n end",
"def db_path\n @db\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def database\n @database || self.class.database\n end",
"def [](db_name)\n DB.new(db_name, self, :logger => @logger)\n end",
"def db=(my_db)\n @db = my_db\n end",
"def db=(my_db)\n @db = my_db\n end",
"def use(args)\n @dbh.select_db(args[:db_name])\n end",
"def db_name\n data[:db_name]\n end",
"def database(value)\n update_query(:database => value)\n end",
"def database\n @database ||= Database.create # defaults to 'aqua' \n end",
"def no_database_error(exc)\n logger.error exc.message\n logger.error exc.backtrace.join(\"\\n\")\n Thread.current[:db_name] = 'soluzionipa_new' \n AuthHub::SpiderModel.establish_connection({})\n flash[:error] = \"Non è possibile gestire le configurazioni dell'ente!\"\n redirect_to auth_hub.dashboard_url\n end",
"def db_record\n db or MyBiaDJ::Table(:files)[:path => relative_path, :name => name.to_s]\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def db\n return @args[:db]\n end",
"def name\n @db_name\n end",
"def database(dbname=nil, &block)\n dbname ||= database_name\n if dbname then\n repository dbname, &block\n else\n yield\n end\n end",
"def database\n self.class.database\n end",
"def usable_with?(db)\n true\n end",
"def database=( db )\n db = Database.create( db ) if db.class == String\n @database = db\n end",
"def initialize(database)\r\n @database = database\r\n end",
"def database\n Jrodb::Database[:default]\n end",
"def hijack_db\n ActiveRecord::Base.establish_connection(\n :adapter => ENV['YAPTESTFE_DBTYPE'],\n :host => ENV['YAPTESTFE_DBIP'],\n :port => ENV['YAPTESTFE_DBPORT'].to_i,\n :username => ENV['YAPTESTFE_DBUSER'],\n :password => ENV['YAPTESTFE_DBPASS'],\n :database => ENV['YAPTESTFE_DBNAME']\n ) \n begin # catch db connection errors\n if not ActiveRecord::Base.connection.active?\n render :template => 'help/dberror', :layout => false\n end\n rescue PGError => msg\n logger.info \"DBERROR: #{msg}\"\n render :template => 'help/dberror', :layout => false\n end\n end",
"def get_budgets(db)\r\n budgets = db.execute(\"SELECT * FROM budgets\")\r\nend",
"def get_database\n\t\tdb = Mysql2::Client(:host => 'localhost',:user => 'root',:password => 'abcd0311')\n\n\t\tbegin\n\t\t\tdb.query(\"DROP DATABASE #{@month}_#{@year}_clients\")\n\t\t\tdb.query(\"CREATE DATABASE #{@month}_#{@year}_clients\")\n\t\trescue Exception => e\n\t\t\tdb.query(\"CREATE DATABASE #{@month}_#{@year}_clients\")\n\t\tend\n\n\t\tdb.query(\"USE #{@month}_#{@year}_clients\")\n\t\tdb.query(\"CREATE TABLE users(cID integer, name varchar(50), address varchar(50), prov varchar(50), postal varchar(50), email varchar(50), cost float);\")\n\t\tdb\n\tend",
"def appDB\n appEM.db\nend",
"def reinitialize_db\n drop_db\n initialize_db\n end",
"def all_dbs\n @conn.query({url_path: \"_all_dbs\", method: :get})\n end",
"def database! name\n create_db(name) rescue nil\n database name\n end",
"def db_adder(database, year, variety, region, notes)\n database.execute(\"INSERT INTO wine_cellar (year,variety,region,notes) VALUES (?,?,?,?)\", [year,variety,region,notes])\nend",
"def database\n @database || self.class.database\n end",
"def db(db_name, options={})\n DB.new(db_name, self, options.merge(:logger => @logger))\n end",
"def open\n create_database\n end",
"def database(args={})\n args[:connection_name] = @connection_name unless args.has_key?(:connection_name)\n req(:required => [:db_name],\n :args_object => args)\n data = {}\n dbh = Mysqladmin::Exec.new(:connection_name => args[:connection_name])\n dbh.use(args[:db_name])\n dbh.list_tables.each do |table_name|\n data[table_name] = table(:table_name => args[:table_name], :db_name => args[:db_name], :connection_name => args[:connection_name])\n end\n return data\n end",
"def db(options = {})\n @_sequelizer_db ||= new_db(options)\n end",
"def openDB\n db =Rho::Database.new(Rho::Application.databaseFilePath('local'), \"local\");\n puts \"#{db.to_s}\"\n data = db\n data\n end",
"def get_db\n db = SQLite3::Database.new 'BarberShop.db'\n db.results_as_hash = true\n return db\n end",
"def create_db_cmd!\n \"createdb -e #{new_db_name}\"\n end",
"def db\n \n ActiveRecord::Base.establish_connection(:adapter => \"mysql2\",\n :database => \"prod1\",\n :user => \"root\",\n :password=>\"Sector@123\").connection()\n \n end"
] |
[
"0.7503319",
"0.7503319",
"0.7234955",
"0.7234955",
"0.6880299",
"0.6773026",
"0.67666745",
"0.6741359",
"0.6729088",
"0.67028457",
"0.6691277",
"0.66829133",
"0.66430026",
"0.6627663",
"0.66204166",
"0.6595281",
"0.6558294",
"0.6558294",
"0.655064",
"0.6541154",
"0.65361845",
"0.6522673",
"0.65076965",
"0.65076965",
"0.64926374",
"0.6487596",
"0.6474938",
"0.64666086",
"0.64657414",
"0.64555484",
"0.6433377",
"0.6425338",
"0.64200675",
"0.6407212",
"0.63981503",
"0.63981503",
"0.6397264",
"0.637389",
"0.63710546",
"0.63710546",
"0.6365179",
"0.63564533",
"0.63518465",
"0.63509065",
"0.63509065",
"0.63509065",
"0.6345841",
"0.63149697",
"0.63148373",
"0.6314475",
"0.63131124",
"0.6292203",
"0.6265725",
"0.62435496",
"0.62305087",
"0.6214724",
"0.62074506",
"0.6205783",
"0.62034637",
"0.62023216",
"0.6196117",
"0.61905783",
"0.61900955",
"0.61900955",
"0.61862046",
"0.6184883",
"0.61782134",
"0.61782134",
"0.61749697",
"0.61723703",
"0.6166927",
"0.6159378",
"0.61568433",
"0.6125586",
"0.61237675",
"0.61237675",
"0.61195946",
"0.61140597",
"0.6113841",
"0.6110647",
"0.61098164",
"0.6109485",
"0.6101306",
"0.60924685",
"0.6089659",
"0.60711914",
"0.60693145",
"0.6066387",
"0.6064709",
"0.6063771",
"0.60601187",
"0.6058994",
"0.6057282",
"0.60561264",
"0.6053632",
"0.6053621",
"0.6052095",
"0.60520566",
"0.6041803",
"0.60416013",
"0.6037083"
] |
0.0
|
-1
|
Schreiben der aktuellen Connection in last logins, wenn neue dabei
|
def write_connection_to_last_logins
database = read_from_client_info_store(:current_database)
last_logins = read_last_logins
min_id = nil
last_logins.each do |value|
last_logins.delete(value) if value && value[:sid] == database[:sid] && value[:host] == database[:host] && value[:user] == database[:user] # Aktuellen eintrag entfernen
end
if params[:saveLogin] == "1"
last_logins = [database] + last_logins # Neuen Eintrag an erster Stelle
write_last_logins(last_logins) # Zurückschreiben in client-info-store
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def connection_completed\n\tend",
"def connection_completed\n end",
"def session_reconnect_state\n super\n end",
"def checkin_connection(*)\n conn = super\n @connection_timestamps[conn] = Sequel.start_timer\n conn\n end",
"def connection_status_mcnet_login; end",
"def nicks_connected_with\n @connection_cache.keys\n end",
"def all_active_connections\n super\n end",
"def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end",
"def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end",
"def connection_completed()\n super()\n puts \"#{self} connection_completed done!\"\n end",
"def refresh_users\n @connections.each{|c| c.current_user.reload if c.current_user}\n end",
"def connected?; end",
"def connected?; end",
"def connected?; end",
"def reconnect\n end",
"def connection_status_done; end",
"def pending_connections\n\t\tredirect_to '/my_connections'\n\tend",
"def connection_status\n \t@current_connection = ConnectionInfo.where(\"disconnected_at is null\").first\n end",
"def checkin_connection(conn)\n @available_connections << conn\n conn\n end",
"def coached_session_changed?\n coach_connections.any? && timeslot_changed?\n end",
"def reconnect\n end",
"def reconnect\n end",
"def remote_connections; end",
"def connected\n\t\tdo_send(setting(:username), :priority => 0)\n\tend",
"def connection_mirror_state\n super\n end",
"def connection_mirror_state\n super\n end",
"def connection_stale!\n log(:debug, :socket, 'connection is stale.')\n close_connection\n end",
"def client_connected\n end",
"def connection_status_login_request; end",
"def reconnect!\n end",
"def connection_ended\n end",
"def connection_ended\n end",
"def post_init\n $connection_list << self\n @my_connection_index = $connection_list.length\n puts \"Connection Initialized #{@my_connection_index}) #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n end",
"def connectionEnd(conn)\n port, host = conn.peeraddr[1,2]\n client = \"#{host}:#{port}\"\n puts \"#{client} has disconnected\"\n $counter=$counter -1\n puts $counter.to_s+\" clients connected\"\n $logger.info \"#{client} has connected\"\n $logger.info $counter.to_s+\" clients connected\"\n\nend",
"def on_session_ended\n @connection = nil\n\n # Automatically reconnect to the server if allowed\n if @reconnect\n reconnect_from(Exception) do\n connect\n trigger(:reconnected)\n end\n end\n end",
"def on_connect(m)\n User(m.user.nick).monitor\n end",
"def disconnected?; connection_state == :disconnected end",
"def connection_closed\n end",
"def connected?; connection_state == :connected end",
"def did_log_in\n self.last_logged_in_at = DateTime.now\n self.class.execute_without_timestamps { save }\n end",
"def connection_completed\n # We aren't completely connected yet if the connection is encrypted.\n connected! unless @network.secure?\n end",
"def connection_established(*args)\n\tend",
"def reconnect!\n @active = true\n end",
"def connect!\n sessions\n self\n end",
"def event_epoch()\n # Flush out idle clients, if any\n @clients.each do |_,client|\n if Time.now - client.var[:last_ping] > 300\n client.socket.close\n client = @clients.delete(client.socket)\n dispatch :connection_reset, client, \"ping timeout\"\n end\n end\nend",
"def fetch_connection( start=0 , count=500 , tries = 0 )\n request = EventMachine::HttpRequest.new(@linkedin_url + \"/v1/people/~/connections?format=json&count=#{count}&start=#{start}\")\n request.use EventMachine::Middleware::OAuth, @oauth_config\n http = request.get \n \n http.callback do\n if http.response_header.status != 200\n Rails.logger.fatal \"Linkedin Connection Request Failed with Error Code #{http.response_header.status}\"\n Rails.logger.ap http\n raise \"Unexpect response status #{http}\" unless http.response_header.status == 200\n end\n \n begin\n data = MultiJson.decode(http.response)['values']\n connection_info = data.map{|data| data.deep_symbolize_keys }.keep_if{ |connection| connection.has_key?(:pictureUrl) }.map{ |connection| \n {\n :identity => {\n :uid => connection[:id],\n :context_name => :linkedin,\n :credentials => {},\n :name => connection[:firstName] + ' '+ connection[:lastName],\n :image => self.class.process_image(connection[:pictureUrl]),\n :url => connection[:siteStandardProfileRequest][:url],\n :properties => {\n 'Headline' => connection[:headline]\n }\n },\n :email => nil,\n :connection => {\n :from => 'me',\n :to => 'you',\n :properties => {}\n }\n }\n }\n @connections_buffer.concat( connection_info)\n Rails.logger.info \"Linkedin Connections Dispath Successful Countdown: #{@countdown.count}\"\n rescue Exception => ex\n Rails.logger.fatal \"FATAL : Linekdin Parse Error #{ex.message}\"\n Rails.logger.fatal \"FATAL : Linkedin Parse Error Backtrace ... \"\n ex.backtrace[0..10].each{ |trace| Rails.logger.fatal trace} \n Rails.logger.fatal \"Linkedin Connection Dispatch Bad Response #{@countdown.count}\"\n Rails.logger.ap http.response\n ensure\n stop_if_finished\n end\n end\n\n http.errback do\n if tries <= 3\n Rails.logger.warn \"Linkedin Connection Request #{ @countdown.count}, Trying again\"\n fetch_connection( start , count , tries + 1 )\n else\n Rails.logger.fatal \"Linkedin Connection Request #{ @countdown.count}, Giving Up\"\n stop_if_finished\n end\n end\n end",
"def wait_connection; end",
"def wait_connection; end",
"def new_connection; end",
"def connected\n\t\tdo_send('CN1')\t# Connection command - initiate comms\n\t\n\t\t@polling_timer = schedule.every('60s') do\n\t\t\tlogger.debug \"Polling JVC\"\n\t\t\tdo_send('CN1')\t# Connection command\n\t\tend\n\tend",
"def active_connection\n super\n end",
"def on_connecting\n\t\t\t\t@@connected = false\n\t\t\t\tpublish('zk_connecting')\n\t\t\tend",
"def ignore_disconnect; end",
"def connection_status_crypt_wait_response; end",
"def reexecute_connections?\n return true\n end",
"def get_connections\n @connected_to.keys\n end",
"def last_Connect(ssid)\n\t\tbegin\n\t\tkey = 'HKLM\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\\\\NetworkList\\\\Profiles'\n\t\troot_key, base_key = client.sys.registry.splitkey(key)\n\t\topen_key = client.sys.registry.open_key(root_key,base_key,KEY_READ)\n\t\tkeys = open_key.enum_key\n\t\tvals = open_key.enum_value\n\t\tif (keys.length > 0)\n\t\tkeys.each { |subkey|\n\t\t\tformat = 'z50z20z1020c'\n\t\t\tkeyint = key+\"\\\\#{subkey}\"\n\t\t\troot_key, base_key = client.sys.registry.splitkey(keyint)\n\t\t\topen_keyint =\n\t\t\tclient.sys.registry.open_key(root_key,base_key,KEY_READ)\n\t\t\tvalsint = open_keyint.enum_value\n\t\t\tv = open_keyint.query_value('ProfileName')\n\t\t\tprof_key = v.data.to_s \n\t\t\tif (prof_key.eql? ssid)\n\t\t\t\tconn_v = open_keyint.query_value('DateLastConnected')\n\t\t\t\tconn_date = conn_v.data.to_s.unpack(\"H*\")[0]\n\t\t\t\treturn reg_binary_to_date(conn_date)\n\t\t\tend\n\t\t}\n\t\telse\n\t\t\treturn 'Error resolving last connected date'\n\t\tend\n\t\trescue\n\t\t\treturn 'Error resolving last connected date'\n\t\tend\n\tend",
"def post_connect_hooks; end",
"def post_connect_hooks; end",
"def connection_completed\n @connection_completed = true\n begin_handshake\n rescue Exception\n log.fatal { \"Error in #connection_completed\" }\n p $!; puts *$@\n end",
"def connection_pool_idle_timeout\n super\n end",
"def reconnect!\n @connection.reset_connection\n end",
"def after_connect\n redis_connect\n set_adapters\n set_callbacks\n end",
"def disconnecting?; connection_state == :disconnecting end",
"def post_init\n @connected = true\n end",
"def post_init\n @connected = true\n end",
"def out_begin_connection(event)\n pass(@password) if @password\n user(event.username, '0.0.0.0', event.address, event.realname)\n nick(@nicknames[0])\n end",
"def connection_completed\n @connection_state = :connected\n @connection_state_callback.call if @connection_state_callback\n end",
"def connections\n @mutex.synchronize do\n @connections.values.inject(0, &:+)\n end\n end",
"def checkin_connection(conn)\n @queue.push(conn)\n conn\n end",
"def on_new_session(session)\n self.session_count += 1\n self.successful = true\n end",
"def post_init\n self.pending_connect_timeout = @telnet_options[:connect_timeout]\n self.comm_inactivity_timeout = @telnet_options[:timeout]\n @@_telnet_connection_count += 1\n end",
"def connection_completed\n\t\tsend_data \"#{$username}:#{$password}\"\n\tend",
"def connection_completed\n @connected = true\n Skates.logger.debug {\n \"CONNECTED\"\n } # Very low level Logging\n end",
"def client_disconnected\n end",
"def on_connected\n end",
"def connection_pool_replenish_state\n super\n end",
"def connections\n @_connections ||= {}\n end",
"def connection_successful\n @authenticating = false\n opened!\n\n exec_callback_yielding_self(:connect)\n end",
"def mysql_keep_alive\n @connection.ping()\n rescue Mysql::Error => e\n @logger.info(\"MySQL connection lost: [#{e.errno}] #{e.error}\")\n @connection = mysql_connect\n end",
"def reconnect!\n clear_cache!\n reset_transaction\n end",
"def all_connections\n yield @conn.first if @conn\n end",
"def reset_oneconnect_statistics\n super\n end",
"def connect\n \t\t#Se sigue la convencion para la identificacion del usuario\n \t\t#y buscamos alusuario que se intenta conectar\n \t\tself.current_user = find_user\n \tend",
"def reset!\n logoff rescue nil\n begin\n new_connection(@config)\n @active = true\n rescue Java::JavaSql::SQLException => e\n @active = false\n raise OracleEnhanced::ConnectionException, e.message\n end\n end",
"def connected?\n self.connected_cache ||= session_info.success?\n end",
"def without_reconnect(&block); end",
"def connections\n @connections ||= []\n end",
"def last_synchronize\n last_update\n end",
"def grab_connections\n connections = []\n connections << @host\n end",
"def reconnect_if_needed\n reconnect if @concurrent_id != concurrent_id\n end",
"def checkin(conn)\n owner = conn.owner\n\n conn._run_checkin_callbacks do\n conn.expire\n end\n\n release owner\n\n @available << conn\n end",
"def last_successful_login\n @last_successful_login ||= login_histories.where(successful: true).order(created_at: :desc).first\n end",
"def getconnectioncount\n coind.getconnectioncount\n end",
"def connected?\n @connection && !@connection.expired?\n end",
"def connections\n @connections ||= {}\n end",
"def cull_idle_sockets\n\t\tself.log.debug \"Culling idle sockets.\"\n\n\t\tearliest = Time.now - self.class.idle_timeout\n\n\t\tself.connection_times.each do |sender_id, times|\n\t\t\ttimes.each do |conn_id, lastframe|\n\t\t\t\tnext unless earliest > lastframe\n\n\t\t\t\tself.log.warn \"Timing out connection %s:%d: last seen %0.3fs ago.\" %\n\t\t\t\t\t[ sender_id, conn_id, Time.now - lastframe ]\n\n\t\t\t\t# Make a CLOSE frame\n\t\t\t\tframe = Mongrel2::WebSocket::Frame.close\n\t\t\t\tframe.set_status( CLOSE_EXCEPTION )\n\n\t\t\t\t# Use the connection directly so we can send a frame and close the\n\t\t\t\t# connection\n\t\t\t\tself.conn.send( sender_id, conn_id, frame.to_s )\n\t\t\t\tself.conn.send_close( sender_id, conn_id )\n\t\t\tend\n\t\tend\n\tend",
"def connection_status_client_status; end",
"def last_peer_count\n\t\t\t@last_peer_count ||= 50\n\t\tend",
"def reconnect\n disconnect rescue nil\n @connected = true\n end"
] |
[
"0.64820606",
"0.6450973",
"0.62735546",
"0.6263115",
"0.6245871",
"0.6197363",
"0.60673416",
"0.59512275",
"0.59512275",
"0.59512275",
"0.59430104",
"0.59274954",
"0.59274954",
"0.59274954",
"0.5922495",
"0.59065956",
"0.582445",
"0.5822487",
"0.5807724",
"0.5801186",
"0.5787296",
"0.5787296",
"0.57861316",
"0.5768869",
"0.57626796",
"0.57626796",
"0.57454544",
"0.5715974",
"0.5699044",
"0.5697061",
"0.56962025",
"0.56962025",
"0.5688113",
"0.56880146",
"0.5675173",
"0.5660256",
"0.5655348",
"0.5638557",
"0.5633626",
"0.5623997",
"0.5612926",
"0.559053",
"0.55778074",
"0.5574849",
"0.5545679",
"0.5536387",
"0.5533168",
"0.5533168",
"0.5525673",
"0.5518228",
"0.5504986",
"0.549934",
"0.54948944",
"0.5493593",
"0.5490326",
"0.548533",
"0.54727226",
"0.5467091",
"0.5467091",
"0.5442393",
"0.54386246",
"0.54373276",
"0.54366726",
"0.543331",
"0.5433078",
"0.5433078",
"0.5430281",
"0.5428015",
"0.5415701",
"0.5398842",
"0.53958595",
"0.53884",
"0.5385855",
"0.53807086",
"0.5378028",
"0.53753",
"0.53742266",
"0.5374033",
"0.5372102",
"0.5364695",
"0.53528124",
"0.534549",
"0.53441906",
"0.5340226",
"0.53368455",
"0.53275526",
"0.53163743",
"0.5312869",
"0.53098047",
"0.5301037",
"0.5296571",
"0.5295549",
"0.5275628",
"0.5263971",
"0.525389",
"0.5251598",
"0.52502805",
"0.52490944",
"0.5246019",
"0.52353436"
] |
0.7601629
|
0
|
DBID explizit setzen wenn mehrere verschiedene in Historie vorhande
|
def set_dbid
set_cached_dbid(params[:dbid])
respond_to do |format|
format.js {render :js => "$('##{params[:update_area]}').html('#{j "DBID for access on AWR history set to #{get_dbid}"}');"}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def track_database_id\n @ole.TrackDatabaseID\n end",
"def track_database_id\n @ole.TrackDatabaseID\n end",
"def track_database_id\n @ole.TrackDatabaseID\n end",
"def track_database_id\n @ole.TrackDatabaseID\n end",
"def getid\n @dbtop+=1\n end",
"def db_key\n\t\t\tself.class.db_key\n end",
"def db4o_id\n self.class.database.id_for(self)\n end",
"def getDBPage(id)\n @dbs_open[id]\n end",
"def initialize\n @id = 0\n @db_symbol = :__undef__\n end",
"def druid_db_obj\n @druid_db_obj ||= Druid.find_or_create_by!(druid: druid)\n end",
"def db_prepare_last_data_id(dbh)\n dbh.prepare(\"SELECT last_value FROM generic_chado.data_data_id_seq\")\n end",
"def database_id\n service.database\n end",
"def set_db\n @db = Db.find(params[:id])\n end",
"def dbi_resource_id\n @dbi.dbi_resource_id\n end",
"def dbi_resource_id\n @dbi.dbi_resource_id\n end",
"def dbi_resource_id\n data[:dbi_resource_id]\n end",
"def set_DB()\n self.is_db = 1\n save()\n end",
"def db=(_arg0); end",
"def db=(_arg0); end",
"def single_object_db; end",
"def set_db_name\n @db_name = DbName.find(params[:id])\n end",
"def on_db_vuln(vuln)\n\tend",
"def db; end",
"def db; end",
"def database_name\n @dbi.db_name\n end",
"def database_name\n @dbi.db_name\n end",
"def prepare_param_dbid\n retval = params[:dbid]\n retval = session[:database][:dbid] unless retval\n retval\n end",
"def db_name\n data[:db_name]\n end",
"def audit\n identifier(audit_db)\n end",
"def db_file\n self.class.db_root.join(id) if id\n end",
"def database_id\n @grpc.database.split(\"/\")[5]\n end",
"def database_record_number\n # TODO: not sure this matches the description.\n # We should check that by scanning the tag two times and seeing that the number of new history\n # matches the increase of this number\n write_report(0x60, '$dbrnum?')\n read_text_command.gsub('DB Record Number =', '').strip.to_i\n end",
"def on_db_ref(ref)\n\tend",
"def db_instance_arn\n data[:db_instance_arn]\n end",
"def dbid_in_profile(dbid)\n get_available_database_ids.include? dbid\n end",
"def id; 1; end",
"def id()\n #This is a stub, used for indexing\n end",
"def id() end",
"def database_id\n @grpc.name.split(\"/\")[5]\n end",
"def database_id\n @grpc.name.split(\"/\")[5]\n end",
"def database_id\n @grpc.name.split(\"/\")[5]\n end",
"def initialize( db )\n @db = db\n end",
"def lastID\r\n self.conn_exec do |driver|\r\n return driver.lastID\r\n end\r\n end",
"def on_db_vuln(context, vuln)\n\tend",
"def id; 1; end",
"def getDB\n @db\n end",
"def last_id()\n #This is a stub, used for indexing\n end",
"def initialize(db)\n @db = db\n end",
"def db_system_id\n data[:db_system_id]\n end",
"def db_system_id\n data[:db_system_id]\n end",
"def initialize(db)\n @db = db\n end",
"def initialize(db)\n @db = db\n end",
"def watched\n identifier(watched_db) \n end",
"def db=(my_db)\n @db = my_db\n end",
"def db=(my_db)\n @db = my_db\n end",
"def __id__() end",
"def [](dbname)\n self.db[dbname]\n end",
"def hijack_db\n unless current_government\n redirect_to \"http://\" + NB_CONFIG['multiple_government_base_url'] + \"/\"\n return\n end\n current_government.switch_db\n end",
"def save_primary_key_grip; end",
"def initialize\n \t @id = @@next_table_id\n \t @@next_table_id += 1\n end",
"def database_id=(database_id) # :nodoc:\n self.id = self.class.parse_database_id(database_id)[1]\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def openDBRanked()\n\t\t@rankedDB \t\t= SQLite3::Database.new File.expand_path('../../../Data/ranked.db', File.dirname(__FILE__))\n\t\t@rankedTimeDB \t= SQLite3::Database.new File.expand_path('../../../Data/rankedTime.db', File.dirname(__FILE__))\n\tend",
"def loadHistoric()\n\t\treturn @rankedDB.execute(\"SELECT historic FROM ranked WHERE idMap = '#{@idMap}'\").shift.shift\n\tend",
"def db_symbol(id)\n return (@data[id][0].db_symbol || :__undef__) if id_valid?(id)\n return :__undef__\n end",
"def id\n __id\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def set_database\n @database = Database.find(params[:id])\n end",
"def set_database_change_log\n @database_change_log = DatabaseChangeLog.find(params[:id])\n end",
"def db(*args); data(1, args); end",
"def select_db(name)\n #This is a stub, used for indexing\n end",
"def database(value)\n update_query(:database => value)\n end",
"def new_id\n dbm = self.class.dbm\n\n max = dbm.keys.map { |k| k.to_i }.max || 0\n id = max + 1\n\n dbm[id.to_s] ||= \"\"\n\n id.to_s\n end",
"def db_symbol(id)\n return (@data[id].db_symbol || :__undef__) if id_valid?(id)\n return :__undef__\n end",
"def initialize(id)\n # self.redis.select 1 #assign to a different database\n @id = id\n end",
"def dom_id; end",
"def dom_id; end",
"def dom_id; end",
"def dom_id; end",
"def on_db_ref(context, ref)\n\tend",
"def flushdb; end",
"def get_database_object\n\t\t\t\t\t$TRACE.debug 5, \"getting database object #{self.database_object} for object #{self.class}:#{self.id}, called by #{caller[0]}\"\n\t\t\t\t\tself.database_object\n\t\t\t\tend",
"def db_record\n db or MyBiaDJ::Table(:files)[:path => relative_path, :name => name.to_s]\n end",
"def get_by_db4o_id(id)\n obj = database.get_by_id(id.to_i)\n # NOTE: Activate depth should be configurable\n database.connection.activate(obj, 5)\n obj.load_attributes!\n end",
"def uri(db = database)\n \"#{db.root}/#{self['_id']}\"\n end",
"def database; datastore['DATABASE']; end",
"def head\n raise InvalidDbError if @stale\n super\n end",
"def ChangeActiveDB\n @dbpage = @nb_dbs.get_nth_page(nb_dbs.get_current_page)\n\n # Then we set the main-variables to refelect current page.\n @tv_tables = @dbpage.get_TVTables\n @tv_columns = @dbpage.get_TVColumns\n @tv_indexes = @dbpage.get_TVIndexes\n @dbconn = @dbpage.get_DBConn\n end",
"def procedure( id )\n if @db != nil\n\n end\n\n return nil\n end",
"def id_number; end",
"def table_id\n\n end",
"def derive_db_id(model_name, obj_id)\n \"#{model_name}_#{obj_id}\"\n end",
"def _store_db(db)\n @db = @cfg[:db] = type?(db, Dbx::Index)\n @db.reduce(yield @db) if defined? yield\n # Making run_list\n sites = @cfg[:sites] || []\n @run_list = sites.empty? ? @db.list : (sites & @db.list)\n self\n end",
"def id; end",
"def id; end",
"def id; end",
"def id; end",
"def id; end",
"def id; end"
] |
[
"0.67526346",
"0.67526346",
"0.67526346",
"0.67526346",
"0.6473767",
"0.61151266",
"0.60542905",
"0.6021306",
"0.59280974",
"0.5847269",
"0.58369416",
"0.5835084",
"0.5817392",
"0.57747823",
"0.57747823",
"0.57673705",
"0.57543296",
"0.5754045",
"0.5754045",
"0.57350045",
"0.5711128",
"0.5694142",
"0.56854486",
"0.56854486",
"0.56544197",
"0.56544197",
"0.5647312",
"0.56290025",
"0.56061304",
"0.5600518",
"0.55961996",
"0.55566067",
"0.5517335",
"0.55129963",
"0.551119",
"0.54894227",
"0.5478248",
"0.54697573",
"0.5463773",
"0.5463773",
"0.5463773",
"0.5460338",
"0.5457233",
"0.54532176",
"0.5452869",
"0.5446202",
"0.5446016",
"0.5427601",
"0.54231966",
"0.54231966",
"0.5415326",
"0.5415326",
"0.54111266",
"0.5408498",
"0.5408498",
"0.53888524",
"0.53865474",
"0.5375895",
"0.53670657",
"0.53667116",
"0.5350991",
"0.53478265",
"0.53478265",
"0.5341166",
"0.5329252",
"0.53288007",
"0.5321032",
"0.53138036",
"0.53138036",
"0.530009",
"0.52986145",
"0.5297809",
"0.52975166",
"0.5289533",
"0.52878773",
"0.528593",
"0.5279128",
"0.5279128",
"0.5279128",
"0.5279128",
"0.52772576",
"0.52770716",
"0.5263026",
"0.52565783",
"0.52418077",
"0.52389693",
"0.523886",
"0.52376795",
"0.523551",
"0.5229517",
"0.52291894",
"0.5225021",
"0.52192765",
"0.5215289",
"0.521047",
"0.521047",
"0.521047",
"0.521047",
"0.521047",
"0.521047"
] |
0.572168
|
20
|
repeat last called menu action
|
def repeat_last_menu_action
controller_name = read_from_client_info_store(:last_used_menu_controller)
action_name = read_from_client_info_store(:last_used_menu_action)
# Suchen des div im Menü-ul und simulieren eines clicks auf den Menü-Eintrag
respond_to do |format|
format.js {render :js => "$('#menu_#{controller_name}_#{action_name}').click();"}
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def repeat_menu\n puts \"\\n-----------------------\".colorize(:blue)\n puts \"You currently have $#{@player.wallet} left.\".colorize(:red)\n puts \"What do you want to do?\".colorize(:red)\n puts \"1)Add more money to my wallet\".colorize(:blue)\n puts \"2)Play another game\".colorize(:blue)\n puts \"3)Exit\".colorize(:blue)\n puts \"-----------------------\".colorize(:blue)\n print \"> \"\n choice = gets.to_i\n case choice\n when 1\n add_money_to_wallet\n display_main_menu\n when 2\n display_main_menu\n when 3\n puts \"\\nGOOD BYE!!!\".colorize(:red)\n sleep(1)\n print `clear`\n exit\n else\n puts \"Invalid Entry\".colorize(:red)\n repeat_menu\n end\n end",
"def run_menu_and_call_next(menu)\n user_wants = run_menu(menu)\n params = user_wants.slice(1..-1) if user_wants.length > 1\n call_method(user_wants.slice(0), params)\n end",
"def call_menu\n call_idle($game_player.old_character_name, false)\n syn_map_menu\n end",
"def repeat\n unless @state.last_command.nil?\n send(@state.last_command[:method], *@state.last_command[:args])\n end\n end",
"def return_to_recipe_list\n system \"clear\"\n main_menu(1)\nend",
"def run\n welcome\n menu_exit\n end",
"def main_menu\n while true\n print_main_menu\n user_selected =gets.to_i\n call_option(user_selected)\n end\n end",
"def update_call_menu\n end",
"def game_start\n opening\n first_menu\n end",
"def main_menu\n name_selector\n puts \"Okay #{@name}, what would you like to do?\"\n loop do\n case menu_arrows\n when '1'\n @recommendation.recommendation_menu\n when '2'\n puts 'you have the following number of games in your library: '\n @game_library.game_instances\n puts 'your custom list of games:'\n @game_library.user_games_lister\n when '3'\n puts 'add a game:'\n @game_library.add_title\n when '4'\n @game_library.delete_games\n when '5'\n @time_used.time_wasted\n when '6'\n @game_library.write_games\n puts 'thanks for your time!'\n exit\n end\n end\n end",
"def perform\n\tgame_menu\n\tgameplay\nend",
"def menu\n \nend",
"def menu\n \n \n\nend",
"def menu\nend",
"def main_end\n super\n $game_temp.last_menu_index = @index\n end",
"def main_menu(fridge)\r\n # loop the menu untill break\r\n loop do\r\n # ask if user wanna make Japanese food.\r\n puts \"Hello #{fridge.owner_name.green}. Wellcome to \"+\"Japanese Firdge\".cyan\r\n sleep 3\r\n system \"clear\"\r\n puts \"Would you like to make Japanese food?(y/n)\"\r\n choice = gets.strip.downcase\r\n case choice\r\n # when yes\r\n when \"y\"\r\n get_what_they_have(fridge)\r\n puts \"Let me think what you can make...\"\r\n sleep 3\r\n system \"clear\"\r\n loop do\r\n choose_recipe(find_mached_recipe(fridge))\r\n puts \" \"\r\n puts \"Press [b] to choose other recipes\\nPress [x] to exit\"\r\n exit_back_choice = gets.strip.downcase\r\n if exit_back_choice == \"b\"\r\n system \"clear\"\r\n elsif exit_back_choice == \"x\"\r\n puts \"See you next time! Enjoy your meal :)\"\r\n sleep 1\r\n abort\r\n end # if exit_back_choice end\r\n end # loop end\r\n\r\n # when no\r\n when \"n\"\r\n puts \"See you next time!\"\r\n sleep 1\r\n break\r\n else\r\n puts \"Say that again? #{choice} is not acceptable.\"\r\n sleep 1\r\n main_menu(fridge)\r\n end # case choice end\r\n end # loop end\r\nend",
"def main_menu\n while true\n print_main_menu\n user_selected = gets.chomp.to_s\n call_option(user_selected)\n end\n end",
"def call_menu\n return if $game_system.menu_disabled\n Sound.play_open_menu\n @spriteset.clear_banners\n#~ if @spriteset.banners?\n#~ bs = @spriteset.title_banners ? @spriteset.title_banners : []\n#~ pb = @spriteset.party_banners ? @spriteset.party_banners : []\n#~ rb = @spriteset.red_banners ? @spriteset.red_banners : []\n#~ $game_temp.remember_banners = [[bs],[pb],[rb]]\n#~ $game_temp.remember_banner_phase = [@spriteset.tickdown,@spriteset.banner_phase]\n#~ $game_temp.remember_joiners = @spriteset.joiners\n#~ $game_temp.remember_leavers = @spriteset.leavers\n#~ $game_temp.remember_removed = @spriteset.removed\n#~ $game_temp.remember_header = @spriteset.header_banner\n#~ $game_temp.remember_posx = @spriteset.posx\n#~ end\n SceneManager.call(Scene_Menu)\n Window_MenuCommand::init_command_position\n end",
"def main_menu\n\t\twhile true\n\t\t\tprint_main_menu\n\t\t\tuser_selected = gets.chomp.to_i\n\t\t\t\tif user_selected == 7\n\t\t\t\tputs \"Current session ended, goodbye!\"\n\t\t\t\treturn\n\t\t\tend\n\t\t\tcall_option(user_selected)\n\t\tend\n\tend",
"def action\n (@current_level = 'X' ; return) if ( @user_choice == 'X' || @user_choice == 'x')\n\n (menu_level_left ; return) if @user_choice == \"\\e[D\"\n\n tmp_lvl = @current_level + '.' + @user_choice\n cmd = @menu_map[tmp_lvl][1]\n cmd ? execute_action(cmd) : @current_level = tmp_lvl\n end",
"def main_menu(user)\n user = user\n self.clear\n Ascii.image\n menu = [\"See all my plants\",\"Add new plant\",\"Delete my account\",\"Quit\"]\n menu_selection = @@prompt.select(\"What would you like to do?\",menu)\n \n case menu_selection\n when \"See all my plants\"\n my_plant(user)\n when \"Add new plant\"\n add_plant(user)\n when \"Delete my account\"\n answer = @@prompt.yes?(\"Are you sure?\")\n answer == true ? user.destroy : self.main_menu(user)\n when \"Quit\"\n index = 0\n # binding.pry\n color = [\"#7FFF00\",\"#6B8E23\",\"#008000\",\"#2F4F4F\",\"#00008B\"]\n 5.times do\n self.clear\n # binding.pry\n puts Paint[Ascii.goodbye, color[index]] \n index += 1\n sleep(0.7)\n end \n end\n end",
"def dat_menu() \n game_states.size == 1 && exit #fires if this is the only gamestate\n Chingu::Text.create 'Now leaving :(', size: 48, x: 200, y: 200, color: Gosu::Color::RED\n after(500) { $window.pop_game_state(setup: false) }\n end",
"def menu # can do custom methods within a method/class\n end",
"def main_menu()\n system 'clear'\n loop do\n headline(\"My Petsitter App\")\n puts \"#{@emoji[:smiling_cat_face_with_open_mouth]} Welcome! #{@emoji[:dog_face]}\".colorize(:bold)\n puts @headline\n input = @prompt.select('Menu:') do |menu|\n menu.choice name: 'Pet Sitters', value: \"PET_SITTERS\"\n menu.choice name: 'Clients', value: \"CLIENTS\"\n menu.choice name: 'Jobs', value: \"JOBS\"\n menu.choice name: 'Logout', value: \"EXIT\"\n end\n puts '-' * 20\n go_to(input)\n end\n end",
"def displaymenu # Console only\r\n\t\t @output.puts \"Menu: (1) Play | (2) New | (3) Analysis | (9) Exit\"\r\n\t\t end",
"def main_menu\n input = 0\n until input.to_i == @@main_ops.length - 1 \n print \"\\e[H\\e[2J\" #clears the screen\n puts @name \n print_menu(@@main_ops)\n print \"Choose an option by entering a number: \"\n input = gets.chomp\n call_option(input)\n end\n end",
"def main_menu(user_instance)\n user_greeting(user_instance)\n case help\n when \"1\", \"playlist\", \"playlists\"\n system(\"clear\")\n playlists_menu(user_instance)\n when \"2\", \"songs\", \"song\"\n system(\"clear\")\n songs_menu(user_instance)\n # when \"3\", \"artists\", \"artist\"\n # system(\"clear\")\n # artists_menu(user_instance)\n when \"exit\"\n system(\"clear\")\n goodbye\n exit\n else\n system(\"clear\")\n puts \"Please enter a valid command.\".colorize(:red).bold\n main_menu(user_instance)\n end\nend",
"def interactive_menu\n loop do\n print_menu\n selection\n end\nend",
"def menu\n puts \"Quelle action veux-tu effectuer ?\" #Presentation menu\n puts \"\"\n puts \"a - chercher une meilleure arme\"\n puts \"s - chercher à se soigner\"\n puts \"\"\n puts \"Attaquer un joueur en vue\"\n print \"0 - \"\n puts @human_player.show_state\n counter_of_ennemies = 0\n @enemies.each do |mechant|\n print \"#{counter_of_ennemies} - \" \n puts mechant.show_state\n counter_of_ennemies += 1\n end\n end",
"def run_menu(menu)\n display_menu(menu)\n user_choice = get_user_input(menu.user_pick_one_prompt)\n while !menu.user_input_valid?(user_choice)\n user_choice = get_user_input(menu.user_wrong_choice_prompt)\n end\n if menu.user_wants_to_quit?(user_choice)\n exit 0\n else\n menu.find_menu_item_chosen(user_choice).do_if_chosen\n end\n end",
"def op_menu\n loop do\n case Prompts.op_selection\n when '1'\n user = User.new_user_input\n main_menu(user)\n when '2'\n User.user_login\n when '3'\n quit\n end\n end\n end",
"def menuScreen\n @levelNo=1\n clearScreen\n puts \"You are at the menu for Sokoban\"\n puts \"To quick play: Press 'p'\"\n puts \"To choose a level: Press 'c'\"\n puts \"To stop: Press 'q'\"\n charPressedInMenu\nend",
"def menu \n\tputs \"What would you like to do?\"\n\tputs \"1. Build a quiz?\"\n\tputs \"2. Take a quiz?\"\n\n\tchoice = gets.chomp.to_i\n\n\tcase choice\n\twhen 1\n\t\tsystem \"clear\"\n\t\tbuild_quiz \n\twhen 2\n\t\tsystem \"clear\"\n choose_quiz\n else\n \tsystem \"clear\"\n \tputs \"please try again\"\n \tmenu\n end\nend",
"def main_menu\n choice = true\n while choice\n puts \"What would you like to do?\"\n puts \"(C)reate, (L)ist, (U)pdate, (D)elete, or (E)xit \"\n options = gets.chomp.downcase\n\n case options\n when \"c\"\n # runs method create line 101\n create\n when \"l\"\n #runs method list line 144\n list\n when \"u\"\n #runs method update line 161\n update\n when \"d\"\n #runs method delete line 229\n delete\n when \"e\"\n choice = false #exits world\n else\n puts \"Wrong Input. Please input C, L, U, D or E\"\n end\n end\n end",
"def main_menu_runner\n\n splash\n\n login_menu_display\n\n end",
"def menu_options\n system \"clear\"\n puts \"~~~ Welcome #{@user.username} to the Main Menu ~~~\\n\\n\" \n puts \"{1} Continue from previous story \"\n puts \"{2} Create new story\"\n puts \"{3} Delete a story\"\n puts \"{4} Tutorial\"\n puts \"{5} End My Session\"\nend",
"def finish() #method\n puts \"Menu cooked successfully.\"\n exit\n end",
"def menu\n puts \"Menu\"\n puts \"1. List Channels\"\n puts \"2. List Users\"\n puts \"3. Select User\"\n puts \"4. Select Channel\"\n puts \"5. Send Message\"\n puts \"6. Quit\"\nend",
"def menu()\n system('clear')\n puts '==================== M E N U ===================='.colorize(:light_blue)\n puts \" Press enter to start\".colorize(:green)\n gets.chomp\n @@support.help\n numberPlayers\n sleep (0)\n game\n return \"Finishing the game\"\n end",
"def main_menu\n @active = 0\n @prompt.select(\"\\nWhat would you like to do?\\n\".blue) do |menu|\n menu.choice \"Check out what's on today\", -> {today_menu} \n menu.choice \"Check out things to do on the weekend\", -> {weekend_menu}\n menu.choice \"Look at my favourites\", -> {display_favorites}\n menu.choice \"Exit\".red, -> {leave_app} \n end \n end",
"def run\n greet\n menu\n end",
"def menu_refresh\n @refresh_signals.each do |signal|\n signal.call\n end\n end",
"def menu_refresh\n @refresh_signals.each do |signal|\n signal.call\n end\n end",
"def perform \n \tquel_menu(menu)\n \tjournaliste\nend",
"def main_menu\n menu_options = [\"Start exploring\", \"Check Inventory\", \"Check Your Score\", \"Go to Pokemon Center\", \"Quit\"]\n menu_prompt = Interactivity.mainMenu \n \n if user.pokemon == nil\n menu_options.shift()\n menu_options.unshift(\"Choose a Pokemon and start exploring\")\n elsif self.user_current_location\n menu_options.shift()\n menu_options.unshift(\"Keep Exploring\")\n end\n \n choice = prompt.select(menu_prompt, menu_options) \n if choice == \"Start exploring\" || choice == \"Choose a Pokemon and start exploring\" || choice == \"Keep Exploring\"\n self.trainer_chooses_pokemon if user.pokemon == nil \n self.trainer_chooses_town\n self.exploring_town\n elsif choice == \"Check Inventory\"\n puts \"MANAGE INVENTORY - CHANGE POKEMONS AROUND\"\n elsif choice == \"Go to Pokemon Center\"\n self.pokemon_center\n elsif choice == \"Check Your Score\"\n puts \"CHECK YOUR SCORE\"\n else\n Interactivity.quit\n end\n end",
"def main_menu\n while(!$quit)\n case welcome_page\n when \"Login\"\n puts \"\\e[H\\e[2J\"\n login_loop\n when \"Register\"\n puts \"\\e[H\\e[2J\"\n register_loop\n when \"Exit\"\n exit\n end\n end\nend",
"def menu\n\tputs \"Quelle action veux-tu effectuer?\"\n\tputs \"\\n\"\n\tputs \"a - chercher une meilleure arme\"\n\tputs \"s - chercher à se soigner\"\n\tputs \"\\n\"\n\tputs \"attaquer un joueur en vue :\"\n\ti = 0\n\tenemies_in_sight.each do |enemy|\n\t\ti +=1\n\t\tputs \"#{i} - #{enemy.name} a #{enemy.life_points} points de vie.\"\n\tend\n\tputs \"Fais ton choix\"\n\tprint \">\"\n\tend",
"def run_normal\n welcome_header\n main_menu \n end",
"def action_A_menu\n case @intern_mode\n when :choose_move_pokemon\n action_move_current_pokemon\n when :choose_move_item\n return $game_system.se_play($data_system.buzzer_se) if @team_buttons[@index].data.item_holding == 0\n @team_buttons[@move = @index].selected = true\n @intern_mode = :move_item\n @base_ui.show_win_text(text_get(23, 22))\n when :move_pokemon\n process_switch\n when :move_item\n process_item_switch\n else\n $game_system.se_play($data_system.decision_se)\n return show_choice\n end\n $game_system.se_play($data_system.decision_se)\n end",
"def present_menu\n is_running = true\n while is_running \n # present_menu_list\n MenusAvailable.present_menu_list\n choice = STDIN.gets.chomp.to_i\n if choice == 1\n get_joke_excluding_dislikes\n elsif choice == 2\n get_joke_by_category\n elsif choice == 3\n list_favorites\n elsif choice == 4\n clear_favorites\n elsif choice == 5\n list_dislikes\n elsif choice == 6\n clear_dislikes\n elsif choice == 7\n is_running = false\n end\n end\n end",
"def display_main_menu\n loop do\n case main_menu_selection\n when 1\n RunApp.start_quiz(1)\n when 2\n RunApp.start_quiz(2)\n when 3\n exit\n end\n end\n end",
"def loc_time_menu\n loc_time = Menu.new(\"What would you like to do with movie time/theatre slots?\")\n loc_time.add_menu_item({key_user_returns: 1, user_message: \"Create a new theatre/time slot.\", do_if_chosen: \n [\"create_loc_time\"]})\n loc_time.add_menu_item({key_user_returns: 2, user_message: \"Update a theatre/time slot.\", do_if_chosen: \n [\"update_object\", LocationTime, \"loc_time_menu\"]})\n loc_time.add_menu_item({key_user_returns: 3, user_message: \"Show me theatre/time slots.\", do_if_chosen: \n [\"show_object\", LocationTime, \"loc_time_menu\"]})\n loc_time.add_menu_item({key_user_returns: 4, user_message: \"Delete a theatre/time slot.\", do_if_chosen: \n [\"delete_loc_time\"]})\n loc_time.add_menu_item({key_user_returns: 5, user_message: \"Return to main menu.\", do_if_chosen: \n [\"main_menu\"]})\n run_menu_and_call_next(loc_time)\n end",
"def cycleMenu(menu)\n\t\tif menu == @selectItemBox\n\t\t\t@selectItemBox = OptionBox.new(15, 5, 34, 7, 18, 15, 128, 26, createNextItemSublist, @screen)\n\t\t\tmenu = @selectItemBox\n\t\telsif menu == @selectMagicBox\n\t\t\t@selectMagicBox = OptionBox.new(15, 5, 34, 7, 18, 15, 128, 26, createNextMagicSublist, @screen)\n\t\t\tmenu = @selectMagicBox\n\t\tend\n\t\treturn menu\n\tend",
"def play\n\t\tdisplay_welcome\n\t\twhile true\n\t\t\tchoice = get_menu_choice\n\t\t\tchoice_result = handle_menu_choice choice\n\t\t\tbreak if choice_result == :quit\n\t\tend\n\t\tputs \"Thanks for playing Hangman :-) Play again soon.\"\n\tend",
"def main_menu\n\t\twhile true\n\t\t\tprint_main_menu\n\t\t\tinput = gets.chomp.to_i\n\t\t\treturn if input == 7\n\t\t\tchoose_option(input)\n\t\tend\n\tend",
"def main_menu\n\n\tif @count < 3\n\n\tputs \"Welcome to The Bank\"\n\tputs \"Please select action from the following menu options:\"\n\tputs \"-----------------------------------------------------\"\n\tputs \"1. Add an account\"\n\tputs \"2. View existing acocunt\"\n\tputs \"3. Exit Menu\"\n\n\n\toption = gets.chomp.to_i # User Choice\n\tif option == 1 \n\t\t@count = 0 #resetting the count\n\t\tadd_account #calling the method\n\telsif option == 2\n\t\t@count = 0 #resetting the count\n\t\tview_account #calling \n\telsif option == 3\n\t\tputs \"Thank you for visiting The Bank\"\n\t\texit\n\telse\n\t\t\tif @account != (1..3)\n\t\t\t\tputs \"invalid selection. Try Again.\"\n\t\t\tend\n\t\t\t@count += 1\n\t\t\tmain_menu\n\t\tend\n\n\telse \n\t\tputs \"You seem to be having trouble. Contact Customer Service.\"\n\t\texit\n\tend\n\nend",
"def list_menu\n puts \"\\nMain Menu\"\n puts \"1. Daily Prophet - News!\"\n puts \"2. Evanesco - Exit\"\n end",
"def print_menu\n isFinished = true\n while (isFinished)\n puts @menu_description\n @menu_items.each_pair { |key, value|\n puts \"(#{key}) #{value}\"\n }\n\n isFinished = determine_action(get_entry(\"Select option: \"))\n end\n end",
"def menu _command\n send_cmd(\"menu #{_command}\")\n end",
"def prev_story_screen\n system \"clear\"\n count = 1\n\n puts \"~~~ Welcome back to your story logs!!! ~~~\" \n my_stories = @user.stories.each do |story| \n puts \"{#{count}} #{story.story_name}\"\n count += 1\n end\n\n while true\n print \"\\n\\nWhich adventure would you like to pick up? (press 'R' to return) ==> \"\n input = gets.chomp\n if input == 'R' || input == 'r'\n main_menu\n end\n input = input.to_i\n if input > count-1 || input < 1\n puts \"That is not a valid input\"\n sleep(1)\n else\n selected_story = my_stories[input-1]\n @story = selected_story\n story_menu\n end\n end\nend",
"def display_and_run\n\n # prints the menu name and waits briefly\n @dp.d_print(@menu_name + \":^^\")\n i = 1\n\n # displays the options\n @options.each do |option|\n print(i.to_s + ' ')\n puts(option.get_name)\n i += 1\n end\n\n # prompt and get valid input from the player\n print(@prompt_string)\n action = get_action\n\n # runs the selected action\n action.call :menu_select\n\n # some test code\n print(\"here\")\n end",
"def today_return_menu\n today_return_selection = @prompt.select(\"\\nSave to your favourites list or go back\\n\".blue) do |menu|\n menu.choice \"Save to favourites\", 1\n menu.choice \"Go back\", 2\n end \n today_return_selection(today_return_selection) \n end",
"def restart\n while get_state() == 'LOST'\n # Press a key to get score.\n @driver.action.send_keys(:up).perform\n sleep(0.2)\n end\n\n while get_state() == 'MENU'\n @driver.action.send_keys(:space).perform\n sleep(0.2)\n end\n\n @driver.action.send_keys(:space).perform\n end",
"def init \n greeting \n menu_list\n menu_selection\n goodbye\nend",
"def main_menu() \n user_input = nil\n while user_input != 4\n system(\"clear\")\n\n puts title_box(\"Main Menu\")\n\n prompt = TTY::Prompt.new\n question = \"Select an action:\"\n choices = [{\"Add book\" => 1}, {\"Check log\" => 2}, {\"Manage log\" => 3}, {\"Exit\" => 4}]\n user_input = prompt.select(question, choices) \n #add new book to log\n if user_input == 1\n add_book()\n #check log\n elsif user_input == 2\n check_log()\n # manage log\n elsif user_input == 3\n manage_log() \n else user_input == 4\n return user_input\n end\n end\nend",
"def next_action\n # puts \"Sequence#next_action\"\n reset_cur_action_repeat\n @action_index = (@action_index + 1) % @sub_actions.length\n @cur_repeat -= 1 if @action_index.zero?\n\n setup_action unless complete?\n end",
"def interactive_menu\n\tloop do\n\tprint_menu\n\tprocess(gets.chomp)\n\tend\nend",
"def gym_menu\n if self.gyms == []\n system \"clear\"\n puts \"You are not registered to any gyms at the moment\"\n sleep 3\n else\n gyms = self.registrations.map do |registration|\n Gym.find(registration.gym_id)\n end\n system \"clear\"\n TTY::Prompt.new.select(\"Here are your registered gyms:\") do |menu|\n gyms.map do |gym|\n menu.choice \"#{gym.name}\", -> {Gym.find_by(name: gym.name).list_gym_programs}\n end\n menu.choice \"Main Menu\"\n end\n end\n end",
"def today_menu\n @active = 1\n if @alive ==true\n today_header\n else\n offline_header\n end\n @selected_activity = []\n @chosen_today_activity = @prompt.select(\"\\nSelect an activity to find out more\\n\".blue, @processed_today.push({name: \"--Back to Menu--\", value: 11}).uniq) \n today_selection(chosen_today_activity) \n end",
"def print_menu\n puts \"Which action [list|add|delete|mark|idea|quit]?\"\nend",
"def assigned_menu\n\n end",
"def menu\n \tredirect_to session_new_path\n end",
"def interactive_menu\n loop do\n print_menu\n user_choice(STDIN.gets.chomp)\n end\nend",
"def main_menu\n h = { \n \"1\" => :view_article,\n \"2\" => :view_comments,\n :f => :display_forum,\n :v => :view_menu,\n :r => :reload,\n :m => :fetch_more,\n :R => :reddit_options,\n :H => :hacker_options,\n :s => :sort_menu, \n :C => :config_menu,\n :a => :view_article,\n :c => :view_comments,\n :x => :extras\n }\n=begin\n :a => :ack,\n \"/\" => :ffind,\n :l => :locate,\n :v => :viminfo,\n :z => :z_interface,\n :d => :child_dirs,\n :r => :recent_files,\n :t => :dirtree,\n \"4\" => :tree,\n :F => :filter_menu,\n :c => :command_menu ,\n :B => :bindkey_ext_command,\n :M => :newdir,\n \"%\" => :newfile,\n=end\n\n menu \"Main Menu\", h\nend",
"def menu_creation\n puts \"Inside the method\"\n puts \"We will be creating a menu\"\n yield\n puts \"We are now back in the method\"\n puts \"Leaving now\"\n yield\n\nend",
"def main_menu\n menu = [\n \"My Stats\",\n \"My Hikes\",\n \"Trails\",\n \"Quit\"]\n choice = nil\n while choice != \"Quit\"\n system 'clear'\n puts \"------MAIN MENU------\"\n choice = @prompt.select(\"What would you like to do #{@current_user.name}?\", menu)\n\n case choice\n when \"My Stats\"\n user_stats\n when \"My Hikes\"\n hike_options\n when \"Trails\"\n trail_options\n end\n end\n end",
"def menu\n\n puts \"________________\"\n\n puts \"insert the user name to continue\"\n @user_name = gets.chomp\n response = User.find_by(user_name: @user_name)\n\n puts \"________________\"\n\n if response\n \n mainscreen\n else\n puts \"try again\"\n menu\n end\n end",
"def create_menu\n items = Hash.new\n # action shd be a hash\n # menu should have array of hashes (or just a string)\n #db = { :name => \"Databases\", :accelerator => \"M-d\", :enabled = true, :on_right => :get_databases }\n #or = { :name => \"Open Recent\", :accelerator => \"M-o\", :enabled = true, :on_right => :get_recent }\n #find_array = {\"Find ...\" => :find, \"Find Next\" => :find_next, \"Find Previous\" => :find_prev}\n items[\"File >\"] = [\"Open ... C-o\" , \"Open Recent\", \"Databases\" , \"Tables\", \"Exit\"]\n items[\"Window >\"] = { \"Tile\" => nil, \"Find >\" => {\"Find ...\" => :find, \"Find Next\" => :find_next, \"Find Previous\" => :find_prev},\n \"Edit\" => nil, \"Whatever\" => nil}\n items[\"Others >\"] = { \"Shell Output ...\" => :shell_output, \"Suspend ...\" => :suspend , \"View File\" => :choose_file_and_view}\n\n # in the case of generated names how will call back know that it is a db name or a table name\n # We get back an array containing the entire path of selections\n right_actions = {}\n right_actions[\"Databases\"] = Proc.new { Dir.glob(\"**/*.{sqlite,db}\") }\n right_actions[\"Tables\"] = :get_table_names\n\n ret = popupmenu items, :row => 1, :col => 0, :bgcolor => :cyan, :color => :white, :right_actions => right_actions\n # ret can be nil, or have a symbol to execute, or a String for an item with no leaf/symbol\n if ret\n alert \"Got #{ret}\"\n last = ret.last\n if last.is_a? Symbol\n if respond_to?(last, true)\n send(last)\n end\n end\n end\n\n return\n r = 1\n ix = popuplist( top , :title => \" Menu \" , :row => r, :col => 0, :bgcolor => :cyan, :color => :white)\n if ix\n value = top[ix]\n ix = popuplist( items[value] , :row => r + 2 + ix, :col => 10, :bgcolor => :cyan, :color => :white)\n end\nend",
"def main_menu(user)\n calories = Calories.new\n loop do\n calories.calorie_intake(user)\n case Prompts.main_selection\n when '1'\n calories.log_daily_meals\n when '2'\n calories.log_daily_intake\n when '3'\n Details.update_weight(user)\n when '4'\n Quotes.inspirational\n when '5'\n quit\n end\n end\n end",
"def show_menu\n puts \"Type 'q' to quit\"\n puts \"Or press Return to continue\"\nend",
"def cancel_menu_call\n if @main and $game_temp.next_scene == \"menu\" and $game_temp.menu_beep\n $game_temp.next_scene = nil\n $game_temp.menu_beep = false\n end\n end",
"def main_menu\n \"Welcome to BATTLESHIP\\nEnter p to play or q to quit\"\n end",
"def forum_actions \n h = { :r => :reload, \n :n => :new_forum, \n :b => :display_forum, \n 'C-b' => :change_subforum, \n :N => :new_articles , \n :k => :delete_current_forum,\n :RIGHT => :next_forum,\n :LEFT => :previous_forum,\n :l => :view_log,\n :C => :config_menu,\n 'C-c' => :quit_app}\n\n ch, menu_text = menu \"Forum Menu \", h\n menu_text = :quit if ch == \"q\"\n return unless menu_text\n case menu_text.to_sym\n when :quit\n when :reload\n fetch_data_from_net $subforum\n when :pages\n $num_pages += 1\n when :new_articles\n new_articles\n when :new_forum\n fetch_data_from_net\n when :change_subforum\n change_file\n when :quit_app\n quit_command\n when :view_log\n view_log\n when :open_command\n print \"Enter open command: \"\n str = Readline::readline('>', true)\n if str && str != \"\"\n $open_command = str\n end\n end\nend",
"def sub_menu\n puts \"\\n***********************************************\".colorize(:magenta).blink\n puts \"Type the following letters to do...\".colorize(:blue)\n puts \"-----------------------------------------------\".colorize(:cyan).bold\n puts \"s = Save Recipe to My Favorites\".colorize(:blue)\n puts \"r = Rate Recipe\".colorize(:blue)\n puts \"a = See Average Recipe Rating\".colorize(:blue)\n puts \"o = Open Link to See the Steps for This Recipe\".colorize(:blue)\n puts \"m = Back to Main Menu\".colorize(:blue)\n puts \"***********************************************\\n \".colorize(:magenta).blink\n end",
"def choose_first_click; end",
"def menu\n puts '1) Promedio de notas'\n puts '2) Inasistencia alumnos'\n puts '3) Alumnos aprobados'\n puts '4) Salir'\nend",
"def main_menu\n h = { \n :a => :ack,\n \"/\" => :ffind,\n :l => :locate,\n :v => :viminfo,\n :z => :z_interface,\n :d => :child_dirs,\n :r => :recent_files,\n :t => :dirtree,\n \"4\" => :tree,\n :s => :sort_menu, \n :F => :filter_menu,\n :c => :command_menu ,\n :B => :bindkey_ext_command,\n :M => :newdir,\n \"%\" => :newfile,\n :x => :extras\n }\n menu \"Main Menu\", h\nend",
"def main_menu\n \twhile true\n \t\tprint_main_menu\n\n \t\tprint \"Choose an option:\"\n \t\tuser_input = gets.chomp.to_i\n\n \t\tbreak if user_input == 7\n \t\t\n choose_option(user_input)\n \tend\n end",
"def main_menu\n while true\n puts \"Options:\"\n puts \"[1] Add a new field of crops\"\n puts \"[2] Harvest crops\"\n puts \"[3] Status of farm\"\n puts \"[4] Relax and view fields\"\n puts \"[5] Exit\"\n puts \"Enter a Number\"\n main_menu_opt = gets.chomp.to_i\n case main_menu_opt\n when 1 then field #will run field method\n when 2 then harvest #will run harvest method\n when 3 then status #will run status method\n when 4 then relax #will run relax method\n else exit\n end\n end\n end",
"def print_menu menu_level= '0'\n print_menu_header menu_level\n\n 20.times do |counter|\n lvl = \"#{menu_level}.#{counter}\"\n puts \" #{counter} : \" + @menu_map[lvl][0] if @menu_map.has_key?(lvl)\n end\n puts \"Make a choice between those items. (X to exit)\"\n puts \"Use left arrow to go back\"\n end",
"def main_menu\n puts \" \"\n user_repeat = true\n while user_repeat == true\n puts \"What would you like to do? (Enter Number)\"\n puts \"1: Create Knight(s)\"\n puts \"2: Control Knights\"\n puts \"3: View Army\"\n puts \"4: Exit\"\n user_input = gets.chomp\n if user_input == \"1\"\n create_knights\n user_repeat = false\n elsif user_input == \"2\"\n control_knights\n user_repeat = false\n elsif user_input == \"3\"\n view_army\n user_repeat = false\n elsif user_input == \"4\"\n user_repeat = false \n else\n puts \"Not a valid selection!\" \n end\n end \nend",
"def atom_menu\n puts \"================\"\n puts \"Make a selection\"\n puts \"================\"\n puts \"1: ctrl + cmd + ^ or v\"\n puts \"2:\"\n puts \"8: Main Menu\"\n puts \"9: exit\"\n case gets.strip\n when \"1\"\n puts \"ctrl + cmd + ^ or v\"\n puts \"grabs the line you are on and moves it up or down as you want.\"\n reset\n #this gap is for adding more functions\n\n when \"8\"\n main_menu\n when \"9\"\n exit 0\n else\n bad_choice\n atom_menu\n end\nend",
"def main_menu\n h = {\n a: :ag,\n z: :z_interface,\n # f: :file_actions,\n b: :bookmark_menu,\n c: :create_menu,\n f: :filter_menu,\n o: :order_menu,\n s: :selection_menu,\n t: :toggle_menu,\n v: :view_menu,\n '`' => :goto_parent_dir,\n x: :extras\n }\n menu 'Main Menu', h\nend",
"def menu_selection \nend",
"def main_menu_options\n a = Artii::Base.new #display main title greeting\n a.asciify('Menu')\n puts a.asciify('Menu').colorize(:blue)\n\n puts \"\"\n puts \"1. Search movies.\"\n puts \"2. View your list.\"\n puts \"\"\n puts \"Please input the number corresponding to your choice.\"\n input = gets.chomp #todo Check to see if you can break this\n system \"clear\"\n if input == '1'\n puts \"Let's look at some movies.\"\n movie_search #send user to the movie search screen\n elsif input == '2'\n display_movie_list_and_movie_list_options #send movie to the movie list screen\n else\n \"Please select a valid option\"\n main_menu_options #call the method again\n end\n end",
"def interactive_menu\n # Repeat once a processs has been carried out\n loop do\n # Print the menu and ask the user what to do\n print_menu\n # Do what the user has selected (corresponding to the number entered by the user)\n selected_option(STDIN.gets.chomp)\n end\nend",
"def reset!\n @menus = register(Vedeu::Menu)\n end",
"def edit_hike_menu(hike_instance)\n menu = [\"Delete\", \"Change Time on Trail\", \"Exit\"]\n system 'clear'\n puts \"-----MY HIKES-----\"\n choice = @prompt.select(\"Which action would you like to take?\", menu)\n case choice\n when \"Delete\"\n delete_hike(hike_instance)\n when \"Change Time on Trail\"\n change_time(hike_instance)\n end\n end",
"def menu\n puts \"\\n************************************************************\".colorize(:magenta).blink\n puts \"Select an option (1-5) from the menu below:\".colorize(:blue).bold\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"1. Don't want to think about what to cook? \\n Spin the RANDOM WHEEL OF RECIPES!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"2. Need some inspiration for cooking? \\n Find recipe by name OR \\n if you have leftover ingredients search your ingredients!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"3. Feeling creative? \\n Write and save your own recipe!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"4. View ALL your favorite recipes in 1 place!\".colorize(:blue)\n puts \"------------------------------------------------------------\".colorize(:cyan)\n puts \"5. You're done? Time to exit...\".colorize(:blue)\n puts \"************************************************************\\n \".colorize(:magenta).blink\n end",
"def setMenu\n\t\t@phase = \"menu\"\n\t\t@dialogueText.setText([\"What will you do?\"])\n\t\t@menuStack.push(@battleOptions)\n\t\t@enemyUnits = @battleManager.enemyUnits\n\t\t@hero.nextCommand = []\n\tend"
] |
[
"0.7005092",
"0.65725285",
"0.6523264",
"0.647607",
"0.64039874",
"0.63643485",
"0.63577473",
"0.63189715",
"0.63114065",
"0.62921345",
"0.6250853",
"0.6189849",
"0.61826587",
"0.61795837",
"0.6158655",
"0.61436075",
"0.61418915",
"0.61282444",
"0.61279035",
"0.6114345",
"0.6112996",
"0.61121047",
"0.61056805",
"0.60923314",
"0.609132",
"0.60856545",
"0.60827446",
"0.6078383",
"0.6033391",
"0.6029936",
"0.598",
"0.5976663",
"0.59739584",
"0.5965709",
"0.5937297",
"0.59318596",
"0.5928529",
"0.59031504",
"0.5894274",
"0.58901054",
"0.58889526",
"0.5885364",
"0.5885364",
"0.58842564",
"0.5867735",
"0.58669615",
"0.58641124",
"0.5858981",
"0.5853558",
"0.58430773",
"0.5825437",
"0.5823732",
"0.58003944",
"0.5800121",
"0.57948214",
"0.5792536",
"0.577578",
"0.57751906",
"0.57747805",
"0.57710415",
"0.57666415",
"0.5765168",
"0.5760929",
"0.5758421",
"0.57579035",
"0.5743945",
"0.5736953",
"0.5734193",
"0.5727493",
"0.5720632",
"0.5706748",
"0.57059926",
"0.5703778",
"0.5699994",
"0.5698387",
"0.56982905",
"0.56948644",
"0.56876194",
"0.5685014",
"0.56806153",
"0.56773007",
"0.56599313",
"0.5654938",
"0.56487566",
"0.564842",
"0.56469315",
"0.5645546",
"0.5641428",
"0.5634755",
"0.562913",
"0.56242216",
"0.5622245",
"0.56116855",
"0.56108",
"0.5610174",
"0.5608842",
"0.56040615",
"0.5599739",
"0.5590894",
"0.55869645"
] |
0.7359739
|
0
|
Returns a hash representation of the serializable object links.
|
def include_links!
return if options[:links] == false
key = configuration_for(:links).fetch :key, :_links
prepare_links!
@node.merge!(key => links) if links.any?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def hash\n [links, organization_id].hash\n end",
"def hash\n [rel, href].hash\n end",
"def hash\n\t\treturn [ self.subject, self.predicate, self.object ].hash\n\tend",
"def hash\n [author, created, icon, id, integration_id, is_favorite, is_read_only, is_shared, modified, popularity, tags, title, type, url].hash\n end",
"def serializable_hash\n @node = links.any? ? super.merge(_links: links) : super\n end",
"def hash\n return to_s.hash\n end",
"def hash\n [name, url].hash\n end",
"def hash\n [self_uri, alternate_links, index, orientation, size, type, shape].hash\n end",
"def hash\n to_s.hash\n end",
"def hash\r\n return to_s.hash\r\n end",
"def to_hash() end",
"def hash\n [principals, relation].hash\n end",
"def links\n @links ||= lambda do \n raw_links.map do |link|\n hash = {}\n link.keys.each do |key|\n hash[key] = link[key]\n end\n hash\n end\n end.call\n end",
"def to_hash\n object\n end",
"def hash\n [self_uri, alternate_links, name, width, height, alternative_text, alternative_text_title, hidden, x, y, z_order_position, fill_format, effect_format, three_d_format, line_format, hyperlink_click, hyperlink_mouse_over, type, is_object_icon, substitute_picture_title, substitute_picture_format, object_name, embedded_file_base64_data, embedded_file_extension, object_prog_id, link_path, update_automatic].hash\n end",
"def hash\n [description, routing_number, account_number, account_type, signatory, metadata, id, signature_url, bank_name, verified, date_created, date_modified, deleted, object].hash\n end",
"def links\n\t\t@links.keys\n\tend",
"def hash\n [_hash, name, owner].hash\n end",
"def inspect\n @lock.synchronize do\n links = @links.to_a.map { |l| \"#{l.class}:#{l.object_id}\" }.join(',')\n \"#<Celluloid::Links[#{links}]>\"\n end\n end",
"def hash\n to_a.hash\n end",
"def hash\n [content_addressable].hash\n end",
"def links\n @links.values\n end",
"def hash\n [class_id, object_type, action, cache_state, cached_time, last_access_time, md5sum, original_sha512sum, path, registered_workflows, used_count, file, network_element].hash\n end",
"def to_hash\n h = self.href.nil? ? '' : self.href\n r = self.rel.nil? ? '' : self.rel\n t = self.title.nil? ? '' : self.title\n y = self.type.nil? ? '' : self.type\n\n { \n \"href\" => h,\n \"type\" => y,\n \"rel\" => r,\n \"title\" => t\n }\n end",
"def links\n param = {lat: lat.to_f, lng: lng.to_f, latlng: latlng}\n Hashie::Mash.new(EXTERNAL_LINKS.map{|key, pattern| [key, pattern % param]}.to_h)\n end",
"def hash\n raw = [name, type, values.join('/')].join(' ')\n Digest::MD5.hexdigest(raw)\n end",
"def hash\n \"#{self.class.name}-#{self.id}-#{@__metadata__.cas}-#{@__attributes__.hash}\".hash\n end",
"def hash\n [self.class, to_s].hash\n end",
"def hash\n object_id\n end",
"def hash #:nodoc:\n __getobj__.hash ^ self.class.hash\n end",
"def hash\n [_self, _links, _schema, _revision, _system_owned, display_name, description, tags, _create_user, _protection, _create_time, _last_modified_time, _last_modified_user, id, resource_type, path, parent_path, unique_id, relative_path, children, overridden, marked_for_delete, tcp_closed, tcp_opening, udp_single, tcp_finwait, tcp_first_packet, tcp_closing, tcp_established, udp_multiple, icmp_error_reply, udp_first_packet, icmp_first_packet].hash\n end",
"def hash\n [self.class, to_s].hash\n end",
"def to_hash\n @relations.each_with_object({}) do |(rel,val), obj|\n rel = rel.to_s\n\n hashed_val = val.map(&:to_hash)\n if val.length == 1 && !single_item_arrays?\n hashed_val = val.first.to_hash\n end\n\n obj[rel] = hashed_val\n end\n end",
"def hash\n [fully_qualified_rel, raw_href, templated?].hash\n end",
"def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end",
"def to_link_json\n {\n sys: {\n type: 'Link',\n linkType: 'Upload',\n id: id\n }\n }\n end",
"def hash\n [self_uri, alternate_links, accent1, accent2, accent3, accent4, accent5, accent6, dark1, dark2, followed_hyperlink, hyperlink, light1, light2].hash\n end",
"def hash\n to_s.hash\n end",
"def hash\n to_s.hash\n end",
"def hash\n\t\treturn [ self.class, self.dn ].hash\n\tend",
"def hash\n model.hash + key.hash\n end",
"def hash\n [fully_qualified_rel,\n raw_href,\n templated?].hash\n end",
"def hash\n to_h.hash ^ self.class.hash\n end",
"def _hash(obj)\n obj.transform_values { |v| _renc(v) }\n end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def hash() end",
"def to_hash\n @hash\n end",
"def inspect\n \"#<#{self.class}:#{object_id} to_hash=#{to_hash.inspect}>\"\n end",
"def hash\n [self.class, to_h].hash\n end",
"def hash\n [self.class, to_h].hash\n end",
"def hash\n [self.class, to_h].hash\n end",
"def hash\n return @revision.hash if @revision\n return object_id\n end",
"def to_hash\n @_hash_\n end",
"def hash\n source.hash ^ target.hash\n end",
"def hash\n self.atoms.hash\n end",
"def serializable_hash\n return nil if @object.nil?\n @node = attributes\n include_links!\n # include_associations! if _embed\n @node\n end",
"def hash\n @hash ||= self.to_a.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def hash\n attributes.hash\n end",
"def to_hash\n {\n 'git' => @git,\n 'ref' => @ref\n }\n end",
"def hash\n [_self, _links, _schema, _revision, _system_owned, display_name, description, tags, _create_user, _protection, _create_time, _last_modified_time, _last_modified_user, id, resource_type, ip_protocol, server_tcp_profile_id, sorry_pool_id, port, server_ssl_profile_binding, pool_id, client_tcp_profile_id, default_pool_member_port, access_log_enabled, application_profile_id, max_concurrent_connections, rule_ids, max_new_connection_rate, persistence_profile_id, client_ssl_profile_binding, default_pool_member_ports, ip_address, ports, enabled].hash\n end",
"def hash\n [custom_headers, encode_as, name, payload, url].hash\n end",
"def hash\n @id.hash\n end",
"def hash\n [avatar, banner, created_at, description, handle, hidden_modules, link_count, modified_at, name, summary, user_count, visible_modules].hash\n end",
"def hash\n digest = Digest::MD5.new\n digest << title.to_s\n digest << content.join('').to_s\n digest.to_s\n end",
"def hash\n [anchor, cv, nullifier, proof, rk, spend_auth_sig].hash\n end",
"def to_hash\n @hash\n end",
"def to_hash\n @hash\n end",
"def hash\n @children.hash\n end",
"def hash\r\n id.hash\r\n end",
"def hash\n [id, to, from, carrier, thumbnails, size, expected_delivery_date, date_created, date_modified, deleted, front_template_id, back_template_id, front_template_version_id, back_template_version_id, tracking_events, object, url, description, metadata, mail_type, merge_variables, send_date, use_type].hash\n end",
"def hash\n [author_email, author_name, author_time, branch, commit_time, committer_email, committer_name, default_branch, message, repository_url, sha, tag].hash\n end",
"def hash\n [id, name, change_number, date_created, date_modified, date_uploaded, content_uri, workspace, created_by, uploaded_by, content_type, content_length, system_type, filename, page_count, read, caller_address, receiver_address, tags, tag_values, attributes, thumbnails, upload_status, upload_destination_uri, upload_method, lock_info, acl, sharing_status, sharing_uri, download_sharing_uri, self_uri].hash\n end",
"def to_s\n \"#<\" + self.class.name + \": \" + href + \">\"\n end",
"def to_hash\n @aliases\n end",
"def attributes_hash(object); end",
"def hash\n\t\t[@id].hash\n\tend",
"def to_hash(object)\n validate_class_kit(object.class)\n\n @hash_helper.to_hash(object)\n end",
"def serializable_hash\n self.attributes\n end",
"def hash\n title.hash\n end",
"def hash\n [self.class, id].hash\n end",
"def hash\n return @id.hash\n end",
"def hash\n @node.sort.push(@edge).hash\n end",
"def hash\n [check_id, exceptions, key, links, port, proof, protocol, since, status].hash\n end",
"def references\n references_hash.to_json\n end",
"def hash\n id.hash\n end",
"def hash\n\t\treturn self.name.to_s.hash\n\tend",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end",
"def hash\n id.hash\n end"
] |
[
"0.7182875",
"0.7038139",
"0.63129836",
"0.6245377",
"0.6240718",
"0.61267585",
"0.612632",
"0.6125655",
"0.61029357",
"0.6100584",
"0.606982",
"0.60530144",
"0.6049339",
"0.6030536",
"0.60302866",
"0.60256726",
"0.6024449",
"0.6023507",
"0.60229737",
"0.59952676",
"0.5994651",
"0.5991358",
"0.5965472",
"0.5956098",
"0.5950181",
"0.5945027",
"0.5943867",
"0.5933455",
"0.5930315",
"0.5929686",
"0.59174186",
"0.5907764",
"0.5894053",
"0.5893146",
"0.58639127",
"0.58639127",
"0.5856452",
"0.5852298",
"0.5852298",
"0.58242935",
"0.5803714",
"0.5801041",
"0.57898927",
"0.57781494",
"0.57777476",
"0.57777476",
"0.57777476",
"0.57777476",
"0.57777476",
"0.57777476",
"0.57777476",
"0.57717866",
"0.5766478",
"0.57639664",
"0.57639664",
"0.57639664",
"0.5763208",
"0.5758665",
"0.5751643",
"0.5746435",
"0.57408524",
"0.57395345",
"0.57384944",
"0.57384944",
"0.57384944",
"0.57346106",
"0.5701888",
"0.5697243",
"0.5683391",
"0.5681823",
"0.56816536",
"0.56811017",
"0.5677162",
"0.5677162",
"0.56724095",
"0.566668",
"0.56661224",
"0.5650044",
"0.5638227",
"0.5635879",
"0.56343204",
"0.56315905",
"0.56308293",
"0.5626972",
"0.56218266",
"0.5611571",
"0.5608785",
"0.56086385",
"0.5608461",
"0.56071407",
"0.5599986",
"0.5596937",
"0.5595065",
"0.5593662",
"0.55934876",
"0.55934876",
"0.55934876",
"0.55934876",
"0.55934876",
"0.55934876",
"0.55934876"
] |
0.0
|
-1
|
Setup hypermedia links by invoking their blocks
|
def prepare_links!(*args)
compile_links_for(_link_configs, *args).each do |link|
rel = link.delete :rel
links[rel] = link
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def prepare_links!\n links_def = find_links_definition or return\n \n links_def.rel2block.each do |link|\n links.update_link(Feature::Hypermedia::Hyperlink.new.tap do |hyperlink| # create Hyperlink representer.\n hyperlink.rel = link[:rel]\n hyperlink.href = run_link_block(link[:block])\n end)\n end\n end",
"def media_link &block\n ASObj.generate :media_link,true,&block\n end",
"def create_links\n end",
"def create_links\n end",
"def links; end",
"def links; end",
"def my_links\n end",
"def link_to( *args, &link_block )\n if block_given?\n name = @template.capture(&link_block)\n options = args.first || {}\n html_options = args.second || {}\n\n link_to_in_block( name, options, html_options, &link_block )\n else\n name = args[0]\n options = args[1] || {}\n html_options = args[2] || {}\n\n link_to_in_html( name, options, html_options )\n end.tap { @item_count += 1 } # Increment the number of links generated (and still return markup)\n end",
"def each_hyperlink # :yields: text\n links = []\n each_hyperlink_attribute {|elem, attr, hyperlink|\n yield hyperlink\n }\n end",
"def each_hyperlink # :yields: text\n each_hyperlink_attribute {|elem, attr, hyperlink|\n yield hyperlink\n }\n end",
"def each_link(&block)\n return enum_for(__method__) unless block_given?\n\n each_body do |content_type,body|\n mime_type = MIME::Type.new(content_type)\n\n case mime_type.sub_type\n when 'html', 'xhtml'\n Nokogiri::HTML(body).search('//a[@href]').each do |a|\n yield a.attr('href')\n end\n when 'plain'\n URI.extract(body,['http','https'],&block)\n end\n end\n end",
"def handle_links(links_object)\n @uri = links_object['file']\n end",
"def parse_link; end",
"def parse_link_definition; end",
"def link() url; end",
"def link() url; end",
"def links(content=nil,opts={}, &block)\n content_for(:linkbar, capture(&block))\n end",
"def links_feed\n end",
"def links\n construct_html(self.items)\n end",
"def auto_link_urls(text, options = {}, &block)\n auto_link_entities(text, Extractor.extract_urls_with_indices(text, :extract_url_without_protocol => false), options, &block)\n end",
"def link *a; app.link *a end",
"def doublelink_each_link(html)\n Nokogiri::HTML(html).css('.double-link').each do |doublelink|\n title_link = doublelink.css('.media__bd__header').text.strip\n subtitle_link = doublelink.css('.media__bd__subheader').text.strip\n\n yield(title_link, subtitle_link)\n end\n end",
"def link\n raise ArgumentError, 'block not supplied' unless block_given?\n define_method { |*args, &block| yield caller, self, args, block }\n end",
"def each\n @links.each { |title, url| yield title, url }\n end",
"def html_link(item)\n tag :a, yield, :href => item.url\n end",
"def create_links(tweet)\n # NOTE: URLs before Users, otherwise we'll double escape the URLs\n link_users(link_hashtags(link_urls(html_escape(tweet))))\n #link_users(link_urls(html_escape(tweet)))\n end",
"def prepare_links!(*args)\n # TODO: move this method to _links or something so it doesn't need to be called in #serialize.\n compile_links_for(link_configs, *args).each do |lnk|\n links.add(lnk) # TODO: move to LinkCollection.new.\n end\n end",
"def links\n @links = super || []\n end",
"def auto_link(text, options = {}, &block)\n auto_link_entities(text, Extractor.extract_entities_with_indices(text, :extract_url_without_protocol => false), options, &block)\n end",
"def processLinks\n if params[:plant][:links_attributes]\n for i in 0..2\n @curLink = @plant.links[i]\n\n if !params[:plant][:links_attributes][i.to_s][:name].empty?\n @curLink.name = params[:plant][:links_attributes][i.to_s][:name]\n end\n if !params[:plant][:links_attributes][i.to_s][:link].empty?\n @curLink.link = params[:plant][:links_attributes][i.to_s][:link]\n end\n end\n end\n end",
"def link_to(*args, &block)\n if block_given?\n super(*args)\n else\n options = args[1] || {}\n html_options = args[2] || {}\n unless html_options.has_key? :'data-id'\n begin\n path = URI.split(url_for(options) || html_options['href'])[5].split(/\\//).select {|x| !x.empty?}\n if path.size > 0\n max = path.size <= 3 ? path.size : 3\n id = path.last(max).join('_')\n else\n id = 'not_defined'\n end\n rescue Exception => e\n id = 'not_parseable'\n end\n html_options.merge!(:'data-id' => \"aid_#{id}\")\n end\n super(args[0], args[1], html_options)\n end\n end",
"def link *a, &b; app.link *a, &b end",
"def link_everything_to_site\n @items.each { |i| i.site = self }\n @layouts.each { |l| l.site = self }\n @code_snippets.each { |cs| cs.site = self }\n end",
"def link_everything_to_site\n @items.each { |i| i.site = self }\n @layouts.each { |l| l.site = self }\n @code_snippets.each { |cs| cs.site = self }\n end",
"def visit_links\n @link_rules.accept\n end",
"def handle_links(json) end",
"def click(link); end",
"def link_self; end",
"def link_at address , context\n super #just sets the position\n @entry.link_at address , context\n address += @entry.length\n @blocks.each do |block|\n block.link_at(pos , context)\n pos += block.length\n end\n end",
"def links\n return unless success? and body\n\n doc = Nokogiri::HTML(@body)\n \n links = []\n\n doc.css('div.list-lbc a').each do |a|\n link = {\n :url => a['href'],\n :title => a.css('div.title').first.content.strip\n }\n\n link[:ad_id] = link[:url][/^http:\\/\\/www.leboncoin.fr\\/locations\\/(\\d+).*/,1]\n links << link\n yield link if block_given?\n end\n\n links\n end",
"def parse_autolink; end",
"def link uri\n self.apply_hyperlink java.net.URI.new(uri)\n end",
"def apply_step_to_links(step, links, release)\n # Delegate creation of next releases to the lambda\n next_releases = step.call(release, links)\n next_releases = [next_releases] unless next_releases.is_a?(Array)\n # Merge processing results into a new array\n next_releases.map do |next_release|\n result = release.merge(next_release)\n if result.key?(:link)\n result[:url] = \"#{release[:url]}#{next_release[:link][:href]}\"\n result.delete(:link)\n end\n result[:url] += '/' unless result[:url].end_with?('/')\n result\n end\n end",
"def links\n each_link.to_set\n end",
"def auto_link_urls(text, html_options = {})\n extra_options = Mash.new(html_options).to_html_attributes\n extra_options = \" #{extra_options}\" unless extra_options.blank?\n\n text.gsub(AUTO_LINK_RE) do\n all, a, b, c, d = $&, $1, $2, $3, $4\n if a =~ /<a\\s/i # don't replace URL's that are already linked\n all\n else\n text = b + c\n text = yield(text) if block_given?\n %(#{a}<a href=\"#{b==\"www.\"?\"http://www.\":b}#{c}\"#{extra_options}>#{text}</a>#{d})\n end\n end\n end",
"def make_link(name, web, text = nil, options = {})\n mode = (options[:mode] || :show).to_sym\n link_type = (options[:link_type] || :show).to_sym\n\n if (link_type == :show)\n known_page = web.has_page?(name)\n else\n known_page = web.has_file?(name)\n description = web.description(name)\n description = description.unescapeHTML.escapeHTML if description\n end\n if (text == name)\n text = description || text\n else\n text = text || description\n end\n text = (text || WikiWords.separate(name)).unescapeHTML.escapeHTML\n \n case link_type\n when :show\n page_link(mode, name, text, web.address, known_page)\n when :file\n file_link(mode, name, text, web.address, known_page, description)\n when :pic\n pic_link(mode, name, text, web.address, known_page)\n when :audio\n media_link(mode, name, text, web.address, known_page, 'audio')\n when :video\n media_link(mode, name, text, web.address, known_page, 'video')\n when :delete\n delete_link(mode, name, web.address, known_page)\n else\n raise \"Unknown link type: #{link_type}\"\n end\n end",
"def parse_links\n @body.scan(@@link_re) do |x|\n m = Regexp.last_match\n type = 'link'\n from = self\n text = m['text_or_to']\n to = @twine.passage_from_name(m['to'] ? m['to'] : m['text_or_to'])\n @links << Link.new(from, to, text, type)\n end\n end",
"def auto_link_urls(text)\n text.gsub(AUTO_LINK_RE) do\n all, a, b, c, d = $&, $1, $2, $3, $4\n if a =~ /<a\\s/i # don't replace URL's that are already linked\n all\n else\n text = b + c\n text = yield(text) if block_given?\n %(#{a}<a href=\"#{b==\"www.\"?\"http://www.\":b}#{c}\">#{text}</a>#{d})\n end\n end\n end",
"def handle_special_HYPERLINK(special); end",
"def links\n @links ||= %w{ a area }.map do |tag|\n search(tag).map do |node|\n Link.new(node, @mech, self)\n end\n end.flatten\n end",
"def links\n @links ||= %w{ a area }.map do |tag|\n search(tag).map do |node|\n Link.new(node, @mech, self)\n end\n end.flatten\n end",
"def link_to(name, url, options = {}); end",
"def links(object=nil)\n options[:links] ||= []\n options[:links] << object if object\n options[:links]\n end",
"def gen_links (res, item, &block)\n\n if block # unique element\n\n [ link('via', res), link('self', res, block.call(item)) ]\n\n elsif item.respond_to?(:current_page) and item.total_pages > 1\n\n a = [\n link('via', ''),\n link('self', res, 'page' => item.current_page)\n ]\n a << link('prev', res, 'page' => item.current_page - 1) \\\n if item.current_page > 1\n a << link('next', res, 'page' => item.current_page + 1) \\\n if item.current_page < item.total_pages\n a\n\n else # collection\n\n [ link('via', ''), link('self', res) ]\n end\n end",
"def href; end",
"def each_uri(base_uri=nil) # :yields: URI\n each_hyperlink_uri(base_uri) {|hyperlink, uri| yield uri }\n end",
"def each_uri(base_uri=nil) # :yields: URI\n each_hyperlink_uri(base_uri) {|hyperlink, uri| yield uri }\n end",
"def link_4menu(item) #:nodoc:\n html = ''\n link = item.link\n link = \"/#{@site.route_name}/#{item.page_id}\" #if link.blank?\n# \n html << @parent.link_to(item.picture, link) unless item.picture.blank?\n html << if !item.caption.blank?\n # TODO Translation\n @parent.link_to(item.caption, link)\n end\nend",
"def link(**opt)\n opt[:path] = show_path(id: object.identifier)\n super(**opt)\n end",
"def href!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n type = HREF\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 371:7: 'href'\n match( \"href\" )\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__, 41 )\n\n end",
"def inline_auto_link(text)\n text.gsub!(AUTO_LINK_RE) do\n all, leading, proto, url, post = $&, $1, $2, $3, $6\n if leading =~ /<a\\s/i || leading =~ /![<>=]?/\n # don't replace URL's that are already linked\n # and URL's prefixed with ! !> !< != (textile images)\n all\n else\n # Idea below : an URL with unbalanced parethesis and\n # ending by ')' is put into external parenthesis\n if ( url[-1]==?) and ((url.count(\"(\") - url.count(\")\")) < 0 ) )\n url=url[0..-2] # discard closing parenth from url\n post = \")\"+post # add closing parenth to post\n end\n tag = content_tag('a', proto + url, :href => \"#{proto==\"www.\"?\"http://www.\":proto}#{url}\", :class => 'external')\n %(#{leading}#{tag}#{post})\n end\n end\n end",
"def my_auto_link(text, href_options = {})\n extra_options = tag_options(href_options.stringify_keys) || \"\"\n text.gsub(AUTO_LINK_RE) do\n all, a, b, c, d = $&, $1, $2, $3, $5\n if a =~ /<a\\s/i # don't replace URL's that are already linked\n all\n else\n text = b + c\n text = yield(text) if block_given?\n %(#{a}<a href=\"#{b==\"www.\"?\"http://www.\":b}#{c}\"#{extra_options}>#{text}</a>#{d})\n end\n end\n end",
"def activate_links(fields, types)\n fields.each do |field|\n field[:type] = activate_field_links(field[:type], types, auto_link: true) if field[:type]\n field[:note] = activate_field_links(field[:note], types) if field[:note]\n field[:description] = activate_field_links(field[:description], types) if field[:description]\n end\n end",
"def linkPages\n @all_pages.each_value do |one_page|\n one_page.addPageLinks\n end\n @all_pages.each_value do |one_page|\n one_page.addMissingLinkNames\n end\n end",
"def link_standard_from_code(to, from)\n to.source = from.container.url\n to.id = from.id\n to.uri = from.uri\n to.prefix = from.container.id\n to.title = from.title\n to.description = from.description\n to.pattern = from.pattern\nend",
"def permalinked\n yield(self)\n end",
"def link(_content, _url)\n raise NotImplementedError\n end",
"def links\n\t\t( 0...self.link_count ).collect do |i|\n\t\t\tself.link( i )\n\t\tend\n\tend",
"def link!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = LINK\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 159:8: 'link'\n match( \"link\" )\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__, 25 )\n\n end",
"def include_links!\n return if options[:links] == false\n key = configuration_for(:links).fetch :key, :_links\n prepare_links!\n @node.merge!(key => links) if links.any?\n end",
"def each(&block)\n @lock.synchronize do\n @links.each(&block)\n end\n end",
"def layouts_show_links(*args)\n render \"layouts/show/links\", obj: args.shift, sender: args.shift, args: args \n end",
"def links\n if @links.blank?\n @links = []\n link_nodes =\n FeedTools::XmlHelper.combine_xpaths_all(self.channel_node, [\n \"atom10:link\",\n \"atom03:link\",\n \"atom:link\",\n \"link\",\n \"channelLink\",\n \"a\",\n \"url\",\n \"href\"\n ])\n for link_node in link_nodes\n link_object = FeedTools::Link.new\n link_object.href = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:href\",\n \"@atom03:href\",\n \"@atom:href\",\n \"@href\",\n \"text()\"\n ], :select_result_value => true)\n if link_object.href == \"atom10:\" ||\n link_object.href == \"atom03:\" ||\n link_object.href == \"atom:\"\n link_object.href = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@href\"\n ], :select_result_value => true)\n end\n if link_object.href.nil? && link_node.base_uri != nil\n link_object.href = \"\"\n end\n begin\n if !(link_object.href =~ /^file:/) &&\n !FeedTools::UriHelper.is_uri?(link_object.href)\n link_object.href = FeedTools::UriHelper.resolve_relative_uri(\n link_object.href,\n [link_node.base_uri, self.base_uri])\n end\n rescue\n end\n if self.configurations[:url_normalization_enabled]\n link_object.href =\n FeedTools::UriHelper.normalize_url(link_object.href)\n end\n link_object.href.strip! unless link_object.href.nil?\n next if link_object.href.blank?\n link_object.hreflang = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:hreflang\",\n \"@atom03:hreflang\",\n \"@atom:hreflang\",\n \"@hreflang\"\n ], :select_result_value => true)\n if link_object.hreflang == \"atom10:\" ||\n link_object.hreflang == \"atom03:\" ||\n link_object.hreflang == \"atom:\"\n link_object.hreflang = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@hreflang\"\n ], :select_result_value => true)\n end\n unless link_object.hreflang.nil?\n link_object.hreflang = link_object.hreflang.downcase\n end\n link_object.rel = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:rel\",\n \"@atom03:rel\",\n \"@atom:rel\",\n \"@rel\"\n ], :select_result_value => true)\n if link_object.rel == \"atom10:\" ||\n link_object.rel == \"atom03:\" ||\n link_object.rel == \"atom:\"\n link_object.rel = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@rel\"\n ], :select_result_value => true)\n end\n unless link_object.rel.nil?\n link_object.rel = link_object.rel.downcase\n end\n if link_object.rel.nil? && self.feed_type == \"atom\"\n link_object.rel = \"alternate\"\n end\n link_object.type = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:type\",\n \"@atom03:type\",\n \"@atom:type\",\n \"@type\"\n ], :select_result_value => true)\n if link_object.type == \"atom10:\" ||\n link_object.type == \"atom03:\" ||\n link_object.type == \"atom:\"\n link_object.type = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@type\"\n ], :select_result_value => true)\n end\n unless link_object.type.nil?\n link_object.type = link_object.type.downcase\n end\n link_object.title = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:title\",\n \"@atom03:title\",\n \"@atom:title\",\n \"@title\",\n \"text()\"\n ], :select_result_value => true)\n if link_object.title == \"atom10:\" ||\n link_object.title == \"atom03:\" ||\n link_object.title == \"atom:\"\n link_object.title = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@title\"\n ], :select_result_value => true)\n end\n # This catches the ambiguities between atom, rss, and cdf\n if link_object.title == link_object.href\n link_object.title = nil\n end\n link_object.length = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:length\",\n \"@atom03:length\",\n \"@atom:length\",\n \"@length\"\n ], :select_result_value => true)\n if link_object.length == \"atom10:\" ||\n link_object.length == \"atom03:\" ||\n link_object.length == \"atom:\"\n link_object.length = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@length\"\n ], :select_result_value => true)\n end\n if !link_object.length.nil?\n link_object.length = link_object.length.to_i\n else\n if !link_object.type.nil? && link_object.type[0..4] != \"text\" &&\n link_object.type[-3..-1] != \"xml\" &&\n link_object.href =~ /^http:\\/\\//\n # Retrieve the length with an http HEAD request\n else\n link_object.length = nil\n end\n end\n @links = [] if @links.nil?\n @links << link_object\n end\n end\n return @links\n end",
"def links\n @mandate_links ||= Links.new(@links)\n end",
"def make_link blocks\n raise \"from block #{@from.block_name} not found\" unless blocks.has_key?(@from.block_name)\n raise \"to block #{@to.block_name} not found\" unless blocks.has_key?(@to.block_name)\n \n from_block = blocks[@from.block_name]\n to_block = blocks[@to.block_name]\n \n raise \"from port #{@from.port_name} not found\" unless from_block.out_ports.has_key?(@from.port_name)\n raise \"to port #{@to.port_name} not found\" unless to_block.in_ports.has_key?(@to.port_name)\n \n from_port = from_block.out_ports[@from.port_name]\n to_port = to_block.in_ports[@to.port_name]\n \n return Link.new(:from => from_port, :to => to_port)\n end",
"def Link(x, y, w, h, link)\n\t\t#Put a link on the page\n @page_links ||= Array.new\n @page_links[@page] ||= Array.new\n @page_links[@page].push([x * @k, @h_pt - y * @k, w * @k, h*@k, link]);\n\tend",
"def add_link\n @bib.link.each do |l|\n case l.type&.downcase\n when \"doi\" then @item.doi = l.content\n when \"file\" then @item.file2 = l.content\n when \"src\" then @item.url = l.content\n end\n end\n end",
"def link_to_asset(body,model,url_opts={},html={})\n result = String.new\n result << '<a href=\"' + url_for_asset(model,url_opts) + '\">'\n result << body\n result << '</a>'\n end",
"def link(link, title, content)\n if no_links\n content\n else\n # \"<a href=\\\"#{DashboardRouter.normalize(link)}\\\" target=\\\"_top\\\">#{content}</a>\"\n \"<a href=\\\"#{link}\\\">#{content}</a>\"\n end\n end",
"def set_url(*raw_urls, &block)\n raw_urls = raw_urls.first if raw_urls.size == 1\n @source.set_url(raw_urls, &block)\n end",
"def maybe_item_thumb_links\n maybe_column.links(:class => \"img\", :href => /.*/) # ---------------------------------- EVERYTHING USING THIS NEEDS REPLACING!!!!!!!!\n end",
"def links=(value)\n @links = value\n end",
"def links=(value)\n @links = value\n end",
"def links=(value)\n @links = value\n end",
"def link_tree(*args, &block)\n if block_given?\n options = args.first || {}\n html_options = args.second\n ######### additional logic by ladas ##############\n html_options ||= {}\n html_options['onclick'] = \"parse_link_and_load_page($(this)); return false;\"\n #########################################\n link_to(capture(&block), options, html_options)\n else\n name = args[0]\n options = args[1] || {}\n html_options = args[2]\n ######### additional logic by ladas ##############\n html_options ||= {}\n html_options['onclick'] = \"parse_link_and_load_page($(this)); return false;\"\n #########################################\n html_options = convert_options_to_data_attributes(options, html_options)\n url = url_for(options)\n\n href = html_options['href']\n tag_options = tag_options(html_options)\n\n href_attr = \"href=\\\"#{ERB::Util.html_escape(url)}\\\"\" unless href\n \"<a #{href_attr}#{tag_options}>#{ERB::Util.html_escape(name || url)}</a>\".html_safe\n end\n end",
"def links\n @links ||= lambda do \n raw_links.map do |link|\n hash = {}\n link.keys.each do |key|\n hash[key] = link[key]\n end\n hash\n end\n end.call\n end",
"def follow_symlinks; end",
"def process_links!(source)\r\n links.each{ |l| source.gsub!(\"[[#{l}]]\", link(l)) }\r\n end",
"def link(*args)\n Restfulie::Common::Builder::Rules::Link.new(*args)\n end",
"def unwrap_links(elements); end",
"def process_links(base_uri, links, level = -1)\n links.each do |uri|\n # Good to process\n next unless good_resource?(uri)\n\n # Same domain\n next unless uri.host == base_uri.host\n\n # Already processed\n next if @processed_links.include? uri.to_s\n @processed_links << uri.to_s\n\n # Run\n puts uri\n begin\n page = agent.get(uri)\n puts \"\\tok\"\n if level != 0 && agent.get_cached?(uri)\n file_name = agent.cached_file_name(uri)\n new_links = process_data(uri, file_name)\n #ap new_links\n process_links(uri, new_links, level - 1)\n end\n rescue Mechanize::ResponseCodeError\n puts \"\\terror\"\n rescue => ex\n unless parser_params[:skip_errors]\n raise\n end\n end\n\n end\n end",
"def link\n h.content_tag :li do\n h.link_to h.content_tag(:i, '' , class: object.icon ) , object.url , target: \"_blank\" , title: object.name\n end\n end",
"def linkgen\n\n LinkGenerator.new(request)\n end",
"def convert_links\n\n # fetch leaf content\n c = self.content\n\n # regexps\n # url = /( |^)http:\\/\\/([^\\s]*\\.[^\\s]*)( |$)/\n tag_regex = /( |^)#(\\w+)( |$)/\n user_regex = /( |^)@(\\w+)( |$)/\n \n #TODO: make sure no one is typing javascript into the field **IMPORTANT**\n\n #replace #tags with links to that tag search\n while c =~ tag_regex\n c.gsub! \"##{$2}\", \"<a href='/leaves?tagged=#{$2}'>##{$2}</a>\"\n self.has_tags = true\n end\n\n #replace @usernames with links to that user, if user exists\n while c =~ user_regex\n user = $2\n if User.find(user)\n c.sub! \"@#{$2}\", \"<a href='/users/#{$2}'>@#{$2}</a>\"\n end\n end\n\n #replace urls with links\n #while c =~ url\n #name = $2\n #c.sub! /( |^)http:\\/\\/#{name}( |$)/, \" <a href='http://#{name}' >#{name}</a> \"\n #end\n\n self.content = c\n\n end",
"def sections_augmented_link( obj )\n title = \"\"\n title << obj.code unless obj.try( :code ).blank?\n title << \"\\n\" unless title.empty? or obj.try( :description ).blank?\n title << obj.description unless obj.try( :description ).blank?\n\n content_tag(\n :span,\n link_to( h( obj.title ), obj ),\n :title => title\n )\n end",
"def link_to(*args, &block)\n if block_given?\n options = args.first || {}\n html_options = args.second\n concat(link_to(capture(&block), options, html_options))\n else\n name = t(args.first, {:force => true})\n options = args.second || {}\n html_options = args.third\n\n url = url_for(options)\n\n if html_options\n html_options = html_options.stringify_keys\n href = html_options['href']\n convert_options_to_javascript!(html_options, url)\n tag_options = tag_options(html_options)\n else\n tag_options = nil\n end\n\n href_attr = \"href=\\\"#{url}\\\"\" unless href\n \"<a #{href_attr}#{tag_options}>#{name || url}</a>\"\n end\n end",
"def add_link(links)\n links = [links] if links.is_a?(String)\n self.class.get(\"/action/add/links/grabber0/start1/\"+links.join(\" \"))\n end",
"def embed_link\n self.embed = detect_host\n end",
"def follow_symlinks=(_arg0); end",
"def news_links\n visit \"http://hk.apple.nextmedia.com/\"\n\n links = doc.css(\"#article_ddl option\").collect do |option|\n link = Link.new\n link.title = option.text\n link.url = option[\"value\"]\n link\n end.reject { |l| l.url.nil? }\n links\n end"
] |
[
"0.7453498",
"0.7094221",
"0.6627272",
"0.6627272",
"0.64992857",
"0.64992857",
"0.64109993",
"0.6194785",
"0.60299706",
"0.60255325",
"0.60152775",
"0.5996744",
"0.5990297",
"0.5987193",
"0.59810024",
"0.59810024",
"0.595275",
"0.59221697",
"0.5900052",
"0.5853816",
"0.5821015",
"0.58184123",
"0.5796077",
"0.57444674",
"0.5741057",
"0.5727157",
"0.57268095",
"0.57254535",
"0.5702688",
"0.57008183",
"0.569417",
"0.56833863",
"0.5679537",
"0.5679537",
"0.56774753",
"0.56760657",
"0.5670962",
"0.5656817",
"0.56492954",
"0.5639333",
"0.56035525",
"0.55887043",
"0.55842996",
"0.55812865",
"0.5579946",
"0.55699813",
"0.5567585",
"0.5566567",
"0.5560805",
"0.55563825",
"0.55563825",
"0.55552596",
"0.5547066",
"0.55393195",
"0.55320734",
"0.5526119",
"0.5526119",
"0.55234873",
"0.55159307",
"0.5515795",
"0.5509632",
"0.5509309",
"0.5502637",
"0.5499742",
"0.54953575",
"0.5491415",
"0.5491085",
"0.54861337",
"0.547411",
"0.5473401",
"0.5462184",
"0.5460789",
"0.54480225",
"0.54426485",
"0.5441372",
"0.54406524",
"0.54350775",
"0.5433022",
"0.54104245",
"0.54100823",
"0.5406522",
"0.5404481",
"0.5404481",
"0.5404481",
"0.53982246",
"0.5390387",
"0.5377211",
"0.53717124",
"0.5361651",
"0.53596807",
"0.53594446",
"0.5351961",
"0.53432924",
"0.53397727",
"0.53334385",
"0.53323597",
"0.5331434",
"0.5327926",
"0.5326601",
"0.5315852"
] |
0.5858568
|
19
|
get the team code check if team code exists in database if it exists, redirect to new student user path if not, throw an error stating invalid team code
|
def parse_comments
team_code = params['team_code']
# result = AdvisorUser.where(team_code: team_code).take
result = Team.find_by(team_code: team_code)
if(result == nil)
session[:team_code_valid] = false
redirect_to join_team_index_path
else
session[:team_code_valid] = true
session[:team_code] = team_code
redirect_to "/student_users/new?student_level=High"
end
#redirect_to new_student_user_path
#do your stuff with comments_from_form here
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def verify_team\n set_team_from_team_id\n unless ( @team )\n flash[:error] = I18n.t(:invalid_action_request) + ' - ' + I18n.t('meeting.errors.missing_team_id')\n redirect_to( meetings_current_path() ) and return\n end\n end",
"def check_use_team\r\n if !params[:team_id].nil?\r\n users = Team.find_by_id(params[:team_id]).users\r\n if !(users.include?(current_user))\r\n redirect_to frontend_root_path,\r\n notice: \"Team not Assigned\"\r\n end\r\n end\r\n end",
"def verify_parameter\n set_team\n unless ( @team )\n flash[:error] = I18n.t(:invalid_action_request)\n redirect_back( fallback_location: root_path ) and return\n end\n end",
"def search_team\n # if user.active_code > 1, can't show this page, redirect to home page!!! \n if current_user.active_code > 1\n redirect_to \"/users/home\"\n # show info\n else\n # level\n @levels = Level.all\n # sport\n if params[:commit] != \"select\" and params[:commit] != \"next\" and params[:commit] != \"join\" and params[:commit] != nil\n sql = ActiveRecord::Base.connection()\n sql.execute(\"DELETE FROM user_sport_preferences WHERE user_id = \" + current_user.id.to_s)\n sport = Sport.find(params[:commit].to_i)\n user_sport_preference = UserSportPreference.new\n user_sport_preference.user_id = current_user.id\n user_sport_preference.sport_id = sport.id\n user_sport_preference.save\n else\n # select sport_level\n if params[:commit] == \"select\"\n level_id = params[:level_id]\n if Team.find_available_by_sport_and_level(current_user.id, level_id).any?\n @teams = Team.find_available_by_sport_and_level(current_user.id, level_id)\n else\n @teams = nil\n end\n if Team.find_available_by_sport(current_user.id).any?\n @teams1 = Team.find_available_by_sport(current_user.id)\n else\n @teams1 = nil\n flash[:notice_search_result] = \"You can create the 1st team of \" + \"#{UserSportPreference.find_by_user_id(current_user.id).sport.name}\"\n end\n # join a team: save team, teammember\n elsif params[:commit] == \"join\"\n # get team_id\n hash = params[:join]\n if hash != nil\n hash_invert = hash.invert\n team_id = hash_invert.values_at(\"join\").first.to_i\n end\n # create teammember\n team = Team.find(team_id)\n teammember = Teammember.new\n teammember.team_id = team.id\n teammember.user_id = current_user.id\n teammember.save\n \n # modify teammembers' active_code = 2\n teammember1 = User.find(current_user.id)\n teammember2 = team.user\n teammember1.update_attribute(:active_code, 2)\n teammember2.update_attribute(:active_code, 2)\n \n # modify team.is_available = 1\n team = Team.find(team_id)\n team.update_attribute(:is_available, 0)\n\n redirect_to '/teams/home'\n elsif params[:commit] == \"next\"\n redirect_to \"/teams/home\"\n end\n end\n end\n end",
"def user_belongs_to_team!\n if signed_in? && current_team.present?\n redirect_to root_app_url unless current_team_role\n end\n end",
"def create_team\n new_team_code = genTeamCode(current_user.id)\n team_params = {\n :team_name => params[:teamname],\n :team_code => new_team_code,\n :advisor_users_id => current_user.id,\n }\n team = Team.new(team_params)\n team.save\n\n current_user.update_attribute( :team_name, params[:teamname] )\n current_user.update_attribute( :team_code, new_team_code)\n\n flash.now[:flash] = 'Team Created'\n render '/advisor/index'\n end",
"def show\n if current_team\n if ! (current_team.email == @team.email)\n redirect_to '/'\n end\n end\n end",
"def show\n redirect_to team_path(@user.team) if @user.team\n end",
"def new\n respond_to do |format|\n if SimTeam.find_by_user_id( current_user )\n flash[:error] = 'You already own a team.'\n @sim_team = SimTeam.find_by_user_id( current_user )\n format.html { render :action => \"yourteam\" }\n format.xml { render :xml => @sim_team.errors, :status => :unprocessable_entity }\n else\n @sim_team = SimTeam.new\n format.html # new.html.erb\n format.xml { render :xml => @sim_team }\n end\n end\n end",
"def check_student\n @@name_path = request.env['PATH_INFO']\n if current_user&.student? and (@@name_path != \"/my_projects\" and @@name_path != \"/\")\n begin\n redirect_to :back, alert: \"You do not have access to that page.\"\n rescue Exception\n redirect_to \"/\", alert: \"You do not have access to that page.\"\n end\n end\n end",
"def check_access(team)\n if !team.is_in?(user)\n flash[:error] = \"Vous ne faites pas partie de cette équipe\"\n redirect_referrer\n end\n end",
"def showUserTeam\n redirect_to team_showUserTeam_path\n end",
"def teamowner_information \n team = Team.find_by_event_id(params[:event_id])\n if team != nil\n @teamowner = Team.find_teamowner(team.id)\n @initial_level = team.initial_level\n else\n flash[:notice] = \"Create a team to be an owner!\"\n flash.now\n redirect_to :controller => 'teams', :action => 'teamowner_information', :notice => \"Create a team to be an owner!\"\n end\n\n end",
"def create\n if params[:password] == params[:password_confirmation]\n @team = Team.new(team_params)\n @team.leader_id = current_user.id\n @team.salt = BCrypt::Engine.generate_salt\n @team.encrypted_password= BCrypt::Engine.hash_secret(params[:password], @team.salt)\n Team.transaction do\n respond_to do |format|\n if @team.save\n current_user.team_id = @team.id\n if current_user.save\n flash[:success] = 'Team was successfully created.'\n format.html { redirect_to root_url}\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: current_user.errors, status: :unprocessable_entity }\n end\n else\n flash[:error] = 'This team name is already taken.'\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end\n else\n flash[:error] = 'Password and password confirmation don\\'t match.'\n redirect_to new_team_path\n end\n end",
"def verify_parameters\n set_team\n unless ( @team )\n flash[:error] = I18n.t(:invalid_action_request) + ' - ' + I18n.t('meeting.errors.missing_team_id')\n redirect_back( fallback_location: root_path ) and return\n end\n end",
"def show\n @team = Team.find_by_slug(params[:id])\n\n if @team.nil?\n raise ActionController::RoutingError.new('Not Found')\n end\n end",
"def create\n @student_team = StudentTeam.new(student_team_params)\n\n respond_to do |format|\n # if !(StudentTeam.where(\"student_id = ? AND team_id = ?\", student_team_params[:student_id], student_team_params[:team_id]).empty?)\n # @student_team.errors =\n # format.html { render :new }\n #format.json { render json: @student_team.errors, status: :unprocessable_entity }\n\n if @student_team.save\n format.html { redirect_to @student_team, notice: 'Student team was successfully created.' }\n format.json { render :show, status: :created, location: @student_team }\n else\n format.html { render :new }\n format.json { render json: @student_team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def student_team_already_existing\n return false if self.student.nil? || self.team.nil?\n if student_id_changed? || team_id_changed?\n assignment = StudentTeam.for_team(self.team).for_student(self.student)\n errors.add(:student_team,\"assignment already exists\") if !assignment.empty?\n end\n end",
"def correct_student\n @student = Student.find(params[:id])\n redirect_to(root_url) unless current_student?(@student)\n end",
"def create\n respond_to do |format|\n format.html { redirect_to :teams, notice: 'Team creation not allowed... But you seem to have a little bit of knowledge...' }\n end\n nil\n # goes to private load_team\n end",
"def create\n if params[:solicitar]\n @tournamentteam = Tournamentteam.new(tournamentteam_params.merge(i_team:true))\n else\n @tournamentteam = Tournamentteam.new(tournamentteam_params.merge(i_tournament:true))\n end\n if !Tournamentteam.exists?(tournament_id:tournamentteam_params[:tournament_id],team_id:tournamentteam_params[:team_id])\n respond_to do |format|\n if @tournamentteam.save\n format.html { redirect_to tournament_path(tournamentteam_params[:tournament_id]), notice: 'Equipo agregado correctamente.' }\n format.json { render :show, status: :created, location: @tournamentteam }\n\n#new_tournamentteam_path(tournament:tournamentteam_params[:tournament_id])\n else\n format.html { redirect_to new_tournamentteam_path(tournament:tournamentteam_params[:tournament_id]),notice: 'No se puede agregar el equipo al torneo.' }\n format.json { render json: @tournamentteam.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to new_tournamentteam_path(tournament:tournamentteam_params[:tournament_id]),notice: 'Equipo ya fue agregado al torneo.'\n end\n\n\n end",
"def login_check\n @passcode = \"3369\"\n @code = params[:code]\n\n ## When uncommented the logic routes to failed_login\n if @code == @passcode ## routes fail when uncommented\n redirect_to :controller => 'pages', :action => 'successful_login'\n else\n redirect_to :controller => 'pages', :action => 'failed_login'\n end\n end",
"def create\n @team = Team.new(name: team_params[:name], course_id: params[:course_id], group_number: team_params[:group_number])\n @team.users << current_user\n @student_sids = put_empty_members\n error = \"\"\n @team_size = Course.find(params[:course_id]).team_size.to_i\n begin\n validate_team_members\n rescue Exception => e\n error = e.message\n end\n respond_to do |format|\n if @team.save and error.blank?\n format.html { redirect_to course_teams_path , notice: 'Team was successfully created.' }\n else \n if !error.blank?\n @team.errors.add(:validate, error)\n flash.now[:error] = error\n end\n if @team.errors[:message].empty? and error.blank?\n flash.now[:error] = \"Team name exists\"\n end\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_team\n @contact = Contact.user_scope().find_by(id: params[:id])\n if !@contact.present?\n redirect_to teams_path, :flash => { :error => \"Team member Not Found!\" }\n end\n end",
"def create\n\n if (current_user.email = \"citytank@gmail.com\")\n\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n # team shouldn't be creatable through this way\n format.html { redirect_to tracks_url, notice: 'Team was successfully created.' }\n #format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n else\n format.html { redirect_to tracks_url, notice: 'You do not have the ability to create a team' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end \n end",
"def create\n return render :new unless params[:subdomain].present?\n team = LockerRoom::Team.find_by(:subdomain => params[:subdomain])\n if team\n redirect_to locker_room.login_url(:subdomain => team.subdomain),\n :notice => 'Please signin.'\n else\n flash.now[:alert] = 'Team is not found.'\n render :new\n end\n end",
"def verify?(idno, vcode)\n if idno==''|| vcode==''\n flash[:error]=\"All fields are required.\"\n return false\n end\n\n #check if student exists\n begin\n student = Profile.find(idno)\n if student.idNo==2041575 #premade Profile for nonexistent students (check web service)\n flash[:error]=\"The student cannot be found. Please check the ID number and try again.\"\n return false\n end\n \n \n #need hash formula for vcode verification here!\n if vcode != hash(idno)[4..9]\n flash[:error]=\"Invalid Verification Code #{hash(idno)[4..9]}\"\n return false\n end\n rescue\n flash[:error]=\"The student cannot be found. Please check the ID number and try again.\"\n return false\n end\n\n return true\n end",
"def valid_auth\n if @user.auth == 0\n flash[:warning] = \"Your can not create Team\"\n redirect_to :action => \"index\"\n end\n end",
"def create\n # get event_id params\n hash = params[:register]\n if hash != nil\n hash_invert = hash.invert\n event_id = hash_invert.values_at(\"register\").first.to_i\n end\n \n # if he/she has already created an event, but on one else join the event\n # destroy the old location, event firstly\n if Event.find_by_user_id(session[:user_id]) != nil\n event = Event.find_by_user_id(session[:user_id])\n location = event.location\n location.destroy\n event.destroy\n end\n\n # if he/she has already created a team, but no one else join the team\n # destroy the old team, teammember firstly\n if Team.find_by_user_id(session[:user_id]) != nil\n team = Team.find_by_user_id(session[:user_id])\n teammember = Teammember.find_by_team_id(team.id)\n teammember.destroy\n team.destroy\n end\n\n # if he/she is the 1st teammember, would like to create a team\n if Team.find_by_event_id(event_id) == nil \n\n # create team\n @team = Team.new(params[:team])\n @team.user_id = session[:user_id]\n @team.event_id = event_id\n @team.save\n\n # create teammember\n teammember = Teammember.new\n teammember.team_id = @team.id\n teammember.user_id = session[:user_id]\n teammember.save\n\n flash[:notice] = \"Create a team to be an owner!\"\n flash.keep(:notice)\n redirect_to '/admin/home', :notice => 'Team was successfully created.'\n # if he/she is the 2nd teammember, would like to join the team\n else \n # create teammember\n team = Team.find_by_event_id(event_id)\n teammember = Teammember.new\n teammember.team_id = team.id\n teammember.user_id = session[:user_id]\n teammember.save\n \n # modify teammembers' active_code = 2\n teammember1 = User.find(session[:user_id])\n teammember2 = team.user\n teammember1.update_attribute(:active_code, 2)\n teammember2.update_attribute(:active_code, 2)\n\n # modify event.is_available = 1\n event = Event.find(event_id)\n event.update_attribute(:is_available, 1)\n\n redirect_to '/admin/home', :notice => 'Team was successfully joined.'\n end\n end",
"def team_for_id(id)\n team = @teams[id]\n\n raise(ActiveRecord::RecordNotFound, \"No team found for id #{id} in #{@teams.keys.sort}\") unless team\n\n team\nend",
"def show\n \n # /teams/1\n if !params[:id].nil?\n @team = Team.find(params[:id]) \n @division = @team.divisions.first\n end\n\n # Old FAFT Route is passed\n if !params[:faft_team_id].nil? && !params[:faft_ds_id].nil?\n \n @division = DivisionSeason.find_by_faft_id(params[:faft_ds_id])\n redirect_to '/search?q=' + params[:team_slug] and return if @division.nil?\n\n @team = @division.teams.find_by_faft_id(params[:faft_team_id])\n @team = Team.find_by_faft_id(params[:faft_team_id]) if @team.nil?\n\n head(:moved_permanently, location: default_team_path(@team)) and return\n end\n\n # Find team by league, division, team slug\n if !params[:league_slug].nil? && !params[:division_slug].nil? && !params[:team_slug].nil?\n @league = League.find_by_slug(params[:league_slug])\n redirect_to '/search?q=' + params[:team_slug] and return if @league.nil?\n\n @divisions = @league.divisions\n @division = @divisions.select{ |ds| !ds.nil? && ds.slug == params[:division_slug] }.first #should only be one\n redirect_to '/search?q=' + params[:team_slug] and return if @division.nil?\n\n @team = @division.teams.find_by_slug(params[:team_slug])\n redirect_to '/search?q=' + params[:team_slug] and return if @team.nil?\n end\n\n # Redirect tenanted teams to the right domain\n # - This check should be performed as soon as it can be\n change_domain, host = change_domain_for_tenanted_model?(@team)\n redirect_to team_url(@team, host: host) and return if change_domain\n\n authorize! :read, @team\n\n user_cache_key = \"\"\n user_cache_key = current_or_guest_user.rabl_cache_key if (!current_or_guest_user.nil?)\n\n @user = current_or_guest_user\n @events_cache_key = \"EventsFragment/#{user_cache_key}/TeamProfile/#{@team.cache_key}/#{@team.events_last_updated_at.utc.to_s(:number)}\"\n\n # tenant info\n @tenant = LandLord.new(@team).tenant\n @tenant_json = Rabl.render(@tenant, 'api/v1/tenants/show', view_path: 'app/views', formats: :json, locals: { page: \"team\" }).html_safe \n\n # Show/hide page elements\n @show_download_app_marketing = !@team.is_o2_touch_team?\n @show_results_section = !@team.is_o2_touch_team?\n\n x = time do\n @activity_items_json = [].to_json\n feed_cache_key = @team.feed_cache_key(:profile, nil, nil, 20, nil)\n\n logger.info \"BF Cache - Feed cache_key is #{feed_cache_key}\"\n \n @activity_items_json = fetch_from_cache \"#{feed_cache_key}\" do \n x = Rabl.render(@team.get_mobile_feed(:profile, nil, nil, 20, nil)[0], \"api/v1/activity_items/index\", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe \n safe_js_string(x)\n end\n end\n logger.debug \"BF Cache - Activity Items\" + (x.to_s)\n\n x = time do #4-5s (7 events) \n @future_events_json = Rails.cache.fetch @events_cache_key + \"/future\"do \n json_collection(@team.future_events, @user).html_safe\n end\n\n @past_events_json = Rails.cache.fetch @events_cache_key + \"/past\" do \n json_collection(@team.past_events, @user).html_safe\n end\n end\n logger.debug \"BF Cache - Events\" + (x.to_s)\n\n template = (can? :manage, @team) ? 'api/v1/users/index_reduced_squad_private' : 'api/v1/users/index_reduced_squad'\n @members_json = Rabl.render(@team.members, template, view_path: 'app/views', formats: [:json], :scope => BFFakeContext.new, locals: { :team => @team }, handlers: [:rabl]).html_safe\n\n # Why do we use @demo_final? Does this need to refactored out? - PR\n x = time do\n @team_json = Rails.cache.fetch \"#{@team.rabl_cache_key}/#{@demo_final}\" do\n Rabl.render(@team, \"api/v1/teams/show\", view_path: 'app/views', :locals => { :demo_final => @demo_final }, :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe\n end\n end\n logger.debug \"BF Cache - Team under view\" + (x.to_s)\n\n x = time do\n @current_user_teams_json = [].to_json\n if !current_or_guest_user.nil?\n @current_user_teams_json = Rails.cache.fetch \"#{current_or_guest_user.rabl_cache_key}/CurrentTeams\" do\n Rabl.render(current_or_guest_user.teams, \"api/v1/teams/index\", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe\n end\n end\n end\n logger.debug \"BF Cache - Current teams\" + (x.to_s)\n\n x = time do\n @current_user_leagues_json = [].to_json\n if !current_user.nil?\n @current_user_leagues_json = Rabl.render(current_user.leagues_as_organiser, \"api/v1/leagues/index\", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe\n end\n end\n logger.debug \"BF Cache - Current leagues\" + (x.to_s)\n\n x = time do\n @user_json = {}.to_json\n if !current_user.nil?\n @user_json = Rails.cache.fetch \"#{@user.rabl_cache_key}\" do\n Rabl.render(@user, \"api/v1/users/show\", view_path: 'app/views', :formats => [:json], :scope => BFFakeContext.new, :handlers => [:rabl]).html_safe\n end\n end\n end\n logger.debug \"BF Cache - User\" + (x.to_s)\n\n #Get combined user and team goals\n @goals_json = [].to_json\n if @team and @user\n combined_goals = @team.goals.get_items.merge(@user.goals.get_items) \n combined_goals_json_array = combined_goals.map do |key, goal_checklist_item|\n goal_checklist_item.to_json\n end\n @goals_json = combined_goals_json_array.to_json.html_safe\n end\n \n\t #Open invite link is required iff the user is an organiser. If this information is put in the json,\n #we end up with complicated rabl cacheing where a team is cached per user. Therefore the simple solution\n #as it stands is to put the information in the markup.\n @open_invite_link = @team.open_invite_link\n\n render \"show_private\"\n end",
"def check_role\n redirect_to root_path unless current_user && current_user.evo_team?\n end",
"def get_team\n if (!params[:team_key])\n return nil\n else\n team = Team.find_by_key(params[:team_key])\n if (!team)\n return nil\n else\n return team\n end\n end\n end",
"def create\n # if he/she has already created a team, but no one else join the team\n # destroy the old team, teammember firstly\n if Team.find_by_user_id(current_user.id) != nil\n team = Team.find_by_user_id(current_user.id)\n teammember = Teammember.find_by_team_id(team.id)\n teammember.destroy\n team.destroy\n end\n \n # create team\n @team = Team.new(params[:team])\n @team.user_id = current_user.id\n sport_level_id = SportLevel.find_by_sql(\"SELECT sport_levels.id FROM sport_levels WHERE sport_levels.sport_id = \" + @team.sport_id.to_s + \" AND sport_levels.name = 1\")\n @team.sport_level_id = SportLevel.find_by_id(sport_level_id)\n @team.save\n\n # create teammember\n teammember = Teammember.new\n teammember.team_id = @team.id\n teammember.user_id = current_user.id\n teammember.save\n\n redirect_to '/teams/render_search_team', :notice_create_team => 'Team was successfully created.'\n end",
"def new\n @team = Team.new\n @course = Course.find(params[:course_id])\n curUsers = User.joins(:enrollments).where('enrollments.course_id' => @course[:id]) \n curStudents = curUsers.where('role' => 'student')\n\n if curStudents != nil && curStudents.count > 1\n curStudents = curStudents.order(last_name: :asc)\n end\n\n @students = nil\n @teams = Team.where(:assignment_id => params[:assignment_id])\n\n @can_use_previous = false\n other_assignments = Assignment.where(:course_id => params[:course_id])\n if other_assignments != nil && other_assignments.count > 0\n sorted_assignments = other_assignments.order(created_at: :desc)\n most_recent_assignment = sorted_assignments.second\n if most_recent_assignment != nil\n all_teams_for_prev_ass = Team.where(:assignment_id => most_recent_assignment.id)\n if all_teams_for_prev_ass != nil && all_teams_for_prev_ass.count > 0\n @can_use_previous = true\n end\n end\n end\n\n if Team.nil?\n else\n existing_teams = Team.where('assignment_id' => params[:assignment_id])\n existing_team_ids = existing_teams.pluck('id')\n if existing_team_ids.count > 0\n @students = []\n curStudents.each do |student|\n current_student_teams = student.team_enrollments.pluck('team_id')\n is_match = existing_team_ids & current_student_teams\n if is_match.empty?\n @students.push(student) \n end\n end\n elsif curStudents.count > 0\n @students = curStudents\n end\n end\n end",
"def create\n @student_user = StudentUser.new(student_user_params)\n \n @student_user.usertype =\"student\"\n\n \tsession[:team_code] = nil\n \tsession[:team_code_valid] = nil\n \t@student_user.school_level=session[:student_level]\n \tsession[:has_school_lvl]=true\n respond_to do |format|\n if @student_user.save\n session[:has_school_lvl]=false\n session[:register]=@student_user.id\n format.html { redirect_to @student_user, notice: 'Please review this information to ensure it is correct' }\n format.json { render :show, status: :created, location: @student_user }\n else\n format.html { render :new }\n format.json { render json: @student_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def show \n @team = Team.find(params[:id])\n #@assignments = Assignment.where(\"course_id = ? and deadline > ?\", @team.course_id, Time.zone.now) \n if current_user.has_role? :student\n redirect_to course_team_assignments_path(:team_id => @team.id), :assignments => @assignments\n elsif current_user.has_role? :instructor or current_user.has_role? :professor \n # flash[:notice] = \"not implemented for instructor yet!\"\n redirect_to course_team_assignments_path(:team_id => @team.id), :assignments => @assignments\n return\n else\n end \n end",
"def require_student\n @group = Group.find_by_code(params[:code])\n \n if logged_as?(:instructor)\n if current_user == @group.creator\n flash[:notice] = \"You already have joined this group as instructor.\"\n redirect_to instructors_class_path(@group)\n else\n flash[:notice] = \"You need to login as student to join groups.\"\n redirect_to default_path_for(current_user)\n end\n elsif !logged_as?(:student)\n store_location\n flash[:notice] = \"You must be logged in to access this page. Signup or login if you are already a member.\"\n redirect_to students_signup_path(:code => params[:code])\n end\n end",
"def verify?(idno, vcode)\n if idno==''|| vcode==''\n flash[:error]=\"Fields can not be blank\"\n return false\n end\n\n #check if student exists\n student = Profile.find(idno)\n if student.id==3 #premade Profile for nonexistent students (check web service)\n flash[:error]=\"Student not found\"\n return false\n end\n\n #need hash formula for vcode verification here!\n if vcode != hash(idno)[4..9]\n flash[:error]=\"Invalid Verification Code #{hash(idno)[4..9]}\"\n return false\n end\n\n\n return true\n end",
"def show\n begin\n @team = Team.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n render(:file => File.join(Rails.root, 'public/404.html'), :status => 404, :layout =>false)\n return\n end\n end",
"def team_information\n @team = Team.find_by_user1(session[:user_id])\n @teammate = Team.find_teammate(session[:user_id])\n @user = User.find(session[:user_id])\n\n flash.now[:notice] = \"You need a teammember!\"\n render :controller => 'teams', :action => 'team_information'\n end",
"def show\n @persona_team = PersonaTeam.find(params[:id], :conditions => ['account_id = ?', session[:account_id]])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @persona_team }\n end\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = 'That persona team was not found'\n redirect_to(index_url)\n end",
"def ensure_correct_user \n # compare some params vs something in the session/current_user\n unless params[:id].to_i == session[:user_id]\n redirect_to all_teams_path, alert: \"Not Authorized\"\n end\n end",
"def update\n team_data = params[:team]\n begin\n team = Team.where(:id=>team_data[:id]).first\n if team && registration = Registration.on_team(team).for_user(current_user).first\n team.update_attributes(team_data) if registration.captain?\n end\n end\n flash[:success] = \"Your team changes were saved successfully. Check them out:\"\n redirect_to registration_olympiad_path(@olympiad, :page=>\"team\")\n end",
"def authorized_for_team\n team = Team.find(params[:id]);\n redirect_to root_path unless team.users_ids.include?(current_user.id) || \n current_user.in_tab_room?(team.tournament);\n end",
"def genTeamCode(seed)\n existing_pay_code=\"T\"\n num = seed.to_i + rand(10000...900000)\n retcode = existing_pay_code + num.to_s\n done = 0\n # Check to see if the pay_code already exists\n while(done==0)\n # Checks database for code\n if AdvisorUser.where(:team_code => retcode).blank?\t\n done = done + 1 #not in database\n else\n retcode = retcode + 1 #in database, increase and check again\n end\n end\n return retcode\n end",
"def team_event\n @team = Team.find(params[:team_id])\n @event = Event.find(params[:event_id])\n @results = Result.team_event(@team, @event)\n rescue ActiveRecord::RecordNotFound\n flash[:notice] = \"Could not find result for #{@event.try :name} #{@team.try :name}\"\n return redirect_to(teams_path)\n end",
"def secret_show\n redirect_to codes_path, notice: 'No Code Found.' if @code.blank?\n end",
"def set_team\n @team = Team.where(\"id=?\",params[:id]).first\n\n unless @team.present? \n render json:{ status: :error, data: \"team is not find\" }\n\n end\n end",
"def captain_of_team_requested\n @user_request = current_user&.team&.user_requests&.find(params[:id])\n @team = @user_request&.team\n raise ActiveRecord::RecordNotFound unless @user_request&.team&.team_captain.eql?(current_user)\n end",
"def add_to_team\n session[:current_team_id] = Team.find_by(id: params[:id]).id\n redirect_to heros_path\n end",
"def teams\n redirect_to navigation_teams_path\n end",
"def team_information\n @team = Team.find_by_user1(current_user.id)\n @teammate = Team.find_teammate(current_user.id)\n @user = current_user\n\n flash.now[:notice] = \"You need a teammember!\"\n render :controller => 'teams', :action => 'team_information'\n\n end",
"def find_this_school(id)\n my_school = MySchool.find_by_id_and_user_id(id, session[:user_id]) \n\n unless my_school \n flash[:error] = 'School not found!'\n redirect_to :action => 'list' \n end\n my_school\n end",
"def create\n msg = check_valid_names\n if !msg.empty?\n logger.debug msg\n flash[:error] = msg\n redirect_to :action => 'new'\n return\n end\n update_course_faculty_label\n\n @team = Team.new(params[:team])\n @team.course_id = params[:course_id]\n\n respond_to do |format|\n if @team.save\n flash[:notice] = 'Team was successfully created.'\n format.html { redirect_to(course_teams_path(@team.course_id)) }\n format.xml { render :xml => @team, :status => :created, :location => @team }\n else\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n format.html { render :action => \"new\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n if has_permissions_or_redirect(:staff, root_path)\n @team = Team.new(params[:team])\n\n @team.course_id = params[:course_id]\n @course = Course.find(params[:course_id])\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n\n msg = @team.update_members(params[:people])\n unless msg.blank?\n flash.now[:error] = msg\n render :action => 'new'\n return\n end\n\n update_course_faculty_label\n\n respond_to do |format|\n if @team.save\n flash[:notice] = 'Team was successfully created.'\n format.html { redirect_to(course_teams_path(@team.course_id)) }\n format.xml { render :xml => @team, :status => :created, :location => @team }\n else\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n format.html { render :action => \"new\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"def create\n ln = params['league']['league_name']\n admin_id = params['league']['admin_id']\n\n @leagues = League.where(:league_name => ln).first\n\n if @leagues\n redirect_to new_league_path, :notice => 'This league already exists, please choose a different league name'\n else\n @league = League.new(league_params)\n \n respond_to do |format|\n if @league.save\n @newuser = LeagueUser.create(:user_id => admin_id, :league_id => @league.id)\n format.html { redirect_to @league, notice: 'League was successfully created.' }\n format.json { render :show, status: :created, location: @league }\n else\n format.html { render :new }\n format.json { render json: @league.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def create\n @team = Team.new(team_params)\n @team.slug = @team.name.downcase.gsub(\" \", \"-\")\n\n @team.community_rating = 0\n\n # Set default picture url\n if !@team.picture_url\n @team.picture_url = 'https://d13yacurqjgara.cloudfront.net/users/205424/screenshots/1953810/pandamoniumshot.png'\n end\n\n @user = User.find(session[:session_key])\n\n respond_to do |format|\n if @team.save\n @team.users.push(@user)\n @team.users\n @team.save\n user_teams = @team.user_teams.find_by(user_id: @user.id)\n user_teams.role = params[:role]\n user_teams.status = 1\n user_teams.save!\n\n # TODO: Add game to user profile if it's not already there\n\n format.html { redirect_to @team, notice: 'Team was successfully created.' }\n format.json { render :show, status: :created, location: @team }\n else\n format.html { render :new }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def team\n @team = :true\n render '/home/landing'\n end",
"def create\n @team = Team.new(team_params)\n\n respond_to do |format|\n if @team.save\n format.html do\n flash[:notice] = 'Team was successfully created.'\n current_user.is_admin? ? (redirect_to teams_path) : (redirect_to user_teams_path(current_user))\n end\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def choose_site\n redirect_to @project if params[:subject_code].blank?\n @subject = current_user.all_viewable_subjects.where(project_id: @project.id)\n .where(\"LOWER(subjects.subject_code) = ?\", params[:subject_code].to_s.downcase).first\n if !@project.site_or_project_editor?(current_user) && !@subject\n alert_text = params[:subject_code].blank? ? nil : \"Subject <code>#{params[:subject_code]}</code> was not found.\"\n redirect_to @project, alert: alert_text\n elsif @subject\n redirect_to [@project, @subject]\n end\n end",
"def correct_lineup\n @lineup = Lineup.find(params[:id])\n redirect_to(@lineup) unless current_team?(@lineup.team) || current_user.admin? || current_team.is_commissioner?\n end",
"def set_team\n @team = current_user.teams.find(params[:id])\n end",
"def create\n puts \"IN CREATE ACTION\"\n if(current_user.role == \"guest\")\n redirect_to login_url and return\n end\n @coaches = Coach.all\n @divisions = Division.all\n @organizations = Organization.all\n @students = Student.all\n @team = Team.new(team_params)\n\n unless current_user.coach.nil?\n @team_organization = current_user.coach.organization\n #@team_name = @team.organization.short_name + \" \" + (@team.organization.teams.count+1).to_s\n @team.organization_id = @team_organization.id\n #@team.name = @team_name\n end\n\n puts \"TEAM IS #{@team.valid?} -- #{@team.to_yaml}\"\n \n respond_to do |format|\n if @team.save\n params[:team][:student_teams_attributes].each do |sta|\n st = StudentTeam.new\n puts \"PREVIEW -- #{@team.id} :: #{sta[1][1]}\"\n # @team.student_teams.each do |st|\n st.team_id = 86\n st.student_id = sta[1][1]\n if st.save\n puts \"StudentTeam ID: #{st.id}\"\n else\n puts \"FAIL\"\n end\n end\n format.html { redirect_to edit_team_url(@team), notice: 'Team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team }\n else\n format.html { render action: 'new' }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def verify_code\n if params.include?(:phone_number) and params.include?(:activate_code)\n if User.exists?(:phone_number => params[:phone_number], :code => params[:activate_code])\n success = true\n message = 'activate successfully'\n else\n success = false\n message = 'phone number does not exist or code activate is not ok'\n end\n else\n success = false\n message = 'please check the paramaters'\n end\n result = { :success => success, :message => message }\n render json: result, status: 200\n end",
"def check_accept_access\n @user_invite = current_user.user_invites.find_by id: params[:id]\n @team = @user_invite&.team\n redirect_back(fallback_location: user_root_path, alert: I18n.t('invites.invalid_permissions')) if @user_invite.nil?\n end",
"def verify_teamship\n # Bail out unless the user is a valid team manager:\n # To be a valid team manager\n # a user must be:\n # - enabled to manage the selected team\n @is_team_swimmer = false\n if verify_team_manageability\n @is_team_swimmer = true\n else\n @is_team_swimmer = current_user.swimmer.badges.where([\"team_id = ? and season_id = 182\", @team_id])\n end\n unless ( @is_team_swimmer )\n flash[:error] = I18n.t(:invalid_action_request) + ' - ' + I18n.t('team_management.error_no_team_swimmer')\n redirect_to( team_radio_path(id: @team.id) ) and return\n end\n end",
"def create\n @user = User.new(params[:user])\n invite_code = params.fetch(:invite_code)\n\n respond_to do |format|\n if invite_code != current_org.invite_code\n format.html { \n flash[:notice] = 'You need an invite code to join!'\n render action: \"new\"\n }\n elsif @user.save\n OpenExamMailer.registration_confirmation(@user).deliver\n session[:user_id] = @user.id\n format.html { redirect_to root_url, notice: 'Thanks for joining OpenExam!' }\n format.json { render json: @user, status: :created, location: @user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @code = params[:verify_code]\n\n respond_to do |format|\n if current_user.verify_code.to_i == @code.to_i\n current_user.update_attributes(verified: true)\n format.html { redirect_to user_dashboards_path, notice: 'You\\'re successfully verified your account.' }\n # format.json { render json: @restaurant, status: :created, location: @restaurant }\n else\n format.html { \n flash[:alert] = 'Incorrect code'\n redirect_to verify_user_dashboards_path\n }\n # format.json { render json: @restaurant.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @team = Team.find(params[:id])\n\n msg = check_valid_names\n if !msg.empty?\n logger.debug msg\n flash[:error] = msg\n redirect_to :action => 'update'\n return\n end\n handle_teams_people\n\n update_course_faculty_label\n\n respond_to do |format|\n if @team.update_attributes(params[:team])\n flash[:notice] = 'Team was successfully updated.'\n format.html { redirect_to(course_teams_path(@team.course)) }\n format.xml { head :ok }\n else\n @faculty = User.find(:all, :order => \"twiki_name\", :conditions => [\"is_teacher = true\"])\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @team.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def signup_for_team(team)\r\n self.seasons.create(team: team)\r\n end",
"def create\n @user_team = UserTeam.new(user_team_params)\n\n respond_to do |format|\n if @user_team.save\n format.html { redirect_to @user_team, notice: 'User team was successfully created.' }\n format.json { render action: 'show', status: :created, location: @user_team }\n else\n format.html { render action: 'new' }\n format.json { render json: @user_team.errors, status: :unprocessable_entity }\n end\n end\n end",
"def user_team(team_id)\n get(\"/user_teams/#{team_id}\")\n end",
"def show\n @team = Team.find(params[:id])\n if @team.name != current_team.name\n flash[:alert] = 'K prohlížení údajů tohoto týmu nemáte potřebné oprávnění'\n @team = current_team\n end\n end",
"def set_team\n @team = Team.friendly.find(params[:team_id])\n end",
"def set_student_team\n @student_team = StudentTeam.find(params[:id])\n end",
"def create\n @team = current_user.teams.new(team_params)\n @league = League.find_by(id: params[:league_id])\n @team.league = @league\n if @team.save\n LeagueInvite.where(email: current_user.email, league: @league).destroy_all\n flash[:success] = \"Added team to league\"\n if @league.teams.count == 10 && current_season = Season.current.first\n if LeagueSeason.where(league: @league, season: current_season).count == 0\n LeagueSeason.create(league: @league, season: current_season)\n end\n end\n redirect_to league_players_path(@league)\n else\n render action: :new\n end\n end",
"def create\n parent = Object.const_get(session[:team_type]).find(params[:id])\n begin\n Team.check_for_existing(parent, params[:team][:name], session[:team_type])\n @team = Object.const_get(session[:team_type] + 'Team').create(name: params[:team][:name], parent_id: parent.id)\n TeamNode.create(parent_id: parent.id, node_object_id: @team.id)\n undo_link(\"The team \\\"#{@team.name}\\\" has been successfully created.\")\n redirect_to action: 'list', id: parent.id\n rescue TeamExistsError\n flash[:error] = $ERROR_INFO\n redirect_to action: 'new', id: parent.id\n end\n end",
"def create\n # Getting the user by mail\n user = User.find_by(email: params[:session][:email].downcase)\n \n # check if we got a user first and then the password is correct\n if user && user.authenticate(params[:session][:password])\n \n # call helper method log_in (se helpers/seesionhelper)\n log_in user\n # Log the user in and redirect to the page with all teams (/teams)\n redirect_to teams_path\n else\n # Create an error message.\n #flash.now is for rendering (lives for the cycle)\n # danger is mapped in the view against bootstraps classes\n flash.now[:danger] = 'Invalid email/password combination'\n # render the layout with the form\n render 'new'\n end\n end",
"def new\n\n if params[:user].nil?\n return\n end\n\n @user.registration_code = params[:user][:registration_code]\n\n registration_code = RegistrationCode.find_by_code(params[:user][:registration_code])\n\n if @code_valid then\n if @registration_code.role.participant? && !User.registrations_open?\n redirect_to \"/register\", :alert => \"Sorry, registration is not yet open. Check back from Week 2 of semester.\"\n else\n render \"new_\"+@code_valid\n end\n else\n render \"new\"\n end\n end",
"def set_student\n unless @student = @school.students.find_by_id(params[:id])\n redirect_to @school, :alert => \"That student does not exist.\"\n end\n end",
"def create\n @user_team = UserTeam.new(params[:user_team])\n\n respond_to do |format|\n if @user_team.save\n format.html { redirect_to(@user_team, :notice => 'User team was successfully created.') }\n format.xml { render :xml => @user_team, :status => :created, :location => @user_team }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_team.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def set_team\n @team = Team.find_by_page_name(params[:id])\n end",
"def add\n added = TeamService.add params[:id], @organisation.ids, params[:username], current_user\n if added == true\n flash[:success] = \"#{params[:username]} was added to the team.\"\n else\n flash[:error] = \"Something went wrong. Please contact the VersionEye team.\"\n end\n redirect_to organisation_team_path( @organisation, @team )\n rescue => e\n logger.error e.message\n logger.error e.backtrace.join(\"\\n\")\n flash[:error] = \"ERROR: #{e.message}\"\n redirect_back\n end",
"def check_student\n if !current_student\n redirect_to :root, notice: \"You are not logged in as student\"\n end \n end",
"def set_scenario\n if @scenario = Scenario.find_by_id(params.require(:scenario_id))\n if not @scenario.has_student? current_user\n redirect_to '/student'\n end\n else\n redirect_to '/student'\n end\n end",
"def cannot_share_exisiting_team_name\n team_names = Team.all.map do |team|\n team.team_name.downcase\n end\n\n current_team_name = team_name.downcase\n \n errors.add(:team_name) if team_names.include?(current_team_name)\n \n p errors.full_messages\n end",
"def update\n respond_to do |format|\n if (current_user.team_id != @team.id) \n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n else\n if @team.update(team_params)\n #format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n #format.html { render :edit, notice: 'Team was successfully updated.' }\n format.html { redirect_to tracks_url, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def correct_employer\n @employer=Employer.find(params[:id])\n redirect_to(root_path) unless current_employer?(@employer)\n end",
"def correct_employee\n @employee = Employee.find(params[:id])\n redirect_to(root_url) unless @employee == current_employee\n end",
"def set_team\n @team = current_user.teams.find(params[:id])\n end",
"def set_team\n @team = Team.find_by_slug(params[:id])\n end",
"def same_school\n if current_teacher.school_id != Teacher.find(params[:id]).school_id\n redirect_to home_path, :flash => { :notice => \"You can't access other schools.\" }\n end\n end",
"def team\n @team = Team.where(id: params[:team_id]).first\n respond_to do |format|\n format.html do\n if @team.nil?\n flash[:notice] = \"No team with id #{params[:team_id]}\"\n return redirect_to(teams_path)\n end\n\n assign_team_results @team, @year\n render layout: !request.xhr?\n end\n\n format.json do\n return(render(status: :not_found, body: \"\")) unless @team\n assign_team_results @team, @year\n render json: @event_results.to_json\n end\n\n format.xml do\n return(render(status: :not_found, body: \"\")) unless @team\n assign_team_results @team, @year\n render xml: @event_results.to_xml\n end\n end\n end",
"def create\n if (User.find_by school_id: params[:user][:school_id])\n @user = User.find_by school_id: params[:user][:school_id]\n @user.update_attributes(user_params)\n else\n @user = User.new(user_params)\n end\n if @user.save\n\n if @user.role != TEACHER\n @member = Member.new\n @member.user_id = @user.id\n @member.project_id = session[:selected_project_id]\n @member.section_number = params[:section_number]\n @member.is_enabled = true\n @member.save\n redirect_to users_path, notice: @user.first_name + \" \" + @user.last_name + ' was successfully created and added to this section.' \n else\n redirect_to users_teachers_path, notice: @user.first_name + \" \" + @user.last_name + ' was successfully created and added to the teacher roster.'\n end\n else\n render action: 'new' \n end \n end",
"def check_if_user_is_team_leader?\n render json: [\"Only the Team Lead can edit this team\"], status: 422 unless current_user.id == this_team.user_id;\n end",
"def update\n respond_to do |format|\n if @team.update(team_params)\n format.html { redirect_to @team, notice: 'Team was successfully updated.' }\n format.json { render :show, status: :ok, location: @team }\n else\n format.html { render :edit }\n format.json { render json: @team.errors, status: :unprocessable_entity }\n end\n end\n define_team_user\n end",
"def check_login_info\n # @signed_up = false\n # something\n # @signed_up = true\n \n # get \"/user_sign_in/\"\n if (User.find_by_name \"#{params[:un]}\")\n redirect_to(\"/user/:#{params[:un]}\")\n else\n redirect_to(\"/sign_up/\")\n end \n end",
"def create\n\n team_errors = [] #array of errors for the create operation \n\n vin_ids_hash = params.reject { |k,v| k.to_s[0,6] != 'vin_id' } #grab vincentian ids\n del_ids_hash = params.reject { |k,v| k.to_s[0,6] != 'del_id' } #grab delivery ids\n\n #validate\n if vin_ids_hash.blank? or del_ids_hash.blank? \n team_errors << \"Select both vincentian(s) and deliveries(s).\"\n else\n vin_ids = vin_ids_hash.values #grab just the values from the hash\n del_ids = del_ids_hash.values #grab just the values from the hash \n end\n\n \n existing_team_num = Team.existing_team_num(vin_ids, del_ids) #check for existing team\n next_team_num = Team.next_team_num if existing_team_num.blank?\n \n if team_errors.blank? \n vin_ids.each do |vin_id| \n del_ids.each do |del_id|\n existing_team_num.blank? ? team_num = next_team_num : team_num = existing_team_num \n new_team = Team.new(\n :delivery_id => del_id, :team_num => team_num, :vincentian_id => vin_id) \n new_team.save\n new_team.errors.each_full do |msg|\n team_errors << msg\n end\n end\n end\n end\n\n \n if team_errors.blank?\n flash.now[:notice] = 'Team(s) successfully created. Refresh the table to see the changes.'\n else\n flash.now[:notice] = \"#{team_errors.join(\" \")}\"\n end\n \n end",
"def create\n uid_from_gh = GitHubUserInfo.get_uid_from_gh(params[:github_name])\n return error_as_json(\"Could not find GitHub username#{params[:github_name]}\") if uid_from_gh.nil?\n\n # TODO: DRY this up with repeated code in user_invites_controller\n # TODO: Add this validation to model\n classroom = Classroom.find_by(id: params[:classroom_id])\n return error_as_json(\"Could not find classroom with ID #{params[:classroom_id]}\") if !classroom.present?\n\n # TODO: Add index for cohort-uid then find_by it instead.\n existing = Student.find_by(classroom_id: params[:classroom_id], uid: uid_from_gh)\n return error_as_json(\"Student ##{existing.id} for classroom ##{params[:classroom_id]} already exists\") if existing\n\n # TODO: Should we just allow preferred_name to be null instead of forcing it be be something?\n @student = Student.new(\n name: params[:name] || params[:github_name], # must have a github_name\n classroom_id: params[:classroom_id],\n github_name: params[:github_name],\n email: params[:email],\n preferred_name: params[:preferred_name] || params[:name] || params[:github_name],\n uid: uid_from_gh\n )\n @student.save ? info_as_json(\"Created student #{@student.name}\") : error_as_json(@student.errors)\n end",
"def check_for_students\n # TODO: set a message.\n # TODO: handle on a per section basis?\n if (!Student.exists?)\n # First we need students, so when the students table is empty\n # go to the import page.\n redirect_to students_path\n end\n end"
] |
[
"0.65180635",
"0.6420315",
"0.6361816",
"0.6345052",
"0.6324049",
"0.6263744",
"0.62610877",
"0.62146115",
"0.6209806",
"0.6166357",
"0.61184293",
"0.60623777",
"0.60522366",
"0.603641",
"0.6026481",
"0.5990543",
"0.5979056",
"0.59318143",
"0.59313095",
"0.5886543",
"0.58707374",
"0.5868754",
"0.58607286",
"0.5821227",
"0.5792654",
"0.57850724",
"0.5753296",
"0.57408625",
"0.5734517",
"0.5716107",
"0.570804",
"0.5707675",
"0.57055223",
"0.5701697",
"0.56835824",
"0.5681665",
"0.56667584",
"0.56585187",
"0.5658512",
"0.5657845",
"0.56499624",
"0.56372184",
"0.56328785",
"0.5604706",
"0.55869764",
"0.5586184",
"0.55838907",
"0.55789685",
"0.5564552",
"0.55465955",
"0.5532926",
"0.55263597",
"0.55096394",
"0.5493542",
"0.5482806",
"0.54807836",
"0.5458234",
"0.5443366",
"0.5442545",
"0.5441559",
"0.543303",
"0.5431305",
"0.54134077",
"0.54100233",
"0.5395449",
"0.53617966",
"0.5361337",
"0.53581464",
"0.5346053",
"0.5343177",
"0.5336299",
"0.53339964",
"0.5333254",
"0.53325135",
"0.53321826",
"0.53313535",
"0.5324144",
"0.53230184",
"0.5319452",
"0.5315999",
"0.53125656",
"0.5311844",
"0.5309049",
"0.5289721",
"0.5287822",
"0.5285951",
"0.52738035",
"0.52737993",
"0.5268227",
"0.52630687",
"0.5256247",
"0.52523476",
"0.52507776",
"0.52476484",
"0.5237281",
"0.5234475",
"0.5223245",
"0.522033",
"0.521969",
"0.5218302",
"0.5204712"
] |
0.0
|
-1
|
This method creates a new `Node` using `data`, and inserts it at the end of the list.
|
def add_to_tail(node)
if self.tail == nil
self.tail = node
self.head = node
node.next = nil
return
end
old_tail = self.tail
old_tail.next = node
node.next = nil
self.tail = node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def insert(data)\n node = Node.new data\n\n if @head.nil?\n node.next_node = node\n else\n # the new node will have the same trailing node as old\n node.next_node = @head.next_node\n # the old head will become the tail\n @head.next_node = node\n end\n\n @head = node\n end",
"def insert data\n\t\tnode = Node.new data\n\t\tunless head\n\t\t\tself.head = node\n\t\telse\n\t\t\tnode.prev = self.tail\n\t\t\tself.tail.next = node\n\t\tend\n\t\tself.tail = node\n\t\tself.length += 1\n\tend",
"def insert data\n\t\tnode = Node.new data\n\t\tunless head\n\t\t\tself.head = node\n\t\telse\n\t\t\tself.tail.next = node\n\t\tend\n\t\tself.tail = node\n\t\tself.length += 1\n\tend",
"def append(data)\n\t\ttmp = Node.new(data)\n\t\tif @head.nil?\n\t\t\t@head = tmp\n\t\t\t@tail = tmp\n\t\t\t\n\t\telse\n\t\t\t@tail.next = tmp\n\t\t\ttmp.previous = @tail\n\t\t\ttmp.next = nil\n\t\t\t@tail = tmp\n\t\tend\n\t\t@count += 1\n\tend",
"def append(data)\n if @head.data.nil?\n @head = Node.new(data)\n else\n node = @head\n node = node.next_node until node.next_node.nil?\n node.next_node = Node.new(data)\n end\n end",
"def append(data)\n node = Node.new(data)\n if @head.nil?\n @head = node\n @tail = node\n else\n @tail.next = node\n @tail = node\n end\n end",
"def append(data)\n\t\ttemp = Node.new(data)\n\t\tif (!@head)\n\t\t\t@head = temp\n\t\t\t@tail = temp\n\t\telse\n\t\t\ttemp.set_prev(@tail)\n\t\t\t@tail.set_next(temp)\n\t\t\t@tail = temp\n\t\tend\n\t\t@size +=1\n\tend",
"def ll_append(data)\n new_node = Node.new(data)\n \n if @num_nodes == 0\n @head = new_node\n @tail = new_node\n else\n end_node = @tail\n end_node.set_Next(new_node)\n @tail = new_node\n end\n \n @num_nodes += 1\n end",
"def append(data)\n\t\t@tail.next_node = Node.new(data, nil)\n\t\t@tail = @tail.next_node\n\tend",
"def add_to_tail (data)\n new_element = Node.new (data)\n if @head.nil?\n @head = new_element\n else\n current_node = @head\n while current_node.next\n current_node = current_node.next\n end\n current_node.next = new_element\n end\n end",
"def insert(data)\n node = Node.new(data)\n if head.nil?\n @head = node\n else\n @head.push(node)\n end\n end",
"def ll_push(data)\n new_node = Node.new(data)\n if @num_nodes == 0\n @head = new_node\n @tail = new_node\n else\n current = @head\n new_node.set_Next(current)\n @head = new_node\n end\n \n @num_nodes += 1\n end",
"def append(data)\n if head\n next_node = head\n next_node = next_node.next_node while next_node.next_node\n next_node.next_node = Node.new(data: data)\n else\n @head = Node.new(data: data)\n end\n end",
"def insert(data)\n node_to_insert = SinglyListNode.new(data, nil)\n if @head.nil? && @tail.nil?\n # both and head and tail is empty so make data both\n @head = node_to_insert\n @tail = @head\n else \n @tail.nextNode = node_to_insert\n @tail = node_to_insert\n end\n @length += 1\n end",
"def insert(data)\n @head = Node.new(data, @head)\n end",
"def add_node(data)\n\n\t\t# change tactics if we're adding the first node\n\t\tif @head.nil?\n\n\t\t\tadd_first_node(data)\n\n\t\telse\n\n\t\t\tnew_node = Node.new(data)\n\n\t\t\t# point the last node to our new one\n\t\t\t@last.next = new_node\n\n\t\t\t# set our new node as the official last node\n\t\t\t@last = new_node\n\n\t\tend\n\t\tputs \"Added node with the value: #{data}\"\n\tend",
"def add_node(data)\n if @head.nil?\n add_first_node(data)\n else\n new_node = Node.new(data, nil)\n @tail.next = new_node\n @tail = new_node\n end\n # puts \"Added node with value: #{data}\"\n end",
"def insert(data)\n @head = Node.new(data, head)\n end",
"def push(data)\n node = Classifieds::ListNode.new(data)\n if @head.nil?\n @head = node\n @tail = node\n else\n @tail.next = node\n node.prev = @tail\n @tail = node\n end\n node\n end",
"def push new_data\n # 1 & 2: Allocate the Node & Put in the data\n new_node = Node.new(new_data)\n # 3. Make next of new Node as head\n new_node.next_node = @head\n # 4. change prev of head node to new_node\n if @head != nil\n @head.prev_node = new_node\n end\n # 5. move the head to point to the new node\n @head = new_node\n end",
"def add(data)\n node = Node.new(data: data)\n if head\n tail.next_node = node\n else\n @head = node\n end\n\n @tail = node\n self\n end",
"def push data\n node = Node.new data\n\n if self.head == nil\n self.head = node\n node.next = node\n else\n temp = self.head\n \n while temp.next != self.head\n temp = temp.next\n end\n\n temp.next = node\n node.next = self.head\n self.head = node\n end\n\n self\n end",
"def push data\n node = Node.new data\n if length == 0\n self.tail = node\n end\n\n node.next = self.head\n self.head = node\n self.length += 1\n end",
"def add_last(data)\n @head.nil? ? @head = Node.new(data, @head) : add_last_helper(data, @head)\n end",
"def add_last(data)\n if !@head\n @head = Node.new(data)\n else\n current = @head\n while current.next\n current = current.next\n end\n current.next = Node.new(data)\n end\n end",
"def add_last(data)\n new_node = Node.new(data)\n # Using add_first function to add new node in case the list is empty.\n if @head.nil?\n add_first(new_node.data)\n return \n end\n\n pointer = @head\n # Until we reach the last node\n until pointer.next.nil?\n # Move the pointer to the next.\n pointer = pointer.next\n end\n\n pointer.next = new_node\n new_node.next = nil\n end",
"def add_last(data)\n last_node = Node.new(data)\n\n unless head\n @head = last_node\n else\n current_node = @head\n until current_node.next.nil?\n current_node = current_node.next\n end\n current_node.next = last_node\n end\n end",
"def push(data)\r\n node = Node.new(data)\r\n if @head.nil?\r\n @head = node\r\n else\r\n tail = @head\r\n tail = tail.next while tail.next\r\n tail.next = node\r\n end\r\n end",
"def push(data)\n \tunless @head\n \t initialize data\n \t else\n \tnode = Node.new(data)\n \t\tnode.next = @last\n \t\tnode.prev = @last.prev\n \t\t@last.prev.next = node\n \t\t@last.prev = node\n \t\t@size += 1\n \t\tnil\n \t\tend\n end",
"def add_last(data)\n if @head.nil? \n @head = Node.new(data)\n else\n pointer = @head \n while !pointer.next.nil?\n pointer = pointer.next\n end\n pointer.next = Node.new(data)\n end\n end",
"def push(data)\n\t\ttemp = Node.new(data)\n\t\tif (!@head)\n\t\t\t@head = temp\n\t\t\t@tail = temp\n\t\telse\n\t\t\ttemp.set_next(@head)\n\t\t\t@head.set_prev(temp)\n\t\t\t@head = temp\n\t\tend\n\t\t@size += 1\n\tend",
"def insert data\n\t\treturn insert_next(nil, data) if (self.length == 0)\n\t\treturn insert_next(self.head, data) if (self.length == 1)\n\n\t\t# We have to find the last node and insert the\n\t\t# new node right next to it.\n\t\tself.current = head\n\t\ti = 0;\n\t\twhile ((i += 1) < self.length)\n\t\t\tmove_next\n\t\tend\n\n\t\t# current == \"tail\".\n insert_next(self.current, data)\n\tend",
"def insert_next prev_node, data\n\t\tnew_node = Node.new data\n\t\tif self.length == 0\n\t\t\tself.head = new_node.next = new_node\n\t\telse\n\t\t\tnew_node.next = prev_node.next\n\t\t\tprev_node.next = new_node\n\t\tend\n self.length += 1\n \n new_node\n\tend",
"def add_last(data)\n current = @head\n \n if current.nil?\n @head = Node.new(data)\n return\n end\n while !current.next.nil?\n current = current.next\n end\n current.next = Node.new(data)\n end",
"def add_last(data)\n # make a new last node\n new_last_node = Node.new(data, nil)\n # get the last node\n current = head\n if head.nil?\n @head = new_last_node\n last_node = head\n else\n while !current.nil?\n last_node = current\n current = current.next\n end\n # make the last node point to a new last node\n last_node.next = new_last_node\n end\n return new_last_node\n end",
"def <<(data)\n node = DoubleNode.new(:data => data)\n\n # list has nodes, add this to last\n if @tail\n @tail.tail = node\n node.head = @tail\n\n # list empty, add first node\n else\n @head = node\n end\n\n # node always added to end of list\n @tail = node\n @size += 1\n\n self\n end",
"def add_last(data)\n if @head.nil?\n add_first(data)\n else\n current = @head\n until current.next.nil?\n current = current.next\n end\n current.next = Node.new(data)\n end\n end",
"def add_last(data)\n\n if head.nil?\n add_first(data)\n return\n end\n \n node = head\n until node.next.nil?\n node = node.next\n end\n \n node.next = Node.new(data)\n end",
"def append_elem(data)\n\t\tnode = Node.new(data)\n\t\tnode.next_node = nil\n\t\t@head = node if @head == nil\n\t\t@last_elem.next_node = node if @last_elem != nil\n\t\t@last_elem = node\n\tend",
"def add_last(data)\n new_node = Node.new(data)\n\n if @head.nil?\n add_first(data)\n return # THIS RETURN IS VERY IMPORTANT\n end\n\n current = @head\n\n until current.next.nil? \n current = current.next\n end\n\n current.next = new_node\n return\n end",
"def add_last(data)\n new_node = Node.new(data)\n if !@head\n @head = new_node\n else\n current = @head\n # while current.next\n while current.next != nil\n current = current.next\n end\n current.next = new_node\n end\nend",
"def add_last(data)\n current_node = @head\n\n if current_node == nil\n add_first(data)\n return\n end\n\n while current_node.next != nil\n current_node = current_node.next\n end\n\n current_node.next = Node.new(data, nil)\n end",
"def add_last(data)\n current = @head\n # if list is empty, add data to front\n if length == 0\n add_first(data)\n else\n # use length method to move to the last node in the list\n (length - 1).times do \n current = current.next\n end\n last = current\n # insert the new node after the current last node; current last node's next become new last node\n new_node = Node.new(data)\n last.next = new_node\n # assign value of new node's next to nil\n new_node.next = nil\n end\n end",
"def <<(data)\n @tail = SingleNode.new(data, @tail)\n @head ||= @tail\n @size += 1\n\n self\n end",
"def prepend(data)\n node = Node.new(data)\n if @head.nil?\n @head = node\n @tail = node\n else\n node.next = @head\n @head = node\n end\n end",
"def insert_next prev_node, data\n\t\tnew_node = Node.new data\n\t\tif self.length == 0\n\t\t\tself.head = new_node.next = new_node\n\t\telse\n\t\t\tnew_node.next = prev_node.next\n\t\t\tprev_node.next = new_node\n\t\tend\n\t\tself.length += 1\n self.hash[data] = new_node\n new_node\n\tend",
"def insert(data)\n @nodes << data\n heapify_up\n end",
"def prepend(data)\n new_node = Node.new(data: data)\n new_node.next_node = @head\n @head = Node.new(data: data, next_node: @head)\n end",
"def insert(loc, data)\n if @head.data == nil\n @head = Node.new(data)\n else\n counter = 1\n node = @head\n until counter == loc\n node = node.next_node\n counter += 1\n end\n new_node = Node.new(data)\n new_node.next_node = node.next_node\n node.next_node = new_node\n end\n end",
"def prepend(data)\n node = Node.new(data)\n node.next_node = @head\n @head = node\n end",
"def prepend(data)\n\t\ttmp = Node.new(data)\n\t\tif @head.nil?\n\t\t\t@head = tmp\n\t\t\t@tail = tmp\n\t\telse \n\t\t\ttmp.next = @head\n\t\t\ttmp.previous = nil\n\t\t\t@head.previous = tmp\n\t\t\t@head = tmp\n\t\tend\n\t\t@count += 1\n\n\tend",
"def add_first_node(data)\n\t\t@head = Node.new(data, nil)\n\t\t@last = @head\n\tend",
"def add_first_node(data)\n @head = Node.new(data, nil)\n @tail = @head\n end",
"def prepend(data)\n\t\t@previous_head = @head\n\t\t@head = Node.new(data, @previous_head)\n\tend",
"def add_last(data)\n if @head.nil?\n @head = Node.new(data)\n return @head.data\n else\n current = self.last_node\n current.next = Node.new(data)\n return current.next.data\n end\n end",
"def insert(data)\n node = Node.new(data)\n\n if @size == 0\n @root = node\n else\n parent = @root\n\n loop do\n if data <= parent.value\n if !parent.left # found a leaf node\n parent.left = node # insert here\n break\n else\n parent = parent.left\n end\n else # data > node.value\n if !parent.right # found a leaf node\n parent.right = node # insert here\n break\n else\n parent = parent.right\n end\n end\n end\n end\n\n @size += 1\n end",
"def add_first(data)\n\n new_node = Node.new(data) # create a new node\n new_node.next = @head # assign the new node's NEXT to the @head\n @head = new_node # assign the head position to the new node\n end",
"def add_first(data)\n new_node = Node.new(data, @head)\n\n @head = new_node\n\n return new_node\n end",
"def add(data)\n if (@header == nil)\n @header = Node.new(data)\n else\n current = @header\n # go to end of the linked list\n while (current.next) do\n current = current.next\n end\n current.next = Node.new(data)\n end\n @number_of_nodes += 1\n end",
"def insert_after(idx, data)\n curr_node = node_at(idx)\n fail ArgumentError, \"index is out of range\" unless curr_node\n new_node = Node.new(data)\n new_node.next_node = curr_node.next_node\n curr_node.next_node = new_node\n end",
"def insert_at(index,data)\n return nil if @head.nil? || index > self.size - 1\n if index == 0\n self.prepend(data)\n elsif index == self.size - 1\n self.append(data)\n else\n new_node = Node.new(data)\n current_node = @head\n prev_node = nil\n index.times do\n prev_node,current_node = current_node,current_node.next\n end\n end\n new_node.next,prev.next = current_node,new_node \n end",
"def add_first(data)\n @head = Node.new(data, @head)\n end",
"def add_first(data)\n @head = Node.new(data, @head)\n end",
"def add_first(data)\n @head = Node.new(data, @head)\n end",
"def add_first(data)\n new_node = Node.new(data, nextNode = @head)\n @head = new_node\n end",
"def add_first(data) \n @head = Node.new(data, @head)\n end",
"def insert_at_index(index, data)\n current_pointer = self.head\n (1..index - 1).each do |number|\n if current_pointer.next.nil? && (index != number)\n current_pointer.next = Node.new(nil, nil)\n end\n current_pointer = current_pointer.next\n end\n if current_pointer\n old_next = current_pointer.next\n current_pointer.next = Node.new(data, old_next)\n end\n end",
"def insert_after prev_node, new_data\n # 1. check if the given prev_node exists\n if prev_node == nil\n puts \"the given previous node cannot be NULL\"\n end\n # 2. Create new node\n # 3. Put in the data\n new_node = Node.new(new_data)\n # 4. Make next of new Node as next of prev_node\n new_node.next_node = prev_node.next_node\n # 5. make next of prev_node as new_node\n prev_node.next_node = new_node\n # 6. Make prev_node ass previous of new_node\n new_node.prev_node = prev_node\n # 7. Change previous of new_nodes's next node\n if new_node.next_node != nil\n new_node.next_node.prev_node = new_node\n end\n end",
"def add_first(data)\n new_node = Node.new(value, @head)\n @head = new_node\n end",
"def add_first(data)\n new_node = Node.new(data)\n new_node.next = @head\n @head = new_node\n end",
"def add_first(data)\n new_node = Node.new(data)\n new_node.next = @head\n @head = new_node\n end",
"def add_first(data)\n # Create a new node\n new_node = Node.new(data)\n if @head.nil?\n @head = new_node\n return\n end\n\n new_node.next = @head \n # conection between the new node and the next one that is the head.\n @head = new_node # The new node becomes the head.\n\n end",
"def enqueue(data)\n node = QueueNode.new data\n unless last.nil?\n @last.next = node\n @last = node\n end\n @first = node if @first.nil?\n end",
"def push(node, data)\n return Node.new data unless node\n\n data = replace_data(node, data) if is_first?(data, node.data)\n\n if left_first?(node.left, node.right)\n node.right = push(node.right, data)\n else\n node.left = push(node.left, data)\n end\n\n node\n end",
"def insert_at!(data, position)\n node, head, tail = set_insert_vars(data, position)\n\n # before: head -> position -> tail\n # after: head -> node -> tail\n head.tail = node if head\n node.tail = tail\n tail.head = node if tail\n node.head = head\n\n # set @tail for list or it will use old tail\n if position.tail?\n @tail = node\n end\n\n # orphan the old node\n position.head = nil\n position.tail = nil\n end",
"def unshift(data)\n \tunless @head\n \t initialize data\n \telse\n \t node = Node.new(data)\n \tnode.prev = nil\n \t\tnode.next = @head\n\n \t\t@head.prev.next = node\n \t\t@size += 1\n \t\tnil\n \t\tend\n end",
"def add_first(data)\n @head = Node.new(data, head)\n end",
"def insert_data(data)\n self.root = insert(data)\n end",
"def insert_at(data, index)\n\t\t@current_node = at(index)\n\t\t@insert_node = Node.new(data, @current_node)\n\n\t\t#Handeling the case that user inserts a node at head position (even though prepend exists for that)\n\t\tif @current_node != @head\n\t\t\t@old_link_node = at(index - 1)\n\t\t\t@old_link_node.next_node = @insert_node\n\t\telse\n\t\t\t@head = @insert_node\n\t\tend\n\tend",
"def push(value)\n new_node = LinkedListNode.new(value, @data)\n @data = new_node\n end",
"def push(new_value)\n @data = LinkedListNode.new(new_value, @data)\n end",
"def push(value)\n @data = LinkedListNode.new value, @data\n end",
"def push(value)\r\n if @data != nil\r\n node = LinkedListNode.new(value, @data)\r\n else\r\n node = LinkedListNode.new(value)\r\n end\r\n @data = node\r\n end",
"def insert(data)\n if @data.nil?\n @data = data\n else\n if data < @data\n if @left.nil?\n @left = Node.new(data)\n else\n @left.insert(data)\n end\n elsif data > @data\n if @right.nil?\n @right = Node.new(data)\n else\n @right.insert(data)\n end\n end\n end\n end",
"def push(value)\n @data = LinkedListNode.new(value, @data) \n end",
"def insert_at(data, index)\n return nil if index < 0 || index > @size \n new_node = Node.new(data, at(index))\n at(index - 1).next_node = new_node\n @size += 1\n end",
"def insert(data, index)\n if index.zero?\n push_front(data)\n return\n end\n\n temp = @head\n\n (0..index - 2).each do |_i|\n break if temp.next.nil?\n\n temp = temp.next\n end\n\n next_node = temp.next\n temp.next = Node.new(data, temp, next_node)\n @tail = temp.next if next_node.nil?\n @size += 1\n end",
"def push(value)\n @data = LinkedListNode.new(value, data)\n end",
"def add(info)\n\t\t_new = Node.new(info, previous: @tail)\n\t\tif @head.nil?\n\t\t\t@head = _new\n\t\t\t@tail = @head\n\t\telse\n\t\t\t@tail.next = _new\n\t\t\t@tail = _new\n\t\tend\n\t\t@length += 1\n\t\tself\n\tend",
"def push(value)\n @data = LinkedListNode.new(value, @data)\n end",
"def push(value)\n @data = LinkedListNode.new(value, @data)\n end",
"def insertNodeAtPosition(llist, data, position)\n tracked_node = llist\n new_node = SinglyLinkedListNode.new data\n\n unless llist\n return new_node\n end\n if position == 0\n new_node.next = llist\n return new_node\n end\n\n current_position = 0\n current_node = llist\n while(current_position != position - 1 && llist.next != nil)\n current_node = current_node.next\n current_position += 1\n end\n node_at_position = current_node.next\n current_node.next = new_node\n new_node.next = node_at_position\n\n return tracked_node\n\nend",
"def push_front(data)\n next_node = @head\n temp = Node.new(data, nil, next_node)\n @head = temp\n @size += 1\n end",
"def insert_sorted(data)\n return insert(data) if !@head || data <= @head.data\n current = @head\n while current.next && current.next.data < data\n current = current.next\n end\n current.next = Node.new(data, current.next)\n end",
"def <<(data)\n insert(-1, data)\n end",
"def push(value)\r\n\t\tif @data.nil? \r\n\t\t\t@data = LinkedListNode.new(value) \r\n\t\telse\r\n\t\t\t@data = LinkedListNode.new(value, @data)\r\n\t\tend\r\n\tend",
"def insert_sorted(data)\n if (!@head || data <= @head.data)\n return insert(data)\n end\n current = @head\n while (current.next && current.next.data < data)\n current = current.next\n end\n current.next = Node.new(data, current.next)\n end",
"def push(value)\n @data = LinkedListNode.new(value, @data)\n end",
"def push(value)\n @data = LinkedListNode.new(value, @data)\n end",
"def push(value)\n # IMPLEMENT ME!\n if @data == nil\n @data = LinkedListNode.new(value)\n else\n @data = LinkedListNode.new(value, @data)\n end\n end",
"def sortedInsert(head, data)\n current_node = head\n new_node = DoublyLinkedListNode.new(data)\n \n if current_node.nil?\n return head = new_node\n elsif current_node.data > data\n new_node.next = current_node\n current_node.prev = new_node\n return head = new_node\n end\n \n while !current_node.next.nil?\n if current_node.next.data > data\n new_node.next = current_node.next\n current_node.next.prev = new_node\n current_node.next = new_node\n new_node.prev = current_node\n return head\n else\n current_node = current_node.next\n end\n end\n \n current_node.next = new_node\n new_node.prev = current_node\n head\nend"
] |
[
"0.8308698",
"0.8247943",
"0.8239432",
"0.81293553",
"0.80927175",
"0.8074037",
"0.80644155",
"0.80509025",
"0.79239196",
"0.7918815",
"0.79041415",
"0.78975517",
"0.78829336",
"0.7876351",
"0.786807",
"0.78648305",
"0.78505915",
"0.7803414",
"0.77253866",
"0.77229077",
"0.7711915",
"0.77100825",
"0.7700862",
"0.7675366",
"0.7671879",
"0.76650393",
"0.76510197",
"0.76451933",
"0.7633418",
"0.75936365",
"0.75869983",
"0.7583917",
"0.75382555",
"0.7507302",
"0.74639803",
"0.7431634",
"0.74227357",
"0.7412932",
"0.740631",
"0.74034005",
"0.740088",
"0.7383301",
"0.7366271",
"0.73187447",
"0.72592986",
"0.72412336",
"0.7193372",
"0.7179244",
"0.71740484",
"0.70950645",
"0.7059786",
"0.7043507",
"0.702693",
"0.7014873",
"0.70137995",
"0.69670194",
"0.69411874",
"0.6940056",
"0.69004506",
"0.6882735",
"0.6874731",
"0.6858717",
"0.6858717",
"0.6858717",
"0.6852887",
"0.6851992",
"0.6838068",
"0.6813805",
"0.6813207",
"0.6791104",
"0.6791104",
"0.67718476",
"0.6767789",
"0.676687",
"0.6737525",
"0.6686347",
"0.66782504",
"0.6675793",
"0.66735375",
"0.6662458",
"0.6651796",
"0.6650963",
"0.66387737",
"0.6613496",
"0.66111475",
"0.66038364",
"0.6600952",
"0.6594418",
"0.65897524",
"0.65835243",
"0.65835243",
"0.65518624",
"0.6551215",
"0.6543892",
"0.65265",
"0.64964265",
"0.64885914",
"0.6483902",
"0.6483902",
"0.6478472",
"0.64749056"
] |
0.0
|
-1
|
This method removes the last node in the lists and must keep the rest of the list intact.
|
def remove_tail
retval = self.tail
if self.head == self.tail
self.head = nil
self.tail = nil
return retval
end
node = self.head
until node.next == retval do
node = node.next
end
node.next = nil
self.tail = node
return retval
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def pop() #delete last element in the LL\n return nil if @head == nil #if list is empty return nil\n return @head = nil if self.list_size == 1 #list has 1 element(head) assign head to nil\n temp_node = @head #if list has more then 1 element, travres till last element\n #stop conditon is when second element from current link to nil, means that first\n #from current is last element in the list\n until temp_node.link.link == nil \n temp_node = temp_node.link\n end\n temp_node.link = nil #cat the link with last element by assigning previous link to nil\n end",
"def remove_last\n return nil if empty?\n node = @sentinel.prev\n e = node.data\n node.prev.next = @sentinel\n @sentinel.prev = node.prev\n e\n end",
"def remove_last\n return nil if empty?\n node = @sentinel.prev\n e = node.data\n node.prev.next = @sentinel\n @sentinel.prev = node.prev\n e\n end",
"def remove_last\n raise 'Cannot remove element from an empty list.' if empty?\n\n # Extract the data off of the tail node\n # Move the tail to the previous node\n data = @tail.data\n @tail = @tail.prev_node\n @size -= 1\n\n # removes the same element from @head, if it was final element/node\n if empty?\n @head = nil\n else\n # send to garbage collector\n @tail.next_node = nil\n end\n\n return data\n end",
"def remove_last\n raise 'Cannot remove element from an empty list.' if empty?\n\n # Extract the data off of the tail node\n # Move the tail to the previous node\n data = @tail.data\n \n if size < 2\n return remove_first\n else\n each_cons(2) do |node, next_node|\n if next_node.next_node == nil\n @tail = node\n @tail.next_node = nil\n break\n end\n end\n end\n\n @size -= 1\n\n return data\n end",
"def remove_last_child\n @elements.pop\n end",
"def pop\n return if list == nil\n\n lastElem = nil\n if list.nextNode == nil\n lastElem = list\n @list = nil\n else\n node = @list\n while (node != nil)\n if (node.nextNode != nil && node.nextNode.nextNode == nil)\n lastElem = node.nextNode\n node.nextNode = nil\n break\n end\n node = node.nextNode\n end\n end\n lastElem\n end",
"def remove_tail\n\n current_node = @head\n if @head == nil #empty lit\n return nil\n end\n if @head.next == nil #list of one\n temp = @head\n @head = nil\n @tail = nil\n return temp\n end\n while(current_node.next.next) #to traverse the list\n current_node = current_node.next\n end\n temp_two = current_node.next\n current_node.next = nil\n @tail = current_node\n return temp_two\n end",
"def remove_tail\n remove_node(@tail)\n end",
"def remove_tail\n if self.head == nil # does nothing to an empty list\n return nil\n end\n \n delete (self.tail) # otherwise, deletes the tail\n end",
"def delete_tail\r\n delete_node @tail\r\n end",
"def remove_tail\n # Loop through the nodes until gets to the last node\n temp_node = @head\n\n if temp_node == @tail\n @head = nil\n @tail = nil\n else\n while temp_node.next != @tail\n temp_node = temp_node.next\n end\n\n @tail = temp_node\n end\n end",
"def remove_last\n raise 'No such element' if @size == 0\n elt = @tail.value\n if @size == 1\n @head = nil\n @tail = nil\n else\n @tail = @tail.previous\n @tail.next.previous = nil\n @tail.next = nil\n end\n @size -= 1\n return elt\n end",
"def pop\n if @head.nil?\n 'List is empty'\n else\n current_node = @head\n current_node = current_node.next_node until current_node.next_node.next_node.nil?\n last_node = current_node.next_node\n current_node.next_node = nil\n end\n last_node\n end",
"def pop\n current = @head\n\n # loop to second to last element of list\n until current.next_node == tail\n current = current.next_node\n end\n\n # update tail\n @tail = current\n\n # set next_node to nil\n current.next_node = nil\n end",
"def remove_tail\n if @current == @tail\n @head = nil\n @tail = nil\n else\n search_until(@tail)\n @tail = @current\n end\n end",
"def remove_at_tail\n\t\t\treturn nil if self.empty?\n\t\t\telement = self.head\n\t\t\tprevious_element = @head\n\n\t\t\tuntil element.next.nil?\n\t\t\t\tprevious_element = element\n\t\t\t\telement = element.next\n\t\t\tend\n\n\t\t\tprevious_element.next = nil\n\t\t\telement\n\t\tend",
"def remove_tail\n if self.head == self.tail\n self.tail = nil\n self.head = nil\n elsif self.head != nil\n current = self.head\n while current.next != self.tail\n current = current.next\n end\n current.next = nil\n self.tail = current\n end\n end",
"def remove_tail\n if @head == @tail\n @head = @tail = nil\n else\n placeholder = @head\n while placeholder.next != @tail\n placeholder = placeholder.next\n end\n placeholder.next = nil\n @tail = placeholder\n end\n end",
"def remove_tail\n current_node = self.head\n if current_node == self.tail\n self.head = nil\n self.tail = nil\n else\n while current_node.next != self.tail\n current_node = current_node.next\n end\n self.tail = current_node\n current_node.next = nil\n end\n end",
"def reverse!\n old_list = self\n new_list = List.new(self.last_node)\n previous_node = self.get_previous_node(self.last_node)\n old_list.remove(old_list.last_node)\n reverse_util(old_list, new_list, previous_node)\n end",
"def pop\n each_with_index do |node, index|\n if index == self.size - 2\n @tail = node\n @tail.next_node = nil\n end\n end\n end",
"def remove_from_list\n if in_list?\n decrement_positions_on_lower_items\n set_list_position(nil)\n end\n end",
"def remove_tail\n current_tail = self.tail\n current_head = self.head\n if current_head != current_tail\n current = self.head\n until current.next == current_tail\n current = current.next\n end\n current.next = nil\n self.tail = current\n else\n self.tail = nil\n self.head = nil\n end\n end",
"def remove_tail\n if @head === @tail #if there is only one node\n @head = nil\n @tail = nil\n else # iterate over linked list\n current_node = @head\n # check to see if current_node is not NIL && that the next node is not the tail node\n while ((!current_node.nil?) && (current_node.next != @tail)) do\n current_node = current_node.next\n end\n @tail = current_node\n @tail.next = nil\n end\n end",
"def remove_tail\n if @head\n node_being_chkd = @head\n while node_being_chkd && (node_being_chkd.next != @tail)\n node_being_chkd = node_being_chkd.next\n end\n @tail = node_being_chkd\n @tail.next = nil if @tail\n else\n nil\n end\n end",
"def pop\n\t\tcurrent_node = @head \n\t\tif current_node.next_node == nil \n\t\t\t@head = nil \n\t\tend \n\t\tuntil current_node.next_node.next_node == nil \n\t\t\tcurrent_node = current_node.next_node\n\t\tend \n\t\tcurrent_node.next_node = nil \n\tend",
"def remove_tail\n if self.head.next == nil\n self.head = nil\n self.tail = nil\n else\n temp = self.head\n while temp && (temp.next.next != nil)\n temp = temp.next\n end\n temp.next = nil\n self.tail = temp\n end\n end",
"def reverse\n\n\t\treturn if @head.nil?\n\n\t\ttemp = self.remove_node\n\t\ttemp.next = nil\n\t\t@last = temp\n\n\t\tuntil @head.nil?\n\n\t\t\tnode = self.remove_node\n\t\t\tnode.next = temp\n\t\t\ttemp = node\n\n\t\tend\n\n\t\t@head = temp\n\n\tend",
"def remove_from_list\n # if in_list?\n # decrement_positions_on_lower_items\n # update_attribute position_column, nil\n # end \n return unless in_list?\n decrement_positions_on_lower_items\n update_attribute position_column, nil \n end",
"def remove_tail\n if self.head == nil\n p \"There isn't anything in the linked list\"\n elsif self.head.data == self.tail.data\n self.head = nil\n self.tail = nil\n else\n temp_node = self.head\n while temp_node.next != self.tail\n temp_node = temp_node.next\n end\n self.tail = temp_node\n end\n end",
"def deletelist\n if @head == nil\n puts \"List deleted\"\n end\n\n tmp = @head\n while(@head != nil)\n tmp = tmp.next\n @head.next = nil\n @head = tmp\n end\n end",
"def remove_tail\n if self.head != nil && self.head.next != nil\n previous = nil\n current = self.head\n while current.next != nil\n previous = current\n current = current.next\n end\n previous.next = nil\n self.tail = previous\n else\n self.tail = nil\n end\n end",
"def remove_last\n # if the head is nil, then we just return nil\n return nil if head.nil?\n # if it's only one node, thet remove_last is equal to pop\n return pop if head.next_node.nil?\n\n # we keep searching for the next node until\n # current.next_node is nil\n prev = @head\n current = @head\n\n while !current.next_node.nil?\n prev = current\n current = current.next_node\n end\n # since current.next_node is nil, we just\n # disconnect it and update the tail reference\n prev.next_node = nil\n @tail = prev\n return current.value\n end",
"def remove_tail\n if @head === @tail\n @head = nil\n @tail = nil\n else\n node = @head\n until ((node.nil?) && (node.next.eql?(@tail))) do\n node = node.next\n end\n @tail = node\n @tail.next = nil\n end\n end",
"def ll_pop()\n current = @head\n \n if @num_nodes == 0\n return nil\n elsif @num_nodes == 1\n @head = nil\n @tail = nil\n else\n second = @head.get_Next()\n @head = second\n end\n \n @num_nodes -= 1\n return current.get_Data()\n end",
"def remove_from_list\n return unless in_list?\n decrement_positions_on_lower_items\n set_my_position nil\n end",
"def pop\n node = last\n last = node.prv\n last.nxt = nil\n node.prv = nil\n node\n end",
"def remove_tail\n if self.tail.nil?\n return nil\n elsif self.head.next.nil?\n self.tail = nil\n else\n current_node = self.head\n until current_node.next == self.tail\n current_node = current_node.next\n end\n current_node.next = nil\n self.tail = current_node\n end\n end",
"def pop\n last = find_tail.data\n node = find_before(last)\n node.next = nil\n end",
"def remove_tail\n if @head === @tail\n @head = nil\n @tail = nil\n else\n current = @head\n while ((current != nil) && (current.next != @tail)) do\n current = current.next\n end\n @tail = current\n @tail.next = nil\n end\n end",
"def pop\n last_node = self.tail\n self.at(self.size - 2).next_node = nil\n return last_node\n end",
"def remove_at_head\n\t\t\treturn nil if self.empty?\n\t\t\telement = self.head\n\t\t\t@head.next = nil || element.next\n\t\t\telement\n\t\tend",
"def remove\n return @exact.shift unless @exact.empty?\n @list.shift\n end",
"def pop\n return nil if @head.nil? || self.size == 0\n current_node = @head\n prev_node = nil\n (self.size - 1).times do\n prev_node = current_node\n current_node = current_node.next\n end\n current_node = nil\n @tail = prev_node\n end",
"def pop\n list.pop\n end",
"def remove_tail\n if @head === @tail\n @head = nil\n @tail = nil\n else\n current_node = @head\n while current_node.next != @tail\n current_node = current_node.next\n end\n current_node.next = nil\n @tail = current_node\n end\n end",
"def remove_tail\n if self.head.nil? || self.head.next.nil?\n self.tail = nil\n else\n last_node = self.head\n prev_to_last = nil\n\n until last_node.next.nil?\n prev_to_last = last_node\n last_node = last_node.next\n end\n\n prev_to_last.next = nil\n self.tail = prev_to_last\n return prev_to_last\n end\n end",
"def pop\n last = size\n at(last - 2).next_node = nil\n end",
"def delete_tail\n # Create a var to hold the current_node; init with head\n current_node = @head\n\n # If the SLL is empty, there's nothing there other than an empty head; return it\n if empty?\n return @head\n elsif @head.next\n # If the head node has a next\n # AND if that next has a next\n while current_node.next.next\n # Reassign current node to point to its next until current is second to last node\n current_node = current_node.next\n end\n\n # Current is now second to last node\n # Set current's next to nil, destroying the reference to the last node, the tail\n current_node.next = nil\n else\n # If there's just one node, it's both head and tail, set its value to nil\n @head.value = nil\n end\n\n # Decrement in all cases\n @size -= 1 if size > 0\n # Return the new tail or an empty head\n current_node\n end",
"def pop\n node = self.double_link_linked_list.delete_tail\n node ? node.value : nil\n end",
"def remove node\n # if the node is at beginning or end of list\n # handle this separately\n return remove_first if node.prev_node == nil\n return remove_last if node.next_node == nil\n\n # tell adjacent nodes to 'skip' over this node\n node.next_node.prev_node = node.prev_node\n node.prev_node.next_node = node.next_node\n\n # store the data, so we can return it\n data = node.data\n\n # send to garbage collector\n node.data = nil\n node = node.prev_node = node.next_node = nil\n\n @size -= 1\n\n return data\n end",
"def pop\r\n removed_item = @data\r\n @data = @data.next_node\r\n removed_item.next_node = nil\r\n removed_item\r\n end",
"def remove_tail\n if @tail === nil # if no tail\n return nil\n elsif @head.next === nil # if list is only head\n @tail = nil\n else # cycle thru to remove\n current_node = @head\n while current_node.next != @tail\n current_node = current_node.next\n end\n current_node.next = nil\n @tail = current_node\n end\n end",
"def remove_node(value)\n new_head = remove_node_recursively(@head, value)\n if new_head\n @head = new_head\n else\n puts \"You can't empty list\"\n end\n end",
"def remove_from_list\n if in_list?\n decrement_positions_on_lower_items\n set_my_position nil\n end\n end",
"def pop\n return nil if @head.nil?\n if self.size > 1\n @tail = self.at(self.size-1) \n @tail.next = nil\n else # only 1 node\n @tail = @head = nil\n end\t\n end",
"def pop\n current_node = @head\n until current_node.next_node.nil?\n previous_node = current_node\n current_node = current_node.next_node\n end\n previous_node.next_node = nil\n @tail = previous_node\n current_node \n end",
"def remove_last_component()\n remove_component_at(index: @child_components.size - 1)\n end",
"def remove(index)\n @size -= 1\n if index == 0\n @first_item = @first_item.next_list_item\n else\n previous_item = get_item( index -1)\n next_list_item = previous_item.next_list_item.next_list_item\n previous_item.next_list_item = next_list_item\n #get_item( index - 1).next_list_item = nil\n # return @first_item = @first_item.next_list_item if index == 0\n # item = @first_item\n # (index - 1).times do\n # item = item.next_list_item\n # # puts \"(((((((()))))))))))))((((((((((((((@item))))))))))))))\"\n # # puts @first_item.payload\n # # puts\"((((((((((((((item.next_list_Item)))))))))))))\"\n # # puts item.payload\n # end\n # raise IndexError if item.nil?\n # item.next_list_item = item.next_list_item.next_list_item\n end\nend",
"def pop\n\t\t\t\tif @length == 0\n\t\t\t\t\traise RuntimeError.new(\"Cannot pop from empty list.\")\n\t\t\t\telse\n\t\t\t\t\tif @tail.prev == nil\n\t\t\t\t\t\t# there is only one element\n\t\t\t\t\t\t@head = nil\n\t\t\t\t\t\t@tail = nil\n\t\t\t\t\telse\n\t\t\t\t\t\t@tail.prev.next = nil\n\t\t\t\t\t\t@tail = @tail.prev\n\t\t\t\t\tend\n\t\t\t\t\t@length -= 1\n\t\t\t\tend\n\t\t\tend",
"def delete_at_index(index)\n if @llist\n if index == 0\n @llist = @llist.next_node\n else\n node = get(index)\n prev_node = get(index-1)\n prev_node.add_next_node node.next_node\n end\n else\n# todo: handle unknown index\n end\n end",
"def accept_list_end list\n @list_index.pop\n @list_type.pop\n @list_width.pop\n end",
"def pop\n node_count = self.size\n\n @tail = self.at(node_count-2) #-2 because of how size works\n @tail.next_node = nil\n end",
"def remove_tail\n if (@head == @tail)\n @head = nil\n @tail = nil\n elsif (@head.next == @tail)\n @head.next = nil\n @tail = @head\n else\n current = head\n while(current.next != nil && current.next != @tail)\n current = current.next\n end\n @tail = current\n end\n end",
"def del_final\n @tail = @tail.node_ant\n if @tail != nil\n @tail.edi_sig(nil)\n else\n @head = @tail\n end\n end",
"def pop\n if @size==1\n \t@root=nil\n \t@tail=nil\n \t@size-=1\n elsif @size>1\n \t#want second to last element\n node=at(@size-2)\n node.next_node=nil\n @tail=node\n @size-=1\n end\n\n end",
"def remove\n node = @head\n\n if node\n @head = node.next_node\n @tail = nil unless @head\n\n node.data\n end\n end",
"def remove_tail\n return nil if @head == nil\n\n node = @head\n popped = @tail\n if @head == @tail\n @head = nil\n @tail = nil\n else\n until node.next == @tail\n node = node.next\n end\n @tail = node\n @tail.next = nil\n end\n end",
"def pop\n if size == 1\n @head.next_node = nil\n else\n current = @head.next_node\n previous = @head\n\n while current.next_node != nil\n current = current.next_node \n previous = previous.next_node\n end\n\n previous.next_node = nil\n end\n end",
"def pop\n previous_node = nil\n current_node = @head\n while current_node.next_node != nil\n previous_node, current_node = current_node, current_node.next_node\n end\n previous_node.next_node = nil\n @tail = previous_node\n end",
"def remove_topmost_node\n (@n = @open.shift)\n @closed << @n\n @full_path << @n\n end",
"def erase_tail()\n aux = @tail[:next]\n aux[:prev] = nil\n @tail = aux\n end",
"def remove_next prev_node\n\t\treturn nil unless self.length > 0\n\n unless prev_node\n # remove head.\n self.head = self.head.next\n else\n self.hash.delete(prev_node.next.data)\n if prev_node.next == prev_node\n self.head = nil\n else\n old = prev_node.next\n prev_node.next = prev_node.next&.next\n if (old == self.head)\n self.head = old.next\n end\n end\n end\n\n \tself.length -= 1\n\tend",
"def remove\n @nxt.prv = @prv if @nxt\n @prv.nxt = @nxt if @prv\n end",
"def remove_at(index)\n return nil if @head.nil? || index > self.size - 1\n if index == 0\n @head = @head.next\n elsif index == self.size - 1\n self.pop(node)\n else\n current_node = @head\n prev_node = nil\n index.times do\n prev_node,current_node = current_node,current_node.next\n end\n end\n prev_node.next = current_node.next\n end",
"def remove_tail\n return @tail if @tail.nil?\n\n old_tail = @tail\n @tail = @tail.prev_node\n\n unless @tail.nil?\n @tail.next_node = nil\n else\n @head = @tail\n end\n\n old_tail\n end",
"def pop\n current_node = @head\n if current_node.next_node.nil?\n @head.nil?\n else\n while current_node.next_node\n previous = current_node\n current_node = current_node.next_node\n end\n previous.next_node = nil\n end\n end",
"def remove_max(list, last_pos)\n removed = list[0]\n list[0] = list[last_pos] \n list[last_pos] = removed\n heap_down(0, last_pos - 1, list)\nend",
"def remove_at(index)\n\t return false if @head.nil? || index > self.size \n\n\t if self.size == 1 || index == self.size #only one node or the last one\n\t self.pop \n\t elsif index == 1 # first node in the list: shift\n\t\t @head = @head.next\n\t else\t\n\t temp_node = self.at(index)\n\t node_ant\t= self.at(index-1)\n\t node_ant.next = temp_node.next\n\t temp_node.next = nil\n end\n return true\t \n\tend",
"def remove node\n return nil unless node \n # If the node we have to remove is the head of the list, we need to cover two situations\n if node == head\n # Head is the only node in the list. We set head and tail to nil and we are done\n if head.next.nil?\n self.head = self.tail = nil\n else\n # Head is not the only node in the list. \n # The node that’s next to head becomes the new head and the original head goes out of scope.\n self.head = self.head.next\n end\n else\n p = node.prev\n n = node.next\n p&.next = n\n n&.prev = p\n end\n self.length -= 1\nend",
"def unlink \n @lnode.unlink unless @lnode.nil?\n end",
"def clean_list(timestamp)\n while @tail && @tail.timestamp <= timestamp - 10\n @message_to_node.delete(@tail.message)\n @tail = @tail.next\n @tail&.prev = nil\n end\n\n unless @tail\n @head = nil\n end\n end",
"def remove_next prev_node\n\t\treturn nil unless self.length > 0\n\n unless prev_node\n # remove head.\n self.head = self.head.next\n else\n if prev_node.next == prev_node\n self.head = nil\n else\n old = prev_node.next\n prev_node.next = prev_node.next&.next\n if (old == self.head)\n self.head = old.next\n end\n end\n end\n\n \tself.length -= 1\n\tend",
"def delete_last()\n \n end",
"def ll_clear()\n @head = nil\n @tail = nil\n @num_nodes = 0\n end",
"def extract_tail\n raise \"Error la lista no puede estar vacia\" unless (@nodos > 1)\n penultimo = @tail.prev\n penultimo.next = nil\n @nodos = @nodos-1\n oldtail = @tail\n @tail = penultimo\n oldtail\n end",
"def remove_at(i)\n \t if @size==0 || i<0 || i>=@size\n \t \treturn nil\n \t end\n \t if i==0 && @size==1\n \t \t@root=nil\n \t \t@tail=nil \n \t elsif i==0\n @root=@root.next_node\n else\n \tpre_node=at(i-1)\n \ti_node= pre_node.next_node\n \tpre_node.next_node=i_node.next_node\n if i==@size-1#if last element was removed, update tails\n @tail=pre_node\n end\n end\n @size-=1\n\n end",
"def pop\n node = @head\n if @size > 1\n node = node.link until node.link.link.nil?\n node.link = nil\n else \n @head = nil\n end\n @size -= 1\n end",
"def reverse_linked_list(list)\n last_node = list.find_last_node\n current_index = list.index_of(last_node.data)\n loop do\n if current_index == 0\n list.find_node(current_index).next_node = nil\n break\n end\n list.find_node(current_index).next_node = list.find_node(current_index - 1)\n current_index -= 1\n end\n list.first_node = last_node\nend",
"def pop_back\n return nil if @size.zero?\n\n if @size == 1\n temp = @head.data\n @head = @tail = nil\n else\n temp = @tail.data\n @tail.prev.next = nil\n @tail = @tail.prev\n end\n @size -= 1\n temp\n end",
"def pop\n\t@new_tail = at((size) - 2)\n\t@new_tail.next_node = nil\n\n\t@tail = @new_tail\t\n\tend",
"def remove_at(index)\n if index == 0\n @head = @head.next_node\n elsif index == self.size - 1\n self.pop\n else\n previous = self.node_at(index - 1)\n current = self.node_at(index)\n previous.next_node = current.next_node\n end\n end",
"def pop\n if head == nil\n \"Nothing to remove\"\n else\n prev = nil\n cur = head\n while cur.next_node != nil\n prev = cur\n cur = cur.next_node\n end\n prev.next_node = nil\n end\n end",
"def delete(node)\n examined_node = @head\n after_examined_node = @head.next\n\n if examined_node == node #to be deleted item is first on the list\n remove_front()\n elsif node == @tail\n remove_tail()\n else\n\n while examined_node != node\n before_examined_node = examined_node\n\n if examined_node.next == nil\n\n else\n\n examined_node = examined_node.next\n end\n after_examined_node = examined_node.next\n\n if examined_node == node\n temp = before_examined_node\n before_examined_node.next = after_examined_node\n end\n end\n end\n end",
"def pop\n return nil unless self.length > 0\n \n self.head = self.head.next\n self.tail = nil if self.length == 1\n self.length -= 1\n end",
"def pop\n if(self.size == 0)\n return false\n end\n popped_node = self.first\n new_first = popped_node.next\n if(!new_first)\n self.last = new_first\n end\n popped_node.next = nil\n self.first = new_first\n self.size -= 1\n\n #pretty_print_node(popped_node)\n return popped_node\n end",
"def remove_at(index)\n self.at(index - 1).next_node = self.at(index + 1)\n self.at(index).next_node = nil\n end",
"def remove_first\n old_head = @head\n @head = @head.next_node unless @head.nil?\n @head.prev_node = nil unless @head.nil?\n old_head\n end",
"def remove_at(index)\n if index == 0\n @head = cur.next_node\n elsif index >= self.size\n pop\n else\n prev = nil\n cur = head\n i = 0\n until i == index\n prev = cur\n cur = cur.next_node\n i += 1\n end\n prev.next_node = cur.next_node\n end\n end"
] |
[
"0.7568185",
"0.7223491",
"0.7223491",
"0.7116486",
"0.7111025",
"0.70929784",
"0.69784075",
"0.6892222",
"0.68800265",
"0.6868323",
"0.68375057",
"0.6771561",
"0.67545986",
"0.67500013",
"0.6726881",
"0.6705629",
"0.66911924",
"0.66699106",
"0.6613078",
"0.66000044",
"0.6570533",
"0.65589285",
"0.65545756",
"0.6550512",
"0.6532503",
"0.65248775",
"0.6515743",
"0.650564",
"0.6500918",
"0.6491505",
"0.6480129",
"0.6450906",
"0.6447205",
"0.6436273",
"0.6433979",
"0.6426361",
"0.64092433",
"0.639747",
"0.63923746",
"0.63860613",
"0.63755804",
"0.6368642",
"0.63667727",
"0.6366763",
"0.63662726",
"0.63622946",
"0.63586193",
"0.63471603",
"0.6334326",
"0.6332752",
"0.6326609",
"0.6325637",
"0.6300164",
"0.6298561",
"0.6271205",
"0.62697643",
"0.6269613",
"0.62524134",
"0.6248913",
"0.6245717",
"0.6245415",
"0.62426573",
"0.6238699",
"0.6237595",
"0.62353635",
"0.62173086",
"0.6201306",
"0.6196051",
"0.61834866",
"0.61719185",
"0.6155064",
"0.6146364",
"0.61461335",
"0.61458457",
"0.6137568",
"0.6133877",
"0.61253995",
"0.6119295",
"0.6118712",
"0.6105544",
"0.610208",
"0.6097139",
"0.6097071",
"0.6096258",
"0.60860217",
"0.6082472",
"0.60815513",
"0.60801506",
"0.607839",
"0.60608387",
"0.60571134",
"0.6032018",
"0.6030129",
"0.6029752",
"0.6029272",
"0.60151976",
"0.60128945",
"0.6012038",
"0.601055",
"0.6005968"
] |
0.6540636
|
24
|
This method prints out a representation of the list.
|
def print
retval = "["
node = self.head
until node == nil do
retval += "#{node.value}"
node = node.next
if node != nil
retval += ", "
end
end
retval += "]"
puts retval
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def print_list; end",
"def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end",
"def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end",
"def print_list\n\t puts \"\"\n\t puts \"\"\n\t\tputs \"#{@list_name}\"\n\t\tprint \"-\" * 40\n\t\t@grocery_list.each {|k, v| puts \"#{k} #{v}\"}\n\t\tputs \"\"\n\t\tget_item\n\tend",
"def to_s\n printed_list = \"\"\n @list.each do |item, quantity|\n printed_list += \"#{quantity} #{item}\\n\"\n end\n return printed_list\n end",
"def print_list\n \t\tputs \"\\n----------------------------\"\n \t\tputs \"#{@date_created.month}/#{@date_created.day}/#{date_created.year}\"\n \t\tputs \"Your Grocery List:\\n\\n\" \t\t\n \t\tif @list.empty?\n \t\t\tputs \"The List Is Empty!\"\n \t\telse\n\n \t@list.each_with_index { |item, index| puts \"#{index+1}. #{item.qty} #{item.name}\" }\n end\n puts \"\\n----------------------------\"\n end",
"def print\n placeholder = @head\n list = \"\"\n while placeholder.next\n list += placeholder.data + \"\\n\"\n placeholder = placeholder.next\n end\n list += placeholder.data + \"\\n\" # the plus \"\\n\" added because of the way the spec is written.\n printf list\n end",
"def display (list)\n\tputs list\nend",
"def print(list)\n\tputs list\nend",
"def print_list\n\t\tcounter = 0\n\t\tcurrent_node = @head\n\t\tloop do\n\t\t\tputs \"Node at index #{counter}: #{current_node.data}\"\n\t\t\tbreak if current_node.next.nil?\n\t\t\tcurrent_node = current_node.next\n\t\t\tcounter += 1\n\t\tend\n\tend",
"def print_list(list)\n\tputs \"\\nHere is the list:\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend",
"def print_list(list)\n\tputs \"\\nHere is the list:\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend",
"def pretty_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list.\"\n\tend\nend",
"def print_list(list)\n\tlist.each do |item,quantity|\n\t\tp \"#{quantity} #{item}\"\n\tend\nend",
"def pretty_in_print(list)\n puts \"---------------------------------------\"\n puts \"These are the items we are gonna buy\"\n list.each {|item, qty| puts \"#{qty} pieces of #{item}\" }\nend",
"def display_list(list)\n\tlist.each do |list_item|\n\t\tputs \"* #{list_item}\"\n\tend\n\nend",
"def print_items\n @items.each { |item| print \"#{item} \"}\n puts \"\\n\"\n end",
"def print_list(list)\n\tlist.each do |item, quantity| puts \"#{item}: #{quantity}\"\n\t\t\n\tend\nend",
"def toString\n\t\tif (!@head)\n\t\t\tputs \"Empty List\\n\\n\"\n\t\telse\n\t\t\tcurrent = @head\n\t\t\tstring = \"Head->\"\n\t\t\twhile (current)\n\t\t\t\tstring += current.get_item().to_s + \"->\"\n\t\t\t\tcurrent = current.get_next()\n\t\t\tend\n\t\t\tstring += \"End\\n\\n\"\n\t\t\tputs \"List of Size: \" +@size.to_s\n\t\t\tputs string\n\t\tend\n\tend",
"def print_list(list)\n\tlist.each do |x,y|\n\t\tputs x + \": \" + y.to_s\n\tend\nend",
"def print_list(list)\n\tlist.each do |x,y|\n\t\tputs x + \": \" + y.to_s\n\tend\nend",
"def pretty_list(list)\n\tlist.each { |item_name, item_quantity|\n\t\tputs \"You will need to purchase #{item_quantity} of #{item_name}.\"\n\t}\nend",
"def print_list(list)\n puts \"List: #{list['name']}\"\n print_separator\n\n list[\"items\"].each do |item|\n puts \"\\tItem: \" + item['name'] + \"\\t\\t\\t\" +\n \"quantity: \" + item['quantity'].to_s\n end\n\n print_separator\nend",
"def print_list(list)\r\n puts \"-\"*20\r\n list.each do |item,quantity|\r\n puts \"Item:#{item} quantity:#{quantity}\"\r\n end\r\n puts \"-\"*20\r\n list\r\nend",
"def print_list\n $list.each {|list_item| puts \"#{list_item[:quantity]} #{list_item[:item]}\"}\nend",
"def pretty_print(list)\n list.each {|item, quantity| puts \"#{item} : #{quantity}\"}\nend",
"def print_list(type='all')\n\n\t\tputs \"{#name} List - #{type} items\"\n\t\tprint '-' * 30 + \"\\n\"\n\n\n\n\t\ttodo_items.each do |item|\n\t\t\tcase type\n\t\t\twhen 'all'\n\t\t\tputs item\n\t\twhen 'complete'\n\t\t\tputs item if item.complete?\n\t\twhen 'incomplete'\n\t\t\tputs item unless item.complete?\n\t\tend\n\t\tend\n\tend",
"def print\n \tlist = ''\n \tcurrent = @head\n \twhile !current.nil?\n list = list + \"#{current.value}\"\n list = list + ' ' if current.next != nil \n current = current.next\n \tend\n \tlist\n end",
"def show_list\n\t\tclear\n\t\tputs \"= LISTE DES INSTANCES #{name} =\".bleu\n\t\tputs \"\\n\\n\"\n\t\tlen_delim = defined?(LIST_ENTETE) ? LIST_ENTETE.length + 2 : 80\n\t\tdelim = (\"-\"*len_delim).bleu\n\t\tif defined?(LIST_ENTETE)\n\t\t\tputs delim\n\t\t\tputs LIST_ENTETE \n\t\tend\n\t\tputs delim\n\t\tall.each do |inst|\n\t\t\tputs \" #{inst.to_console}\"\n\t\tend\n\t\tputs delim\n\t\tputs \"\\n\\n\"\n\tend",
"def print_list(list)\n\tputs \"----- Shopping List -----\"\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\n\treturn list\nend",
"def inspect\n result = 'Immutable::List['\n each_with_index { |obj, i| result << ', ' if i > 0; result << obj.inspect }\n result << ']'\n end",
"def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend",
"def pretty_list(list)\n list.each do |item,quantity|\n p \"#{item}! You have #{quantity}.\"\n end\nend",
"def pretty_list(list)\r\n\tlist.each { |item, quantity| puts \"Item: #{item.capitalize} - Amount: #{quantity}\" }\r\nend",
"def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item}, amount: #{quantity}\"\n\tend\nend",
"def print_item_list\n @current_items.each_with_index do |item, item_no|\n puts \"Item #{item_no+1}\"\n puts \"----------------\"\n puts \"Item Name: #{item.name}\"\n puts \"----------------\"\n end\n end",
"def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend",
"def print_list(list)\n\tlist.each do |item, qty|\n\t\tputs \"#{item} = #{qty}\"\n\tend\nend",
"def print_pretty(new_list)\n puts \"Grocery List:\"\n new_list.each do |item, amount|\n \n puts \"#{item}: #{amount}\"\n end\nend",
"def print_list(list)\r\n puts \"Here is your current list: \"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end\r\nend",
"def showlist\n\t\t@people_list.each do |x|\n\t\t\tputs \"* #{capitalize(x.type)}, #{capitalize(x.name)}, #{capitalize(x.party)}\"\n\t\tend\n\tend",
"def print_list(list)\n\tputs \"Grocery List\"\n\tlist.each{|item, quantity|\n\t\tputs \"#{item} : #{quantity}\"\n\t}\nend",
"def pretty_list(list)\n list.each do |grocery_item, qty|\n puts \"#{grocery_item}, quantity: #{qty}\"\n end\nend",
"def print_friendly_list(list)\n puts \n puts \"Shopping List:\"\n puts \"----------------\"\n list.each {|key, value| puts \"#{key} #{value}\" }\n puts \nend",
"def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"#{item.capitalize}: #{quantity}\"\n\tend\nend",
"def pretty_list(list)\n puts \"Grocery List:\"\n list.each do |key, value|\n puts \"#{value} #{key}(s)\"\n end\n \nend",
"def print_pretty(list)\n list.each { |item, value| puts \"#{item} #{value}\" }\nend",
"def prettify_list(list)\n\tlist.each do |item, quantity|\n\t\tp \"You have #{quantity} #{item}\"\n\tend\nend",
"def pretty_print(pp)\n pp.group(1, 'Immutable::List[', ']') do\n pp.breakable ''\n pp.seplist(self) { |obj| obj.pretty_print(pp) }\n end\n end",
"def printable\n\t\t@entries.sort.map do |key, value|\n\t\t\t\"[#{key}] \\\"#{value}\\\"\"\n\t\tend.join(\"\\n\")\n\tend",
"def dump\n super\n\n puts \"list entry:\"\n pp list_entry\n puts\n\n puts \"inodes:\"\n each_inode do |inode|\n inode.dump\n end\n puts\n end",
"def pretty_list(list)\n # new_list = \"\"\n # list.each { |item, quantity| new_list << \"You want #{quantity} #{item}\\n\" }\n # return new_list\n list.each { |item, quantity| puts \"You want #{quantity} #{item}\\n\" }\nend",
"def print_list(list)\n\tputs \"This is what you need to buy:\"\n\tputs \"--------------------\"\n\tlist.each do |item, quantity|\n\t\tputs \" #{item} : #{quantity}\"\n\tend\n\tputs \"--------------------\"\nend",
"def print_list\n current_node = @head\n\n until current_node == nil\n\t print \"#{current_node.value} -> \"\n\t current_node = current_node.next\n end\n\n puts '' \t\n end",
"def print() #output all the values in the list #Code Type B\n current_node = @head #start from the top... yet, #Code Type B\n if current_node.nil? # if there's no head => the list is empty #Code Type B\n return nil #exit out of this #Code Type B\n end #Code Type B\n puts \"\\nx\\ty\\n------------\" #Code Type A\n\n while current_node != nil #Code Type B\n puts \"#{current_node.x}\\t#{current_node.y}\" #Code Type M\n current_node = current_node.next #Code Type B\n end #Code Type B\n end",
"def print_list(list)\r\n puts \"Your current grocery list\"\r\n puts \"---------------------------\"\r\n list.each do |item, quantity|\r\n puts \"#{item}: #{quantity}\"\r\n end \r\nend",
"def print_out(list)\n\tlist.each {|item, qty| puts \"#{item}; #{qty}\"}\nend",
"def printlist(list) \n\tputs \"Today's Grocery List is:\"\n\tlist.map { |item| puts \"* #{item}\"}\n\t\nend",
"def print_list(list)\r\n\r\n\tputs 'Shopping List'\r\n\r\n\tlist.each {|item, quantity| puts \"#{item}: #{quantity}\"}\r\n\t\r\n\tputs \"\"\r\n\r\nend",
"def print_list(list)\r\n\tlist.each {|item, quantity| puts \"#{item}: #{quantity}\"}\r\nend",
"def print_list(list)\n\tlist.each do |item,count|\n\t\tputs \"#{item}: #{count}\"\n\tend\nend",
"def print_list(list)\n p \"Shopping List:\"\n list.each do |k, v|\n p \"Item: #{k}, Qauntity: #{v}\"\n end\nend",
"def printItem\n print @category,\", \"\n print @batteryLife,\", \"\n print @modelNum,\", \"\n print @color,\", \"\n print @manufacturer,\", \"\n print @status,\", \"\n print @yearBuilt,\", \"\n print @price,\", \"\n print @features\n end",
"def print_list(list)\r\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\r\nend",
"def print_list(list)\n\t# input: list\n\t# output: none\n\n\t# print header\n\tputs \"Grocery List\\n------------\"\n\t# iterate over list\n\tfor item, qty in list do\n\t\t# print each item to screen ex: \" - Lemonade, 2 liters\"\n\t\tputs \" - #{item}, #{qty}\"\n\tend\n\nend",
"def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"We need #{quantity} #{item}\"\n\tend\nend",
"def print_list (list)\n list.each do |item|\n puts \"* \" + item\n end\nend",
"def format_list(items); end",
"def print(list)\n list.each do |item|\n puts \"*#{item}\"\n end\nend",
"def printList( name, list )\n title( \"#{name} available on #{$params[ :host ]}:#{$params[ :port ]}\", \"=\" )\n list.each {|item| print item.class == DictArrayItem ? \"#{item.name} - #{item.description}\\n\" : item }\n print \"\\n\"\n end",
"def printout (list)\n\tlist.each { |item, quantity| puts \"#{item} is #{quantity} \" } \nend",
"def print_list(list)\r\n puts \"_-\" *25 + \"\\n\\n\"\r\n puts \"Here is your Grocery List: \\n\\n\"\r\n list.each do |item, quantity|\r\n puts \"\\tItem: #{item} \\tAmount: #{quantity}\"\r\n end\r\n puts \"_-\" *25\r\nend",
"def display\n current = @head\n full_list = []\n while current.next != nil\n full_list += [current.data.to_s]\n current = current.next\n end\n full_list += [current.data.to_s]\n puts full_list.join(\"->\")\n end",
"def print_list(list)\n\tlist.each do |item, quantity|\n\t\tputs \"There are #{quantity} #{item} on the grocery list!!\"\n\tend\nend",
"def to_s\r\n @list.map{|el| el.to_s}.join ' | '\r\n end",
"def print_list(list)\n puts \"Grocery List\"\n list.each { |item, qty| puts \"#{item}: #{qty}\" }\nend",
"def print_list(list)\r\n# input: completed list\r\n# steps:\r\n # iterate over list and print formatted list\r\n puts \"Your Grocery List\"\r\n list.each do |item, quantity|\r\n puts \"#{item}, qty: #{quantity}\"\r\n end\r\n # format: each item with its own line\r\n # \"item - quantity\"\r\n# output: implicit return of list\r\nend",
"def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend",
"def pretty_list(grocery_list)\n grocery_list.each do |item, quantity|\n puts \"#{quantity} #{item}\"\n end\nend",
"def lister(list)\n\tlist.each do |item|\n\t\tputs \"* #{item}\"\n\tend\nend",
"def pretty_list(list_name)\r\n list_name.each do |key, value|\r\n p \"#{key}: #{value}\"\r\n end\r\nend",
"def print_list(fund_hash)\n fund_hash[:list].each do |item|\n puts \"Name: #{item[:name]}\"\n puts \"Description: #{item[:description]}\"\n puts \"Target: $#{item[:target]}\"\n puts \"Balance: $#{item[:balance]}\"\n puts \"Percentage: #{item[:percentage]}%\"\n puts \"Importance: #{item[:importance]}\"\n puts \"-------------------------\"\n end\n end",
"def print_list(list)\n list.each do |item, quantity|\n p \"#{item}: #{quantity}\"\n end\nend",
"def print_list(list)\n list.each do |name, quantity|\n puts \"#{name} : #{quantity}\"\n end\nend",
"def prettify(list)\r\n\r\n list.each do |item, quantity|\r\n puts \"There are #{quantity} #{item} in the list.\"\r\n end\r\n\r\nend",
"def pretty_list(groceries_list)\n\t# Print a line of text to lead into the list\n\tputs \"Here is your updated grocery list:\"\n\t# for each key and value in the list, print a string \n\t# containing the key and value\n\tgroceries_list.each do |item, quantity|\n\t\tputs \"#{item}: #{quantity}\"\n\tend\nend",
"def print\n list_head = self.head\n next_node = list_head.next\n while next_node\n next_node = next_node.next unless next_node.next === false\n end\n end",
"def pretty_list(grocery_list)\r\n puts \"Your Grocery List for next week!\"\r\n grocery_list.each do |item, num|\r\n puts \"#{item} qty #{num}\"\r\n end\r\n \r\nend",
"def print_list(list)\r\n puts \"YOUR LIST:\"\r\n list.each {|key, value| puts \"#{key}: #{value}\"}\r\nend",
"def pretty_list(list)\n list.each {|item, quantity| puts \"You need #{quantity} #{item}\"}\nend",
"def print_list(list)\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend",
"def print_list(list)\n puts \"This week's grocery list:\"\n list.each do |item, quantity|\n puts \"#{item}: #{quantity}\"\n end\nend",
"def print_list(list)\n list.each do |item, quant| \n puts \"Item: #{item}, Quantity: #{quant}\"\n end\nend",
"def list_formatter(list)\n\tlist.each do |item, quanity|\n\t\tputs \"we need #{quanity} of #{item}\"\n\tend\nend",
"def print_list_delete\n\t\tputs \"\"\n\t\tputs \"\"\n\t\tputs @list_name\n\t\tprint \"-\" * 40\n\t\t@grocery_list.each {|k, v| puts \"#{k} #{v}\"}\n\t\tputs \"\"\n\t\tdelete_item\n\tend",
"def print_list(list)\n\tmax_index = list.length;\n\ti=1\n\twhile i<=max_index\n\tprint \"#{i}. #{hash_to_string(list[i-1])}\".center(get_winsize)\n\tprint \"\\n\"\n\ti +=1\n\tend\nend",
"def print_list(list)\n list.each do |item, quantity| puts \"#{item}: #{quantity}\"\n\n end\nend",
"def pretty_list(list)\n list.each{|food, quantity| puts \"Please get #{quantity} #{food}.\"}\n puts \"Thanks!\"\nend",
"def print_list(list)\n puts \"Here's your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend",
"def listing(list)\n list.each {|item|puts \"* #{item}\"}\n print \"\\n\"\nend"
] |
[
"0.78834105",
"0.774563",
"0.774563",
"0.75637674",
"0.74403816",
"0.7367925",
"0.72690237",
"0.7222558",
"0.71940017",
"0.71452534",
"0.71394694",
"0.71394694",
"0.71307045",
"0.7120213",
"0.7116719",
"0.70976114",
"0.7060826",
"0.7054907",
"0.70359814",
"0.7001138",
"0.7001138",
"0.69931597",
"0.69903886",
"0.6987669",
"0.6977213",
"0.69583905",
"0.69488615",
"0.69329053",
"0.6930959",
"0.69127184",
"0.6900646",
"0.6899242",
"0.6899242",
"0.6872076",
"0.6871027",
"0.6869935",
"0.68654764",
"0.6857804",
"0.6853029",
"0.6811612",
"0.6809712",
"0.68038195",
"0.67960185",
"0.67761755",
"0.6767221",
"0.67664194",
"0.67608106",
"0.6754478",
"0.673968",
"0.6731064",
"0.6730114",
"0.67292994",
"0.6712544",
"0.6707651",
"0.6699331",
"0.66985136",
"0.668709",
"0.66853845",
"0.6679574",
"0.6678288",
"0.66757077",
"0.6668487",
"0.665965",
"0.66592133",
"0.66539377",
"0.66480625",
"0.66456157",
"0.664012",
"0.6635828",
"0.66303134",
"0.66221875",
"0.66154295",
"0.657899",
"0.6578518",
"0.65746367",
"0.6569387",
"0.6568511",
"0.65626967",
"0.65626967",
"0.6556321",
"0.6552907",
"0.6540391",
"0.6539745",
"0.6538781",
"0.6537473",
"0.65299004",
"0.6528584",
"0.6527889",
"0.65267587",
"0.65244824",
"0.65182287",
"0.65177196",
"0.6515062",
"0.6514644",
"0.65041554",
"0.65030587",
"0.6502002",
"0.64943475",
"0.64883965",
"0.64817077"
] |
0.6577018
|
74
|
This method removes `node` from the list and must keep the rest of the list intact.
|
def delete(node)
if node == self.head
if self.head == self.tail
self.head = nil
self.tail = nil
node.next = nil
return node
end
self.head = node.next
node.next = nil
return node
end
self.print
node1 = self.head
until node1.next == node do
if node1.next == nil
return nil # not on the list
end
node1 = node1.next
end
node1.next = node.next
if node == self.tail
self.tail = node1
end
node.next = nil
return node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def remove(node)\n end",
"def remove_node(node)\n\t\t\tif has_node?(node)\n\t\t\t\tpull_edges_of(node)\n\t\t\t\t@nodes.delete(node)\n\t\t\t\t@order -= 1\n\t\t\tend\n\t\t\tself\n\t\tend",
"def node_remove(node)\n return unless node_present? node\n nodes.delete prepare_key(node)\n end",
"def remove_node(node)\n @nodes_being_worked_on.delete(node)\n @nodes.delete(node)\n # the last edge keeps getting ignored when you remove this, so handling the final case\n assign_node(@edges[0][1]) if @edges.size == 1\n @edges.reject! { |edge| edge.include?(node) }\n end",
"def delete(node)\n if !@head.nil?\n if @head === node\n remove_front\n elsif @tail === node\n remove_tail\n else # iterate over the list\n current_node = @head\n while !current_node.nil? && current_node.next != node\n current_node = current_node.next #move to the next node\n end\n if current_node.next == node\n current_node.next = current_node.next.next # skip over the matched node and thereby reset current_node's next node.\n end\n end\n end\n end",
"def remove node\n # if the node is at beginning or end of list\n # handle this separately\n return remove_first if node.prev_node == nil\n return remove_last if node.next_node == nil\n\n # tell adjacent nodes to 'skip' over this node\n node.next_node.prev_node = node.prev_node\n node.prev_node.next_node = node.next_node\n\n # store the data, so we can return it\n data = node.data\n\n # send to garbage collector\n node.data = nil\n node = node.prev_node = node.next_node = nil\n\n @size -= 1\n\n return data\n end",
"def delete(node)\n examined_node = @head\n after_examined_node = @head.next\n\n if examined_node == node #to be deleted item is first on the list\n remove_front()\n elsif node == @tail\n remove_tail()\n else\n\n while examined_node != node\n before_examined_node = examined_node\n\n if examined_node.next == nil\n\n else\n\n examined_node = examined_node.next\n end\n after_examined_node = examined_node.next\n\n if examined_node == node\n temp = before_examined_node\n before_examined_node.next = after_examined_node\n end\n end\n end\n end",
"def remove node\n\t\treturn nil unless node\n\t\treturn nil unless self.length > 0\n\n\t\t# head?\n\t\treturn remove_next node if (self.length == 1)\n\n\t\t# Find the precedent node to the node we \n\t\t# want to remove.\n\t\tprev = nil\n\t\tself.current = self.head\n\t\twhile ((prev = self.move_next) != node)\n\t\tend\n\t\tremove_next prev\n\tend",
"def del_access_node(node)\n puts \"Deleting Node with value: #{node.value} from the list\"\n if node.next != nil\n node.value = node.next.value\n node.next = node.next.next\n else\n node.value = nil\n end\n print\n end",
"def removed(node)\n\t\t\t@size -= 1\n\t\t\treturn node\n\t\tend",
"def remove node\n return nil unless node \n # If the node we have to remove is the head of the list, we need to cover two situations\n if node == head\n # Head is the only node in the list. We set head and tail to nil and we are done\n if head.next.nil?\n self.head = self.tail = nil\n else\n # Head is not the only node in the list. \n # The node that’s next to head becomes the new head and the original head goes out of scope.\n self.head = self.head.next\n end\n else\n p = node.prev\n n = node.next\n p&.next = n\n n&.prev = p\n end\n self.length -= 1\nend",
"def remove_node(node)\n return nil unless node\n previous_node = node.previous_node\n next_node = node.next_node\n previous_node.next_node = next_node if previous_node\n next_node.previous_node = previous_node if next_node\n self.head = node.next_node if node == head\n node\n end",
"def delete(node)\n if node == @head\n remove_front()\n elsif node == @tail\n remove_tail()\n else\n search_until(node)\n @current.next = node.next\n end\n end",
"def delete(node)\n if @tail == node # if node is tail (or also, where list of 1)\n remove_tail\n elsif @head == node # remove head\n @head = @head.next\n else # remove a middle node\n current_node = @head\n while current_node.next != node\n current_node = current_node.next\n end\n current_node.next = node.next\n end\n end",
"def remove_node(node) \n case node\n when @tail\n remove_tail\n when @head\n # this is a good candidate for a helper method!\n @head = node.next_node\n @head.prev_node = nil unless @head.nil?\n @tail = @head if @head.nil? || @head.next_node.nil?\n else\n node.prev_node.next_node = node.next_node unless node.prev_node.nil?\n node.next_node.prev_node = node.prev_node unless node.next_node.nil?\n end\n \n node\n end",
"def delete(node)\n current_node = self.head.next\n last_node = self.head\n\n if self.head == node\n self.head = self.head.next \n else\n while current_node != nil # Runs through each node in the list.\n if current_node == node # Checks for node to be deleted.\n if current_node == self.tail\n self.tail = last_node\n end\n last_node.next = current_node.next\n end\n last_node = current_node\n current_node = current_node.next\n end\n end\n end",
"def delete(node)\n remove_node(node)\n end",
"def remove\n node = @head\n\n if node\n @head = node.next_node\n @tail = nil unless @head\n\n node.data\n end\n end",
"def remove!(node)\n super\n key_to_node.delete(node.key)\n self\n end",
"def remove node\n\t\treturn nil unless node\n\n\t\tif node == head\n\t\t\tif head.next.nil?\n\t\t\t\tself.head = self.tail = nil\n\t\t\telse\n\t\t\t\tself.head = self.head.next\n\t\t\tend\n\t\telse\n\t\t\ttmp = self.head\n\t\t\twhile tmp && tmp.next != node\n\t\t\t\ttmp = tmp.next\n\t\t\tend\n\t\t\ttmp.next = node.next if tmp\n\t\tend\n\t\tself.length -= 1\n\tend",
"def remove(node)\n # Traverse looking for the node\n sets = []\n prev_link = nil\n each_link do |link|\n if link[:ref_id] == node.id\n sets << [prev_link, link]\n next # in case adjacent removal node links\n end\n prev_link = link\n end\n # Now we can just do the join and we're out\n sets.each do |prev_link, the_link|\n if prev_link\n prev_link[:next_id] = the_link[:next_id]\n else\n self[:head_id] = the_link[:next_id]\n end\n # Mark removal\n element_removed!\n end\n # Return the node if any were removed\n node unless sets.empty?\n end",
"def delete(node)\n if self.head.data == node.data\n self.remove_front\n else\n temp = self.head\n while temp && (temp.next.data != node.data)\n temp = temp.next\n end\n target = temp.next\n temp.next = target.next\n if temp.next == nil\n self.tail = temp\n end\n end\n end",
"def remove node\n\t\treturn nil unless node\n\n\t\tif node == head\n\t\t\tif head.next.nil?\n\t\t\t\tself.head = self.tail = nil\n\t\t\telse\n\t\t\t\tself.head = self.head.next\n\t\t\tend\n\t\telse\n\t\t\tp = node.prev\n\t\t\tn = node.next\n\t\t\tp&.next = n\n\t\t\tn&.prev = p\n\t\tend\n\t\tself.length -= 1\n\tend",
"def delete_node(node)\n ## just copy the information of the next node and then cut it out\n node.id = node.next.id\n node.next = node.next.next\nend",
"def remove_node(value)\n new_head = remove_node_recursively(@head, value)\n if new_head\n @head = new_head\n else\n puts \"You can't empty list\"\n end\n end",
"def remove(node)\n if link = Likewise::Link.find_by_id(key_for(node))\n remove_link(link)\n element_removed!\n element_decremented!(link[:weight])\n end\n node.context = link\n node\n end",
"def delete(node)\n if self.head == node\n remove_front\n elsif self.tail == node\n remove_tail\n else\n current_node = self.head\n until current_node.next == node\n current_node = current_node.next\n end\n current_node.next = node.next\n end\n end",
"def delete(node)\n if self.head == node # if deleting the head, then the second element becomes\n # the new head\n self.head = node.next\n return node\n end\n\n prev = previous(node) # compute the previous node\n \n if prev != nil\n prev.next = node.next # the previous node now points to the element after node\n end\n \n if self.tail == node # if the node is the last, then the previous becomes the new tail\n self.tail = prev \n end\n\n node.next = nil # no longer in the list, so no next\n return node\n end",
"def delete(node)\n if node === @tail\n remove_tail\n return\n elsif node === @head\n remove_front\n return\n else\n current_node = @head\n while current_node.next != node\n current_node = current_node.next\n end\n current_node.next = node.next\n end\n end",
"def remove_from_tree(item, node) \n return rebalance(super(item, node))\n end",
"def remove node\n # if the node is at beginning or end of list\n # handle this separately\n return remove_first if node == @head\n return remove_last if node == @tail\n\n # store the data, so we can return it\n data = node.data\n\n # iterate through nodes, two at a time\n each_cons(2) do |search_node, next_node|\n # if our second item in a pair is the node we are looking for\n if next_node == node\n # then make the previous node's (i.e the search_node) next node equal to the FOLLOWING\n search_node.next_node = next_node.next_node\n next_node = nil\n break\n end\n end\n\n @size -= 1\n\n return data\n end",
"def delete(node)\n if (node == @head)\n @head = node.next\n elsif (node == @tail)\n self.remove_tail\n else\n current = @head\n while (current != node)\n if (current.next == node)\n current.next = node.next\n break\n end\n current = current.next\n end\n end\n end",
"def delete(node)\n if node.data == self.head.data\n remove_front\n elsif node.data == self.tail.data\n remove_tail\n else\n current_node = self.head\n prev_node = nil\n\n until current_node.data == node.data\n prev_node = current_node\n current_node = current_node.next\n end\n\n prev_node.next = current_node.next\n current_node.next = nil\n\n return current_node\n end\n end",
"def delete(node)\n if @head == node\n remove_front\n elsif @tail == node\n remove_tail\n else\n remove_node(node)\n end\n end",
"def delete_node_improved(node)\n node.val = node.next.val\n node.next = node.next.next\nend",
"def delete(node)\n if @head.data == node.data\n remove_front\n elsif @tail.data == node.data\n remove_tail\n else\n previousNode = @head\n placeholder = @head.next\n while placeholder.data != node.data\n if placeholder.next\n previousNode = placeholder\n placeholder = placeholder.next\n else\n return 'node not found'\n end\n end\n previousNode.next = placeholder.next\n end\n end",
"def remove_node\n remove_node_helper(@root)\n end",
"def delete(node)\n if node == self.head\n remove_front\n elsif node == self.tail\n remove_tail\n else\n last_node = self.head\n current_node = self.head.next\n while current_node != node\n if current_node == self.tail\n return nil\n else\n last_node = current_node\n current_node = current_node.next\n end\n end\n last_node.next = current_node.next\n end\n end",
"def delete(node)\n if self.head != nil\n if node == self.head\n remove_front\n elsif node == self.tail\n remove_tail\n else\n current = self.head\n while current.next != nil && current.next != node\n current = current.next\n end\n temp = current.next.next\n current.next = nil\n current.next = temp\n end\n end\n end",
"def delete(node)\n if @head.eql?(node)\n remove_front\n elsif @tail == node\n remove_tail\n else\n current = @head\n until current.next.eql?(node)\n current = current.next\n end\n current.next = node.next\n end\n end",
"def delete_node(node)\n return unless node\n\n if node.prev\n node.prev.next = node.next\n end\n\n if node.next\n node.next.prev = node.prev\n end\n\n if node == @head\n @head = node.next\n end\n\n if node == @tail\n @tail = node.prev\n end\n\n @length -= 1\n return node\n end",
"def delete(node)\n if self.head == node\n remove_front\n elsif self.tail == node\n remove_tail\n else\n current = self.head\n while current.next != node\n current = current.next\n end\n current.next = node.next\n node.next = nil\n end\n end",
"def remove(node)\n node = node.name if Node === node\n riak_admin 'remove', node\n end",
"def delete(node)\n if @head != nil\n if @head === node\n remove_front\n elsif @tail === node\n remove_tail\n else\n current = @head\n while current != nil && current.next != node \n current = current.next\n end\n if current.next == node\n current.next = current.next.next\n end\n end\n end \n end",
"def remove_node_if\n #_clear_cache #done in clear_node(node)\n all = self.nodes\n all.each do |node|\n if yield node then\n self.clear_node(node)\n @pathway.graph.delete(node)\n end\n end\n self\n end",
"def delete_node(node)\n return unless node\n @sem.synchronize do\n left, right = node.left, node.right\n left.nil? ? @head = right : left.right = right\n right.nil? ? @tail = left : right.left = left\n end\n node.right,node.left = nil,nil\n node\n end",
"def remove?(node)\n\t\t\tif node.head\n\t\t\t\treturn remove!(node)\n\t\t\tend\n\t\t\t\n\t\t\treturn nil\n\t\tend",
"def delete_node(node_to_delete)\n next_node = node_to_delete.next\n\n if next_node\n raise \"Can't delete the last node with this method!\"\n else\n node_to_delete.value = next_node.value\n node_to_delete.next = next_node.next\n end\nend",
"def delete(node)\n current = self.head\n if current == node\n self.head = current.next\n return\n else\n while current.next != nil && current.next != node\n current = current.next\n end\n current.next = current.next.next unless current.next === nil\n while current.next != nil\n current = current.next\n end\n self.tail = current\n end\n end",
"def delete_after(node)\n node.next = node.next.next\n end",
"def delete_node\n node.destroy if node\n end",
"def delete_this_node(node)\n node.val = node.next_node.val\n node.next_node = node.next_node.next_node\n return node\nend",
"def delete(node)\n removed = nil\n if node == @head\n removed = @head\n node = @head.next\n @head = node\n elsif node == @tail\n removed = @tail\n current = @head\n until current.next == @tail\n current = current.next\n end\n @tail = current\n @tail.next = nil\n else\n current = @head\n until current.next == node\n current = current.next\n end\n link_1 = current\n until current == node\n current = current.next\n end\n link_2 = current.next\n removed = current\n link_1.next = link_2\n end\n removed\n end",
"def deleteNode node\n node.val = node.next.val\n node.next = node.next.next\nend",
"def clean(node)\n update node, false, true, nil\n end",
"def delete(node)\n temp_node = @head\n\n while temp_node != @tail\n if @head == node\n if @head == @tail\n @head = nil\n break\n else\n @head = @head.next\n break\n end\n elsif temp_node.next == node\n if temp_node.next == @tail\n @tail = temp_node\n break\n else\n temp_node.next = temp_node.next.next\n break\n end\n end\n\n temp_node = temp_node.next\n end\n end",
"def remove_node(node)\n return if !node_file(node).exist?\n\n txn do\n @repo.rm node_file(node)\n\n message = \"remove node #{node.fqn}\"\n @repo.commit message\n log << \"Database commit: #{message}\"\n end\n end",
"def delete_node(current_node)\n\nend",
"def remove_node(index)\n\n\t\t# Start at the head\n\t\tcounter = 0\n\t\tcurrent_node = @head\n\t\tprev_node = nil\n\n\t\t# crawl to the index position\n\t\twhile counter < index \n\t\t\tprev_node = current_node\n\t\t\tcurrent_node = current_node.next\n\t\t\tcounter += 1\n\t\tend\n\n\t\t# Now perform removal (cutting out current_node)\n\t\tnext_node = current_node.next\n\t\tcurrent_node.next = nil # clear the pointer\n\t\tprev_node.next = new_node\n\n\t\tputs \"Removed node at index #{index} with value: #{current_node.data}\"\n\tend",
"def remove(node)\n if node.parent.nil?\n @root = nil\n return\n end\n if node.parent.left == node\n node.parent.left = nil\n elsif node.parent.right == node\n node.parent.right = nil\n end\n end",
"def e31_delete(node, input)\n while node.next != nil\n if node.value == input\n node.value = node.next.value\n node.next = node.next.next\n else\n node = node.next\n end\n end #while ends\n end",
"def remove_at_head\n\t\t\treturn nil if self.empty?\n\t\t\telement = self.head\n\t\t\t@head.next = nil || element.next\n\t\t\telement\n\t\tend",
"def delete_node(node)\n until node.next.nil?\n next_node = node.next\n node.val = next_node.val\n if next_node.next\n node = node.next\n else\n node.next = nil\n end\n end\nend",
"def delete_node this_node\r\n prev_node = this_node.get_prev_node\r\n next_node = this_node.get_next_node\r\n #if the deleted node is currently at the head\r\n if @head == this_node\r\n #set the head to the next node of this node\r\n @head = next_node\r\n #the head will be set to NULL if there's no node after this node (if this node is the only node in the list)\r\n end\r\n #if there's a node before this deleted node\r\n if prev_node != nil\r\n #point the next pointer of the previous node (of the deleted node) to the next node (of the deleted node)\r\n prev_node.set_next_node next_node\r\n end\r\n #if there's a node after this deleted node\r\n if next_node != nil\r\n #point the prev pointer of the next node (of the deleted node) to the previous node (of the deleted node)\r\n next_node.set_prev_node prev_node\r\n end\r\n #OPTIONAL: if the deleted node is at the tail\r\n if @tail == this_node\r\n #update the tail by pointing it to the previous node (of the deleted node)\r\n #this will return NULL if the deleted node is the only node in the list\r\n @tail = prev_node\r\n end\r\n #You can return the list so that you can chain methods\r\n return self\r\n end",
"def delete_node(list, head)\n curr = list\n while(curr.next.val != head.val)\n curr = curr.next\n end\n curr.next = head.next\n head = nil\nend",
"def clear_node(node)\n if node != nil\n @visited_actors.clear\n end\n end",
"def remove(node)\n node.inputs.each do |producer_edge|\n producer_edge.from.outputs.reject! { |edge| edge.to == node }\n end\n\n node.outputs.each do |consumer_edge|\n consumer_edge.to.inputs.reject! { |edge| edge.from == node }\n end\n\n nodes.delete(node)\n end",
"def pop() #delete last element in the LL\n return nil if @head == nil #if list is empty return nil\n return @head = nil if self.list_size == 1 #list has 1 element(head) assign head to nil\n temp_node = @head #if list has more then 1 element, travres till last element\n #stop conditon is when second element from current link to nil, means that first\n #from current is last element in the list\n until temp_node.link.link == nil \n temp_node = temp_node.link\n end\n temp_node.link = nil #cat the link with last element by assigning previous link to nil\n end",
"def pop\r\n removed_item = @data\r\n @data = @data.next_node\r\n removed_item.next_node = nil\r\n removed_item\r\n end",
"def clean_node(node)\n element = node.instance_variable_get(\"@element\")\n directory_response = element.document.css(\"n2|SearchDirectoryResponse\", 'n2' => 'urn:zimbraAdmin').first\n directory_response.children.each {|c| c.remove}\n directory_response.add_child element\n node\n end",
"def remove (data)\n if @head.data == data\n @head = @head.next # Move head to the next node\n else\n current_node = @head.next # Go the next element\n prev_node = @head\n while current_node\n if current_node.data == data\n prev_node.next = current_node.next\n return @head # Head didnt change\n end\n prev_node = current_node\n current_node = current_node.next\n end\n\n return @head\n end\n end",
"def remove_node\n cspsearchpath.delete(@label)\n end",
"def remove(x)\n if x == head\n self.head = head.next\n x.next = nil\n else\n\n el = head\n while el and el != x\n prev = el \n el = el.next\n end\n\n raise ListError, \"Element not found\" unless el\n\n prev.next = el.next\n el.next = nil\n end\n x\n end",
"def unlink \n @lnode.unlink unless @lnode.nil?\n end",
"def delete_node\n delete(@nodename)\n end",
"def remove_duplicate_without_buffer(node)\n return if node.nil?\n\n c = node\n\n while c\n n = c.next\n while n\n if n.data == c.data\n c.next = n.next\n else\n n = n.next\n end\n end\n c = c.next\n end\nend",
"def remove_head(value, node)\n if node.left\n link = max_search(node.left)\n link.right = @head.right\n @head = @head.left\n elsif node.right\n link = min_search(node.right)\n link.left = @head.left\n @head = @head.right\n else\n @head = nil\n end\n end",
"def unwrap(node)\n node.children.each do |child|\n node.parent << child\n end\n node.remove\n end",
"def remove_child(node)\n if node.parent == nil\n raise \"this is an orphan\"\n end \n node.parent = nil\n end",
"def remove_from_list\n if in_list?\n decrement_positions_on_lower_items\n set_list_position(nil)\n end\n end",
"def node\n purge_node[:node]\n end",
"def remove_from_list\n return unless in_list?\n decrement_positions_on_lower_items\n set_my_position nil\n end",
"def pop(node = @head)\n if node.next_node.next_node.nil?\n node.next_node = nil\n @tail = node\n return\n end\n pop(node.next_node)\n end",
"def remove_at(index)\n return nil if @head.nil? || index > self.size - 1\n if index == 0\n @head = @head.next\n elsif index == self.size - 1\n self.pop(node)\n else\n current_node = @head\n prev_node = nil\n index.times do\n prev_node,current_node = current_node,current_node.next\n end\n end\n prev_node.next = current_node.next\n end",
"def delete_head\r\n delete_node @head\r\n end",
"def remove(value)\n\t\t\n\t\tnode = @head\n\t\twhile node.value.sal != value do\n\t\t\tnode = node.next\n\t\tend\n\t\t\n\t\tif node != nil\n\t\t\n\t\t\tif node != @head\n\t\t\t\tnode.prev.next = node.next\n\t\t\telse\n\t\t\t\t@head = node.next\n\t\t\tend\n\n\t\t\tif node != @tail\n\t\t\t\tnode.next.prev = node.prev\n\t\t\telse\n\t\t\t\t@tail = node.prev\n\t\t\tend\n\n\t\t\t@size-=1\n\t\tend\t\t\t\n\t\t\t\t\n\tend",
"def remove_found_node(node)\n #at most one child of new_node, new_node will be removed directly\n if node.left.nil? or node.right.nil?\n #the root is deleted\n if node.parent.nil?\n @root=nil\n node=nil\n return\n end\n r = node\n else\n # new_node has two children --> will be replaced by successor\n r = successor(node)\n node.value = r.value\n end\n\n if r.left.nil?\n p = r.right;\n else\n p = r.left;\n end\n\n unless p.nil?\n p.parent = r.parent;\n end\n if r.parent.nil?\n this.root = p;\n else\n if r==r.parent.left\n r.parent.left=p;\n else\n r.parent.right = p\n # balancing must be done until the root is reached.\n end\n end\n recursive_balance(r.parent)\n r = nil\n end",
"def clean_node!(node)\n raise ArgumentError unless node.is_a?(Nokogiri::XML::Node)\n\n node.traverse do |traversed_node|\n if traversed_node.element?\n clean_element!(traversed_node)\n elsif traversed_node.comment?\n traversed_node.unlink unless @config[:allow_comments]\n elsif traversed_node.cdata?\n traversed_node.replace(Nokogiri::XML::Text.new(traversed_node.text,\n traversed_node.document))\n end\n end\n\n node\n end",
"def remove_item(list, item)\n\tlist.delete(item)\n\tlist\nend",
"def remove_node(node)\n raise KeyError, \"Error in deleting node #{node} from Graph.\" unless @nodes.key?(node)\n\n neighbours = @adj[node]\n neighbours.each_key { |k| @pred[k].delete(node) }\n @pred[node].each_key do |k|\n @adj[k].delete(node)\n end\n\n @pred.delete(node)\n @adj.delete(node)\n @nodes.delete(node)\n end",
"def remove(node)\n @replicas.times do |i|\n key = hash(\"#{node.to_s}:#{i}\")\n @ring.delete(key)\n @nodesort.delete(key)\n end\n end",
"def delete_node(node_value)\n current_node = @root_node\n if current_node.get_node_data() == node_value\n @root_node = @root_node.get_next()\n @root_node.set_prev(nil)\n current_node = nil\n else\n while current_node.has_next?()\n current_node = current_node.get_next()\n if current_node.get_node_data() == node_value\n current_node.get_prev().set_next(current_node.get_next())\n current_node.get_next().set_prev(current_node.get_prev())\n return\n end\n end\n end\n end",
"def clean_cached_node(node)\n Puppet::Node.indirection.destroy(node)\n Puppet.info \"#{node}'s cached node removed\"\n end",
"def remove_from_list\n # if in_list?\n # decrement_positions_on_lower_items\n # update_attribute position_column, nil\n # end \n return unless in_list?\n decrement_positions_on_lower_items\n update_attribute position_column, nil \n end",
"def remove(identifier)\n # we want to set the previous next as the current next so that the\n # current is forgotten from the list\n find(identifier) do |previous, current|\n if current == @first_node\n @first_node = current.next\n end\n\n previous.next = current.next\n end\n end",
"def remove(list, item)\n\tlist.delete(item)\n\tlist\nend",
"def delete_mid_node(myNode)\n current = myNode\n current.value = current.next.value\n current.next = current.next.next\n end",
"def pop\n\t\tcurrent_node = @head \n\t\tif current_node.next_node == nil \n\t\t\t@head = nil \n\t\tend \n\t\tuntil current_node.next_node.next_node == nil \n\t\t\tcurrent_node = current_node.next_node\n\t\tend \n\t\tcurrent_node.next_node = nil \n\tend",
"def erase\n @nodes.erase\n end",
"def remove_item(item, list)\n\t# steps: delete the item if it exists\n\tlist.delete_if {|list_item| list_item == item.to_sym}\n\t# output: updated list\n\tlist\nend"
] |
[
"0.7827693",
"0.7665672",
"0.7595631",
"0.7578332",
"0.7514646",
"0.74869066",
"0.74359757",
"0.74340177",
"0.743196",
"0.7410933",
"0.7404785",
"0.7379001",
"0.7350996",
"0.73318905",
"0.72788984",
"0.7269746",
"0.7269483",
"0.72557163",
"0.7246284",
"0.72445863",
"0.7221512",
"0.7174625",
"0.7162622",
"0.71509314",
"0.7140828",
"0.7118887",
"0.7095724",
"0.7080254",
"0.70797867",
"0.706257",
"0.7062403",
"0.702331",
"0.702063",
"0.70186305",
"0.7005664",
"0.6996773",
"0.6994621",
"0.698941",
"0.694731",
"0.6946021",
"0.6943381",
"0.6934362",
"0.69041765",
"0.6894826",
"0.687803",
"0.6875151",
"0.68719697",
"0.6848683",
"0.6839867",
"0.6791164",
"0.67481244",
"0.67301136",
"0.66950816",
"0.66833776",
"0.66493595",
"0.66431284",
"0.65998197",
"0.6590416",
"0.658354",
"0.6582794",
"0.6561296",
"0.6546841",
"0.6523929",
"0.6501708",
"0.6482717",
"0.647785",
"0.644039",
"0.64378875",
"0.64356685",
"0.6418977",
"0.6417705",
"0.6406327",
"0.6406069",
"0.6382903",
"0.63608456",
"0.6327426",
"0.6327185",
"0.6326978",
"0.63212866",
"0.63021636",
"0.629813",
"0.62950945",
"0.6271819",
"0.6265765",
"0.62599134",
"0.6247606",
"0.62460786",
"0.6239088",
"0.621822",
"0.62179697",
"0.6214563",
"0.6210636",
"0.6206583",
"0.62025774",
"0.61999506",
"0.6196684",
"0.61889946",
"0.61566144",
"0.614561",
"0.61376524"
] |
0.73315173
|
14
|
This method removes and returns the first node in the Linked List and must set Linked List's head to the second node.
|
def remove_front
node = self.head
if node == self.tail
self.tail = nil
end
self.head = node.next
node.next = nil
return node
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def remove_front\n value = self.head # save the first element\n self.head = value.next # the second element becomes the new first element\n value.next = nil # no longer in the list, so no next\n return value\n end",
"def remove_head\n\t\t\n\t\told_head = @head\n\n\t\tif old_head == nil\n\t\t\treturn nil\n\t\telse\n\t\t\t@head = old_head.next_node\n\t\tend\n\n\t\t# puts old_head.value\n\t\treturn old_head\n\n\tend",
"def remove_front\n first_node = @head\n if @head === @tail\n @head = nil\n @tail = nil\n elsif @head != nil\n @head = first_node.next\n\n if @head.next.nil? #in case there were only two nodes, and we delete the first one, then new_head_node is also the tail node\n @tail = @head\n end\n end\n return first_node\n end",
"def remove_front\n first_node = @head\n if @head === @tail\n @head = nil\n @tail = nil\n elsif !@head.nil?\n @head = first_node.next\n\n if @head.next.nil? #in case there were only two nodes, and we delete the first one, then new_head_node is also the tail node\n @tail = @head\n end\n end\n return first_node\n end",
"def remove_first\n old_head = @head\n @head = @head.next_node unless @head.nil?\n @head.prev_node = nil unless @head.nil?\n old_head\n end",
"def remove_front\n temp_node = @head\n if @head === nil # empty list\n return nil\n elsif @head === @tail # list of 1\n @head = nil\n @tail = nil\n return temp_node\n else\n @head = @head.next\n return temp_node\n end\n end",
"def pop_head()\n nodo=@head\n aux=@head.next\n aux.prev=nil\n @head=aux\n return nodo\n end",
"def delete_head\n # If the SLL is empty, there's nothing there other than an empty head; return it\n if empty?\n return @head\n elsif @head.next\n # If the head node has a next\n # Set the head to the original head's next, destroying any reference to the original\n @head = @head.next\n else\n # If the head is the only node, just set its value to nil\n @head.value = nil\n end\n\n # Decrement the SLL by 1 in all cases\n @size -= 1 if size > 0\n # Return the new or empty head\n @head\n end",
"def remove_front\n removed_node = self.head\n self.head = self.head.next\n return removed_node\n end",
"def remove_first\n raise 'No such element' if @size == 0\n elt = @head.value\n if @size == 1\n @head = nil\n @tail = nil\n else\n @head = @head.next\n @head.previous.next = nil\n @head.previous = nil\n end\n @size -= 1\n return elt\n end",
"def remove\n node = @head\n\n if node\n @head = node.next_node\n @tail = nil unless @head\n\n node.data\n end\n end",
"def delete(node)\n if self.head == node # if deleting the head, then the second element becomes\n # the new head\n self.head = node.next\n return node\n end\n\n prev = previous(node) # compute the previous node\n \n if prev != nil\n prev.next = node.next # the previous node now points to the element after node\n end\n \n if self.tail == node # if the node is the last, then the previous becomes the new tail\n self.tail = prev \n end\n\n node.next = nil # no longer in the list, so no next\n return node\n end",
"def removeHead\n\t\tif @head != nil\n\t\t\tn = @head\n\t\t\t@head = n.nnode\n\t\t\tn.nnode = nil\n\t\t\treturn n.value\n\t\tend\n\tend",
"def remove_first\n raise 'Cannot remove element from an empty list.' if empty?\n\n # Extract the data off of the head node\n # Move the head to the next node\n data = @head.data\n @head = @head.next_node\n @size -= 1\n\n # removes the same element from @tail, if it was final element/node\n if empty?\n @tail = nil\n end\n\n return data\n end",
"def remove_first\n raise 'Cannot remove element from an empty list.' if empty?\n\n # Extract the data off of the head node\n # Move the head to the next node\n data = @head.data\n @head = @head.next_node\n @size -= 1\n\n # removes the same element from @tail, if it was final element/node\n if empty?\n @tail = nil\n else\n # send to garbage collector\n @head.prev_node = nil\n end\n\n return data\n end",
"def pop\n first.next.prev = @head\n @head.next = first.next\n end",
"def remove node\n # if the node is at beginning or end of list\n # handle this separately\n return remove_first if node == @head\n return remove_last if node == @tail\n\n # store the data, so we can return it\n data = node.data\n\n # iterate through nodes, two at a time\n each_cons(2) do |search_node, next_node|\n # if our second item in a pair is the node we are looking for\n if next_node == node\n # then make the previous node's (i.e the search_node) next node equal to the FOLLOWING\n search_node.next_node = next_node.next_node\n next_node = nil\n break\n end\n end\n\n @size -= 1\n\n return data\n end",
"def remove node\n return nil unless node \n # If the node we have to remove is the head of the list, we need to cover two situations\n if node == head\n # Head is the only node in the list. We set head and tail to nil and we are done\n if head.next.nil?\n self.head = self.tail = nil\n else\n # Head is not the only node in the list. \n # The node that’s next to head becomes the new head and the original head goes out of scope.\n self.head = self.head.next\n end\n else\n p = node.prev\n n = node.next\n p&.next = n\n n&.prev = p\n end\n self.length -= 1\nend",
"def shift\n node = self.double_link_linked_list.delete_head\n node ? node.value : nil\n end",
"def remove_at_head\n\t\t\treturn nil if self.empty?\n\t\t\telement = self.head\n\t\t\t@head.next = nil || element.next\n\t\t\telement\n\t\tend",
"def removeHead\n if @length == 1\n @head.nextNode = nil\n @tail.val = nil\n @length = 0\n elsif @length > 1\n @head.nextNode = @head.nextNode.nextNode\n @length -= 1\n end\n end",
"def remove_front\n temp = self.head\n self.head = self.head.next\n return temp\n end",
"def remove_tail\n\n current_node = @head\n if @head == nil #empty lit\n return nil\n end\n if @head.next == nil #list of one\n temp = @head\n @head = nil\n @tail = nil\n return temp\n end\n while(current_node.next.next) #to traverse the list\n current_node = current_node.next\n end\n temp_two = current_node.next\n current_node.next = nil\n @tail = current_node\n return temp_two\n end",
"def remove node\n\t\treturn nil unless node\n\n\t\tif node == head\n\t\t\tif head.next.nil?\n\t\t\t\tself.head = self.tail = nil\n\t\t\telse\n\t\t\t\tself.head = self.head.next\n\t\t\tend\n\t\telse\n\t\t\ttmp = self.head\n\t\t\twhile tmp && tmp.next != node\n\t\t\t\ttmp = tmp.next\n\t\t\tend\n\t\t\ttmp.next = node.next if tmp\n\t\tend\n\t\tself.length -= 1\n\tend",
"def remove_first\n return nil if empty?\n node = @sentinel.next\n e = node.data\n node.next.prev = @sentinel\n @sentinel.next = node.next\n e\n end",
"def remove_first\n return nil if empty?\n node = @sentinel.next\n e = node.data\n node.next.prev = @sentinel\n @sentinel.next = node.next\n e\n end",
"def pop\n return nil if @head.nil?\n if self.size > 1\n @tail = self.at(self.size-1) \n @tail.next = nil\n else # only 1 node\n @tail = @head = nil\n end\t\n end",
"def remove_front\n if !@head.nil?\n if @head == @tail\n temp_node = @head\n @head = nil\n @tail = nil\n\n return temp_node\n else\n temp_node = @head\n @head = @head.next\n return temp_node\n end\n else\n nil\n end\n end",
"def remove node\n\t\treturn nil unless node\n\t\treturn nil unless self.length > 0\n\n\t\t# head?\n\t\treturn remove_next node if (self.length == 1)\n\n\t\t# Find the precedent node to the node we \n\t\t# want to remove.\n\t\tprev = nil\n\t\tself.current = self.head\n\t\twhile ((prev = self.move_next) != node)\n\t\tend\n\t\tremove_next prev\n\tend",
"def remove_front\n if self.head.nil?\n return nil\n else\n temp = self.head\n self.head = self.head.next\n return temp\n end\n end",
"def remove (data)\n if @head.data == data\n @head = @head.next # Move head to the next node\n else\n current_node = @head.next # Go the next element\n prev_node = @head\n while current_node\n if current_node.data == data\n prev_node.next = current_node.next\n return @head # Head didnt change\n end\n prev_node = current_node\n current_node = current_node.next\n end\n\n return @head\n end\n end",
"def pop() #delete last element in the LL\n return nil if @head == nil #if list is empty return nil\n return @head = nil if self.list_size == 1 #list has 1 element(head) assign head to nil\n temp_node = @head #if list has more then 1 element, travres till last element\n #stop conditon is when second element from current link to nil, means that first\n #from current is last element in the list\n until temp_node.link.link == nil \n temp_node = temp_node.link\n end\n temp_node.link = nil #cat the link with last element by assigning previous link to nil\n end",
"def remove_front\n placeholder = @head\n @head = placeholder.next\n return placeholder\n end",
"def remove node\n\t\treturn nil unless node\n\n\t\tif node == head\n\t\t\tif head.next.nil?\n\t\t\t\tself.head = self.tail = nil\n\t\t\telse\n\t\t\t\tself.head = self.head.next\n\t\t\tend\n\t\telse\n\t\t\tp = node.prev\n\t\t\tn = node.next\n\t\t\tp&.next = n\n\t\t\tn&.prev = p\n\t\tend\n\t\tself.length -= 1\n\tend",
"def remove!(other)\n a = head\n b = other.head\n\n while a and b\n\n while a.data < b.data\n prev = a\n a = a.next\n end\n\n while b.data < a.data\n b = b.next\n end\n\n if prev.nil?\n prev = a\n a = a.next\n prev.next = nil\n self.head = a \n b = b.next\n else\n a = a.next\n prev.next = a\n b = b.next\n end\n end\n self\n end",
"def delete(node)\n if node == self.head\n if self.head == self.tail\n self.head = nil\n self.tail = nil\n node.next = nil\n return node\n end\n self.head = node.next\n node.next = nil\n return node\n end\n \n self.print\n \n node1 = self.head\n until node1.next == node do\n if node1.next == nil\n return nil # not on the list\n end\n node1 = node1.next\n end\n \n node1.next = node.next\n if node == self.tail\n self.tail = node1\n end\n\n node.next = nil\n return node\n end",
"def remove(value)\n\t\t\telement = self.head\n\t\t\tprevious_element = @head\n\t\t\twhile element.value != value\n\t\t\t\tif element.next.nil?\n\t\t\t\t\treturn nil\n\t\t\t\telse\n\t\t\t\t\tprevious_element = element\n\t\t\t\t\telement = element.next\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tprevious_element.next = element.next\n\t\t\telement\n\t\tend",
"def pop\n if head == nil\n \"Nothing to remove\"\n else\n prev = nil\n cur = head\n while cur.next_node != nil\n prev = cur\n cur = cur.next_node\n end\n prev.next_node = nil\n end\n end",
"def remove_tail\n if self.head == nil\n p \"There isn't anything in the linked list\"\n elsif self.head.data == self.tail.data\n self.head = nil\n self.tail = nil\n else\n temp_node = self.head\n while temp_node.next != self.tail\n temp_node = temp_node.next\n end\n self.tail = temp_node\n end\n end",
"def remove(x)\n if x == head\n self.head = head.next\n x.next = nil\n else\n\n el = head\n while el and el != x\n prev = el \n el = el.next\n end\n\n raise ListError, \"Element not found\" unless el\n\n prev.next = el.next\n el.next = nil\n end\n x\n end",
"def remove node\n # if the node is at beginning or end of list\n # handle this separately\n return remove_first if node.prev_node == nil\n return remove_last if node.next_node == nil\n\n # tell adjacent nodes to 'skip' over this node\n node.next_node.prev_node = node.prev_node\n node.prev_node.next_node = node.next_node\n\n # store the data, so we can return it\n data = node.data\n\n # send to garbage collector\n node.data = nil\n node = node.prev_node = node.next_node = nil\n\n @size -= 1\n\n return data\n end",
"def remove_front\n node = @head\n if @head.eql?(@tail)\n @head = nil\n @tail = nil\n elsif !@head.nil?\n @head = node.next\n if @head.next.nil?\n @tail = @head\n end\n end\n return node\n end",
"def pop\n node = remove_node(head)\n return nil unless node\n self.size -= 1\n node.data\n end",
"def remove_front\n self.head = self.head.next\n end",
"def remove(value)\n if head.value == value\n @head = head.next\n else\n current_node = head.next\n prev_node = head\n while current_node\n if current_node.value == value\n prev_node.next = current_node.next\n return\n else\n prev_node = current_node\n current_node = current_node.next\n end\n end\n nil\n end\n end",
"def pop\n node = self.double_link_linked_list.delete_tail\n node ? node.value : nil\n end",
"def remove_front\n if @head == nil\n return nil\n end\n front = @head\n @head = front.next\n front\n end",
"def ll_pop()\n current = @head\n \n if @num_nodes == 0\n return nil\n elsif @num_nodes == 1\n @head = nil\n @tail = nil\n else\n second = @head.get_Next()\n @head = second\n end\n \n @num_nodes -= 1\n return current.get_Data()\n end",
"def remove_front\n if self.head == nil\n p \"the linked list is empty\"\n elsif self.head == self.tail\n self.head = nil \n self.tail = nil\n else\n self.head = self.head.next\n end\n end",
"def remove_front\n @head = @head.next\n end",
"def pop\n last_node = self.tail\n self.at(self.size - 2).next_node = nil\n return last_node\n end",
"def remove_head(value, node)\n if node.left\n link = max_search(node.left)\n link.right = @head.right\n @head = @head.left\n elsif node.right\n link = min_search(node.right)\n link.left = @head.left\n @head = @head.right\n else\n @head = nil\n end\n end",
"def remove_node(node)\n return nil unless node\n previous_node = node.previous_node\n next_node = node.next_node\n previous_node.next_node = next_node if previous_node\n next_node.previous_node = previous_node if next_node\n self.head = node.next_node if node == head\n node\n end",
"def pop\n\t\tcurrent_node = @head \n\t\tif current_node.next_node == nil \n\t\t\t@head = nil \n\t\tend \n\t\tuntil current_node.next_node.next_node == nil \n\t\t\tcurrent_node = current_node.next_node\n\t\tend \n\t\tcurrent_node.next_node = nil \n\tend",
"def delete_tail\n # Create a var to hold the current_node; init with head\n current_node = @head\n\n # If the SLL is empty, there's nothing there other than an empty head; return it\n if empty?\n return @head\n elsif @head.next\n # If the head node has a next\n # AND if that next has a next\n while current_node.next.next\n # Reassign current node to point to its next until current is second to last node\n current_node = current_node.next\n end\n\n # Current is now second to last node\n # Set current's next to nil, destroying the reference to the last node, the tail\n current_node.next = nil\n else\n # If there's just one node, it's both head and tail, set its value to nil\n @head.value = nil\n end\n\n # Decrement in all cases\n @size -= 1 if size > 0\n # Return the new tail or an empty head\n current_node\n end",
"def pop\n node = @head\n if @size > 1\n node = node.link until node.link.link.nil?\n node.link = nil\n else \n @head = nil\n end\n @size -= 1\n end",
"def pop\n return nil if @head.nil?\n\n to_remove = @head\n @head = @head.next\n to_remove.next = nil\n @count -= 1\n\n to_remove.value\n end",
"def remove_node(value)\n new_head = remove_node_recursively(@head, value)\n if new_head\n @head = new_head\n else\n puts \"You can't empty list\"\n end\n end",
"def delete_node this_node\r\n prev_node = this_node.get_prev_node\r\n next_node = this_node.get_next_node\r\n #if the deleted node is currently at the head\r\n if @head == this_node\r\n #set the head to the next node of this node\r\n @head = next_node\r\n #the head will be set to NULL if there's no node after this node (if this node is the only node in the list)\r\n end\r\n #if there's a node before this deleted node\r\n if prev_node != nil\r\n #point the next pointer of the previous node (of the deleted node) to the next node (of the deleted node)\r\n prev_node.set_next_node next_node\r\n end\r\n #if there's a node after this deleted node\r\n if next_node != nil\r\n #point the prev pointer of the next node (of the deleted node) to the previous node (of the deleted node)\r\n next_node.set_prev_node prev_node\r\n end\r\n #OPTIONAL: if the deleted node is at the tail\r\n if @tail == this_node\r\n #update the tail by pointing it to the previous node (of the deleted node)\r\n #this will return NULL if the deleted node is the only node in the list\r\n @tail = prev_node\r\n end\r\n #You can return the list so that you can chain methods\r\n return self\r\n end",
"def remove_front\n temp = @head\n @head.next = nil # This is for memory managment purposes\n @head = temp\n end",
"def pop\n current_node = @head\n if current_node.next_node.nil?\n @head.nil?\n else\n while current_node.next_node\n previous = current_node\n current_node = current_node.next_node\n end\n previous.next_node = nil\n end\n end",
"def popHead\n \n unless @head.nil?\n \n aux = @head\n unless @head.next.nil?\n \n @head.next.prev = nil\n @head = @head.next\n \n else\n \n @head = nil\n @tail = nil\n \n end\n aux\n \n end\n \n end",
"def remove_front\n @head = @head.next if @head\n end",
"def remove_front\n @head = @head.next if @head\n end",
"def remove_front\n if (@head)\n @head = @head.next\n end\n end",
"def remove_next prev_node\n\t\treturn nil unless self.length > 0\n\n unless prev_node\n # remove head.\n self.head = self.head.next\n else\n self.hash.delete(prev_node.next.data)\n if prev_node.next == prev_node\n self.head = nil\n else\n old = prev_node.next\n prev_node.next = prev_node.next&.next\n if (old == self.head)\n self.head = old.next\n end\n end\n end\n\n \tself.length -= 1\n\tend",
"def delete(node)\n if node.data == self.head.data\n remove_front\n elsif node.data == self.tail.data\n remove_tail\n else\n current_node = self.head\n prev_node = nil\n\n until current_node.data == node.data\n prev_node = current_node\n current_node = current_node.next\n end\n\n prev_node.next = current_node.next\n current_node.next = nil\n\n return current_node\n end\n end",
"def remove_tail\n retval = self.tail\n if self.head == self.tail\n self.head = nil\n self.tail = nil\n return retval\n end\n node = self.head\n until node.next == retval do\n node = node.next\n end\n node.next = nil\n self.tail = node\n return retval\n end",
"def remove_front\n self.tail == self.head ? self.head = nil : self.head = self.head.next\n end",
"def shift\n return nil if @head.nil?\n node = @head\n @head = @head.next\n return node\n end",
"def remove_tail\n if self.head == nil # does nothing to an empty list\n return nil\n end\n \n delete (self.tail) # otherwise, deletes the tail\n end",
"def remove_next prev_node\n\t\treturn nil unless self.length > 0\n\n unless prev_node\n # remove head.\n self.head = self.head.next\n else\n if prev_node.next == prev_node\n self.head = nil\n else\n old = prev_node.next\n prev_node.next = prev_node.next&.next\n if (old == self.head)\n self.head = old.next\n end\n end\n end\n\n \tself.length -= 1\n\tend",
"def remove_front\n if self.head == self.tail\n remove_tail\n else\n temp = self.head.next\n self.head = nil\n self.head = temp\n end\n end",
"def delete_this_node(node)\n node.val = node.next_node.val\n node.next_node = node.next_node.next_node\n return node\nend",
"def pop\n return nil if @head.nil? || self.size == 0\n current_node = @head\n prev_node = nil\n (self.size - 1).times do\n prev_node = current_node\n current_node = current_node.next\n end\n current_node = nil\n @tail = prev_node\n end",
"def pop\n if size == 1\n @head.next_node = nil\n else\n current = @head.next_node\n previous = @head\n\n while current.next_node != nil\n current = current.next_node \n previous = previous.next_node\n end\n\n previous.next_node = nil\n end\n end",
"def delete_head\r\n delete_node @head\r\n end",
"def pop_head\n\n\t\tif(@head == nil)\n\t\t\treturn nil\n\t\t \telse\n\t\t val= @head\n\t\t node = @head.next\n\t\t @head = node\n\t\t if @head != nil\n\t\t \t@head.prev = nil\n\t\t else\n\t\t \t@tail = nil\n\t\t end\n\t\t @sz = @sz -1\n\t\tend\n\n\t\treturn val\n end",
"def remove_at(index)\n return nil if head.nil?\n\n if index.zero?\n node = head\n @head = head.next\n return node.value\n end\n\n curr = head\n index.downto(2) do |_|\n break if curr.next.nil?\n\n curr = curr.next\n end\n node = curr.next\n node.nil? ? (return nil) : (curr.next = node.next)\n node.value\n end",
"def remove_front\n self.head = self.head.next\n if self.head == nil\n self.tail = nil\n end\n end",
"def shift\n if self.empty\n return nil\n else\n if @tail == @head\n @tail = nil\n @head = nil\n else\n @head = @head.next\n return @head\n end\n end\n end",
"def remove_tail\n if self.tail.nil?\n return nil\n elsif self.head.next.nil?\n self.tail = nil\n else\n current_node = self.head\n until current_node.next == self.tail\n current_node = current_node.next\n end\n current_node.next = nil\n self.tail = current_node\n end\n end",
"def pop\n if @head.nil?\n 'List is empty'\n else\n current_node = @head\n current_node = current_node.next_node until current_node.next_node.next_node.nil?\n last_node = current_node.next_node\n current_node.next_node = nil\n end\n last_node\n end",
"def remove_tail\n if self.head.nil? || self.head.next.nil?\n self.tail = nil\n else\n last_node = self.head\n prev_to_last = nil\n\n until last_node.next.nil?\n prev_to_last = last_node\n last_node = last_node.next\n end\n\n prev_to_last.next = nil\n self.tail = prev_to_last\n return prev_to_last\n end\n end",
"def pop()\n \n return nil if @head.nil?\n \n result = @head\n \n @head.next_node.nil? ? @head = nil : @head = @head.next_node \n \n result.val\n end",
"def remove(value)\n\t\t\n\t\tnode = @head\n\t\twhile node.value.sal != value do\n\t\t\tnode = node.next\n\t\tend\n\t\t\n\t\tif node != nil\n\t\t\n\t\t\tif node != @head\n\t\t\t\tnode.prev.next = node.next\n\t\t\telse\n\t\t\t\t@head = node.next\n\t\t\tend\n\n\t\t\tif node != @tail\n\t\t\t\tnode.next.prev = node.prev\n\t\t\telse\n\t\t\t\t@tail = node.prev\n\t\t\tend\n\n\t\t\t@size-=1\n\t\tend\t\t\t\n\t\t\t\t\n\tend",
"def pop\n node = @head\n if node.data == nil\n remove = \"\"\n else\n node = node.next_node until node.next_node.next_node.nil?\n remove = node.next_node.data\n node.next_node = nil\n end\n remove\n end",
"def shift_first \n @head=@head.next\n @head.prev=nil\n end",
"def delete(node)\n examined_node = @head\n after_examined_node = @head.next\n\n if examined_node == node #to be deleted item is first on the list\n remove_front()\n elsif node == @tail\n remove_tail()\n else\n\n while examined_node != node\n before_examined_node = examined_node\n\n if examined_node.next == nil\n\n else\n\n examined_node = examined_node.next\n end\n after_examined_node = examined_node.next\n\n if examined_node == node\n temp = before_examined_node\n before_examined_node.next = after_examined_node\n end\n end\n end\n end",
"def reverse\n\n\t\treturn if @head.nil?\n\n\t\ttemp = self.remove_node\n\t\ttemp.next = nil\n\t\t@last = temp\n\n\t\tuntil @head.nil?\n\n\t\t\tnode = self.remove_node\n\t\t\tnode.next = temp\n\t\t\ttemp = node\n\n\t\tend\n\n\t\t@head = temp\n\n\tend",
"def pop\n return nil unless self.length > 0\n \n self.head = self.head.next\n self.tail = nil if self.length == 1\n self.length -= 1\n end",
"def delete(node)\n if node == self.head\n remove_front\n elsif node == self.tail\n remove_tail\n else\n last_node = self.head\n current_node = self.head.next\n while current_node != node\n if current_node == self.tail\n return nil\n else\n last_node = current_node\n current_node = current_node.next\n end\n end\n last_node.next = current_node.next\n end\n end",
"def remove_node(node) \n case node\n when @tail\n remove_tail\n when @head\n # this is a good candidate for a helper method!\n @head = node.next_node\n @head.prev_node = nil unless @head.nil?\n @tail = @head if @head.nil? || @head.next_node.nil?\n else\n node.prev_node.next_node = node.next_node unless node.prev_node.nil?\n node.next_node.prev_node = node.prev_node unless node.next_node.nil?\n end\n \n node\n end",
"def remove(identifier)\n # we want to set the previous next as the current next so that the\n # current is forgotten from the list\n find(identifier) do |previous, current|\n if current == @first_node\n @first_node = current.next\n end\n\n previous.next = current.next\n end\n end",
"def pop\n if @head == nil\n return nil\n elsif @tail == @head\n @tail = nil\n @head = nil\n else\n aux = @tail\n @tail = aux.prev\n @tail.next = nil\n return aux\n end\n\n end",
"def pop\n\t\tlocation = @head.next_node\n\t\twhile location.next_node.next_node != nil\n\t\t\tlocation = location.next_node\n\t\tend\n\t\tlast = location.next_node\n\t\tlocation.next_node = nil\n\t\treturn last\n\t\tlocation = @head\n\tend",
"def pop\r\n return nil if @head == nil\r\n res = @head\r\n @head = @head.next_node\r\n return res.value\r\n end",
"def delete(node)\n removed = nil\n if node == @head\n removed = @head\n node = @head.next\n @head = node\n elsif node == @tail\n removed = @tail\n current = @head\n until current.next == @tail\n current = current.next\n end\n @tail = current\n @tail.next = nil\n else\n current = @head\n until current.next == node\n current = current.next\n end\n link_1 = current\n until current == node\n current = current.next\n end\n link_2 = current.next\n removed = current\n link_1.next = link_2\n end\n removed\n end",
"def pop\n return nil if head.nil?\n\n curr = head\n if curr.next.nil?\n @head = nil\n return curr\n end\n curr = curr.next until curr.next.next.nil?\n last = curr.next\n curr.next = nil\n last.value\n end",
"def pop\n item = @first.val\n @first = @first.next\n @last = nil if(@first == nil)\n @size -= 1\n item\n end"
] |
[
"0.7722269",
"0.739533",
"0.7326662",
"0.73219603",
"0.73059607",
"0.7236986",
"0.7229386",
"0.7221796",
"0.71602464",
"0.71060896",
"0.70952016",
"0.7090669",
"0.7042859",
"0.70349824",
"0.699761",
"0.6994844",
"0.6986392",
"0.69855326",
"0.69282323",
"0.6916709",
"0.6909721",
"0.68787235",
"0.68734986",
"0.6854801",
"0.68497705",
"0.68497705",
"0.68484485",
"0.68215245",
"0.6809832",
"0.6803504",
"0.6770232",
"0.67339516",
"0.6728689",
"0.6722947",
"0.6679659",
"0.66748315",
"0.6653475",
"0.6645603",
"0.66360795",
"0.6605078",
"0.659285",
"0.65923744",
"0.65860975",
"0.6580749",
"0.6560607",
"0.65605",
"0.6542244",
"0.65386665",
"0.6516441",
"0.6510926",
"0.65054977",
"0.6501791",
"0.64882493",
"0.64858055",
"0.6483095",
"0.6473135",
"0.64689463",
"0.6459599",
"0.6452902",
"0.64367926",
"0.6406671",
"0.63990587",
"0.6398645",
"0.6398645",
"0.63904625",
"0.63842523",
"0.6383136",
"0.63824",
"0.6378423",
"0.6368946",
"0.6366354",
"0.6364255",
"0.63596964",
"0.63562685",
"0.63536376",
"0.63512075",
"0.63312113",
"0.633046",
"0.6305186",
"0.6304339",
"0.6301817",
"0.63016254",
"0.6297819",
"0.62918764",
"0.6289958",
"0.62885237",
"0.6286651",
"0.6286526",
"0.62820786",
"0.6277435",
"0.62601244",
"0.6258785",
"0.6257466",
"0.625685",
"0.62531054",
"0.6243636",
"0.623971",
"0.6219282",
"0.6217957",
"0.6211932"
] |
0.67870486
|
30
|
make sure you set this
|
def pluralize amount, singular
"#{amount} #{singular}#{amount == 1 ? '' : 's'}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def private; end",
"def initialize\n super\n end",
"def initialize\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end",
"def initialize()\n super\n end"
] |
[
"0.73432803",
"0.68643606",
"0.68643606",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694",
"0.66496694"
] |
0.0
|
-1
|
GET /graphics GET /graphics.json
|
def index
@projects = Project.all
@statuses = Status.all
i = 0
j=0
cont=0
graphs = Array.new(@projects.length)
@charts = Array.new(@projects.length)
@projects.each do |p|
graphs[j] = GoogleVisualr::DataTable.new
graphs[j].new_column('string', 'Estatus')
graphs[j].new_column('number', 'Hours per Day')
graphs[j].add_rows(4)
graphs[j].set_cell(0, 0, 'No Iniciado' )
graphs[j].set_cell(1, 0, 'Aceptado' )
graphs[j].set_cell(2, 0, 'No Aceptado' )
graphs[j].set_cell(3, 0, 'Listo' )
@statuses.each do |st|
s = Story.where("status_id = ? AND project_id = ?", st.id, p.id)
graphs[j].set_cell(i, 1, s.length )
cont+=s.length
i+=1
end
opts = { :width => 600, :height => 400, :title => p.nombre + ' - Total Features: '+ cont.to_s, :colors => ['#dc3912', '#109618', '#ff9900', '#3366cc'], :is3D => true, :backgroundColor => '#f5f5f5' }
@charts[j] = GoogleVisualr::Interactive::PieChart.new(graphs[j], opts)
i = 0
cont = 0
j+=1
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @charts }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @graphic }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @graphic }\n end\n end",
"def index\n @graphics = Graphic.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @graphics }\n end\n end",
"def index\n @graphics = Graphic.fetch_ordered_by_page(params[\"page\"])\n end",
"def get_game_graphics_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_game_graphics ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n # resource path\n local_var_path = \"/universe/graphics/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_game_graphics\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @drawables = Drawable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drawables }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graphic }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graphic }\n end\n end",
"def show\n @drawable = Drawable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drawable }\n end\n end",
"def show\n @drawing = Drawing.find(params[:id])\n\n render json: @drawing\n end",
"def get_svg\n\t expires_in(1.hours, :private => false, :public => true)\n\t source_fedora_object = Multiresimage.find(params[:id])\n\t authorize! :show, source_fedora_object\n\t @svg = source_fedora_object.DELIV_OPS.content()\n gon.url = DIL_CONFIG['dil_js_url']\n respond_to do |wants|\n wants.xml { render :xml => @svg }\n end\n end",
"def get_svg\n\t expires_in(1.hours, :private => false, :public => true)\n\t source_fedora_object = Multiresimage.find(params[:id])\n\t authorize! :show, source_fedora_object\n\t @svg = source_fedora_object.DELIV_OPS.content()\n gon.url = DIL_CONFIG['dil_js_url']\n respond_to do |wants|\n wants.xml { render :xml => @svg }\n end\n end",
"def index\n @pictures = Picture.where(foodscape_id: params[:foodscape_id])\n render json: @pictures\n end",
"def show\n @pix = Pix.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pix }\n end\n end",
"def show\n @draw = Draw.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @draw }\n end\n end",
"def show\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_grappt }\n end\n end",
"def show\n @infographic = Infographic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @infographic.to_json(:include => :rows) }\n end\n end",
"def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end",
"def index\n @pic_spaces = PicSpace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pic_spaces }\n end\n end",
"def show\n @grm_pic = GrmPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_pic }\n end\n end",
"def show\n @svgpost = Svgpost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @svgpost }\n end\n end",
"def show\n @gl = Gl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gl }\n end\n end",
"def index\n @shots = Shot.all\n\n render json: @shots\n end",
"def show\n render json: @shot\n end",
"def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def show\n @texture = Texture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @texture }\n end\n end",
"def get_game_graphics(opts = {})\n data, _status_code, _headers = get_game_graphics_with_http_info(opts)\n return data\n end",
"def index\n @textures = Texture.find(:all, :limit => 20, :order=> 'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @textures }\n end\n end",
"def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end",
"def show\n @game_instance = GameInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game_instance.to_json(:include => { :squares => { :include => :lines }} ) }\n end\n end",
"def show\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gauge }\n end\n end",
"def index\n @screenshots = Screenshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @screenshots }\n end\n end",
"def show\n if @drawing.name == 'EllieDee'\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => JSON::parse(@drawing.to_json).merge(\"last_req\" => $last_req).to_json }\n end\n # @drawing['last_req'] = $last_req\n # render :json => Group.find(params[:id]), :methods => :message\n end\n end",
"def show\n @generation = Generation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generation }\n end\n end",
"def show\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotel }\n end\n end",
"def show\n @gmap = Gmap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gmap }\n end\n end",
"def show\n @action_graphic = ActionGraphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @action_graphic }\n end\n end",
"def show\n @pic_space = PicSpace.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic_space }\n end\n end",
"def show\n route = Route.find(params[:id])\n imgs = []\n if !route.nil?\n route.rota_points.each do |rp|\n imgs.push(rp.rota_point_images)\n end\n render :json => {:success => \"true\", :route => route, :points => route.rota_points, :images => imgs}\n else\n render :json => {:success => \"false\"}\n end\n end",
"def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end",
"def index\n @user_figures = UserFigure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @user_figures }\n end\n end",
"def show\n @screenshot = Screenshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @screenshot }\n end\n end",
"def new\n @graphic = Graphic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graphic }\n end\n end",
"def shape\n=begin\n\t\tgeometries = Rails.cache.fetch(MEMORY_CACHE_KEY_SHAPE.gsub(\"[shape_id]\", params[:id])\n\t\t\t\t.gsub(\"[locale]\", I18n.locale.to_s)\n\t\t\t\t.gsub(\"[shape_type_id]\", params[:shape_type_id])) {\n\t\t\tShape.build_json(params[:id], params[:shape_type_id]).to_json\n\t\t}\n=end\n\t\tkey = FILE_CACHE_KEY_SHAPE.gsub(\"[shape_id]\", params[:id])\n\t\t\t.gsub(\"[locale]\", I18n.locale.to_s)\n\t\t\t.gsub(\"[shape_type_id]\", params[:shape_type_id])\n\t\tgeometries = JsonCache.fetch_shape(key) {\n \t\tShape.build_json(params[:id], params[:shape_type_id]).to_json\n\t\t}\n\n respond_to do |format|\n format.json { render json: geometries }\n end\n end",
"def index\n @mugshots = Mugshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mugshots }\n end\n end",
"def show\n @barcode_list = BarcodeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @barcode_list }\n format.svg { send_data @barcode_list.data, :type => 'image/svg+xml', :disposition => 'inline' }\n end\n end",
"def show\n @barcode_list = BarcodeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @barcode_list }\n format.svg { send_data @barcode_list.data, :type => 'image/svg+xml', :disposition => 'inline' }\n end\n end",
"def show\n render json: @family_image\n end",
"def index\n @illustrations = Illustration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @illustrations }\n end\n end",
"def index\n @generations = Generation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @generations }\n end\n end",
"def show\n @garbage = Garbage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @garbage }\n end\n end",
"def show\n @mugshot = Mugshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mugshot }\n end\n end",
"def show\n @dimgeom = Dimgeom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dimgeom }\n end\n end",
"def show\n render json: @picture\n end",
"def index\n render json: Picture.all\n end",
"def show\n @bgimage = Bgimage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bgimage }\n end\n end",
"def new\n @drawing = Drawing.new\n\n render json: @drawing\n end",
"def show\n render json: Game.find(params[:id])\n end",
"def index\n @captures = Capture.all\n\n render json: @captures\n end",
"def index\n @draws = Draw.paginate(:page => params[:page], :per_page => 50)\n @winning_draws = Draw.where(:selection => \"WINNER\")\n @draw = Draw.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @draws }\n end\n end",
"def show\n @outdoor = Outdoor.find(params[:id])\n @json = Outdoor.find(params[:id]).to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outdoor }\n end\n end",
"def new\n @draw = Draw.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @draw }\n end\n end",
"def show\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gasto }\n end\n end",
"def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end",
"def show\n @garment_image = GarmentImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @garment_image }\n end\n end",
"def index\n @pictures = Picture.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"def show\n @curve = Curve.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curve }\n end\n end",
"def show\n @grm = Grm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm }\n end\n end",
"def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end",
"def index\n @in_game_gifts = InGameGift.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @in_game_gifts }\n end\n end",
"def index\n @activity = Activity.find(params[:activity_id])\n @pictures = @activity.pictures\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"def get_figures\n get(FIGURES)\n end",
"def show\n render json: @web_car_gallery\n end",
"def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end",
"def show\n # proxy to GET /roi/id\n @result = ImageServer.get('/roi/'+params[:id]);\n render :json => @result\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"def show\n @image_gallery = ImageGallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_gallery }\n end\n end",
"def show\n render json: @game\n end",
"def show\n @glyph = Glyph.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glyph }\n end\n end",
"def index\n @circle = current_user.circle\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @circle }\n end\n end",
"def show\n @glass = Glass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glass }\n end\n end",
"def index\n @gpsds = Gpsd.all\n #respond_to do |format|\n # format.json { render }\n #end\n end",
"def route\n hitch = Hitch.find(params[:hitch_id])\n render json: hitch.geojson\n end",
"def show\n @gravity = Gravity.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gravity }\n end\n end",
"def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @galleries }\n end\n end",
"def show\n @odontologo = Odontologo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologo }\n end\n end",
"def show\n render json:@web_display_car_image\n end",
"def show\n @green = Green.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @green }\n end\n end",
"def index\n @gifs = Gif.sorted.paginate(page: params[:page], per_page: 12)\n\n respond_to do |format|\n format.html\n format.json { render json: @gifs }\n end\n end",
"def show\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gallery }\n end\n end",
"def show\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gallery }\n end\n end",
"def show\n render json: @dice\n end",
"def index\n @galleries = Gallery.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @galleries }\n end\n end",
"def new\n @pix = Pix.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pix }\n end\n end",
"def show\n @pic = Pic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic }\n end\n end",
"def show\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @circle }\n end\n end",
"def show\n @citation = Citation.find(params[:id])\n @galaxies = @citation.galaxies\n @citation.galaxy_ids_array\n\n respond_to do |format|\n format.html { render :show }\n format.json { render :json => @citation.to_json(\n :only => [:title, :author, :bibtex, :journal, :year,\n :volume, :pages, :month, :note, :key],\n :methods => [:galaxy_ids_array]\n )\n }\n end\n end",
"def show\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @circle }\n end\n end"
] |
[
"0.7448132",
"0.7448132",
"0.7265818",
"0.7132463",
"0.7110957",
"0.6600178",
"0.6550299",
"0.6550299",
"0.6515574",
"0.6490883",
"0.6480113",
"0.6480113",
"0.6336206",
"0.62874675",
"0.62858784",
"0.62684005",
"0.6252954",
"0.6212031",
"0.6206706",
"0.61616254",
"0.61500853",
"0.6147647",
"0.61241955",
"0.6109314",
"0.6109098",
"0.6045471",
"0.6032607",
"0.60266536",
"0.5996972",
"0.5967633",
"0.59484816",
"0.5944838",
"0.59229785",
"0.5921742",
"0.5916996",
"0.5913282",
"0.590507",
"0.5902884",
"0.58911586",
"0.5879263",
"0.58634335",
"0.5862263",
"0.58611494",
"0.5856891",
"0.5855648",
"0.5852411",
"0.5852411",
"0.5845271",
"0.5832926",
"0.58296305",
"0.582614",
"0.581926",
"0.58179057",
"0.5810575",
"0.5807413",
"0.5796284",
"0.5794756",
"0.5792902",
"0.57912886",
"0.57909316",
"0.57865846",
"0.57804525",
"0.57706666",
"0.5766864",
"0.5758451",
"0.5745217",
"0.5743018",
"0.57331705",
"0.57241434",
"0.5719619",
"0.5718157",
"0.571026",
"0.5710117",
"0.5707418",
"0.57046175",
"0.5701674",
"0.57000613",
"0.5699975",
"0.5697991",
"0.5690937",
"0.568604",
"0.5685008",
"0.56798685",
"0.56768906",
"0.56753933",
"0.5674291",
"0.5674291",
"0.5674291",
"0.56736815",
"0.56668985",
"0.5666358",
"0.5666329",
"0.5665098",
"0.56642526",
"0.5660857",
"0.56563616",
"0.564809",
"0.5647843",
"0.56440866",
"0.5639455",
"0.5634515"
] |
0.0
|
-1
|
GET /graphics/1 GET /graphics/1.json
|
def show
@graphic = Graphic.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @graphic }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @graphics = Graphic.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @graphics }\n end\n end",
"def index\n @graphics = Graphic.fetch_ordered_by_page(params[\"page\"])\n end",
"def get_game_graphics_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: UniverseApi.get_game_graphics ...\"\n end\n if opts[:'datasource'] && !['tranquility', 'singularity'].include?(opts[:'datasource'])\n fail ArgumentError, 'invalid value for \"datasource\", must be one of tranquility, singularity'\n end\n # resource path\n local_var_path = \"/universe/graphics/\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'datasource'] = opts[:'datasource'] if !opts[:'datasource'].nil?\n query_params[:'user_agent'] = opts[:'user_agent'] if !opts[:'user_agent'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n header_params[:'X-User-Agent'] = opts[:'x_user_agent'] if !opts[:'x_user_agent'].nil?\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Integer>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: UniverseApi#get_game_graphics\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @drawable = Drawable.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drawable }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graphic }\n end\n end",
"def show\n @graphic = Graphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @graphic }\n end\n end",
"def show\n @drawing = Drawing.find(params[:id])\n\n render json: @drawing\n end",
"def show\n @pix = Pix.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pix }\n end\n end",
"def show\n @grm_grappt = GrmGrappt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_grappt }\n end\n end",
"def index\n @drawables = Drawable.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drawables }\n end\n end",
"def show\n @draw = Draw.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @draw }\n end\n end",
"def get_svg\n\t expires_in(1.hours, :private => false, :public => true)\n\t source_fedora_object = Multiresimage.find(params[:id])\n\t authorize! :show, source_fedora_object\n\t @svg = source_fedora_object.DELIV_OPS.content()\n gon.url = DIL_CONFIG['dil_js_url']\n respond_to do |wants|\n wants.xml { render :xml => @svg }\n end\n end",
"def get_svg\n\t expires_in(1.hours, :private => false, :public => true)\n\t source_fedora_object = Multiresimage.find(params[:id])\n\t authorize! :show, source_fedora_object\n\t @svg = source_fedora_object.DELIV_OPS.content()\n gon.url = DIL_CONFIG['dil_js_url']\n respond_to do |wants|\n wants.xml { render :xml => @svg }\n end\n end",
"def show\n @gpath = Gpath.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gpath }\n end\n end",
"def index\n @pictures = Picture.where(foodscape_id: params[:foodscape_id])\n render json: @pictures\n end",
"def show\n @gl = Gl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gl }\n end\n end",
"def show\n @grm_pic = GrmPic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm_pic }\n end\n end",
"def show\n @svgpost = Svgpost.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @svgpost }\n end\n end",
"def show\n @texture = Texture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @texture }\n end\n end",
"def show\n @infographic = Infographic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @infographic.to_json(:include => :rows) }\n end\n end",
"def show\n @gethotelstaticdatagd = Gethotelstaticdatagd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotelstaticdatagd }\n end\n end",
"def show\n @generation = Generation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generation }\n end\n end",
"def show\n @gauge = Gauge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gauge }\n end\n end",
"def show\n @genotype = Genotype.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @genotype }\n end\n end",
"def show\n @action_graphic = ActionGraphic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @action_graphic }\n end\n end",
"def show\n render json: @shot\n end",
"def show\n @dimgeom = Dimgeom.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dimgeom }\n end\n end",
"def show\n @screenshot = Screenshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @screenshot }\n end\n end",
"def show\n @mugshot = Mugshot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mugshot }\n end\n end",
"def show\n @gig = Gig.find(params[:id])\n\n respond_to do |format|\n format.html {render json: @gig, status: :ok}\n format.json { render json: @gig, status: :ok }\n end\n end",
"def show\n # proxy to GET /roi/id\n @result = ImageServer.get('/roi/'+params[:id]);\n render :json => @result\n end",
"def index\n @shots = Shot.all\n\n render json: @shots\n end",
"def new\n @graphic = Graphic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @graphic }\n end\n end",
"def show\n render json: Game.find(params[:id])\n end",
"def show\n @gopy = Gopy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gopy }\n end\n end",
"def show\n @gmap = Gmap.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gmap }\n end\n end",
"def show\n @pic_space = PicSpace.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic_space }\n end\n end",
"def show\n if @drawing.name == 'EllieDee'\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => JSON::parse(@drawing.to_json).merge(\"last_req\" => $last_req).to_json }\n end\n # @drawing['last_req'] = $last_req\n # render :json => Group.find(params[:id]), :methods => :message\n end\n end",
"def show\n @bgimage = Bgimage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @bgimage }\n end\n end",
"def index\n @pic_spaces = PicSpace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pic_spaces }\n end\n end",
"def show\n @image = Image.find(params[:id])\n\n render json: @image\n end",
"def show\n @image = Image.find(params[:id])\n\n render json: @image\n end",
"def index\n @textures = Texture.find(:all, :limit => 20, :order=> 'created_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @textures }\n end\n end",
"def show\n @gethotel = Gethotel.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gethotel }\n end\n end",
"def show\n @gen = Gen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gen }\n end\n end",
"def show\n @illustration = Illustration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @illustration }\n end\n end",
"def serv_json\n \"http://api.dribbble.com/shots/popular?page=1\"\n end",
"def show\n @illustration = Illustration.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @illustration }\n end\n end",
"def show\n @glyph = Glyph.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glyph }\n end\n end",
"def show\n @game_instance = GameInstance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @game_instance.to_json(:include => { :squares => { :include => :lines }} ) }\n end\n end",
"def show\n @garbage = Garbage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @garbage }\n end\n end",
"def show\n @garment_image = GarmentImage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @garment_image }\n end\n end",
"def index\n @illustrations = Illustration.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @illustrations }\n end\n end",
"def show\n @konfig = Konfig.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @konfig }\n end\n end",
"def show\n @generator = Generator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @generator }\n end\n end",
"def new\n @drawing = Drawing.new\n\n render json: @drawing\n end",
"def show\n @grm = Grm.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @grm }\n end\n end",
"def show\n @image_gallery = ImageGallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image_gallery }\n end\n end",
"def show\n @glass = Glass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @glass }\n end\n end",
"def new\n @draw = Draw.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @draw }\n end\n end",
"def shape\n=begin\n\t\tgeometries = Rails.cache.fetch(MEMORY_CACHE_KEY_SHAPE.gsub(\"[shape_id]\", params[:id])\n\t\t\t\t.gsub(\"[locale]\", I18n.locale.to_s)\n\t\t\t\t.gsub(\"[shape_type_id]\", params[:shape_type_id])) {\n\t\t\tShape.build_json(params[:id], params[:shape_type_id]).to_json\n\t\t}\n=end\n\t\tkey = FILE_CACHE_KEY_SHAPE.gsub(\"[shape_id]\", params[:id])\n\t\t\t.gsub(\"[locale]\", I18n.locale.to_s)\n\t\t\t.gsub(\"[shape_type_id]\", params[:shape_type_id])\n\t\tgeometries = JsonCache.fetch_shape(key) {\n \t\tShape.build_json(params[:id], params[:shape_type_id]).to_json\n\t\t}\n\n respond_to do |format|\n format.json { render json: geometries }\n end\n end",
"def index\n @screenshots = Screenshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @screenshots }\n end\n end",
"def show\n @green = Green.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @green }\n end\n end",
"def new\n @pix = Pix.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pix }\n end\n end",
"def show\n @image_set = ImageSet.find(params[:id])\n\n render json: @image_set\n end",
"def show\n @gasto = Gasto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gasto }\n end\n end",
"def show\n @curve = Curve.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @curve }\n end\n end",
"def show\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gallery }\n end\n end",
"def show\n @gallery = Gallery.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @gallery }\n end\n end",
"def show\n @gymnasium = Gymnasium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gymnasium }\n end\n end",
"def show\n @game = Game.find(params[:id])\n render json: @game, status: 200\n end",
"def new\n @drawable = Drawable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @drawable }\n end\n end",
"def show\n render json: @picture\n end",
"def show\n @imagem = Imagem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @imagem }\n end\n end",
"def show\n @pic = Pic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pic }\n end\n end",
"def show\n @indexed_gif = IndexedGif.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @indexed_gif }\n end\n end",
"def show\n render json: @family_image\n end",
"def show\n @gitem = Gitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gitem }\n end\n end",
"def show\n @polygon = Polygon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @polygon }\n end\n end",
"def show\n @outdoor = Outdoor.find(params[:id])\n @json = Outdoor.find(params[:id]).to_gmaps4rails\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @outdoor }\n end\n end",
"def show\n @gallery = Gallery.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gallery }\n end\n end",
"def show\n @barcode_list = BarcodeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @barcode_list }\n format.svg { send_data @barcode_list.data, :type => 'image/svg+xml', :disposition => 'inline' }\n end\n end",
"def show\n @barcode_list = BarcodeList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @barcode_list }\n format.svg { send_data @barcode_list.data, :type => 'image/svg+xml', :disposition => 'inline' }\n end\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @picture }\n end\n end",
"def show\n @odontologo = Odontologo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @odontologo }\n end\n end",
"def show\n @ginasio = Ginasio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @ginasio }\n end\n end",
"def index\n @mugshots = Mugshot.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @mugshots }\n end\n end",
"def show\n @grumble = Grumble.find(params[:id])\n render status: 200, json: @grumble.to_json\n end",
"def show\n @picture = Picture.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json=>@picture }\n end\n end",
"def show\n @mouse = Mouse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mouse }\n end\n end",
"def show\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @circle }\n end\n end",
"def show\n @gage = Gage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gage }\n end\n end",
"def index\n @activity = Activity.find(params[:activity_id])\n @pictures = @activity.pictures\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @pictures }\n end\n end",
"def show\n @circle = Circle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @circle }\n end\n end"
] |
[
"0.71110284",
"0.6976917",
"0.6875089",
"0.67676455",
"0.6766882",
"0.6766882",
"0.6689983",
"0.6537907",
"0.64281446",
"0.6420917",
"0.64197826",
"0.6398936",
"0.6398936",
"0.6395809",
"0.63739014",
"0.63421196",
"0.63392407",
"0.6324268",
"0.630673",
"0.62881243",
"0.6233865",
"0.6220877",
"0.6153539",
"0.6139703",
"0.61326",
"0.61321723",
"0.6127978",
"0.6126305",
"0.6090048",
"0.6085829",
"0.6067401",
"0.6050991",
"0.60507476",
"0.60443276",
"0.6032898",
"0.603144",
"0.602893",
"0.6025421",
"0.60238874",
"0.6015237",
"0.60052776",
"0.60052776",
"0.6001348",
"0.60012007",
"0.59939235",
"0.59815294",
"0.59779704",
"0.597298",
"0.59660685",
"0.5965623",
"0.5947955",
"0.5947509",
"0.5943209",
"0.5941111",
"0.5936682",
"0.59290445",
"0.5921911",
"0.5914659",
"0.59119844",
"0.5903609",
"0.59032017",
"0.58995783",
"0.58994395",
"0.58974826",
"0.58959585",
"0.5891456",
"0.5887917",
"0.58797836",
"0.58790165",
"0.58733743",
"0.58658916",
"0.58618027",
"0.5856345",
"0.58542985",
"0.5852563",
"0.5843664",
"0.58429193",
"0.5832992",
"0.5828498",
"0.58227944",
"0.5813641",
"0.58081865",
"0.58081865",
"0.5806512",
"0.5806512",
"0.5806512",
"0.5806512",
"0.5806512",
"0.5806512",
"0.5804606",
"0.5803712",
"0.58024836",
"0.57969904",
"0.5781521",
"0.57801896",
"0.5778349",
"0.5778316",
"0.57753164",
"0.5773873"
] |
0.7641829
|
1
|
a = Scraper.new("Essential Decadent Chocolate Brownie with Greek Yogurt Chips Naturally Flavored", 78100, 110, 2, 15, 11) b = Scraper.new("Essential Decadent Chocolate Brownie with Greek Yogurt Chips2 Naturally Flavored", 78101, 110, 2, 15, 11)
|
def initialize(number)
@@all << self
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def scraper(keyword)\n #in this example I get an empty array selecting the .c16H9d class\n url = \"https://www.lazada.vn/catalog/?q=#{keyword}&_keyori=ss&from=input&spm=a2o4n.home.search.go.1905e1822eN5XO\"\n html_file = open(url).read\n html_doc = Nokogiri::HTML(html_file)\n keywords = []\n\n html_doc.search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n\n end\n\n #example 2, for this example I try to follow this:\n # https://medium.com/@LindaVivah/the-beginner-s-guide-scraping-in-ruby-cheat-sheet-c4f9c26d1b8c\n\n def scraper2(keyword)\n url = \"https://www.lazada.vn/catalog/?q=#{keyword}&_keyori=ss&from=input&spm=a2o4n.home.search.go.1905e1822eN5XO\"\n html_file = open(url).read\n html_doc = Nokogiri::HTML(html_file)\n keywords = []\n\n html_doc.search('.c3KeDq').search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n end\n\n #more deep class selection\n html_doc.search('.c5TXIP').search('.c3KeDq').search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n end\n\n\n\n end\n\n\nend",
"def scraper(url2)\n dataUrl = Nokogiri::HTML(open(url2))\n linksUrl = dataUrl.css('div.place-post')\n \n linksUrl.each do |review|\n arr = []\n # name\n arr << review.css('#main-content-title').text.strip\n # neighborhood\n arr << review.css('span.date').text.strip\n # street-address\n #arr << review.css('span.street-address').text.strip\n # street-address\n #arr << review.css('span.locality').text.strip\n # food rating\n arr << review.css('span.i-box[1] span.i-number').text.strip\n # decor rating\n arr << review.css('span.i-box[2] span.i-number').text.strip\n #service rating\n arr << review.css('span.i-box[3] span.i-number').text.strip\n #cost rating\n arr << review.css('span.i-box[4] span.i-number').text.strip\n\n return arr\n end \nend",
"def scrape\n request = BoundingBox.new(\n :term => keyword,\n :sw_latitude => sw_lat,\n :sw_longitude => sw_long,\n :ne_latitude => ne_lat,\n :ne_longitude => ne_long,\n :sort => 2)\n\n request2 = BoundingBox.new(\n :term => keyword,\n :sw_latitude => sw_lat,\n :sw_longitude => sw_long,\n :ne_latitude => ne_lat,\n :ne_longitude => ne_long,\n :sort => 2,\n :limit => 20,\n :offset => 20)\n\n\n [ client.search(request), client.search(request2) ]\n end",
"def scraper(url2)\n dataUrl = Nokogiri::HTML(open(url2))\n linksUrl = dataUrl.css('div#leftContainer')\n \n linksUrl.each do |review|\n arr = []\n # name\n arr << review.css('span.fn').text.strip\n # neighborhood\n #arr << review.css('span.neighborhood').text.strip\n # street-address\n arr << review.css('div.h5').first.text.strip.split(\"Send\").first\n # street-address\n #arr << review.css('span.locality').text.strip\n # price rating\n arr << review.css('span.pricerange').text.strip\n # rating\n arr << review.css('span.value').text.strip\n #blurb\n arr << review.css('span#blurb').text.strip\n\n return arr\n end \nend",
"def get_bardahl_product_data\n agent = Mechanize.new\n page = agent.get('https://allbardahl.ru/catalog/additives/')\n review_links = page.links_with(text: /[a-zA-Z]/, href: %r{/\\w+})[1, 76]\n\n array_links = []\n review_links.map.with_index do |elem, i|\n i % 2 == 0 ? array_links << elem : next\n end\n array_links\nend",
"def scraper(url2)\n dataUrl = Nokogiri::HTML(open(\"http://www.timeout.com#{url2}\"))\n linksUrl = dataUrl.css('#content')\n \n linksUrl.each do |review|\n arr = []\n # name\n arr << review.css('h1.listing_page_title').text.strip\n # neighborhood\n arr << review.css('span.listings_flag').text.strip\n # street-address\n #arr << review.css('span.street-address').text.strip\n # summary\n arr << review.css('h2.review__summary').text.strip\n # food rating\n arr << review.css('ul.star_rating li.sr-only').text[0]\n #cost rating\n arr << review.css('span.listings_flags__price li.icon_highlight').count\n\n return arr\n end \nend",
"def scrape\n end",
"def create\n @scrap = Scrap.new(params[:scrap])\n\n\n\n require 'scrapifier'\n require 'nokogiri'\n require 'open-uri'\n require 'addressable/uri'\n require 'mechanize'\n require 'pattern-match'\n require 'rubygems'\n \n\n r = @url\n \n case r\n when /http?:\\/\\/www.gizmobaba.com[\\S]+/\n\tpage = Nokogiri::HTML(open(url,'User-Agent'=>'Mozilla/5.0 (Windows NT 6.0; rv:12.0) Gecko/20100101 Firefox/12.0 FirePHP/0.7.1')) \n \t#@url = r\n\t@title = page.xpath(\"//div[@class='ctl_aboutbrand']/h1\").text\n \t@desc = page.xpath(\"//p[@itemprop='description']\").text\n \t@price = page.xpath(\"//span[@itemprop='price']\").text\n \t@img = page.xpath(\"////img[@id='bankImage']/@src\")\n\n when /http?:\\/\\/www.myntra.com[\\S]+/\n\tpage = Nokogiri::HTML(open(url,'User-Agent'=>'Mozilla/5.0 (Windows NT 6.0; rv:12.0) Gecko/20100101 Firefox/12.0 FirePHP/0.7.1'))\n \t#@url = r\n\t@title = page.xpath(\"//h1[@class='title']\").text\n \t@desc = page.xpath(\"//div[@class='description']/p\").text\n \t@price = page.xpath(\"//div[@class='price']\").text\n \t@img = page.xpath(\"//div[@class='blowup']/img/@src\")\n\n else\n agent = Mechanize.new\n\tdata = r.scrapify(images: [:jpg] )\n\t@url = data[:uri]\n\t@title = data[:title]\n\t@desc = data[:description] \n\tcase r\n\t\twhen /http?:\\/\\/www.jabong.com[\\S]+/\n \t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@itemprop='price']\") \n \t @image = code.at(\"//img[@itemprop ='image']/@src\")\n\n\t\twhen /http?:\\/\\/www.flipkart.com[\\S]+/\n\t code = agent.get(r)\n \t\t@price = code.at(\"//span[@class='fk-font-verybig pprice vmiddle fk-bold']\")\n \t\t@image = code.at(\"//img[@id ='visible-image-small']/@src\")\n \n \t\twhen /http?:\\/\\/www.99lens.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='price']\")\n\t @image = code.at(\"//img[@id ='image']/@src\")\t\n\n\t\twhen /http?:\\/\\/www.amazon.in[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@id='priceblock_ourprice']\")\n\t\t@image = code.at(\"//img[@id ='landingImage']/@src\")\n\n\t\twhen /http?:\\/\\/www.americanswan.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='product-price-12782']\")\n\t\t@image = code.at(\"//img[@id ='image']/@src\")\n\n\t\twhen /http?:\\/\\/www.babyoye.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='current_product_price']\")\n\t\t@image = code.at(\"//img[@class ='google-analytics-event']/@src\")\n\n\t\twhen /http?:\\/\\/www.basicslife.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='price']\")\n\t\t@image = code.at(\"//a[@class='MagicZoomPlus']/img/@src\")\n\n\t\twhen /http?:\\/\\/www.bhaap.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='price']\")\n\t\t@image = code.at(\"//div[@class='product-img-box']/a/img/@src\")\n\n\t\twhen /http?:\\/\\/www.coke2home.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//p[@class='online_price29']\")\n\t\t@image = code.at(\"//a[@class='jqzoom2']/@href\")\n\n\t\twhen /http?:\\/\\/crazyflorist.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='regular-price']\")\n \t@image = code.at(\"//img[@itemprop='image']/@src\")\n\n\t\twhen /http?:\\/\\/www.dailyobjects.com[\\S]+/\t\n\t\tcode = agent.get(r)\n \t@price = code.at(\"//div[@class='do_detail_page_product_price']\")\n\t\t@image = code.at(\"//img[@itemprop='image']/@src\")\n\n \t\twhen /http?:\\/\\/www.fashionara.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@itemprop='lowprice']\")\n\t\t@image = code.at(\"//img[@itemprop='image']/@src\")\n\n\t\twhen /http?:\\/\\/www.fnp.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@id='INR']\")\n\t\t@image = code.at(\"//div[@class='slider']/ul/li/img/@src\")\n\n\t\twhen /http?:\\/\\/www.freecultr.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@id='product-price-14473']\")\n\t\t@image = code.at(\"//img[@id='zoom1']/@src\")\n\n\t\twhen /http?:\\/\\/www.gizmobaba.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='offer']\")\n\t\t@image = code.at(\"//img[@id='bankImage']/@src\")\n\n\t\twhen /http?:\\/\\/www.grabmore.in[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//div[@class='appr_price']\")\n\t\t@image = code.at(\"//img[@id='zoom1']/@src\")\n\n\t\twhen /http?:\\/\\/www.haladirams.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='price']\")\n\t\t@image = code.at(\"//img[@id='zoom_Img']/@src\")\n\t\n\t\twhen /http?:\\/\\/www.healthgenie.in[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@id='product-price-8924']\")\n\t\t@image = code.at(\"//img[@id='image1']/@src\")\n\n\t\twhen /http?:\\/\\/www.high5store.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@id='our_price_display']\")\n\t\t@image = code.at(\"//img[@id='bigpic']/@src\")\n\n\t\twhen /http?:\\/\\/www.indireads.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//p[@class='price']\")\n\t\t@image = code.at(\"//img[@class='attachment-shop_single wp-post-image']/@src\")\n\n\t\twhen /http?:\\/\\/www.kidzdeals.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='price']\")\n\t\t@image = code.at(\"//p[@class='product-image product-image-zoom']/a/img/@src\")\n\n\t\twhen /http?:\\/\\/www.metroshoes.net[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@itemprop='price']\")\n\t\t@image = code.at(\"//img[@id='bankImage']/@src\")\n\n\n\t\twhen /http?:\\/\\/www.pannkh.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='mrp']\")\n\t\t@image = code.at(\"//img[@id='largeImage']/@src\")\n\n\t\twhen /http?:\\/\\/www.pepperfry.com[\\S]+/\n \t\tcode = agent.get(r)\n\t @price = code.at(\"//li[@class='you_pay_price']\")\n\t\t@image = code.at(\"//img[@id='zoom_01']/@src\")\n\n\t\twhen /http?:\\/\\/www.planetsportsonline.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='offer']\")\n\t\t@image = code.at(\"//img[@id='bankImage']/@src\")\n\n\t\twhen /http?:\\/\\/www.purplle.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@class='normal-price d-b']\")\n\t\t@image = code.at(\"//img[@class='product-img']/@src\")\n\n\t\twhen /http?:\\/\\/www.shopatplaces.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//div[@class='price']\")\n\t\t@image = code.at(\"//img[@id='image']/@src\")\n\n\n\t\twhen /http?:\\/\\/www.slassy.com[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@itemprop='price']\")\n\t\t@image = code.at(\"//a[@class='productzoom']/@href\")\n\n\t\twhen /http?:\\/\\/www.smiledrive.in[\\S]+/\n\t\tcode = agent.get(r)\n\t @price = code.at(\"//span[@id='product-price-77']\")\n\t\t@image = code.at(\"//a[@id='zoom1']/img/@src\")\n\n\t\twhen /http?:\\/\\/www.stalkbuylove.com[\\S]+/\n\t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@class='price']\")\n\t\t@image = code.at(\"//img[@class='my_image_box']/@src\")\n\n\t\twhen /http?:\\/\\/www.yebhi.com[\\S]+/\n\t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@itemprop='price']\")\n \t@image = code.at(\"//img[@itemprop='image']/@src\")\n\n\t\twhen /http?:\\/\\/www.yepme.com[\\S]+/\n\t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@id='lblPayHead']\")\n\t\t@image = code.at(\"//img[@id='img2']/@src\")\n\n\t\twhen /http?:\\/\\/www.zovi.com[\\S]+/\n\t\tcode = agent.get(r)\n \t\t@price = code.at(\"//label[@id='price']\")\n\t\t@image = code.at(\"//section[@id='detail-image']/img/@src\")\n\n\t\twhen /http?:\\/\\/www.fabally.com[\\S]+/\n\t\tcode = agent.get(r)\n\t\t@price = code.at(\"//div[@class='codeArea']/span\")\n\t\t@image = code.at(\"//img[@id='prdimage']/@src\")\n\n\t\twhen /http?:\\/\\/www.beebayonline.com[\\S]+/\n \t\tcode = agent.get(r)\n\t\t@price = code.at(\"//span[@class='price']\")\n\t\t@image = code.at(\"//p[@class='product-image product-image-zoom']/a/@href\")\n\n\t\twhen /http?:\\/\\/www.foodpanda.in[\\S]+/ \n \t\tcode = agent.get(r)\n\t\t@price = code.at(\"//div[@class='restaurant-list-table last']\")\n\t\t@image = code.at(\"//div[@class='restaurant-content clearfix']/img/@src\")\n\n\t\twhen /http?:\\/\\/www.jewelskart.com[\\S]+/ \n \t\tcode = agent.get(r)\n\t\t@price = code.at(\"div[@class='lenskart']\")\n\t\t@image = code.at(\"//div[@id='slide-img']/a/img/@src\")\n\n\t\twhen /http?:\\/\\/www.lenskart.com[\\S]+/ \n \t\tcode = agent.get(r)\n\t\t@price = code.at(\"div[@class='lenskart']\")\n\t\t@image = code.at(\"//div[@id='slide-img']/a/img/@src\")\n\n\t\twhen /http?:\\/\\/www.moodsofcloe.com[\\S]+/ \n\t\tcode = agent.get(r)\n\t\t@price = code.at(\"//p[@class='productPrice color']\")\n\t\t@image = code.at(\"//div[@class='zImg om']/a/@href\")\n\n\t\twhen /http?:\\/\\/www.watchkart.com[\\S]+/ \n \t\tcode = agent.get(r)\n\t\t@price = code.at(\"div[@class='lenskart']\")\n\t\t@image = code.at(\"//div[@id='slide-img']/a/img/@src\")\n\n\t\twhen /http?:\\/\\/www.clapone.com[\\S]+/\n \t\tcode = agent.get(r)\n\t\t@price = code.at(\"//div[@class='price']\")\n\t\t@image = code.at(\"//img[@id='image']/@src\")\n\n\t\twhen /http?:\\/\\/www.fabfurnish.com[\\S]+/\n \t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@class='special_price_box']\")\n\t\t#@image = \n\n\t\twhen /http?:\\/\\/www.fashionequation.com[\\S]+/\n\t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@class='money']\")\n\t\t#@image = \n\n\t\twhen /http?:\\/\\/www.shopclues.com[\\S]+/\n \t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@id='sec_discounted_price_2631066']\")\n\t\t#@image = \n\n\t\twhen /http?:\\/\\/www.miladyavenue.com[\\S]+/\n \t\tcode = agent.get(r)\n \t@price = code.at(\"//span[@class='price-new']\")\n\t\t#@image = \n\n\t\twhen /http?:\\/\\/www.limeroad.com[\\S]+/\n \t\tcode = agent.get(r)\n \t\t#@price = code.at(\"//span[@class='price']\")\n\t\t#@image = \n\t\t\n\t\telse\n\t\t puts \" waiting for authentication to publish\"\n\t\n\n end\n\n end\n \n \n@scrap.save \n\n\n respond_to do |format|\n if @scrap.save\n format.html { redirect_to @scrap, notice: 'Scrap was successfully created.' }\n format.json { render :show, status: :created, location: @scrap }\n else\n format.html { render :new }\n format.json { render json: @scrap.errors, status: :unprocessable_entity }\n end\n end\n end",
"def scraper(range)\n range.each do |index|\n products = []\n counter = 0\n letter = (index + 65).chr\n\n # Open the specified product page, throw it into a Nokogiri object\n puts \"Opening: http://www.ikea.com/us/en/catalog/productsaz/#{index}\"\n az_page = Nokogiri::HTML(open(\"http://www.ikea.com/us/en/catalog/productsaz/#{index}\"))\n # pull out the product links\n product_links = az_page.css('span.productsAzLink a')\n\n # This blacklist was built over several runs. Several products will crash\n # the scraper - they're 404's, redirects, etc.\n product_links.each do |product|\n blacklist = [\n \"/us/en/catalog/products/S59932146/\",\n \"/us/en/catalog/products/S99014376/\",\n \"/us/en/catalog/products/60285335/\",\n \"/us/en/catalog/products/40173777/\",\n \"/us/en/catalog/products/70288183/\"\n ]\n\n # Grab the URL of this product\n url_fragment = product.attribute('href').text\n\n puts \"Scraping '#{url_fragment}'\"\n # only go after what we think are good URLs\n unless !url_fragment.include?(\"product\") || blacklist.include?(url_fragment)\n products << scrape_product_data(url_fragment)\n puts \"Stashing #{products.last.title} in array\"\n end\n end\n\n # Now that we have all the product info we're going to get from this page,\n # save it all out to a csv\n products.each do |the_product|\n CSV.open(\"./products/#{letter}.csv\", \"ab\") do |csv|\n csv << [\n the_product.url,\n the_product.title,\n the_product.subtitle,\n the_product.picture_url,\n the_product.price,\n the_product.category,\n the_product.article_number\n ]\n counter += 1\n end\n end\n\n puts \"#{letter}.csv saved with #{counter} lines\"\n end\nend",
"def trader_obscur\ncurrency_name = []\npage = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\")).css(\".currency-name-container\").each do |item|\n name = item.text\n currency_name << name\nend\n\ncurrency_price = []\npage = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\")).css(\".price\").each do |item|\n price = item.text\n currency_price << price\nend\n\nputs Hash[currency_name.zip(currency_price)]\n\nend",
"def scrape_it\n \n end",
"def compare(a, b)\n # ids, classes, tags\n a_ = [a.scan(/\\#\\w+/), a.scan(/\\.\\w+/), a.scan(/(?<=^|\\s)\\b(\\w+)\\b/)]\n b_ = [b.scan(/\\#\\w+/), b.scan(/\\.\\w+/), b.scan(/(?<=^|\\s)\\b(\\w+)\\b/)]\n return a if a_[0].count > b_[0].count\n return a if a_[0].count == b_[0].count && a_[1].count > b_[1].count\n return a if a_[0].count == b_[0].count && a_[1].count == b_[1].count && a_[2].count > b_[2].count\n return a if a_[0].count == b_[0].count && a_[1].count == b_[1].count && a_[2].count == b_[2].count && a_.count > b_.count\n b\nend",
"def scraper_nt\n url = 'https://www.biblegateway.com/versions/The-Living-Bible-TLB/#booklist'\n unparsed_page = HTTParty.get(url)\n parsed_page = Nokogiri::HTML(unparsed_page)\n book_lists_ot = parsed_page.css('tr.nt-book') #New testament Books\n\n new_testament_list = []\n new_testament_chapters = []\n book_lists_ot.each do |book_list| #Iterate through the book list\n \n ab = (book_list.css('td.book-name').text)\n nt_book = {\n name: ab.gsub(/\\d+$/, \"\"), #Strips out the one or more digits at end of line\n total_chapters: ab.gsub(/(^\\d)|\\D/, \"\").to_i #strips out the beginning numbers and letters, and converts to integer\n }\n book_chapter = book_list.css('td.chapters')\n\n book_chapter.each do |chapter|\n chapter_tag = chapter.css('a')\n\n chapter_tag.each do |tag|\n\n nt_chapter_list = {\n name: ab.gsub(/\\d+$/, \"\"), #Strips out the one or more digits at end of line\n title: tag.attributes[\"title\"].value,\n link: \"https://www.biblegateway.com\" + tag.attributes[\"href\"].value\n }\n new_testament_chapters << nt_chapter_list\n end\n end \n new_testament_list << nt_book\n\n \n end\n\n #/............................................................................../\n\n the_living_bible = []\n \n # new_testament_list.each do |book| #iterate through the list of books\n # # book[:name].each do |name| #find each book\n \n # chapter_count = 0\n # while chapter_count <= 1\n new_testament_chapters.each do |chapter|\n\n chapter_url = chapter[:link]\n chapter_unparsed_page = HTTParty.get(chapter_url)\n chapter_parsed_page = Nokogiri::HTML(chapter_unparsed_page)\n chapter_page_content = chapter_parsed_page.css('//span.text').text.gsub(/[0-9]+(-[0-9]+)|[0-9]+/, \"\\n\\n \\\\0\").gsub(/[*]/, \"\") #grab chapter text, add new line on each verse and remove special character\n \n chapter_page_header = chapter_parsed_page.css('//span.passage-display-bcv').text.gsub(/[0-9]{2}(-[0-9]{2})|[1-9]{2}/, \"\\\\0 \") #Grabs the Chapter Header\n \n chapter_content = {\n header: chapter_page_header,\n content: chapter_page_content\n }\n \n the_living_bible << chapter_content\n puts \"#{chapter[:title]} from link #{chapter[:link]} added to The Living Bible (New Testament)\"\n puts \"**************************************\"\n \n end \n # chapter_count += 1\n \n # end \n \n \n # end \n the_living_bible_pdf = Prawn::Document.new\n the_living_bible_pdf.font_size(40) {the_living_bible_pdf.text \"The Living Bible (New Testament)\"}\n the_living_bible.each do |the_bible|\n \n the_living_bible_pdf.font_families.update(\"Roboto\"=>{:normal =>\"fonts/Roboto/Roboto-Regular.ttf\"})\n the_living_bible_pdf.font \"Roboto\"\n\n the_living_bible_pdf.font_size(25) {the_living_bible_pdf.text \"#{the_bible[:header]}: \"}\n the_living_bible_pdf.move_down 20\n the_living_bible_pdf.text \"#{the_bible[:content]}\"\n the_living_bible_pdf.start_new_page\n \n end \n the_living_bible_pdf.move_down 100\n the_living_bible_pdf.font_size(9) {the_living_bible_pdf.text \"crawled from 'https://www.biblegateway.com' by Odogwudozilla\"}\n the_living_bible_pdf.render_file \"the_living_bible(NT).pdf\"\n puts \"**********The Living Bible (New Testament) crawled and created successfully**************\"\n \n \nend",
"def linkReturn(url)\n data = Nokogiri::HTML(open(url))\n links = data.css('.new-restaurants')\n allUrl = links.css('p a').map { |var| var['href'] }\n allUrl.each do |i|\n puts scraper(i)\n puts ''\n #puts i\n end\nend",
"def linkReturn(url)\n data = Nokogiri::HTML(open(url))\n links = data.css('.zone_B_with_ads')\n allUrl = links.css('div.tile__content a.tile__read_more').map { |var| var['href'] }\n allUrl.each do |i|\n puts scraper(i)\n puts ''\n #puts i\n end\nend",
"def create_digest(html)\n apartments = []\n items = html.css('p.row')\n items.each do |item|\n details = item.css('.pl').text\n new_digest = {\n :description => item.css('a').text,\n :price => parse_price(item.css('.price').text),\n :bedrooms => parse_bedrooms(item.css('.pnr').text)\n }\n apartments << new_digest\n end\n apartments\nend",
"def scrape\n google_url = create_google_url\n google_data = Scrubyt::Extractor.define do\n fetch google_url\n\n link_title \"//a[@class='l']\", :write_text => true do\n link_url\n end\n end\n google_data.to_hash.map {|r| r[:link_url]}\n end",
"def trip(url, steps=10)\n so_far = [] # (3) \n\n steps.times do \n page = fetch(url)\n book_info = scrape_book_info(page)\n so_far << book_info[:title]\n puts format_output(book_info)\n \n next_book = scrape_affinity_list(page).find do | possible | # (4) \n not so_far.include?(possible[:title])\n end\n\n url = next_book[:url]\n end\nend",
"def make_breeds\n html = Nokogiri::HTML(open(\"http://www.vetstreet.com/cats/breeds\")) \n html.css(\"div.desktop-experience #hub-breed-list-container\").children[3].css(\"a\").each do |b| \n breed = CatBreeds::Breed.new(b.text) \n breed.web = URL+b.attribute(\"href\").value \n end \n\n end",
"def scrape(num)\n num.times do\n single_scrape()\n end\nend",
"def go(uri)\n\n foaf='http://xmlns.com/foaf/0.1/' \n contact=\"http://www.w3.org/2000/10/swap/pim/contact#\" \n air= 'http://www.megginson.com/exp/ns/airports#'\n\n ayf = SimpleScutter.new uri\n\n pagecount=0\n # a code block to output basic info about each RDF page encountered\n # \n page_summary = Proc.new do |crawler,page| \n puts \"RDFDOC: count='#{pagecount}': uri:#{crawler.uri} gave RDF graph #{page} \\\n\twith #{page.size} triples\\n\" \n pagecount=pagecount+1\n end\n\n # a code block to see if some page provides nearestAirport information: \n #\n # <contact:nearestAirport><wn:Airport air:icao=\"EGGD\" air:iata=\"BRS\"/>...\n #\n airports = Proc.new do |crawler,page| \n\n #page.reg_xmlns 'http://www.megginson.com/exp/ns/airports#', 'air'\n \n rs = page.ask Statement.new(nil, air+\"iata\", nil)\n rs.objects.each do |a|\n a.graph=page\n puts \"AIRPORT: #{a} got airport code in #{crawler.uri})\" if (a.to_s =~ /\\S/) \n end\t\t\t\t\t# the 'if' is fix for parser bug\n end\n\n\n # the mugshots and htmler blocks are related, and share some state:\n report=\"\"\n seenpic=Hash.new(0) \t# counter\n\n # basic image metadata harvesting\n #\n mugshots = Proc.new do |crawler,page|\n images=[]\n img = page.ask Statement.new(nil, foaf+'img', nil)\n img.objects.each {|a| images.push a.to_s }\n img = page.ask Statement.new(nil, foaf+'depiction',nil)\n img.objects.each {|a| images.push a.to_s }\n\t\t # todo: store this state locally instead of inside crawler\n images.each do |pic|\n next if (!pic =~ /\\S/) #bug in Liber RDF parser.\n if seenpic[pic]==0 ### how to do this as a Proc? fixme\n report += \"<img src='#{pic}' width='128' height='128' />\" \n report += \"<!-- linked at: #{crawler.uri} -->\\n\\n\"\n end\n seenpic[pic]=seenpic[pic]+1\n end\n end\n\n # a code block that writes an html page based on the crawler's .out property \n #\n htmler = Proc.new do |crawler,page|\n html = \"<html><head><title>all your foaf depictions...</title></head>\\n<body>\\n\"\n html += \"<h1>AllYourFoaf Image Index</h1>\\n\" \n html += \"<p><strong>stats:</strong>: left.size=#{crawler.left.size} \\\n\tseen.size=#{crawler.seen.size} seenpic.size=#{seenpic.size} current:#{crawler.uri} </p> \"\n html += \"<hr />\\n\\n\" + report\n html += \"</body></html>\\n\\n\"\n SimpleScutter.writefile(crawler.outfile,html)\n end\n\n # stats to be output at start of each loop \n #\n loopstats = Proc.new do |s|\n puts \"INIT: s.left.size=#{s.left.size} s.seen.size=#{s.seen.size} current: #{s.uri}\"\n end\n\n error_logger = Proc.new {|e| puts \"ERROR: #{e}\" }\n\n # register some handlers:\n ayf.pagehandlers.push page_summary, airports, mugshots, htmler\n ayf.inithandlers.push loopstats\n ayf.errorhandlers.push error_logger \n ayf.run # set crawler running!\nend",
"def scrape_and_look_for_next_link(url)\n i = 0;\n page = Nokogiri::HTML(open(url))\n counties = scrape_timesbycounty(page)\n counties.collect do |county| \n if county \n county_url = BASE_URL + URI.escape(county['href'])\n areapage = Nokogiri::HTML(open(county_url))\n churches = scrape_area(areapage)\n churches.collect do |church| \n if church \n church_url = BASE_URL + URI.escape(church['href'])\n masstimes = Nokogiri::HTML(open(church_url))\n times = scrape_masstimes(masstimes)\n puts \"------------------------------------------\"\n puts \"county = \" +county.inner_text.strip\n puts \"church = \" +church.inner_text.strip\n puts \"times = \" +times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\")\n puts \"------------------------------------------\" \n i+=1\n record = {}\n record['ID'] = i \n record['County'] = county.inner_text.strip \n record['Church'] = church.inner_text.strip \n record['Times'] = times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\") \n ScraperWiki.save([\"ID\"], record)\n end\n end\n end\n end\nend",
"def scrape_and_look_for_next_link(url)\n i = 0;\n page = Nokogiri::HTML(open(url))\n counties = scrape_timesbycounty(page)\n counties.collect do |county| \n if county \n county_url = BASE_URL + URI.escape(county['href'])\n areapage = Nokogiri::HTML(open(county_url))\n churches = scrape_area(areapage)\n churches.collect do |church| \n if church \n church_url = BASE_URL + URI.escape(church['href'])\n masstimes = Nokogiri::HTML(open(church_url))\n times = scrape_masstimes(masstimes)\n puts \"------------------------------------------\"\n puts \"county = \" +county.inner_text.strip\n puts \"church = \" +church.inner_text.strip\n puts \"times = \" +times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\")\n puts \"------------------------------------------\" \n i+=1\n record = {}\n record['ID'] = i \n record['County'] = county.inner_text.strip \n record['Church'] = church.inner_text.strip \n record['Times'] = times.map { |str| \"'\" + str.to_s + \"'\" }.join(\",\") \n ScraperWiki.save([\"ID\"], record)\n end\n end\n end\n end\nend",
"def pull_offers(keyword, indeed_offers)\n puts \"Pulling result cards from the \\\"#{keyword}\\\" search\"\n domain = 'https://www.indeed.com.mx/'\n url = \"trabajo?q=#{keyword}&remotejob=032b3046-06a3-4876-8dfd-474eb5e7ed11\"\n html_content = open(domain + url).read\n doc = Nokogiri::HTML(html_content)\n # This var verifies if there are multiple pages of results\n next_page_button = doc.search('path')\n next_page_button = next_page_button.search('*[d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"]').text\n unless next_page_button.empty?\n # If there are multiple pages it will iterate though all of the result pages\n gather_offers_per_page(doc, indeed_offers)\n current_page = 1\n while next_page_button.empty? == true\n next_page = \"&start=#{current_page}0\"\n html_content = open(domain + url + next_page).read\n doc = Nokogiri::HTML(html_content)\n # This var verifies if there are multiple pages of results\n gather_offers_per_page(doc, indeed_offers)\n current_page += 1\n next_page_button = doc.search('path')\n next_page_button = next_page_button.search('*[d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6-6-6z\"]')\n end\n else\n gather_offers_per_page(doc, indeed_offers)\n end\n end",
"def show_wine\n # # Creation of a new Scraper object with wine's url as a parameter\n # @scraper = Scraper.new\n # @scraper.link = params[:link]\n #\n # # Contruction of the figaro url\n # url = \"http://avis-vin.lefigaro.fr\" + @scraper.link\n #\n # # Call of wine's years scraping class method\n # @years = Scraper.get_wine_years(url) # => array of hashes containing wine's years\n end",
"def scraper2(keyword)\n url = \"https://www.lazada.vn/catalog/?q=#{keyword}&_keyori=ss&from=input&spm=a2o4n.home.search.go.1905e1822eN5XO\"\n html_file = open(url).read\n html_doc = Nokogiri::HTML(html_file)\n keywords = []\n\n html_doc.search('.c3KeDq').search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n end\n\n #more deep class selection\n html_doc.search('.c5TXIP').search('.c3KeDq').search('.c16H9d a').each do |element|\n element.text.strip\n element.attribute('title').value.map { |word| word.include?(keywords) ? keywords.to_f/2 : word }\n end\n\n\n\n end",
"def get_results(url) #pass url in as argument\n scraper = make_scraper\n url=\"https://www.dice.com/jobs?q=rails&l=Washington%2C+DC&searchid=7137101740189\"\n page = scraper.get(url)\n end",
"def scrap(ingredient)\n scraper = ScraperMarmiton.new(ingredient)\n scraper.doc.search('m.search').each do |element|\n name = element.search('.m_search_titre_recette > a').inner_text\n rating = element.search('etoile1').size\n prep_time = 10 #element.search('m_search_result_part4').inner_text.match(/\\d+/)[1]\n cooking_time = 10 #\n create(name, rating, preparation_time, cooking_time)\n end\n end",
"def stock_scraper(range)\n bad_pages = {}\n hits = {}\n mech = Mechanize.new\n mech.user_agent = \"Melon MTG Scraper v0.1 - awkwardmelon@gmail.com - Please contact if the behavior of this bot is found to be problematic in any way.\"\n range.shuffle.each do |n|\n begin\n page = mech.get(\"http://mtgstocks.com/cards/#{n}\")\n rescue Exception => e\n bad_pages[\"#{n}\"] = e\n next\n end\n if page.code == \"200\"\n id = page.uri.path.scan(/\\d+/).first.to_i\n card = page.at(\"title\").text.chomp(\" - MTGStocks.com\")\n set = page.at(\".indent\").at(\"a\").text\n hits[\"Card: #{card}\" + \" \" + \"Set: #{set}\"] = n\n end\n puts \"#{card} - #{set} - #{n}\"\n sleep(rand(1.0..2.0))\n end\n File.open(\"mtgStocksNumberScrape.rb\", \"w\") do |f|\n f.write(JSON.dump(hits))\n end\n return hits\n end",
"def trip(url, steps=10) # (1) \n\n steps.times do # (2) \n page = fetch(url)\n book_info = scrape_book_info(page)\n puts format_output(book_info)\n \n next_book = scrape_affinity_list(page)[0]\n\n url = next_book[:url]\n end\nend",
"def prod_scraper(sup)\n sleep rand(1..3)\n agent = Mechanize.new\n begin\n doc = agent.get(\"#{sup[:link]}?campaign=compadi\")\n rescue => e\n #check if page still avaiable\n if e.response_code == '404'\n return sup\n end\n puts \"error.. retrying after a min\" \n puts e\n sleep 60\n retry\n end\n puts \"Scrapping #{sup[:name]}\"\n unless doc.search('.default-price').first.nil?\n sup[:price] = doc.search('.default-price').first.text\n end\n unless doc.search('.product-seller-name').first.nil?\n sup[:seller] = doc.search('.product-seller-name').children.first.text\n end \n unless doc.search('.dlvr').first.nil?\n sup[:sender] = doc.search('.dlvr').first.text\n end\n unless doc.search('.tell-me-button-wrapper').first.nil?\n unless doc.search('.tell-me-button-wrapper').children.first.nil?\n return 'delete' if doc.search('.tell-me-button-wrapper').children.first.text == \"Produto indisponível\"\n end\n end\n unless doc.search('.show-seller-name').first.nil?\n sup[:seller] = doc.search('.show-seller-name').first.text\n sup[:sender] = doc.search('.show-seller-name').first.text\n end\n unless doc.search('.sku-select').search('.content').first.nil?\n sup[:flavor] = doc.search('.sku-select').search('.item a').first.text\n end\n unless doc.search('.badge-item').first.nil?\n sup[:promo] = doc.search('.badge-item').first.text\n end\n if doc.search('.tag-shipping').empty?\n sup[:supershipping] = false\n else\n sup[:supershipping] = true\n end \n binding.pry\n sup\n end",
"def scrapeAirBNB(location=\"\", pmin=\"\", pmax=\"\", indate=\"\", outdate=\"\", bednum=\"\")\n\n\t\turl = \"https://www.airbnb.com/s/hong-kong/homes?hosting_amenities%5B%5D=6\"\n\t\tif location != \"\"\n\t\t\turl = \"https://www.airbnb.com/s/#{location}/homes?hosting_amenities%5B%5D=6\"\n\t\tend\n\t\tif pmin != \"\"\n\t\t\turl << \"&price_min=#{pmin}\"\n\t\tend\n\t\tif pmax != \"\"\n\t\t\turl << \"&price_max=#{pmax}\"\n\t\tend\n\t\tif indate != \"\"\n\t\t\turl << \"&checkin=#{indate}\"\n\t\tend\n\t\tif outdate != \"\"\n\t\t\turl << \"&checkout=#{outdate}\"\n\t\tend\n\t\tif bednum != \"\"\n\t\t\turl << \"&adults=#{bednum}\"\n\t\tend\t\n\t\tputs url\n\n\t\ttitle = []\n\t\tprice = [] \n\t\troomtype = []\n\t\tbedno = []\n\t\tlinks = []\n\n\t\trating = []\n\t\tlocation = [] #e.g. central, tst, mong kok, disneyland, etc\t\n\n\t\t#information = [title, price, roomtype, bedno]\n\n\n\t\tpage = Nokogiri::HTML(open(url))\n\n\t\ta_tag = page.at('a')\n\t\tlink = a_tag.attributes[\"href\"].value\n\t\t#handles title and price\n\t\tcounter = 1\n\t\tpage.css(\"span.text_5mbkop-o_O-size_small_1gg2mc-o_O-weight_bold_153t78d-o_O-inline_g86r3e\").each do |line|\n\t\t\tif (counter+1) % 3 == 0\n\t\t\t\tprice << line.text.strip.delete(\"Price\")\t\t\t\n\t\t\t\tcounter += 1\n\t\t\telsif (counter+0) % 3 == 0\n\t\t\t\tcounter += 1\n\t\t\telsif (counter-1) % 3 == 0\n\t\t\t\ttitle << line.text.strip\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\n\t\t#Handles room type and number of beds\n\t\tcounter = 1\n\t\tpage.css(\"span.detailWithoutWrap_j1kt73\").each do |line|\n\t\t\tif (counter) % 2 == 1\n\t\t\t\troomtype << line.text.strip\n\t\t\t\tcounter += 1\n\t\t\telsif (counter) % 2 == 0\n\t\t\t\tbedno << line.text.strip\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\n\t\t#handles links\n\t\tcounter = 1\n\t\tpage.css('a').each do |line|\t\t\n\t\t\tif line.attributes[\"href\"].value[0..3] == \"/roo\" && counter % 2 == 0\n\t\t\t\tlinks << \"https://www.airbnb.com\" + line.attributes[\"href\"].value\n\t\t\t\tcounter += 1\n\t\t\telse\n\t\t\t\tcounter += 1\n\t\t\tend\n\t\tend\n\n\t\t#Creates CSV files\n\t\tCSV.open(\"airbnb_listings.csv\", \"w\") do |file|\n\t\t\tfile << [\"Title\", \"Price\", \"Room Type\", \"No. Beds\", \"Link\", \"Location\"]\n\t\t\tprice.length.times do |i|\n\t\t\t\tfile << [title[i], price[i], roomtype[i], bedno[i], links[i], location[i]]\n\t\t\tend\n\t\tend\n\n\t\t#Creates JSON\n\t\textracted_data = CSV.table('airbnb_listings.csv')\n\t\ttransformed_data = extracted_data.map { |row| row.to_hash }\n\t\tFile.open('airbnb.json', 'w') do |file|\n\t \t\tfile.puts JSON.pretty_generate(transformed_data)\n\t\tend\n\tend",
"def recommendations(url,num=5)\n url = url_host_path(url)\n uid = REDIS[\"id:#{url}\"]\n results = REDIS.zrevrangebyscore(\"recos:#{uid}\", '+inf', '-inf', {:withscores => true} )\n \n recos = results[0...num].map do |x| uid,score = x[0],x[1]\n { :title=>REDIS[\"title:#{uid}\"], :url=>REDIS[\"url:#{uid}\"], :score=>score }\n end\n \n return recos\nend",
"def linkReturn(url)\n data = Nokogiri::HTML(open(url))\n links = data.css('div.case')\n allUrl = links.css('h3 a').map { |var| var['href'] }\n allUrl.each do |i|\n puts scraper(i)\n puts ''\n puts i\n end\nend",
"def get_paper_list(keywords)\n output = []\n page = 0\n\n keywords.each do |keyword|\n puts \"keyword: \"+keyword\n\n LIMIT.times do |page|\n puts \"page: \"+page.to_s\n\n #parses array of papers\n data = Hpricot(self.download_url(self.set_url(keyword, page)))\n papers = data.search(\"ul.blockhighlight\")\n \n # parse necessary data\n papers.each do |item|\n \n \n title = item.search(\"em.title\").first.inner_html\n link = item.search(\"a.doc_details\").first.attributes['href']\n # odstraneni prazdnych radku, smrsknuti vicenasobnych mezer a rozdeleni podle html entity pomlcky\n author_and_year = item.search(\"li.author\").first.inner_html.delete(\"\\n\").squeeze(\" \").split(\"—\")\n additional_info = self.get_additional_info(link)\n \n puts \"Dokument:\\t\"+title\n\n # vytvoreni tridy pro dokument\n doc = Document.new(@title)\n # gsub stripne html tagy\n doc.title = title.strip.gsub(/<\\/?[^>]*>/, \"\")\n doc.year = author_and_year[1].strip \n doc.abstract = additional_info['abstract']\n # rozdeleni jmen autoru - citeseerx ma rozdeleno mezerou a carkou\n doc.authors = self.parse_authors(author_and_year[0].strip.sub(/^by /, \"\"))\n \n # kontrola, zda dokument ukladat nebo ne\n if doc.unique? then\n puts \"unikatni\"\n downloaded = self.download_paper(additional_info['links'])\n doc.filename = downloaded\n doc.filetype = 'application/pdf' \n if(doc.save() === false)\n puts \"Chyba pri ukladani dokumentu!\"\n end\n else\n puts \"NEunikatni\"\n end\n \n puts \"\\n\\n\"\n end #papers.each\n end #LIMIT.times\n end #keywords.each\n\n return output\n end",
"def get_all_the_urls_of_manche\n#On créer deux tableau, 1 pour stocker les noms des maries, l'autre pour stocker les e-mails\n @town_names = []\n @town_emails = []\n urls = %w[http://www.annuaire-des-mairies.com/manche.html]\n\n urls.each do |url|\n doc = Nokogiri::HTML(open(url))\n \tdoc.css(\".lientxt\").each do |link|\n \t\turl = \"http://annuaire-des-mairies.com\" + link[\"href\"][1..-1].to_s\n \t\ttown_name = link.text\n \t\ttown_email = get_the_email_of_a_townhal_from_its_webpage(url)\n @town_names << town_name\n @town_emails << town_email\n end\n end\n\n urls = %w[http://www.annuaire-des-mairies.com/manche-2.html]\n\n urls.each do |url|\n doc = Nokogiri::HTML(open(url))\n \tdoc.css(\".lientxt\").each do |link|\n \t\turl = \"http://annuaire-des-mairies.com\" + link[\"href\"][1..-1].to_s\n \t\ttown_name = link.text\n \t\ttown_email = get_the_email_of_a_townhal_from_its_webpage(url)\n @town_names << town_name\n @town_emails << town_email\n end\n end\n\n urls = %w[http://www.annuaire-des-mairies.com/manche-3.html]\n\n urls.each do |url|\n doc = Nokogiri::HTML(open(url))\n \tdoc.css(\".lientxt\").each do |link|\n \t\turl = \"http://annuaire-des-mairies.com\" + link[\"href\"][1..-1].to_s\n \t\ttown_name = link.text\n \t\ttown_email = get_the_email_of_a_townhal_from_its_webpage(url)\n @town_names << town_name\n @town_emails << town_email\n end\n end\n envoie_mail #Cette méthode ce trouve dans townhalls_mailer.rb\n pro_twitter #Cette méthode ce trouve dans townhalls_follower.rb\n end",
"def kiwixAnswerSearch(aA, aB, aC, aD)\n\thtmls = []\n\n\tbegin\n\t\taddress1 ='http://127.0.0.1:8000/wikipedia_en_all_nopic_01_2012/A/' + URI::encode(aA) + '.html'\n\trescue\n\t\tputs \"address1 not encoded\"\n\tend\n\tbegin\n\t\taddress2 ='http://127.0.0.1:8000/wikipedia_en_all_nopic_01_2012/A/' + URI::encode(aB) + '.html'\n\trescue\n\t\tputs \"address1 not encoded\"\n\tend\n\tbegin\n\t\taddress3 ='http://127.0.0.1:8000/wikipedia_en_all_nopic_01_2012/A/' + URI::encode(aC) + '.html'\n\trescue\n\t\tputs \"address1 not encoded\"\n\tend\n\tbegin\n\t\taddress4 ='http://127.0.0.1:8000/wikipedia_en_all_nopic_01_2012/A/' + URI::encode(aD) + '.html'\n\trescue\n\t\tputs \"address1 not encoded\"\n\tend\n\n\tbegin\n\t\thtmls << HTTParty.get(address1)\n\trescue\n\t\tputs \"address1 not gotten\"\n\tend\n\tbegin\n\t\thtmls << HTTParty.get(address2)\n\trescue\n\t\tputs \"address2 not gotten\"\n\tend\n\tbegin\n\t\thtmls << HTTParty.get(address3)\n\trescue\n\t\tputs \"address3 not gotten\"\n\tend\n\tbegin\n\t\thtmls << HTTParty.get(address4)\n\trescue\n\t\tputs \"address4 not gotten\"\n\tend\nend",
"def economists\n b = Watir::Browser.new(:phantomjs)\n begin\n b.goto 'http://www.economist.com/'\n doc = Nokogiri::HTML(b.html)\n # def one\n begin\n a = doc.css('.hero-item-1')\n b = doc.css('.hero-item-1 a')[1]['href']\n url = 'http://www.theeconomist.com' + b.to_s\n puts url\n c = doc.css('.hero-item-1 .fly-title')\n title = c.text\n puts title\n d = doc.css('.hero-item-1 .headline')\n subtitle = d.text\n puts subtitle\n @economist = Economist.find_or_create_by(title: title, subtitle: subtitle, url: url)\n @economist.save\n puts 'Economist entry created!'\n # end\n # def two\n a = doc.css('.hero-item-2')\n b = doc.css('.hero-item-2 a')[0]['href']\n url = 'http://www.theeconomist.com' + b.to_s\n puts url\n c = doc.css('.hero-item-2 .fly-title')\n title = c.text\n puts title\n d = doc.css('.hero-item-2 .headline')\n subtitle = d.text\n puts subtitle\n @economist = Economist.find_or_create_by(title: title, subtitle: subtitle, url: url)\n @economist.save\n puts 'Economist entry created!'\n # end\n # def three\n a = doc.css('.hero-item-3')\n b = doc.css('.hero-item-3 a')[1]['href']\n url = 'http://www.theeconomist.com' + b.to_s\n puts url\n c = doc.css('.hero-item-3 .fly-title')\n title = c.text\n puts title\n d = doc.css('.hero-item-3 .headline')\n subtitle = d.text\n puts subtitle\n @economist = Economist.find_or_create_by(title: title, subtitle: subtitle, url: url)\n @economist.save\n puts 'Economist entry created!'\n # end\n # def four\n a = doc.css('.hero-item-4')\n b = doc.css('.hero-item-4 a')[1]['href']\n url = 'http://www.theeconomist.com' + b.to_s\n puts url\n c = doc.css('.hero-item-4 .fly-title')\n title = c.text\n puts title\n d = doc.css('.hero-item-4 .headline')\n subtitle = d.text\n puts subtitle\n @economist = Economist.find_or_create_by(title: title, subtitle: subtitle, url: url)\n @economist.save\n puts 'Economist entry created!'\n # end\n rescue\n puts \"No method error\"\n end\n # homepage center\n f = doc.css('#homepage-center-inner article')\n puts 'number of articles'\n c = f.count.to_i\n c = c - 1\n z = (0..c).to_a\n puts 'number of z'\n puts z\n z.each do |i|\n begin\n a = doc.css('#homepage-center-inner .news-package')[i]\n b = doc.css('#homepage-center-inner article a')[0]['href']\n url = 'http://www.economist.com' + b.to_s\n puts url\n c = doc.css('#homepage-center-inner article .headline')[i]\n title = c.text\n puts 'title'\n puts title\n d = doc.css('#homepage-center-inner article .rubric')[i]\n subtitle = d.text[0..-10].strip\n puts 'subtitle'\n puts subtitle\n @economist = Economist.find_or_create_by(title: title, subtitle: subtitle, url: url)\n @economist.save\n puts 'Economist entry created!'\n rescue\n puts \"No method error\"\n end\n end\n rescue\n retry\n end\n end",
"def test_get_position_links_02\n a = Scraper.new\n link = a.get_position_links\n link.each do |a|\n assert_match /https:\\/\\/www.jobsatosu.com.*/, a ,\"The link must be a link to jobsatosu.com\"\n end\n\n end",
"def ebay_scrap(scr)\n product = scr\n url = \"http://shop.ebay.com/?_from=R40&_trksid=p3907.m570.l1313&_nkw=#{product}&_sacat=See-All-Categories\"\n doc = Nokogiri::HTML(open(url))\n\n puts url\n doc.css(\".tp\").each do |item|\n text = item.at_css(\".v4lnk\").text\n price = item.at_css(\".prices\").text + \"rur\"\n puts \"#{text} - #{price}\"\n end\n\nend",
"def scrape_book_info(html)\n retval = {}\n html = restrict(html,\n /<div.+class\\s*=\\s*\"buying\".*?>\\s*<b/,\n %r{</div\\s*>})\n retval[:title] = scrape_title(html)\n retval[:authors] = scrape_authors(html)\n retval\nend",
"def scraper_categories\n scraped = Scraper.scrape_website\n Flower.all \n #find method?\n # if price == $0..$79\n # @@low << flower_object\n # elsif == $80..$149\n # @@med << flower_object\n # else\n # @@high << flower_object\n # end \n\n # binding.pry\n end",
"def scrape_more_pages\n\n pages_to_scrape = 0\n\n clear_screen\n clear_screen\n\n # loop untl we get a valid number of pages to scrape\n until pages_to_scrape != 0\n print \"\\nHow many pages would you like to scrape?: \".blue\n pages_to_scrape = gets.chomp.to_i\n end\n\n ending_page = last_scraped_page + pages_to_scrape # calculate our last page number\n @last_scraped_page += 1\n\n puts \"\\n\"\n (@last_scraped_page..ending_page).each.with_index(1) do |page, index|\n progress_bar(index.to_f / pages_to_scrape)\n @scraper.scrape_data_from_url(\"#{@scraper.base_url}#{page}\").each do |job_hash|\n FreelancerFinder::Job.new(job_hash) unless FreelancerFinder::Job.all.detect {|job| job.path == job_hash[:path]} # next create a job instance from the data we just scraped unless it exists already\n end\n end\n\n puts \"\\nSuccesfully Scraped #{pages_to_scrape} Pages!\".magenta\n\n @last_scraped_page = ending_page\n\n FreelancerFinder::Job.all\n end",
"def scrape_botw(*reintentos)\n begin\n\n if reintentos[0]==1\n reintentos = reintentos[1].to_i\n else\n reintentos = 2\n end\n \n i=0\n url = \"http://blogs.botw.org/\" \n page = Nokogiri::HTML(open(url))\n \n page.css(\"div.categories-holder ul.category-list li.category\").each do |category|\n if category.css(\"a\")[0]['href'] == \"/Science/\"\n category_page = Nokogiri::HTML(open(\"http://blogs.botw.org\" + category.css(\"a\")[0]['href']))\n puts category.css(\"a\")[0]['href']\n if !category_page.css(\".categories-empty li a\").empty?\n puts \"tiene subcategorias\"\n category_page.css(\".categories-empty li a\").each do |subcategory|\n subcategory_page = Nokogiri::HTML(open(\"http://blogs.botw.org\" + subcategory['href']))\n if !subcategory_page.css(\".categories-empty li a\").empty?\n puts \"Buscar si hay mas categorias\"\n else\n puts \"No hay subcategorias, escrapeamos blogs\"\n subcategory_page.css(\"div#Listings.listings div.listing p a img\").each do |blog|\n puts i+=1\n scrape_rss_feed blog['alt'], \"Post\"\n end\n #y miramos si hay subcategorias en sidebar, hasta profundidad de nivel 1 (seguir mirando como hacer para profundidad de nivel 2)\n if !subcategory_page.css(\"div#ShowSpecificCategory1_SideBarTopLevelCategoriesPanel ul li a\").empty?\n subcategory_page.css(\"div#ShowSpecificCategory1_SideBarTopLevelCategoriesPanel ul li a\").each do |subcategory_sidebar|\n subcategory_sidebar_page = Nokogiri::HTML(open(\"http://blogs.botw.org\" + subcategory_sidebar['href']))\n subcategory_page.css(\"div#Listings.listings div.listing p a img\").each do |blog|\n puts i+=1\n scrape_rss_feed blog['alt'], \"Post\"\n end\n end\n end\n if !subcategory_page.css(\"div#ShowSpecificCategory1_SideBarMidLevelCategoriesPanel ul li a\").empty?\n subcategory_page.css(\"div#ShowSpecificCategory1_SideBarMidLevelCategoriesPanel ul li a\").each do |subcategory_sidebar|\n subcategory_sidebar_page = Nokogiri::HTML(open(\"http://blogs.botw.org\" + subcategory_sidebar['href']))\n subcategory_page.css(\"div#Listings.listings div.listing p a img\").each do |blog|\n puts i+=1\n scrape_rss_feed blog['alt'], \"Post\"\n end\n end\n end\n if !subcategory_page.css(\"div#ShowSpecificCategory1_SideBarBottomLevelCategoriesPanel ul li a\").empty?\n subcategory_page.css(\"div#ShowSpecificCategory1_SideBarBottomLevelCategoriesPanel ul li a\").each do |subcategory_sidebar|\n subcategory_sidebar_page = Nokogiri::HTML(open(\"http://blogs.botw.org\" + subcategory_sidebar['href']))\n subcategory_page.css(\"div#Listings.listings div.listing p a img\").each do |blog|\n puts i+=1\n scrape_rss_feed blog['alt'], \"Post\"\n end\n end\n end\n end\n end\n else\n puts \"no tiene subcategorías, escrapeamos blogs\"\n category_page.css(\"div#Listings.listings div.listing p a img\").each do |blog|\n puts i+=1\n scrape_rss_feed blog['alt'], \"Post\"\n end\n #y miramos si hay subcategorias en sidebar, hasta profundidad de nivel 1\n if !category_page.css(\"div#ShowSpecificCategory1_SideBarTopLevelCategoriesPanel ul li a\").empty?\n category_page.css(\"div#ShowSpecificCategory1_SideBarTopLevelCategoriesPanel ul li a\").each do |subcategory_sidebar|\n subcategory_page = Nokogiri::HTML(open(\"http://blogs.botw.org\" + subcategory_sidebar['href']))\n subcategory_page.css(\"div#Listings.listings div.listing p a img\").each do |blog|\n puts i+=1\n scrape_rss_feed blog['alt'], \"Post\"\n end\n end\n end\n end\n end #if Science\n end \n rescue Exception => e\n puts \"Exception in scrape_botw\"\n puts \"Reintentamos dos veces, sino abortamos\"\n puts e.backtrace.inspect\n puts e.message\n if reintentos > 0\n puts reintentos\n reintentos-=1\n sleep 2\n scrape_botw(1,reintentos)\n end\n end\n end",
"def all_matches\n b = GenerateBets.new(1, 1, 40)\n # ap b.generate_sameple\n return b.generate_sameple\n # return b.example_feed\n end",
"def parse_results(raw_results)\n results = []\n results << ['Name', 'URL', 'Price', 'Neighborhood']\n\n raw_results.each do |result|\n link = result.css('a')[1] #mechanize library\n name = link.text.strip\n url = \"http://sfbay.craigslist.org\" + link.attributes[\"href\"].value\n price = result.search('span.price').text\n neighborhood = result.search('span.pnr').text[3..-13]\n\n puts \"This apartment is located in #{neighborhood}\"\n\n a = Apartment.new(name,url,price,neighborhood)\n\n results << [a.name, a.url, a.price, a.neighborhood]\n create_csv(results)\n end\nend",
"def single_scrape\n next_page()\n save_page()\nend",
"def crawl_parser(results)\n\t\tputs \"[\".light_green + \"*\".white + \"] OK\".light_green + \", \".white + \"running parser on\".light_green + \": #{results}\".white\n\t\timportant = File.open(results, \"r\") #place our found links in variable to manipulate and search as needed\n\t\trezDir = \"#{$results}#{@zsite}/\" #Our results dir for this site which has been already created in first function cycles\n\n\t\t# placeholder arrays for sorting and finding unique testable links\n\t\tspreadsheetz=[]; executablez=[]; no_params=[]; test_keys=[]; noparamz=[]; archivez=[]; testlink=[]; opendocz=[]; outlookz=[]; paramz=[]; imagez=[];\n\t\taudioz=[]; videoz=[]; flashz=[]; multi=[]; vcardz=[]; bkupz=[]; jsz=[]; confz=[]; wordz=[]; xmlz=[]; pazz=[]; pdfz=[]; txtz=[]; pptz=[]; dbz=[];\n\n\t\tmcount=0 #Multi Parameter Links Count\n\t\tscount=0 #Single Parameter Links Count\n\t\tnocount=0 #No Parameter Links Count\n\n\t\t#loop through content of crawler.links file line by line...\n\t\timportant.each do |line|\n\t\t\tbegin\n\t\t\t\t#parse out parameters if they are present, if not will error NoMethodError and be handled there with rescue\n\t\t\t\tparam = URI.parse(line).query\n\n\t\t\t\t#break paramaters into hash [ \"@key\" => \"@value\" ] formatting held in storage for easier manipulation\n\t\t\t\tparamsHash = Hash[URI.parse(line).query.split('&').map{ |q| q.split('=') }] \n\n\t\t\t\t# Parse according to the number of parameters in link\t\t\n\t\t\t\t###### Handle Single Parameter links ######\n\t\t\t\tif paramsHash.length == 1\n\t\t\t\t\tscount += 1\n\t\t\t\t\tparamz << line\n\t\t\t\t\tparamsHash.each do |key, value|\n\t\t\t\t\t\tif value =~ /\\d+/ #if value is numerical replace with number and then we unique ;)\n\t\t\t\t\t\t\ttestlink << line.sub(/#{value}/, '1') \n\t\t\t\t\t\telse\n\t\t\t\t\t\t\ttestlink << line #keep strings since they can be funky sometimes\n\t\t\t\t\t\tend\n\t\t\t\t\tend #finish cycle\n\n\t\t\t\telsif \"#{paramsHash.length}\".to_i > 1\n\t\t\t\t\t###### Handle Multi Parameter links ######\n\t\t\t\t\tmcount += 1\n\t\t\t\t\tparamz << line\n\t\t\t\t\t#Test each link and see if the parameter key has been logged or not, this way we only get unique paramter links ;)\n\t\t\t\t\tparamsHash.keys.each do |key|\n\t\t\t\t\t\tif test_keys.include?(key)\n\t\t\t\t\t\t\t#Do Nothing, its already included in our test_keys array!\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\t#Unique paramter, include key in test_key array and URL link in multi array for injector tests l8r\n\t\t\t\t\t\t\ttest_keys << key #so we dont catch anymore links with this parameter\n\t\t\t\t\t\t\tmulti << line.chomp #so we note the link for injection tests\n\t\t\t\t\t\tend\n\t\t\t\t\tend#end hash.key cycle\n\t\t\t\tend # parameter check looping\n\n\t\t\t###### Handle NO Parameter links ######\n\t\t\trescue NoMethodError\n\t\t\t\t# We really only need to check a few links without params to see if they throw errors (URL re-write type stuff hiding)\n\t\t\t\tnocount += 1\n\t\t\t\tif nocount < 10 # gives us up to 15 no parameter links to check, more than enough\n\t\t\t\t\tno_params << line\n\t\t\t\tend\n\n\t\t\t\t#Parse over links we're ditching & sort into appropriate results files (in case that info is needed for follow up l8r)\n\t\t\t\tif /\\/.+\\.pdf/i.match(line)\n\t\t\t\t\tpdfz << line.chomp\n\t\t\t\telsif /\\/.+\\.doc/i.match(line)\n\t\t\t\t\twordz << line.chomp\n\t\t\t\telsif /\\/.+\\.js|\\/.+\\.javascript/i.match(line)\n\t\t\t\t\tjsz << line.chomp\n\t\t\t\telsif /\\/.+\\.txt|\\/.+\\.rtf/i.match(line)\n\t\t\t\t\ttxtz << line.chomp\n\t\t\t\telsif /\\/.+\\.png|\\/.+\\.jpg|\\/.+\\.jpeg|\\/.+\\.gif|\\/.+\\.bmp|\\/.+\\.exif|\\/.+\\.tiff/i.match(line)\n\t\t\t\t\timagez << line.chomp\n\t\t\t\telsif /\\/.+\\.msg/i.match(line)\n\t\t\t\t\toutlookz << line.chomp\n\t\t\t\telsif /\\/.+\\.odt/i.match(line)\n\t\t\t\t\topendocz << line.chomp\n\t\t\t\telsif /\\/.+\\.csv|\\/.+\\.xlr|\\/.+\\.xls/i.match(line)\n\t\t\t\t\tspreadsheetz << line.chomp\n\t\t\t\telsif /\\/.+\\.pps|\\/.+\\.ppt/i.match(line)\n\t\t\t\t\tpptz << line.chomp\n\t\t\t\telsif /\\/.+\\.tar|\\/.+\\.zip|\\/.+\\.7z|\\/.+\\.cbr|\\/.+\\.deb|\\/.+\\.gz|\\/.+\\.bz|\\/.+\\.pkg|\\/.+\\.rar|\\/.+\\.rpm|\\/.+\\.sit/i.match(line)\n\t\t\t\t\tarchivez << line.chomp\n\t\t\t\telsif /\\/.+\\.vcf/i.match(line)\n\t\t\t\t\tvcardz << line.chomp\n\t\t\t\telsif /\\/.+\\.xml/i.match(line)\n\t\t\t\t\txmlz << line.chomp\n\t\t\t\telsif /\\/.+\\.m3u|\\/.+\\.m4a|\\/.+\\.mp3|\\/.+\\.mpa|\\/.+\\.wav|\\/.+\\.wma/i.match(line)\n\t\t\t\t\taudioz << line.chomp\n\t\t\t\telsif /\\/.+\\.avi|\\/.+\\.mov|\\/.+\\.mp4|\\/.+\\.mpg|\\/.+\\.srt|\\/.+\\.vob|\\/.+\\.wmv/i.match(line)\n\t\t\t\t\tvideoz << line.chomp\n\t\t\t\telsif /\\/.+\\.swf|\\/.+\\.flv/i.match(line)\n\t\t\t\t\tflashz << line.chomp\n\t\t\t\telsif /\\/.+\\.sql|\\/.+\\.accdb|\\/.+\\.db|\\/.+\\.mdb|\\/.+\\.pdb/i.match(line)\n\t\t\t\t\tdbz << line.chomp\n\t\t\t\telsif /\\/.+\\.apk|\\/.+\\.app|\\/.+\\.bat|\\/.+\\.cgi|\\/.+\\.exe|\\/.+\\.gadget|\\/.+\\.jar|\\/.+\\.pif|\\/.+\\.vbs|\\/.+\\.wsf/i.match(line)\n\t\t\t\t\texecutablez << line.chomp\n\t\t\t\telsif /\\/.+\\.bak|\\/.+\\.tmp|\\/.+\\.bk/i.match(line)\n\t\t\t\t\tbkupz << line.chomp\n\t\t\t\telsif /\\/.+\\.conf/i.match(line)\n\t\t\t\t\tconfz << line.chomp\n\t\t\t\telsif /\\/.+\\.passwd|\\/.+\\.htpasswd/i.match(line)\n\t\t\t\t\tpazz << line.chomp\n\t\t\t\telse\n\t\t\t\t\tnoparamz << line\n\t\t\t\tend\n\t\t\tend #End begin/rescue block\n\t\tend\n\n\t\t#make sure we dont have duplicates\n\t\tno_params = no_params.uniq\n\t\ttest_keys = test_keys.uniq\n\t\ttestlink = testlink.uniq\n\t\tmulti = multi.uniq\n\t\tinjtestlinks=[]\n\n\t\tputs \"[\".light_green + \"*\".white + \"] Crawler Results\".light_green + \": \".white\n\t\t#Write found NO parameter links to their own file just like everything else, just these dont fall into any group\n\t\tcount=0\n\t\tif not noparamz.empty?\n\t\t\tzfile=\"NO_paramaters\"\n\t\t\tnoparamz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\") #Open our file handle in write mode\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\") #Open our file handle in append mode\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\" #write the hits to file \n\t\t\t\tlostANDfound.close #close our file handle we opened a minute ago\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{noparamz.length} Links in total with NO paramaters in them\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not paramz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"paramater\"\n\t\t\tparamz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links in total with paramaters in them\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not jsz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"JS\"\n\t\t\tjsz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for JS Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not pdfz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"PDF\"\n\t\t\tpdfz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for PDF Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not wordz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"MS_WORD\"\n\t\t\twordz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for MS Word Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not txtz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"TEXT\"\n\t\t\ttxtz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for TEXT Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not outlookz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"OUTLOOK-MSG\"\n\t\t\toutlookz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for OUTLOOK-MSG Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not opendocz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"OpenDoc\"\n\t\t\topendocz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for OpenDoc Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not spreadsheetz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"SpreadSheet\"\n\t\t\tspreadsheetz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for SpreadSheet Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not pptz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"PowerPoint\"\n\t\t\tpptz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for PowerPoint Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not archivez.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"ARCHIVE\"\n\t\t\tarchivez.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for ARCHIVE Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not vcardz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"vCard\"\n\t\t\tvcardz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for vCard Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not xmlz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"XML\"\n\t\t\txmlz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for XML Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not audioz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"AUDIO\"\n\t\t\taudioz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for AUDIO Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not videoz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"VIDEO\"\n\t\t\tvideoz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for VIDEO Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not flashz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"FLASH\"\n\t\t\tflashz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for FLASH Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not dbz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"DATABASE\"\n\t\t\tdbz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for DATABASE Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not executablez.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"EXECUTABLES\"\n\t\t\texecutablez.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for EXECUTABLES Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not bkupz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"BackUp\"\n\t\t\tbkupz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for BackUp Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not confz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"CONFIG\"\n\t\t\tconfz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for CONFIG Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not pazz.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"PASSWORDS\"\n\t\t\tpazz.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for PASSWORDS Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tif not imagez.empty?\n\t\t\tcount=0\n\t\t\tzfile=\"IMAGE\"\n\t\t\timagez.each do |line|\n\t\t\t\tif count.to_i < 1\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"w+\")\n\t\t\t\t\tcount = count.to_i + 1\n\t\t\t\telse\n\t\t\t\t\tlostANDfound = File.new(\"#{rezDir}#{zfile}.links\", \"a+\")\n\t\t\t\tend\n\t\t\t\tlostANDfound.puts \"#{line.chomp}\"\n\t\t\t\tlostANDfound.close\n\t\t\tend\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{paramz.length} Links for IMAGE Files\".light_green + \": #{rezDir}#{zfile}.links\".white\n\t\tend\n\t\tputs \"[\".light_green + \"*\".white + \"] Other Info\".light_green + \".....\".white\n\t\tif not test_keys.empty?\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{test_keys.length} Testable Parameters\".light_green + \": \".white\n\t\t\tputs \"[\".light_green + \"*\".white + \"] \".light_green + \"#{test_keys.join(', ').to_s}\".white\n\t\tend\n\t\tif not testlink.empty?\n\t\t\t#print single parameter links we will test\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{testlink.length} Unique Single Parameter Links (out of #{scount} total)\".light_green + \": \".white\n\t\t\ttestlink.each do |line|\n\t\t\t\tputs \"\\t#{line.chomp}\".white\n\t\t\t\tinjtestlinks << line\n\t\t\tend\n\t\tend\n\t\tif not multi.empty?\n\t\t\t#print multi parameter links we will test\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{multi.length} Unique Multi Parameter Links (out of #{mcount} total)\".light_green + \":\".white\n\t\t\tmulti.each do |line|\n\t\t\t\tputs \"\\t#{line.chomp}\".white\n\t\t\t\tinjtestlinks << line\n\t\t\tend\n\t\tend\n\t\tif not no_params.empty?\n\t\t\tif no_params.length < 9\n\t\t\t\tputs \"[\".light_green + \"*\".white + \"] Found the following NO Parameter links\".light_green + \": \".white\n\t\t\t\tnopam = no_params\n\t\t\telse\n\t\t\t\tputs \"[\".light_green + \"*\".white + \"] 10 random No Parameter Links (out of #{nocount} total)\".light_green + \": \".white\n\t\t\t\tnopam = no_params.sort_by{rand}[0..9]\n\t\t\tend\n\t\t\t#print no parameter links we will test\n\t\t\tnopam.each do |line|\n\t\t\t\tputs \"\\t#{line.chomp}\".white\n\t\t\t\tinjtestlinks << line\n\t\t\tend\n\t\tend\n\t\tif not injtestlinks.empty?\n\t\t\t#Write the suggested testable links to their own file for use with other tools\n\t\t\tf = File.new(\"#{rezDir}testable.links\", \"w+\")\n\t\t\tinjtestlinks.each do |link|\n\t\t\t\tf.puts link\n\t\t\tend\n\t\t\tf.close\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Suggested Testable Links\".light_green + \": #{rezDir}testable.links\".white\n\t\tend\n\t\t#Display the emails found now....\n\t\tif not @emails_array.empty?\n\t\t\t@emails_array.uniq!\n\t\t\tf=File.open(\"#{rezDir}temp.emails\", 'w+')\n\t\t\t@emails_array.each do |email|\n\t\t\t\tf.puts email\n\t\t\tend\n\t\t\tf.close\n\t\t\t#Because Ruby built-in uniq function doesn't seem to be fully doing the job we use some OS magic to make sure it is unique emails only....\n\t\t\tsystem(\"cat #{rezDir}temp.emails | sort -u > #{rezDir}emails.txt\")\n\t\t\tcount=`wc -l #{rezDir}emails.txt | cut -d' ' -f1`\n\t\t\tFileUtils.rm(\"#{rezDir}temp.emails\")\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Found #{count} emails while crawling\".light_green + \"....\".white\n\t\t\tputs \"[\".light_green + \"*\".white + \"] Find them here\".light_green + \": #{rezDir}emails.txt\".white\n\t\tend\n\tend",
"def make_new_searches\n\t\n\turl = \"/Users/MichaelB/Documents/TenTracks/artists.html\"\n\t\n\t\n\tdoc = Nokogiri::HTML(open(url))\n\tbands_array = doc.css(\"h1\")\n\ti=259\n\t#Rails.logger.debug(i)\n\t\n\twhile i < bands_array.length or i < 10\n\t\n\tRails.logger.debug(i)\n\tRails.logger.debug(bands_array[i].content)\n\t\n\ttest = EventSearch.where(:bandName => bands_array[i].content)\n\t\n\tif !test[0]\n\t\n\tes = EventSearch.new\n\tes.bandName = bands_array[i].content\n\t\n\tband_search = bands_array[i].content.split(' ').join(\"+\")\n\t\n\turl2 = \"http://www.myspace.com/search/music?q=\" << band_search << \"&ac=t\"\n\t#Rails.logger.debug(url2)\n\t\n\tif validate(url2)\n\tdoc2 = Nokogiri::HTML(open(url2))\n\tband_url_array = doc2.css(\".beacon .beacon\")\n\t\n\t\tif band_url_array[0]\n\t\t\tRails.logger.debug(band_url_array[0][:href])\n\t\t\tes.urlOne = band_url_array[0][:href]\n\t\t\tes.eventDateCSS = \".entryDate\"\n\t\t\tes.eventLocationCSS = \"#module9 a\"\n\t\t\tes.descriptionCSS = \"#module9 p\"\n\t\telse\n\t\tRails.logger.debug(\"Invalid myspace link\")\n\t\tes.urlOne = \"Invalid myspace link\"\n\t\tend\n\t\n\telse\n\tRails.logger.debug(\"Invalid myspace link\")\n\tes.urlOne = \"Invalid myspace link\"\n\t\n\tend # of validate\n\t\n\tes.save\n\t\n\tend #of test\n\t\n\ti += 1\n\tend # of while\n\t\n end",
"def resort_scraper\nstates = [\"CO\", \"CA\", \"WY\", \"ID\", \"MT\", \"NY\", \"UT\", \"VT\", \"WA\"]\n states.map do |state|\n url = \"https://opensnow.com/state/#{state}#forecasts\"\n unparsed_page = HTTParty.get(url)\n parsed_page = Nokogiri::HTML(unparsed_page)\n resorts_array = Array.new\n all_resorts = parsed_page.css('div.compare-item')\n all_resorts.each do |resort|\n resort = {\n state_id: states.index(state) + 1, \n name: resort.css('div.title-location').text\n }\n resorts_array << resort\n end \n resorts_array.each do |resort|\n Resort.create(resort)\n puts \"creating #{resort[:name]}\" \n end \n end\nend",
"def search_a1books(query,type)\n #@@logger.info(\"Search a1books..\")\n #@@logger.info(query)\n mtype= type[:search_type]\n\n #@@logger.info(mtype)\n\n prices=[]\n if mtype != 'books' then\n #@@logger.info ('----------------Ignoring search on a1books---------------------------------------------')\n price_info = {:price=> -999, :author=> 'fake',:name=>'fake', :img => 'fake', :url => 'fake', :source=>'Rediff', :weight => -999}\n prices.push(price_info)\n return prices\n end\n url =\"http://www.a1books.co.in/searchresult.do?searchType=books&keyword=#{query[:search_term]}&fromSearchBox=Y&partnersite=a1india&imageField=Go\"\n page = self.fetch_page(url)\n\n begin\n price_text = page.search(\"span.salePrice\").map { |e| \"#{e.text.tr('A-Za-z,','')}\" }\n name_text = page.search(\"table.section a.label\").map{ |e| \"#{e.text}\" }\n author_text = page.search(\"table.section td[@width='100%']\").map{ |e| \"#{e.text}\" }\n url_text = page.search(\"table.section a.label[@href]\").map{|e| e['href'] }\n discount_text =\"\" \n shipping_text =\"\"\n \n \n (0...price_text.length).each do |i|\n author = author_text[i]\n name = name_text[i].strip\n search_index = author.index(name) \n if search_index != nil then \n author = author[search_index+name.length..author.length]\n end\n if (name_text[i] == nil && author != nil) then\n weight,cost = find_weight(author, \"#{query[:search_term]}\" )\n elsif (name_text[i] !=nil && author == nil) then\n weight,cost = find_weight(name_text[i], \"#{query[:search_term]}\" )\n else\n weight,cost = find_weight(name_text[i]+\" \"+author, \"#{query[:search_term]}\" )\n end \n if (weight > 0) then\n price_info = {:price => price_text[i],:author=>proper_case(author), :name=>proper_case(name_text[i]), :img=>\"\",:url=>\"http://a1books.co.in\"+url_text[i], :source=>'A1Books', :weight=>weight, :discount=>discount_text, :shipping => shipping_text} \n prices.push(price_info)\n end\n end\n rescue => ex\n #Just ignore this error\n #@@logger.info (\"#{ex.class} : #{ex.message}\")\n end\n prices\n end",
"def build_candidates\n doc = Nokogiri::HTML(open(\"http://www.google.com/search?q=#{query}&num=30\"))\n doc.xpath('//div/cite').each do |node|\n @candidates << Sanitize.clean(node)\n end\n\n @candidates = @candidates.collect{|c| c if c.include?(\"http\") && (c.include?(\"youtube.com\") || c.include?(\"soundcloud.com\") || c.include?(\"bandcamp.com\")) }.compact\n\n #replace each with url, score, and title\n set = []\n\n @candidates.each do |c|\n if c.include?(\"youtube\")\n set << get_youtube(c)\n elsif c.include?(\"soundcloud\")\n set << get_soundcloud(c)\n elsif c.include?(\"bandcamp\")\n set << get_bandcamp(c)\n end\n end\n\n @candidates = set\n @candidates.sort!{|x,y| y[:score] <=> x[:score]}\n puts @candidates.count\n end",
"def data(boards, team, is_string)\n\n s1 = Set.new\n\n response = Net::HTTP.get(URI.parse('http://futisforum2.org/index.php?action=.xml;type=rss2;boards=' +\n boards +\n ';limit=255'))\n\n feed = RSS::Parser.parse response\n\n feed.items.each do |item|\n\n if item.title.include? team\n\n body = Net::HTTP.get(URI.parse(item.link)).to_s.gsub!('<br />', ' ').strip\n\n # Funny encoding hack...\n body.force_encoding('iso-8859-1')\n body = body.encode(\"UTF-16be\", :invalid=>:replace, :replace=>\"?\").encode('UTF-8')\n body.to_s.gsub!('', '€')\n\t\t\t\tbody.to_s.gsub!('', '\"')\n\n document = Oga.parse_html(body)\n\n document.css('div.post div.quote').each do |quote|\n quote.replace('\"' + quote.text.strip + '\" - ')\n end\n\n document.css('div.post div.quoteheader').each do |quote|\n quote.replace(\"\")\n end\n\n document.css('div.post a').each do |link|\n\t\t\t\t #puts link.attributes[0]\n\t\t\t\t\t#puts link.text\n link.replace(link.attributes[0].to_s)\t\t\t\t\t\n end\n\n document.css('div.post ul').each do |l|\n document.css('li').each do |x|\n x.replace(' ' + x.text + ', ')\n end\n end\n\n document.css('div.post').each do |person|\n\n if is_string == true\n s1.add(person.text + \" ||| \")\n else\n s1.add(person.text)\n end\n\n #puts '-' * 40\n end\n\n break\n\n else\n # DO SOMETHING LATER\n end\n\n end\n return s1\n end",
"def initialize(username , limit)\n @username = username\n @limit = limit\n #pass only the username into methods so we generate the urls we need as we scrape them\n #dont call the next method here, use the object created in its place of creaton\n #to call further scraping methods class methods\n end",
"def scrape(url)\n\t\n $log.info \"START #{__FILE__}.#{__method__}\"\n\t\n \n def initialize \n super ARGV[0],\"groupon\"\n end\n \n begin\n html = open(url)\n doc = Nokogiri::HTML(html.read)\n doc.encoding = \"utf-8\"\n $log.info \"Open url : #{url}\"\n\n $log.info \"Fetching from : #{url}\"\n \n title \t\t= doc.at_xpath($deal_config[$site_name][\"title\"])\n deal_url\t= URI.parse(url)\n price \t\t= doc.at_xpath($deal_config[$site_name][\"price\"])\n location \t= doc.at_xpath($deal_config[$site_name][\"location\"])\n sold \t\t= doc.at_xpath($deal_config[$site_name][\"sold\"])\n items\t\t= doc.at_xpath($deal_config[$site_name][\"items\"])\n category\t= doc.at_xpath($deal_config[$site_name][\"category\"])\n deal_thumb\t= doc.at_xpath($deal_config[$site_name][\"deal_thumb\"])['src']\n description = doc.at_xpath($deal_config[$site_name][\"description\"]) \n discount = doc.at_xpath($deal_config[$site_name][\"discount\"])\n expiry = doc.at_xpath($deal_config[$site_name][\"expiry\"])['value'] \n city = doc.at_xpath($deal_config[$site_name][\"location_city\"])\n\n # check if there is an imagemap\n # if so, insert latitude and longitude\n # else try geocoding\n image_map = doc.at_xpath($deal_config[$site_name][\"image_map\"])\n lat = nil\n long = nil\n if !image_map.nil? && image_map.to_s != \"\"\n uri = URI.parse(URI.encode(image_map['src']))\n uri_params = CGI.parse(uri.query)\n if !uri_params[\"center\"].nil?\n lat, long = uri_params[\"center\"][0].chomp.split(',')\n end\n \n else\n # geocode address\n loc=GeoKit::Geocoders::MultiGeocoder.geocode(location.content.to_s.strip) \n if !loc.success\n #if loc.lat.nil?\n lat = nil \n long = nil\n elsif loc.success\n lat = loc.lat\n long = loc.lng\n end\n end\n \t\t\n $arr_deals << Deal.new(title, deal_url, deal_thumb, price, location, sold, items, category, description, lat, long, discount)\n \n # set the following to site name\n $arr_deals[-1].author = $deal_config[$site_name][\"author\"]\n \n # specialized code for expiry\n time = Time.now + expiry.to_i/1000\n $arr_deals[-1].expiry = time.strftime(\"%Y-%m-%d %H:%M:%S\")\n \n # add city to location 20120328\n cit = city.content.to_s.strip\n $arr_deals[-1].location += \", #{cit}\"\n # puts $arr_deals[-1].location\n \n # print ...\n #\t\tputs \"#{$arr_deals[-1].title} \\n\"\n #\t\tputs \"#{$arr_deals[-1].price} \\n\"\n #\t\tputs \"#{$arr_deals[-1].sold} \\n\"\n # \tputs \"#{$arr_deals[-1].items} \\n\"\n #\t\tputs \"#{$arr_deals[-1].location} \\n\"\n #\t\tputs \"#{$arr_deals[-1].deal_url} \\n\"\n #\t\tputs \"#{$arr_deals[-1].deal_thumb} \\n\"\n #\t\tputs \"#{$arr_deals[-1].category} \\n\"\n #\t\tputs \"#{$arr_deals[-1].description} \\n\"\n #\t\tputs \"#{$arr_deals[-1].latitude} \\n\"\n #\t\tputs \"#{$arr_deals[-1].longitude} \\n\"\n #\t\tputs \"#{$arr_deals[-1].discount} \\n\"\n\n $insert_number += 1\n puts \"inserting deal #{$insert_number}...\"\n $db.insert_deal($arr_deals[-1])\n \n $log.info \"Successfully retrieved data : #{url}\"\n\n rescue Exception=>e\n\t\n print \"Could not retrieve values. Maybe the site has changed?\"\n $log.error e.to_s\n puts e.to_s\n\t\t\n end\n\t\n $log.info \"END #{__FILE__}.#{__method__}\"\n\t\n end",
"def crypto_scrapper ()\r\n url = \"https://coinmarketcap.com/all/views/all/\"\r\n page_inspect = URI.open(url)\r\n page_inspected = Nokogiri::HTML(page_inspect)\r\n page_inspected.xpath('//a[contains(@href, \"/currencies\")]').each do |crypto|\r\n \r\n crypto = crypto.text\r\n B << crypto\r\n end\r\n #puts B.to_s\r\nend",
"def benchmark(s1, s2)\n puts \"s1=#{s1}\"\n puts \"s2=#{s2}\"\n puts \n \n start_time = Time.now\n #match = number_match(s1, s2)\n match = slide_cache(s1, s2)\n duration = Time.now - start_time\n \n puts \"Slide match: #{match}\"\n puts \"Took: #{(duration * 1000).round(5)}ms\"\n puts\n \n=begin \n start_time = Time.now\n a1 = build_substrings(s1)\n a2 = build_substrings(s2)\n match = find_longest_match(a1, a2)\n duration = Time.now - start_time\n \n puts \"Table match: #{match}\"\n puts \"Took: #{duration * 1000}ms\"\n=end \nend",
"def parse_search_results(page)\n libraries_available = []\n links = page.css(\"ol[class=result] li[class=clearfix] h3 a\")\n links.each do |link|\n fetch_result = fetch(\"#{LIBRARY_BASE_URL + (link.attr 'href')}\")\n body = Zlib::GzipReader.new(StringIO.new(fetch_result[:response].body)).read\n libraries_available.concat parse_detail(body)\n\n # should we go to the next link? do we already know if it's available at our library?\n if libraries_available.include? LIBRARY_MY_STRING; return [LIBRARY_MY_STRING] end\n end\n\n libraries_available\nend",
"def scrape_articles\n age_import=AgeImporter.new(self.start_date,self.end_date)\n age_import.scrape_article\n sun_import=SunImporter.new(self.start_date,self.end_date)\n sun_import.scrape_article\n nyt_import=NytImporter.new(self.start_date,self.end_date)\n nyt_import.scrape_article\n\n\n\n abc_import=AbcImporter.new(self.start_date,self.end_date)\n abc_import.scrape_article\n\n smh_import=SmhImporter.new(self.start_date,self.end_date)\n smh_import.scrape_article\n\n sbs_import=SbsImporter.new(self.start_date,self.end_date)\n sbs_import.scrape_article\n end",
"def get_all_the_urls_of_val_doise_townhalls (web_list)\npage = Nokogiri::HTML(RestClient.get(web_list))#recupere le code html du site\npage.css(\"a.lientxt\").each do |note|\nnote['href'] = note['href'][1..-1]#donne les urls de chaque commune en retirant le premier caractaire c-a-d \".\"\nweb_page = \"http://annuaire-des-mairies.com\" + note['href']\nputs web_page\nget_the_email_of_a_townhal_from_its_webpage(web_page)#rappel la fonction get_the_email_of_a_townhal_from_its_webpage pour recuperer les adresses emails grace aux liens (fonctions recurssive)\nend\nend",
"def get_pages(count, page_array)\n count ||= 1\n page_array ||= []\n scraper = Mechanize.new\n base_url = \"https://www.goodreads.com/author/quotes/24956.Dorothy_Parker?page=#{count}\"\n page = scraper.get(base_url)\n if !page.search('div.quoteText').empty?\n page_array.push(page)\n count += 1\n get_pages(count, page_array)\n else\n puts \"Found #{page_array.length} pages of Dorothy Parker quotes.\"\n end\n page_array\nend",
"def scrape_job_listings\n queries = [\"Rails+Developer\", \"front+end+Developer\", \"ruby+developer\", \"junior+web+Developer\", \"javascript+Developer\"]\n locations = [\"San+Francisco\"]\n\n locations.each do |location|\n queries.each do |query|\n scrape_indeed(query, location)\n scrape_github(query, location)\n # scrape_glassdoor(query, location)\n ; scrape_careerbuilder(query, location)\n end\n end\nend",
"def extracthref(serps)\n split_array=[]\n #go through the serps NodeList one by one and extract the href attribute of the anchor tags\n (0..serps.length-1).each {|i|\n serps_url = serps[i]['href']\n #remove junk that Google appends before and after the end of the returned search result pages\n #using a funky regular expression and push it into a new array\n split_array.push(serps_url.split(/(http.*?)(?=&)/))\n }\n #delete the junk in the array before the element we need\n (0..serps.length-1).each {|i|\n split_array[i].delete_at(0)\n }\n #delete the junk in the array after the element we need (note all elements have moved index by one)\n #due to the last function\n (0..serps.length-1).each {|i|\n split_array[i].delete_at(1)\n }\n split_array\nend",
"def make_cards\n #14 restuarants\n scrape_cards.each do |res|\n binding.pry\n ResInfo::Restaurant.new_from_scraper(res)\n end\n end",
"def bs\n [\n [\"реализации\", \"использовать\", \"интеграция\", \"рационализации\", \"оптимизация\", \"развиваться\", \"преобразовать\", \"объятия\", \"включить\", \"организовать\", \"рычаг\", \"изобретать\", \"агрегат \",\" архитектор \",\" повысить \",\" стимулирования \",\" морфинг \",\" расширение прав и возможностей \",\" envisioneer \",\" монетизировать \",\" запрягать \",\" содействовать \",\" захват \",\" disintermediate\", \"развернуть\", \"бренд\", \"расти\", \"цель\", \"синдикат\", \"синтез\", \"доставить\", \"сетка\", \"высиживать\", \"заниматься\", \"максимально\", \" увидеть \",\" перепрофилирование \",\" инновации \",\" масштаб \",\" развязать \",\" драйв \",\" расширить \",\" инженер \",\" революцию \", \"генерировать\", \"эксплуатировать\", \"переход\", \"д включить\", \"перебора\", \"возделывать\", \"матрица\", \"пересмотреть\"].rand,\n [\"кликов и минометных\", \"добавленную стоимость\", \"вертикальная\", \"активный\", \"надежный\", \"революционный\", \"масштабируемый\", \"передовые\", \"инновационный\", \"интуитивной\"].rand,\n [\"взаимодействие\", \"веб-готовность\", \"парадигм\", \"рынки\", \"партнерские\", \"инфраструктура\", \"платформ\", \"инициатив\", \"каналы\", \"глаза\", \"общины\", \"рентабельность\", \"решения\", \"интернет-магазинах», «электронных услуг», «действие пунктов\", \"порталы\", \"ниши\", \"технологии\", \"содержание\"].rand\n ].join(' ')\n end",
"def get_all_the_urls_of_val_doise_townhalls\n\n\n page1 = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\")) #ouvre la page ciblée\n $get_llinks = page1.css('a[href*=\"95\"]').map{|link| link[\"href\"]} #definie un array \"get_llinks\" cible la balise avec href 95 et prend toutes les fin d'url\n\n\nend",
"def get_all_the_urls_of_val_doise_townhalls\n\n\n page1 = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\")) #ouvre la page ciblée\n $get_llinks = page1.css('a[href*=\"95\"]').map{|link| link[\"href\"]} #definie un array \"get_llinks\" cible la balise avec href 95 et prend toutes les fin d'url\n\n\nend",
"def initialize(a, b)\n\t\t\t@a_words = []\n\t\t\t@b_words = []\n\t\t\t@differences = []\n\t\t\n\t\t\trun_diff(a, b)\n\t\tend",
"def scrape\n Job.reset\n puts 'Enter a URL to scrape (or press enter for default):'\n url = gets.strip\n url = 'https://news.ycombinator.com/item?id=16052538' if url == ''\n puts \"Scraping...\\n\\n\"\n jobs_data = Scraper.scrape(url)\n jobs_data.each_with_index do |job_data, i|\n job = Job.new(job_data.merge({id: i+1}))\n end\n puts list\n end",
"def parse_multiple_search_results(page)\n companies = []\n rows = page.body.split('<tr class=\\'alt')\n rows.shift\n rows.each do |row|\n company = {\n 'name' => '',\n 'id' => '',\n 'records' => ''\n }\n company['name'] = row.split('<a class=\\'nowrap\\' title=\\'')[1].split('\\' href=')[0]\n company['id'] = row.split('\\' href=\\'/id')[1].split('/')[0].to_i\n company['records'] = row.split('=showCompDir&\\'>')[1].split('</a>')[0]\n companies << company\n end\n return companies\nend",
"def start_scrapping\n query = ARGV.first\n\n if query.nil?\n puts \"Lo estas haciendo mal!\"\n puts \"Sintaxis: ruby scrapper.rb query --filter [free|paid] --sort [relevance|popularity]\"\n else\n filter = \"no_filter\"\n sort = nil\n pages = 2\n start_time = Time.now\n sort = \"relevance\"\n\n filter = ARGV[(ARGV.index \"--filter\") + 1] unless (ARGV.index \"--filter\").nil?\n sort = ARGV[(ARGV.index \"--sort\") + 1] unless (ARGV.index \"--sort\").nil?\n pages = ARGV[(ARGV.index \"--pages\") + 1].to_i unless (ARGV.index \"--pages\").nil?\n\n apps = search(query, {:filter => filter, :sort => sort, :pages => pages})\n\n puts \"\"\n puts \"Obteniendo datos de las aplicaciones.\"\n puts \"\"\n\n apps.each do |app|\n print \"#{app.name} \"\n prev_time = Time.now\n obtain_app_details app\n print \"(#{Time.now-prev_time} s)\"\n puts \"\"\n end\n\n open(\"#{query}-apps.csv\", \"a\") { |f|\n f.puts \"Nombre,Url,Precio,DwnMin,DwnMax,DwnAvg,Espacio\"\n\n apps.each do |app|\n f.puts \"#{app.name},#{app.url},#{app.price},#{app.downloads_min},#{app.downloads_max},#{app.downloads_avg},#{app.size}\"\n end\n }\n\n puts \"\"\n puts \"Finalizado en #{Time.now - start_time} s\"\n end\n\nend",
"def scrape_stars_and_director\n\t\t@stars = @stars_section.map {|s| Star.new({fullname: s.text, url: s['href']}) }\n\t\t@director = Director.new(fullname: @director_section.text, url: @director_section['href'])\n\tend",
"def scrape_table(page)\n page.css('.listing_content').collect do |x|\n record = {}\n record['Business'] = x.css('.business-name a').text\n record['Address'] = x.css('.street-address').text.sub(/,[\\s]*/, '') || \"not listed\"\n record['City'] = x.css('.locality').text || \"not listed\"\n record['State'] = x.css('.region').text || \"not listed\"\n record['Zipcode'] = x.css('.postal-code').text || \"not listed\"\n record['Phone'] = x.css('.business-phone').text || \"not listed\"\n\n ## collect secondary info\n url = x.at_css('.business-name a').attribute(\"href\")\n page2 = Nokogiri::HTML(open(url))\n ext_record = scrape_page2(page2)\n \n record.merge!(ext_record)\n ScraperWiki.save([\"Business\"], record)\n end\nend",
"def scrape_table(page)\n page.css('.listing_content').collect do |x|\n record = {}\n record['Business'] = x.css('.business-name a').text\n record['Address'] = x.css('.street-address').text.sub(/,[\\s]*/, '') || \"not listed\"\n record['City'] = x.css('.locality').text || \"not listed\"\n record['State'] = x.css('.region').text || \"not listed\"\n record['Zipcode'] = x.css('.postal-code').text || \"not listed\"\n record['Phone'] = x.css('.business-phone').text || \"not listed\"\n\n ## collect secondary info\n url = x.at_css('.business-name a').attribute(\"href\")\n page2 = Nokogiri::HTML(open(url))\n ext_record = scrape_page2(page2)\n \n record.merge!(ext_record)\n ScraperWiki.save([\"Business\"], record)\n end\nend",
"def scrap\n\n page = Nokogiri::HTML(open(\"https://apkpure.co/\"))\n\n @text = []\n @images= []\n @download_button_name = []\n @download_links = []\n @all_website_urls = []\n\n # name\n\n page.css('div.main div.box ul.top-list dl .title-dd a').each do |el|\n @text << el.text\n end\n\n\n # icon images\n\n page.css('div.main div.box ul.top-list dl dt img').each do |el|\n @images << el['src']\n end\n\n @images.each do |image|\n File.open(\"#{Rails.root}/scrape_data/#{image.split('/').last}\", \"wb\") do |f|\n f.write(open(image).read)\n end\n\n end\n\n # on this page(https://apkpure.co/) download links are not present, insted of download links only name are present\n\n page.css('div.main div.box ul.top-list dl .down a').each do |el|\n @download_button_name << el[\"href\"]\n end\n\n # fetch all download links of clash-of-clans on (https://apkpure.co/clash-of-clans/) this url\n\n Nokogiri::HTML(open(\"https://apkpure.co/clash-of-clans/\")).css('.faq_cat dl dd .down').each do |el|\n @download_links << el[\"href\"]\n end\n\n # All website urls\n\n Nokogiri::HTML(open(\"https://apkpure.co/\")).css('a').each do |el|\n @all_website_urls << el[\"href\"].to_s\n end\n\n # puts Text =\"#{@text}\", Images= \"#{@images}\", Download_button_name = \"#{@download_button_name}\", Download_links = \"#{@download_links}\", All_Website_url = \"#{@all_website_urls}\"\n\n\n CSV.open(\"/#{Rails.root}/scrape_data/csv_file/file.csv\", \"wb\") do |csv|\n csv << [\"Text\", \"Images\", \"Download_button_name\", \"Download_links\", \"All_Website_url\"]\n (0..@text.length).each do |index|\n csv << [@text[index], @images[index], @download_button_name[index], @download_links[index], @all_website_urls[index]]\n end\n end\n redirect_to :back\n\n end",
"def googleNewsSearch(name, mins = 720)\n\n type = \"\"\n theRep = Rep.all\n puts \"THE REP! : #{theRep}\"\n if Rep.where(name: name)[0].json.index(\"senate\") != nil\n type = \"Sen\"\n else\n type = \"Rep\"\n end\n\n # fix the name -- so if there is 'ç' or some weird\n # character like that, it turns into 'c'\n name = ActiveSupport::Inflector.transliterate(name)\n query = \"%22#{type} #{name}%22\"\n query.gsub!(\" \", \"%20\")\n\n link = \"https://www.google.com/search?q=#{query}&tbm=nws&tbs=qdr:n#{mins}\"\n file = open(link)\n document = Nokogiri::HTML(file)\n puts document.class\n titles = document.css('h3 > a')\n urls = document.css('h3 > a')\n excerpts = document.css('.st')\n dates = document.css('div.slp > span.f')\n\n\n\n articles = []\n for i in 0..(titles.length - 1)\n article_info = {}\n article_info[\"title\"] = cleanString(titles[i].text)\n article_info['url'] = cleanUrl(urls[i].attr('href'))\n article_info['excerpt'] = cleanString(excerpts[i].text)\n article_info['date'] = cleanDate(dates[i].text)\n articles << article_info\n end\n\n return articles\nend",
"def scrape_1_page(page)\n p \"scraping a page\" #{link.href}\" \n blog_date_1 = nil #the first part of the pubDate field goes into here\n blog_body = nil #the body text goes here\n blog_date_2 = nil #the second part of the pubDate field goes into here\n comments_arr = nil #temporary storage for comments before they get added to main document\n \n #select on td id=maincontent\n page.search('#maincontent')[0].each_child{ |child|\n \n if @max_blog_entries != nil and @curr_blog_entries >= @max_blog_entries\n @completed = true\n p \"reached max_blog_entries=#{@max_blog_entries}\"\n return\n end\n \n if child.search('.blogheader').length != 0\n blog_date_1 = convert_xanga_header_to_wordpress_date(child.inner_html)\n p \"blog head #{blog_date_1}\" \n #this is first part of date-time\n\n elsif child.search('.blogbody').length != 0\n #TODO: extract comments, number of views for blog\n \n #this is body of the blog\n blog_body = sanitize_blog_body(child.search(\"td\")[1].inner_html)\n \n p \"blog body=#{blog_body}\"\n \n #extract the date of blog for archiving purposes\n #inside class blogbody, lives a class smalltext, and we want the inner_html of the second <a href> tag\n blog_date_2 = convert_to_usable_time(child.search('.blogbody')[0].search('.smalltext')[0].search(\"a\")[1].inner_html)\n \n #create teh new document out of blogheader and blogfooter\n doc = create_new_xml_blog( blog_body, blog_date_1 + blog_date_2 )\n \n #catch comments here\n #inside class blogbody, lives a class smalltext, and we want the inner_html of the fifth <a href> tag\n if child.search('.blogbody')[0].search('.smalltext')[0].search(\"a\")[4].inner_html != \"add comments\"\n comments_arr =scrape_comments( Hpricot::Elements[ child.search('.blogbody')[0].search('.smalltext')[0].search(\"a\")[4] ].attr(\"href\") )\n comments_arr.each { |comment| \n doc.search(\"item\").append(comment.inner_html.to_s)\n #p \"adding comment here #{comment.inner_html.to_s}\"\n }\n #dump_page(doc)\n end\n\n #add resulting document to the @doc object already created\n @doc.search(\"channel\").append(doc.inner_html.to_s) \n\n @curr_blog_entries += 1\n end\n \n }\n end",
"def scraper\r\n driver = Selenium::WebDriver.for :firefox\r\n url = 'file:///c:/Users/alaett/Desktop/serpapi/files/van-gogh-paintings-updated.html'\r\n file = driver.get(url)\r\n doc = Nokogiri::HTML((driver.page_source))\r\n container = []\r\n paintings_container = doc.css('div.EDblX.DAVP1')\r\n max_val = doc.css('div.EDblX.DAVP1').children.count()\r\n for item in 0..max_val -1 # should be -2 with van-gogh-paintings.html\r\n\r\n=begin \r\n \r\nI have to -2 from max_val with git van-gogh file.\r\n\r\nThis code misses one item with newer files. \r\n\r\nBosch, Dali and updated Gogh all work with max_val -1.\r\n\r\n \r\n=end\r\n artworks = Hash.new\r\n begin\r\n artworks['name'] = paintings_container.css('a.MiPcId.mlo-c')[item]['aria-label']\r\n artworks['extensions'] = [paintings_container.css('a.MiPcId.mlo-c')[item].css('div.ellip.klmeta').children.text]\r\n artworks['link'] = 'https://www.google.com' + paintings_container.css('a.MiPcId.mlo-c')[item]['href']\r\n artworks['image'] = paintings_container.css('img')[item].values[1] \r\n rescue\r\n artworks['name'] = paintings_container.css('div.MiPcId').css('a.klitem')[item]['aria-label']\r\n artworks['extensions'] = [paintings_container.css('div.MiPcId').css('a.klitem')[item].css('div.ellip.klmeta').children.text]\r\n artworks['link'] = 'www.google.com' + paintings_container.css('div.MiPcId').css('a.klitem')[item]['href']\r\n artworks['image'] = paintings_container.css('img')[item].values[2]\r\n end\r\n container << artworks\r\n end\r\n File.open(\"files/expected_array.json\",\"w\") do |f|\r\n f.write('\"artworks\": ')\r\n f.write(JSON.pretty_generate(container))\r\n end\r\n byebug\r\nend",
"def crawler_items\n crawler_data.css('.sresult')\n end",
"def scrape(site)\n base_url = \"#{site}/page/\"\n\n url_list = Array.new\n post_links = Array.new\n\n # Grabbing all the pages\n (1..14).each do |i|\n url_list << base_url + i.to_s\n puts \"Getting page \" + i.to_s\n end\n\n # Going through individual pages\n url_list.each do |page|\n doc = Nokogiri::HTML(open(page))\n\n # Getting post links, make sure to check the HTML <==================== CHANGE THIS ===========================\n doc2 = doc.css('h2.entry-title a')\n\n doc2.each do |link|\n puts 'Collecting link ' + post_links.count.to_s\n post_links << link['href']\n end\n end\n\n puts \"Finished with getting all the links\"\n\n CSV.open(\"derek-halpern-wp.csv\", \"wb\") do |csv|\n csv << [\"Title\", \"Link\", \"Date\", \"Comments\", \"Likes\", \"Tweets\", \"LinkedIn\", \"Pins\", \"+ 1's\"]\n \n post_links.each_with_index do |post, index|\n\n share_counts = \"http://api.sharedcount.com/?url=#{post}\"\n resp = (Net::HTTP.get_response(URI.parse(share_counts))).body\n result = JSON.parse(resp, :symbolize_names => true)\n\n fb = result[:Facebook][:total_count]\n tw = result[:Twitter]\n ln = result[:LinkedIn]\n pin = result[:Pinterest]\n gp = result[:GooglePlusOne]\n\n post_page = Nokogiri::HTML(open(post))\n\n # Make sure the post headline follows this structure <==================== CHANGE THIS ===========================\n post_title = post_page.css('h1.entry-title').text\n \n # Make sure the comments follow this structure <==================== CHANGE THIS ===========================\n post_comments = post_page.css('#comments_intro').text.to_i\n\n #post_date = post_page.css('.meta .signature').text\n #find_comments = post_page.xpath('//*[@id=\"comments\"]/comment()').text\n #convert_to_ng = Nokogiri::HTML.parse(find_comments)\n #post_comments = convert_to_ng.css('h2').text.to_i\n\n puts \"Scraping post \" + index.to_s + \"/\" + post_links.length.to_s\n\n csv << [\"#{post_title}\", \"#{post}\", \"#{post_date}\",\"#{post_comments}\", \"#{fb}\", \"#{tw}\", \"#{ln}\", \"#{pin}\", \"#{gp}\"]\n end\n end\nend",
"def get_books\n unless self.scraped\n page = Nokogiri::HTML(open(self.url), nil, \"iso-8859-1\")\n item_elements = page.css(\".g-span7when-wide\")\n item_elements.each do |item|\n book_data = {}\n book_data[:title] = item.at_css(\".a-link-normal\").text.strip\n book_data[:author] = item.at_css(\".a-size-small\").text.split(\"by\")[-1].strip\n book_data[:price] = item.at_css(\".a-color-price\").text.strip\n book_data[:price] = \"N/A\" unless book_data[:price].include?(\"$\")\n book_data[:asin] = item.at_css(\".a-link-normal\")[\"href\"].split(\"/\")[2].strip.split(\"?\")[0]\n self.books << Book.new(book_data)\n end\n self.last_scraped = Time.now\n self.scraped = true\n end\n end",
"def search(first_class, second_class)\n metszet = []\n first_min_second = []\n first_class[:descr].split(',').each do |first_word|\n if second_class[:descr].include? first_word\n metszet << first_word\n else\n first_min_second << first_word\n end\n end\n {metszet: metszet, first_min_second: first_min_second}\nend",
"def get_cnn\n articles = []\n\n urls = {'politics' => 'http://rss.cnn.com/rss/cnn_allpolitics.rss',\n 'tech' => 'http://rss.cnn.com/rss/cnn_tech.rss',\n 'business' => 'http://rss.cnn.com/rss/money_latest.rss',\n 'travel' => 'http://rss.cnn.com/rss/cnn_travel.rss',\n 'entertainment' => 'http://rss.cnn.com/rss/cnn_showbiz.rss',\n 'health' => 'http://rss.cnn.com/rss/cnn_health.rss',\n 'sports' => 'http://rss.cnn.com/rss/si_topstories.rss'\n }\n\n authors = %w(Dorren Serkan Chad Randall Matt Decarlo Rachel Depa)\n urls.each do |cat, url|\n content = open(url).read\n rss = RSS::Parser.parse(content, false)\n\n rss.items.each do |item|\n article = {:id => item.title.downcase.gsub(/\\W+/, '-'),\n :title => item.title, \n :content => item.description,\n :category => cat,\n :published_at => item.pubDate,\n :ratings => rand(5) + 1,\n :authors => []}\n\n article[:authors] << authors[rand(authors.size)]\n\n 2.times do |i|\n num = rand(50)\n article[:authors] << authors[num] if num < authors.size\n end\n\n articles << article\n end\n end \n\n articles\nend",
"def scrapeProductPage (pageURL)\n\t$logger.info(\"Parsing product Page\");\n\tputs(\"hahaha\");\n\t$mechanizer.get(pageURL) do |page|\n\n\n\t\t\tproductTitle \t\t\t= page.parser.css('#title span');\n\t\t\t# productRating \t\t\t= parseCustomerRating(page.parser.css(\"#averageCustomerReviews_feature_div .a-icon-star\").to_s);\n\t\t\tshippingWeight\t \t\t= getShippingWeight(page);\n\t\t\tproductURL\t\t\t\t= pageURL;\n\t\t\tproductPictureImgURL\t= parseImageURL(page.parser.css(\"img#landingImage\").to_s);\n\n\t\t\tputs \"<tr><td>#{productTitle}</td> <td>#{shippingWeight}</td> <td>#{productURL}</td> <td>#{productPictureImgURL}</td></tr>;\"\n\t\t\t\n\t\t\t# puts shippingWeight;\n\t\t\t\n\tend\nend",
"def find_shareholders(acquired_hotel, acquired_hotel_size)\n hotel_name = acquired_hotel.name\n most_shares = 0\n second_most_shares = 0\n majority_player = 'none'\n minority_player = 'none'\n tie_for_first = 'none'\n tie_for_second = 'none'\n self.game_players.each do |player|\n count = player.stock_cards.where(hotel: hotel_name).count\n if count > most_shares\n majority_player = player\n most_shares = count\n tie_for_first = 'none'\n elsif count = most_shares\n tie_for_first = player\n elsif count > second_most_shares\n minority_player = player\n second_most_shares = count\n tie_for_second = 'none'\n elsif count = second_most_shares\n tie_for_second = player\n end \n end\n\n\n if minority_player == 'none' && tie_for_first == 'none'\n minority_player = majority_player\n end\n\n\n give_bonuses(acquired_hotel, majority_player, minority_player, acquired_hotel_size, tie_for_first, tie_for_second)\n end",
"def scrape_text\n\n end",
"def make_articles\n EndangeredSpecies::Scraper.new.make_articles\n end",
"def search_implementation(args)\n scrape_url = construct_search_url(args)\n response = http_client.get(scrape_url)\n\n unless response.ok?\n error = BentoSearch::Results.new\n error.error = {\n status: response.status,\n response: response.body\n }\n fill_in_search_metadata_for(error, args)\n\n return error\n end\n\n document = Nokogiri::HTML(response.body)\n\n results = BentoSearch::Results.new\n if single_result_page?(document)\n results.total_items = extract_single_total_items(document)\n item = SingleItemExtractor.new(document, configuration).extract\n if item\n # best we can do for link is the search URL we scraped...\n item.link ||= scrape_url\n results << item\n end\n else\n results.total_items = extract_multi_total_items(document)\n\n extractor = MultiItemExtractor.new(document, configuration)\n results.concat extractor.extract\n end\n\n return results\n end",
"def scrape(page)\n data_table = page.css('table.ttable tr').collect {|x| x.css('td')}.reject{ |x| x.length == 0}.collect do |row|\n id = row.at_css('td.opis_td .link1')\n if id\n record = {\n ID: row.at_css('td.opis_td .link1')['href'].scan(/^.+(opis)(\\d+)(\\.html)$/).first[1],\n Product: row.css('td.opis_td .link1').inner_text + ' ' + row.css('td.opis_td').children[3].inner_text,\n Price: row.css('span.cena span.price').inner_text\n }\n \n # Print out the data we've gathered\n p record\n \n # Finally, save the record to the datastore - 'Product' is our unique key\n ScraperWiki.save_sqlite([:Product], record)\n end\n end\nend",
"def scrape(page)\n data_table = page.css('table.ttable tr').collect {|x| x.css('td')}.reject{ |x| x.length == 0}.collect do |row|\n id = row.at_css('td.opis_td .link1')\n if id\n record = {\n ID: row.at_css('td.opis_td .link1')['href'].scan(/^.+(opis)(\\d+)(\\.html)$/).first[1],\n Product: row.css('td.opis_td .link1').inner_text + ' ' + row.css('td.opis_td').children[3].inner_text,\n Price: row.css('span.cena span.price').inner_text\n }\n \n # Print out the data we've gathered\n p record\n \n # Finally, save the record to the datastore - 'Product' is our unique key\n ScraperWiki.save_sqlite([:Product], record)\n end\n end\nend",
"def dianping_search_shops(keywords,limit_query_pages)\n shops = []\n query_link = \"#{$DIANPING_SHOP_SEARCH_PATH_START_PAGE}#{URI.escape(keywords)}\"\n pages = DianpingPageParser.number_of_pages(query_link)\n \n puts pages\n \n max_page_to_crawl = (limit_query_pages.to_int < pages) ? limit_query_pages.to_int : pages\n \n (1..max_page_to_crawl).each { | page | shops << DianpingPageParser.shops_in_page(File.join(query_link, \"p#{page}\")) }\n \n return shops\nend",
"def pages(url)\n urls = Array.new\n data = Array.new \n data << Nokogiri::HTML(ScraperWiki.scrape(url))\n data[0].css('p.pages a').each do |link|\n urls << editUrl(link.attribute(\"href\").to_s())\n end\n\n urls.uniq.each do |link|\n data << Nokogiri::HTML(ScraperWiki.scrape(link))\n end\n\n return data\nend",
"def pages(url)\n urls = Array.new\n data = Array.new \n data << Nokogiri::HTML(ScraperWiki.scrape(url))\n data[0].css('p.pages a').each do |link|\n urls << editUrl(link.attribute(\"href\").to_s())\n end\n\n urls.uniq.each do |link|\n data << Nokogiri::HTML(ScraperWiki.scrape(link))\n end\n\n return data\nend",
"def scrap_trip_pages\n \n mp_trip_pages.each do |mp, trip_page|\n printf \"mp - #{mp}\\n\"\n doc = utf_page(trip_page)\n t = Time.now\n komandiruotes = (doc/\"//a[text()='Komandiruotės']\").first\n mp_business_trip(mp, denormalize( komandiruotes.attributes['href'] ) ) if komandiruotes\n printf \"Laikas: #{Time.now - t}\\n\"\n #sleep 3\n end\n \n end",
"def scrape\n created_at = Time.now\n date = Time.now\n puts \"Scrape for #{date.to_date} at #{date}\"\n\n begin\n base_url = 'https://unicode-table.com'\n agent = Mechanize.new\n agent.verify_mode = OpenSSL::SSL::VERIFY_NONE\n alphabets_page = Nokogiri::HTML(agent.get(\"#{base_url}/en/alphabets/\").content)\n nav = alphabets_page.css(\".navigation\")\n alphabet_links = nav.css(\"a\")\n\n alphabets = {}\n\n alphabet_links.each_with_index {|link, i|\n alphabet = {}\n # next if !(i == 1 || i == 32 || i == 28)\n alphabet_url = link.attr(\"href\") # /en/alphabets/armenian/\n\n alphabet[:title] = link.text\n alphabet[:letters] = []\n\n puts alphabet[:title]\n\n alphabet_page = Nokogiri::HTML(agent.get(\"#{base_url}#{alphabet_url}\").content)\n letters_el = alphabet_page.css(\".detailed-list li\")\n\n letters_el.each {|letter_el|\n letter = {}\n letter[:letter] = letter_el.css(\".char\").text()\n\n\n desc = letter_el.css(\".sdesc\")\n\n title_element = desc.css(\".stitle a\")\n\n #letter[:url] = title_element.attr(\"href\").text() # /en/0531/ hex code of character\n letter[:title] = title_element.text()\n\n block_element = desc.css(\".sblock a\")\n letter[:block] = block_element.attr(\"href\").text().gsub(\"/en/blocks/\",\"\").gsub(\"/\",\"\")\n\n letter[:code] = desc.css(\".code\").text()\n # letter[:html_code] = desc.css(\".html-code\").text()\n\n alphabet[:letters] << letter\n }\n\n name = alphabet_url.gsub(\"/en/alphabets/\",\"\").gsub(\"/\",\"\")\n\n alphabets[name.to_sym] = alphabet\n }\n\n File.write(\"unicode_alphabets.json\", JSON.pretty_generate(alphabets))\n File.write(\"unicode_alphabets.min.json\", alphabets.to_json)\n\n rescue Exception => e\n puts \"#{e} - exception occured\"\n end\n # end\nend",
"def parse_results (params)\n\t# Parses results and returns an array for each result as JSON\n\t# Function parameters\n\tresults = params[:results]\n\tcheck_re = (params[:check_re] or /(.*)/)\n\n\tnewly_added = Set.new\n\tret = []\n\n\tresults = results.gsub(/<\\/div>|<div id=\"gs_ccl_results\">/, '').strip # remove closing divs\n\n\tresults.split(/<div class=\"gs_r\">/).each do |result|\n\t\t# IGNORE result\n\t\t# if it's empty\n\t\t# OR\n\t\t# if result is user's home page (not paper)\n\t\t# OR\n\t\t# if result is a user citation\n\t\t# OR\n\t\t# if it's not validated by the string\n\t\tunless result == '' or result =~ /(.*(user profiles for).*|\\[citation\\])/i or (not result =~ check_re)\n\t\t\t# this variable contains the link to the PDF from Google Scholar, (regardless paid or not)\n\t\t\t# this one hold the rest of the data as HTML content\n\t\t\tinf_div = result.match(/<div class=\"gs_ri\">(.*)$/)[0].gsub(/^<div class=\"gs_ri\">/, '')\n\n\t\t\t# title of paper as well as link to it\n\t\t\ttitle_link = inf_div.match(/<h\\d(.*)<\\/h\\d>/)[0].gsub(/^<h\\d(.*)><a|<\\/h\\d>$/, '')\n\t\t\tpublication_title = title_link.match(/>(.*)<\\/a>/)[0].gsub(/(^>|<\\/a>$)/, '')\n\t\t\ttitle_sha2 = Digest::SHA2.hexdigest(publication_title)\n\t\t\t# if title is already indexed, or was visitied before in the current parse then skip\n\t\t\tif USE_INDEX and (INDEX.include? (title_sha2 + \"\\n\") or newly_added.include? title_sha2)\n\t\t\t\tnext\n\t\t\tend\n\n\t\t\tpublication_link = title_link.match(/href=\"([^\"]*)\"/)[0].gsub(/(^href=\"|\"$)/, '')\n\t\t\t# authors of it, also contains the link of the publisher as well as a tag of some sort referring to the topic\n\t\t\tauthors_div_arr = inf_div.match(/<div class=\"gs_a\">(.*)<div class=\"gs_rs\">/)[0].gsub(/^<div class=\"gs_a\">|<div class=\"gs_rs\">$/, '').gsub(/\"/, '\\\"').gsub(/<([^<>]*)>/, '').split('-')\n\t\t\t# abstract extracted by Google Scholar\n\t\t\tabstract_div = inf_div.match(/<div class=\"gs_rs\">(.*)<div class=\"gs_fl\">/)[0].gsub(/^<div class=\"gs_rs\">|<div class=\"gs_fl\">$/, '')\n\n\t\t\t# get the section containing the pdf info and link\n\t\t\t# remove beginning div tag and trailing div from next\n\t\t\tpdf_div = result.match(/<div class=\"gs_ggs gs_fl\">(.*)<div class=\"gs_ri\">/)\n\t\t\t# no guarantee for pdf div from Google\n\t\t\tpdf_link = nil\n\t\t\tunless pdf_div.nil?\n\t\t\t\tpdf_div = pdf_div[0].gsub(/(<div class=\"gs_ggs gs_fl\">|<div class=\"gs_ri\">$)/, '')\n\t\t\t\tpdf_link = pdf_div.match(/href=\"([^\"]*)\"/)[0].gsub(/(^href=\"|\"$)/, '')\n\t\t\tend\n\n\n\t\t\t# dictionary holding the data\n\t\t\tres = {}\n\n\t\t\tres[:__title__] = publication_title.gsub(/\"/, '\\\"').gsub(/<([^<>]*)>/, '').strip\n\t\t\tres[:__link__] = publication_link.gsub(/\"/, '\\\"').gsub(/<([^<>]*)>/, '').strip\n\t\t\tres[:__authors__] = authors_div_arr[0].strip\n\t\t\tres[:__abstract__] = abstract_div.gsub(/\"/, '\\\"').gsub(/<([^<>]*)>/, '').strip\n\t\t\tres[:__publisher__] = ($SITE_NAMES[authors_div_arr[-1].strip] or authors_div_arr[-1]).strip\n\t\t\tres[:__hash__] = title_sha2\n\t\t\tpdf_link.nil? ? res[:__pdf__] = nil : res[:__pdf__] = pdf_link.gsub(/\"/, '\\\"').gsub(/<([^<>]*)>/, '').strip\n\n\t\t\t# append to return variable\n\t\t\tret << res\n\t\t\tnewly_added << res[:__hash__] if USE_INDEX\n\t\tend\n\tend\n\n\treturn ret, newly_added\nend",
"def test_one_two_pair_beats_another_with_one_same_pair\n a_cards = prepare_cards('5H 8C 8D 9H 9D')\n b_cards = prepare_cards('4H 6C 6D 9C 9S')\n a = TwoPair.new(a_cards)\n b = TwoPair.new(b_cards)\n assert a.beats(b)\n end",
"def poll_extractions url=nil\n url ||= site.sample\n finders = all_finders\n begin\n pagetags = PageTags.new(url, @site, finders, true, false)\n correct_result = nil\n finders.each do |finder|\n pagetags.results_for(finder[:id]).each do |result|\n # pagetags.results_for(label).each do |result|\n # finder = result.finder\n puts \"<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<\"\n puts \"URL: #{url}\"\n label = finder[:label]\n finder.each { |key, value| puts \"\\t(#{key}: #{value})\" unless [:label, :count, :foundlings].include?(key) }\n # accepted = false\n if (foundstr = result.out.shift)\n unless column = correct_result && (foundstr == correct_result) && :yes_votes\n puts \"#{label}: #{foundstr}\"\n site_option = [\"Description\", \"Site Name\", \"Title\", \"Image\", \"Author Name\", \"Author Link\", \"Tags\"].include?(label) ? \" S(ave value to Site) \" : \"\"\n puts \"Good? [y](es) n(o) #{site_option} Q(uit)\"\n answer = gets.strip\n case answer[0]\n when 'Q'\n return nil\n when 'N', 'n'\n column = :no_votes\n if answer[0] == 'N'\n @site.reviewed = nil\n @site.save\n return false\n end\n when 'Y', 'y', nil\n column = :yes_votes\n # accepted = (answer[0] == 'Y')\n correct_result = foundstr\n # Include the finder on the site\n unless @site.finders.exists?(finds: finder[:label], selector: finder[:path], read_attrib: finder[:attribute])\n if existing = @site.finders.where(finds: finder[:label]).first\n existing.selector = finder[:path]\n existing.read_attrib = finder[:attribute]\n existing.save\n else\n @site.finders.create(finds: finder[:label], selector: finder[:path], read_attrib: finder[:attribute])\n @site.save\n end\n end\n # Saved the title finder: take a crack at the editing RegExp\n if label == \"Title\"\n done = false\n until done\n trimmed = trim_title foundstr\n puts \"Title In: #{foundstr}\"\n puts \"Title Out: #{trimmed}\"\n puts \"Good? (sS to save, qQ to quit, otherwise type new regexp for title) \"\n answer = gets.strip\n case answer\n when 's', 'S'\n site.save\n done = true\n when 'q', 'Q'\n done = true\n else\n @site.ttlcut = answer\n end\n end\n end\n when 'S'\n # Copy the value to the corresponding field on the site\n rest_of_line = answer[1..-1].strip\n field_val = rest_of_line.blank? ? foundstr : rest_of_line\n case label\n when \"Image\"\n @site.logo = field_val\n @site.save\n when \"Description\"\n @site.description = field_val\n @site.save\n when \"Site Name\", \"Title\"\n @site.name = field_val\n @site.save\n when \"Author Name\"\n TaggingServices.new(@site).tag_with field_val, User.super_id, type: \"Author\"\n @site.save\n when \"Author Link\"\n # Add a reference to the author, if any\n @site.tags(User.super_id, tagtype: \"Author\").each { |author|\n Reference.assert field_val, author, \"Home Page\"\n }\n when \"Tags\"\n ts = TaggingServices.new @site\n field_val.split(',').collect { |tagname|\n tagname = tagname.split(':').last.strip\n tagname if (tagname.length>0)\n }.compact.each { |tagname|\n ts.tag_with tagname, User.super_id\n }\n else\n puts \"There's no field on the site for #{label}\"\n end\n end\n end\n if column\n finder[column] = 0 unless finder[column]\n finder[column] = finder[column]+1\n end\n end\n end\n end\n return true\n rescue Exception => e\n puts \"Error: couldn't open page '#{url}' for analysis:\"\n puts e.to_s\n return false\n end\n end",
"def extract_video_page_urls(webpage,options)\r\n puts \"Extracting data from html5 data\"\r\n webpage.css('li.regularitem').each do |post|\r\n link = post.css('h4.itemtitle').css('a').first\r\n description = post.css('div.itemcontent').first.text\r\n download_episode(link.child.text,link['href'],description, options)\r\n end\r\nend",
"def fetch_products_with_crawler\n crawler_items.each do |crawler_item|\n products.create_from_crawler crawler_item\n end\n end",
"def test_one_two_pair_beats_another_with_one_same_pair\n a_cards = prepare_cards('5H 8C 8D 9H 9D')\n b_cards = prepare_cards('4H 8H 8S 9C 9S')\n a = TwoPair.new(a_cards)\n b = TwoPair.new(b_cards)\n assert a.beats(b)\n end"
] |
[
"0.6186652",
"0.61565745",
"0.61365855",
"0.6052331",
"0.58965707",
"0.5852861",
"0.58464736",
"0.57693875",
"0.5715033",
"0.5708145",
"0.56893134",
"0.5668627",
"0.5637688",
"0.5635966",
"0.56314445",
"0.5602669",
"0.55943286",
"0.55835193",
"0.5560925",
"0.5474126",
"0.545309",
"0.5447354",
"0.5447354",
"0.54343516",
"0.54183286",
"0.5399715",
"0.5394711",
"0.5385555",
"0.53636205",
"0.53612554",
"0.53346956",
"0.5332353",
"0.5319772",
"0.5308987",
"0.52990884",
"0.52973515",
"0.5276847",
"0.5269929",
"0.52673835",
"0.52582884",
"0.5255618",
"0.52475125",
"0.5246639",
"0.5245379",
"0.5237786",
"0.5232168",
"0.522396",
"0.522334",
"0.5223051",
"0.52147603",
"0.5210713",
"0.5204128",
"0.5188763",
"0.5179699",
"0.5173828",
"0.5170138",
"0.5162206",
"0.5144933",
"0.51355016",
"0.5128283",
"0.51098675",
"0.51092166",
"0.51046443",
"0.5098726",
"0.509849",
"0.5091725",
"0.5091725",
"0.50916326",
"0.5088709",
"0.5078963",
"0.5077902",
"0.50710684",
"0.5070452",
"0.5070452",
"0.5066525",
"0.50664574",
"0.50586945",
"0.50581425",
"0.50421673",
"0.50405794",
"0.50403905",
"0.5031842",
"0.50181264",
"0.50173545",
"0.5014211",
"0.50134015",
"0.5009881",
"0.5004399",
"0.5001583",
"0.5001583",
"0.5001011",
"0.49936005",
"0.49936005",
"0.4993284",
"0.49898732",
"0.4987215",
"0.4987052",
"0.49840087",
"0.4982529",
"0.49794707",
"0.49773493"
] |
0.0
|
-1
|
Retrieves the next encounter for bound patient
|
def next_encounter
state = INITIAL_STATE
loop do
state = next_state state
break if state == END_STATE
LOGGER.debug "Loading encounter type: #{state}"
encounter_type = EncounterType.find_by(name: state)
return EncounterType.new name: EXAMINATION\
if go_to_examination?
# prevent diagonis is lab order has been selected
return EncounterType.new name: DIAGNOSIS\
if patient_should_go_for_diagnosis?
return EncounterType.new name: LAB_ORDERS\
if patient_should_go_for_lab_order?
return EncounterType.new name: LAB_RESULTS\
if patient_should_go_for_lab_results?
return encounter_type if valid_state?(state)
end
nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def next_encounter\n state = INITIAL_STATE\n loop do\n state = next_state state\n break if state == END_STATE\n\n LOGGER.debug \"Loading encounter type: #{state}\"\n encounter_type = EncounterType.find_by(name: state)\n\n return encounter_type if valid_state?(state)\n end\n\n nil\n end",
"def next_encounter\n state = INITIAL_STATE\n loop do\n state = next_state state\n break if state == END_STATE\n\n LOGGER.debug \"Loading encounter type: #{state}\"\n encounter_type = EncounterType.find_by(name: state)\n\n return encounter_type if valid_state?(state)\n end\n\n nil\n end",
"def find_encounter(program, patient, date)\n date = date.to_date\n\n encounter_type = EncounterType.find_by(name: 'DISPENSING').encounter_type_id\n Encounter.where(program_id: program.id,\n encounter_type: encounter_type,\n patient_id: patient.id,\n encounter_datetime: date...(date + 1.day))\n .order(date_created: :desc)\n .first\n end",
"def find_htn_management_encounter(patient, date)\n type = encounter_type('HYPERTENSION MANAGEMENT')\n\n encounter = patient.encounters.where(type: type)\\\n .where('encounter_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(date))\\\n .order(:encounter_datetime)\n .last\n\n return encounter if encounter\n\n Encounter.create(encounter_datetime: date, type: type,\n creator: User.current.id, location_id: Location.current.id,\n patient: patient)\n end",
"def next_observance\n @next_observance ||= upcoming_observances.first\n end",
"def next\n begin\n self.band.levels[band.levels.index(self) + 1]\n rescue\n return nil\n end\n end",
"def current_encounter(program, patient, date: nil, create: false, provider: nil)\n date ||= Time.now\n encounter = find_encounter(program, patient, date)\n return encounter if encounter || !create\n\n create_encounter(program, patient, date, provider)\n end",
"def next\n self.occurrences.where('date >= ?', Date.current).first\n end",
"def find_patient_date_enrolled(patient)\n order = Order.joins(:encounter, :drug_order)\\\n .where(encounter: { patient: patient },\n drug_order: { drug: Drug.arv_drugs })\\\n .order(:start_date)\\\n .first\n\n order&.start_date&.to_date\n end",
"def find_patient_date_enrolled(patient)\n order = Order.joins(:encounter, :drug_order)\\\n .where(encounter: { patient: patient },\n drug_order: { drug: Drug.arv_drugs })\\\n .order(:start_date)\\\n .first\n\n order&.start_date&.to_date\n end",
"def next\r\n next_values[0]\r\n end",
"def last_encounter\n Encounter.where(:user_id => self.id).last\n end",
"def next_available_number\n request :get_next_available_number\n end",
"def next_available_number\n request :get_next_available_number\n end",
"def get_next\n r = nil\n iterator_lock do\n if @iterator <= @last_id\n r = get(@iterator)\n @iterator += 1\n @iterator_file.write(\"#{@iterator.to_s(36)}\\n\")\n r\n else\n nil\n end\n end\n end",
"def get_next_patid\n\t\tStudySubject.maximum(:patid).to_i + 1\n#\n#\tWhat happens if/when this goes over 4 digits? \n#\tThe database field is only 4 chars.\n#\n\tend",
"def get_next_entry; end",
"def getNext(next_val, restriction, next_restriction)\n if restriction.to_i == -3 && session[:impacto_usuario] == -2\n next_restriction\n elsif restriction.to_i == 50 && session[:aforo] != nil && session[:aforo].to_i > 49\n next_restriction\n else\n next_val\n end\n end",
"def patient_bp_readings_trail(patient, max_date)\n concepts = [concept('SBP'), concept('DBP')]\n readings = Observation.where(person: patient.person, concept: concepts)\\\n .where('obs_datetime < ?', (max_date + 1.day).to_date)\n .order(obs_datetime: :desc)\n visit_bp_readings_trail(readings, patient, concepts)\n end",
"def next_available_number\n session.request Debtor.soap_action(:get_next_available_number)\n end",
"def get_next()\n\t\t\treturn @next\n\t\tend",
"def getNext(next_val, restriction, next_restriction)\n #if restriction.to_i == -20 && !session[:is_business_home] \n # next_restriction\n \tif restriction.to_i == -20 && session[:uso_de_suelo]\n \t\tnext_restriction\n \telse\n \t\tnext_val\n \tend\n end",
"def next\n Issue.find(:first, :conditions => ['date > ?', date], :order => 'date')\n end",
"def next\n return @next if defined? @next\n\n @next = course.levels.offset(level_number + 1).first\n end",
"def next_competition\n Competition.where(\"competition_date > ?\", Time.now).order(\"competition_date\").first\n end",
"def next\r\n\r\n Access.first(:order => 'accesses.id', :conditions => [\"accesses.id > ?\", self.id])\r\n end",
"def next\n last? ? nil : locate + 1\n end",
"def next\n\t\t# Use up all of the extras\n\t\treturn @extras.pop if !@extras.empty?\n\t\t# Then track the last freeid used (which should always be the max)\n\t\treturn (@last+=1)-1\n\tend",
"def __next_ordinal__\n\t\t\t\treturn_value = @ordinal\n\t\t\t\t@ordinal = @ordinal.next\n\t\t\t\treturn_value\n\t\t\tend",
"def get_next_childid\n\t\tStudySubject.maximum(:childid).to_i + 1\n\tend",
"def next\n self.class.where(\"id > ?\", id).where(:punto_venta_id => self.punto_venta_id).first\n end",
"def next_bib\n self[:next_bib] = self.inc(next_bib: 1)[:next_bib]\n\tend",
"def encounter_params\n params[:encounter]\n end",
"def next\n @opened && @cur_record_index < @num_records ? _read_next_record : nil\n end",
"def get_next_free_enemy(event_id)\n i = 1\n while i < $Enemies.length \n if !$Enemies[i].active\n $Enemies[i].set_id(event_id)\n $Enemies[i].set_active\n $Enemies[i].set_map_id\n return i\n break\n end\n i += 1 \n end\n end",
"def next_assigned_or_reserved\n Ip.find(:first, :conditions => \n ['address_i > ? AND service = ? and (network_id is not null OR reserved_until is not null)', \n self.address_i, self.service], :order => 'address_i asc')\n end",
"def find_next date\n loop do \n \treturn date if include?(date)\n \t# puts \"#{@resolution} : #{date}\"\n \tdate = beginning_of_next @resolution, date\n end\n end",
"def find_next\n PcpItem.where( pcp_subject_id: pcp_subject_id ).where( 'id > ?', id ).first\n end",
"def next\n recurrence.next if recurring?\n end",
"def next_available_npid(patient:, identifier_type:, program_id: nil)\n unless identifier_type.name.match?(/#{PatientIdentifierType::NPID_TYPE_NAME}/i)\n raise \"Unknown identifier type: #{identifier_type.name}\"\n end\n\n return identifier_type.next_identifier(patient: patient) unless use_dde_service?\n\n dde_patient_id_type = patient_identifier_type(PatientIdentifierType::DDE_ID_TYPE_NAME)\n dde_patient_id = patient_identifiers(patient, dde_patient_id_type).first&.identifier\n return dde_service(Program.find(program_id)).re_assign_npid(dde_patient_id) if dde_patient_id\n\n dde_service(Program.find(program_id)).create_patient(patient)\n end",
"def next\n\t self.class.where(\"deck_id == ?\", deck_id).where(\"id > ?\", id).first\n\tend",
"def read_next_id\n id = nil\n list = current_list\n\n if @co_index <= list.size\n id = list[@co_index - 1][:id]\n end\n\n @co_index += 1\n\n id\n end",
"def next_attestation_detail\n AttestationDetail.find_by_study_plan_id_and_attestation_term(id,\n Attestation.next_for_faculty(index.student.faculty))\n end",
"def begin_next_dance\n\t partner = @dance_card[0]\n\t @dance_card.shift\n\t p @dance_card\n\t p \"Now dancing with #{partner}.\"\n\tend",
"def next_row\n observation_matrix.observation_matrix_rows.where('position > ?', position).order(:position).first\n end",
"def get_next(oids, options = {})\n each_session do |session|\n @pdu = session.get_next(oids)\n @pdu.print\n puts \"ERROR\" if @pdu.error?\n end\n \"GETNEXT\"\n end",
"def next\n if self[:next_ptr] == FFI::Pointer::NULL\n nil\n else\n BigBedInterval.new(self[:next_ptr])\n end\n end",
"def get_next_free_recorder\n send(\"GET_NEXT_FREE_RECORDER#{FIELD_SEPARATOR}-1\")\n response = recv\n\n # If we have a recorder free, return the recorder id, otherwise false\n response[0] == \"-1\" ? false : response[0].to_i\n end",
"def next_assigned\n Ip.find(:first, :conditions => \n ['address_i > ? AND service = ? and network_id is not null', self.address_i, self.service], :order => 'address_i asc')\n end",
"def ajax_next_patient\n begin\n if params[:commit]\n @ct = params[:patients_groups]\n @patient = Patient.find(@ct[:next_patient])\n set_patient_session(@patient.id, @patient.patient_name)\n else\n @patients_groups = PatientsGroup.find_all_by_group_id(session[:group]) \n @patient = Patient.find_all_by_id(@patients_groups.collect{|c| c.patient_id}, :order => \"last_name ASC, first_name ASC\") \n end\n \n #the get is an ajax call, th post is a redirect to new insurance billing\n respond_to do |format|\n format.html { redirect_to new_insurance_billing_path(:dos => session[:dos]) }\n format.js\n end\n rescue\n respond_to do |format|\n format.html { head :no_content }\n format.js { head :no_content }\n end\n end\n end",
"def patient_last_drugs_received(patient, ref_date)\n dispensing_encounter = Encounter.joins(:type).where(\n 'encounter_type.name = ? AND encounter.patient_id = ?\n AND DATE(encounter_datetime) <= DATE(?) AND program_id = ?',\n 'DISPENSING', patient.patient_id, ref_date, program('HIV Program').id\n ).order(encounter_datetime: :desc).first\n\n return [] unless dispensing_encounter\n\n # HACK: Group orders in a map first to eliminate duplicates which can\n # be created when a drug is scanned twice.\n (dispensing_encounter.observations.each_with_object({}) do |obs, drug_map|\n next unless obs.value_drug || drug_map.key?(obs.value_drug)\n\n order = obs.order\n next unless order&.drug_order&.quantity\n\n drug_map[obs.value_drug] = order.drug_order if order.drug_order.drug.arv?\n end).values\n end",
"def dose_sequence_number\n return nil unless patient_id\n\n dose&.sequence_number || follow_up_for_dose&.next_sequence_number || 1\n end",
"def patient\n insurance_provider.patient\n end",
"def get_last_port\n flist = Fiberstrand.where(\"connection_id = \" + self.id.to_s)\n #binding.pry\n fportid=0\n # binding.pry\n flist.each do |fiber|\n fport = Devport.find_by_id(fiber.portb)\n fportid=fport.id\n break if (fport.fiber_out_id==0)\n fportid=0\n end\n \n fportid\n \n end",
"def next\n next? ? @current + 1 : nil\n end",
"def next_occurrence(after = Time.now.utc)\n occurrence_solver.next_occurrence(after)\n end",
"def next\n self.offset(1)\n end",
"def next\n offering.admin_phases.find(:first, :conditions => ['sequence > ?', self.sequence], :order => 'sequence')\n end",
"def get_Next()\n \t return @outputs[\"Next\"]\n \tend",
"def get_Next()\n \t return @outputs[\"Next\"]\n \tend",
"def get_Next()\n \t return @outputs[\"Next\"]\n \tend",
"def get_Next()\n \t return @outputs[\"Next\"]\n \tend",
"def get_Next()\n \t return @outputs[\"Next\"]\n \tend",
"def get_Next()\n \t return @outputs[\"Next\"]\n \tend",
"def next\n return Question.find_by(id: self.id + 1)\n end",
"def next_bib\n \tself[:next_bib] = self[:next_bib] + 1\n end",
"def next_cycle(previous_occurrence)\n unless occurrences\n self.occurrences = occurrences_for(previous_occurrence)\n end\n candidate = next_candidate(previous_occurrence)\n if candidate\n sub_cycle_incrementer.first_within_outer_cycle(previous_occurrence, update_cycle_range(candidate))\n else\n nil\n end\n end",
"def next_throw frame\n if frame.number != 10\n #next_frame = frames.where(number: frame.number + 1).take\n next_frame = frames.select{ |related_frame| related_frame.number == frame.number + 1}.first\n return next_frame.first_throw\n else\n return frame.third_throw\n end\n end",
"def get_last_assessment\n Assessment.find_by(year: year - 1)\n end",
"def get_last_assessment\n Assessment.find_by(year: year - 1)\n end",
"def get_next\n\t\t\n\tend",
"def next\n self.class.where('id > ?', id).first\n end",
"def next_in\n\t\treturn if cancelled?\n\n\t\t@mutex.synchronize {\n\t\t\t@every - (Time.now - @at)\n\t\t}\n\tend",
"def next!\n id = @counter.next!\n id = @counter.next! while @map[id]\n register id\n end",
"def next\n\t\tself.class.where(\"id > ?\", id).first\n\tend",
"def get_next\n\n if (@local_iterator)\n @local_iterator.get_next\n else\n raise \"No iterator defined! Cannot get next element\"\n end\n\n end",
"def sequence\n\t\tunless self.id.nil? # a nil ID means a virtual \"anticipated\" appointment\n\t\t\t#\n\t\t\t# Gets a count of the number of appointments for this allocation prior to this\n\t\t\t# appointment's date\n\t\t\tseq=Appointment.joins(:slot_date).\n\t\t\t\twhere(\"allocation_id=?\", self.allocation_id).\n\t\t\t\twhere(\"appointment_date<?\",self.slot_date.appointment_date).\n\t\t\t\twhere(:counted => true).\n\t\t\t\tcount + 1\n logger.debug \"appointment.sequence: non-virtual appointment #{self.id} = #{seq}\"\n seq\n\t\telse # is a pencilled-in appointment\n\t\t\n\t\t\t#\n\t\t\t# Find the last actual appointment in this sequence\n\t\t\t#\n\t\t\tlastappointment = Appointment.where(\"allocation_id=?\", self.allocation_id).last\n\t\t\t#\n\t\t\t# OK, we know when our last appointment for this allocation was. Now let's count the intervening\n\t\t\t# interruptions that might exist between then and now\n\t\t\t#\n\n\t\t\t# count absences and other appts\n\t\t\t\n\n\t\t\t# count weeks between last appt and this one\n\t\t\ts = (self.appointment_date - lastappointment.appointment_date).to_i / 7\n\t\t\ts + lastappointment.sequence\n\t\tend\n\tend",
"def next\n\t\tself + 1\n\tend",
"def current_htn_drugs(patient, date = Date.today)\n medication_concept = concept('HYPERTENSION DRUGS').concept_id\n drug_concept_ids = ConceptSet.where('concept_set = ?', medication_concept).map(&:concept_id)\n drugs = Drug.where('concept_id IN (?)', drug_concept_ids)\n drug_ids = drugs.collect(&:drug_id)\n dispensing_encounter = encounter_type('DISPENSING')\n\n prev_date = Encounter.joins(\n 'INNER JOIN obs ON encounter.encounter_id = obs.encounter_id'\n ).where(\n \"encounter.patient_id = ?\n AND value_drug IN (?) AND encounter.encounter_datetime < ?\n AND encounter.encounter_type = ?\",\n patient.id, drug_ids, (date + 1.day).to_date, dispensing_encounter.id\n ).select(['encounter_datetime']).last&.encounter_datetime&.to_date\n\n return [] if prev_date.blank?\n\n dispensing_concept = concept('AMOUNT DISPENSED').concept_id\n result = Encounter.find_by_sql(\n [\"SELECT obs.value_drug FROM encounter\n INNER JOIN obs ON obs.encounter_id = encounter.encounter_id\n WHERE encounter.voided = 0 AND encounter.patient_id = ?\n AND obs.value_drug IN (?) AND obs.concept_id = ?\n AND encounter.encounter_type = ? AND DATE(encounter.encounter_datetime) = ?\",\n patient.id, drug_ids, dispensing_concept, dispensing_encounter.id, prev_date]\n )&.map(&:value_drug)&.uniq || []\n\n result.collect { |drug_id| Drug.find(drug_id) }\n end",
"def next\n \tself.class.where(\"id > ?\", id).first\n \tend",
"def get_next_player(start)\n for i in 1..10\n to_check = (start + i)%10 + 10\n if self.players.where(:location => to_check).length == 1\n player = self.players.where(:location => to_check)[0]\n if player.in_hand\n return player.location\n end\n end\n end\n return -10\n end",
"def next_exp\n return (@exp_list[@level+1] > 0 ? @exp_list[@level+1]-@exp_list[@level] : 0)\n end",
"def next_observation # :nologin: :norobots:\n redirect_to_next_object(:next, Observation, params[:id].to_s)\n end",
"def next_id\n self[:next_id]\n end",
"def enrollment\n self.enrollments.last\n end",
"def next_id\n @next_id = ((start...(start + size)).to_a - leases.map { |l| l.id }).first\n end",
"def next_number\n Sequence.next_val\n end",
"def get_patient\n @get_patient ||= patient_service.get(user.icn)\n end",
"def advance\n @current += 1 unless at_end?\n return previous\n end",
"def full_next_exp\n return (@exp_list[@level+1] > 0 ? @exp_list[@level+1] : 0)\n end",
"def see_next\n if @index >= @normalized_numbers.length\n return -1\n else\n return @normalized_numbers[@index]\n end\n end",
"def next_occurrence_after(date)\n first_occurrence_on_or_after(date + 1)\n end",
"def next\n @offset = get_current_offset + get_count\n get_results @current_projection\n end",
"def first_available_room(start_date, end_date)\n return list_rooms_available_for_date_range(start_date, end_date).first.room_number\n end",
"def next_cursor\n @result[:next_cursor]\n end",
"def next\n at(position + 1)\n end",
"def get_next_membership_number\n self.class.connection.execute(\"SELECT nextval('membership_number_seq')\").getvalue(0, 0).to_s\n end",
"def instability_index\n @instability_index ||=\n begin\n instability_sum = 0.0\n i = 0\n while @seq[i+1] != nil\n aa, next_aa = [@seq[i].chr.to_sym, @seq[i+1].chr.to_sym]\n if DIWV.key?(aa) && DIWV[aa].key?(next_aa)\n instability_sum += DIWV[aa][next_aa]\n end\n i += 1\n end\n round((10.0/amino_acid_number.to_f) * instability_sum, 2)\n end\n end",
"def next_value_for_sequence(sequence_name)\n %{#{sequence_name}.nextval}\n end",
"def next\n return nil unless fund_item && next_perspective\n fund_item.fund_editions.next_to( self )\n end"
] |
[
"0.62114567",
"0.62114567",
"0.6168569",
"0.55435693",
"0.55312634",
"0.54928786",
"0.54856104",
"0.54759085",
"0.54370743",
"0.54179215",
"0.53413236",
"0.53375024",
"0.5333356",
"0.5333356",
"0.5327856",
"0.52845246",
"0.5274529",
"0.52589446",
"0.51964945",
"0.51957935",
"0.51404685",
"0.5140457",
"0.5135329",
"0.5117832",
"0.51021105",
"0.51012963",
"0.5079878",
"0.5072989",
"0.5071185",
"0.5065437",
"0.505932",
"0.5056347",
"0.5054315",
"0.5036708",
"0.50098246",
"0.5006609",
"0.4998592",
"0.498297",
"0.49729759",
"0.49721658",
"0.49635056",
"0.49559823",
"0.49481833",
"0.49394542",
"0.4939073",
"0.493892",
"0.4936028",
"0.49326852",
"0.49232858",
"0.49099016",
"0.49055618",
"0.49012172",
"0.48980644",
"0.48959404",
"0.4885296",
"0.48814377",
"0.48677692",
"0.48573142",
"0.48403838",
"0.48403838",
"0.48403838",
"0.48403838",
"0.48403838",
"0.48403838",
"0.48378345",
"0.48249584",
"0.4820234",
"0.4820113",
"0.48171255",
"0.48171255",
"0.48063055",
"0.4803657",
"0.47979826",
"0.47890642",
"0.47820306",
"0.47746965",
"0.47679403",
"0.47660872",
"0.4763693",
"0.47632307",
"0.47522366",
"0.4743388",
"0.47378257",
"0.4731796",
"0.47300088",
"0.47253838",
"0.47229627",
"0.47215077",
"0.47140652",
"0.47101513",
"0.4708551",
"0.47067505",
"0.47044626",
"0.4702174",
"0.4700048",
"0.46987298",
"0.46976084",
"0.4696527",
"0.46924612",
"0.46913436"
] |
0.61382484
|
3
|
Check if a relevant encounter of given type exists for given patient. NOTE: By `relevant` above we mean encounters that matter in deciding what encounter the patient should go for in this present time.
|
def encounter_exists?(type)
# Vitals may be collected from a different program so don't check
# for existence of an encounter rather check for the existence
# of the actual vitals.
return false if type.name == VITALS
Encounter.where(type: type, patient: @patient, program: @program)\
.where('encounter_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(@date))\
.exists?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def encounter_exists?(type)\n Encounter.where(type: type, patient: @patient)\\\n .where('encounter_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(@date))\\\n .exists?\n end",
"def encounter_exists?(type)\n Encounter.where(type: type, patient: @patient)\\\n .where('encounter_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(@date))\\\n .exists?\n end",
"def has_encounter_type?(enc_type)\r\n return false if !enc_type\r\n return @encounter_tables[enc_type] && @encounter_tables[enc_type].length > 0\r\n end",
"def should_patient_tested_through_diagnosis?\n procedure_type = concept('Procedure type')\n x_ray = concept('Xray')\n clinical = concept('Clinical')\n ultrasound = concept('Ultrasound')\n Observation.joins(:encounter).where(\n 'person_id = ? AND concept_id = ? AND (value_coded = ? || value_coded = ? || value_coded = ?) AND encounter.encounter_type = ?',\n @patient.patient_id, procedure_type.concept_id, x_ray.concept_id, clinical.concept_id, ultrasound.concept_id, encounter_type(EXAMINATION).id\n ).order(obs_datetime: :desc).exists?\n end",
"def patient_does_not_have_prescription?\n encounter_type = EncounterType.find_by name:TREATMENT\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def patient_does_not_have_diagnosis?\n encounter_type = EncounterType.find_by name:OUTPATIENT_DIAGNOSIS\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def reservation_found? tracker, type\n\t\t\traise ArgumentError, \"No #{type} available in date range.\" if tracker.empty?\n\n\t\t\treturn tracker\n\t\tend",
"def patient_suitable_for_circumcision?\n # Memoize as this may be called a number of times within one request.\n # It is a pre-condition to a number of encounters.\n return @patient_suitable_for_circumcision unless @patient_suitable_for_circumcision.nil?\n\n @patient_suitable_for_circumcision = begin\n Observation.joins(:encounter)\\\n .where(concept: concept('Suitable for circumcision'),\n value_coded: concept('Yes').concept_id)\\\n .where('DATE(obs_datetime) = ?', date.to_date)\\\n .merge(Encounter.where(patient: patient, program: program))\\\n .exists?\n end\n end",
"def relevant?\n @relevant.nil? ? true : @relevant\n end",
"def patient_does_not_have_dispensation?\n encounter_type = EncounterType.find_by name:DISPENSING\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def encounter_type\r\n time = pbGetTimeNow\r\n ret = nil\r\n if $PokemonGlobal.surfing\r\n ret = find_valid_encounter_type_for_time(:Water, time)\r\n else # Land/Cave (can have both in the same map)\r\n if has_land_encounters? && $game_map.terrain_tag($game_player.x, $game_player.y).land_wild_encounters\r\n ret = :BugContest if pbInBugContest? && has_encounter_type?(:BugContest)\r\n ret = find_valid_encounter_type_for_time(:Land, time) if !ret\r\n end\r\n if !ret && has_cave_encounters?\r\n ret = find_valid_encounter_type_for_time(:Cave, time)\r\n end\r\n end\r\n return ret\r\n end",
"def has_matches_on_event?(event_type, visitor_swimmer = @visitor_swimmer)\n @local_swimmer.meeting_programs.exists? &&\n visitor_swimmer && visitor_swimmer.id &&\n @local_swimmer.meeting_programs\n .joins(:meeting_event)\n .includes(:meeting_event)\n .where([\n 'meeting_events.event_type_id = ? and exists (select 1 from meeting_individual_results mir join swimmers s on s.id = mir.swimmer_id where s.id = ? and mir.meeting_program_id = meeting_programs.id)',\n event_type.id,\n visitor_swimmer.id\n ]).exists?\n end",
"def encounter_triggered?(enc_type, repel_active = false, triggered_by_step = true)\r\n if !enc_type || !GameData::EncounterType.exists?(enc_type)\r\n raise ArgumentError.new(_INTL(\"Encounter type {1} does not exist\", enc_type))\r\n end\r\n return false if $game_system.encounter_disabled\r\n return false if !$Trainer\r\n return false if $DEBUG && Input.press?(Input::CTRL)\r\n # Check if enc_type has a defined step chance/encounter table\r\n return false if !@step_chances[enc_type] || @step_chances[enc_type] == 0\r\n return false if !has_encounter_type?(enc_type)\r\n # Get base encounter chance and minimum steps grace period\r\n encounter_chance = @step_chances[enc_type].to_f\r\n min_steps_needed = (8 - encounter_chance / 10).clamp(0, 8).to_f\r\n # Apply modifiers to the encounter chance and the minimum steps amount\r\n if triggered_by_step\r\n encounter_chance += @chance_accumulator / 200\r\n encounter_chance *= 0.8 if $PokemonGlobal.bicycle\r\n end\r\n if !Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS\r\n encounter_chance /= 2 if $PokemonMap.blackFluteUsed\r\n min_steps_needed *= 2 if $PokemonMap.blackFluteUsed\r\n encounter_chance *= 1.5 if $PokemonMap.whiteFluteUsed\r\n min_steps_needed /= 2 if $PokemonMap.whiteFluteUsed\r\n end\r\n first_pkmn = $Trainer.first_pokemon\r\n if first_pkmn\r\n case first_pkmn.item_id\r\n when :CLEANSETAG\r\n encounter_chance *= 2.0 / 3\r\n min_steps_needed *= 4 / 3.0\r\n when :PUREINCENSE\r\n encounter_chance *= 2.0 / 3\r\n min_steps_needed *= 4 / 3.0\r\n else # Ignore ability effects if an item effect applies\r\n case first_pkmn.ability_id\r\n when :STENCH, :WHITESMOKE, :QUICKFEET\r\n encounter_chance /= 2\r\n min_steps_needed *= 2\r\n when :SNOWCLOAK\r\n if GameData::Weather.get($game_screen.weather_type).category == :Hail\r\n encounter_chance /= 2\r\n min_steps_needed *= 2\r\n end\r\n when :SANDVEIL\r\n if GameData::Weather.get($game_screen.weather_type).category == :Sandstorm\r\n encounter_chance /= 2\r\n min_steps_needed *= 2\r\n end\r\n when :SWARM\r\n encounter_chance *= 1.5\r\n min_steps_needed /= 2\r\n when :ILLUMINATE, :ARENATRAP, :NOGUARD\r\n encounter_chance *= 2\r\n min_steps_needed /= 2\r\n end\r\n end\r\n end\r\n # Wild encounters are much less likely to happen for the first few steps\r\n # after a previous wild encounter\r\n if triggered_by_step && @step_count < min_steps_needed\r\n @step_count += 1\r\n return false if rand(100) >= encounter_chance * 5 / (@step_chances[enc_type] + @chance_accumulator / 200)\r\n end\r\n # Decide whether the wild encounter should actually happen\r\n return true if rand(100) < encounter_chance\r\n # If encounter didn't happen, make the next step more likely to produce one\r\n if triggered_by_step\r\n @chance_accumulator += @step_chances[enc_type]\r\n @chance_accumulator = 0 if repel_active\r\n end\r\n return false\r\n end",
"def patient_does_not_have_complaints?\n encounter_type = EncounterType.find_by name:PRESENTING_COMPLAINTS\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def pbHasType?(type)\n if type.is_a?(String) || type.is_a?(Symbol)\n type = getID(PBTypes,type)\n end\n for pokemon in $Trainer.pokemonParty\n return true if pokemon.hasType?(type)\n end\n return false\nend",
"def contested?\n if issue\n self.class.where(issue_id: issue.id).count > 1 \n elsif pact\n self.class.where(pact_id: pact.id).count > 1\n end\n end",
"def has_water_encounters?\r\n GameData::EncounterType.each do |enc_type|\r\n return true if enc_type.type == :water && has_encounter_type?(enc_type.id)\r\n end\r\n return false\r\n end",
"def encounter_possible_here?\r\n return true if $PokemonGlobal.surfing\r\n terrain_tag = $game_map.terrain_tag($game_player.x, $game_player.y)\r\n return false if terrain_tag.ice\r\n return true if has_cave_encounters? # i.e. this map is a cave\r\n return true if has_land_encounters? && terrain_tag.land_wild_encounters\r\n return false\r\n end",
"def patient_getting_prescription?(patient, date)\n Observation.where(person_id: patient.patient_id,\n concept_id: ConceptName.find_by_name('Prescribe drugs').concept_id,\n value_coded: ConceptName.find_by_name('Yes').concept_id)\\\n .where('obs_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(date))\n .exists?\n end",
"def knows_bestiary_data?(type, data, enemy)\n return false unless @bestiary_known_data[type][data]\n return @bestiary_known_data[type][data].include?(enemy)\n end",
"def look_for_type(target_type, ignoring = [], &blk)\n each_sexp do |elem|\n elem.look_for_type(target_type, ignoring, &blk) unless ignoring.include?(elem.type)\n end\n blk.call(self) if type == target_type\n end",
"def include?(quest_id, list_type = :all)\n return false if !revealed?(quest_id)\n case list_type\n when :all then true\n when :complete, :failed, :active then @data[quest_id].status?(list_type)\n else\n @data[quest_id].custom_categories.include?(list_type)\n end\n end",
"def time_is_audience_specific?(person_or_type = nil)\n start_time(person_or_type) != start_time || end_time(person_or_type) != end_time\n end",
"def include?(type)\n return !@except.call(type, {}) if @except\n return @only.call(type, {}) if @only\n true\n end",
"def is_belong_to?(country, target_continent)\n my_html = Nokogiri::HTML(country.country_doc)\n doc = my_html.at(\"table tr td div.region1 a\")\n belong = false\n\n if doc != nil then\n region = doc.text\n if str_include?(region, target_continent)\n belong = true\n end\n end\n return belong\n end",
"def has_land_encounters?\r\n GameData::EncounterType.each do |enc_type|\r\n next if ![:land, :contest].include?(enc_type.type)\r\n return true if has_encounter_type?(enc_type.id)\r\n end\r\n return false\r\n end",
"def has_cave_encounters?\r\n GameData::EncounterType.each do |enc_type|\r\n return true if enc_type.type == :cave && has_encounter_type?(enc_type.id)\r\n end\r\n return false\r\n end",
"def find_encounter(program, patient, date)\n date = date.to_date\n\n encounter_type = EncounterType.find_by(name: 'DISPENSING').encounter_type_id\n Encounter.where(program_id: program.id,\n encounter_type: encounter_type,\n patient_id: patient.id,\n encounter_datetime: date...(date + 1.day))\n .order(date_created: :desc)\n .first\n end",
"def qualifies? element\n return false unless the_right_type? element\n return false unless meets_criteria? element\n return true\n end",
"def match_in_owner_scope(others)\n others.detect do |other|\n self.class == other.class and specimen_type == other.specimen_type and pathological_status == other.pathological_status and\n characteristics and characteristics.matches?(other.characteristics)\n end\n end",
"def publication_match_in_profile\n @info.available_related_content_types.include? 'emp'\n end",
"def patient_not_registered_today?\n encounter_type = EncounterType.find_by name: PATIENT_REGISTRATION\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def find_htn_management_encounter(patient, date)\n type = encounter_type('HYPERTENSION MANAGEMENT')\n\n encounter = patient.encounters.where(type: type)\\\n .where('encounter_datetime BETWEEN ? AND ?', *TimeUtils.day_bounds(date))\\\n .order(:encounter_datetime)\n .last\n\n return encounter if encounter\n\n Encounter.create(encounter_datetime: date, type: type,\n creator: User.current.id, location_id: Location.current.id,\n patient: patient)\n end",
"def relevant_data?\n @relevant_data\n end",
"def include_question_type?(type)\n questions.any? { |q| q.type == type }\n end",
"def participating?(given_event)\n participations.find_by_participated_id(given_event.id)\n end",
"def any_records?(type)\n @records.any? { |rec| rec.is_a?(type) && rec.valid? }\n end",
"def has_related_patient?\n if registrations.count > 0\n return true\n end\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n return true\n end\n end\n return false\n end",
"def choose_wild_pokemon(enc_type, chance_rolls = 1)\r\n if !enc_type || !GameData::EncounterType.exists?(enc_type)\r\n raise ArgumentError.new(_INTL(\"Encounter type {1} does not exist\", enc_type))\r\n end\r\n enc_list = @encounter_tables[enc_type]\r\n return nil if !enc_list || enc_list.length == 0\r\n # Static/Magnet Pull prefer wild encounters of certain types, if possible.\r\n # If they activate, they remove all Pokémon from the encounter table that do\r\n # not have the type they favor. If none have that type, nothing is changed.\r\n first_pkmn = $Trainer.first_pokemon\r\n if first_pkmn && rand(100) < 50\r\n favored_type = nil\r\n case first_pkmn.ability_id\r\n when :STATIC\r\n favored_type = :ELECTRIC if GameData::Type.exists?(:ELECTRIC)\r\n when :MAGNETPULL\r\n favored_type = :STEEL if GameData::Type.exists?(:STEEL)\r\n when :FLASHFIRE\r\n favored_type = :FIRE if GameData::Type.exists?(:FIRE)\r\n when :HARVEST\r\n favored_type = :GRASS if GameData::Type.exists?(:GRASS)\r\n when :LIGHTNINGROD\r\n favored_type = :ELECTRIC if GameData::Type.exists?(:ELECTRIC)\r\n when :STORMDRAIN\r\n favored_type = :WATER if GameData::Type.exists?(:WATER)\r\n end\r\n if favored_type\r\n new_enc_list = []\r\n enc_list.each do |enc|\r\n species_data = GameData::Species.get(enc[1])\r\n t1 = species_data.type1\r\n t2 = species_data.type2\r\n new_enc_list.push(enc) if t1 == favored_type || t2 == favored_type\r\n end\r\n enc_list = new_enc_list if new_enc_list.length > 0\r\n end\r\n end\r\n enc_list.sort! { |a, b| b[0] <=> a[0] } # Highest probability first\r\n # Calculate the total probability value\r\n chance_total = 0\r\n enc_list.each { |a| chance_total += a[0] }\r\n # Choose a random entry in the encounter table based on entry probabilities\r\n rnd = 0\r\n chance_rolls.times do\r\n r = rand(chance_total)\r\n rnd = r if r > rnd # Prefer rarer entries if rolling repeatedly\r\n end\r\n encounter = nil\r\n enc_list.each do |enc|\r\n rnd -= enc[0]\r\n next if rnd >= 0\r\n encounter = enc\r\n break\r\n end\r\n # Get the chosen species and level\r\n level = rand(encounter[2]..encounter[3])\r\n # Some abilities alter the level of the wild Pokémon\r\n if first_pkmn\r\n case first_pkmn.ability_id\r\n when :HUSTLE, :PRESSURE, :VITALSPIRIT\r\n level = encounter[3] if rand(100) < 50 # Highest possible level\r\n end\r\n end\r\n # Black Flute and White Flute alter the level of the wild Pokémon\r\n if Settings::FLUTES_CHANGE_WILD_ENCOUNTER_LEVELS\r\n if $PokemonMap.blackFluteUsed\r\n level = [level + rand(1..4), GameData::GrowthRate.max_level].min\r\n elsif $PokemonMap.whiteFluteUsed\r\n level = [level - rand(1..4), 1].max\r\n end\r\n end\r\n # Return [species, level]\r\n return [encounter[1], level]\r\n end",
"def relevant?(user_context)\n result = true\n\n if self.tags.blank?\n result &&= self.hidden_tag.relevant?(user_context)\n else\n result &&= self.tags.any? { |tag| tag.relevant?(user_context) }\n end\n \n result\n end",
"def includes?(time)\n next_occurrence = next_occurrence(time) || last_occurrence\n residue_for(time) == @residue \\\n && !next_occurrence.nil? \\\n && time_overlaps?(time, next_occurrence, next_occurrence + duration)\n end",
"def in_contest?(pet)\n pet.id == challenger.id || pet.id == challenged.id\n end",
"def has_individual_result?(gender_type, pool_type, event_type, category_code)\n # team.meeting_individual_results\n # .is_not_disqualified\n # .for_gender_type(gender_type)\n # .for_pool_type(pool_type)\n # .for_event_type(event_type)\n # .for_category_code(category_code).exists?\n team.meeting_individual_results\n .is_not_disqualified\n .for_team_best(pool_type, gender_type, category_code, event_type).exists?\n end",
"def equip_atype_ok?(atype_id)\r\n features_set(FEATURE_EQUIP_ATYPE).include?(atype_id)\r\n end",
"def seed_data_exists?(type)\n !processed_seed_data[type.to_s].nil?\n end",
"def check_item_needed(type, id)\n action = eval(type + '_Need_Items.dup')\n equipment = eval(type + '_Need_Equiped.dup')\n if action.include?(id)\n for need in action[id]\n next if need[0] == 'i' and $game_party.item_number(need[1]) >= need[2]\n next if need[0] == 'a' and $game_party.armor_number(need[1]) >= need[2]\n next if need[0] == 'w' and $game_party.weapon_number(need[1]) >= need[2]\n return false\n end\n end\n if equipment.include?(id)\n for need in equipment[id]\n equipments = armors.dup if need[0] == 'a'\n equipments = weapons.dup if need[0] == 'w'\n for equip in equipments\n if action_id(equip) == need[1] and (need[0] == 'a' and \n $game_party.armor_number(need[1]) >= [need[2] - 1, 0].max) or\n (need[0] == 'w' and $game_party.weapon_number(need[1]) >= [need[2] - 1, 0].max)\n return true \n end\n end\n end\n return false\n end\n return true\n end",
"def find_valid_encounter_type_for_time(base_type, time)\r\n ret = nil\r\n if PBDayNight.isDay?(time)\r\n try_type = nil\r\n if PBDayNight.isMorning?(time)\r\n try_type = (base_type.to_s + \"Morning\").to_sym\r\n elsif PBDayNight.isAfternoon?(time)\r\n try_type = (base_type.to_s + \"Afternoon\").to_sym\r\n elsif PBDayNight.isEvening?(time)\r\n try_type = (base_type.to_s + \"Evening\").to_sym\r\n end\r\n ret = try_type if try_type && has_encounter_type?(try_type)\r\n if !ret\r\n try_type = (base_type.to_s + \"Day\").to_sym\r\n ret = try_type if has_encounter_type?(try_type)\r\n end\r\n else\r\n try_type = (base_type.to_s + \"Night\").to_sym\r\n ret = try_type if has_encounter_type?(try_type)\r\n end\r\n return ret if ret\r\n return (has_encounter_type?(base_type)) ? base_type : nil\r\n end",
"def all_resident?\n lead_type == \"all_resident\"\n end",
"def is(type)\n @value.include?(type)\n end",
"def any_of_type?(type)\n keys_by_type[type]&.any?\n end",
"def per_facility?(account_type)\n facility_account_types.include?(account_type.to_s.classify)\n end",
"def equip_type_sealed?(etype_id)\r\n features_set(FEATURE_EQUIP_SEAL).include?(etype_id)\r\n end",
"def matches_type? identifier, type\n case type\n\n # Simple setter method,\n # as in this.setTitle('Projects')\n when \"setter\"\n /\\Aset(?=[[:upper:]])/.match(identifier).present?\n\n # Introduces translation scope,\n # as in Ext.define(\"ads.locale.en.view.project.List\", { ... })\n when \"scope\"\n %w[define create].include? identifier\n\n # First method in chained call,\n # as lookupReference in this.lookupReference('editButton').setText('Edit')\n when \"finder\"\n %w[lookupReference queryById].include? identifier\n\n # Attribute,\n # as in format: 'd-m-Y'\n when \"attribute\"\n not %w[override].include? identifier\n\n # Data compound attribute,\n # as in data: [ { \"name\" : \"Succeed\", \"value\": \"succeed\"} ]\n when \"data\"\n %w[data].include? identifier\n\n when \"any\"\n true\n else\n false\n end\n end",
"def equip_wtype_ok?(wtype_id)\r\n features_set(FEATURE_EQUIP_WTYPE).include?(wtype_id)\r\n end",
"def capturable?\n [ :base, :harbour, :airfield ].include?( @type ) and\n @faction != @game.my_faction\n end",
"def is_reservable?\n if self.is_a? Patient\n return false\n end\n true\n end",
"def affects?(event)\n !event.deleted &&\n time_matches?(event) &&\n faculty_matches?(event) &&\n semester_matches?(event) &&\n course_matches?(event) &&\n timetable_slot_matches?(event)\n end",
"def attending?(exerciseclass)\n \texerciseclass.participants.include?(self)\n \tend",
"def perform_encounter(time, entity, record_encounter = true)\n # set process to true so that the process method knows we've done a successful encounter\n @processed = true\n @time = time\n\n if @reason\n cond = @context.most_recent_by_name(@reason)\n cond = cond.symbol if cond\n cond = entity[@reason].to_sym if cond.nil? && entity[@reason]\n end\n\n if record_encounter\n value = add_lookup_code(Synthea::ENCOUNTER_LOOKUP)\n value[:class] = @encounter_class\n entity.record_synthea.encounter(symbol, time, cond)\n end\n\n # Look through the history for conditions to diagnose\n @context.history.each do |h|\n if h.is_a?(OnsetState) && !h.diagnosed && h.target_encounter == @name\n h.diagnose(time, entity)\n end\n end\n end",
"def associated?(participant) \n (not participant.nil?) and participant_ids.include?(participant.id)\n end",
"def has_category_by_type?(type)\n categories.where(:main_type => type).any?\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 match(env, target)\n target_type = target.kind_of?(Type) ? target : target.pione_type(env)\n while target_type do\n return true if self == target_type\n target_type = target_type.parent_type\n end\n return false\n end",
"def attending?(fun_event)\n eu_rels.find_by(attended_id: fun_event)\n end",
"def mandatory_work_characteristic(arg_pgu_adults_collection,arg_week_start_date,arg_week_end_date)\n mandatory_characteristic_present = false\n if arg_pgu_adults_collection\n\t arg_pgu_adults_collection.each do |each_client|\n\t\t mandatory_characteristic = ClientCharacteristic.has_mandatory_work_characteristic_in_a_given_date_range(each_client.id,arg_week_start_date,arg_week_end_date)\n\t\t\tif mandatory_characteristic.present?\n\t\t\t mandatory_characteristic_present = true\n\t\t\t break\n\t\t\tend\n\t end\n else\n #no adults present\n end\n return mandatory_characteristic_present\nend",
"def available_for_interview?(time, timeblock)\n !interview_availabilities.find_by_time_and_offering_interview_timeblock_id(time.to_time, timeblock).nil?\n end",
"def patient_should_proceed_after_diagnosis?\n procedure_type = concept 'Procedure type'\n x_ray = concept 'Xray'\n clinical = concept 'Clinical'\n ultrasound = concept 'Ultrasound'\n observation = Observation.joins(:encounter).where(\n 'person_id = ? AND concept_id = ? AND (value_coded = ? || value_coded = ? || value_coded = ?) AND encounter.encounter_type = ?',\n @patient.patient_id, procedure_type.concept_id, x_ray.concept_id, clinical.concept_id, ultrasound.concept_id, encounter_type(DIAGNOSIS).id\n ).order(obs_datetime: :desc).first\n\n begin\n time_diff = (Time.current - observation.obs_datetime)\n minutes = (time_diff / 60)\n (minutes >= 1 / 60)\n rescue StandardError\n false\n end\n end",
"def includes?(participant)\n participants.include?(participant)\n end",
"def encounters_type_params\n params.require(:encounters_type).permit(:name, :description, :creator, :date_created, :retired, :retired_by, :date_retired, :retire_reason, :uuid)\n end",
"def include?(teleport)\n return false if !teleport.discovered && !CSCA::TELE::SHOW_UNDISCOVERED\n return true if @category == :all\n return true if @category == teleport.type\n return false\n end",
"def perform_encounter(time, entity, record_encounter = true)\n # set process to true so that the process method knows we've done a successful encounter\n @processed = true\n @time = time\n\n if @context.current_encounter\n # if there is a current non-wellness encounter, end it with no discharge type\n enc = @context.most_recent_by_name(@context.current_encounter)\n entity.record_synthea.encounter_end(enc.symbol, time) unless enc.wellness\n end\n @context.current_encounter = @name\n\n if @reason\n cond = @context.most_recent_by_name(@reason)\n cond = cond.symbol if cond\n cond = entity[@reason].to_sym if cond.nil? && entity[@reason]\n end\n\n # find closest service provider\n service = @encounter_class\n provider = Synthea::Provider.find_closest_service(entity, service)\n\n # hash below is added so that procedures during encounters will have a reference to provider\n entity.add_current_provider(@context.name, provider)\n\n if record_encounter\n value = add_lookup_code(Synthea::ENCOUNTER_LOOKUP)\n value[:class] = @encounter_class\n options = { 'reason' => cond, provider: provider }.compact\n entity.record_synthea.encounter(symbol, time, options)\n\n # increment number of encounters performed by service providing hospital\n provider.increment_encounters\n end\n\n # Look through the history for conditions to diagnose\n @context.history.each do |h|\n if h.is_a?(OnsetState) && !h.diagnosed && h.target_encounter == @name\n h.diagnose(time, entity)\n end\n end\n end",
"def treatment_check(ty)\n if ty.citation\n if ty.treatment.nil?\n return\n elsif !ty.citation.treatments.include?(ty.treatment)\n \": <span class='red_back'>treatment_id: #{ty.treatment.id}, not in associated citation associated treatments!</span>\"\n end\n end\n\n end",
"def occupied?\n !patient.nil?\n end",
"def present_study?(date = Time.now)\n study.id == 1 || (study.id == 2 && study_form_changed_on && study_form_changed_on > date.to_date)\n end",
"def pokemon_matching_requirements?(pkmn, wanted_data)\n return pkmn.id == wanted_data[0] && pkmn.level >= wanted_data[1] &&\n pkmn.level <= wanted_data[2] && (wanted_data[3] == 0 || pkmn.gender == wanted_data[3])\n end",
"def get_by_type(type)\r\n facts2typerule = {:methodcall => [:cant_access, :can_access],\r\n :inheritance => [:cant_extend, :can_extend],\r\n :objcreation => [:cant_create, :can_create]}\r\n\r\n find_all { |x| facts2typerule[type].index(x.type_interaction) != nil }\r\n end",
"def applies_type?(scope, type); end",
"def for_one_friend?\n # If kind = skill, and effect scope is for ally (including 0 HP)\n if @kind == 1 and [3, 5].include?($data_skills[@skill_id].scope)\n return true\n end\n # If kind = item, and effect scope is for ally (including 0 HP)\n if @kind == 2 and [3, 5].include?($data_items[@item_id].scope)\n return true\n end\n return false\n end",
"def attending?(event)\n \tattendances.find_by(event_id: event.id)\n \tend",
"def contains?(target)\n return false if kind == 'state' && target.kind == 'country'\n return false if kind == 'zipcode' && ['country', 'state'].include?(target.kind)\n return false if zone_members.empty? || target.zone_members.empty?\n\n if kind == target.kind\n target.zoneables.each do |target_zoneable|\n return false unless zoneables.include?(target_zoneable)\n end\n elsif target.kind == 'zipcode'\n target.zoneables.each do |target_zip|\n # zips contained in states\n if kind == 'state'\n return false unless zoneables.include?(target_zip.state)\n # zips contained in countries\n elsif kind == 'country'\n return false unless zoneables.include?(target_zip.state.try(:country))\n end\n end\n elsif\n # states contained in countries\n target.zoneables.each do |target_state|\n return false unless zoneables.include?(target_state.country)\n end\n end\n true\nend",
"def allow?(type)\n found = (@only.nil?) ? true : lookup(type, @only)\n return false unless found\n\n found = (@except.nil?) ? true : lookup(type, @except)\n return false if found\n\n true\n end",
"def include?(item)\r\r\n item[:discovered]\r\r\n end",
"def includes?(participant)\n return participants.include?(participant)\n end",
"def includes?(participant)\n return participants.include?(participant)\n end",
"def includes?(participant)\n return participants.include?(participant)\n end",
"def conjunction?\n type != HQMF::PopulationCriteria::OBSERV\n end",
"def find_by_type(medium, *args)\n path = \"medium/#{medium}\"\n Rdigg.fetch(path, @@type, args)\n end",
"def choose_wild_pokemon_for_map(map_ID, enc_type)\r\n if !enc_type || !GameData::EncounterType.exists?(enc_type)\r\n raise ArgumentError.new(_INTL(\"Encounter type {1} does not exist\", enc_type))\r\n end\r\n # Get the encounter table\r\n encounter_data = GameData::Encounter.get(map_ID, $PokemonGlobal.encounter_version)\r\n return nil if !encounter_data\r\n enc_list = encounter_data.types[enc_type]\r\n return nil if !enc_list || enc_list.length == 0\r\n # Calculate the total probability value\r\n chance_total = 0\r\n enc_list.each { |a| chance_total += a[0] }\r\n # Choose a random entry in the encounter table based on entry probabilities\r\n rnd = 0\r\n chance_rolls.times do\r\n r = rand(chance_total)\r\n rnd = r if r > rnd # Prefer rarer entries if rolling repeatedly\r\n end\r\n encounter = nil\r\n enc_list.each do |enc|\r\n rnd -= enc[0]\r\n next if rnd >= 0\r\n encounter = enc\r\n break\r\n end\r\n # Return [species, level]\r\n level = rand(encounter[2]..encounter[3])\r\n return [encounter[1], level]\r\n end",
"def is_playup_kind?(type)\n types = ([playup_type] + ancestor_types)\n types.include?(type)\n end",
"def candidate_qualifies?(candidate)\n checkLanguages = ['Ruby', 'Python']\n\n if candidate[:languages].select{ |language| checkLanguages.include? language }\n language = true\n else\n language = false\n end\n\n experienced = experienced? candidate\n\n\n experienced &&\n candidate[:github_points] >= 100 &&\n language &&\n candidate[:date_applied] > Date.today - 15 &&\n candidate[:age] > 17\nend",
"def research_starters_match_in_profile\n @info.available_related_content_types.include? 'rs'\n end",
"def include?(item)\r\n $game_party.usable?(item)\r\n end",
"def valid_type? item_type\n [BATTLE_ITEMS, KEY_ITEMS, INGREDIENTS, TREASURES, CAR_PARTS, LEISURE].include?(item_type)\n end",
"def available_on?(day, hour)\n @availability[day].include?(hour)\n end",
"def obj_exists_and_is_not_type?(obj:, type:)\n obj.nil? ? false : obj != type\n end",
"def summoned?(character)\n return (@pets + @monsters).include?(character)\n end",
"def includes_r_and_d?\n party_ids = @parties.map(&:id)\n party_ids.include?('D') && party_ids.include?('R')\n end",
"def training_required?(person_or_type)\n aud = Event.process_audience(person_or_type)\n return false if self[aud.to_s.downcase + \"_training_optional\"]\n !training_for(person_or_type).nil?\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 of_interest?\n of_interest == params.fetch(:watching,\n session.fetch(:watching,\n of_interest))\n end"
] |
[
"0.6986266",
"0.6986266",
"0.55290514",
"0.54396576",
"0.54148734",
"0.5191949",
"0.5113055",
"0.509446",
"0.50830734",
"0.5069062",
"0.5064489",
"0.4943027",
"0.49399996",
"0.4893817",
"0.4877564",
"0.48285052",
"0.48224702",
"0.4811259",
"0.4806268",
"0.472354",
"0.47001582",
"0.4695555",
"0.46854883",
"0.467303",
"0.46718636",
"0.4650395",
"0.46467495",
"0.46113262",
"0.4559462",
"0.45424497",
"0.4530563",
"0.45147213",
"0.44969743",
"0.44932848",
"0.4488214",
"0.447462",
"0.4471114",
"0.44675505",
"0.4463975",
"0.44630045",
"0.44383404",
"0.44254148",
"0.44233465",
"0.44164783",
"0.44136792",
"0.4398693",
"0.43947318",
"0.43915913",
"0.4382058",
"0.43781066",
"0.43770295",
"0.43732345",
"0.43681967",
"0.4362768",
"0.43567297",
"0.4354998",
"0.43497515",
"0.4339973",
"0.43387234",
"0.4336677",
"0.43288007",
"0.43254372",
"0.43197763",
"0.43082696",
"0.43080828",
"0.43051028",
"0.4294689",
"0.42918482",
"0.42898378",
"0.42884967",
"0.42824048",
"0.42792115",
"0.42671463",
"0.42655537",
"0.4262413",
"0.4262054",
"0.425839",
"0.4256803",
"0.42561063",
"0.42512774",
"0.42476803",
"0.4245747",
"0.42422512",
"0.42422512",
"0.42422512",
"0.42419422",
"0.42354178",
"0.42274392",
"0.42270726",
"0.42177546",
"0.42162853",
"0.42104024",
"0.4210206",
"0.42087796",
"0.42025146",
"0.41930982",
"0.41930845",
"0.41924584",
"0.41922528",
"0.41856995"
] |
0.68180025
|
2
|
if minor found TB negative through DIAGONIS, give them ITP
|
def patient_is_under_five?
person = Person.find_by(person_id: @patient.patient_id)
((Time.zone.now - person.birthdate.to_time) / 1.year.seconds).floor < UNDER_FIVE_AGE_LIMIT
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def minor; end",
"def minor; end",
"def minor; end",
"def minor=(_arg0); end",
"def target_tb_lmt\n return 0 if (b=battler).nil?\n b.target_tb_lmt + target_lmt_equip_mod\n end",
"def imc\n\t\tnum = (@peso/(@talla*@talla)).round(2)\n\t\tif num < 18.5\n\t\t\tnum #- Bajo peso\"\n\t\telsif num > 18.5 and num < 24.9\n\t\t\tnum #- Adecuado\"\n\t\telsif num > 25.0 and num < 29.9\n\t\t\tnum #- Sobrepeso\"\n\t\telsif num > 30.0 and num < 34.9\n\t\t\tnum #Obesidad grado 1\"\n\t\telsif num > 35.0 and num < 39.9\n\t\t\tnum #- Obesidad grado 2\"\n\t\telsif num > 40\n\t\t\tnum #- Obesidad grado 2\"\n\t\tend\t\t\t\n\tend",
"def minor_par_prices(corp)\n price = minor_required_train(corp).price\n stock_market.market.first.select { |p| (p.price * 10) > price }.reject { |p| p.type == :endgame }\n end",
"def firmware_minor\n raw_response[1]\n end",
"def number_battled_brilliant_tier(species)\r\n number = number_battled(species)\r\n if number >= 200\r\n return 2.0\r\n elsif number >= 50\r\n return 1.6\r\n elsif number >= 20\r\n return 1.3\r\n else\r\n return 1.0\r\n end\r\n end",
"def masterwork_prob_bonus; 0; end",
"def native_kendalTauish_cost( pi )\n EpsSrraNative::rank_aggergate_upperW(@n){ |u,v| pi.pref(u,v) == @w[u][v] ? 0 : 1 } \n end",
"def find_centos_minor_version\n os_minor_version = ''\n kernel_patch_version = find_kernel_patch_version\n\n os_minor_version = '7' if kernel_patch_version >= '1062'\n os_minor_version = '8' if kernel_patch_version >= '1127'\n os_minor_version = '9' if kernel_patch_version >= '1160'\n\n os_minor_version\nend",
"def dev_minor() end",
"def who_is_beta\n fairness = fairness_level_comparison\n if fairness < 0\n -1\n elsif fairness > 0\n 1\n else\n 0\n end\n end",
"def mambo_no_5; end",
"def minor_version\n @version_helper.minor\n end",
"def minor_version\n @version_helper.minor\n end",
"def minor_version\n @version_helper.minor\n end",
"def minor_version; end",
"def minor(m,i)\n n = m.length\n mb = m[1..-1]\n mb.map{|row| row.first(i) + row[i+1..n-1]}\nend",
"def num_tankoubon; end",
"def mp_on_kill\n (maxmp * features_sum(:mp_on_kill)).to_i\n end",
"def max_charging_power; end",
"def fuel_blocks\n bay = @detail.fuels.detect { |b| b.type_id != TYPE_ID_STRONT }\n return 0 unless bay\n bay.quantity\n end",
"def meta_send_op_gt\n <<-CODE\n t1 = stack_pop();\n t2 = stack_back(0);\n if(FIXNUM_P(t1) && FIXNUM_P(t2)) {\n j = N2I(t1);\n k = N2I(t2);\n stack_set_top((j > k) ? Qtrue : Qfalse);\n } else {\n _lit = global->sym_gt;\n t2 = Qnil;\n j = 1;\n goto perform_no_ss_send;\n }\n CODE\n end",
"def dev_major() end",
"def unstable?\n harm > 3\n end",
"def dorian_b2(root=nil)\n Scale.melodic_minor(root).rotate(1)\n end",
"def battery_weight; end",
"def beta_x_bp\n case @health_profile.male\n when true\n systolic_blood_pressure_log * (@health_profile.antihypertensive_drugs ? 1.92672 : 1.85508)\n when false\n systolic_blood_pressure_log * (@health_profile.antihypertensive_drugs ? 2.88267 : 2.81291)\n end\n end",
"def neginv(b) return \"@SP\\nA=M-1\\nM=\"+b+\"M\\n\" end",
"def driving_low?\n output? && !@mplab_pin.high?\n end",
"def driving_high?\n output? && @mplab_pin.high?\n end",
"def high_five; end",
"def getTier(colIndex,rowIndex)\r\n if (colIndex > @columns-1 || colIndex < 0 || rowIndex > @rows-1 || rowIndex < 0)\r\n return 0 #Checks if the tile is in the bounds of the grid.\r\n else\r\n return @tile[colIndex][rowIndex].tier\r\n end\r\nend",
"def minor_upgrade?(to)\n nil unless installed?\n major_version(installed_version?) == major_version(to) && minor_version(installed_version?) != minor_version(to)\n end",
"def rdev_minor() end",
"def test_comparison_minor\n value1_ = ::Versionomy.create(:major => 2, :tiny => 1, :tiny2 => 3, :release_type => :release_candidate, :release_candidate_version => 2)\n value2_ = ::Versionomy.create(:major => 2, :minor => 1, :release_type => :alpha)\n assert(value2_ > value1_)\n end",
"def minor_key?\n @data[1]\n end",
"def big_bang(bb = 0)\n # FIXME: this is temporary. Eventually this will call a callback in the Neater script.\n v = Vector[@thrust, 0, 0]\n @thrust += @bang * bb\n @thrust -= @thrust * @thrust_decay * @dt\n v\n end",
"def ayarla(toplam)\n if toplam > 0\n return 1\n else\n return 0\n end\n end",
"def minor(version)\n res = 0\n res = Regexp.last_match(1) if version =~ /^\\s*\\d+\\.(\\d+)\\.\\d+/\n res\n end",
"def test_jmpt_does_not_branch_when_tos_is_false\n @ctx.constants = [1,0,5]\n @bc.codes = [:cls, :pushc, 0, :pushc, 1, :eq, :jmpt, 13, :cls, :pushc, 0, :jmp, 16, :cls, :pushc, 5, :halt]\n assert_eq @ci.run, 1\n end",
"def best_suffix(i)\n matrix[i...length].map(&:max).inject(0.0, &:+)\n end",
"def modeler_description\n return \"This EEM adds EMS logic to the model that actuates the condenser loop setpoint manager. The added logic first checks the outdoor air wet-bulb temperature (OAWBT). If OAWBT is between 14.3C and 22.7C then the condenser loop setpoint temperature is set to OAWBT + 4C. If the OAWBT is above 22.7C, the condenser loop setpoint temperature is set to 26.7C. If the OAWBT is below 14.3C, the condenser loop setpoint temperature is set to 18.3C.\"\n end",
"def max_tp\r\n return 100\r\n end",
"def magic_alignement()\n\t\tdt = @buswi[0][0]\n\t\tokb = [@buswi[0]]\n\n\t\tremb = @buswi[1..].clone\n\t\tt=0\n\t\tloop do \n\t\t\tt = t + dt\n\t\t\tokb=[]\n\t\t\tremb.each do |p,i|\n\t\t\t\tif (t+i)%p == 0\n\t\t\t\t\tdt = dt.lcm(p)\n\t\t\t\t\tokb << [p,i]\n\t\t\t\tend\n\t\t\tend\n\t\t\tremb = remb - okb\n\t\t\tbreak if remb.empty?\n\t\tend\n\t\tt\n\tend",
"def meta_send_op_lt\n <<-CODE\n t1 = stack_pop();\n t2 = stack_back(0);\n if(FIXNUM_P(t1) && FIXNUM_P(t2)) {\n j = N2I(t1);\n k = N2I(t2);\n stack_set_top((j < k) ? Qtrue : Qfalse);\n } else {\n _lit = global->sym_lt;\n t2 = Qnil;\n j = 1;\n goto perform_no_ss_send;\n }\n CODE\n end",
"def major; end",
"def major; end",
"def major; end",
"def cellular_block_wi_fi_tethering\n return @cellular_block_wi_fi_tethering\n end",
"def imc_tabla\n\t\tx = self.indice_masa_corporal\n\n\n\t\tif x < 18.5\n\t\t\treturn \"#{x} < 18.5 -- Bajo peso -- Delgado\"\n\t\telsif x >= 18.5 && x <= 24.9\n\t\t\treturn \"18.5 < #{x} < 24.9 -- Adecuado -- Aceptable\"\n\t\telsif x > 24.9 && x <= 29.9\n\t\t\treturn \"25.0 < #{x} < 29.9 -- Sobrepeso -- Sobrepeso\"\n\t\telsif x > 29.9 && x <= 39.9\n\t\t\treturn \"30.0 < #{x} < 39.9 -- Obesidad grado 1 -- Obesidad\"\n\t\telsif x > 39.9\n\t\t\treturn \" #{x} > 40 -- Obesidad grado 2 -- Obesidad\"\n\t\tend\n\n\tend",
"def combustion_eff_to_thermal_eff(combustion_eff)\n \n return combustion_eff - 0.007 # Per PNNL doc, Boiler Addendum 90.1-04an\n \nend",
"def blg; end",
"def fd_loglike_b_eq6(m)\n rho=@rho\n if rho.abs>0.9999\n rho= (rho>0) ? 0.9999 : -0.9999\n end\n total=0\n @nr.times do |i|\n @nc.times do |j|\n total+=@matrix[i,j].quo(pd[i][j]+EPSILON) * fd_loglike_cell_b(i,j,m)\n end\n end\n total\n end",
"def xlate_minor_version()\n return MIN_VERSION_XLATES[@minor_version] if (MIN_VERSION_XLATES.has_key?(@minor_version))\n return(@minor_version.to_s) \n end",
"def elv_tygnon\n atk < dfe\n end",
"def suitable_halfs\n required_amount\n end",
"def max_descent_speed; end",
"def number_battled_shiny_tier(species)\r\n number = number_battled(species)\r\n if number >= 500\r\n return [5,30]\r\n elsif number >= 300\r\n return [4,30]\r\n elsif number >= 200\r\n return [3,25]\r\n elsif number >= 100\r\n return [2,20]\r\n elsif number >= 50\r\n return [1,15]\r\n else\r\n return [0,0]\r\n end\r\n end",
"def benchtupe\n @benchtupe =\n if @tupe_flag == 'Y'\n @benchsubtotal3 * @framework_rates['M148']\n else\n @benchtupe = 0\n end\n end",
"def battery_type; end",
"def total_high\n if is_soft\n return total[1]\n end\n return total\n end",
"def set_gt major, minor, value\n if not @stats.has_key?(major)\n @stats[major] = { minor => value }\n elsif not @stats[major].has_key?(minor)\n @stats[major][minor] = value\n elsif @stats[major][minor] < value\n @stats[major][minor] = value\n end\n end",
"def glte(b,ln)\n\treturn arith(\"-\",\"D\")+\n\t\"@T\"+ln.to_s+\"\\nD;\"+b+\"\\n@SP\\nA=M-1\\nM=0\\n@CT.\"+\n\tln.to_s+\"\\n0;JMP\\n(T\"+ln.to_s+\")\\n@SP\\nA=M-1\\nM=-1\\n(CT.\"+ln.to_s+\")\\n\"\nend",
"def classifyLR(data2Classify, weightingMtx)\n t = sigmod(data2Classify.multi(weightingMtx).sum)\n if(t>=0.5)\n return 1\n else\n return 0\n end\n end",
"def bsb_number; end",
"def major_extra\n MajorExtra.find_by_major_branch_and_major_pathway_and_major_last_yr_and_major_last_qtr_and_major_abbr(\n major_branch, major_pathway, major_last_yr, major_last_qtr, major_abbr\n )\n end",
"def processa_bc\n # puts(format(\"%<n>4i ATTESTATIONS INSERIDAS #{BD}.eth2at\", n: apibc.novtx.empty? ? 0 : dml(eth2at_ins)))\n # puts(format(\"%<n>4i PROPOSALS INSERIDAS #{BD}.eth2pr\", n: apibc.novkx.empty? ? 0 : dml(eth2pr_ins)))\n puts(format(\"%<n>4i BALANCES\\tETH2\\t\\tINSERIDOS eth2bh\", n: apibc.nov.empty? ? 0 : dml(eth2bh_ins)))\n end",
"def required_fuel(mass)\n fuel = (mass / 3).floor - 2\n fuel < 0 ? 0 : fuel\nend",
"def preferred_264(fields)\n fields.select { |field| field.indicator1 == '3' && field.indicator2 == '1' }.last ||\n fields.select { |field| field.indicator2 == '1' }.last ||\n fields.select { |field| field.indicator1 == '3' && field.indicator2 =~ /[023]/ }.last ||\n fields.select { |field| field.indicator2 != '4' }.last\n end",
"def puppet_infrastructure_tune_current\n puts \"Checking current PE tune...\"\n puts\n\n output = on(master, \"puppet infrastructure tune --current\").output\n\n puts output\n puts\n\n output\n end",
"def gettarget(pc, op)\n x = field_x(op)\n hibits = (pc + 4) & 0xf0000000\n lobits = x << 2\n\n (hibits | lobits)\nend",
"def latency_of(dist)\n len=(dist == 0) ? OVERHEAD_INNER : OVERHEAD_OUTER + dist\n if len <= 300 # [cm]\n #Copper cable\n len*4.4E-9 #HP BladeSystem c-Class 40G QSFP+ to QSFP+ Direct Attach Copper Cable\n else\n # Optical cable \n len*5.2E-9 #Speed of light in glass= 190000km/sec\n end\nend",
"def thnum()\n #This is a stub, used for indexing\n end",
"def atk_lmt_equip_mod\n return 0 if battler.nil? || !battler.is_a?(Game_Actor)\n battler.equips.inject(0) do |sum,e| \n mod = e.nil? ? 0 : (e.batk_acts_mod ||= 0)\n sum += mod\n end\n end",
"def vat_number; end",
"def locrian_6(root=nil)\n Scale.harmonic_minor(root).rotate(1)\n end",
"def get_threshold\n d = self.vspecs.select(:value).where(name: 'threshold').first\n return d != nil ? d.value : d\n end",
"def circuit_breaker; end",
"def preferred_260(fields)\n fields.select { |field| field.indicator1 == '3' }.last || fields.last\n end",
"def t1pb ast\n lmp(pgm_sl(ast).first)\n #\nend",
"def modeler_description\n return \"Reads the Boiler Nominal Capacity from an EnergyPlus .eio file and hardsizes the Nominal Capacity of the Boiler to this value.\"\n end",
"def bumpMinor()\n\t\t\t\t@minor += 1\n\t\t\t\t@build = 0\n\t\t\tend",
"def received_transmitted(max_kbs=MAX_KBS)\n lines = `sar -n DEV #{@sleep} 1`.split(\"\\n\")\n relevant_lines = lines[3..-1].take_while {|line| line =~ /\\w/ }\n data_ar = relevant_lines.map do |line|\n data = line.split(/\\s+/)\n # interface, rxkb, txkb\n [data[2], percent_no_gt(max_kbs, data[5].to_f), percent_no_gt(max_kbs, data[6].to_f)]\n end\n data = data_ar.find {|ar| ar[0] == NETWORK_INTERFACE }\n @received_transmitted = data[1..-1]\n end",
"def get major, minor\n return 0 unless @stats.has_key?(major)\n return 0 unless @stats[major].has_key?(minor)\n return @stats[major][minor]\n end",
"def minimum_required_minor_engine_version\n data.minimum_required_minor_engine_version\n end",
"def fuel_needed(mass)\n return (mass / 3) - 2\nend",
"def find_max_value(array)\n \n (find_max_value(scale)).to eq(5)\n (find_max_value(scale_2)).to eq(6)\n (find_max_value(hill)).to eq(5)\n (find_max_value(valley)).to eq(5)\n (find_max_value(zig_zag)).to eq(1000)\n end",
"def checkGtir(before, after, instruction)\n\ta = instruction[1] #val\n\tb = instruction[2] #reg\n\tc = instruction[3] #reg\n\n\treturn (after[c] == 1 && a > before[b]) || (after[c] == 0 && a <= before[b])\nend",
"def tpr(i)\n [ @tp[i].quo(@tp[i] + @n[i] - @tn[i]), 1 ].min\n end",
"def major\n @major\n end",
"def get_band()\n return(get_cmd('BN;',0.1,0.5,3).gsub(/^BN/,'').gsub(/;$/,'').to_i)\nend",
"def pe66v5()\n\tprintf \"Using meathod pe66v5 \\n\";\n\tda = [2]\n\t3.upto(1000) do |d|\n\t\tif((d ** 0.5) % 1 != 0) then \n\t\t\tda.push(d)\n\t\tend\n\t\t\n\tend\n\tda.each do |d|\n\t\tprintf \"%d \",d\n\tend\n\tprintf \"\\n\"\n\tmax = 0;\n\ttotal = 0;\n\tda.each do |d|\t\n\t\t1.upto(10000) do |x|\n\t\t\t1.upto(10000) do |y|\n\t\t\t\ttotal = d * (y ** 2 ) + 1\n\t\t\t\tif(total != x ** 2 ) then next end\n\t\t\t\tif(x > max) then\n\t\t\t\t\tmax = x\n\t\t\t\t\tprintf \"Found x = %d d = %d y = %d\\n\",x,d,y\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend\nend",
"def tankvol(h, d, vt)\n\nend",
"def firmware_major\n raw_response[2]\n end",
"def _c_t_expert_level\n case currency\n when 'RMB' then cpt.to_i >= 1500 ? 'Premium Expert' : 'Standard Expert'\n when 'USD' then cpt.to_i >= 200 ? 'Premium Expert' : 'Standard Expert'\n else 'Standard Expert'\n end\n end",
"def clutchPedal t\n clutch=0\n @clutch.each_with_index {|c,i| clutch+=c*(t**i)}\n if clutch<0\n 0\n elsif clutch<=1\n clutch\n else\n 1\n end\n end",
"def ndp_tgt; self[:ndp_tgt].to_i; end",
"def check_p2 operations, vol\n operations.each do |op| \n if op.temporary[vol] < 0.4\n return \"There are volumes smaller than 0.4; please use the P2!\"\n end\n end\n \"\"\n end"
] |
[
"0.6048206",
"0.6048206",
"0.6048206",
"0.5658443",
"0.5586637",
"0.54840016",
"0.5347137",
"0.5347136",
"0.5245033",
"0.5197787",
"0.51512146",
"0.51436746",
"0.51358783",
"0.51221156",
"0.51154816",
"0.5113061",
"0.5113061",
"0.5113061",
"0.5052149",
"0.50505817",
"0.500917",
"0.49987268",
"0.49963492",
"0.4989555",
"0.49742916",
"0.49672964",
"0.49519977",
"0.4919975",
"0.4915139",
"0.491032",
"0.4902818",
"0.48954403",
"0.48920938",
"0.48866528",
"0.48622692",
"0.48512015",
"0.48413152",
"0.4838498",
"0.48352483",
"0.48281184",
"0.4819829",
"0.48169252",
"0.48134315",
"0.47985157",
"0.47969452",
"0.47944808",
"0.47817594",
"0.47594842",
"0.47309774",
"0.47309774",
"0.47309774",
"0.47299156",
"0.47248462",
"0.47164026",
"0.47151026",
"0.47042468",
"0.46994513",
"0.46957272",
"0.46881393",
"0.46849757",
"0.46798685",
"0.46795616",
"0.46670252",
"0.46666688",
"0.46602893",
"0.46587786",
"0.46577293",
"0.46519113",
"0.46445554",
"0.46279073",
"0.4620888",
"0.46195066",
"0.46167964",
"0.46158537",
"0.46113038",
"0.4609202",
"0.46088675",
"0.46077853",
"0.46073622",
"0.4606077",
"0.46059385",
"0.46017686",
"0.4599353",
"0.45992628",
"0.45983624",
"0.4596969",
"0.45968798",
"0.45967934",
"0.45961946",
"0.45961335",
"0.45935616",
"0.45885167",
"0.45861086",
"0.45836717",
"0.4582315",
"0.45769754",
"0.45697984",
"0.4564032",
"0.45610002",
"0.45600477",
"0.45592695"
] |
0.0
|
-1
|
return to the patient dashboard if patient lab test has been ordered within 1 hour
|
def patient_should_proceed_after_lab_order?
test_type = concept 'Test type'
tb_concept = concept 'Tuberculous'
observation = Observation.joins(:encounter).where(
'person_id = ? AND concept_id = ? AND value_coded = ? AND encounter.encounter_type = ?',
@patient.patient_id, test_type.concept_id, tb_concept.concept_id, encounter_type(LAB_ORDERS).id
).order(obs_datetime: :desc).first
begin
time_diff = ((Time.now - observation.obs_datetime.to_time)).to_i
(time_diff >= 12)
rescue StandardError
false
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def in_test\n virtualtest_status = current_user.sk.test_status(@virtualtest)\n render 'errors/access_refused' and return if virtualtest_status == \"not_started\"\n redirect_to virtualtests_path and return if virtualtest_status == \"finished\" # Smoothly redirect because it can happen when timer stops\n end",
"def success\n @city = City.find(params[:city_id])\n @event = Event.find(params[:id])\n if @event.created_at < Time.now - 1.hour\n redirect_to event_path( @city, @event )\n else\n add_breadcrumb \"New Event\", new_event_path( @city )\n add_breadcrumb @event.name, event_path( @city, @event )\n end\n end",
"def can_be_online\n date_in_one_hour = 1.hour.from_now\n if @contest.contestproblems.count == 0\n flash[:danger] = \"Un concours doit contenir au moins un problème !\"\n redirect_to @contest\n elsif @contest.contestproblems.first.start_time < date_in_one_hour\n if !Rails.env.development?\n flash[:danger] = \"Un concours ne peut être mis en ligne moins d'une heure avant le premier problème.\"\n redirect_to @contest\n else\n flash[:info] = \"Un concours ne peut être mis en ligne moins d'une heure avant le premier problème (en production).\"\n end\n end\n end",
"def trial_over?\n unless self.trial_started_at.blank?\n return Time.now - APP_CONFIG['trial_length'].days > self.trial_started_at\n else\n return false\n end\n end",
"def on_trial?\n trial_ends_at? && trial_ends_at > Time.current\n end",
"def in_test\n @t = @problem.virtualtest\n return if check_nil_object(@t)\n redirect_to virtualtests_path if current_user.sk.test_status(@t) != \"in_progress\"\n end",
"def attested_for?(date)\n last_attested_on && last_attested_on > date.to_time\n end",
"def has_passed?\n\t\tTime.zone.at(starttime) < Time.zone.now\n\tend",
"def can_begin\n redirect_to virtualtests_path if @no_new_submissions\n if current_user.sk.test_status(@virtualtest) != \"not_started\"\n redirect_to virtualtests_path\n elsif Takentest.where(:user => current_user.sk, :status => :in_progress).count > 0\n flash[:danger] = \"Vous avez déjà un test virtuel en cours !\"\n redirect_to virtualtests_path\n end\n end",
"def test_business_open_now\n # Step 1\n random_listings_get\n log_listing = []\n time = Time.now\n @listings.each do |listing|\n local_time = nil\n offset = nil\n if listing['Timezone']\n tz = TZInfo::Timezone.get(listing['Timezone'])\n offset = tz.current_period.utc_total_offset\n local_time = time.dup.localtime(offset)\n end\n\n if listing['Hours'] && listing['OpenNow'] && offset\n operating = listing['Hours']['Today']['Hours'][0]\n\n if operating.nil?\n # TODO: Find a better solution with missing or improperly formatted hours...\n # If Text is populated, but hours missing, this means that Data couldn't\n # determine the standard hours automatically when initially imported:\n # EXAMPLE: Mon-Fri 11am-9:30pm\\\\nSat 4:30pm-9:30pm\\\\nSun 11am-9:30am\n # API will only alert an issue if this Text field is blank\n if listing['Hours']['Details'][0]['Text'].nil?\n log_listing << listing\n end\n else\n if operating[0] == 'Today' && operating[1] != 'Closed'\n # Use Rhino Data for Business Hours to determine the accuracy of the OpenNow flag that Panda provides\n default_hours = get_rhino_business_hours(listing['Int_Xxid'])\n current_day = local_time.strftime(\"%A\")\n open_hours = default_hours['StandardHours'][current_day]\n current_time = local_time.strftime('%H%M')\n open_now = open_hours.any? { |x| current_time >= x[0] && current_time < x[1] }\n assert_equal(open_now, listing['OpenNow'], \"Local Time : #{current_time}, Open - Close : #{open_hours}, Listing : #{listing}\")\n else\n # 'OpenNow: nil' is a valid setting if Panda is unable to determine the\n # flag based on the hours provided by the data for the listing specified\n # EXAMPLE: The listing may only specify 'Delivery Hours'\n assert_equal(false, listing['OpenNow'], \"Local Time : #{local_time}, #{operating[1]}, Listing : #{listing}\") unless listing['OpenNow'].nil?\n end\n end\n end\n end\n\n int_xxids = []\n log_listing.each { |listing| int_xxids << listing['Int_Xxid'] }\n\n assert_empty(log_listing, \"Please check with Data team for inaccuracies on the following Listings: #{int_xxids}\" )\n end",
"def within_hour?\n\t\tupdated_at >= 1.hour.ago\t\t\n\tend",
"def atest_ID_25891_scheduled_posts_02\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n sleep 5\n go_to_scheduled_tab_on_your_post_page\n verify_text \"Your Posts\",\"Current Drafts\", \"Scheduled Posts\", \"Published Posts\", \"Scheduled\"\n assert $profile_edit_post.exists?\n assert $profile_delete.exists?\n assert $count_of_scheduled.exists?\n end",
"def check_hours\n if @recorder.current_recording_hours >= @rec_show.req_recording_hours\n return true\n end\n false\n end",
"def current_qc_tests\n return if authorise_for_web(program_name(params[:id]),'edit')== false\n session[:qc_inspection_type_code] = params[:id]\n qc_current_inspection = ActiveRecord::Base.connection.select_one(\"select * from qc_current_inspections\n where user_id = #{session[:user_id].id}\n and qc_inspection_type_code = '#{params[:id]}'\")\n if qc_current_inspection.nil? || qc_current_inspection.qc_business_context_query.nil?\n redirect_to_index(\"'You have not yet listed tests for #{params[:id]}'\", \"''\")\n else\n dm_session[:search_engine_query_definition] = qc_current_inspection.qc_tests_query\n session[:columns_list] = YAML.load(qc_current_inspection.tests_columns_list)\n submit_tests_search\n end\n end",
"def zero_hour?\n # if the times differ more than 1 minute we probably have more important issues\n needs_view && (ends_at.to_i - updated_at.to_i) < 60\n end",
"def check_up\n maintenant = DateTime.now.to_i\n Takentest.where(status: 0).each do |t|\n debut = t.takentime.to_i\n if debut + t.virtualtest.duration*60 < maintenant\n t.status = 1\n t.save\n u = t.user\n v = t.virtualtest\n v.problems.each do |p|\n p.submissions.where(user_id: u.id, intest: true).each do |s|\n s.visible = true\n s.save\n end\n end\n end\n end\n end",
"def tired\t\r\n\tif $hours_asleep >= 8 then\r\n\t $hours_asleep = 0\r\n \t\treturn false\r\n \telse\r\n \t\t$hours_asleep += 1\r\n \t\treturn true\r\n \tend \t\t\r\nend",
"def redirectToAvailability\n EnziUIUtility.wait(@driver, :id, 'MoreTabs_Tab', 100)\n @driver.find_element(id: 'MoreTabs_Tab').click\n @driver.find_element(:link, 'Reservable').click\n #sleep(10)\n end",
"def active_trial?\n trial_end_date > Time.now ? true : false\n end",
"def check_status!\n if (created_at + 48.hours).past?\n update_status(10)\n return false\n end\n return true\n\n end",
"def next_alert_time\n false\n end",
"def test_grader_that_has_active_report_cant_take_on_another_report\n login_as :sean\n post :auto_assign\n assert_redirected_to :controller => :home, :action=>:index\n end",
"def test\n notify_credit_problem\n redirect_to(:action => 'show')\n end",
"def check_lesson_plan\n current_schedule = \n submitted_lesson_plan = LessonPlan.find(:all, :conditions => ['is_submitted=?', true]).map(&:schedule)\n if submitted_lesson_plan.include?(self.id)\n #lesson plan created, schedule editable? #issue arise during training : lesson plan first created by lecturer, schedule used to be last minute produce by Coordinator\n #errors.add_to_base \"tak bole la\"\n # raise I18n.t(\"weeklytimetable_detail.removal_not_allowed\")\n return false\n end\n end",
"def lecture_period\n @event = Event.first\n if (@event.activity_begin_day < DateTime.now && DateTime.now < @event.activity_end_day) || !current_user.adm?\n redirect_to lectures_path\n flash[:info] = \"Palestra nao disponivel!\"\n end\n end",
"def controller_timelog_edit_before_save(context={ })\n if context[:time_entry] && context[:time_entry][:hours].present?\n if(context[:time_entry].user_id == context[:time_entry].issue.assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"BD\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_bd,\n :hours => (context[:time_entry].issue.ayty_get_value_by_custom_field_name(\"Tempo Restante BD\",\n context[:time_entry].issue.ayty_get_value_by_custom_field_name(\"Estimativa BD - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n if(context[:time_entry].user_id == context[:time_entry].issue.assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"SIS\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_sys,\n :hours => (context[:time_entry].issue.ayty_get_value_by_custom_field_name(\"Tempo Restante SIS\",\n context[:time_entry].issue.ayty_get_value_by_custom_field_name(\"Estimativa SIS - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n end\n end",
"def atest_ID_25891_scheduled_posts_03\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n sleep 5\n go_to_scheduled_tab_on_your_post_page\n scheduledPostCountCurrent = count_scheduled_current\n $profile_delete_on_scheduled_post.when_present().click\n $delete_on_delete_this_draft.when_present().click\n $browser.refresh\n $count_of_scheduled.wait_until_present()\n scheduledPostCountAfterDeletingScheduledPost = count_scheduled_current\n assert scheduledPostCountAfterDeletingScheduledPost == scheduledPostCountCurrent - 1\n end",
"def happyTest(request)\n visit root_path\n submitServiceRequestPage (request)\n selectStudyPage(request)\n selectDatesAndArmsPage(request)\n serviceCalendarPage(request)\n documentsPage\n reviewPage(request)\n submissionConfirmationPage\n goToSparcProper\n\n if request.otfServices.length!=0 then \n adminPortal(request.study, request.otfServices[0]) \n end\n\n if request.ppServices.length!=0 then \n adminPortal(request.study, request.ppServices[0]) \n clinicalWorkFulfillment(request.study, request.ppServices[0])\n end\n\n userPortal(request)\n end",
"def completed?\n (@start + 10 * DAY) < Time.now\n # p (@start + 10 * DAY)\n end",
"def check_in_past\n errors.add(:check_in_at, \"cannot be more than one hour in the past\") if\n check_in_at < (Time.now - 1.hour)\n end",
"def tired\t\n\tif $hours_asleep >= 8 then\n\t $hours_asleep = 0\n \t\treturn false\n \telse\n \t\t$hours_asleep += 1\n \t\treturn true\n \tend \t\t\nend",
"def admin_view_hours_prep\n return if current_user.roles.include?(Role.admin_role)\n\n redirect_to root_path\n end",
"def should_patient_go_lab_examination_at_followup?\n first_dispensation = Encounter.joins(:type).where(\n 'encounter_type.name = ? AND encounter.patient_id = ? AND encounter.program_id = ?',\n DISPENSING,\n @patient.patient_id,\n @program.program_id\n ).order(encounter_datetime: :asc).first\n\n begin\n first_dispensation_date = first_dispensation.encounter_datetime\n number_of_days = (Time.current.to_date - first_dispensation_date.to_date).to_i\n (number_of_days == 56 || number_of_days == 84 || number_of_days == 140 || number_of_days == 168)\n rescue StandardError\n false\n end\n end",
"def enter_date_completed(test_data)\n hide_notifications_bar\n logger.info \"Entering date completed '#{test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name]}'\"\n wait_for_element_and_type(date_completed_input, test_data[CoreUseOfCollectionsData::DATE_COMPLETED.name])\n hit_enter\n end",
"def enter_date_completed(test_data)\n hide_notifications_bar\n wait_for_element_and_type(date_completed_input, test_data[UseOfCollections::DATE_COMPLETED.name])\n hit_enter\n end",
"def toggle\n client.time.toggle(@time_entry.harvest_id).timer_started_at.present?\n end",
"def check_for_top_up\n\t\tif self.do_top_up == YES\n\t\t\tif top_up_report = Diagnostics::Report.get_top_up_report\n\t\t\t\tself.template_report_ids << top_up_report.id.to_s\n\t\t\telse\n\t\t\t\tself.errors.add(:do_top_up,\"The Top Up Option is missing, please contact the developers\")\n\t\t\tend\n\t\tend\n\tend",
"def timeis_up\n current_user.submit_answers\n render text: true\n end",
"def valid_test_taking()\n if current_user.tenant.pricing_plan.plan_group == \"assessment_only_plan\" then\n if current_user.tenant.remaining_learner_credit > 0 then\n return true\n else\n return false\n end\n else\n return true\n end\n end",
"def check_date()\n event = Event.find_by(id: self.event_id) \n if Time.now > event.start_date then\n halt msg: 'check_date() fail' \n false\n else\n true\n end\n end",
"def order_complete\n load_order\n if @order.packed_at.blank? && (@current_retailer && @current_retailer.id == @order.retailer_id)\n \t@order.update_attribute(:packed_at, Time.now)\n end\n redirect_to admin_order_url(@order)\n end",
"def enter_date_requested(test_data)\n hide_notifications_bar\n logger.info \"Entering date requested '#{test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name]}'\"\n wait_for_element_and_type(date_requested_input, test_data[CoreUseOfCollectionsData::DATE_REQUESTED.name])\n hit_enter\n end",
"def redirect_to_overview\n if current_order.confirming?\n redirect_to wizard_path(:overview) and return unless step == :overview\n end\n end",
"def valid_alert? \n check_in = self.query[\"check_in\"].to_datetime if self.query[\"check_in\"]\n check_out = self.query[\"check_out\"].to_datetime if self.query[\"check_out\"]\n if (check_in && (check_in < Time.now)) or (check_out && (check_out < Time.now))\n Authorization::Maintenance::without_access_control do\n ActiveRecord::Base.record_timestamps = false\n self.update_attributes({:active => false})\n ActiveRecord::Base.record_timestamps = true\n end\n return false\n else\n return true\n end\n end",
"def set_cut_off_time\n if params[:cut_off_time].present?\n #Home.all.each {|r| r.destroy}\n Home.create(:cut_off_time => params[:cut_off_time])\n redirect_to admin_action_by_admin_path, :flash => {:notice => \"Shipment cut off time updated succesfully\"}\n else\n flash.now[:notice] = 'please enter vaild time to procced.'\n end\n end",
"def complete_appointment \n @appointment = Appointment.find_by_id(params[:appointment_id])\n @user = User.find_by_id(params[:user_id])\n \n if @appointment.complete_appointment(current_user.id)\n @appointment.host.increment_completed_count\n \n if params[:review] == \"host\"\n redirect_to new_user_review_path(@user) \n else\n redirect_to new_user_travelerreview_path(@user)\n end\n else\n flash[:error] = \"Sorry, meeting could not be completed, #{@appointment.errors.full_messages}\"\n redirect_to root_path\n end\n end",
"def time_out?\n if @tiempo >= 11\n true\n else\n false\n end\n end",
"def check_if_end_tour_button_is_displayed\n\n page.should have_button(END_TOUR_BUTTON)\n sleep(THREAD_SLEEP_1)\n\n end",
"def on_trial\n !!(trial_ends_at && trial_ends_at.future?)\n end",
"def is_before?(e)\n (@periodicity.start_time.hour < e.periodicity.start_time.hour) or\n (@periodicity.start_time.hour == e.periodicity.start_time.hour and @periodicity.start_time.min < e.periodicity.start_time.min)\n end",
"def controller_issues_edit_after_save(context={ })\n if context[:time_entry] && context[:time_entry][:hours].present?\n if(context[:time_entry].user_id == context[:issue].assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"BD\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_bd,\n :hours => ( context[:issue].ayty_get_value_by_custom_field_name(\"Tempo Restante BD\",\n context[:issue].ayty_get_value_by_custom_field_name(\"Estimativa BD - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n if(context[:time_entry].user_id == context[:issue].assigned_to_id && context[:time_entry].activity.name[0..2].include?(\"SIS\"))\n context[:controller].flash[:warning] = l(:notice_ayty_remember_fill_rest_sys,\n :hours => ( context[:issue].ayty_get_value_by_custom_field_name(\"Tempo Restante SIS\",\n context[:issue].ayty_get_value_by_custom_field_name(\"Estimativa SIS - hr\", 0)).to_f -\n context[:time_entry][:hours].to_f))\n end\n end\n end",
"def check_schedule()\n create_daily_tests()\n create_weekly_tests()\n end",
"def show\n practice = Practice.find(params[:id])\n @assignment = Assignment.find(practice.assignment)\n @assignment_group = practice.assignment_group\n if (current_user.role? \"admin\") || (@assignment_group.students.pluck(:student_id).include? current_student.id)\n @flag = Favourite.find_by(user_id: current_user.id,assignment_id: @assignment.id)\n @rb = @assignment.answers.where(language: \"ruby\")\n @js = @assignment.answers.where(language: \"javascript\")\n @py = @assignment.answers.where(language: \"python\")\n # create time of viewing the assignment only once when the user clicks on the practice link\n #binding.pry\n SubmissionTimer.create(user_id: current_user.id, practice_id: params[:id], assignment_id: @assignment.id, assignment_group_id: practice.assignment_group_id) if SubmissionTimer.find_by(user_id: current_user.id, practice_id: params[:id], assignment_id: @assignment.id, assignment_group_id: practice.assignment_group_id).nil?\n #binding.pry\n @start_time = SubmissionTimer.find_by(user_id: current_user.id, practice_id: params[:id], assignment_id: @assignment.id, assignment_group_id: practice.assignment_group_id)\n #binding.pry\n else \n redirect_to root_path, notice: \"The page you are looking for does not exist\"\n end\n end",
"def before_connected_to_strava_at(tt = 8.hours)\n dt = connected_to_strava_at\n dt -= tt if dt\n dt\n end",
"def workshop_period\n @event = Event.first\n if (@event.activity_begin_day < DateTime.now && DateTime.now < @event.activity_end_day) || !current_user.adm?\n redirect_to workshops_path\n flash[:info] = \"Workshop nao disponivel!\"\n end\n end",
"def waits_for_actual_attestation?\n !index.final_exam_passed? &&\n !attested_for?(Attestation.actual_for_faculty(index.student.faculty))\n end",
"def test_bad_times\n \tlist = create_test_list\n\tassert_nothing_raised do\n \t get :index, {:id => list.id, :end_seconds => 99999999999, :start_seconds => 99999999999 }\n \t get :index, {:id => list.id, :seconds_before_today => 99999999999 }\n \t get :index, {:id => list.id, :seconds_after_today => 99999999999 }\n \t talks = assigns(:talks)\n \tend\n end",
"def alternate_test_procedure_type\n begin\n last_time_diagnosis_selected.obs_datetime > last_time_lab_order_selected.obs_datetime\n rescue StandardError\n return true if last_time_lab_order_selected.nil?\n end\n end",
"def check_phase_estimation\n return false if !life_cycle_phase\n planned_hours_phase = self.project.projects_phases_joins.where(\"life_cycle_phase_id = ?\", self.life_cycle_phase.id).first.planned_hours_phase\n if self.new_record?\n sum_hours_tasks = self.project.tasks.where(\"life_cycle_phase_id = ?\", self.life_cycle_phase.id).sum(\"planned_hours\")\n else\n sum_hours_tasks = self.project.tasks.where(\"life_cycle_phase_id = ? AND id <> ?\", self.life_cycle_phase.id, self.id).sum(\"planned_hours\")\n end\n sum_hours_tasks = sum_hours_tasks + self.planned_hours\n if (sum_hours_tasks) > planned_hours_phase\n errors.add(:planned_hours, I18n.t(\"screens.alerts.tasks_exceeded_in_hours\"))\n return false\n end\n return true\n end",
"def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def check_expired \n\t\t@current_epoch_time = DateTime.now.strftime('%s').to_i\n\t\texpired_required_trips = []\n\t\texpired_listed_trips = []\n\n\t\t# Find the expired trips and add them to the expired arrays\n\t\tcurrent_user.trips_requested.each do |trip_index|\n\t\t\t@trip = Trip.find_by(_id: trip_index) \n\t\t\tif @trip.date < @current_epoch_time\n\t\t\t\texpired_required_trips << trip_index\n\t\t\tend\n\t\tend\n\t\tcurrent_user.trips_driving.each do |trip_index|\n\t\t\t@trip = Trip.find_by(_id: trip_index)\n\t\t\tif @trip.date < @current_epoch_time\n\t\t\t\texpired_listed_trips << trip_index\n\t\t\tend\n\t\tend\n\n\t\tcurrent_user.trips_requested = current_user.trips_requested - expired_required_trips\n\t\tcurrent_user.trips_driving = current_user.trips_driving - expired_listed_trips\n\n\t\tcurrent_user.past_trips_requested = current_user.past_trips_driven + expired_required_trips\n\t\tcurrent_user.past_trips_driven = current_user.past_trips_driven + expired_listed_trips\n\n\t\tcurrent_user.save!\n\n\t\trender json: {\n\t\t\tstatus: 'success',\n\t\t\tuser: current_user\n\t\t}\n\n\tend",
"def success_confirm_address_hp\n\tsleep 5\n\t page.has_content?('Su dirección ha sido guardada exitosamente')\nend",
"def check_if_plan_has_expired(expiry_date,plan_code)\n return \"ok\" if (Time.now < expiry_date - 5.days && plan_code == \"trial\") || (plan_code != \"trial\") #check if expiry time left to expire is more than 5 days\n return \"stop\" if Time.now > expiry_date #check if expiry time has passed\n return \"warning\"\n end",
"def short_job?\n date = DateTime.new(params[:job][\"deadline(1i)\"].to_i, \n params[:job][\"deadline(2i)\"].to_i, \n params[:job][\"deadline(3i)\"].to_i, \n params[:job][\"deadline(4i)\"].to_i, \n params[:job][\"deadline(5i)\"].to_i) \n date < Time.now + 3.days\n end",
"def welcome\n week = TestMeta.week\n \n # Get the user's test for this week\n @test = Test.where( { :study_user_id => @user, :week => week } ).first\n \n @welcome_state = nil\n \n if @test.complete\n # User has already completed this week's test\n @welcome_state = :already_finished\n \n elsif @test.state and !@test.complete \n # User is returning in the middle of an existing test\n @welcome_state = :already_started\n \n \n # Time has no expired\n \n # Time has expired\n \n else \n # User is starting a new test\n @welcome_state = :new_test\n \n @condition = @test.get_condition\n \n if @test.condition == \"none\" or Question.where( :active => true ).empty?\n # There is no test this week \n @test.complete = true \n end\n \n @test.started_at = DateTime.now\n @test.save\n end\n \n end",
"def time_is_up!\n Astute.logger.error \"Puppet agent took too long to run puppet task.\"\\\n \" Mark task as failed. #{task_details_for_log}\"\n self.task_status = 'failed'\n end",
"def parrot_trouble(talking, hour)\n if talking && (hour < 7 || hour > 20)\n puts \"NG\"\n else\n puts \"OK\"\n end\nend",
"def enter_date_requested(test_data)\n hide_notifications_bar\n wait_for_element_and_type(date_requested_input, test_data[UseOfCollections::DATE_REQUESTED.name])\n hit_enter\n end",
"def request_active_report\n begin\n #both of these return some info include the report request id..\n @active_report = @client.request_report(\"_GET_MERCHANT_LISTINGS_DATA_\").parse\n\n rescue Excon::Errors::ServiceUnavailable\n puts \"the active report had an issue\"\n sleep 2 and retry\n \n else\n puts \"The active report was requested fine\"\n end\n \n if @difference < 1800\n find_report_status_just_active\n end\n \n end",
"def ensure_future_batch\n if !!@course_batch && @course_batch.expired?\n redirect_to :back, alert: 'Sorry. There but the batch has already started. Please select some different batch.'\n end\n end",
"def atest_ID_25891_scheduled_posts_01\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n sleep 5\n scheduledPostCount = count_scheduled_current\n if (scheduledPostCount < 5)\n i=1\n while i < 3\n $browser.goto($patch_note)\n $post_pick_group.when_present().click\n $group_select.when_present().select(\"Sports\")\n $post_compose_note.wait_until_present()\n $browser.link(:text, \"Basketball\").when_present().click\n $post_compose_note.when_present().set(\"Note field populated by automated test.\")\n $advanced_options.when_present().click\n currentTime = Time.now() + 2\n currentDate = currentTime.strftime(\"%Y-%m-%d\")\n $post_advanced_calendar.when_present().set(\"#{currentDate}\")\n $post_advanced_time.when_present().set(\"11:00 PM\")\n sleep 3\n $browser.link(:text => /11:00/).click\n $profile_schedule.when_present().fire_event(\"onclick\")\n sleep 3\n i = i+1\n end\n end\n end",
"def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end",
"def advance_stage\n puts 'Inside advance stage in dashboard controller'\n patient_id = params[:patient]\n patient = Patient.find(patient_id)\n\n if patient.nil?\n #\n else\n puts 'calling dashboardHelper function'\n DashboardHelper.advance_stage(patient)\n end\n end",
"def waits_too_long?(account)\n is?(:asked) and self.asked <= 4.days.ago.to_date\n end",
"def retry?\n unless rt_at.nil?\n now = Time.now.utc\n if now >= rt_at\n true\n else\n false\n end\n else\n false\n end\n end",
"def paycheck(hours_actually_editing, paycheck_total, hourly_charge = 50)\n\t(paycheck_total/hours_actually_editing) > hourly_charge\nend",
"def test_hour\n assert_nil tasks(:explain_search).hours\n assert_equal 8, tasks(:today_shift).hours\n end",
"def check_sla_hours(issue)\n tracker_sla_day = SlaWorkingDay.where(:project_id => issue.project.id, :tracker_id => issue.tracker.id).last\n s_from = Time.parse(tracker_sla_day.start_at)\n e_to = Time.parse(tracker_sla_day.end_at)\n t = Time.now\n Time.local(t.year, t.month, t.day, s_from.hour, s_from.min) <= Time.now && Time.local(t.year, t.month, t.day, e_to.hour, e_to.min) >= Time.now\n end",
"def after?(time)\n start_time > time\n end",
"def after?(time)\n start_time > time\n end",
"def passed_event?\n date_time < Time.now.utc\n end",
"def overdue?\n !self.attempt_next_contact_by.nil? && self.attempt_next_contact_by < Time.current\n end",
"def test_011\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n # check log in the navigation bar\n sleep 2\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end",
"def check_over_due\n time = Time.now\n @time_table.each{ |book, date|\n if date <= time\n puts \"Bro #{book} is overdue\"\n @overdue = true\n end\n }\n end",
"def create\n @time_off_instance = TimeOffInstance.new(time_off_instance_params)\n #@time_off_instance.employee.hours_left -= @time_off_instance.hours_used\n respond_to do |format|\n if @time_off_instance.save\n self.use_pto_hours\n #print \"HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE HERE\"\n format.html { redirect_to @time_off_instance, notice: 'Time off instance was successfully created.' }\n format.json { render :show, status: :created, location: @time_off_instance }\n else\n format.html { render :new }\n format.json { render json: @time_off_instance.errors, status: :unprocessable_entity }\n end\n end\n end",
"def delivery_time_can_not_be_too_soon\n if time < Time.now + @@starttime\n errors.add(\"Ora di consegna:\", \"ci vogliono almeno #{@@starttime/60} minuti per l\\'elaborazione.\n Quindi ordinazioni prima delle #{(Time.now + @@starttime).strftime(\"%H:%M\")} non possono essere accettate.\")\n end\n end",
"def test_int_page\n open_new_tab(Constants::INT_PAGE)\n sleep 5\n button_click(LOCATOR['RWDS_TAB'])\n switch_frame\n button_click(LOCATOR['ERN_PTS'])\n p text_displayed?(LOCATOR['ACT_NM'], 'Account Creation')\n switch_back\n @driver.close\n end",
"def submit_purchased!\n return false if was_submitted?\n\n wizard_steps[:checkout] = Time.zone.now\n submit!\n end",
"def scheduling_tab()\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n wait.until {@driver.find_element(SCHEDULING_TAB).displayed?}\n scheduling_tab = @driver.find_element(SCHEDULING_TAB)\n scheduling_tab.click\n end",
"def open_at_this_time?\n now = timenow\n time_inside?(now, start_time.utc, end_time.utc)\n end",
"def index\n @time_clocks = current_user.time_clocks\n @time_clock = TimeClock.new\n @test_clock = current_user.time_clocks.last\n unless @test_clock && @test_clock.clock_out.nil?\n @time = TimeClock.new(clock_in: (DateTime.now - 5.hours), user_id: current_user.id, date: Date.today.to_s)\n @time.save!\n end\n @total_hours = 0\n @unpaid_hours = 0\n @time_clocks.each do |time|\n if time.clock_out.nil?\n else\n time.hours = time_diff(time.clock_in, time.clock_out)\n time.save!\n @total_hours += time.hours\n end\n end\n @time_clocks.where(billed: false).each do |time|\n if time.hours.nil?\n else\n @unpaid_hours += time.hours\n end\n end\n end",
"def story_time\n touch(@@detailsheader)\n sleeper(30)\n end",
"def show\n if current_user.created_at > Time.now-4.seconds\n gon.tour1 = 1\n p \"GON 1 \"*19\n end\n if (current_user.jobs.count == 1) && (current_user.jobs.first.updated_at-current_user.jobs.first.created_at < 30.seconds)\n gon.tour4 = 4\n p \"GON 4 \"*19\n end\n\n @company = Company.new\n @job = Job.new\n if check_to_mail?\n flash[:info] = \"Congratulations! Your are ready to submit your 10/30.\"\n end\n end",
"def view_issues_form_details_bottom(context={})\r\n issue = context[:issue]\r\n if issue.leaf? # only leaf issue need validation\r\n validate_estimated_time_js = \"\r\n $('#issue-form').submit(\r\n function(){\r\n var start_date = $('#issue_start_date').val();\r\n var due_date = $('#issue_due_date').val();\r\n var estimated_hours = $('#issue_estimated_hours').val();\r\n if(start_date && due_date && estimated_hours){\r\n var start = new Date(Date.parse(start_date.replace(/-/g, '/')));\r\n var end = new Date(Date.parse(due_date.replace(/-/g, '/')));\r\n var diff = (end - start)/(3600*24*1000) + 1; // include start and end\r\n var hours = parseFloat(estimated_hours);\r\n if(isNaN(hours)){\r\n alert('Estimated hours is invalid!');\r\n return false;\r\n }else if(diff < 1 || hours/8 > diff ){\r\n alert('Estimated: '+hours+' hours, and expected finished in '+diff+' days. Please postpone Due Date!');\r\n return false;\r\n }\r\n }\r\n if(!$(this).attr('data-submitted-plugin-resource')){\r\n $(this).removeAttr('data-submitted');\r\n $(this).attr('data-submitted-plugin-resource');\r\n return true;\r\n }\r\n });\r\n \".html_safe\r\n order_asignee_js = \"\r\n var issue_assigned_to = $('#issue_assigned_to_id').val();\r\n $('#issue_assigned_to_id').attr('autocomplete','off');\r\n $('#issue_assigned_to_id>option').sort(function(a, b){\r\n return a.innerHTML.localeCompare(b.innerHTML)\r\n }).appendTo($('#issue_assigned_to_id'));\r\n $('#issue_assigned_to_id').val(issue_assigned_to);\r\n \".html_safe\r\n return content_tag('script', \"#{validate_estimated_time_js} #{order_asignee_js}\".html_safe)\r\n else\r\n return\r\n end\r\n\r\n end",
"def execute\n super()\n\n # executes test case info\n\n # workaround pages that need to login to secondary domains\n auth_workarounds()\n\n # Change this to 0 to get retries in buyflow test\n timeout_count = 1 \n \n begin\n puts @report.url\n\n # Navigate to the site\n @page.browser.driver.browser.get @report.url if(@report.url)\n\n\n\n\n\n # ------------ Marketing section, Landing Page ------------ \n\n @report.browser = @page.browser_name\n\n\n # pull the operating System from the user agent or other sources\n @report.os = @page.os_name\n\n # pull the brand from the page variables or domain\n @report.buyflow_report.brand = @page.brand\n\n # pull the uci code from omniture\n @report.uci_report.uci_mp = @page.uci\n\n if(@configuration['Brand'] == 'Marajo' || @configuration['Brand'] == 'smileactives')\n puts \"products hiiiiiiiii\"\n @page = @page.go_to_productpage()\n puts \"done product button\"\n else\n puts \"going to order page\"\n @page = @page.go_to_orderpage()\n puts @page\n puts \"done fetching orderpage\"\n end\n\n # navigate to the SAS page if that page section isn't present.\n # @page = @page.go_to_orderpage()\n\n\n\n\n @report.buyflow_report.lastpagefound = \"sas\"\n\n # ------------ SAS Section ------------ \n\n @report.uci_report.uci_sas = @page.uci\n \n # If an offer is not present in test\n if(@offer == nil)\n # navigate to the cart using default options\n @page = @page.skip_to_cart\n else\n # ...otherwise select the options defined by the offer\n \n @page = @page.select_options(@offer)\n end\n\n # exclude_from_selection_workaround = BrandsExcludedSelectionWorkaround.all.select('brand').collect(&:brand)\n # if(@offer)\n # if(timeout_count == 1 && @offer['OfferCode'])\n # if(exclude_from_selection_workaround.include?(@configuration[\"Brand\"].downcase) == false)\n # selection_workaround(@page.browser)\n # end\n # end\n # end\n\n \n\n\nputs \"Proceed to cart section\"\n\n # ------------ Cart Section ------------ \n\n @report.uci_report.uci_op = @page.uci\n\n @report.buyflow_report.lastpagefound = \"cart\"\n\n @report.buyflow_report.offer_code = @page.offercode\n puts \"offercode\"\n puts @report.buyflow_report.offer_code\n\n @report.grcid = @page.grcid\n puts \"grcid\"\n puts @report.grcid\n\n # catch_and_display_error do\n\n @report.buyflow_report.total_pricing = @page.total_pricing\n puts \"total_pricing\"\n puts @report.buyflow_report.total_pricing\n\n @report.buyflow_report.subtotal_price = @page.subtotal_price\n puts \"subtotal_price\"\n puts @report.buyflow_report.subtotal_price\n\n # pull the pricing for the SAS for any sections still in the same page as the cart\n begin\n @report.buyflow_report.saspricing = @page.check_sas_pricing(@report.buyflow_report.subtotal_price)\n rescue => e\n @report.buyflow_report.saspricing = \"No Offer Associated with this Test\"\n end\n \n @report.buyflow_report.saspricing = '' if @report.buyflow_report.saspricing == nil\n puts \"saspricing\"\n puts @report.buyflow_report.saspricing\n @report.buyflow_report.sasprices = @page.check_sas_prices\n puts \"sasprices\"\n puts @report.buyflow_report.sasprices\n\n # pull the cart description from the order summary section\n @report.buyflow_report.cart_language = @page.cart_description\n puts \"cart description\"\n puts @report.buyflow_report.cart_language\n\n @report.buyflow_report.cart_title = @page.cart_title\n puts \"productname\"\n puts @report.buyflow_report.cart_title\n\n @report.buyflow_report.sas_kit_name = @page.check_sas_kit_name(@report.buyflow_report.cart_title)\n\n @report.buyflow_report.kitnames = @page.cart_title\n\n @report.buyflow_report.cart_quantity = @page.quantity\n puts \"quantity\"\n puts @report.buyflow_report.cart_quantity\n\n if(@report.buyflow_report.cart_quantity.nil?)\n @report.buyflow_report.cart_quantity = \"[Quantity Dropdown Missing] - Locator may be missing\"\n end\n\n @report.buyflow_report.shipping_standard = @page.shipping('Standard')\n puts \"shipping\"\n puts @report.buyflow_report.shipping_standard\n \n # Rush Shipping\n @report.buyflow_report.shipping_rush = @page.shipping('Rush') \n\n # Overnight Shipping\n @report.buyflow_report.shipping_overnight = @page.shipping('Overnight')\n\n @report.buyflow_report.shipping_standard = 'N/A' if @report.buyflow_report.shipping_standard.nil?\n \n @report.buyflow_report.shipping_rush = 'N/A' if @report.buyflow_report.shipping_rush.nil?\n\n @report.buyflow_report.shipping_overnight = 'N/A' if @report.buyflow_report.shipping_overnight.nil?\n\n if(@offer)\n @offer.each do |offer|\n # Continuity Shipping \n @report.buyflow_report.continuity_shipping = @page.continuity(offer)\n puts \"Continuity\"\n puts @report.buyflow_report.continuity_shipping\n end\n end\n # end\n\n # get the shipping selection price\n puts \"cart_shipping_selection_price\"\n cart_shipping_selection_price = @page.current_shipping_cost\n puts cart_shipping_selection_price\n\n @page.place_order(@configuration['ConfEmailOverride'])\n\n # Submit order in order to reach confirmation page\n @page = @page.submit_order\n\n # ------------ Confirmation Page ------------\n\n puts \"proceeding to confirmation page\"\n\n @page.expand_order_details()\n \n # pull the confirmation number\n @report.buyflow_report.confirmation_number = @page.get_confirmation_number\n\n @report.buyflow_report.lastpagefound = \"confirmation page\"\n # pull the uci number for the confirmation page\n @report.uci_report.uci_cp = @page.uci\n\n # Compare the billing and shipping information to the data that was entered in the cart\n check_billing_info(@report.buyflow_report, @page)\n\n # get the offer code from the confirmation page\n @report.buyflow_report.confoffercode = @page.offercode\n\n # get the confirmation page pricing for the main product\n @report.buyflow_report.confpricing = @page.confpricing\n\n # check the shipping price matches the shipping selected in the cart\n puts \"shipping_conf\"\n shipping_conf = @page.conf_shipping_price\n puts shipping_conf\n\n if(shipping_conf == cart_shipping_selection_price)\n @report.buyflow_report.shipping_conf = \"match\"\n @report.buyflow_report.shipping_conf_val = shipping_conf\n @report.buyflow_report.selected_shipping = cart_shipping_selection_price\n else\n begin\n @report.buyflow_report.shipping_conf_val = shipping_conf\n\n rescue\n end\n begin\n @report.buyflow_report.selected_shipping = cart_shipping_selection_price\n rescue\n\n end\n begin\n @report.buyflow_report.shipping_conf = shipping_conf.to_s + \" - expected: \" + cart_shipping_selection_price.to_s\n rescue\n @report.buyflow_report.shipping_conf = \"Problem with gathering data: confirmation - \" + shipping_conf.class.to_s + \" cart - \" + cart_shipping_selection_price.class.to_s\n end\n end\n\n @report.buyflow_report.conf_kit_name = @page.cart_title\n\n # -------- Failure Checks ---------\n if(@report.grcid.nil?)\n fail 'GRCID not found for this page (AKA Campaign Code)'\n end\n\n if(@report.uci_report.uci_mp.nil?)\n fail 'UCI code for Marketing section was not found'\n end\n\n if(@report.uci_report.uci_op.nil?)\n fail 'UCI code for Cart section was not found'\n end\n \n if(@report.uci_report.uci_sas.nil?)\n fail 'UCI code for SAS section was not found'\n end \n \n if(@report.uci_report.uci_cp.nil?)\n fail 'UCI code for Confirmation page was not found'\n end\n\n if(@report.buyflow_report.subtotal_price.nil?)\n fail 'subtotal price was not found'\n end\n\n if(@report.buyflow_report.cart_title.to_s.downcase.include? 'kit')\n if(@report.buyflow_report.cart_language.nil?)\n fail 'cart language was not found'\n end\n end\n\n if(@report.buyflow_report.cart_title.nil?)\n fail 'cart title was not found'\n end\n\n # Check Shipping matches given offer if present\n if(@offer)\n if(@offer.length == 1)\n @offer.each do |offer|\n if(@report.buyflow_report.shipping_standard != offer['StartSH'].gsub('$','').strip())\n fail \"Shipping price did not match - #{offer.Offer.to_s} - Entry -a #{@report.buyflow_report.shipping_standard} -e #{offer['StartSH'].gsub('$','').strip()}\"\n end\n\n if(@report.buyflow_report.shipping_rush != offer['Rush'].gsub('$','').strip())\n fail \"Shipping price did not match - #{offer.Offer.to_s} - Rush -a #{@report.buyflow_report.shipping_rush} -e #{offer['Rush'].gsub('$','').strip()}\"\n end\n\n if(@report.buyflow_report.shipping_overnight != offer['OND'].gsub('$','').strip())\n fail \"Shipping price did not match - #{offer.Offer.to_s} - OND -a #{@report.buyflow_report.shipping_overnight} -e #{offer['OND'].gsub('$','').strip()}\"\n end\n end\n else\n standard_data = ''\n rush_data = ''\n ond_data = ''\n if((@report.buyflow_report.cart_title.to_s.downcase.include? 'kit') && (@report.buyflow_report.brand == 'Marajo'))\n @offer.each do |offer|\n next unless offer.Offer.to_s.downcase.include? 'kit'\n standard_data = offer['StartSH'].gsub('$','').strip()\n rush_data = offer['Rush'].gsub('$','').strip()\n ond_data = offer['OND'].gsub('$','').strip()\n break\n end\n else\n standard_data = '$0.00'\n @offer.each do |offer|\n rush_data = offer['Rush'].gsub('$','').strip()\n ond_data = offer['OND'].gsub('$','').strip()\n break\n end\n end\n \n if(@report.buyflow_report.shipping_standard != standard_data.gsub('$','').strip())\n fail \"Shipping price did not match - #{offer.Offer.to_s} - Entry -a #{@report.buyflow_report.shipping_standard} -e #{standard_data.gsub('$','').strip()}\"\n end\n\n if(@report.buyflow_report.shipping_rush != rush_data)\n fail \"Shipping price did not match - #{offer.Offer.to_s} - Rush -a #{@report.buyflow_report.shipping_rush} -e #{rush_data}\"\n end\n\n if(@report.buyflow_report.shipping_overnight != ond_data)\n fail \"Shipping price did not match - #{offer.Offer.to_s} - OND -a #{@report.buyflow_report.shipping_overnight} -e #{ond_data}\"\n end\n end\n end \n\n if(@report.buyflow_report.conf_kit_name.nil?)\n fail 'confirmation kit name was not found'\n end\n\n if(@report.buyflow_report.confpricing.nil?)\n fail 'confirmation price was not found'\n end\n\n if(@report.buyflow_report.billname == 'FAILED' || @report.buyflow_report.billaddress == 'FAILED' || @report.buyflow_report.billemail == 'FAILED' || @report.buyflow_report.shipaddress == 'FAILED')\n fail 'The billing/shipping info on the confirmation page did not match data input on cart page'\n end\n\n if(@report.buyflow_report.shipping_conf != 'match')\n fail 'Shipping did not match cart on confirmation page' \n end\n\n if(@report.buyflow_report.confoffercode.nil?)\n fail 'Could not find Offer code on the confirmation page'\n end\n\n if(@report.buyflow_report.offer_code.nil?)\n fail 'Could not find Offer code on the cart page'\n end\n\n if(@offer)\n @offer.each do |offer|\n puts @report.buyflow_report.offer_code\n puts @report.buyflow_report.confoffercode\n puts offer.OfferCode.to_s\n if(@report.buyflow_report.expected_offer_code)\n if @report.buyflow_report.offer_code.to_s.downcase.include?(offer.OfferCode.to_s.downcase) == false\n raise \"OfferCode didn't match in cart page\"\n end\n end\n\n if(@report.buyflow_report.expected_offer_code)\n if @report.buyflow_report.confoffercode.to_s.downcase.include?(offer.OfferCode.to_s.downcase) == false\n raise \"OfferCode didn't match in confirmation page\"\n end\n end\n# puts offer.offer_data_detail.offerdesc\n# puts @report.buyflow_report.cart_language\n if(offer.offer_data_detail)\n if(@report.buyflow_report.cart_language)\n if cleanup_format(@report.buyflow_report.cart_language).include?(cleanup_format(offer.offer_data_detail.offerdesc)) == false\n raise \"Cart language did not match\"\n end\n end\n\n if(@report.buyflow_report.cart_title)\n if @report.buyflow_report.cart_title.to_s.downcase.include?(offer.offer_data_detail.offer_title.to_s.downcase) == false\n raise \"Cart title did not match\"\n end\n end\n else\n if(@report.buyflow_report.cart_title)\n if @report.buyflow_report.cart_title.to_s.downcase.include?(offer.Offer.to_s.downcase) == false\n raise \"Cart title did not match\"\n end\n end\n end\n end\n end\n\n # ------- end of testing --------\n\n\n rescue T5::PasswordMatchException => e\n raise e\n\n rescue Net::ReadTimeout, Selenium::WebDriver::Error::UnknownError => e\n net_timeout_timeout = 0\n begin\n net_timeout_timeout += 1\n sleep(5)\n soft_browser_quit()\n # create browser for new attempt\n @browser = BrowserFactory.create_browser(@browsertype)\n\n # instatiate the starting page model\n @page = T5::Marketing.new(@configuration)\n \n # set the browser session to the current one held by the test case\n @page.browser = @browser\n \n # adapt the page based on the configuration settings\n @page = @page.adapt\n\n auth_workarounds()\n exp = @report.buyflow_report.expected_offer_code\n @report.buyflow_report = GRReporting::BuyflowReport.new()\n @report.buyflow_report.expected_offer_code = exp\n rescue => exc\n if net_timeout_timeout < 5\n retry\n else\n raise e\n end\n end\n retry\n rescue => e\n timeout_count += 1;\n # Change the limit of retries here.\n raise e if(timeout_count > 1)\n soft_browser_quit()\n @browser = BrowserFactory.create_browser(@browsertype)\n\n # instatiate the starting page model\n @page = T5::Marketing.new(@configuration)\n \n # set the browser session to the current one held by the test case\n @page.browser = @browser\n \n # adapt the page based on the configuration settings\n @page = @page.adapt\n\n auth_workarounds()\n exp = @report.buyflow_report.expected_offer_code\n @report.buyflow_report = GRReporting::BuyflowReport.new()\n @report.buyflow_report.expected_offer_code = exp\n retry\n end\n end",
"def trial_place\n @user = current_user\n if @user.event_count != 0\n if @user.stripe_token.nil?\n redirect_to trial_payment_path\n else\n redirect_to dashboard_path\n end\n end \n @new_place = Place.new\n end",
"def evaulate_schedule\n true\n end",
"def test_scan_every_patient\n patient_ids = Patient.find(:all).map(&:id)\n login\n select_tasks ['HIV Reception']\n patient_ids.each {|patient_id|\n begin\n patient = Patient.find(patient_id)\n puts \"Scanning #{patient.national_id} (#{patient.id})\"\n scan_patient(patient.national_id, patient.id) \n assert_redirected_to \"/patient/patient_detail_summary\"\n rescue Exception => e\n puts \" #{e}\"\n yell \" #{e}\"\n end\n } \n end",
"def is_in_the_past? \n departureOnThe > returnOnThe \n end",
"def booking_is_available?(user, service, order_time)\n order_time > Time.new + 6.hours and user.id != service.user_id\n end"
] |
[
"0.5937826",
"0.57870626",
"0.5786309",
"0.57496786",
"0.5606584",
"0.5595736",
"0.5577767",
"0.5557089",
"0.5510528",
"0.54581636",
"0.5450569",
"0.541663",
"0.5366033",
"0.53527725",
"0.53487706",
"0.5346876",
"0.5345055",
"0.5323697",
"0.53066516",
"0.5300956",
"0.52988535",
"0.5268498",
"0.5266959",
"0.5256084",
"0.5254315",
"0.5243879",
"0.52345717",
"0.5231436",
"0.52224565",
"0.5207903",
"0.5197816",
"0.5185425",
"0.5183259",
"0.51711524",
"0.5166549",
"0.5163982",
"0.51487684",
"0.5136936",
"0.51291406",
"0.51186305",
"0.51155853",
"0.511516",
"0.5110991",
"0.510633",
"0.50931823",
"0.5086882",
"0.5083022",
"0.50780755",
"0.50737756",
"0.50628483",
"0.5062595",
"0.5061566",
"0.5060464",
"0.5057616",
"0.50562406",
"0.50511444",
"0.50460416",
"0.50449264",
"0.50343645",
"0.50313264",
"0.5026888",
"0.502608",
"0.50251323",
"0.5022668",
"0.5021295",
"0.50186205",
"0.501643",
"0.50117844",
"0.50103307",
"0.5005044",
"0.5003511",
"0.50007224",
"0.4999885",
"0.49948043",
"0.4993496",
"0.49889094",
"0.49810857",
"0.4979535",
"0.49749053",
"0.49749053",
"0.4972337",
"0.49712202",
"0.49692312",
"0.49583796",
"0.49572244",
"0.49527377",
"0.49517825",
"0.49489844",
"0.49477422",
"0.4945636",
"0.4943197",
"0.4942233",
"0.49415132",
"0.49387714",
"0.49380034",
"0.49365106",
"0.4934303",
"0.4933338",
"0.49330506",
"0.49321893"
] |
0.6458008
|
0
|
patient worklow should proceed after 10 minutes
|
def patient_should_proceed_after_diagnosis?
procedure_type = concept 'Procedure type'
x_ray = concept 'Xray'
clinical = concept 'Clinical'
ultrasound = concept 'Ultrasound'
observation = Observation.joins(:encounter).where(
'person_id = ? AND concept_id = ? AND (value_coded = ? || value_coded = ? || value_coded = ?) AND encounter.encounter_type = ?',
@patient.patient_id, procedure_type.concept_id, x_ray.concept_id, clinical.concept_id, ultrasound.concept_id, encounter_type(DIAGNOSIS).id
).order(obs_datetime: :desc).first
begin
time_diff = (Time.current - observation.obs_datetime)
minutes = (time_diff / 60)
(minutes >= 1 / 60)
rescue StandardError
false
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def tired\t\r\n\tif $hours_asleep >= 8 then\r\n\t $hours_asleep = 0\r\n \t\treturn false\r\n \telse\r\n \t\t$hours_asleep += 1\r\n \t\treturn true\r\n \tend \t\t\r\nend",
"def typhoeus_timeout\n\t \t\t10\n\t \tend",
"def tired\t\n\tif $hours_asleep >= 8 then\n\t $hours_asleep = 0\n \t\treturn false\n \telse\n \t\t$hours_asleep += 1\n \t\treturn true\n \tend \t\t\nend",
"def tock\n @minute += 1\n end",
"def push_next_try_at\r\n self.next_try_at = 15.minutes.from_now\r\n end",
"def sleep_time\n 60\n end",
"def atest_ID_25891_scheduled_posts_01\n login $user_1_email, $master_password\n go_to_edit_profile_page\n $profiles_your_posts.click\n sleep 5\n scheduledPostCount = count_scheduled_current\n if (scheduledPostCount < 5)\n i=1\n while i < 3\n $browser.goto($patch_note)\n $post_pick_group.when_present().click\n $group_select.when_present().select(\"Sports\")\n $post_compose_note.wait_until_present()\n $browser.link(:text, \"Basketball\").when_present().click\n $post_compose_note.when_present().set(\"Note field populated by automated test.\")\n $advanced_options.when_present().click\n currentTime = Time.now() + 2\n currentDate = currentTime.strftime(\"%Y-%m-%d\")\n $post_advanced_calendar.when_present().set(\"#{currentDate}\")\n $post_advanced_time.when_present().set(\"11:00 PM\")\n sleep 3\n $browser.link(:text => /11:00/).click\n $profile_schedule.when_present().fire_event(\"onclick\")\n sleep 3\n i = i+1\n end\n end\n end",
"def implicit_wait=(seconds); end",
"def timer; end",
"def timer; end",
"def timer; end",
"def timer; end",
"def work(interval = 5.0)\n end",
"def minutes_running_low(tenant)\n ActsAsTenant.current_tenant = nil\n @tenant = tenant\n @plan = tenant.plan_bid.to_s\n @days = (tenant.next_due - Date.today).to_i\n mail(subject: 'Minutes Running Low', to: @tenant.owner.email, bcc: APP_CONFIG['admin_emails'])\n end",
"def retry_later\n IngestWorkflowMonitorJob.set(wait: 15.minutes).perform_later(flow.id, @params)\n end",
"def start_periodic_timers; end",
"def start_periodic_timers; end",
"def create\n timer = Timer.new(\n last_rang: Time.now,\n time_increment: params[:time_increment],\n increment_unit: params[:increment_unit],\n timerable_id: params[:timerable_id],\n timerable_type: params[:timerable_type],\n repeating: params[:repeating] \n )\n\n if timer.save\n user = timer.timerable.user\n text = \"your medication\"\n ReminderJob.set(wait: eval(\"#{timer.time_increment}.#{timer.increment_unit}\")).perform_later(timer, user.phone_number, text)\n\n render json: {message: 'Reminder created successfully'}, status: :created\n else \n render json: {errors: timer.errors.full_messages}, status: :bad_request\n end\n end",
"def sleep_before_next_attempted_login\n sleep 900\n end",
"def sleep_before_next_attempted_login\n sleep 900\n end",
"def simulate_work(time)\n return\n sleep time unless Softcover::test?\n end",
"def run_padi_upload # CHNAGE _STATUS_FLAG = Y !!!!!!! ## add mri_visit_number????\n v_base_path = Shared.get_base_path()\n @schedule = Schedule.where(\"name in ('padi_upload')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting padi_upload\"\n @schedulerun.save\n @schedulerun.start_time = @schedulerun.created_at\n @schedulerun.save\n v_comment = \"\"\n v_comment_warning =\"\"\n v_wisc_siteid =\"P04\"\n v_computer = \"kanga\"\n connection = ActiveRecord::Base.connection();\n # shp, alz, pc, adni, dodadni, lmpd\n v_scan_procedure_exclude = [21,28,31,34,15,19,23,35,44,51,50,49,20,24,36] # [21,28,31,34,15,19,23,35,44,51,50,49]\n # just get the predicttau\n v_scan_procedures = [26,41] # pdt1 and pdt [20,24,26,36,41,58] # how to only get adrc impact? \n #not limiting by protocol #scan_procedures_vgroups.scan_procedure_id in (\"+v_scan_procedures.join(\",\")+\")\n # getting adrc impact from t_adrc_impact_20150105 --- change to get from refreshing table?\n v_pet_tracer_array = [1] # just pib 1,2,7] # pib and fdg and thk5117 \n\n v_scan_type_limit = 1 \n v_series_desc_array =['T1 Volumetic','T1 Volumetric','T1+Volumetric','T1_Volumetric','T1'] # just t1,'T2','T2 Flair','T2_Flair','T2+Flair','DTI','ASL','resting_fMRI']\n v_series_desc_nii_hash = {'nothing'=>\"Y\"} #{ 'T1 Volumetic'=>\"Y\",'T1 Volumetric'=>\"Y\",'T1+Volumetric'=>\"Y\",'T1_Volumetric'=>\"Y\",'T1'=>\"Y\"}\n # recruit new scans --- change \n v_weeks_back = \"2\" # cwant to give time for quality checks etc. \n # NEED TO LIMIT ADRC BY LP --- NEED TO REFRESH ADRC IMPACT \n # t_adrc_impact_control_20150216 where participant_id is not null and lp_completed_flag ='Y')\n #(participants.wrapnum is not null and participants.wrapnum > '')\n # only want the tau - petid=7 \n # 'pdt00150','pdt00151','pdt00152','pdt00153','pdt00154','pdt00155','pdt00156','pdt00157','pdt00158','pdt00159'\n\n sql = \"select distinct vgroups.id, vgroups.participant_id,\n vgroups.transfer_mri, vgroups.transfer_pet\n from enrollments,enrollment_vgroup_memberships, vgroups, scan_procedures_vgroups,participants \n where participants.id = vgroups.participant_id and\n ( \n (vgroups.participant_id) in ( select enrollments.participant_id from enrollments where do_not_share_scans_flag ='N' and\n enrollments.enumber in ('pdt00178','pdt00176','pdt00175','pdt00173','pdt00172','pdt00171','pdt00169','pdt00166','pdt00168','pdt00165','pdt00167','pdt00164','pdt00162'))\n )\n and vgroups.id = enrollment_vgroup_memberships.vgroup_id \n and vgroups.id = scan_procedures_vgroups.vgroup_id\n and scan_procedures_vgroups.scan_procedure_id in (\"+v_scan_procedures.join(\",\")+\")\n and enrollment_vgroup_memberships.enrollment_id = enrollments.id\n and vgroups.vgroup_date < DATE_SUB(curdate(), INTERVAL \"+v_weeks_back+\" WEEK) \n and enrollments.do_not_share_scans_flag ='N' \n and vgroups.id NOT IN ( select cg_padi_upload.vgroup_id from cg_padi_upload \n where scan_procedure_id = scan_procedures_vgroups.scan_procedure_id )\n and ( vgroups.transfer_mri ='yes' and vgroups.transfer_pet ='yes' and vgroups.id \n in ( select appointments.vgroup_id from appointments, petscans where petscans.appointment_id = appointments.id\n and petscans.lookup_pettracer_id in (1) )\n )\"\n results = connection.execute(sql)\n results.each do |r|\n enrollments = Enrollment.where(\"id in (select enrollment_id from enrollment_vgroup_memberships where vgroup_id in(?))\",r[0])\n enrollment_enumbers_array = []\n enrollments.each do |e|\n enrollment_enumbers_array.push(e.enumber)\n end\n enrollment_enumbers = enrollment_enumbers_array.join(\",\")\n scan_procedures = ScanProcedure.where(\"id in (select scan_procedure_id from scan_procedures_vgroups where vgroup_id in(?))\",r[0])\n scan_procedure_codename_array = []\n scan_procedures.each do |e|\n scan_procedure_codename_array.push(e.codename)\n end\n scan_procedure_codenames = scan_procedure_codename_array.join(\",\")\n v_mri_status_flag = \"N\"\n v_pet_status_flag =\"N\"\n if (r[2].to_s == \"yes\")\n v_mri_status_flag = \"Y\" \n end\n if (r[3].to_s == \"yes\")\n v_pet_status_flag = \"Y\" \n end\n sql2 = \"insert into cg_padi_upload (vgroup_id,mri_sent_flag,mri_status_flag, pet_sent_flag,pet_status_flag,participant_id,enumbers,codenames) \n values('\"+r[0].to_s+\"','N','\"+v_mri_status_flag+\"', 'N','\"+v_pet_status_flag+\"',\"+r[1].to_s+\",'\"+enrollment_enumbers+\"','\"+scan_procedure_codenames+\"')\"\n results2 = connection.execute(sql2)\n end\n\n sql = \"insert into cg_padi_participants (participant_id)\n select distinct cg_padi_upload.participant_id from cg_padi_upload \n where participant_id NOT IN ( select participant_id from cg_padi_participants)\n and participant_id is not null\"\n\n results = connection.execute(sql)\n\n sql = \"update cg_padi_upload \n set cg_padi_upload.export_id = ( select cg_padi_participants.export_id from cg_padi_participants \n where cg_padi_participants.participant_id = cg_padi_upload.participant_id)\"\n results = connection.execute(sql)\n\n # add mri_visit_number and pet_visit_number update !!!!!!!!!!!!!!!\n\n v_folder_array = Array.new\n v_scan_desc_type_array = Array.new\n # check for dir in /tmp\n v_target_dir =\"/tmp/padi_upload\"\n # v_target_dir =\"/Volumes/Macintosh_HD2/padi_upload\"\n if !File.directory?(v_target_dir)\n v_call = \"mkdir \"+v_target_dir\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n end\n #PET\n sql = \"select distinct vgroup_id,export_id,enumbers,cg_padi_upload.pet_visit_number from cg_padi_upload where pet_sent_flag ='N' and pet_status_flag in ('G') and pet_visit_number is not null\" # ('Y','R') \"\n results = connection.execute(sql)\n\n v_comment = \" :list of vgroupids\"+v_comment\n results.each do |r|\n\n v_comment = r[0].to_s+\",\"+v_comment\n end\n @schedulerun.comment =v_comment[0..1990]\n @schedulerun.save\n results.each do |r|\n v_vgroup_id = r[0].to_s\n v_export_id = v_wisc_siteid+r[1].to_s.rjust(4,padstr='0')\n v_visit_number = \"v\"+r[3].to_s\n v_comment = \"strt \"+v_vgroup_id+\",\"+v_comment\n @schedulerun.comment =v_comment[0..1990]\n @schedulerun.save\n # update schedulerun comment - prepend \n \n sql_vgroup = \"select round((DATEDIFF(max(v.vgroup_date),p.dob)/365.25),2) from vgroups v, participants p where \n v.participant_id = p.id\n and v.id = \"+v_vgroup_id+\" and v.id in (select evm.vgroup_id from enrollment_vgroup_memberships evm, enrollments e,scan_procedures_vgroups spvg where spvg.vgroup_id = evm.vgroup_id and \n evm.enrollment_id = e.id and e.do_not_share_scans_flag ='N')\"\n results_vgroup = connection.execute(sql_vgroup)\n # mkdir /tmp/padi_upload/[subjectid]_YYYYMMDD_wisc\n # switching from age_at_appt , to v#, and somehow also passing age_at_appt linked to file name\n ####v_age = (results_vgroup.first)[0].to_s\n ####v_subject_dir = v_export_id+\"_\"+v_age.gsub(/\\./,\"\")+\"_pet\"\n v_subject_dir = v_export_id+\"_\"+v_visit_number+\"_pet\"\n v_parent_dir_target =v_target_dir+\"/\"+v_subject_dir\n v_call = \"mkdir \"+v_parent_dir_target\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close \n sql_pet = \"select distinct appointments.appointment_date, petscans.id petscan_id, petfiles.id petfile_id, lookup_pettracers.name, petfiles.path,petscans.lookup_pettracer_id\n from vgroups , appointments, petscans, lookup_pettracers, petfiles \n where vgroups.transfer_pet = 'yes' and vgroups.id = appointments.vgroup_id \n and appointments.id = petscans.appointment_id and petscans.id = petfiles.petscan_id\n and petscans.lookup_pettracer_id = lookup_pettracers.id\n and petscans.lookup_pettracer_id in (\"+v_pet_tracer_array.join(\",\")+\") \n and vgroups.id = \"+v_vgroup_id+\" \n order by appointments.appointment_date \"\n results_pet = connection.execute(sql_pet)\n v_folder_array = [] # how to empty\n v_tracer_array = []\n v_cnt = 1\n results_pet.each do |r_dataset|\n v_subject_id = \"\"\n v_tracer = r_dataset[3].gsub(/ /,\"_\").gsub(/\\[/,\"_\").gsub(/\\]/,\"_\")\n if !v_tracer_array.include?(v_tracer)\n v_tracer_array.push(v_tracer)\n end\n v_petfile_path = r_dataset[4]\n v_petfile_name = (r_dataset[4].split(\"/\")).last\n v_pettracer_id = r_dataset[5]\n #/mounts/data/raw/johnson.pipr.visit1/pet/pipr00001_2ef_c95_de11.v\n v_enumbers_array = r[2].split(\",\")\n v_enumbers_array.each do |e|\n v_subject_id = e\n v_petfile_name = v_petfile_name.gsub(v_subject_id,v_export_id )\n end\n if v_pettracer_id.to_s == \"1\"\n v_petfile_target_name = v_tracer+\"_\"+v_petfile_name\n v_call = \"rsync -av \"+v_petfile_path+\" \"+v_parent_dir_target+\"/\"+v_petfile_target_name \nputs(\"this petid= \"+v_pettracer_id.to_s )\n stdin, stdout, stderr = Open3.popen3(v_call)\n stderr.each {|line|\n puts line\n }\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n end\n end\n\n v_call = \"rsync -av \"+v_parent_dir_target+\" panda_user@\"+v_computer+\".dom.wisc.edu:/home/panda_user/upload_padi/\" #+v_subject_dir\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n \n #v_call = \"zip -r \"+v_target_dir+\"/\"+v_subject_dir+\".zip \"+v_parent_dir_target\n #v_call = \"cd \"+v_target_dir+\"; zip -r \"+v_subject_dir+\" \"+v_subject_dir # ??????? PROBLEM HERE????\n #v_call = \"cd \"+v_target_dir+\"; /bin/tar -zcf \"+v_subject_dir+\".tar.gz \"+v_subject_dir+\"/\"\n ## switch to zop for xnat \n ## v_call = 'ssh panda_user@\"+v_computer+\".dom.wisc.edu \" tar -C /home/panda_user/upload_padi -zcf /home/panda_user/upload_padi/'+v_subject_dir+'.tar.gz '+v_subject_dir+'/ \" '\n\nv_call = 'ssh panda_user@'+v_computer+'.dom.wisc.edu \" cd /home/panda_user/upload_padi/; zip -r '+v_subject_dir+'.zip '+v_subject_dir+' \" ' \n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n puts \"bbbbbbb \"+v_call\n\n v_call = ' rm -rf '+v_target_dir+'/'+v_subject_dir\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n # \n v_call = 'ssh panda_user@'+v_computer+'.dom.wisc.edu \" rm -rf /home/panda_user/upload_padi/'+v_subject_dir+' \"'\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n \n \n # did the tar.gz on \"+v_computer+\" to avoid mac acl PaxHeader extra directories\n # not need this? \n # could change sftp to come from ~/upload_padi\n v_call = \"rsync -av panda_user@\"+v_computer+\".dom.wisc.edu:/home/panda_user/upload_padi/\"+v_subject_dir+\".zip \"+v_target_dir+'/'+v_subject_dir+\".zip\"\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n\n#### # sftp -- shared helper hasthe username /password and address\n#### v_username = Shared.padi_sftp_username # get from shared helper\n#### v_passwrd = Shared.padi_sftp_password # get from shared helperwhich is not on github\n#### v_ip = Shared.padi_sftp_host_address # get from shared helper\n v_source = v_target_dir+'/'+v_subject_dir+\".zip\"\n v_target = v_subject_dir+\".zip\"\n\n \n\n#### Net::SFTP.start(v_ip, v_username, :password => v_passwrd) do |sftp|\n#### sftp.upload!(v_source, v_target)\n#### end\n# WANT TO CHECK TRANSFERS\n v_call = \" rm -rf \"+v_target_dir+'/'+v_subject_dir+\".zip\"\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close \n \n sql_sent = \"update cg_padi_upload set pet_sent_flag ='Y' where vgroup_id ='\"+r[0].to_s+\"' \"\n results_sent = connection.execute(sql_sent) \n\n end\n\n # get subjectid to upload # USING G AS LIMIT FOR TESTING\n #MRI switching to appointment\n sql = \"select distinct cg_padi_upload.vgroup_id,export_id,appointments.id,cg_padi_upload.mri_visit_number from cg_padi_upload,appointments \n where appointments.vgroup_id = cg_padi_upload.vgroup_id and\n appointments.appointment_type = 'mri'\n and mri_sent_flag ='N' and mri_status_flag in ('G') and mri_visit_number is not null \" # ('Y','R') \"\n results = connection.execute(sql)\n\n v_comment = \" :list of vgroupid \"+v_comment\n results.each do |r|\n v_comment = r[0].to_s+\",\"+v_comment\n end\n @schedulerun.comment =v_comment[0..1990]\n @schedulerun.save\n v_past_vgroup_id = \"0\"\n v_cnt = 1\n results.each do |r|\n v_vgroup_id = r[0].to_s\n if v_vgroup_id != v_past_vgroup_id\n v_past_vgroup_id = v_vgroup_id\n v_cnt = 1\n else\n v_cnt = v_cnt + 1\n end\n v_export_id =v_wisc_siteid+r[1].to_s.rjust(4,padstr='0')\n v_appointment_id = r[2].to_s\n v_visit_number = \"v\"+r[3].to_s\n v_comment = \"strt \"+v_vgroup_id+\",\"+v_comment\n @schedulerun.comment =v_comment[0..1990]\n @schedulerun.save\n # update schedulerun comment - prepend \n # just using appt date\n sql_vgroup = \"select round((DATEDIFF(a.appointment_date,p.dob)/365.25),2),\n round((DATEDIFF(v.vgroup_date,p.dob)/365.25),2),\n a.id from appointments a,vgroups v,participants p where v.id = \"+v_vgroup_id+\" \n and v.id = a.vgroup_id and a.id = \"+v_appointment_id+\"\n and v.participant_id = p.id\n and v.id in (select evm.vgroup_id from enrollment_vgroup_memberships evm, enrollments e,scan_procedures_vgroups spvg where spvg.vgroup_id = evm.vgroup_id and \n evm.enrollment_id = e.id and e.do_not_share_scans_flag ='N')\"\nputs \"PPPPP = apptid=\"+v_appointment_id+\" sql=\"+sql_vgroup \n results_vgroup = connection.execute(sql_vgroup)\n # mkdir /tmp/padi_upload/[subjectid]_YYYYMMDD_wisc\n # just using appt age \"_\"+(results_vgroup.first)[1].to_s+\n # switching from age_at_appt to v#, and somehow also send the age_appt to link up with file name\n #####v_age = ((results_vgroup.first)[0].to_s).gsub(/\\./,\"\")\n ####v_subject_dir = v_export_id+\"_\"+((results_vgroup.first)[0].to_s).gsub(/\\./,\"\")+\"_\"+v_cnt.to_s+\"_mri\"\n v_subject_dir = v_export_id+\"_\"+v_visit_number+\"_\"+v_cnt.to_s+\"_mri\"\n v_parent_dir_target =v_target_dir+\"/\"+v_subject_dir\n v_call = \"mkdir \"+v_parent_dir_target\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close \n sql_dataset = \"select distinct appointments.appointment_date, visits.id visit_id, image_datasets.id image_dataset_id, image_datasets.series_description, image_datasets.path, series_description_types.series_description_type \n from vgroups , appointments, visits, image_datasets, series_description_maps, series_description_types \n where vgroups.transfer_mri = 'yes' and vgroups.id = appointments.vgroup_id \n and appointments.id = visits.appointment_id and visits.id = image_datasets.visit_id\n and (image_datasets.do_not_share_scans_flag is NULL or image_datasets.do_not_share_scans_flag ='N')\n and (image_datasets.lock_default_scan_flag != 'Y' or image_datasets.lock_default_scan_flag is NULL)\n and LOWER(image_datasets.series_description) = LOWER(series_description_maps.series_description)\n and series_description_maps.series_description_type_id = series_description_types.id\n and series_description_types.series_description_type in ('\"+v_series_desc_array.join(\"','\")+\"') \n and image_datasets.series_description != 'DTI whole brain 2mm FATSAT ASSET'\n and vgroups.id = \"+v_vgroup_id+\" and appointments.id = \"+v_appointment_id+\"\n order by appointments.appointment_date \"\n results_dataset = connection.execute(sql_dataset)\n v_folder_array = [] # how to empty\n v_scan_desc_type_array = []\n v_cnt = 1\n results_dataset.each do |r_dataset|\n v_ids_ok_flag = \"Y\"\n v_ids_id = r_dataset[2]\n v_ids_ok_flag = self.check_ids_for_severe_or_incomplete(v_ids_id) # ADD THE DO NOT SHARE\n if v_ids_ok_flag == \"Y\" # no quality check severe or incomplete\n v_series_description_type = r_dataset[5].gsub(\" \",\"_\")\n v_path = r_dataset[4]\n v_dir_array = v_path.split(\"/\")\n v_dir = v_dir_array[(v_dir_array.size - 1)]\n v_dir_target = v_dir+\"_\"+v_series_description_type\n v_path = v_path.gsub(\"/Volumes/team/\",\"\").gsub(\"/Volumes/team-1/\",\"\").gsub(\"/Data/vtrak1/\",\"\") #v_base_path+\"/\"+\n if v_folder_array.include?(v_dir_target)\n v_dir_target = v_dir_target+\"_\"+v_cnt.to_s\n v_cnt = v_cnt +1\n # might get weird if multiple types have dups - only expect T1/Bravo\n end\n v_folder_array.push(v_dir_target)\n v_nii_flag = \"N\"\n #### v_nii_file_name = [subjectid]_[series_description /replace \" \" with -] , _[] , path- split / , last value]\n v_path_dir_array = r_dataset[4].split(\"/\")\n #/mounts/data/raw/wrap140/wrp002_5938_03072008/001\n v_subject_vgroup_array = v_path_dir_array[4].split(\"_\")\n v_subject_id = v_subject_vgroup_array[0]\n v_nii_file_name = v_subject_id+\"_\"+r_dataset[3].gsub(/ /,\"-\")+\"_\"+v_path_dir_array.last+\".nii\"\n v_nii_file_path = v_base_path+\"/preprocessed/visits/\"+v_path_dir_array[4].to_s+\"/\"+v_subject_id+\"/unknown/\"+v_nii_file_name\n\n if(v_series_desc_nii_hash[r_dataset[5]] == \"Y\")\n v_nii_flag = \"Y\"\n v_call = \"rsync -av \"+v_nii_file_path+\" \"+v_parent_dir_target+\"/\"+v_export_id+\"_\"+r_dataset[3].gsub(/ /,\"-\")+\"_\"+v_path_dir_array.last+\".nii\" \n stdin, stdout, stderr = Open3.popen3(v_call)\n stderr.each {|line|\n puts line\n }\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n end\n if !v_scan_desc_type_array.include?(v_series_description_type)\n v_scan_desc_type_array.push(v_series_description_type)\n end\n # v_call = \"/usr/bin/bunzip2 \"+v_parent_dir_target+\"/\"+v_dir_target+\"/*.bz2\"\n v_call = \"mise \"+v_path+\" \"+v_parent_dir_target+\"/\"+v_dir_target # works where bunzip2 cmd after rsync not work\n#puts \"v_path = \"+v_path\n#puts \"v_parent_dir_target = \"+ v_parent_dir_target\n#puts \"v_dir_target=\"+v_dir_target\nputs \"AAAAAA \"+v_call\n stdin, stdout, stderr = Open3.popen3(v_call)\n stderr.each {|line|\n puts line\n }\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n # temp - replace /Volumes/team/ and /Data/vtrak1/ with /Volumes/team-1 in dev\n # split on / --- get the last dir\n # make new dir name dir_series_description_type \n # check if in v_folder_array , if in v_folder_array , dir_series_description_type => dir_series_description_type_2\n # add dir, dir_series_description_type to v_folder_array\n # cp path ==> /tmp/padi_upload/[subjectid]_yyymmdd_wisc/dir_series_description_type(_2)\n end # skipping if qc severe or incomplete \n end\n\n sql_status = \"select mri_status_flag from cg_padi_upload where vgroup_id ='\"+r[0].to_s+\"' \"\n results_status = connection.execute(sql_status)\n if v_scan_desc_type_array.size < v_scan_type_limit and (results_status.first)[0] != \"R\"\n puts \"bbbbb !R or not enough scan types \"\n sql_dirlist = \"update cg_padi_upload set general_comment =' NOT ALL SCAN TYPES!!!! \"+v_folder_array.join(\", \")+\"' where vgroup_id ='\"+r[0].to_s+\"' \"\n results_dirlist = connection.execute(sql_dirlist)\n # send email \n v_subject = \"padi_upload \"+r[0].to_s+\" is missing some scan types --- set mri_status_flag ='R' to send : scans =\"+v_folder_array.join(\", \")\n v_email = \"noreply_johnson_lab@medicine.wisc.edu\"\n PandaMailer.schedule_notice(v_subject,{:send_to => v_email}).deliver\n\n # mail(\n # :from => \"noreply_johnson_lab@medicine.wisc.edu\"\n # :to => \"noreply_johnson_lab@medicine.wisc.edu\", \n # :subject => v_subject\n # )\n PandaMailer.schedule_notice(v_subject,{:send_to => \"noreply_johnson_lab@medicine.wisc.edu\"}).deliver\n v_comment_warning = v_comment_warning+\" \"+v_scan_desc_type_array.size.to_s+\" scan type \"+r[0].to_s+\" sp\"+r[1].to_s\n v_call = \"rm -rf \"+v_parent_dir_target\n# puts \"BBBBBBBB \"+v_call\n stdin, stdout, stderr = Open3.popen3(v_call)\n stderr.each {|line|\n puts line\n }\n while !stdout.eof?\n puts stdout.read 1024 \n end \n stdin.close\n stdout.close\n stderr.close\n else\n puts \"AAAAAAAAA DCM PATH TMP =\"+v_parent_dir_target+\"/*/*/*.dcm\"\n# /tmp/padi_upload/adrc00045_20130920_wisc/008_DTI/008\n\n sql_dirlist = \"update cg_padi_upload set mri_dir_list =concat('\"+v_folder_array.join(\", \")+\"',mri_dir_list) where vgroup_id ='\"+r[0].to_s+\"' \"\n results_dirlist = connection.execute(sql_dirlist)\n# TURN INTO A LOOP -- need to get rid of dates \n v_dicom_field_array =['0010,0030','0010,0010','0008,0050','0008,1030','0010,0020','0040,0254','0008,0080','0008,1010','0009,1002','0009,1030','0018,1000',\n '0025,101A','0040,0242','0040,0243','0008,0020','0008,0021','0008,0022','0008,0023','0040,0244']\n v_dicom_field_value_hash ={'0010,0030'=>'DOB','0010,0010'=>v_export_id,'0008,0050'=>'Accession Number',\n '0008,1030'=>'Study Description', '0010,0020'=>v_visit_number,'0040,0254'=>'Performed Proc Step Desc',\n '0008,0080'=>'Institution Name','0008,1010'=>'Station Name','0009,1002'=>'Private',\n '0009,1030'=>'Private','0018,1000'=>'Device Serial Number','0025,101A'=>'Private',\n '0040,0242'=>'Performed Station Name','0040,0243'=>'Performed Location',\n '0008,0020'=>'19720101','0008,0021'=>'19720101','0008,0022'=>'19720101', \n '0008,0023'=>'19720101','0040,0244'=>'19720101'}\n #### v_dicom_field_array.each do |dicom_key|\n Dir.glob(v_parent_dir_target+'/*/*/*.dcm').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.0*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.1*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.2*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.3*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.4*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.5*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n Dir.glob(v_parent_dir_target+'/*/*/*.6*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n \n #### end \n \n# \n# # #puts \"bbbbb dicom clean \"+v_parent_dir_target+\"/*/\"\n# Dir.glob(v_parent_dir_target+'/*/*/*.dcm').each {|dcm| puts d = DICOM::DObject.read(dcm); if !d[\"0010,0030\"].nil? \n# d[\"0010,0030\"].value = \"DOB\"; d.write(dcm) \n# end } \n v_call = \"rsync -av \"+v_parent_dir_target+\" panda_user@\"+v_computer+\".dom.wisc.edu:/home/panda_user/upload_padi/\" #+v_subject_dir\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n \n #v_call = \"zip -r \"+v_target_dir+\"/\"+v_subject_dir+\".zip \"+v_parent_dir_target\n #v_call = \"cd \"+v_target_dir+\"; zip -r \"+v_subject_dir+\" \"+v_subject_dir # ??????? PROBLEM HERE????\n #v_call = \"cd \"+v_target_dir+\"; /bin/tar -zcf \"+v_subject_dir+\".tar.gz \"+v_subject_dir+\"/\"\n # switching to zip for xnat\n #v_call = 'ssh panda_user@\"+v_computer+\".dom.wisc.edu \" tar -C /home/panda_user/upload_padi -zcf /home/panda_user/upload_padi/'+v_subject_dir+'.tar.gz '+v_subject_dir+'/ \" '\n v_call = 'ssh panda_user@'+v_computer+'.dom.wisc.edu \" cd /home/panda_user/upload_padi/; zip -r '+v_subject_dir+'.zip '+v_subject_dir+' \" '\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n puts \"bbbbbbb \"+v_call\n\n v_call = ' rm -rf '+v_target_dir+'/'+v_subject_dir\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n # \n v_call = 'ssh panda_user@'+v_computer+'.dom.wisc.edu \" rm -rf /home/panda_user/upload_padi/'+v_subject_dir+' \"'\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n \n \n # did the tar.gz on \"+v_computer+\" to avoid mac acl PaxHeader extra directories\n # not need this? \n # could change sftp to come from ~/upload_padi\n v_call = \"rsync -av panda_user@\"+v_computer+\".dom.wisc.edu:/home/panda_user/upload_padi/\"+v_subject_dir+\".zip \"+v_target_dir+'/'+v_subject_dir+\".zip\"\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n\n#### # sftp -- shared helper hasthe username /password and address\n#### v_username = Shared.padi_sftp_username # get from shared helper\n#### v_passwrd = Shared.padi_sftp_password # get from shared helperwhich is not on github\n#### v_ip = Shared.padi_sftp_host_address # get from shared helper\n v_source = v_target_dir+'/'+v_subject_dir+\".zip\"\n v_target = v_subject_dir+\".tar.gz\"\n\n \n\n#### Net::SFTP.start(v_ip, v_username, :password => v_passwrd) do |sftp|\n#### sftp.upload!(v_source, v_target)\n#### end\n# WANT TO CHECK TRANSFERS\n v_call = \" rm -rf \"+v_target_dir+'/'+v_subject_dir+\".zip\"\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close \n \n sql_sent = \"update cg_padi_upload set mri_sent_flag ='Y' where VGROUP_id ='\"+r[0].to_s+\"' \"\n results_sent = connection.execute(sql_sent)\n end\n v_comment = \"end \"+r[0].to_s+\",\"+v_comment\n @schedulerun.comment =v_comment[0..1990]\n @schedulerun.save \n end\n \n @schedulerun.comment =(\"successful finish padi_upload \"+v_comment_warning+\" \"+v_comment[0..1990])\n if !v_comment.include?(\"ERROR\")\n @schedulerun.status_flag =\"Y\"\n end\n @schedulerun.save\n @schedulerun.end_time = @schedulerun.updated_at \n @schedulerun.save \n \n \n end",
"def perform\n time = Time.zone.now.utc\n\n start_time = (time - 1.hour - 10.minutes).to_s(:time)\n end_time = (time - 1.hour + 10.minutes).to_s(:time)\n\n User\n .includes(:reports)\n .where('work_start_time::time > ? AND work_start_time < ?', start_time, end_time)\n .find_each do |user|\n\n last_reported_report = user.reports.reported.last\n\n user_start_time = time.change(hour: user.work_start_time.hour, min: user.work_start_time.min)\n next if (user_start_time..time).cover?(last_reported_report&.reported_at)\n\n Notifications::UserReportReminderJob.perform_async(user.id)\n end\n end",
"def watch_interval; end",
"def do_job\r\n# disable recycle invites\r\n# min = Time.now.min\r\n# #recycle invites 1 min per hour\r\n# if min == 0\r\n# ret = ActiveRecord::Base.connection.execute(\"delete from invites where invitee_id is null and created_at < subdate(now(), interval 3 day)\")\r\n# puts \"recycle invites: #{ret}\"\r\n# end\r\n end",
"def first_data_timeout(seconds); end",
"def notify\n graduate_course = GraduateCourse.find(params[:graduate_course])\n subperiod = params[:subperiod].to_i\n year = params[:year]\n if true\n head :ok\n start(graduate_course,subperiod,year)\n cap = Capability.find_by_name(\"Gestione schemi d'orario\")\n puts \"INIZIATO\"\n receivers = graduate_course.users.find(:all, :include => :capabilities, :conditions => [\"capabilities.id = ?\", cap.id])\n receivers.each do |r|\n TeacherMailer.deliver_timetable_calculate_is_started(r,graduate_course,params[:subperiod].to_i)\n end\n else\n head :unavailable\n end\n end",
"def pre_sleep; end",
"def sleepfor \n\ttimetorun = $hours * 60 * 60\n\tsleep(timetorun)\nend",
"def _rtimeout(wi)\n Ruote.participant_send(self, :rtimeout, 'workitem' => wi)\n end",
"def pause_for_roundtime\n if $_api_current_rt > 0\n api_sleep $_api_current_rt + $rt_adjust\n end\nend",
"def run_sleep_t1\n\n v_base_path = Shared.get_base_path()\n v_log_base =\"/mounts/data/preprocessed/logs/\"\n v_process_name = \"sleep_t1\"\n process_logs_delete_old( v_process_name, v_log_base)\n @schedule = Schedule.where(\"name in ('sleep_t1')\").first\n @schedulerun = Schedulerun.new\n @schedulerun.schedule_id = @schedule.id\n @schedulerun.comment =\"starting sleep_t1\"\n @schedulerun.save\n @schedulerun.start_time = @schedulerun.created_at\n @schedulerun.save\n v_comment = \"\"\n v_comment_warning =\"\"\n v_stop_file_name = v_process_name+\"_stop\"\n v_stop_file_path = v_log_base+v_stop_file_name\n connection = ActiveRecord::Base.connection();\n v_computer = \"kanga\"\n\n # fill in missing enrollmentid/scan_procedure_id\n sql = \"select distinct subjectid from cg_sleep_t1 where enrollment_id is NULL or scan_procedure_id is NULL\"\n results_blanks = connection.execute(sql)\n results_blanks.each do |r|\n v_subjectid_visit_num = r[0]\n v_subjectid = r[0].gsub(\"_v2\",\"\").gsub(\"_v3\",\"\").gsub(\"_v4\",\"\").gsub(\"_v5\",\"\")\n v_scan_procedure_id = get_sp_id_from_subjectid_v(v_subjectid_visit_num)\n v_enrollment_id = get_enrollment_id_from_subjectid_v(v_subjectid_visit_num)\n sql_update = \"update cg_sleep_t1 set enrollment_id = \"+v_enrollment_id.to_s+\", \n scan_procedure_id = \"+v_scan_procedure_id.to_s+\" \n where subjectid ='\"+v_subjectid_visit_num+\"'\"\n if !v_scan_procedure_id.blank? and !v_enrollment_id.blank?\n results = connection.execute(sql_update)\n end\n end\n \n # t1 and resting bold from /unknown asl from /asl\n v_target_dir = \"/home/panda_user/upload_sleep_t1\"\n v_final_target = \"ftp directory tbd\"\n v_series_description_category_array = ['T1_Volumetric'] #,'ASL']\n v_series_description_category_id_array = [19] #,1]\n sql = \"select distinct subjectid, enrollment_id, scan_procedure_id from cg_sleep_t1\n where ( sleep_sent_flag != 'Y' or sleep_sent_flag is NULL)\n and ( sleep_status_flag != 'N' or sleep_status_flag is NULL)\n and enrollment_id is not NULL \n and scan_procedure_id is not NULL\n \"\n results = connection.execute(sql)\n # get each subject , make target dir \n # get each series decription / file name / nii file based on series_description_category\n # mkdir with series_description_category, # of scan - e.g. 3rd T1\n # copy over the .nii file, r\n # bzip2 each subjectid dir\n results.each do |r|\n v_break = 0 # need a kill swith\n v_log = \"\"\n if File.file?(v_stop_file_path)\n File.delete(v_stop_file_path)\n v_break = 1\n v_log = v_log + \" STOPPING the results loop\"\n v_comment = \" STOPPING the results loop \"+v_comment\n end\n break if v_break > 0\n \n v_comment = \"strt \"+r[0]+\",\"+v_comment\n @schedulerun.comment =v_comment[0..1990]\n @schedulerun.save\n # update schedulerun comment - prepend \n sql_vgroup = \"select DATE_FORMAT(max(v.vgroup_date),'%Y%m%d' ) from vgroups v where v.id in (select evm.vgroup_id from enrollment_vgroup_memberships evm, enrollments e where evm.enrollment_id = e.id and e.enumber ='\"+r[0]+\"')\n and v.id in ( select scvg.vgroup_id from scan_procedures_vgroups scvg where scvg.scan_procedure_id in (\"+r[2].to_s+\"))\"\n results_vgroup = connection.execute(sql_vgroup)\n # mkdir /tmp/adrc_upload/[subjectid]_YYYYMMDD_wisc\n v_export_id = (@schedule.id).to_s+\"_\"+r[0].to_s\n v_subject_dir = v_export_id+\"_\"+(results_vgroup.first)[0].to_s+\"_wisc\"\n v_parent_dir_target =v_target_dir+\"/\"+v_subject_dir\n v_call = \"ssh panda_user@\"+v_computer+\".dom.wisc.edu 'mkdir \"+v_parent_dir_target +\"' \"\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n v_subjectid = r[0].gsub(\"_v2\",\"\").gsub(\"_v3\",\"\").gsub(\"_v4\",\"\").gsub(\"_v5\",\"\")\n sql_dataset = \"select distinct appointments.appointment_date, visits.id visit_id, image_datasets.id image_dataset_id, image_datasets.series_description, image_datasets.path, series_description_types.series_description_type \n from vgroups , appointments, visits, image_datasets, series_description_maps, series_description_types \n where vgroups.transfer_mri = 'yes' and vgroups.id = appointments.vgroup_id \n and appointments.id = visits.appointment_id and visits.id = image_datasets.visit_id\n and LOWER(image_datasets.series_description) = LOWER(series_description_maps.series_description)\n and series_description_maps.series_description_type_id = series_description_types.id\n and series_description_types.series_description_type in ('T1 Volumetic','T1 Volumetric','T1+Volumetric','T1_Volumetric','T1') \n and vgroups.id in (select evm.vgroup_id from enrollment_vgroup_memberships evm, enrollments e where evm.enrollment_id = \"+r[1].to_s+\" and evm.enrollment_id = e.id and e.enumber ='\"+ v_subjectid+\"')\n and vgroups.id in (select spv.vgroup_id from scan_procedures_vgroups spv where spv.scan_procedure_id = \"+r[2].to_s+\" )\n order by appointments.appointment_date \"\n\n results_dataset = connection.execute(sql_dataset)\n v_cnt = 1\n v_dir_target = \"\"\n v_scan_desc_type_array = []\n v_folder_array = [] # how to empty\n results_dataset.each do |r_dataset|\n v_series_description_type = r_dataset[5].gsub(\" \",\"_\")\n if !v_scan_desc_type_array.include?(v_series_description_type)\n v_scan_desc_type_array.push(v_series_description_type)\n end\n v_path = r_dataset[4]\n v_dir_array = v_path.split(\"/\")\n v_dir = v_dir_array[(v_dir_array.size - 1)]\n v_dir_target = v_dir+\"_\"+v_series_description_type\n v_path = v_path.gsub(\"/Volumes/team/\",\"\").gsub(\"/Volumes/team-1/\",\"\").gsub(\"/Data/vtrak1/\",\"\") #v_base_path+\"/\"+\n if v_folder_array.include?(v_dir_target)\n v_dir_target = v_dir_target+\"_\"+v_cnt.to_s\n v_cnt = v_cnt +1\n # might get weird if multiple types have dups - only expect T1/Bravo\n end\n puts \"aaaaaa v_dir_target = \"+v_dir_target\n v_folder_array.push(v_dir_target)\n\n # v_call = \"/usr/bin/bunzip2 \"+v_parent_dir_target+\"/\"+v_dir_target+\"/*.bz2\"\n v_tmp = \"/tmp/\"+v_dir_target \n v_call = \"mise \"+v_path+\" \"+v_parent_dir_target+\"/\"+v_dir_target # works where bunzip2 cmd after rsync not work\n v_call = \"mise \"+v_path+\" \"+v_tmp \n #puts \"v_path = \"+v_path\n #puts \"v_parent_dir_target = \"+ v_parent_dir_target\n #puts \"v_dir_target=\"+v_dir_target\n puts \"AAAAAA \"+v_call\n stdin, stdout, stderr = Open3.popen3(v_call)\n stderr.each {|line|\n puts line\n }\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n # temp - replace /Volumes/team/ and /Data/vtrak1/ with /Volumes/team-1 in dev\n # split on / --- get the last dir\n # make new dir name dir_series_description_type \n # check if in v_folder_array , if in v_folder_array , dir_series_description_type => dir_series_description_type_2\n # add dir, dir_series_description_type to v_folder_array\n # cp path ==> /tmp/adrc_dti/[subjectid]_yyymmdd_wisc/dir_series_description_type(_2)\n end\n\n\n if v_scan_desc_type_array.size > 0 \nputs \"dddddd in ids dicoms\"\nputs \" /tmp dir = \"+\"/tmp/\"+v_dir_target+\"/*/*.* 0. 1. 2. *.dcm\" \n # TURN INTO A LOOP \n v_dicom_field_array =['0010,0030','0010,0010','0008,0050','0008,1030','0010,0020','0040,0254','0008,0080','0008,1010','0009,1002','0009,1030','0018,1000',\n '0025,101A','0040,0242','0040,0243']\n v_dicom_field_value_hash ={'0010,0030'=>'DOB','0010,0010'=>'Name','0008,0050'=>'Accession Number',\n '0008,1030'=>'Study Description', '0010,0020'=>'Patient ID','0040,0254'=>'Performed Proc Step Desc',\n '0008,0080'=>'Institution Name','0008,1010'=>'Station Name','0009,1002'=>'Private',\n '0009,1030'=>'Private','0018,1000'=>'Device Serial Number','0025,101A'=>'Private',\n '0040,0242'=>'Performed Station Name','0040,0243'=>'Performed Location'}\n\n\n # v_dicom_field_array =['0010,0030']\n # v_dicom_field_value_hash ={'0010,0030'=>'DOB'}\n #### v_dicom_field_array.each do |dicom_key|\n Dir.glob('/tmp/'+v_dir_target+'/*/*.dcm').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n\n \n Dir.glob('/tmp/'+v_dir_target+'/*/*.0*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end }\n\n Dir.glob('/tmp/'+v_dir_target+'/*/*.1*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm)\n end \n end } \n Dir.glob('/tmp/'+v_dir_target+'/*/*.2*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end } \n Dir.glob('/tmp/'+v_dir_target+'/*/*.3*').each {|dcm| puts d = DICOM::DObject.read(dcm); \n v_dicom_field_array.each do |dicom_key|\n if !d[dicom_key].nil? \n d[dicom_key].value = v_dicom_field_value_hash[dicom_key]; d.write(dcm) \n end \n end } \n\n v_call = \"rsync -av /tmp/\"+v_dir_target+\" panda_user@\"+v_computer+\".dom.wisc.edu:\"+v_parent_dir_target \n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n\n v_call = \"rm -rf /tmp/\"+v_dir_target\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n\n\n end \n\n\n \n #tar.gz subjectid dir\n v_call = \"cd \"+v_target_dir+\"; /bin/tar -zcf \"+v_subject_dir+\".tar.gz \"+v_subject_dir+\"/\"\n v_call = 'ssh panda_user@'+v_computer+'.dom.wisc.edu \" tar -C '+v_target_dir+' -zcf '+v_parent_dir_target+'.tar.gz '+v_subject_dir+'/ \" '\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n # remove subjectid dir\n v_call = 'ssh panda_user@'+v_computer+'.dom.wisc.edu \" rm -rf '+v_parent_dir_target+' \"'\n stdin, stdout, stderr = Open3.popen3(v_call)\n while !stdout.eof?\n puts stdout.read 1024 \n end\n stdin.close\n stdout.close\n stderr.close\n \n # fsftp dir when set -- not practical - not using auto move\n # sftp -- shared helper hasthe username /password and address\n # v_username = Shared.panda_admin_sftp_username # get from shared helper -- leaving as panda_admin\n # v_passwrd = Shared.panda_admin_sftp_password # get from shared helperwhich is not on github\n # switch on new platform\n #v_username = Shared.panda_user_sftp_username # get from shared helper\n #v_passwrd = Shared.panda_user_sftp_password # get from shared helperwhich is not on github\n # v_ip = Shared.dom_sftp_host_address # get from shared helper\n # v_sftp_dir = Shared.antuano_target_path\n \n # problem that files are on \"+v_computer+\", but panda running from nelson\n # need to ssh to \"+v_computer+\" as pand_admin, then sftp\n # v_source = \"panda_user@\"+v_computer+\".dom.wisc.edu:\"+v_target_dir+'/'+v_subject_dir+\".tar.gz\"\n \n # v_target = v_sftp_dir+\"/\" #+v_subject_dir+\".tar.gz\"\n \n# puts \"aaaaaa v_source = \"+v_source\n# puts \"bbbbbb v_target = \"+v_target\n# Net::SFTP.start(v_ip, v_username, :password => v_passwrd) do |sftp|\n# sftp.upload!(v_source, v_target)\n# end\n# \n \n sql_done = \"update cg_sleep_t1 set sleep_sent_flag ='Y', sleep_dir_list = '\"+ v_folder_array.join(\",\")+\"' where subjectid = '\"+r[0]+\"'\"\n results_done = connection.execute(sql_done)\n \n end # results\n \n @schedulerun.comment =(\"successful finish sleep_t1_upload \"+v_comment_warning+\" \"+v_comment[0..1990])\n if !v_comment.include?(\"ERROR\")\n @schedulerun.status_flag =\"Y\"\n end\n @schedulerun.save\n @schedulerun.end_time = @schedulerun.updated_at \n @schedulerun.save\n\n\n end",
"def sleepy_run; end",
"def create\n # @patient = Patient.new(patient_params)\n # @numOfPatients = \"number of patients\"\n \n # respond_to do |format|\n # if @patient.save\n # @count = Patient.count-1\n # flash[:numOfPatients] = \"number of patients in the front: #{@count}\"\n # format.html { redirect_to patients_url, notice: \"Estimated wait time : #{@count} hours\"}\n # format.json { render :show, status: :created, location: @patient }\n # else\n # format.html { render :new }\n # format.json { render json: @patient.errors, status: :unprocessable_entity }\n # end\n # end\n time = Time.new.in_time_zone('Central Time (US & Canada)')\n flag = false\n flag1 = true\n res_hour = -1\n res_min = -1\n p_hour = -1\n p_minute = -1\n \n @patients = Patient.order(:id)\n @patients.each do |patient|\n p_time = patient.time.split(\":\")\n p_hour = p_time[0].to_i\n p_minute = p_time[1].to_i\n \n if ((p_hour > time.hour.to_i) or (p_hour == time.hour.to_i and p_minute > time.min.to_i)) and (patient.name.eql? \"_name\")\n flag = true\n res_hour = p_hour - time.hour.to_i\n res_min = p_minute - time.min.to_i\n \n if(res_min < 0)\n res_hour = res_hour - 1\n res_min = 60 + res_min\n end\n \n flag1 = patient.update(patient_params)\n # patient.update_attribute(:name, patient_params[:patient][:name])\n # patient.update_attribute(:number, patient_params[:patient][:number])\n break\n end\n end\n \n respond_to do |format|\n if flag and flag1\n format.html { redirect_to patients_url, notice: \"Estimated wait time : #{res_hour} hours, #{res_min} minutes / tiempo estimado : #{res_hour} horas, #{res_min} minutos\"}\n elsif !flag1\n flash[:notice] = \"ERROR: No Duplicate entry allowed. Number can contain only 10 digits from 0-9.\"\n format.html { render :new}\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n else\n format.html { redirect_to patients_url, notice: \"No more patient accepted, please come tomorrow\"}\n end\n end\n end",
"def work( payload, metadata )\n\t\tself.job_counter.mark\n\t\tself.job_timer.time do\n\t\t\tsuper\n\t\tend\n\tend",
"def test_participant_re_dispatch_later_cancel\n\n pdef = Ruote.process_definition do\n alpha\n end\n\n @dashboard.register_participant :alpha, RetryParticipant, 'delay' => '1m'\n\n #noisy\n\n wfid = @dashboard.launch(pdef)\n sleep 0.7\n\n @dashboard.cancel_process(wfid)\n wait_for(wfid)\n\n assert_equal 0, @dashboard.storage.get_many('schedules').size\n end",
"def test_start_stop\n start_time_for={}\n stop_time=nil\n at=Activity_tracker.new do |id|\n assert((Time.now-start_time_for[id]-at.timeout).to_f.abs<at.tick_time)\n end\n if at.tresholds<3\n puts \"Warning: this test supposed to run successfully\"+\n \"only wich tresholds>3\"\n end\n 4.times do\n start_time_for[1]=Time.now \n at.active 1\n sleep at.timeout.to_f/2\n start_time_for[2]=Time.now \n at.active 2\n sleep at.timeout.to_f/2\n start_time_for[2]=Time.now \n at.active 2\n end\n end",
"def persistent_timeout(seconds); end",
"def work_profile_password_minutes_of_inactivity_before_screen_timeout\n return @work_profile_password_minutes_of_inactivity_before_screen_timeout\n end",
"def put_to_sleep\n if self.program_player.present?\n self.update_attributes(:num_crows => self.num_crows+1, :day_of_budge => NEEDS_REVIVING)\n self.program_player.user.contact_them(:email, :moment_of_truth, self) \n end\n end",
"def test_participant_re_dispatch_later\n\n pdef = Ruote.process_definition do\n alpha\n end\n\n @dashboard.register_participant :alpha, RetryParticipant\n\n wfid = @dashboard.launch(pdef)\n wait_for(wfid)\n\n times = @tracer.to_s.split(\"\\n\").collect { |t| Float(t) }\n t = times.last - times.first\n\n assert t >= 1.0, \"took less that 1 second\"\n assert t < 2.8, \"took more than 2.8 second\"\n end",
"def start_trial\n self.trial_started_at = Time.now if self.new_record?\n end",
"def on_timed_hit_success\n end",
"def remember_to_review\n if self.id and self.redeemed_at \n RunOncePeriodicJob.create!(:name => 'RememberToReview',\n :job => \"Credit.review_reminder(#{self.id})\",\n :next_run_at => (7.days.from_now)) unless self.redeemed_at.nil?\n end\n end",
"def redmine_add_time(m, params)\n begin\n \tcertificate = redmine_check_auth(m)\n\t\tif ! certificate\n\t\t\t# ne rien faire, l'utilisateur n'est pas connecté\n\t\telse\n\t\t\tresulted_task = redmine_check_task(m, params, certificate)\n\t\t\tif resulted_task\n\t\t\t\t# on met à jour le champ params avant de l'employer\n\t\t\t\tparams[:username] = certificate[:username]\n\t\t\t\tparams[:spent_time] = params[:hours]\n\t\t\t\t# appel à la méthode du webservice pour l'ajout de temps pour une tache\n\t\t\t\tredmine_add_time_entry(m, params, certificate)\n\t\t\t\t\n\t\t\t\t# on indique à l'utilisateur\n\t\t\t\t@bot.say m.replyto, \"#{certificate[:username]}, #{@redmine_l_thetask} ##{resulted_task.id} #{@redmine_l_hasbeenupdated} => #{@redmine_rapid_url}#{@redmine_issue_show_path}/#{resulted_task.id}\"\n\t\t\telse\n\t\t\t\tm.reply \"#{@redmine_l_thetask} ##{params[:task]} #{@redmine_l_doesnotexistsinredmine}\"\n\t\t\tend\n\t\tend\n rescue Exception => e\n m.reply e.message\n m.reply e.backtrace.inspect\n end\n end",
"def timeout; end",
"def timeout; end",
"def timeout; end",
"def worker_check_interval(interval); end",
"def start_timed_out\n end",
"def timeout_at; end",
"def evaulate_schedule\n 5\n end",
"def story_time\n touch(@@detailsheader)\n sleeper(30)\n end",
"def home\n #sleep(60)\n end",
"def next_meeting(after_time = Time.now.utc )\n # puts \"Looking up next meeting after #{after_time}\"\n if recurrence_frequency.blank?\n return start_time\n end\n\n if after_time < start_time\n return start_time\n end \n\n after_time = after_time.local_from_utc(self.time_zone) \n\n\n # Advance the starting time in the case when it falls after the beginning of\n # a meeting on the same day. We do this so that we can use \"day precision\"\n # (PDate.day) in the Runt library instead of \"minute precision\" (PDate.min),\n # which performs terribly.\n start_time = start_time_local\n if(after_time.hour > start_time.hour or ( after_time.hour == start_time.hour and after_time.min > start_time.min))\n after_time = after_time + 1.day\n after_time = Time.gm(after_time.year, after_time.month, after_time.day, 0, 0)\n end\n\n case recurrence_frequency\n when 'daily'\n end_time = after_time + 25.hours \n # after_time -= 1.day\n start_date = PDate.day(after_time.year, after_time.month, after_time.day , after_time.hour, after_time.min)\n end_date = PDate.day(end_time.year, end_time.month, end_time.day, end_time.hour, end_time.min)\n when 'weekdays'\n # Make the range over 3 days so that Friday night searches will still turn\n # up Monday as the next day.\n end_time = after_time + 3.days\n start_date = PDate.day(after_time.year, after_time.month, after_time.day, after_time.hour, after_time.min)\n end_date = PDate.day(end_time.year, end_time.month, end_time.day, end_time.hour, end_time.min)\n when 'monthly'\n eom = (after_time + 40.days)\n start_date = PDate.day(after_time.year, after_time.month, after_time.day)\n end_date = PDate.day(eom.year, eom.month, eom.day)\n when 'weekly'\n eow = (after_time + 8.days)\n start_date = PDate.day(after_time.year, after_time.month, after_time.day)\n end_date = PDate.day(eow.year, eow.month, eow.day)\n when 'yearly'\n # Just doing \"after_time + 367.days\" results in a bit of a performance hit\n # as hundreds of days are compared. We'll try to narrow it a bit. Not too\n # much, because we don't have time to actually write unit tests and make\n # sure the narrowing code works. :) Which is why the comment is here.\n st = after_time + 250.days\n et = st + 150.days\n start_date = PDate.day(st.year, st.month, st.day)\n end_date = PDate.day(et.year, et.month, et.day)\n end \n # puts \" Range #{start_date.to_s} - #{end_date.to_s}\"\n d_range = DateRange.new(start_date, end_date)\n sched = Schedule.new\n event = Event.new((self.invitation.name rescue \"no name\"))\n sched.add(event,self.runt_expression)\n dates = sched.dates(event,d_range)\n\n next_mtg = dates.first\n next_mtg_time = Time.gm(next_mtg.year, next_mtg.month, next_mtg.day, start_time_local.hour, start_time_local.min)\n result = nil\n begin\n result = next_mtg_time.local_to_utc(self.time_zone)\n rescue TZInfo::PeriodNotFound\n # This only happens when the time is during the one hour which is skipped\n # during the transition to DST. For example, only on Sun Mar 08 02:15:00\n # (see ticket #744).\n next_hour = start_time_local.hour + 1\n next_mtg_time = Time.gm(next_mtg.year, next_mtg.month, next_mtg.day, next_hour, start_time_local.min)\n retry\n end\n return result\n end",
"def test_ps_and_schedules\n\n pdef = Ruote.define do\n concurrence do\n wait '4h'\n wait '2h'\n end\n end\n\n wfid = @dashboard.launch(pdef)\n\n @dashboard.wait_for(4)\n\n #assert_equal 1, @dashboard.processes.size\n assert_equal [ wfid ], @dashboard.processes.collect { |ps| ps.wfid }\n end",
"def run!\n make_new_account\n\n length.times do\n universe = ACTIVITIES\n activity = universe.sample\n unless respond_to?(activity, true)\n LLL.error \"activity #{activity} not implemented\"\n next\n end\n\n LLL.info \"trying #{activity}\"\n before_time = Time.now.to_f\n Timeout.timeout(@timeout) do\n send activity\n end\n after_time = Time.now.to_f\n\n @report[activity].add(after_time - before_time)\n end\n end",
"def work_profile_password_minutes_of_inactivity_before_screen_timeout=(value)\n @work_profile_password_minutes_of_inactivity_before_screen_timeout = value\n end",
"def lead_time\n 1\n end",
"def on_timer_timeout\n #puts \"#on_timer_minute #{@timer_minute} #{@timer_minute_limit}\"\n @timer_minute += 1\n if @timer_minute > @timer_minute_limit\n change_wallpaper\n\n # Restart timer\n reset_timer_minute\n end\n end",
"def trial_early(company_phone)\n @company_phone = company_phone\n @company = @company_phone.company\n @trial_discount = ENV['TRIAL_EARLY_BUY_DISCOUNT']\n @pay_url = \"#{@landing_url}/pago?api_key=#{@company.api_key}\"\n @discount_limit =\n @company.trial_ends_at.localtime.strftime('%d/%m/%Y a las %H:%M')\n mail(\n to: @company_phone.extensions.admin.first.email,\n subject: 'GurúComm | Nos da gusto saber que estás usando GurúComm'\n )\n end",
"def extend()\n # Get the appointment\n appointment = current_user.appointments.last\n student_id = current_user.id\n tutor_id = appointment.tutor.id\n # Get the sidekiq job\n jids = appointment.jids.split('|')\n jid_reminder = jids[0]\n jid_complete = jids[1]\n job_reminder = Sidekiq::ScheduledSet.new.find_job(jid_reminder)\n job_complete = Sidekiq::ScheduledSet.new.find_job(jid_complete)\n complete_new_time = job_complete.at + Settings.call_extend_time\n reminder_new_time = complete_new_time - Settings.call_speak_reminder_time\n\n if job_complete.reschedule(complete_new_time) &&\n job_reminder.reschedule(reminder_new_time)\n # update the appointment cost and call time\n appointment.update_attribute(:amount, appointment.amount + Settings.call_extend_cost)\n appointment.update_attribute(:tutor_earned, appointment.tutor_earned + Settings.call_extend_earned)\n # notify the student and the tutor\n msg = I18n.t('appointment.conference_room.call_extend', \n time: Settings.call_extend_time)\n MessageBroadcastJob.perform_later(msg, 'notification',\n student_id: student_id,\n tutor_id: tutor_id)\n else\n msg = I18n.t('students.errors.appointment.call_extend')\n MessageBroadcastJob.perform_later(msg, 'notification',\n student_id: student_id)\n end\n end",
"def wfs_delay\r\n\t\t10\r\n\tend",
"def sleep_according_to_timer_and_api_call_limit(call_hash, logger)\n\t# if meet max allowed call count during the time interval\n\t# sleep until time expires\n\tlogger.info \"end time=#{call_hash['end_time']}, call count #{call_hash['call_count']}, allowed number calls #{call_hash['allowed_call_number_during_interval']}\"\n\twhile (Time.now.to_i <= call_hash['end_time'].to_i && call_hash['call_count'] >= call_hash['allowed_call_number_during_interval'])\n\t\tsleep_sec = (call_hash['end_time'] - Time.now).to_i + 2\n\t\tlogger.info \"API call: sleep #{sleep_sec} seconds till next time interval\"\n\t\tsleep(sleep_sec)\n\tend\n\n\tif (Time.now.to_i > call_hash['end_time'].to_i)\n\t\t# set new time frame\n\t\tcall_hash[\"start_time\"] = Time.now\n\t\tcall_hash['end_time'] = call_hash['start_time'] + call_hash['time_interval_in_seconds'] # one minute apart\n\t\t#rest the esb call count\n\t\tlogger.info \"reset call count\"\n\t\tcall_hash['call_count'] = 0\n\tend\n\n\t# return changed values\n\treturn call_hash\nend",
"def perform\n alerts = Alert.utilization_efficiency.where(\"enabled=?\",true)\n\n # if it has just alert the user\n alerts.each do |alert|\n begin\n #calculate in hours the frequency\n utilization_efficiency_hours = 0\n amount = alert.utilization_efficiency_number\n\n #convert the aggregation [days or hours] into hours for calculations\n hours_per_day = 24\n if alert.aggregation_frequency == \"month\"\n utilization_efficiency_hours = amount * hours_per_day * 30 \n elsif alert.aggregation_frequency == \"week\"\n utilization_efficiency_hours = amount * hours_per_day * 7 \n elsif alert.aggregation_frequency == \"day\"\n utilization_efficiency_hours = amount * hours_per_day \n else\n utilization_efficiency_hours = amount\n end\n\n hour_difference = (Time.parse(DateTime.now.to_s) - Time.parse(alert.utilization_efficiency_last_checked.to_s))/3600\n if hour_difference > utilization_efficiency_hours\n alert.update_column(\"utilization_efficiency_last_checked\", Time.now)\n alert_history_count=AlertHistory.where('alert_id=?', alert.id).where('created_at >= ?', alert.utilization_efficiency_last_checked).where('for_aggregation_calculation=true').count\n\n # minimum value for the threshold is one\n if alert_history_count <= alert.aggregation_threshold\n alert_history_triggered(alert, alert_history_count)\n else\n #the sample was read x times correctly so the alert does not need to monitor for this sample id, now disable the alert\n # or do we reset the utilization_efficiency_last_checked and recheck??\n alert.update_column(\"enabled\", false)\n alert.delete_percolator\n end\n end\n\n rescue => e\n Rails.logger.error { \"Encountered an error when trying to run background job HourlyUtilizationEfficiencyJob : #{alert.id}, #{e.message} #{e.backtrace.join(\"\\n\")}\" }\n end\n end\n end",
"def first_hires\n (1..10).each do |number|\n add_to_waitlist(number)\n end\n hire(6)\n self\n end",
"def test_scan_every_patient\n patient_ids = Patient.find(:all).map(&:id)\n login\n select_tasks ['HIV Reception']\n patient_ids.each {|patient_id|\n begin\n patient = Patient.find(patient_id)\n puts \"Scanning #{patient.national_id} (#{patient.id})\"\n scan_patient(patient.national_id, patient.id) \n assert_redirected_to \"/patient/patient_detail_summary\"\n rescue Exception => e\n puts \" #{e}\"\n yell \" #{e}\"\n end\n } \n end",
"def nap\n @awake = false\n time_passed\nend",
"def idle_timeout; end",
"def idle_timeout; end",
"def worker_timeout(timeout); end",
"def ddos_protect(max)\n sleep(((60 / max) * 10).ceil/10)\n end",
"def lock_timeout_retries; end",
"def patiently(seconds=Capybara.default_max_wait_time, &block)\n #puts \"Tried waiting\"\n old_wait_time = Capybara.default_max_wait_time\n # dont make nested wait_untils use up all the alloted time\n Capybara.default_max_wait_time = 0 # for we are a jealous gem\n if page.driver.wait?\n start_time = Time.now\n begin\n block.call\n rescue Exception => e\n raise e unless RETRY_ERRORS.include?(e.class.name)\n puts \"Failed: #{e.message}\" if SimpliTest.mode == 'DEBUG'\n wait_time = SimpliTest.config_settings ? SimpliTest.config_settings['MAX_WAIT_TIME'] : 5\n raise e if (Time.now - start_time) >= wait_time\n sleep(0.1)\n raise Capybara::FrozenInTime, \"time appears to be frozen, Capybara does not work with libraries which freeze time, consider using time travelling instead\" if Time.now == start_time\n puts \"Retrying...\" if SimpliTest.mode == 'DEBUG'\n retry\n end\n else\n block.call\n end\n ensure\n Capybara.default_max_wait_time = old_wait_time\n end",
"def calc_next_run\n RunAtPeriodicJob.new(:name => self.name, :job => self.job, :run_at_minutes => self.run_at_minutes)\n end",
"def lock_timeout; end",
"def runjob\n #last_valuation = current_valuation\n #current_valuation = rand(100)\n\n #APIKEY = 'qFuWyb9A1pIkykQ'\n #@SERVERURL = 'http://nightwing.recsports.vt.edu:3001/api?api_key=' + APIKEY\n\n #data = HTTParty.get @SERVERURL\n\n #@STATURL = 'http://nightwing.recsports.vt.edu:3001/api/stats?key=123456'\n @STATURL = 'http://run.recsports.vt.edu/api/stats?key=qFuWyb9A1pIkykQ'\n @stats = HTTParty.get(@STATURL)\n @statshash = JSON.parse(@stats.body)\n\n #@statshash = Oj.dump(@stats.body)\n\n #puts @statshash\n #total_registrations = @statshash['stats']['total_registrations']\n\n total_registrations = @statshash['stats']['checked_in']\n\n #walkup = @statshash['stats']['walkup']\n #checked_in = @statshash['stats']['checked_in']\n #checked_in_first_day = @statshash['stats']['checked_in_first_day']\n #checked_in_percent = checked_in.fdiv(@total_registrations)*100\n #checked_in_percent = checked_in_percent.round\n\n puts total_registrations\n\n last_valuation = total_registrations\n #puts walkup\n #puts checked_in\n #puts checked_in_percent\n\n #json = Oj.load(@statshash)\n #@statshash = JSON.parse(@stats.stats)\n\n\n Dashing.send_event('totalregisters', { current:total_registrations}) #, last: last_valuation\n #Dashing.send_event('walk', { current: walkup, last: walkup })\n #Dashing.send_event('checkedin', { value: checked_in })\n #Dashing.send_event('checkedinfirstday', { current: checked_in_first_day, last: checked_in_first_day })\n\n\nend",
"def rest(time:)\n @stepdown_wait = time\n end",
"def recurring; end",
"def setup_heartbeat_timer; end",
"def need_tock?\n if @second == 60\n @second = 0\n tock\n end\n end",
"def perform(metadata)\n scheduled_at = Time.at(metadata[\"scheduled_at\"])\n minutes = scheduled_at.min\n hours = scheduled_at.hour\n\n # 20 requests / minute\n if (minutes % 2 == 0) # Top 0-19; every 2 minutes\n perform_update(1)\n else # Top 20-99; every 2 minutes, full cycle of 6 minutes\n sub_index = (minutes / 2) % 3\n perform_update(2, sub_index)\n end\n\n # 20 requests / minute\n if minutes % 3 == 0 # Top 100-199; every 3 minutes, full cycle of 15 minutes\n sub_index = (minutes / 3) % 5\n perform_update(3, sub_index)\n elsif minutes % 6 == 1 # Top 200-299; every 6 minutes, full cycle of 30 minutes\n sub_index = (minutes / 6) % 5\n perform_update(4, sub_index)\n elsif minutes % 6 == 2 # Top 300-499; every 6 minutes, full cycle of 60 minutes\n sub_index = (minutes / 6) % 10\n perform_update(5, sub_index)\n end\n\n # 25-30 requests / minute\n if minutes % 12 == 0 # Top 500-749; every 12 minutes, full cycle of 1 hour\n sub_index = (minutes / 12) % 5\n perform_update(6, sub_index)\n end\n two_hour_cycle = hours % 2 * 60 + minutes\n if two_hour_cycle % 12 == 1 # Top 750-999; every 12 minutes, full cycle of 2 hours\n sub_index = (two_hour_cycle / 12) % 10\n perform_update(7, sub_index)\n end\n four_hour_cycle = hours % 4 * 60 + minutes\n if four_hour_cycle % 12 == 2 # Top 1000-1499; every 12 minutes, full cycle of 4 hours\n sub_index = (four_hour_cycle / 12) % 20\n perform_update(8, sub_index)\n end\n # 25 requests / 3 minutes with blank periods due to unknown coin limit\n six_hour_cycle = hours % 6 * 60 + minutes\n if six_hour_cycle % 3 == 1 # Top 1500-4499; every 3 minutes, full cycle of 6 hours\n sub_index = (six_hour_cycle / 3) % 120\n perform_update(9, sub_index)\n end\n end",
"def perform(*args)\n # start a \"timer\" and run it until whenever\n start_time = Time.now.to_i\n\n expiration_time = Config.find_by(description: 'Timer expiration').value.to_f\n \n # just run forever (i.e. until expired or cancelled)\n while !cancelled? && (Time.now.to_f - start_time) < expiration_time\n end\n\n # remove own JID from Timer table\n timer = Timer.find_by(jid: jid)\n # Don't try this update if a Timer with this JID does not exist\n if timer\n timer.update(jid: nil)\n end\n\n end_time = Time.now.to_f\n\n puts \"Timer JID:#{jid} ran for: #{end_time - start_time} seconds\"\n end",
"def timer_checkpoints\n t = self.time_remaining\n if @timer_checkpoint_hash[30] < 3 && t <= 40\n @timer_checkpoint_hash[30] += 1\n tab; \"#{@time_remaining} seconds left.\\n\".typing\n elsif @timer_checkpoint_hash[120] == 0 && t.between?(60, 140)\n @timer_checkpoint_hash[120] += 1\n tab; \"Cutting it close, #{codename}\".typing\n elsif @timer_checkpoint_hash[180] == 0 && t.between?(140, 180)\n @timer_checkpoint_hash[180] += 1\n tab; \"3 minutes. Finish the job.\\n\".typing\n elsif @timer_checkpoint_hash[240] == 0 && t.between?(200, 240)\n @timer_checkpoint_hash[240] += 1\n tab; \"Doing good. 4 minutes left.\\n\".typing\n end\n end",
"def schedule_to_close_timeout; Float::INFINITY; end",
"def when_to_run\n time - @@REMINDER_TIME\n end",
"def run!\n process_classic\n\n length.times do\n activity = ACTIVITIES.sample\n\n unless respond_to?(activity, true)\n LLL.error \"activity #{activity} not implemented\"\n next\n end\n\n LLL.info \"trying #{activity}\"\n before_time = Time.now.to_f\n Timeout.timeout(@timeout) do\n send activity\n end\n after_time = Time.now.to_f\n\n @report[activity].add(after_time - before_time)\n end\n end",
"def pm_counter_cron_main_with_team(team_array)\n \n start_time=Time.now\n\n return if team_array.nil? || team_array.size ==0\n \n\nteam_array.each do |team|\n logger=Logger.new(\"pm_counter_#{team}.log\",shift_age = 7, shift_size = 1048576)\n all_counters=pm_counter_get_defined_counter(logger)\n set_logger_level(logger)\n Bts.where(:team=>team).each do |bts|\n result=pm_counter_analysis_one_bts(all_counters,bts.s1_ip,bts.bts_username,bts.bts_password,logger)\n end\n\n Cron.create(:name=>\"PM counter_#{team}\",:scope=>\"#{team}\",:start=>start_time.to_s,:cost=>Time.now - start_time,:succ=>\"#{0}\",:fail=>\"#{0}\")\n ActiveRecord::Base.connection.close\nend\nend",
"def calculate_retry_after(env); end",
"def timeout!; end",
"def wfs_delay\n\t\t30\n\tend",
"def initialize\n super\n @limit = Time.now + 60*60*24*7\n\n @available = []\n @errorz = []\n @recent = []\n run()\n end",
"def execute\n puts \"*********************\"\n Tenant.all.each do |tenant|\n puts tenant.subdomain\n begin\n if PackageConfig::PAY_AS_YOU_GO.eql? tenant.plan_bid.to_s\n tenant_minutes = (tenant.call_minutes.to_i - tenant.credit_minutes.to_i)\n\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - tenant minutes - #{tenant_minutes}\")\n\n if tenant.tenant_notification.nil?\n tenant_notification = TenantNotification.new\n tenant_notification.tenant_id = tenant.id\n tenant_notification.pay_as_you_go = 0\n tenant_notification.save\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - tenant notification created - pay as you go\")\n else\n tenant_notification = tenant.tenant_notification\n tenant_notification.pay_as_you_go = 0\n tenant_notification.save\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - tenant notification updated - pay as you go\")\n end\n\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - not overage_transaction\")\n\n if tenant_minutes > 100\n overage_transaction(tenant, \"call minutes\", :call_minutes, 0)\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - overage_transaction\")\n end\n\n tenant_minutes = (tenant.call_minutes.to_i - tenant.credit_minutes.to_i)\n if (tenant_minutes >= 90 or tenant_minutes >= 350) && !tenant_notification.pay_as_you_go.present?\n ClientMailer.delay.minutes_running_low(tenant)\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - minutes running low - pay as you go\")\n end\n end\n\n if PackageConfig::MINUTE_200.eql? tenant.plan_bid.to_s\n if tenant.tenant_notification.nil?\n tenant_notification = TenantNotification.new\n tenant_notification.tenant_id = tenant.id\n tenant_notification.minutes200 = 0\n tenant_notification.save\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - tenant notification created - 200 minutes\")\n else\n tenant_notification = tenant.tenant_notification\n tenant_notification.minutes200 = 0\n tenant_notification.save\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - tenant notification updated - 200 minutes\")\n end\n\n tenant_minutes = (tenant.call_minutes.to_i - tenant.credit_minutes.to_i)\n if tenant_minutes >= 350 && !tenant_notification.minutes200.present?\n ClientMailer.delay.minutes_running_low(tenant)\n ClientMailer.delay.call_transaction_mailer(tenant,\"execute - minutes running low - 200 minutes\")\n end\n end\n\n #if tenant.menu_minutes > 100\n # overage_menu_minutes(tenant)\n # ClientMailer.delay.call_transaction_mailer(tenant,\"execute - overage_transaction - menu minutes\")\n #end\n #if tenant.mail_minutes > 100\n # overage_mail_minutes(tenant)\n # ClientMailer.delay.call_transaction_mailer(tenant,\"execute - overage_transaction - mail minutes\")\n #end\n rescue => e\n puts \"ERROR: #{e}\"\n end\n\n end\n end",
"def run()\n d1 = LCKTestDriver.startNewShortLivedDriver()\n session1 = d1.createShortLivedSession()\n d1.init(:SESSION => session1, :DISPATCH_FLAGS => \"SA_DISPATCH_ALL\")\n d1.resourceOpen(:SESSION => session1, \n :LOCK_NAME => \"lockExclusiveWithTimerTwice\")\n d1.lockSync(:SESSION => session1, :LOCK_MODE => 'EX', \n :LOCK_FLAG_NO_QUEUE => true, \n :EXPECTED_LOCK_STATUS => 'SA_LCK_LOCK_GRANTED')\n\n d2 = LCKTestDriver.getRandomLongLivedDriver()\n session2 = d2.createShortLivedSession()\n d2.init(:SESSION => session2, :DISPATCH_FLAGS => \"SA_DISPATCH_ALL\")\n d2.resourceOpen(:SESSION => session2, \n :LOCK_NAME => \"lockExclusiveWithTimerTwice\")\n action = d2.lockSyncBG(:SESSION => session2, \n :LOCK_MODE => 'EX', :TIMEOUT => 10000000000,\n :EXPECTED_LOCK_STATUS => 'SA_LCK_LOCK_GRANTED')\n sleep(5)\n d1.stop()\n d2.waitForLockSyncBG(:ACTION => action)\n\n d2.resourceClose(:SESSION => session2)\n d2.finalize(:SESSION => session2)\n d2.deleteSession(:SESSION => session2)\n passed()\n end",
"def heartbeat\n end",
"def do_ramp(last_check)\n if last_check.off?\n # If the status report says the Equipment is offline, try\n # resending the Task. If that doesn't work, fail and punt to the launcher.\n ramp_failure! unless send_to_rhizome\n elsif last_check.temperature >= target_temperature\n # If we reach the target temperature, transition into holding.\n ready!\n end\n end",
"def get_and_perform\n appointment = Appointment.order(:appointed_at).first\n puts \"get and perform: appointment # #{appointment.try(:id)}\"\n puts \"---------- #{Time.now-@start} ----------\"\n return false unless appointment\n puts \"Appointment: #{appointment.appointable.performed_at}\"\n puts \"matchday id: #{appointment.appointable.matchday.number}\"\n puts \"competition: #{appointment.appointable.matchday.competition.name}\"\n perform appointment\n get_and_perform\n end",
"def lead_time\n 4\n end",
"def set_cut_off_time\n if params[:cut_off_time].present?\n #Home.all.each {|r| r.destroy}\n Home.create(:cut_off_time => params[:cut_off_time])\n redirect_to admin_action_by_admin_path, :flash => {:notice => \"Shipment cut off time updated succesfully\"}\n else\n flash.now[:notice] = 'please enter vaild time to procced.'\n end\n end",
"def report\n if data[:ping].nil?\n @fails += 1\n if @fails >= @alert_after\n alarm \"Miner #{@num} did not respond to status query\"\n end\n else\n @fails = 0\n if self[:mhs] < @min_speed*0.95 and upminutes > 5\n alarm \"Miner #{@num} performance is #{self[:mhs]}, should be #{@min_speed}\"\n elsif upminutes < 2\n alarm \"Miner #{@num} restarted\", \"Frog.aiff\"\n end\n end\n end",
"def set_progress\n set_user\n expired_rentals = Rental.where([\n 'user_id = ? AND status = ? AND start_time < ? AND renter_id = ?', \n @user.id, 0, DateTime.current, nil])\n expired_rentals.each do |rental|\n rental.update_column(:status, 4)\n\n car = Car.find(rental.car_id)\n owner_log = Log.create!(\n user_id: rental.user_id, \n action: 4, \n content: 'Canceled renting my '+car.make+' '+car.model+' starting '+helpers.smart_date(rental.start_time, true)+' due to no one renting it before the start time')\n owner_log.touch(time: rental.start_time)\n end\n\n rentals = Rental.where([\n '(renter_id = ? OR user_id = ?) AND ((status = ? AND start_time < ?) OR (status = ? AND end_time < ?))', \n @user.id, @user.id, 1, DateTime.current, 2, DateTime.current])\n rentals.each do |rental|\n if rental.end_time < DateTime.current\n rental.update_column(:status, 3)\n\n car = Car.find(rental.car_id)\n owner_log = Log.create!(\n user_id: rental.user_id, \n action: 3, \n content: 'Completed renting my '+car.make+' '+car.model+' starting '+helpers.smart_date(rental.start_time, true)+' to the renter ('+User.find(rental.renter_id).username+')')\n owner_log.touch(time: rental.end_time)\n renter_log = Log.create!(\n user_id: rental.renter_id, \n action: 3, \n content: 'Completed renting a '+car.make+' '+car.model+' starting '+helpers.smart_date(rental.start_time, true)+' from the owner ('+User.find(rental.user_id).username+')')\n renter_log.touch(time: rental.end_time)\n else\n rental.update_column(:status, 2)\n end\n end\n end"
] |
[
"0.613992",
"0.6030918",
"0.59746933",
"0.58295095",
"0.5822202",
"0.5814416",
"0.57991976",
"0.57255983",
"0.57120204",
"0.57120204",
"0.57120204",
"0.57120204",
"0.5704908",
"0.5699917",
"0.56950307",
"0.5657013",
"0.5657013",
"0.56335866",
"0.56248295",
"0.56248295",
"0.5617701",
"0.5613156",
"0.56063056",
"0.55889326",
"0.55879724",
"0.55805546",
"0.55659753",
"0.55632704",
"0.55571014",
"0.5553034",
"0.5547154",
"0.5535683",
"0.552422",
"0.55239683",
"0.55207515",
"0.55126876",
"0.5499864",
"0.5480014",
"0.5469098",
"0.5463425",
"0.5458874",
"0.54551643",
"0.54544145",
"0.5443569",
"0.5435315",
"0.5429379",
"0.5429379",
"0.5429379",
"0.5416972",
"0.5415038",
"0.5398158",
"0.53899616",
"0.5382761",
"0.53755057",
"0.5372433",
"0.5372033",
"0.5371146",
"0.5371126",
"0.53540194",
"0.5351021",
"0.5343366",
"0.5339978",
"0.53307235",
"0.5328095",
"0.5318954",
"0.53045833",
"0.5303292",
"0.53030145",
"0.5297462",
"0.5297462",
"0.52895355",
"0.5288258",
"0.52830845",
"0.52825326",
"0.5277438",
"0.5274658",
"0.52738744",
"0.527135",
"0.5271334",
"0.52607864",
"0.5257092",
"0.52563447",
"0.5252412",
"0.5246699",
"0.52440506",
"0.52421194",
"0.5233461",
"0.52226615",
"0.5214124",
"0.52124256",
"0.5205235",
"0.51982063",
"0.5196187",
"0.51924944",
"0.51902455",
"0.51856405",
"0.5184905",
"0.5183992",
"0.51830804",
"0.5182795",
"0.51777166"
] |
0.0
|
-1
|
Send the TB patient for a lab order on the 56th/84th/140th/168th day
|
def should_patient_go_lab_examination_at_followup?
first_dispensation = Encounter.joins(:type).where(
'encounter_type.name = ? AND encounter.patient_id = ? AND encounter.program_id = ?',
DISPENSING,
@patient.patient_id,
@program.program_id
).order(encounter_datetime: :asc).first
begin
first_dispensation_date = first_dispensation.encounter_datetime
number_of_days = (Time.current.to_date - first_dispensation_date.to_date).to_i
(number_of_days == 56 || number_of_days == 84 || number_of_days == 140 || number_of_days == 168)
rescue StandardError
false
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def order_budget()\n \n @greeting = \"Hi\"\n\n mail :to => \"docs1006@prodigy.net.mx\", :subject => 'Pragmatic Store Order Confirmation'\n end",
"def send_order order_id\n order_to_send = @current_orders.find {|order| order.id.to_i == order_id.to_i}\n @order_history.push(@current_orders.delete(order_to_send))\n if order_to_send != nil\n send \"Your order is 1 hour away from arriving\"\n puts \"For kitchen: #{order_to_send.adress}\"\n puts \"For driver: #{order_to_send.array}\"\n end\n end",
"def send_submitted_order(order)\n @order = order\n mail :to => 'orders@landingintl.com', :subject => \"Landing International: Order Submitted\"\n end",
"def new_order_placed\n @order = params[:order]\n mail(to: \"pratap.sai99@gmail.com\", subject: \"New Order Placed\")\n end",
"def trial_early(company_phone)\n @company_phone = company_phone\n @company = @company_phone.company\n @trial_discount = ENV['TRIAL_EARLY_BUY_DISCOUNT']\n @pay_url = \"#{@landing_url}/pago?api_key=#{@company.api_key}\"\n @discount_limit =\n @company.trial_ends_at.localtime.strftime('%d/%m/%Y a las %H:%M')\n mail(\n to: @company_phone.extensions.admin.first.email,\n subject: 'GurúComm | Nos da gusto saber que estás usando GurúComm'\n )\n end",
"def order_received(order)\n@order=order\nmail(:to => order.email, :subject => 'Pragmatic Toy Shop Order Confirmation')\nend",
"def order_received(order)\n@order = order\nmail :to => order.email, :subject => 'Sedin Online Store Order Confirmation'\nend",
"def send_order_email\n\t mail( :to => 'ashley@asiancomco.com',\n\t :subject => 'Order' )\n\t end",
"def send phone_number\n account = CLIENT.account \n message = account.sms.messages.create({from: TAKEAWAY_NUMBER , to: phone_number, body: \"Thanks for your order! It shall arrive no later than #{@delivery_time.strftime(\"%H\")}:#{@delivery_time.strftime(\"%M\")}.\"})\n message.body\n end",
"def thank_you\n # debugger\n @order_date = DateTime.now\n @shipping = 20000\n @total = order_subtotal + @shipping\n order = {\n \"total\" => @total,\n \"shipping\" => @shipping,\n \"items\" => session[:purchase]\n }\n # debugger\n OrderMailer.order_confirmation(session[:address], order).deliver_now\n end",
"def send_cart\n case params[:override_delay]\n when '1'\n delay_in_hrs = 0\n when '2'\n delay_in_hrs = 0\n send_on_complete = true\n else\n delay_in_hrs = JobSet.delay_in_hrs;\n end\n send_on_complete ||= false\n\n if params[:autosend] and !@patient.autosend\n @patient.autosend = true\n @patient.save\n elsif params[:autosend].nil? and @patient.autosend\n @patient.autosend = false\n @patient.save\n end\n\n @job_set = JobSet.new({\n :patient_id => @patient.id,\n :user_id => @user.id,\n :email_address => params[:email],\n :phone_number => params[:phone],\n :modified_date => Time.now,\n :delay_in_hrs => delay_in_hrs,\n :send_on_complete => send_on_complete,\n :use_rsna_id => (params[:new_email] == \"true\" ? false : true),\n :send_to_site => (not params[:send_to_site].blank?)\n })\n if @job_set.save\n @cart.each do |exam_id|\n time = Time.now\n job = Job.create(:exam_id => exam_id, :job_set_id => @job_set.id, :modified_date => time)\n JobTransaction.create(:job_id => job.id, :status_code => 1, :comments => \"Queued\", :modified_date => time)\n end\n cart_op {|cart| [] }\n flash[:notice] = \"Exams queued and patient information printed\"\n render :partial => \"exams/token_info\"\n else\n render :text => \"An error occured while saving your cart information\"\n end\n end",
"def final_price(order)\n @greeting = \"Hi\"\n @order = order;\n\n mail to: order.email\n end",
"def recevied(order)\n @order = order\n\n mail to: \"tariq.sulehir@khaleef.com\", subject: \"Rails Store Order Conformation..\"\n end",
"def notify_order(order)\n @order = order\n to = ADMIN_EMAIL\n\n mail :to => email_to(to), :subject => \"Pocket Prints Order ##{order.order_code}\"\n end",
"def send_ethos_mail\n TeaTimeMailer.delay(run_at: Time.now + 1.hour).ethos(self.user_id)\n end",
"def shipped(order)\n @order = order\n mail to: order.email, subject: 'Заказ из Card Shop отправлен'\nend",
"def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Fast Find Auto Parts Order Shipped'\n end",
"def shipped (order)\n @order=order\n\n mail to: order.email, subject: \"You are receiveing the first Mail from Depot App\"\n end",
"def shipped(order)\n @order = order\n mail to: order.mail, subject: 'Заказ из GlebKs stall отправлен'\n end",
"def appointment_pending(appoint_obj)\n @doctor = Doctor.find_by_id(appoint_obj.doctor_id)\n @patient = Patient.find_by_id(appoint_obj.patient_id)\n mail(:to => @doctor.email, :subject => \"New Appointment\")\n end",
"def send_success_report\n return if @success_orders.blank?\n success_orders = ['Order, SKU, Tracking, ParcelId, Quantity, Date, Country'] + @success_orders\n Spree::InnotracMailer.csv(success_orders.join(\"\\n\"), 'innotrac', \"Sand & Sky : INNOTRAC Shipments Report(#{Time.now.strftime('%d/%m/%Y')})\").deliver\n end",
"def order_received(order)\n @order = order\n\n mail :to => \"sandra_sovane@inbox.lv\", :subject => 'Pragmatic Store Order Confirmation'\n end",
"def new_order_notice(enquiry)\n @enquiry = enquiry\n @customer = @enquiry.customer\n mail(subject: \"[team] New Order #{@enquiry.id}\")\n end",
"def send_failure_report\n return if @failed_orders.blank?\n failed_orders = ['Order, Tracking, ParcelId, Quantity, Date, Error_Message, Country'] + @failed_orders\n Spree::InnotracMailer.csv(failed_orders.join(\"\\n\"), 'innotrac', \"Sand & Sky : INNOTRAC Failed Shipments Report(#{Time.now.strftime('%d/%m/%Y')})\").deliver\n end",
"def order_send(order)\n @greeting = \"Hi\"\np 1111111111\np order\n @orde_email = order.email\n\n mail(:to => order.email, :subject => \"Your Order\")\n end",
"def fetch_qoo10_delivered_orders(smp)\n @message = []\n @all_cart_numbers = []\n fba_complete_states = ['complete', 'customer_complete', 'self_collect_complete', 'collect_complete', 'return_complete']\n market_place = smp.market_place\n #qoo10_statuses = {\"5\"=>\"Delivered\", \"4\"=>\"On delivery\"}\n qoo10_statuses = {\"5\"=>\"Delivered\"}\n for j in 1..10\n begin\n s_date = j.day.ago.strftime(\"%Y%m%d\")\n e_date = (j-1).day.ago.strftime(\"%Y%m%d\")\n qoo10_statuses.keys.each do |k|\n uri = URI(market_place.domain_url+'/ShippingBasicService.api/GetShippingInfo')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=>smp.api_secret_key,'ShippingStat'=>k,'search_Sdate'=>s_date,'search_Edate'=>e_date})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|http.request(req)end\n if res.code == \"200\"\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=>true)\n begin\n if res_body[:ShippingAPIService][:ResultMsg] == \"Success\"\n for i in 1..res_body[:ShippingAPIService][:TotalOrder].to_i\n order = res_body[:ShippingAPIService][(\"Order\"+i.to_s).to_sym]\n # find out the order\n @order = nil\n @order = Spree::Order.where(\"market_place_order_no=? AND seller_id=?\", order[:orderNo], smp.seller_id).try(:first)\n # check order present or not and order should not be cancelled already\n if @order.present? && !@order.is_cancel?\n # code to delivered the order\n if @order.update_attributes!(:market_place_order_status => \"Delivered\")\n @all_cart_numbers << @order.cart_no if @order.market_place_order_status == \"Delivered\" && (!fba_complete_states.include?@order.fulflmnt_state)\n else\n @message << \"Order not found!\"\n end # End of success status change in SF if\n end # End if order nil\n end # End of for loop\n end # End of success if\n @all_cart_numbers = @all_cart_numbers.uniq\n #Call to FBA to change status\n Spree::Order.update_fba_state(@all_cart_numbers.uniq, smp, \"Completed\") if @all_cart_numbers.present?\n rescue Exception => e\n @message << e.message\n end\n else\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=> true)\n @message << res_body[:ShippingAPIService][:ResultMsg]\n end\n end # End of status do\n rescue Exception => e\n @message << e.message\n end\n end # End for loop for day\n return @message.join(\"; \")\n end",
"def shipped(order)\n @order = order\n\n mail to: order.email, subject: '8 facts you will never believe! Doctors hate it!'\n end",
"def shipped(order)\n @greeting = \"Hi\"\n @order = order\n\n mail to: \"colin.lin@newbiiz.com\", subject: \"Success! You shipped it.\"\n end",
"def order_shipped(order)\n @order = order\n mail :to => User.find_by_id(@order.user_id).email, :subject => \"来自Time international GmbH的包裹发送信息\"\n end",
"def downloaded(order)\n @order = order\n to = @order.email\n\n mail :to => email_to(to), :subject => \"Your Pocket Prints Order ##{order.order_code} is being processed\"\n end",
"def received(order)\n @order = order\n mail to: order.email, subject: 'Подтверждение заказа в Card Shop'\nend",
"def received(order)\n @greeting = \"Hi\"\n @order = order\n\n mail to: \"colin.lin@newbiiz.com\", subject: \"Success! Pragmatic Store Order Confirmation.\"\n # mail to: \"mclxly@gmail.com\", subject: \"Success! Pragmatic Store Order Confirmation.\"\n # mail to: \"legoo8@qq.com\", subject: \"Success! Pragmatic Store Order Confirmation.\"\n end",
"def coming_order\n NameCardOrderMailer.coming_order\n end",
"def pay(keygap, bnf, amount, details)\n start = Time.now\n job = job_of(\n clean(\n Typhoeus::Request.post(\n 'https://wts.zold.io/do-pay',\n headers: headers,\n body: { keygap: keygap, bnf: bnf, amount: amount, details: details }\n )\n )\n )\n @log.debug(\"PAY job #{job} started in #{Zold::Age.new(start)}\")\n job\n end",
"def send_success_report\n return if @success_orders.blank?\n success_orders = ['Order, SKU, Tracking, ParcelId, Quantity, Date, Country'] + @success_orders\n Spree::AsendiaMailer.csv(success_orders.join(\"\\n\"), 'asendia', \"Sand & Sky : ASENDIA Shipments Report(#{Time.now.strftime('%d/%m/%Y')})\").deliver\n end",
"def send_sms_to_fundaraiser(don_name_param,don_amt_param, fundraiser_phone_no)\n msg = \"Donation of Rs. \" + don_amt_param + \" from \" + don_name_param +\" has been added to Donut. Thank you.\"\n self.send_sms(fundraiser_phone_no, msg)\n end",
"def send_quote(operator, trip)\n @trip = trip\n @operator = operator\n @emails = Organisation.get_all_emails(trip.organisation)\n mail(\n to: @emails,\n subject: 'JetSetGo - quote created'\n )\n end",
"def send_pay_msg\n values = []\n \n fee = [0, (self.total_fee - self.discount_fee)].max\n values << { keyword1: \"#{fee}元\" }\n values << { keyword2: self.product.title }\n values << { keyword3: self.shipment_info.try(:region) + self.shipment_info.try(:address)}\n values << { keyword4: self.order_no }\n \n PushMessageJob.perform_later(self.user.id, SiteConfig.order_paid_msg_tpl, order_detail_url, { first: '您的订单支付成功,我们会尽快为您发货。', remark: '如有问题请直接在微信留言,我们会第一时间为您服务!', values: values })\n \n # 新建一条采购统计,不考虑创建失败,如果失败,还可以后台人为添加\n OrderProduct.create(order_id: self.id)\n end",
"def post_shipment_notifier(shipment)\n @shipment = shipment\n subject = \"WARNING: No InstaTrace Shipments Posted in 24 hours\" \n mail(:to => EMAIL_NOTIFY_POST_SHIPMENT_API, :subject => subject) if shipment.hawb && shipment.created_at\n end",
"def order_cancelled\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def shipped(order)\n @order = order\n @greeting = \"Hello from rails4book\"\n\n mail to: order.email, subject: 'rails4book order shipped'\n end",
"def new_order(order)\n @greeting = \"Hi\"\n @order = order;\n\n mail to: order.email\n end",
"def send_eighty_g_reciept_notification(donation)\n begin\n # send mail for 80g reciept\n donour = Donour.find(donation.donour_id)\n product = CfrProduct.where(:id => donation.product_id, :is_other_product => 1)\n product_or_event_name = ''\n if product.present?\n product_or_event_name = product.name.to_s\n else\n product_or_event_name = 'General Donation'\n end\n\n if donour.present?\n donour_name = donour.first_name\n if donour.last_name.present?\n donour_name += ' ' + donour.last_name\n end\n if donour.email_id.present?\n begin\n session[:donor_name] = donour_name\n session[:donation_amount] = donation.donation_amount.to_s\n session[:don_id] = donation.id.to_s\n session[:donor_address] = donour.address.to_s\n session[:created_at] = donation.created_at.day.to_s + \"/\" + donation.created_at.mon.to_s + \"/\" + donation.created_at.year.to_s\n \n number = donation.donation_amount.to_s\n amt_parts = number.to_s.split(\".\")\n dec_result = amt_parts.count > 1 ? amt_parts[1].to_s : 0\n \n amt_rupees_text = \"#{wordify number.to_i}\"\n amt_paise_text = nil\n \n begin\n if dec_result.to_i > 0\n amt_paise_text = \"#{wordify dec_result.to_i}\" + ' paise'\n end\n rescue\n amt_paise_text = nil\n end\n if amt_paise_text.nil?\n session[:donation_amount_text] = amt_rupees_text + ' rupees'\n else\n session[:donation_amount_text] = amt_rupees_text + ' rupees and ' + amt_paise_text\n end\n \n pdf_80g_reciept = WickedPdf.new.pdf_from_string(\n render_to_string('pdf_templates/don_receipt_80g.pdf.erb')\n )\n email_text = confirmation_mail_template_with_eighty_g(donour_name, donour.email_id,\n donation.donation_amount.to_s, \n donation.id.to_s, \n product_or_event_name)\n puts \"Emails \" + donour.email_id\n send_mails_with_attachment(donour.email_id, 'Donation Confirmation', email_text, pdf_80g_reciept, 'DonationReciept.pdf')\n session[:donor_name], session[:donation_amount], session[:don_id], session[:donation_amount_text], session[:donor_address] = ''\n \n rescue Exception => e\n logger.warn \"Unable to send mail: #{e}\" \n end\n end \n end\n rescue Exception => ex\n logger.warn \"Unable to send notification: #{ex}\" \n end \n end",
"def send_receive_sample order_mail\n @order = order_mail.order\n client = @order.client\n subject = \"#{t('order_mails.type.receive_sample')} #{t('activerecord.attributes.order.sn')}: #{@order.sn}\"\n mail to: to, subject: subject\n end",
"def order_recieved(order)\n @order = order\n\n mail to: order.email, subject: \"Pragmatic Store Order Confirmation\"\n end",
"def shipped(order)\n @order = order\n \n mail :to => order.email, :subject => 'Montagna Verde Order Shipped'\n end",
"def order_received(order)\n @order = order\n mail:to => order.email, :subject => 'pragmetic store order confirmation'\n end",
"def shipped(order)\n @order = order\n mail to: order.email, subject: 'PMAC Store Order Shipped'\n end",
"def order_received(order)\n @order = order\n\n mail :subject => \"order received!\"\n end",
"def shipped(order)\n @order=order\n mail(\n to: order.email,\n subject: 'BookShelf Order Shipped',\n from: \"BookShelf\",\n return_path: \"morozhunce@gmail.com\",\n date: Time.now,\n template_path: 'order_notifier',\n template_name: 'shipped'\n )\n end",
"def shipped(order)\r\n @order = order\r\n mail to: order.email, subject: 'Заказ из Pragmatic Store отправлен'\r\n end",
"def received(order)\n @order = order\n mail to: order.email, subject: 'Подтверждение заказа в GlebKs stall'\n end",
"def shipped\n @greeting = \"Hi\"\n @order = order\n mail(to: order.email, subject: 'Your Chocolate Bar order was received')\n end",
"def call_order\n NewsletterMailer.call_order\n end",
"def shipped(order)\n @order = order\n\n mail to: order.e_mail, subject: 'Eloctronic Shop Order Shipped'\n end",
"def order_shipped\n @order = order\n\n mail :to => \"sandra_sovane@inbox.lv\", :subject => 'Pragmatic Store Order Shipped'\n end",
"def date_of_booking(service)\n notification = Notification.find_by_name(\"Overdue service\")\n vehicle = service.fleet\n setting = vehicle.truck_fleet.setting.email_notifications.find_by_notification_id(notification.id)\n emails = self.find_emails(vehicle, setting)\n if emails.present?\n mail :to => emails,\n :subject => \"Date of booking. For #{vehicle.fleet_number}\"\n end\n end",
"def cancel_order_fetch_qoo10(smp)\n @message = []\n market_place = Spree::MarketPlace.find(smp.market_place_id)\n #qoo10_claim_statuses = {\"1\"=>\"Cancel Request\", \"2\"=>\"Cancelling\", \"3\"=>\"Cancel Completed\", \"4\"=>\"Return Request\", \"5\"=>\"Returning\", \"6\"=>\"Return completed\"}\n #qoo10_claim_statuses.keys.each do |k|\n uri = URI(market_place.domain_url+'/ShippingBasicService.api/GetClaimInfo')\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data({'key'=> smp.api_secret_key, 'ClaimStat'=> '3', 'search_Sdate'=> '', 'search_Edate'=>''})\n res = Net::HTTP.start(uri.hostname, uri.port) do |http|http.request(req)end\n if res.code == \"200\"\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=> true)\n begin\n if res_body[:ShippingAPIService][:ResultMsg] == \"Success\"\n for i in 1..res_body[:ShippingAPIService][:TotalOrder].to_i\n order = res_body[:ShippingAPIService][(\"Order\"+i.to_s).to_sym]\n # find out the order\n @order = nil\n @order = Spree::Order.where(\"market_place_order_no=? AND seller_id=?\", order[:orderNo], smp.seller_id).try(:first)\n # check order present or not and order should not be cancelled already\n if @order.present? && !@order.is_cancel?\n # code to cancel the order\n if @order.update_attributes(:is_cancel=> true)\n cm_user = !@order.is_bypass rescue true\n if cm_user\n seller_id = @order.seller_id\n market_place_id = @order.market_place_id.present? ? @order.market_place_id : nil\n product_id = @order.products.present? ? @order.products.first.id : nil\n seller_market_place_product = Spree::SellersMarketPlacesProduct.where(\"seller_id=? AND market_place_id=? AND product_id=?\", seller_id, market_place_id, product_id)\n if seller_market_place_product.present?\n # code to add the stock after cancelling the order\n # if @order.line_items.present?\n # @order.line_items.each do |line_item|\n # stock = seller_market_place_product.first.product.stock_products.where(\"variant_id=? AND sellers_market_places_product_id=?\", line_item.variant.id, seller_market_place_product.first.id).first\n # stock.variant.update_attributes(:fba_quantity=>stock.variant.fba_quantity + line_item.quantity) if stock && !stock.variant.quantity_inflations.present?\n # stock.update_attributes(:count_on_hand=>stock.count_on_hand + line_item.quantity) if stock\n # end\n # end\n @order.update_attributes!(:market_place_order_status => \"cancel\", :order_canceled_date=>order[:cancelRefundDate])\n # call api in FBA to cancel the order\n #@order.cancel_order_on_fba(smp)\n @message << @order.market_place_order_no.to_s+\": \"+ \"Success\"\n end # End if seller_product\n else\n @order.update_attributes!(:market_place_order_status => \"cancel\", :order_canceled_date=>order[:cancelRefundDate])\n @order.mp_order_line_items.update_all(:is_cancel=>true)\n end\n else\n @order.update_attributes(:is_cancel=> false, :order_canceled_date=>nil)\n @message << @order.market_place_order_no.to_s+\": \"+ \"Failure\"\n end # End if update order\n else\n @message << \"Order not found!\"\n end # End if order nil\n end # End of for loop\n end # End of if\n # Order cancelation on FBA\n order_cancelation_on_fba(smp)\n rescue Exception => e\n @message << e.message\n end\n else\n res_body = Hash.from_xml(res.body).to_json\n res_body = JSON.parse(res_body, :symbolize_names=> true)\n @message << res_body[:ShippingAPIService][:ResultMsg]\n end\n #end # End of do\n return @message.join(\"; \")\n end",
"def order_shipped(order)\n @order = order\n\n mail :subject => \"order shipped!\"\n end",
"def send_failure_report\n return if @failed_orders.blank?\n failed_orders = ['Order, Tracking, ParcelId, Quantity, Date, Error_Message, Country'] + @failed_orders\n Spree::AsendiaMailer.csv(failed_orders.join(\"\\n\"), 'asendia', \"Sand & Sky : ASENDIA Failed Shipments Report(#{Time.now.strftime('%d/%m/%Y')})\").deliver\n end",
"def order_created(order)\n @order = order\n mail :to => User.find_by_id(@order.user_id).email, :subject => \"来自Time international GmbH的购物确认信件\"\n end",
"def shipped(order)\n @order = order\n mail to: \"sushicat16@yandex.ru\"\n end",
"def new_order(order)\n @order = order\n\n mail(\n to: order.user.email,\n subject: 'Fry Farms Coop Order Received'\n )\n end",
"def create\n @user_order = UserOrder.new(user_order_params)\n respond_to do |format|\n if @user_order.save\n format.html { redirect_to @user_order, notice: 'User order was successfully created.' }\n format.json { render :show, status: :created, location: @user_order }\n else\n format.html { render :new }\n format.json { render json: @user_order.errors, status: :unprocessable_entity }\n end\n end\n\n # check new order total and notify host via SMS if order minimum has been met\n current_order_total = 0.0\n UserOrder.where(OrderID: @user_order.OrderID).each do |uo|\n current_order_total = current_order_total + uo.Total\n end\n\n host_order = Order.find(@user_order.OrderID)\n if current_order_total >= host_order.reqd_total.to_f\n account_sid = 'ACd8e80d698128ba7ac744054f5ccdc705' #trial credentials\n auth_token = '4b34a2a4f74ced7d1214bcf53efae432' #trial credentials\n client = Twilio::REST::Client.new account_sid, auth_token\n\n host_cell_number = User.where(Email: host_order.primaryUser).first.phone\n sms = client.account.messages.create({\n :body => \"Hello from Order2gether! Your order total has been fulfilled. Go to My Orders to review and place your order.\",\n :to => \"#{host_cell_number}\",\n :from => \"+17605762473\" #trial credentials\n })\n end\n end",
"def shipped(order)\n @order = order\n\n mail to: order.email, subject: 'Envío de compra Farmacia Zi'\n end",
"def trial_warning(company_phone)\n @company_phone = company_phone\n @company = @company_phone.company\n @pay_url = \"#{@landing_url}/pago?api_key=#{@company.api_key}\"\n mail(\n to: @company_phone.extensions.admin.first.email,\n subject: 'GurúComm | Te queda un día de tu periodo de prueba'\n )\n end",
"def do_pay\n self.paid_at = Time.now.utc\n self.send_paid\n end",
"def received(order)\n @order = order\n\n mail to: order.email, subject: 'Fast Find Auto Parts Order Confirmation'\n end",
"def shipped(order)\n @order = order \n\n mail to: order.email, subject: 'justEat Order Shipped'\n end",
"def shipped(order)\n @order = order\n\n # defaults to using html template\n mail to: order.email, subject: \"O'Trendy Store Order Shipped\"\n end",
"def buyer_invoices\n logger.info(\"Will send email of BUYER JDE and ZLot csvs\")\n email = current_employee.present? ? current_employee.email : \"salesreports@outbid.com\"\n logger.info(\"Will send email to \\\"#{email}\\\"\")\n Vehicle.queue_buyer_invoice_email(email)\n \n respond_to do |format|\n format.json { render json: { message: \"success\" } }\n format.html { redirect_to vehicles_url(:state_as_string => \"wtg_for_settlement_confirmation\") }\n end\n end",
"def received(order)\n @order = order\n\n mail to: order.email, subject: '7 facts you will never believe! 3 will shock you'\n end",
"def trial_ended(company_phone)\n attachments.inline['consult.png'] = email_cdn_file('/img/consult.png')\n @company_phone = company_phone\n @company = @company_phone.company\n @pay_url = \"#{@landing_url}/pago?api_key=#{@company.api_key}\"\n mail(\n to: @company_phone.extensions.admin.first.email,\n subject: 'GurúComm | Tu periodo de prueba ha finalizado'\n )\n end",
"def shipped(order)\n @order = order\n\n mail to: order.email,subject: \"Pragmatic Store Order Shipped\"\n end",
"def received(order)\n @order=order\n mail(to: order.email, subject: 'BookShelf Order Confirmation') do |format|\n format.html\n end\n end",
"def send_service_email(checkout, order_items)\n @checkout = checkout\n @associate = @checkout.associate\n @order_items = order_items\n @email = Email.find(1)\n mail(:to => @associate.email, :subject => \"Customer Accessories Request [ \" + @checkout.customer_name + \" ]\",\n\n :cc => [@email.address])\n end",
"def send_email(cab_request,pick_up_date,pick_up_time,requester,admin_emails,vendor_email)\n mail(reply_to:[requester,admin_emails,vendor_email], cc: [admin_emails,vendor_email,requester] , subject: \"[Cab Request]\", body:\n\n \"Name :\\t\" + cab_request.traveler_name+\n\n \"\\nContact_no :\\t\" + cab_request.contact_no+\n\n \"\\nFrom :\\t\" + cab_request.source+\n\n \"\\nTo :\\t\" + cab_request.destination+\n\n \"\\nOn :\\t\" + pick_up_date+\n\n \"\\nAt :\\t\" + pick_up_time+\n\n \"\\nVehicle Type :\\t\" + cab_request.vehicle_type+\n\n \"\\nOther Travellers :\\t\" + cab_request.other_travellers+\n\n \"\\nComments :\\t\" + cab_request.comments+\n\n \"\\nStatus :\\t\" + cab_request.status)\n\n end",
"def send_text\n @number_list.each do |number|\n # clock = Alarm.new(2014, 07, 17, 11, 38, 40)\n puts Time.now\n account_sid = 'ACe330ba04d082392df4cb3511dcb72cec'\n auth_token = '2008ea097713e401a16c54029058da82'\n @client = Twilio::REST::Client.new account_sid, auth_token\n # until Time.now > clock.time\n # puts \"It's not time!\"\n # sleep (5)\n # end\n @client.account.messages.create(\n :from => '+18152642023',\n :to => number,\n :body => @body\n )\n end\n end",
"def b_rdt_send message\n puts 'B Sending Data Unreliably...'\n packet = Packet.new\n packet.payload = message.data\n b_udt_send packet\nend",
"def label\n @order = params[:order]\n @shipping = params[:shipping]\n mail(to: @order.email, subject: \"🛠Thank you for the order \" + @order.order_no.to_s + \" \"+ @order.product.model_no + \" this is your shipping label\").attachments[@shipping + \".pdf\"] = File.read('public/uploads/labels/'+ @shipping +'.pdf')\n end",
"def fulfillment_new_invoice(invoice) \n @invoice = invoice\n sc = invoice.site.store_config\n mail(:to => sc.fulfillment_email, :subject => 'New Order')\n end",
"def shipped(order)\n @order = order\n\n puts \">> shipped order email sent\"\n\n mail to: @admin_email, subject: 'Pragmatic Store Order Shipped'\n end",
"def your_parking(correo, numspace, floorspace)\n @numspace = numspace\n @floorspace = floorspace\n mail(to: correo, subject: 'Your car parking')\n end",
"def insert_hwb\n type = OrderType.find_by_name(\"hwb\")\n \n res = RResponse.new\n\n Order.transaction do\n begin\n data = params[\"order\"]\n\n # hack created by for now\n data[\"created_by\"] = current_user.account\n data[\"order_type_id\"] = type.id\n \n \n data[\"bill_number\"] = (params[\"is_quote\"] == 'false') ? type.generate_bill_number(self.get_config_param(:hwb_offset)) : nil\n \n data[\"dim_factor\"] = 194\n \n if (params[\"multiple_pickup\"] != nil && params[\"multiple_pickup\"] == \"on\") \n data[\"pickup_locations\"] = JSON::parse(params[\"locations\"])\n end\n \n # read bill_to bill_third_party checkbox: if on, bill third-party. otherwise, bill shipper.\n if (params[\"bill_third_party\"].nil? || params[\"bill_third_party\"] != 'on')\n data[\"bill_to_id\"] = params[\"shipper\"][\"company_id\"]\n end\n \n ##############################################################################################\n # HACK order[billing_method_id] -- might need this in order since it's defined company-wide\n ##############################################################################################\n data[\"billing_method_id\"] = 1\n ##############################################################################################\n \n # super can handle it from here...\n order = Order.create(data)\n\n # get OrderTypeEntity list\n entities = order.type.entities(:include => [:domain])\n entities.each do |e|\n if (e.name != 'consignee' || (e.name == 'consignee' && params[\"has_consignee\"] != nil && params[\"has_consignee\"] == 'on') )\n data = params[e.name]\n data[:order_id] = order.id\n data[:order_type_entity_id] = e.id\n oe = OrderEntity.create(data)\n end\n end\n \n # apply markup & fuel_surcharge from order's bill_to to the order.\n types = SystemRevenuType.find(:all)\n revenus = SystemRevenu.find(:all)\n revenus.each do |sr|\n \n field = order.bill_to.domain.fields.find_by_name(sr.name) \n raise RException.new(\"Create HWB -- Could not locate company's revenu-field '#{sr.name}'\") if field.nil?\n \n # first get default value \n value = field.config[:value] \n \n # if the bill_to company has this Revenu field explicitly defined, apply that instead.\n if (!order.bill_to.domain_values.nil? && !order.bill_to.domain_values[field.id].nil?)\n value = order.bill_to.domain_values[field.id] \n end \n \n # apply insurance only if declared_value was defined\n if (sr.name != 'insurance' || !order.declared_value.nil?)\n # apply multiplier type to insurance only -- all other revenus (markup, fuel-surcharge) get percentage\n type = (sr.name != 'insurance') ? types.find { |t| (t.name == 'percentage') ? true : false} : types.find { |t| (t.name == 'multiplier') ? true : false} \n OrderRevenu.create(\n :order_id => order.id,\n :system_revenu_id => sr.id,\n :system_revenu_type_id => type.id,\n :value => value,\n :config => field.config #<-- this column contains Ext.form.Field config\n ) \n end \n end\n # log order-creation\n OrderLog.create(\n :order_id => order.id,\n :account_id => current_user.account.id,\n :order_log_type_id => OrderLogType.find_by_name('status').id,\n :subject => 'Order created',\n :msg => 'New ' + type.name\n )\n res.data[:order] = {\n :id => order.id,\n :bill_number => order.bill_number\n }\n res.success = true\n res.msg = 'Created order #' + order.bill_number.to_s\n end \n end\n\n respond(res)\n end",
"def order_cancellation\n\t\torder = Order.first\n\t\tOrderMailer.order_cancellation(order)\n end",
"def order_shipped(order)\n \t@order = order\n mail to: order.email, subject: 'Pragmatic Store Order Shipped'\n end",
"def new_caitredette_service_notice(req)\n @req = req\n mail(subject: \"[team] New Caitredette Service Request Received\")\n end",
"def in_process\n to = params[:patron_email] + ', ' + params[:staff_email]\n from = \"Request Services <#{params[:staff_email]}>\"\n title = params[:bib_record].title\n subject = \"On Order / In Process Request [#{title}]\"\n mail(to: to, from: from, subject: subject)\n end",
"def holdtag_email(tbl_quality_issue)\n @tbl_quality_issue = tbl_quality_issue\n\n mlist1test = [ \n 'dgleba@stackpole.com',\n ]\n \n mlist1 = [ \n 'dgleba@stackpole.com',\n ]\n\n # mail(to: mlist1test , subject: 'CSD1-Sinter Shift Report Record Submitted')\n mail(to: mlist1test , subject: 'test holdtag mailer 06ht1')\n end",
"def produkt_bestilling(order)\n @fornavn = order.company_detail.first_name\n @etternavn = order.company_detail.last_name\n @fullt_navn = \"#{order.company_detail.first_name} #{order.company_detail.last_name}\"\n @epost = order.company_detail.email\n @produkt = order.product.name\n @pris = order.total\n\n\n mail(to: @epost, subject: 'Ordrebekreftelse - Logo Maker\\'n')\n end",
"def paid(order)\n @order = order\n\n mail :to => order.billing_address.email\n end",
"def paid_request_to_tenant(reservation)\n @reservation = reservation\n @tenant = @reservation.user\n @cookoon = @reservation.cookoon\n @host = @cookoon.user\n mail(to: @tenant.full_email, subject: 'Vous avez demandé un Cookoon !')\n end",
"def send_reminder\n @reminder = Reminder.find(params[:id])\n @order = @reminder.order\n \n @reminder.send_email(params)\n \n flash[:notice] = \"Your email was successfully sent at #{current_time}\"\n redirect_to :action => :reminders, :id => @order\n end",
"def due_service(service)\n notification = Notification.find_by_name(\"Due service\")\n vehicle = service.fleet\n setting = vehicle.truck_fleet.setting.email_notifications.find_by_notification_id(notification.id)\n emails = self.find_emails(user, vehicle, setting)\n \n if emails.present?\n mail :to => emails,\n :subject => \"Service due. For #{vehicle.fleet_number}\"\n end\n end",
"def recieved (order)\n @order=order\n\n mail to: order.email, subject: \"You are receiveing the first Mail from Depot App\"\n end",
"def order_received\n @greeting = \"Hi\"\n\n mail to: \"to@example.org\"\n end",
"def cancelled_email(user, trip)\n @trip=Trip.find_by(:id => trip)\n @user = User.find_by(:id => user)\n @fbo= Fbo.find_by(:id => @trip.fbo_id)\n @airport = Airport.find_by(:id => @fbo.airport_id)\n @url = 'http://chartair.us/trips'\n mail(to: @user.email, subject: 'Trip Cancellation')\n end",
"def bs_order(o)\n tkr = o[:tkr]\n half_at_2R = o[:half_at_2R]\n return if not active_ticker?(tkr)\n #orders[tkr] |= {}\n size = (o[:pos_risk].to_f / (o[:stop_px].to_f-o[:stop_ex].to_f)).to_i\n return if invalid_size?(size)\n debug \"stage order to buy #{size} #{o[:tkr]} @#{o[:stop_px]}, risking #{o[:pos_risk]}\"\n unless o[:stop_px].to_f > 0\n warn \"must input valid entry stop price!\"\n return\n end\n stop_price = (o[:stop_px].to_f).round(2)\n stop_loss = (o[:stop_ex].to_f).round(2)\n limit_price = ((stop_price > 10) ? stop_price+0.38 : stop_price+0.12).round(2)\n #limit_price = 0\n profit_price = o[:tgt_price].to_f.round(2) || (o[:pos_risk].to_f * 4 / size + stop_price).round(2)\n\n debug \"stop_price = #{stop_price}\"\n debug \"stop_loss = #{stop_loss}\"\n debug \"limit_price = #{limit_price}\"\n debug \"profit_price = #{profit_price}\"\n\n #-- Parent Order --\n #buy_limit(tkr,size,limit_price)\n debug \"send parent order\"\n debug \"IB::Order.new :total_quantity => #{size},\"\n debug \" :limit_price => #{limit_price},\"\n debug \" :aux_price => #{stop_price},\"\n debug \" :action => 'BUY',\"\n debug \" :order_type => 'STP',\"\n debug \" :algo_strategy => '',\"\n debug \" #:account => account_code,\"\n debug \" :transmit => true\"\n buy_order = IB::Order.new :total_quantity => size,\n :limit_price => limit_price,\n :aux_price => stop_price,\n :action => 'BUY',\n :tif => 'GTC',\n :order_type => 'STPLMT',\n :algo_strategy => '',\n #:account => account_code,\n :transmit => true\n #ib.wait_for :NextValidId\n place_order buy_order, @contracts[tkr]\n \n #-- Child STOP --\n puts \"send stop order\"\n debug \"IB::Order.new :total_quantity => #{size},\"\n debug \" :limit_price => 0,\"\n debug \" :aux_price => #{stop_loss},\"\n debug \" :action => 'SELL',\"\n debug \" :order_type => 'STP',\"\n #puts \" :account => account_code,\"\n debug \" :parent_id => #{buy_order.local_id},\"\n debug \" :transmit => true\"\n stop_order = IB::Order.new :total_quantity => size,\n :limit_price => 0,\n :aux_price => stop_loss,\n :action => 'SELL',\n :tif => 'GTC',\n :order_type => 'STP',\n #:account => account_code,\n :parent_id => buy_order.local_id,\n :transmit => true\n ib.wait_for :NextValidId\n place_order stop_order, @contracts[tkr]\n \n #-- BreakEven LMT\n tgt_1 = (stop_price + 2*(stop_price - stop_loss)).round(2)\n size_1 = (size/2).round(0)\n size_2 = size - size_1\n if half_at_2R && profit_price > tgt_1\n size = size_2\n debug \"breakeven_order = IB::Order.new :total_quantity => #{size_1},\"\n debug \" :limit_price => #{tgt_1},\"\n debug \" :action => 'SELL',\"\n debug \" :tif => 'GTC',\"\n debug \" :order_type => 'LMT',\"\n #debug \" :parent_id => #{buy_order.local_id},\"\n debug \" :transmit => true\"\n \n breakeven_order = IB::Order.new :total_quantity => size_1,\n :limit_price => tgt_1,\n :action => 'SELL',\n :tif => 'GTC',\n :order_type => 'LMT',\n #:parent_id => buy_order.local_id,\n :transmit => true\n place_order breakeven_order, @contracts[tkr]\n end \n #-- Profit LMT\n #puts \"profit_order = IB::Order.new :total_quantity => #{size},\"\n #puts \" :limit_price => #{profit_price},\"\n #puts \" :action => 'SELL',\"\n #puts \" :tif => 'GTC',\"\n #puts \" :order_type => 'LMT',\"\n #puts \" :parent_id => #{buy_order.local_id},\"\n #puts \" :transmit => true\"\n \n #profit_order = IB::Order.new :total_quantity => size,\n # :limit_price => profit_price,\n # :action => 'SELL',\n # :tif => 'GTC',\n # :order_type => 'LMT',\n # #:account => account_code,\n # :parent_id => buy_order.local_id,\n # :transmit => true\n #place_order profit_order, @contracts[tkr]\n end",
"def send_notice(type:,adjustment:,previous_data: nil, subject:,title:,email: 'info@landingintl.com')\n @type = type\n @adjustment = adjustment\n @previous_data = previous_data\n @title = title\n @link = inventory_adjustments_url\n mail :to => email, :subject => subject\n end",
"def monthly_smallV_report(count, budget, budget_increase, total_consumed, kol_count, kol_increase, real_kol_count, real_kol_increase)\n puts \"Prepare for monthly email\"\n @count = count\n @budget = budget\n @budget_increase = budget_increase\n @total_consumed = total_consumed\n @kol_count = kol_count\n @kol_increase = kol_increase\n @real_kol_count = real_kol_count\n @real_kol_increase = real_kol_increase\n mail(:to => 'monthly_report@robin8.com', :subject => \"【Robin8】Small-V monthly report\",:from => \"Robin8 <system@robin8.com>\")\n puts \"Monthly email sent\"\n end",
"def plan_with_balance(company, company_phone)\n @company = company\n @company_phone = company_phone\n mail(\n to: company_phone.extensions.admin.first.email,\n subject: '¡En GurúComm agradecemos tu recarga!'\n )\n end"
] |
[
"0.6162591",
"0.5979957",
"0.5944701",
"0.59194416",
"0.5843076",
"0.5792522",
"0.5732725",
"0.5731386",
"0.5710641",
"0.5607974",
"0.5575205",
"0.5572806",
"0.55705214",
"0.55692035",
"0.5551878",
"0.5544476",
"0.554407",
"0.55421376",
"0.5538726",
"0.55243313",
"0.5519518",
"0.5507493",
"0.5497689",
"0.549459",
"0.5492161",
"0.549148",
"0.5481704",
"0.54646796",
"0.54523396",
"0.5448274",
"0.54454434",
"0.5435282",
"0.5417083",
"0.54028636",
"0.54004896",
"0.5396482",
"0.53929234",
"0.53876406",
"0.5385793",
"0.5382882",
"0.5379009",
"0.5375705",
"0.5371217",
"0.53700906",
"0.5369731",
"0.5364273",
"0.5361006",
"0.5359995",
"0.5356438",
"0.5351075",
"0.53489715",
"0.5344802",
"0.53445005",
"0.5340976",
"0.5340364",
"0.533841",
"0.53347605",
"0.53322583",
"0.5328346",
"0.5326952",
"0.5317242",
"0.5316905",
"0.5313165",
"0.5277298",
"0.5275598",
"0.5274888",
"0.5271173",
"0.5270998",
"0.5268127",
"0.52680755",
"0.52632284",
"0.5262405",
"0.52613443",
"0.5256535",
"0.5256461",
"0.52528214",
"0.5252347",
"0.52506644",
"0.5250293",
"0.52485067",
"0.524708",
"0.52454805",
"0.52451724",
"0.5244214",
"0.52417135",
"0.52413887",
"0.52400523",
"0.5236026",
"0.52345043",
"0.5234275",
"0.5232252",
"0.522651",
"0.52194315",
"0.5216565",
"0.5211404",
"0.5209653",
"0.52082306",
"0.52008986",
"0.5196154",
"0.5195423",
"0.51932025"
] |
0.0
|
-1
|
CLEAN UP THIS ONE
|
def should_patient_tested_through_diagnosis?
procedure_type = concept('Procedure type')
x_ray = concept('Xray')
clinical = concept('Clinical')
ultrasound = concept('Ultrasound')
Observation.joins(:encounter).where(
'person_id = ? AND concept_id = ? AND (value_coded = ? || value_coded = ? || value_coded = ?) AND encounter.encounter_type = ?',
@patient.patient_id, procedure_type.concept_id, x_ray.concept_id, clinical.concept_id, ultrasound.concept_id, encounter_type(EXAMINATION).id
).order(obs_datetime: :desc).exists?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def cleanup!; end",
"def cleanup!; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup; end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup\r\n end",
"def cleanup\n end",
"def cleanup\n end",
"def cleanup!\n # This method may be left unimplemented if that is applicable\n end",
"def cleanup\n\tend",
"def cleanup\n\tend",
"def clean_up\n end",
"def clean_up\n end",
"def clear() end",
"def clear() end",
"def clear!; end",
"def clear!; end",
"def clear!; end",
"def clear; end",
"def clear; end",
"def clear; end",
"def clear; end",
"def clear; end",
"def clear; end",
"def clear; end",
"def cleanup!\n input.drop\n output.drop\n end",
"def _clean; end",
"def cleanup\n true\n end",
"def cleanup\n super\n end",
"def do_cleanup; \"\" end",
"def cleanup\n true\nend",
"def reset\n cleanup(true)\n end",
"def cleanup(options=nil)\n end",
"def cleanup\n super\n end",
"def clean_up\n show do\n title 'Store pellets on ice'\n note temp_instructions(ON_ICE)\n\n note 'Keep the labeled cell pellets, in the 24-well aluminum block, on ice until you are ready for FACS.'\n end\n\n buffers = operations.map { |op| op.inputs.select { |i| ALL_BUFFERS.include?(i.name) } }.flatten\n buffers.map! { |b| b.child_item }.uniq!\n\n release(buffers, interactive: true)\n\n show do\n title 'Clean up'\n\n check 'Any items that remain on the bench (other than the labeled cell pellets) can be discarded.'\n check \"Set the refigerated centrifuge back to 25 #{DEGREES_C}.\"\n end\n end",
"def nuke\n self.open_graph_event.destroy unless self.open_graph_event.nil?\n self.teamsheet_entries.destroy_all\n self.messages.destroy_all\n self.activity_items.destroy_all\n self.result.destroy unless self.result.nil?\n self.destroy\n end",
"def clean()\n\t\tSystem::clean target()\n\tend",
"def clean()\n\t\tSystem::clean target()\n\tend",
"def cleanup_hook; end",
"def cleanup\n winrm.run_cmd( \"del #{base64_file_name} /F /Q\" )\n winrm.run_cmd( \"del #{command_file_name} /F /Q\" )\n end",
"def clear!\n end",
"def purge!\n @data = nil\n end",
"def purge!\n @data = nil\n end",
"def purge \n\t\t@head = nil\n\t\t@tail = nil\n\tend",
"def discard; end",
"def discard; end",
"def clear\n end",
"def clear\n end",
"def finalise\n end",
"def reset() end",
"def clear\n end",
"def clear\n end",
"def clear\n end",
"def clean_environment\n `rm -rf /tmp/#{@upload_id}` # all sliced pages of the source file\n end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def reset; end",
"def clean!\n stop\n remove_instance_dir!\n FileUtils.remove_entry(config.download_path) if File.exists?(config.download_path)\n FileUtils.remove_entry(config.tmp_save_dir, true) if File.exists? config.tmp_save_dir\n md5.clean!\n FileUtils.remove_entry(config.version_file) if File.exists? config.version_file\n end",
"def tear_down; end",
"def clean\n\t\t\n\t\t@db.del 'twitter'\n\t\t@db.del 'rpg'\n\t\n\tend",
"def cleanup\n # override and do something appropriate\n end",
"def finalize\r\n drop_chopsticks\r\n end",
"def clean\n # dispose all damage sprites\n @damages.each {|sprite| sprite.dispose if sprite.is_a?(Sprite)}\n # dispose all beam sprites\n @beams.each {|ary| ary[0].dispose}\n # create new damage sprite buffer and new projectile buffer\n @damages, @remotes, @beams = [], [], []\n # unfreeze all actor's actions\n $BlizzABS.battlers.each {|actor| actor.freeze_action = false}\n # clear observation and path request data\n $BlizzABS.AI = BlizzABS::AI.new\n end",
"def purge\r\n @head = nil\r\n @tail = nil\r\n end",
"def reset!; end",
"def reset!; end",
"def reset!; end",
"def reset!; end",
"def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end",
"def clean!\n stop\n FileUtils.remove_entry(download_path) if File.exists? download_path\n FileUtils.remove_entry(tmp_save_dir, true) if File.exists? tmp_save_dir\n FileUtils.remove_entry(instance_dir, true) if File.exists? instance_dir\n FileUtils.remove_entry(md5sum_path) if File.exists? md5sum_path\n FileUtils.remove_entry(version_file) if File.exists? version_file\n end",
"def unload\n @all = nil\n end",
"def cleanup\n\tsh 'del /F /Q .\\_site\\*'\n\t# sh 'rm -rf ./_site'\nend",
"def clear\n return\n end",
"def purge\n end",
"def clean_up\n self.user_thread = nil\n self.uid = nil\n self.internal_date = nil\n self.raw_eml = nil\n self.envelope = nil\n self.message_id = nil\n self.sha1 = nil\n self.mail_log = nil\n end",
"def mina_cleanup!\n run! if commands.any?\n end",
"def clean_up(*args)\n # Remove all orphan Entries and Products\n SemiStatic::Entry.all{|e| e.destroy if e.tag.nil?}\n SemiStatic::Product.all{|p| p.destroy if p.entry.nil?}\n\n # Get rid of newsletter tags where the actual newsletter has been deleted\n SemiStatic::Tag.select{|t| t.newsletter_id.present? && t.newsletter.nil?}.each{|t| t.destroy}\n\n # There was a bug where some Entry.master_entry_id were not reset to nil, fix these\n SemiStatic::Entry.where.not(:master_entry_id => nil).each{|e| e.master_entry_id = nil; e.save;}\n end",
"def teardown\n\t\t\t\t# Do nothing\n\t\tend"
] |
[
"0.79912174",
"0.79912174",
"0.7925388",
"0.7925388",
"0.7925388",
"0.7925388",
"0.77884847",
"0.77884847",
"0.77884847",
"0.7781651",
"0.7781651",
"0.7781651",
"0.7781651",
"0.774741",
"0.7726321",
"0.7726321",
"0.7647412",
"0.75905967",
"0.75905967",
"0.74834317",
"0.74834317",
"0.7444417",
"0.7444417",
"0.7362517",
"0.7362517",
"0.7362517",
"0.7268548",
"0.7268548",
"0.7268548",
"0.7268548",
"0.7268548",
"0.7268548",
"0.7268548",
"0.72049874",
"0.7148463",
"0.7114835",
"0.6950856",
"0.69469094",
"0.6940146",
"0.691951",
"0.6870782",
"0.68589747",
"0.6838402",
"0.68225116",
"0.68165064",
"0.68165064",
"0.6811797",
"0.6797046",
"0.6781375",
"0.67787033",
"0.67787033",
"0.6769099",
"0.6765635",
"0.6765635",
"0.67390287",
"0.67390287",
"0.67221373",
"0.67049325",
"0.6694264",
"0.6694264",
"0.6694264",
"0.66891456",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.6679587",
"0.66782176",
"0.66548187",
"0.66488487",
"0.66374534",
"0.66355693",
"0.66308504",
"0.6613388",
"0.66024077",
"0.66024077",
"0.66024077",
"0.66024077",
"0.6593999",
"0.6593999",
"0.6591683",
"0.6588511",
"0.6586684",
"0.65643847",
"0.65437126",
"0.6540883",
"0.6537272",
"0.65363145"
] |
0.0
|
-1
|
patient should get diagnised through lab order
|
def alternate_test_procedure_type
begin
last_time_diagnosis_selected.obs_datetime > last_time_lab_order_selected.obs_datetime
rescue StandardError
return true if last_time_lab_order_selected.nil?
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def patient_should_proceed_after_lab_order?\n test_type = concept 'Test type'\n tb_concept = concept 'Tuberculous'\n observation = Observation.joins(:encounter).where(\n 'person_id = ? AND concept_id = ? AND value_coded = ? AND encounter.encounter_type = ?',\n @patient.patient_id, test_type.concept_id, tb_concept.concept_id, encounter_type(LAB_ORDERS).id\n ).order(obs_datetime: :desc).first\n begin\n time_diff = ((Time.now - observation.obs_datetime.to_time)).to_i\n (time_diff >= 12)\n rescue StandardError\n false\n end\n end",
"def patient_should_proceed_after_diagnosis?\n procedure_type = concept 'Procedure type'\n x_ray = concept 'Xray'\n clinical = concept 'Clinical'\n ultrasound = concept 'Ultrasound'\n observation = Observation.joins(:encounter).where(\n 'person_id = ? AND concept_id = ? AND (value_coded = ? || value_coded = ? || value_coded = ?) AND encounter.encounter_type = ?',\n @patient.patient_id, procedure_type.concept_id, x_ray.concept_id, clinical.concept_id, ultrasound.concept_id, encounter_type(DIAGNOSIS).id\n ).order(obs_datetime: :desc).first\n\n begin\n time_diff = (Time.current - observation.obs_datetime)\n minutes = (time_diff / 60)\n (minutes >= 1 / 60)\n rescue StandardError\n false\n end\n end",
"def should_patient_tested_through_diagnosis?\n procedure_type = concept('Procedure type')\n x_ray = concept('Xray')\n clinical = concept('Clinical')\n ultrasound = concept('Ultrasound')\n Observation.joins(:encounter).where(\n 'person_id = ? AND concept_id = ? AND (value_coded = ? || value_coded = ? || value_coded = ?) AND encounter.encounter_type = ?',\n @patient.patient_id, procedure_type.concept_id, x_ray.concept_id, clinical.concept_id, ultrasound.concept_id, encounter_type(EXAMINATION).id\n ).order(obs_datetime: :desc).exists?\n end",
"def diag_required\n return if self.vis_type == TELE_VISIT # patient-created visits have no diagnosis\n hcp_codes = hcp_proc_codes.split(',') rescue nil\n return unless hcp_codes.any?\n hcp_codes.each do |code|\n proc = Procedure.find_by(code: code) \n if proc.diag_req\n errors.add(:diag_code, \"Diagnosis is required for this visit\") if diag_code.blank?\n return\n end\n end\n end",
"def should_patient_go_lab_examination_at_followup?\n first_dispensation = Encounter.joins(:type).where(\n 'encounter_type.name = ? AND encounter.patient_id = ? AND encounter.program_id = ?',\n DISPENSING,\n @patient.patient_id,\n @program.program_id\n ).order(encounter_datetime: :asc).first\n\n begin\n first_dispensation_date = first_dispensation.encounter_datetime\n number_of_days = (Time.current.to_date - first_dispensation_date.to_date).to_i\n (number_of_days == 56 || number_of_days == 84 || number_of_days == 140 || number_of_days == 168)\n rescue StandardError\n false\n end\n end",
"def test_lung_cancer\n @answers[0] = true\n @answers[2] = true\n assert_equal(Diagnosis.diagnose(@answers),\"Lung Cancer\")\n end",
"def attendTest_no_show_imaging(patient)\n yield [] if @state[IAPPOINTMENTREQUESTED].any? {|terms| terms.size == 2 and terms[0] == patient and state(PATIENT, patient) and state(RADIOLOGIST, terms[1]) and not state(IAPPOINTMENTKEPT, patient, terms[1])}\nend",
"def patient_implicit?\n @authorized_user.patients.size == 1 \n end",
"def primary_dx\n diagnoses.find_by_dx_type('P')\n end",
"def set_diagnosed_patient\n @diagnosed_patient = DiagnosedPatient.find(params[:id])\n end",
"def current_diagnoses(patient_id)\n patient = Patient.find(patient_id)\n patient.encounters.current.includes([:observations]).map{|encounter|\n encounter.observations.where([\"obs.concept_id = ? OR obs.concept_id = ?\",\n ConceptName.find_by_name(\"DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end",
"def current_diagnoses\n self.encounters.current.all(:include => [:observations]).map{|encounter| \n encounter.observations.active.all(\n :conditions => [\"obs.concept_id = ? OR obs.concept_id = ?\", \n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS\").concept_id,\n ConceptName.find_by_name(\"OUTPATIENT DIAGNOSIS, NON-CODED\").concept_id])\n }.flatten.compact\n end",
"def patient_does_not_have_diagnosis?\n encounter_type = EncounterType.find_by name:OUTPATIENT_DIAGNOSIS\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def deliverDiagnostics_only_imaging(patient)\n physician = ''\n radiologist = ''\n generate(\n [\n [PATIENT, patient],\n [PHYSICIAN, physician],\n [RADIOLOGIST, radiologist],\n [IAPPOINTMENTKEPT, patient, radiologist]\n ],\n [\n [BIOPSYREQUESTED, physician, patient]\n ], physician, radiologist\n ) {\n yield [\n ['requestRadiologyReport', physician, radiologist, patient],\n ['sendRadiologyReport', radiologist, physician, patient],\n ['generateTreatmentPlan', physician, patient]\n ]\n }\nend",
"def has_related_patient?\n if registrations.count > 0\n return true\n end\n under_supervision_clinics.each do |clinic|\n clinic.registrations.each do |reg|\n return true\n end\n end\n return false\n end",
"def test_that_foreign_robot_needing_repairs_sent_to_station_1\n skip\n # arrange\n # happened in setup\n # act\n actual_value = @robot.needs_repairs && @robot.foreign_model\n # assert\n expected_value = true\n assert_equal(actual_value, expected_value)\n end",
"def occupied?\n !patient.nil?\n end",
"def doctors_visit(patient_id)\n \nend",
"def virgilism_dentality(checkrowed, generatrix)\n unflickeringly_draftiness_goer()\n retrust(clavation_uneclipsed)\n thumby(afterknowledge, disproval)\n end",
"def test_can_set_side_effects\n patient = patient(:andreas)\n patient.set_art_staging_encounter(\"Other side effect\",\"Yes\",@@today)\n assert patient.requested_observation_by_name_date(\"Other side effect\",@@today) == \"Yes\"\n end",
"def probe?\n self.order == -1\n end",
"def patient_diagnosis_date_is_after_dob\n\t\tif !patient.nil? && !patient.diagnosis_date.blank? && \n\t\t\t!dob.blank? && patient.diagnosis_date < dob\n#\t\t\t!pii.nil? && !pii.dob.blank? && patient.diagnosis_date < pii.dob\n\t\t\terrors.add('patient:diagnosis_date', \"is before study_subject's dob.\") \n\t\tend\n\tend",
"def show\n # no way for map.resources to use other than :id, which we don't want\n params[:wedgetail]=params[:id]\n @patient=User.find_by_wedgetail(params[:wedgetail],:order =>\"created_at DESC\")\n \n \n if !@patient or @patient.role!=5\n flash[:notice]='Patient not found'\n elsif !@patient.hatched and Pref.unhatched_access==1\n flash[:notice]='Patient not yet registered'\n else\n authorize_only(:patient) {@patient.wedgetail == @user.wedgetail}\n authorize_only(:temp) { @patient.wedgetail == @user.wedgetail.from(6)}\n authorize_only(:leader){@patient.firewall(@user)}\n authorize_only(:user){@patient.firewall(@user)}\n authorize :admin\n @narratives=Narrative.find(:all, :conditions=>[\"narrative_type_id IS NOT NULL and wedgetail=?\",params[:wedgetail]], :order=>\"created_at DESC\")\n @audit=Audit.create(:patient=>params[:wedgetail],:user_wedgetail=>@user.wedgetail)\n @special=Array.new\n @count=Array.new\n @displayOrder=[1,5,12,3,8,9,6]\n j=1\n for i in @displayOrder\n @special[j]=Narrative.find(:first, :conditions=>[\"wedgetail=? and narrative_type_id=?\",params[:wedgetail],i], :order=>\"narrative_date DESC,created_at DESC\") \n @count[i]= Narrative.count(:all,:conditions=>[\"wedgetail='#{params[:wedgetail]}' and narrative_type_id='#{i}'\"])\n j=j+1\n end\n @wall_info=get_wall(@patient.wedgetail)\n @medication=Narrative.find(:first, :conditions=>[\"wedgetail=? and narrative_type_id=2\",params[:wedgetail]], :order=>\"created_at DESC\")\n unless @medication\n @medication=Narrative.create(:wedgetail=>@patient.wedgetail,:content=>\"\",:narrative_type_id=>2,:created_by=>@user.wedgetail,:content_type=>\"text/plain\")\n \n end\n \n @allergy=Narrative.find(:first, :conditions=>[\"wedgetail=? and narrative_type_id=5\",params[:wedgetail]], :order=>\"created_at DESC\")\n unless @allergy\n @allergy=Narrative.create(:wedgetail=>@patient.wedgetail,:content=>\"\",:narrative_type_id=>5,:created_by=>@user.wedgetail,:content_type=>\"text/plain\")\n end\n # get patients conditions\n @conditions=@patient.conditions\n end\n \n \n respond_to do |format|\n format.html{\n if !@patient or @patient.role!=5\n redirect_to :action=>:index\n elsif ! @patient.hatched and Pref.unhatched_access==1\n render :action=>:unconfirmed\n end\n }\n format.iphone {render :layout=> 'layouts/application.iphone.erb'}# index.iphone.erb \n format.xml { render :xml => @patient }\n end\n end",
"def comp_noncomp_past_step_1?\n !spectator? && status_is_active?(\"base_details\")\n end",
"def set_treatment_notes\n @patient = Patient.find(params[:patient_id])\n end",
"def test_necessary_existence_of_deceased\n puts \"*** START OF TEST DECEASED ***\"\n puts \"PERSON DEC FLAG is #{@person.deceased}\"\n @person.deceased = nil\n assert !@person.save\n check_for_error(\"is not included in the list\", @person, :deceased)\n \n \n end",
"def trials_for_design(d)\n @trials.select{ |t| t.design and t.design==d }\n end",
"def new_patient?(patient)\n return Patient.find_by_mrn(patient.mrn).nil?\n end",
"def performPathologyTests_biopsy_unnecessary(patient)\n yield [] if @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == C1 and terms[3] == patient and state(PATIENT, patient) and state(PHYSICIAN, terms[2])}\nend",
"def setup\r\n @patient = patients(:patient_00001)\r\n end",
"def test_necessary_existence_of_communication_note\n puts @communication.communication_note\n test_necessary_existence_of_model_field(\"cannot be empty\", @communication, :communication_note)\n end",
"def patient_user\n redirect_to(patient_page_url) if current_user.patient?\n end",
"def patient_diagnosis_date_is_after_dob\n\t\tif !patient.nil? && !patient.diagnosis_date.blank? && \n\t\t\t\t!dob.blank? && patient.diagnosis_date < dob\n\t\t\terrors.add('patient:diagnosis_date', \"Diagnosis date is before study_subject's dob\") \n\t\tend\n\tend",
"def patient_diagnosis_date_is_after_dob\n\t\tif !patient.nil? && !patient.diagnosis_date.blank? && \n\t\t\t\t!dob.blank? && patient.diagnosis_date < dob\n\t\t\terrors.add('patient:diagnosis_date', \"Diagnosis date is before study_subject's dob\") \n\t\tend\n\tend",
"def run_examination\n true\n end",
"def demographics_label(patient_id)\n patient = Patient.find(patient_id)\n patient_bean = PatientService.get_patient(patient.person)\n demographics = mastercard_demographics(patient)\n hiv_staging = Encounter.where([\"encounter_type = ? and patient_id = ?\",\n EncounterType.find_by_name(\"HIV Staging\").id,patient.id]).last\n\n tb_within_last_two_yrs = \"tb within last 2 yrs\" unless demographics.tb_within_last_two_yrs.blank?\n eptb = \"eptb\" unless demographics.eptb.blank?\n pulmonary_tb = \"Pulmonary tb\" unless demographics.pulmonary_tb.blank?\n\n cd4_count_date = nil ; cd4_count = nil ; pregnant = 'N/A'\n\n (hiv_staging.observations).map do | obs |\n concept_name = obs.to_s.split(':')[0].strip rescue nil\n next if concept_name.blank?\n case concept_name\n when 'CD4 COUNT DATETIME'\n cd4_count_date = obs.value_datetime.to_date\n when 'CD4 COUNT'\n cd4_count = obs.value_numeric\n when 'IS PATIENT PREGNANT?'\n pregnant = obs.to_s.split(':')[1] rescue nil\n end\n end rescue []\n\n office_phone_number = PatientService.get_attribute(patient.person, 'Office phone number')\n home_phone_number = PatientService.get_attribute(patient.person, 'Home phone number')\n cell_phone_number = PatientService.get_attribute(patient.person, 'Cell phone number')\n\n phone_number = office_phone_number if not office_phone_number.downcase == \"not available\" and not office_phone_number.downcase == \"unknown\" rescue nil\n phone_number= home_phone_number if not home_phone_number.downcase == \"not available\" and not home_phone_number.downcase == \"unknown\" rescue nil\n phone_number = cell_phone_number if not cell_phone_number.downcase == \"not available\" and not cell_phone_number.downcase == \"unknown\" rescue nil\n\n initial_height = PatientService.get_patient_attribute_value(patient, \"initial_height\")\n initial_weight = PatientService.get_patient_attribute_value(patient, \"initial_weight\")\n\n label = ZebraPrinter::StandardLabel.new\n label.draw_text(\"Printed on: #{Date.today.strftime('%A, %d-%b-%Y')}\",450,300,0,1,1,1,false)\n label.draw_text(\"#{demographics.arv_number}\",575,30,0,3,1,1,false)\n label.draw_text(\"PATIENT DETAILS\",25,30,0,3,1,1,false)\n label.draw_text(\"Name: #{demographics.name} (#{demographics.sex})\",25,60,0,3,1,1,false)\n label.draw_text(\"DOB: #{PatientService.birthdate_formatted(patient.person)}\",25,90,0,3,1,1,false)\n label.draw_text(\"Phone: #{phone_number}\",25,120,0,3,1,1,false)\n if demographics.address.length > 48\n label.draw_text(\"Addr: #{demographics.address[0..47]}\",25,150,0,3,1,1,false)\n label.draw_text(\" : #{demographics.address[48..-1]}\",25,180,0,3,1,1,false)\n last_line = 180\n else\n label.draw_text(\"Addr: #{demographics.address}\",25,150,0,3,1,1,false)\n last_line = 150\n end\n\n if !demographics.guardian.nil?\n if last_line == 180 and demographics.guardian.length < 48\n label.draw_text(\"Guard: #{demographics.guardian}\",25,210,0,3,1,1,false)\n last_line = 210\n elsif last_line == 180 and demographics.guardian.length > 48\n label.draw_text(\"Guard: #{demographics.guardian[0..47]}\",25,210,0,3,1,1,false)\n label.draw_text(\" : #{demographics.guardian[48..-1]}\",25,240,0,3,1,1,false)\n last_line = 240\n elsif last_line == 150 and demographics.guardian.length > 48\n label.draw_text(\"Guard: #{demographics.guardian[0..47]}\",25,180,0,3,1,1,false)\n label.draw_text(\" : #{demographics.guardian[48..-1]}\",25,210,0,3,1,1,false)\n last_line = 210\n elsif last_line == 150 and demographics.guardian.length < 48\n label.draw_text(\"Guard: #{demographics.guardian}\",25,180,0,3,1,1,false)\n last_line = 180\n end\n else\n if last_line == 180\n label.draw_text(\"Guard: None\",25,210,0,3,1,1,false)\n last_line = 210\n elsif last_line == 180\n label.draw_text(\"Guard: None}\",25,210,0,3,1,1,false)\n last_line = 240\n elsif last_line == 150\n label.draw_text(\"Guard: None\",25,180,0,3,1,1,false)\n last_line = 210\n elsif last_line == 150\n label.draw_text(\"Guard: None\",25,180,0,3,1,1,false)\n last_line = 180\n end\n end\n\n label.draw_text(\"TI: #{demographics.transfer_in ||= 'No'}\",25,last_line+=30,0,3,1,1,false)\n label.draw_text(\"FUP: (#{demographics.agrees_to_followup})\",25,last_line+=30,0,3,1,1,false)\n\n\n label2 = ZebraPrinter::StandardLabel.new\n #Vertical lines\n=begin\n label2.draw_line(45,40,5,242)\n label2.draw_line(805,40,5,242)\n label2.draw_line(365,40,5,242)\n label2.draw_line(575,40,5,242)\n\n #horizontal lines\n label2.draw_line(45,40,795,3)\n label2.draw_line(45,80,795,3)\n label2.draw_line(45,120,795,3)\n label2.draw_line(45,200,795,3)\n label2.draw_line(45,240,795,3)\n label2.draw_line(45,280,795,3)\n=end\n label2.draw_line(25,170,795,3)\n #label data\n label2.draw_text(\"STATUS AT ART INITIATION\",25,30,0,3,1,1,false)\n label2.draw_text(\"(DSA:#{patient.date_started_art.strftime('%d-%b-%Y') rescue 'N/A'})\",370,30,0,2,1,1,false)\n label2.draw_text(\"#{demographics.arv_number}\",580,20,0,3,1,1,false)\n label2.draw_text(\"Printed on: #{Date.today.strftime('%A, %d-%b-%Y')}\",25,300,0,1,1,1,false)\n\n label2.draw_text(\"RFS: #{demographics.reason_for_art_eligibility}\",25,70,0,2,1,1,false)\n label2.draw_text(\"#{cd4_count} #{cd4_count_date}\",25,110,0,2,1,1,false)\n label2.draw_text(\"1st + Test: #{demographics.hiv_test_date}\",25,150,0,2,1,1,false)\n\n label2.draw_text(\"TB: #{tb_within_last_two_yrs} #{eptb} #{pulmonary_tb}\",380,70,0,2,1,1,false)\n label2.draw_text(\"KS:#{demographics.ks rescue nil}\",380,110,0,2,1,1,false)\n label2.draw_text(\"Preg:#{pregnant}\",380,150,0,2,1,1,false)\n label2.draw_text(\"#{demographics.first_line_drugs.join(',')[0..32] rescue nil}\",25,190,0,2,1,1,false)\n label2.draw_text(\"#{demographics.alt_first_line_drugs.join(',')[0..32] rescue nil}\",25,230,0,2,1,1,false)\n label2.draw_text(\"#{demographics.second_line_drugs.join(',')[0..32] rescue nil}\",25,270,0,2,1,1,false)\n\n label2.draw_text(\"HEIGHT: #{initial_height}\",570,70,0,2,1,1,false)\n label2.draw_text(\"WEIGHT: #{initial_weight}\",570,110,0,2,1,1,false)\n label2.draw_text(\"Init Age: #{PatientService.patient_age_at_initiation(patient, demographics.date_of_first_line_regimen) rescue nil}\",570,150,0,2,1,1,false)\n\n line = 190\n extra_lines = []\n label2.draw_text(\"STAGE DEFINING CONDITIONS\",450,190,0,3,1,1,false)\n (hiv_staging.observations).each{|obs|\n name = obs.to_s.split(':')[0].strip.upcase rescue nil\n condition = obs.to_s.split(':')[1].strip.humanize rescue nil\n next unless name == 'WHO STAGES CRITERIA PRESENT'\n line+=25\n if line <= 290\n label2.draw_text(condition[0..35],450,line,0,1,1,1,false)\n end\n extra_lines << condition[0..79] if line > 290\n } rescue []\n\n if line > 310 and !extra_lines.blank?\n line = 30\n label3 = ZebraPrinter::StandardLabel.new\n label3.draw_text(\"STAGE DEFINING CONDITIONS\",25,line,0,3,1,1,false)\n label3.draw_text(\"#{PatientService.get_patient_identifier(patient, 'ARV Number')}\",370,line,0,2,1,1,false)\n label3.draw_text(\"Printed on: #{Date.today.strftime('%A, %d-%b-%Y')}\",450,300,0,1,1,1,false)\n extra_lines.each{|condition|\n label3.draw_text(condition,25,line+=30,0,2,1,1,false)\n } rescue []\n end\n return \"#{label.print(1)} #{label2.print(1)} #{label3.print(1)}\" if !extra_lines.blank?\n return \"#{label.print(1)} #{label2.print(1)}\"\n end",
"def patient_user\n redirect_to(patient_page_url) if current_user.patient?\n end",
"def time_shifted_patient(doc, vendor_id, bundle)\n # check for start date\n year_validator = MeasurePeriodValidator.new\n doc_start = year_validator.measure_period_start(doc)&.value\n # doc_end = validator.measure_period_end(doc).value -> should we validate end???\n return false, 'Document needs to report the Measurement Start Date' unless doc_start\n\n # import\n begin\n patient, _warnings, codes = QRDA::Cat1::PatientImporter.instance.parse_cat1(doc)\n\n # use all patient codes to build description map\n Cypress::QrdaPostProcessor.build_code_descriptions(codes, patient, bundle)\n\n # shift date\n utc_start = DateTime.parse(doc_start).to_time.utc\n # Compare date alone, without time\n if utc_start.strftime('%x') != DateTime.strptime(bundle.measure_period_start.to_s, '%s').utc.strftime('%x')\n time_dif = bundle.measure_period_start - utc_start.to_i\n patient.qdmPatient.shift_dates(time_dif)\n end\n\n patient.update(_type: CQM::VendorPatient, correlation_id: vendor_id, bundleId: bundle.id)\n Cypress::QrdaPostProcessor.replace_negated_codes(patient, bundle)\n Cypress::QrdaPostProcessor.remove_unmatched_data_type_code_combinations(patient, bundle)\n Cypress::QrdaPostProcessor.add_parsed_telecoms(patient, parse_telecoms(doc))\n Cypress::QrdaPostProcessor.remove_invalid_qdm_56_data_types(patient) if bundle.major_version.to_i > 2021\n patient.save\n [true, patient]\n rescue StandardError => e\n [false, e.to_s]\n end\n end",
"def patient_forms\n # blank\n end",
"def log_denials\n @log_denials = true\n end",
"def attacking_diagonal?\n false\n end",
"def display_parent_child_test_cases\n \n end",
"def reassociation_trace\n trn_elements = []\n trn_elements << 'TRN'\n trn_elements << '1'\n check_num = \"#{check.check_number.to_i}\"\n job = check.job\n if payer\n if job.payer_group == \"PatPay\"\n # checking whether the check_number is duplicated\n # in the whole check number array\n if Output835.element_duplicates?(check_num, @check_nums)\n # get all indexes at which duplicate elements are present\n # then check at what position the current element resides\n # that gives the duplication index as one moves from first to last elem of the array\n # For Ex : array = [a, b, c, c, d, e, f, e, g]\n # all_indices for 'c' would return [2, 3]\n # comparing the current element's index with that, we would get either '0' or '1' depending on\n # whether we're dealing with 'c' in 2nd place or at 3rd place, couting starts from 0th place\n # all_indices for 'e' would return [5, 7]\n counter = Output835.all_indices(check_num, @check_nums).index(index)\n # since counter starts from zero, adding 1 to get the correct count\n end\n check_num << \"#{check.batch.date.strftime(\"%m%d%y\")}\" unless check_num.blank?\n check_num << \"#{counter+1}\" if counter\n end\n end\n trn_elements << (check_num.blank? ? \"0\" : check_num)\n if @check_amount.to_f > 0 && check.payment_method == \"EFT\"\n unless facility.facility_tin.blank?\n trn_elements << '1' + facility.facility_tin\n end\n else\n trn_elements << '1999999999'\n end\n trn_elements = Output835.trim_segment(trn_elements)\n trn_elements.join(@element_seperator)\n end",
"def find_patient_date_enrolled(patient)\n order = Order.joins(:encounter, :drug_order)\\\n .where(encounter: { patient: patient },\n drug_order: { drug: Drug.arv_drugs })\\\n .order(:start_date)\\\n .first\n\n order&.start_date&.to_date\n end",
"def same_curriculum_and_mandatory\n @problem.avoid(1, :name => \"same_curriculum_and_mandatory\") {\n conjunct{[\n Timetable::Entry.asp(:course_component_id => \"C1\", :weekday_id => \"WD\", :timeframe_id => \"TF\"),\n Timetable::Entry.asp(:course_component_id => \"C2\", :weekday_id => \"WD\", :timeframe_id => \"TF\"),\n CurriculumModuleAssignment.asp(:course_component_id => \"C1\", :curriculum_id => \"Cu\"),\n CurriculumModuleAssignment.asp(:course_component_id => \"C2\", :curriculum_id => \"Cu\"),\n \"C1 != C2\" ]}\n}\n end",
"def subject_is_case\n\t\tif study_subject and !study_subject.is_case?\n\t\t\terrors.add(:study_subject,\"must be case to have patient info\")\n\t\tend\n\tend",
"def enrolled_patients\n created_patients\n end",
"def trial_guard_squads\n guard_squads = Array.new\n trial_squads.each do |trial_squad|\n guard_squads << trial_squad unless trial_squad.intruder_flg\n end\n guard_squads\n end",
"def find_patient_date_enrolled(patient)\n order = Order.joins(:encounter, :drug_order)\\\n .where(encounter: { patient: patient },\n drug_order: { drug: Drug.arv_drugs })\\\n .order(:start_date)\\\n .first\n\n order&.start_date&.to_date\n end",
"def assessment_sms_weblink(patient)\n add_fail_history_blank_field(patient, 'primary phone number') && return if patient&.primary_telephone.blank?\n\n num = patient.primary_telephone\n # patient.dependents includes the patient themselves if patient.id = patient.responder_id (which should be the case)\n patient.active_dependents.uniq.each do |dependent|\n lang = dependent.select_language\n url = new_patient_assessment_jurisdiction_lang_initials_url(dependent.submission_token,\n dependent.jurisdiction.unique_identifier,\n lang&.to_s || 'en',\n dependent&.initials_age)\n contents = \"#{I18n.t('assessments.sms.weblink.intro', locale: lang)} #{dependent&.initials_age('-')}: #{url}\"\n account_sid = ENV['TWILLIO_API_ACCOUNT']\n auth_token = ENV['TWILLIO_API_KEY']\n from = ENV['TWILLIO_SENDING_NUMBER']\n client = Twilio::REST::Client.new(account_sid, auth_token)\n client.messages.create(\n from: from,\n to: Phonelib.parse(num, 'US').full_e164,\n body: contents\n )\n add_success_history(dependent, patient)\n end\n patient.update(last_assessment_reminder_sent: DateTime.now)\n rescue Twilio::REST::RestError => e\n Rails.logger.warn e.error_message\n add_fail_history_sms(patient)\n patient.update(last_assessment_reminder_sent: DateTime.now)\n end",
"def is_decision\n return (@index == 89)\n end",
"def in_law; end",
"def patients\r\n\t\tAppointment.all.collect do |appt|\r\n\t\t\t\tappt.patient if appt.doctor == self\r\n\t\tend\r\n\tend",
"def call_list_patients(line)\n ordered_patients(line).reject { |x| recently_called_by_user? x }\n end",
"def appointments\n Appointment.all.select do |appointment|\n appointment.patient == self\n #binding.pry\n end\n end",
"def show\n p_id = params[:app_id].to_i\n @id_patient_actual = params[:id_patient_actual]\n @appointment = Appointment.find_by(id_appointment: p_id, id_patient: @id_patient_actual)\n temp_treats = []\n @diagnoses = []\n @treatments = []\n if @appointment.nil?\n @actual_user = Patient.find_by(id_patient: @id_patient_actual)\n flash[:notice] = \"appointment doesn't exist\"\n redirect_to controller: 'appointment_patients', id: @id_patient_actual and return\n else\n list = @appointment.id_diagnoses\n end\n if list.nil?\n @diagnoses = []\n @treatments = []\n else\n list.each do |i|\n app_actual = Diagnose.find_by(id_diagnose: i[:id])\n if !app_actual.nil?\n @diagnoses += [app_actual]\n temp_treats += Diagnose.find_by(id_diagnose: i[:id]).id_treatments\n end\n end\n if !temp_treats.nil?\n temp_treats.each do |j|\n algo = Treatment.find_by(id_treatment: j)\n if !algo.nil? \n @treatments += [algo]\n end\n end\n end\n end\n end",
"def processPatient_process_patient_healthy(patient)\n if @state[COMMITMENT].any? {|terms| terms.size == 4 and terms[0] == C1 and terms[3] == patient and state(PATIENT, patient) and state(PHYSICIAN, terms[2])}\n yield [\n ['performImagingTests', patient],\n ['performPathologyTests', patient],\n ['deliverDiagnostics', patient]\n ]\n end\nend",
"def the_doctor; end",
"def add_diagnosis_s( name, sym, positive, val )\n add_diagnosis( name, sym, positive, 'a', val.to_s )\n end",
"def test_belongs_to_responsible_party \r\n Patient.find(1).responsible_party.first_name\r\n assert_equal responsible_parties(:responsible_party_00001).first_name, Patient.find(1).responsible_party.first_name\r\n assert !Patient.find(1).responsible_party.nil?, \"Every Patient should have a Responsible Party Details\"\r\n end",
"def force_patient\n unless get_patient\n redirect_to :controller => :patients, :action => :index\n end\n end",
"def is_a_patient?\n ((!self.role.blank?) && (self.role == self.class::PATIENT))\n end",
"def details_view_patient\n @patient = current_user.user_record\n @appointments = Appointment.all(:conditions => { :patient_id => @patient.id })\n find_reports(current_user.id)\n end",
"def add_subject_died_operational_event\n\t\tif( ( vital_status_changed? ) &&\n\t\t\t\t( vital_status == 'Deceased' ) && \n\t\t\t\t( vital_status_was != 'Deceased' ) )\t\n\t\t\t#\n\t\t\t#\tIf it changed and is now Deceased, obviously it wasn't Deceased. \n\t\t\t#\tCould remove that check.\n\t\t\t#\n\t\t\tself.operational_events.create!(\n\t\t\t\t:project_id => Project['ccls'].id,\n\t\t\t\t:operational_event_type_id => OperationalEventType['subjectDied'].id,\n\t\t\t\t:occurred_at => DateTime.current\n\t\t\t)\n\t\tend\n\tend",
"def show\n p_id = params[:app_id].to_i\n @appointment = Appointment.find_by(id_appointment: p_id)\n temp_treats = []\n @diagnoses = []\n @treatments = []\n if @appointment.nil?\n @actual_user = Patient.find_by(id_patient: @id_patient_actual)\n flash[:notice] = \"appointment doesn't exist\"\n redirect_to controller: 'doctors' and return\n else\n list = @appointment.id_diagnoses\n end\n if list.nil?\n @diagnoses = []\n @treatments = []\n else\n list.each do |i|\n app_actual = Diagnose.find_by(id_diagnose: i[:id])\n if !app_actual.nil?\n @diagnoses += [app_actual]\n temp_treats += Diagnose.find_by(id_diagnose: i[:id]).id_treatments\n end\n end\n if !temp_treats.nil?\n temp_treats.each do |j|\n algo = Treatment.find_by(id_treatment: j)\n if !algo.nil? \n @treatments += [algo]\n end\n end\n end\n end\n end",
"def sequential\n return true if hand_to_val.last - hand_to_val.first == 4\n return false \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 current_lead?\n false\n end",
"def Customer_Endurance_Loop\n getPatientList.each_with_index do |patient, index|\n Log.Trace(\"Creating plan for patient id #{patient.id}\")\n #Scroll the the index of the patient, used if the patient index it outside the bounds of the scroll window\n @patientTable.scrollToRowByIndex(index)\n #Get the patient details\n details = patient.openPatientDetails\n #Get the number of plans from the patient record\n origPlanCount = details.getPlanCount\n #Add a new plan for the selected patient record\n begin\n editScreen = details.clickCreateNewPlan.addTarget.clickAddAblationZones.clickAddAblation\n rescue\n # Some interaction between Squish and the Upslope application cause some patients not to open correctly.\n Log.TestFail(\"Plan editor for patient id #{patient.id} did not open.\")\n @appHeaderFooter.clickLoadImagesRadio\n next\n end\n\n editScreen.capture3dScreenshot(\"Took 3D screenshot for patient name: #{patient.name} id: #{patient.id}\", patient.id)\n #Go back to the patient tree\n @appHeaderFooter.clickLoadImagesRadio\n #Scroll to the patient (if needed) and open up the patient details - displaying all the available plans for this patient\n details = scrollToPatientIndex(index).openPatientDetails(patient)\n #Test to make sure that the original plan count is increased by one\n Log.TestVerify(origPlanCount+1 == details.getPlanCount, \"Verify Plan count increased by one\")\n #Determine the patient row index for the new plan\n patientRowIndex = index % (MAX_NUM_VISIBLE_TABLE_ROWS - 1)\n\n Log.Trace(\"#{self.class.name}::#{__method__}(): patientRowIndex: #{patientRowIndex}\")\n newPlanCount = details.getPlanCount\n Log.Trace(\"#{self.class.name}::#{__method__}(): New Plan count is \" + newPlanCount.to_s)\n # Scroll down to the last plan row to delete it\n # +1 is for the CT row\n scrollToPatientIndex(patientRowIndex + 1 )\n # Delete the plan\n details.patientCTPlans.first.deletePlan\n # Open patient details to verify new row created\n details = patient.openPatientDetails\n # Verify the plan was deleted\n Log.TestVerify(origPlanCount == details.getPlanCount, \"Verify Plan count decreased by one\")\n # CLick the row again to close patient details\n patient.closePatientDetails\n end\n\n return MainScreen.new\n end",
"def can_create_patient?\n has_role?(:enroller) || has_role?(:public_health_enroller)\n end",
"def patients_reinitiated_on_art_ever\n\t\tpatients = []\n\t\tObservation.find(:all, :joins => [:encounter], :conditions => [\"concept_id = ? AND value_coded IN (?) AND encounter.voided = 0 \\\n\t\t\tAND DATE_FORMAT(obs_datetime, '%Y-%m-%d') <= ?\", ConceptName.find_by_name(\"EVER RECEIVED ART\").concept_id,\n\t\t\t\tConceptName.find(:all, :conditions => [\"name = 'YES'\"]).collect{|c| c.concept_id},\n\t\t\t\t@end_date.to_date.strftime(\"%Y-%m-%d\")]).each do | patient |\n\t\t\tpatients << patient.patient_id.to_i\n\t\tend\n\t\treturn patients\n\tend",
"def reassociation_trace\n simple_client_array_for_1000000009 = [\"NAVICURE\", \"ASCEND CLINICAL LLC\"]\n trn_elements = ['TRN', '1', ref_number]\n if simple_client_array_for_1000000009.include? (@client_name)\n trn_elements << '1000000009'\n elsif @check_amount.to_f > 0 && @check.payment_method == \"EFT\"\n trn_elements << '1' + @facility.facility_tin if @facility.facility_tin.present?\n else\n trn_elements << '1999999999'\n end\n trn_elements.trim_segment.join(@element_seperator)\n end",
"def patient_suitable_for_circumcision?\n # Memoize as this may be called a number of times within one request.\n # It is a pre-condition to a number of encounters.\n return @patient_suitable_for_circumcision unless @patient_suitable_for_circumcision.nil?\n\n @patient_suitable_for_circumcision = begin\n Observation.joins(:encounter)\\\n .where(concept: concept('Suitable for circumcision'),\n value_coded: concept('Yes').concept_id)\\\n .where('DATE(obs_datetime) = ?', date.to_date)\\\n .merge(Encounter.where(patient: patient, program: program))\\\n .exists?\n end\n end",
"def patient_admit_date_is_after_dob\n#\t\tif !patient.nil? && !patient.admit_date.blank? && \n#\t\t\t!pii.nil? && !pii.dob.blank? && patient.admit_date < pii.dob &&\n#\t\t\tpii.dob.to_date != Date.parse('1/1/1900') &&\n\t\tif !patient.nil? && !patient.admit_date.blank? && \n\t\t\t!dob.blank? && patient.admit_date < dob &&\n\t\t\tdob.to_date != Date.parse('1/1/1900') &&\n\t\t\tpatient.admit_date.to_date != Date.parse('1/1/1900')\n\t\t\terrors.add('patient:admit_date', \"is before study_subject's dob.\") \n\t\tend\n\tend",
"def patients\napps = []\nAppointment.all.each do |x|\n if x.doctor == self\n apps << x.patient\n end\nend\napps\nend",
"def patients\n\t\tAppointment.all.collect do |appt|\n\t\t\t\tappt.patient if appt.doctor == self\n\t\tend\n\tend",
"def check_formation(corp)\n return if formed?(corp)\n\n if major?(corp) && corp.floated?\n @formed << corp\n @log << \"#{corp.name} forms\"\n elsif minor?(corp) && corp.cash >= minor_required_train(corp).price\n @formed << corp\n @log << \"Minor #{corp.name} forms\"\n\n # buy required train (no phase-change side-effects)\n r_train = minor_get_train(corp)\n @minor_trains.delete(r_train)\n corp.trains << r_train\n r_train.owner = corp\n corp.spend(r_train.price, @bank)\n @log << \"Minor #{corp.name} spends #{format_currency(r_train.price)} for required train (#{r_train.name})\"\n end\n end",
"def can_access_patient?(patient_id)\n @authorized_user.patients.map { |patient| patient.id }.include?(patient_id.to_i)\n end",
"def log_qc_answers\n show do \n operations.each do |op|\n sample_id = op.input(\"PCR\").sample.id\n qc_answer = FieldValue.where(parent_id: sample_id, parent_class: \"Sample\", name: \"Has this strain passed QC?\").first\n note \"#{qc_answer.value}\"\n end\n end\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 onColumn_dnase(num_ops)\n dnase = (num_ops) * 10#ul\n rdd = (num_ops) * 70#ul\n tot_vol = dnase + rdd\n arr = ['DNase', 'RDD']\n headers = arr.map{|x| \"#{x} (µl)\"}\n tab = [ headers, [dnase, rdd].map {|i| {content: \"#{i}\", check: true}} ]\n check_dnase = show do\n title \"Preparing DNase I\"\n separator\n check \"Gather <b>1</b> clean #{(tot_vol > 1501) ? ('15mL Falcon tube') : ('1.5 mL eppie tube')} and label: <b>DNase + RDD</b>\"\n check \"Gather Qiagen RDD Buffer in #{DNASE_LOC[arr[1].downcase]}, you will need: <b>#{rdd}ul</b>\"\n check \"Gather <b>#{num_ops}</b> DNase I 10ul Aliquot(s) in #{DNASE_LOC[arr[0].downcase]} and thaw on ice.\"\n select [ \"Yes\", \"No\"], var: \"dnase\", label: \"Are there enough DNase aliquots? If not, select 'No' and proceed to the next step.\"\n separator\n note 'In an eppendorf tube mix by pipetting:'\n table tab\n note \"<b>Once finished set on ice until needed & proceed to the next step.</b>\"\n end\n \n # if user selected no then a new DNase I must be openned and prepared \n # Also, gives instructions to make dnase for current experiment\n if check_dnase[:dnase] == \"No\"\n show do\n title \"Prepare DNase I\"\n separator\n \n check \"Prepare DNase I stock solution by injecting/dispensing <b>550µl</b> of RNase-free water in to the DNase I vial.\"\n note \"Mix gently by inverting.\"\n check \"Next, aliquot <b>#{num_ops * 10}µl</b> of DNase into a clean 1.5 mL eppie tube.\"\n check \"To the same tube, add <b>#{num_ops * 70}µl</b> of Buffer RDD.\"\n note \"Mix by inverting and centrifuge briefly to collect at the bottom.\"\n note \"<b>Place on ice until ready to use.</b>\"\n note \"Finally, aliquot the rest of the DNase into a new clean stripwell(s) - <b>10µl</b> in each well.\"\n check \"When finished, store DNase I aliquots at -20C\"\n end\n end\n end",
"def assessment_sms_weblink(patient)\n if patient&.primary_telephone.blank?\n add_fail_history_blank_field(patient, 'primary phone number')\n return\n end\n if patient.blocked_sms\n TwilioSender.handle_twilio_error_codes(patient, TwilioSender::TWILIO_ERROR_CODES[:blocked_number][:code])\n return\n end\n\n # Cover potential race condition where multiple messages are sent for the same monitoree.\n return unless patient.last_assessment_reminder_sent_eligible?\n\n messages_array = []\n sms_lang = patient.select_language(:sms)\n web_lang = patient.select_language(:email)\n patient.active_dependents.uniq.each do |dependent|\n url = new_patient_assessment_jurisdiction_lang_initials_url(dependent.submission_token, dependent.jurisdiction.unique_identifier, web_lang&.to_s,\n dependent&.initials_age)\n contents = I18n.t('assessments.twilio.sms.weblink.intro', locale: sms_lang, initials_age: dependent&.initials_age('-'), url: url)\n # Update last send attempt timestamp before Twilio call\n patient.last_assessment_reminder_sent = DateTime.now\n patient.save(touch: false)\n threshold_hash = dependent.jurisdiction[:current_threshold_condition_hash]\n message = { prompt: contents, patient_submission_token: dependent.submission_token,\n threshold_hash: threshold_hash }\n messages_array << message\n end\n patient.active_dependents_and_self.each { |pat| add_success_history(pat) } if TwilioSender.send_sms(patient, messages_array)\n end",
"def invalidPatientId\n@patients =Patient.where(\"patient_number =?\",@commands[1])\n\tif @patients.size == 0\n\t\treturn true\t\n\tend \nreturn false\nend",
"def invalidPatientId\n@patients =Patient.where(\"patient_number =?\",@commands[1])\n\tif @patients.size == 0\n\t\treturn true\t\n\tend \nreturn false\nend",
"def invalidPatientId\n@patients =Patient.where(\"patient_number =?\",@commands[1])\n\tif @patients.size == 0\n\t\treturn true\t\n\tend \nreturn false\nend",
"def create\n # Creating the patient with present surgeon\n params[:patient][:owner_id] = devise_current_user.id.to_s\n patient = current_user.patients.new(patient_params)\n # Condition for checking the saved or not\n if patient.save\n # Check the condition of which url is present\n if params[:patient][:prev_url].present?\n # If prev present then navigate to the patients case form\n redirect_to new_patient_case_path(patient)\n else\n # redirect to the patients if prev url not present\n redirect_to patients_path\n end\n else\n # redirect to the same page of the patient new page\n redirect_to :back\n # if the record is not save then navigate to the same page and showing the flash\n flash.notice = \"Need fill out the Essential Fields\"\n end\n end",
"def add_diagnosis_d( name, sym, positive, val )\n add_diagnosis( name, sym, positive, 'd', val.to_f )\n end",
"def patient_does_not_have_dispensation?\n encounter_type = EncounterType.find_by name:DISPENSING\n encounter = Encounter.joins(:type).where(\n 'patient_id = ? AND encounter_type = ? AND DATE(encounter_datetime) = DATE(?)',\n @patient.patient_id, encounter_type.encounter_type_id, @date\n ).order(encounter_datetime: :desc).first\n\n encounter.blank?\n end",
"def index\n @diagnosed_patients = DiagnosedPatient.all\n @diseases = Disease.all\n end",
"def matches_expected? pi\n pi.patient_identifier == expected.patient_identifier &&\n pi.affinity_domain == expected.affinity_domain\n end",
"def normal_patient_with_request_upcomming_cancle_appointment\n\n user = User.find_by_email('new_patient@gmail.com')\n unless user.present?\n # create a user\n user = User.create :first_name => \"patient\", :last_name => \"normal\", :email => 'new_patient@gmail.com', :password => 'abc@12345', :password_confirmation => 'abc@12345', :account_type => 'patient'\n user.save(validate: false)\n # confim it too\n user.update_attributes({confirmation_token: nil, confirmed_at: Time.now})\n # create the patient with this user\n birth = Time.now - SecureRandom.random_number(50).year\n patient = Patient.create :user_id => user.id, :last_name => user.last_name, :first_name => user.first_name, :gender => \"M\", :date_of_birth => birth, :language => \"EN\", :timezone => \"Pacific/Honolulu\", :medical_history => Faker::Lorem.paragraph(2)\n # create patient_isurance\n # patient_insurance = PatientInsurance.create! :patient_id => patient.id, :seq => 1, :subscriber_relationship => [\"P\", \"D\"].sample, :policy_number => \"policy_number\", :group_number => \"group_number\", :group_name => \"group_name\", :subscriber_last_name => Faker::Name.last_name, :subscriber_first_name => Faker::Name.first_name, :subscriber_dob => birth, :subscriber_address1 => Faker::Address.street_address, :subscriber_address2 => Faker::Address.secondary_address , :subscriber_city => Faker::Address.city\n else\n patient = Patient.find_by_user_id(user.id)\n end\n # create 2 therapist for this\n for i in 1..3\n therapist_user = User.create :first_name => Faker::Name.first_name, :last_name => Faker::Name.last_name, :email => Faker::Internet.email, :password => 'abc@12345', :password_confirmation => 'abc@12345', :account_type => 'therapist'\n therapist_user.save(validate: false)\n therapist_user.update_attributes({confirmation_token: nil, confirmed_at: Time.now})\n # create the therapist with this user\n therapist = Therapist.create! :user_id => therapist_user.id, :last_name => therapist_user.last_name, :first_name => therapist_user.first_name, :gender => \"M\", :timezone => \"VN\", :npi_no => [55, 65, 78].sample\n # create 7 appointments with random\n i = 0\n date = Date.today\n while i < 5 do\n past = date.advance(days: -i)\n feature = date.advance(days: i)\n # create 5 cancel appointments\n cancel_apoitment = Appointment.create! :owner_id => user.id, :therapist_id => therapist.id, :patient_id => patient.id, :date => [past, feature].sample, :start_time => \"08:00:00\", :end_time => \"09:00:00\", :status => \"x\", :delete_date => Time.now\n # create 5 past appointments\n past_apoitment = Appointment.create! :owner_id => user.id, :therapist_id => therapist.id, :patient_id => patient.id, :date => past, :start_time => \"08:00:00\", :end_time => \"09:00:00\", :status => [\"c\", \"x\"].sample\n # create 5 request/pending appointments\n pending_appointment = Appointment.create! :owner_id => user.id, :therapist_id => therapist.id, :patient_id => patient.id, :date => feature, :start_time => \"08:00:00\", :end_time => \"09:00:00\", :status => \"p\"\n # create 5 upcomming appointments\n upcomming_appointment = Appointment.create! :owner_id => user.id, :therapist_id => therapist.id, :patient_id => patient.id, :date => feature, :start_time => \"08:00:00\", :end_time => \"09:00:00\", :status => \"c\"\n #Create a relationship if it doesn't exist and there's a patient\n if !upcomming_appointment.patient_id.blank?\n therapist_user_id = Therapist.find(upcomming_appointment.therapist_id)\n patient_user_id = Patient.find(upcomming_appointment.patient_id)\n if !TherapistPatient.has_relation?(therapist_user_id.user_id, patient_user_id.user_id)\n relation = TherapistPatient.new\n relation.therapist_user_id = therapist_user_id.user_id\n relation.patient_user_id = patient_user_id.user_id\n relation.start_date = Time.now\n relation.accepted_on = Time.now\n relation.save\n end\n end\n i += 1\n end\n end\n\n sign_in(user)\n redirect_to appointments_path()\n end",
"def treatment_began_on_is_after_diagnosis_date\n\t\tif !treatment_began_on.blank? && \n\t\t\t!diagnosis_date.blank? && \n\t\t\ttreatment_began_on < diagnosis_date\n#\t\t\terrors.add(:treatment_began_on, \"is before diagnosis_date.\") \n\t\t\terrors.add(:treatment_began_on, ActiveRecord::Error.new(\n\t\t\t\tself, :base, :blank, { \n\t\t\t\t\t:message => \"Date treatment began must be on or after the diagnosis date.\" } ) )\n\t\tend\n\tend",
"def new\n redirect_to(root_url) && return unless current_user.can_create_patient?\n\n dashboard_crumb(params.permit(:nav)[:nav] || (params.permit(:isolation)[:isolation] ? 'isolation' : 'global'), nil)\n @title = 'Enroll New Monitoree'\n\n # If this is a close contact that is being fully enrolled, grab that record to auto-populate fields\n @close_contact = CloseContact.where(patient_id: current_user.viewable_patients).where(id: params.permit(:cc)[:cc])&.first if params[:cc].present?\n\n @patient = Patient.new(jurisdiction_id: current_user.jurisdiction_id,\n isolation: params.permit(:isolation)[:isolation] == 'true',\n first_name: @close_contact.nil? ? '' : @close_contact.first_name,\n last_name: @close_contact.nil? ? '' : @close_contact.last_name,\n primary_telephone: @close_contact.nil? ? '' : @close_contact.primary_telephone,\n email: @close_contact.nil? ? '' : @close_contact.email,\n last_date_of_exposure: @close_contact.nil? ? '' : @close_contact.last_date_of_exposure,\n assigned_user: @close_contact.nil? ? '' : @close_contact.assigned_user,\n contact_of_known_case: !@close_contact.nil?,\n contact_of_known_case_id: @close_contact.nil? ? '' : @close_contact.patient_id,\n exposure_notes: @close_contact.nil? ? '' : @close_contact.notes,\n contact_type: 'Self',\n preferred_contact_method: 'Unknown')\n end",
"def reassociation_trace\n trn_elements = ['TRN', '1', ref_number]\n if @check_amount.to_f > 0 && @check.payment_method == \"EFT\"\n trn_elements << '1' + @facility.facility_tin if @facility.facility_tin.present?\n else\n trn_elements << '1999999999'\n end\n trn_elements.join(@element_seperator)\n end",
"def show\n @patient = @client.patients.find(params[:id]) unless current_user.staff?\n @patient = Patient.find(params[:id]) if current_user.staff?\n \n # Build patient history (table) of cases, examinations and treatments\n @patient_history = []\n @patient.accidents.each do |accident|\n record = []\n record[0] = accident.id\n @patient_history << record if accident.chiropractic_examinations.blank?\n accident.chiropractic_examinations.each do |examination|\n record = []\n record[0] = accident.id\n record[1] = examination.id\n @patient_history << record if examination.chiropractic_treatments.blank?\n examination.chiropractic_treatments.each do |treatment|\n record = []\n record[0] = accident.id\n record[1] = examination.id\n record[2] = treatment.id\n @patient_history << record\n end\n end\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patient }\n end\n end",
"def invoice_possible?\n # 1. facture globale ?\n invoices = Invoice.find :first,\n \t:conditions => ['order_id = ? AND ds_id IS NULL', self.order_id]\n return false if (!invoices.nil?)\n # 2. facture pour cette livraison ?\n invoices = Invoice.find :first, :conditions => ['ds_id = ?', self.id]\n return false if (!invoices.nil?)\n # 3. bon de commande pour cette livraison ?\n return false if (self.order_id.nil?)\n return true\n end",
"def validate_order_detail_unjournaled(order_detail)\n if order_detail.journal_id.present?\n @errors << \"#{order_detail} is already journaled in journal #{order_detail.journal_id}\"\n end\n end",
"def patients \n patients = Patient.all.select do |patient|\n patient.doctor == self\n end\n\n # patients.map do |patient|\n # patient.name\n # end\n end",
"def create_local_order(patient, encounter, date, accession_number)\n Order.create patient: patient,\n encounter: encounter,\n concept: concept('Laboratory tests ordered'),\n order_type: order_type('Lab'),\n orderer: User.current.user_id,\n start_date: date,\n accession_number: accession_number,\n provider: User.current\n end",
"def patient\n insurance_provider.patient\n end",
"def show\n @patient = Patient.find(params[:id])\n @emergency_contacts = @patient.patient_emergency_contacts\n @progress_notes = @patient.progress_notes\n @intake_notes = @patient.intake_notes\n @treatment_plans = @patient.treatment_plans\n @termination_notes = @patient.termination_notes\n end"
] |
[
"0.6589105",
"0.63766426",
"0.63148224",
"0.61355364",
"0.5977252",
"0.5509335",
"0.5509047",
"0.5454047",
"0.544968",
"0.54035056",
"0.5393992",
"0.5331882",
"0.5317752",
"0.53044164",
"0.52860916",
"0.52404547",
"0.5240151",
"0.5237152",
"0.5186199",
"0.51755273",
"0.51698214",
"0.5163395",
"0.5160793",
"0.5148589",
"0.5141139",
"0.5086043",
"0.5079941",
"0.5052196",
"0.5043311",
"0.5027137",
"0.5025805",
"0.5024805",
"0.5008979",
"0.5008979",
"0.500102",
"0.49889797",
"0.4974497",
"0.4971004",
"0.49677682",
"0.49545804",
"0.49544087",
"0.49539834",
"0.49499467",
"0.4938562",
"0.4933461",
"0.49291748",
"0.49136612",
"0.49110436",
"0.49097544",
"0.4907358",
"0.49063966",
"0.48897654",
"0.48874232",
"0.48810875",
"0.48727244",
"0.487145",
"0.48690474",
"0.48664665",
"0.48647332",
"0.48616517",
"0.48432025",
"0.4842882",
"0.48412347",
"0.48397082",
"0.48330334",
"0.48213482",
"0.48153087",
"0.4804521",
"0.48023126",
"0.47937816",
"0.47933277",
"0.47918123",
"0.47915348",
"0.47878993",
"0.4787331",
"0.47840744",
"0.4782701",
"0.47767386",
"0.47699094",
"0.4769107",
"0.47672302",
"0.47664618",
"0.47608912",
"0.47608912",
"0.47608912",
"0.4758672",
"0.47536466",
"0.47409502",
"0.47347677",
"0.4733935",
"0.47296393",
"0.4722949",
"0.47221404",
"0.47191578",
"0.47094992",
"0.4705519",
"0.47021526",
"0.4699714",
"0.46976393",
"0.46962422",
"0.4693847"
] |
0.0
|
-1
|
iterate over the character hash to find the collection of `films` for the given `character` collect those film API urls, make a web request to each URL to get the info for that film return value of this method should be collection of info about each film. i.e. an array of hashes in which each hash reps a given film this collection will be the argument given to `parse_character_movies` and that method will do some nice presentation stuff: puts out a list of movies by title. play around with puts out other info about a given film
|
def parse_character_movies(films_hash)
films_hash.each_with_index do | film, index |
puts "#{index + 1} #{film["title"]}"
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show_character_movies(character)\n urls_of_films = get_character_movies_from_api(character)\n films_hash = add_film_urls(urls_of_films)\n parse_character_movies(films_hash)\nend",
"def get_character_movies_from_api(character_name)\n #make the web request\n\n response_string = RestClient.get('http://www.swapi.co/api/people/')\n response_hash = JSON.parse(response_string)\n\n counter = 1\n films = []\n\n\n while films.size <= 1 do\n\n response_hash[\"results\"].find do |item_name|\n\n if item_name[\"name\"].downcase == character_name.downcase\n films = item_name[\"films\"]\n puts \"Film found\"\n films.collect! do |film_url|\n response_film_url = RestClient.get(film_url)\n response_film_url_hash = JSON.parse(response_film_url)\n response_film_url_hash[\"title\"]\n end\n puts \"Film Convert\"\n return films\n elsif response_hash[\"next\"] == nil\n return puts \"Character not found.\"\n end\n\n counter += 1\n\n response_string = RestClient.get(response_hash[\"next\"])\n response_hash = JSON.parse(response_string)\n end\nend\n\n\n #films = []\n #response_hash[\"results\"].find do |item_name|\n #\n # if item_name[\"name\"].downcase == character_name.downcase\n # films = item_name[\"films\"]\n # end\n #end\n\n #if response_hash[\"results\"][0][\"name\"].downcase == character_name\n # films = response_hash[\"results\"][0][\"films\"]\n #end\n\n #films.collect! do |film_url|\n # response_film_url = RestClient.get(film_url)\n # response_film_url_hash = JSON.parse(response_film_url)\n # response_film_url_hash[\"title\"]\n #end\n\n\n\n\n # iterate over the response hash to find the collection of `films` for the given\n # `character`\n # collect those film API urls, make a web request to each URL to get the info\n # for that film\n # return value of this method should be collection of info about each film.\n # i.e. an array of hashes in which each hash reps a given film\n # this collection will be the argument given to `print_movies`\n # and that method will do some nice presentation stuff like puts out a list\n # of movies by title. Have a play around with the puts with other info about a given film.\nend",
"def parse_character_movies(character)\n get_character_movies_from_api(character).collect do |film_name|\n film_resp_string = RestClient.get(film_name)\n JSON.parse(film_resp_string)\n end \n response_hash[\"results\"].each do |hash|\n if character == hash[\"name\"]\n desired_films = hash[\"films\"]\n end\nend\n desired_films\nend",
"def get_movie_characters_from_api(movie)\nmovie_hash = make_search('http://www.swapi.co/api/films/')\ncharacters_array = []\n movie_hash[\"results\"].each do |item|\n if item[\"title\"].downcase == movie\n item[\"characters\"].each do |character| #urls \n character_info_hash = make_search(character)\n characters_array << character_info_hash\n end \n end\n end \n #characters_array #all the info on films an array of hashes\n parse_movie_character(characters_array)\nend",
"def get_character_movies_from_api(character)\n film_urls = get_film_urls(character)\n film_urls.collect do |movie_url|\n look_up(movie_url)\n end\nend",
"def show_character_movies(character)\n films_hash = get_character_movies_from_api(character) #returns films list/url\n parse_character_movies(films_hash)\nend",
"def get_character_movies_from_api(character)\n #make the web request\n page = 1\n # iterate over the character hash to find the collection of `films` for the given\n # `character`\n # collect those film API urls,\n until page == 10\n all_characters = RestClient.get(\"https://swapi.co/api/people/?page=#{page}\")\n character_hash = JSON.parse(all_characters)\n\n character_hash[\"results\"].each do |value|\n if value[\"name\"] == character\n films_hash = value[\"films\"]\n end\n end\n page +=1\n end\n\nend",
"def show_character_movies(character)\n films_hash = get_character_movies_from_api(character)\n parse_character_movies(films_hash)\nend",
"def show_character_movies(character)\n get_character_movies_from_api(character)\n # parse_character_movies(films_hash)\nend",
"def show_character_movies(character)\n films_hash = get_character_movies_from_api(character)\n\n if films_hash\n parse_character_movies(films_hash)\n else\n puts \"Cannot find character\"\n end\nend",
"def get_film_urls(character)\n character_hash = look_up('http://www.swapi.co/api/people/')\n film_urls = character_hash[\"results\"].find do |element|\n element[\"name\"].downcase == character\n end[\"films\"]\nend",
"def get_character_movies_from_api(character)\n all_characters = RestClient.get('http://www.swapi.co/api/people/')\n character_hash = JSON.parse(all_characters)\n\n results = []\n still_searching = true\n\n while still_searching\n results << character_hash[\"results\"] # results pushed into results array on every loop iteration\n if character_hash[\"next\"]\n next_page = RestClient.get(character_hash[\"next\"])\n character_hash = JSON.parse(next_page)\n else\n still_searching = false\n end\n end\n\n results = results.flatten\n results = results.select {|chara| chara[\"name\"].downcase == character}\n # results is an array containing a hash\n\n if results.length > 0\n film_hash = results[0][\"films\"].map do |film_url|\n film = RestClient.get(film_url)\n film = JSON.parse(film)\n end\n end\nend",
"def get_character_movies_from_api(character)\n #make the web request\n all_characters = RestClient.get('http://www.swapi.co/api/people/')\n character_hash = JSON.parse(all_characters)\n film_urls = get_film_urls(character_hash, character)\n\n parse_character_movies(parse_films(film_urls))\nend",
"def parse_character_movies(films_hash)\n # some iteration magic and puts out the movies in a nice list\nend",
"def get_character_movies_from_api(character)\n #make the web request\n all_characters = RestClient.get('http://www.swapi.co/api/people/')\n character_hash = JSON.parse(all_characters)\n\n person_hash = []\n character_hash.each do |key, value|\n if key == \"results\"\n value.each do |info|\n if info[\"name\"].downcase == character.downcase\n person_hash = info\n binding.pry\n end\n end\n end\n end\n\n film_info = []\n films.each do |film_url|\n film_info.push(JSON.parse(RestClient.get(film_url)))\n end\n new_character = Character.new(person_hash)\nend",
"def find_films(character)\n target = find_character(character) #hash\n if target == nil\n return \"Please enter correct character name.\"\n else\n films_of_character = target[\"films\"]#an array of movies URLs\n end\nend",
"def character_movies(character)\n output = []\n all_characters = RestClient.get('http://www.swapi.co/api/people/')\n character_hash = JSON.parse(all_characters)\n results = character_hash[\"results\"]\n results.each do |person|\n if person[\"name\"].downcase == character\n output = person[\"films\"]\n end\n end\n return output\nend",
"def show_character_movies(character)\n films = get_character_movies_from_api(character)\n print_movies(films)\nend",
"def show_character_movies(character)\n if get_characters.include? character\n films_hash = get_character_movies_from_api(character)\n puts parse_character_movies(films_hash)\n else\n puts \"Have you even seen the movies?\"\n end\nend",
"def get_movies_of_specific_character(specific_character_data)\n specific_character_films = specific_character_data.first[\"films\"]\nend",
"def get_movies_data(character_data)\n if character_data\n character_films = character_data[\"films\"]\n movie_response_string = character_films.map {|film_url| RestClient.get(film_url)}\n movie_response_string.map {|response_string| JSON.parse(response_string)}\n else\n nil\n end\nend",
"def show_character_movies(character)\n films = get_character_movies_from_api(character)\n #print_movies(films)\nend",
"def movie_array(character)\n films_array = get_char_hash(character)[\"films\"]\n films_array.map do |movie_url|\n movie_info(movie_url)[\"title\"]\n end\nend",
"def parse_character_movies(films_hash)\n # some iteration magic and puts out the movies in a nice list\n return_array = []\n films_hash.each do |film|\n return_array.push(film[1][\"title\"])\n\n end\n return_array\nend",
"def get_character_movies_from_api(character)\n #make the web request\n link = \"http://www.swapi.co/api/people/\"\n character_hash = parse_json(link)\n link = character_hash[\"next\"]\n\n while link != nil\n character_hash[\"results\"] = character_hash[\"results\"].replace(parse_json(link)[\"results\"])\n break if check_for_character(character_hash[\"results\"], character)\n link = parse_json(link)[\"next\"]\n end\n\n char = get_character_info(character_hash, character)\n\nend",
"def get_character_movies_from_api(character)\n #make the web request\n all_characters = RestClient.get('http://www.swapi.co/api/people/') # web request\n character_hash = JSON.parse(all_characters)\n\n arr = nil\n character_hash[\"results\"].each do |key|\n if key[\"name\"] == character\n arr = key[\"films\"]\n end\n end\narr\nend",
"def show_character_movies(character)\n films = get_character_movies_from_api(character)\n print_movies(films)\n\n\n\nend",
"def parse_character_movies(films_hash)\n films_hash.collect do |movie|\n movie[\"title\"]\n end\nend",
"def parse_character_movies(films_hash)\n films_hash.each do |film|\n puts \"*\" * 20\n puts \"Title: #{film_title(film)}\"\n puts \"Episode: #{film_episode(film)}\"\n puts \"Director: #{film_director(film)}\"\n puts \"Producer(s): #{film_producer(film)}\"\n puts \"Release Date: #{film_release_date(film)}\"\n end\nend",
"def parse_character_movies(films_hash)\n # some iteration magic and puts out the movies in a nice list\nall_movie_title=[]\nall_movie_descr=[]\n films_hash.map do |urls|\n movie = RestClient.get(urls)\n json = JSON.parse(movie)\n all_movie_title << json[\"title\"]\n all_movie_descr << json[\"opening_crawl\"]\n end\n\n # films_hash.map do |urls|\n # movie = RestClient.get(urls)\n # json = JSON.parse(movie)\n # all_movie_descr << json[\"opening_crawl\"]\n\n #end\n movie_hash={}\n all_movie_title.zip(all_movie_descr) do |key,value|\n movie_hash[key.to_sym]=value\n end\n movie_hash.each do |key,value|\n puts \"\\n Title: #{key.to_s} \\n Desciption: #{value.to_s} \\n\"\n\n #puts \"Desciption: #{value.to_s} \\n\"\n end\n#binding.pry\n #all_movie\n\nend",
"def get_character_movies_from_api(name)\n parsed_data = get_results_array\n films = []\n parsed_data.map do |result_instance|\n if result_instance[\"name\"] == name \n # puts result_instance[\"name\"]\n films = result_instance[\"films\"]\n end\n end\n film_array = []\n films.map do |film_instance|\n film_data = RestClient.get(film_instance)\n parsed_film = JSON.parse(film_data)\n film_array << parsed_film\n end \n puts film_array\n\nend",
"def parse_character_movies(films_hash)\n films_hash.each do |film|\n puts # blank line\n puts \"Your character appears in:\"\n puts \"Star Wars Episode #{film[\"episode_id\"]}\"\n puts film[\"title\"]\n puts film[\"opening_crawl\"]\n end\nend",
"def get_character_films_array(character_hash, character)\n character_films_array = []\n character_hash[\"results\"].each do |char|\n if character == char[\"name\"]\n character_films_array = char[\"films\"]\n end\n end\n character_films_array\nend",
"def get_all_character_apis\n\t\t\tjson(@@movie_api)[\"results\"].map { |movie| movie[\"characters\"]}.flatten\n end",
"def parse_character_movies(films_array) #films_hash\n count = 1\n films_array.each do |current_film|\n puts \"#{count}. #{current_film['title']}, released: #{current_film['release_date']}\"\n count += 1\n end\nend",
"def print_movies(films)\n list = films.map do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n response_hash[\"title\"]\n end\n puts list\n # some iteration magic and puts out the movies in a nice list\nend",
"def parse_character_movies(films_hash)\n # binding.pry\n films_hash.each_with_index do |movie_url, num|\n get_movie_info = RestClient.get(movie_url)\n movie_info = JSON.parse(get_movie_info)\n title = movie_info[\"title\"]\n puts \"#{num+1}. #{title}\"\n end\n\nend",
"def get_all_characters(page=nil)\n\n if page\n response = RestClient.get(page)\n else\n response = RestClient.get(\"https://swapi.co/api/people\")\n end\n characters_array = JSON.parse(response.body)[\"results\"]\n\n characters_array.each do |character|\n StarWarsCliApi::Character.new(character)\n end\n\n # next_page = JSON.parse(response.body)[\"next\"]\n # if next_page\n # get_all_characters(next_page)\n # end\n end",
"def show\n @films_all = HTTParty.get('https://swapi.co/api/films',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_1 = HTTParty.get('https://swapi.co/api/people',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_2 = HTTParty.get('https://swapi.co/api/people/?page=2',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_3 = HTTParty.get('https://swapi.co/api/people/?page=3',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_4 = HTTParty.get('https://swapi.co/api/people/?page=4',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_5 = HTTParty.get('https://swapi.co/api/people/?page=5',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_6 = HTTParty.get('https://swapi.co/api/people/?page=6',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_7 = HTTParty.get('https://swapi.co/api/people/?page=7',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_8 = HTTParty.get('https://swapi.co/api/people/?page=8',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @characters_all_9 = HTTParty.get('https://swapi.co/api/people/?page=9',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @starships_all_1 = HTTParty.get('https://swapi.co/api/starships',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @starships_all_2 = HTTParty.get('https://swapi.co/api/starships/?page=2',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @starships_all_3 = HTTParty.get('https://swapi.co/api/starships/?page=3',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @starships_all_4 = HTTParty.get('https://swapi.co/api/starships/?page=4',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_1 = HTTParty.get('https://swapi.co/api/planets',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_2 = HTTParty.get('https://swapi.co/api/planets/?page=2',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_3 = HTTParty.get('https://swapi.co/api/planets/?page=3',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_4 = HTTParty.get('https://swapi.co/api/planets/?page=4',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_5 = HTTParty.get('https://swapi.co/api/planets/?page=5',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_6 = HTTParty.get('https://swapi.co/api/planets/?page=6',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n @planets_all_7 = HTTParty.get('https://swapi.co/api/planets/?page=7',\n :headers =>{'Content-Type' => 'application/json'} )['results']\n\n\n\n\n \n @planet = HTTParty.get(\"https://swapi.co/api/planets/#{params[:id]}\",\n :headers =>{'Content-Type' => 'application/json'} )\n\n @characters = []\n @planet['residents'].each do |cha|\n cha_id = cha.split('/')[5]\n @characters.push(HTTParty.get(\"https://swapi.co/api/people/#{cha_id}\",\n :headers =>{'Content-Type' => 'application/json'} ))\n end\n\n @films = []\n @planet['films'].each do |film|\n film_id = film.split('/')[5]\n @films.push(HTTParty.get(\"https://swapi.co/api/films/#{film_id}\",\n :headers =>{'Content-Type' => 'application/json'} ))\n end\n\n end",
"def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film_hash|\n puts film_hash[\"title\"]\n end\nend",
"def find_films_for_each_customer()\n sql = \"SELECT films.*\n FROM films\n INNER JOIN tickets\n ON tickets.film_id = films.id\n WHERE customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = films.map {|film| Film.new(film)}\n return result\n end",
"def get_character_info(character,response_hash)\n #response_string = RestClient.get('http://www.swapi.co/api/people/')\n #response_hash = JSON.parse(response_string)\n response_hash[\"results\"].each do |value|\n #/iterate over each element and check if value of the name key is equal to user input\n #binding.pry\n if value[\"name\"].downcase == character\n return value[\"films\"]\n end\n end\nend",
"def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON tickets.film_id = films.id WHERE customer_id = $1\"\n values = [@id]\n film_data = SqlRunner.run(sql, values)\n return Film.map_items(film_data)\n end",
"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 films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON\n films.id = tickets.film_id WHERE tickets.customer_id = $1;\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = Film.map_films(films)\n end",
"def get_characters\n character_hash = look_up('http://www.swapi.co/api/people/')\n character_hash[\"results\"].collect do |element|\n element[\"name\"]\n end\nend",
"def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n puts response_hash[\"title\"]\n end\nend",
"def print_movies(films_hash)\n#binding.pry\n films_hash.each do |film|\n\n # some iteration magic and puts out the movies in a nice list\n movie = RestClient.get(film)\n movie_hash = JSON.parse(movie)\n puts movie_hash[\"title\"]\n\n\n #movie_hash[\"results\"].each do |title|\n end\n\nend",
"def get_characters_from_api\n #establish initial url from api\n url = 'http://www.swapi.co/api/people/'\n #get all data from first page of API\n page_of_characters = JSON.parse(RestClient.get(url))\n all_characters = page_of_characters\n \n next_call = page_of_characters[\"next\"]\n\n while next_call do\n next_page = next_call\n next_page_of_characters = JSON.parse(RestClient.get(next_page))\n (all_characters[\"results\"] << next_page_of_characters[\"results\"])\n next_call = next_page_of_characters[\"next\"]\n end\n\n all_characters\nend",
"def customers_for_film()\n sql = \"SELECT name FROM customers\n INNER JOIN tickets ON customers.id = tickets.customer_id\n WHERE film_id = $1 ORDER BY name\"\n values = [@id]\n customer_data = SqlRunner.run(sql, values)\n return Customer.map_items(customer_data)\n end",
"def movies\n CharacterMovieActing.all.filter do |cma|\n cma.character == self\n end.map do |cm|\n cm.movie\n end\n end",
"def print_movies(films)\n films.each do |film|\n puts film[\"title\"]\n end\nend",
"def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n films_array = SqlRunner.run(sql, values)\n films = films_array.map { |film_hash| Film.new(film_hash)}\n return films\n end",
"def get_info_on_films(film_array) \n film_array.map do |film|\n film_info = JSON.parse(RestClient.get(film))\n film_info\n end\nend",
"def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map {|film| Film.new(film)}\n end",
"def movies\n char_movies = Char_Movie.all.select{ |char_movie| char_movie.character.actor == self}\n char_movies.collect{ |char_movie| char_movie.movie }\n end",
"def parse_character_movies(films_hash)\n # some iteration magic and puts out the movies in a nice list\n print_film_array = []\n films_hash.each_with_index do |film, index|\n print_film_array << \"Episode #{film[\"episode_id\"]} #{film[\"title\"]}\"\n end\n puts print_film_array.sort\n puts \"\\n\"\nend",
"def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.customer_id = $1;\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map{|film| Film.new(film)}\n end",
"def films()\n sql = \"SELECT films.* FROM films INNER JOIN tickets ON films.id = tickets.film_id WHERE tickets.cust_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n return films.map{|film| Film.new(film)}\n end",
"def show_character_stats(character,user_choice)\n #retrieve stat from api\n #stat can either be a string containing stat, a URL or array of URL's\n stat = get_character_stats_from_api(character, user_choice)\n #homeworld stat is a URL\n if user_choice == \"homeworld\"\n #get response from homeworld URL\n response_hash = get_response(stat)\n #display the homeworld name\n puts response_hash[\"name\"]\n puts\"*****************\\n\"\n\n elsif user_choice == \"films\"#get response from homeworld URL\n #get response from film URL\n #get name for each film and film array\n parsed_stats = parse_character_stats(stat, \"title\")\n print_stats(parsed_stats)\n\n elsif user_choice == \"species\"\n #get response from species URL\n parsed_stats = parse_character_stats(stat, \"name\")\n print_stats(parsed_stats)\n\n else\n \n puts stat\n puts \"*****************\\n\"\n end\n\nend",
"def films()\n sql = \"SELECT films.* FROM films\n INNER JOIN tickets ON tickets.film_id = films.id\n WHERE tickets.customer_id = $1\"\n values = [@id]\n film_array = SqlRunner.run(sql, values)\n result = film_array.map { |film| Film.new( film ) }\n return result\n end",
"def films()\n sql = \"\n SELECT films.* FROM films\n INNER JOIN tickets ON tickets.film_id =\n films.id WHERE customer_id = $1\n \"\n values = [@id]\n result = SqlRunner.run(sql, values)\n\n return nil if result.count == 0\n return result.map {|film| Film.new(film)}\n end",
"def search_for_chars\n results = []\n response = client.characters(:nameStartsWith => user_search)\n response[\"data\"][\"results\"].each do |result|\n options = {}\n options[\"name\"] = result[\"name\"]\n if result[\"description\"] == \"\"\n options[\"description\"] = \"No description found\"\n else\n options[\"description\"] = result[\"description\"]\n end\n options[\"popularity\"] = result[\"comics\"][\"available\"]\n options[\"image\"] = result[\"thumbnail\"][\"path\"] + \".\" + result[\"thumbnail\"][\"extension\"] if result[\"thumbnail\"] != nil\n options[\"user_id\"] = user_id\n options[\"team_id\"] = 0\n results << Character.new(options)\n end\n results \n end",
"def fetchMovieData(movieID)\n puts \"HITTING THE NET\"\n #Construct the URL used to access the API\n url = \"http://api.themoviedb.org/3/movie/#{movieID}?api_key=#{$apiKey}\"\n #Preform a restful request to get the information\n #Uses the RestClient gem to preform the request\n data = RestClient.get(url)\n #Parse the JSON to get a simple hash (key value pairs) of info\n #Uses the JSON gem to avoid manual parsing\n data = JSON.parse(data)\n\n #Reformat some data to make it easier to work with later\n #2015-04 BN: added a translation step so that apostrophes, like \"he's\" willl get \n # passed correctly\n data[\"description\"] = data[\"overview\"][0..249]\n\n \n #Get the information that was not included in the first API call\n #Rating and date info\n ratingAndDate = fetchMovieRatingAndYear(movieID)\n #Add this data to the hash before returning it\n data[\"contentRating\"] = ratingAndDate[\"certification\"]\n data[\"year\"] = Date.parse(ratingAndDate[\"release_date\"]).year.to_s\n\n #Fetch the movie directors and actors and add them to the hash\n data[\"artist\"] = fetchMovieCast(movieID)\n data[\"directors\"] = fetchMovieDirectors(movieID)\n return data\nend",
"def show_films\n sql = \"SELECT films.* FROM films INNER JOIN screenings ON screenings.film_id = films.id INNER JOIN tickets on screenings.id = tickets.screening_id INNER JOIN customers on customers.id = tickets.customer_id WHERE customers.id = $1\"\n values = [@id]\n result = SqlRunner.run(sql, values)\n return result.map {|film| Film.new(film)}\n end",
"def fetch_all_characters\n if Character.count <= 126\n\n clients = Lol::Client.new ENV[\"RIOT_API_KEY\"], {region: \"euw\"}\n @lore = clients.static.champion.get(champData: 'lore')\n\n @client = Taric.client(region: :oce)\n characters = @client.static_champions[\"data\"]\n\n characters.each do |char|\n\t Character.create :name => \"#{char[1]['name']}\", :image => \"http://ddragon.leagueoflegends.com/cdn/5.13.1/img/champion/#{char[1]['key']}.png\"\n end\n\n @characters = Character.all\n @lore.each_with_index do |lore, i|\n @characters[i].update :lore => lore['lore']\n # Character.save :lore => \"#{lore['lore']}\"\n end\n end\n end",
"def films()\n sql = \"SELECT DISTINCT films.* FROM films\n INNER JOIN screenings ON films.id = screenings.film_id\n INNER JOIN tickets ON screenings.id = tickets.screening_id\n WHERE tickets.customer_id = $1;\"\n values = [@id]\n films_array = SqlRunner.run(sql, values)\n return Film.map_to_objects(films_array)\n end",
"def fetchMovieCast(movieID)\n #Construct the URL used to access the API\n url = \"http://api.themoviedb.org/3/movie/#{movieID}/credits?api_key=#{$apiKey}\"\n #RESTful request\n data = JSON.parse(RestClient.get(url))\n #Extract the cast data from the returned results\n castData = data[\"cast\"]\n #Remove everything except the names of the actors, maintaining the order\n #This line is converting an array of hashes into an array of strings\n #by mapping the values that correspond to the key \"name\" for each hash in \n #the array to the output array\n castNames = castData.map{ |castMember| castMember[\"name\"]}\n #Grab just the first three of the actors and then join them on the string \", \"\n return castNames[0..$numActors-1].join(\", \")\nend",
"def films\n sql = \"SELECT films.*\n FROM films\n INNER JOIN tickets\n ON films.id = tickets.film_id\n WHERE tickets.customer_id = $1\"\n values = [@id]\n SqlRunner.run(sql, values).map { |film_hash| Film.new(film_hash) }\n end",
"def movie_info(movie_url)\n movie_hash = get_movies_from_api\n movie_hash[\"results\"].find do |movie_info|\n movie_info[\"url\"] == movie_url\n end\nend",
"def get_movie_info(movie_title)\n #page = HTTParty.get('http://www.imdb.com/title/tt0119081/')\n page = HTTParty.get(movie_title)\n # this is where we transform our http response into a nokogiri object so that we can parse it\n parse_page = Nokogiri::HTML(page)\n #now we grab the HTML content we want\n #GET TITLE\n movie_name = parse_page.xpath('//h1').text.strip\n p \"this is the movie_name \" + movie_name\n\n #GET Director\n director = parse_page.css('.credit_summary_item').text.gsub(\"\\n\",'').gsub(\"Director:\",\"\").strip\n director = director.split(\" \")[0]\n p \"this is the direcor \" + director\n\n\n #GET actors\n actors = []\n\n actor_1 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[2]/div[1]/div[4]/span[1]/a/span').inner_html\n actor_2 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[2]/div[1]/div[4]/span[2]/a/span').inner_html\n actor_3 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[2]/div[1]/div[4]/span[3]/a/span').inner_html\n p actors\n if actor_1 == \"\"\n p \"actors are NOT defined! ! ! \"\n actor_1 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[1]/div[4]/span[1]/a/span').inner_html\n actor_2 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[1]/div[4]/span[2]/a/span').inner_html\n actor_3 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[1]/div[4]/span[3]/a/span').inner_html\n else\n p \"it's all good homie.. here is actor _1 \"\n p actor_1\n end\n\n actors = [actor_1, actor_2, actor_3]\n\n p \"these are the main actors... \"\n p actors\n\n # characters = []\n # # char_1 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[16]/td[4]/div/a')\n # char_1 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[2]/td[4]/div/a').inner_html\n # char_2 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[2]/td[4]').inner_html\n # # character_2 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[3]/td[4]/div/a').inner_html\n # character_3 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[4]/td[4]/div/a').inner_html\n # characters = [character_1, character_2, character_3]\n # p \"this the main characters... \"\n # p char_2\n\n # get rating\n rating = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[2]/div[2]/div/div[1]/div[1]/div[1]/strong/span').inner_html\n p \"this is the rating\"\n p rating\n new_rating = (rating.to_f)/10\n p \"this is the new rating\"\n p new_rating\n #GET TIME\n time = parse_page.xpath('//time').text.gsub(\"\\n\",'').strip[-7, 7]\n p \"this the time ... \"\n p time\n\n #GET plot\n # plot = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[1]/p').inner_html.gsub(\"\\n\",\" \")\n # plot = plot.split('<em', 2)\n # plot = plot[0].split('.',2)\n # plot_words = plot[1].scan(/\\w+ \\w+/)\n\n #GET keywords\n keywords = []\n kw_1 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[1]/span').inner_html\n kw_2 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[2]/span').inner_html\n kw_3 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[3]/span').inner_html\n kw_4 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[4]/span').inner_html\n keywords = [ kw_1,kw_2, kw_3, kw_4]\n p \"these are the keywords : \"\n p keywords\n\n # get tagline\n # tagline = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[3]').text\n # tagline = tagline.gsub(\"\\n\",\" \")\n # tagline = tagline.rpartition(\"Taglines:\")[2]\n # tagline = tagline.split(\"See more\")[0]\n\n\n #get review\n # review_page = movie_title.split('?', 2)\n # review_page = review_page[0] << \"reviews?ref_=tt_urv\"\n #\n # page = HTTParty.get(review_page)\n # # this is where we transform our http response into a nokogiri object so that we can parse it\n # parse_page = Nokogiri::HTML(page)\n # review = parse_page.xpath('//*[@id=\"tn15content\"]/p[10]').text.gsub(\"\\n\",\" \")\n\n\n movie_info = {\n time: time,\n actors: actors,\n # plot: plot,\n keywords: keywords,\n # characters: characters,\n director: director,\n movie_name: movie_name,\n # review: review,\n new_rating: new_rating,\n # tagline: tagline,\n }\n\n rescue\n end",
"def movies\n movie_characters = MovieCharacter.all.select {|movie_character| movie_character.character == self}\n movie_characters.map {|movie_character| movie_character.movie}\n end",
"def scrape_movie(url)\n html_doc = parse_url(url)\n\n pattern = /^(?<title>.+)[[:space:]]\\((?<year>\\d{4})\\)$/\n\n match_data = html_doc.search(\"h1\").text.strip.match(pattern)\n title = match_data[:title]\n year = match_data[:year].to_i\n storyline = html_doc.search(\".summary_text\").text.strip\n director = html_doc.search(\".credit_summary_item a\").first.text\n\n cast_div = html_doc.search(\".credit_summary_item\")\n\n # cast = []\n # cast_div.last.search(\"a\").take(3).each do |element|\n # cast << element.text\n # end\n\n cast = cast_div.last.search(\"a\").take(3).map do |element|\n element.text\n end\n\n {\n title: title,\n year: year,\n storyline: storyline,\n director: director,\n cast: cast\n }\nend",
"def fetch_list_characters\n response_string = RestClient.get('http://www.swapi.co/api/people/')\n response_hash = JSON.parse(response_string)\n\n character = response_hash[\"results\"].map {|char| char[\"name\"]}\nend",
"def get_movies_by_film(title)\n all_movies = RestClient.get('http://www.swapi.co/api/films/')\n movies_hash = JSON.parse(all_movies)\n\n results = movies_hash[\"results\"].select {|movie| movie[\"title\"].downcase == title}\n # results is an array containing a hash\n\n if results[0].length > 0\n puts \"Title: #{results[0][\"title\"]}\"\n puts \"Director: #{results[0][\"director\"]}\"\n puts \"Release Date: #{results[0][\"release_date\"]}\"\n else\n puts \"Movie not found\"\n end\nend",
"def print_movies(films)\n films.each do |single_film| #films is a hash, single_fiml is an array\n puts \"The movie name is #{single_film[\"title\"]} and the director of this movie is #{single_film[\"director\"]}.\"\n end\nend",
"def movies_with_director_key(name, movies_collection)\n \n results_arr = [] # Delcare and initalize empty hash\n \n movies_collection.length.times do |movie| # Traverse through movie collection\n # Push the hash returned from the movie_with_director_name onto the empty array results_arr\n results_arr << movie_with_director_name(name,movies_collection[movie]) \n end\n\n results_arr\nend",
"def films_customer_sees()\n sql = \"SELECT * FROM films INNER JOIN tickets\n ON films.id = tickets.film_id WHERE customer_id = $1\"\n values = [@id]\n films = SqlRunner.run(sql, values)\n result = films.map {|film_hash| Film.new(film_hash)}\n return result\nend",
"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 actors_by_show\n @shows.flat_map do |character, actor|\n character.actors\n end\n\n end",
"def get_film_info(film_link_array)\n film_link_array.map do |film_link|\n #puts film_link\n film_info = RestClient.get(film_link)\n film_info_hash = JSON.parse(film_info)\n end\nend",
"def scrape_recent\n\t\trecent_movies = []\n\t\tscraper = MetacriticScraper.new\n\n\t\t# import file with recent reviews hash that shows movie-uri and number of reviews\n\t\trecent_movie_links = scraper.scrape_recent_movies\n\t\trecent_movie_links.each_with_index do | movie_link, i |\n\t\t\tmovie_uri = movie_link.attributes[\"href\"].value\n\t\t\treviews = scraper.scrape_one_movies_reviews(\"http://www.metacritic.com#{movie_uri}\")\n\t\t\tsave_data(reviews, movie_uri)\n\t\tend\n\tend",
"def movies_with_director_key(name, movies_collection)\n new_collection = []\n i = 0\n while i < movies_collection.length do\n movie_info = movies_collection[i]\n new_collection << movie_with_director_name(name, movie_info)\n i += 1 \n end\n return new_collection # {director => [array of movies]}\nend",
"def movies_with_director_key(name, movies_collection)\n mwd_aoh = []\n index = 0\n while index < movies_collection.length do\n mindex = 0\n while mindex < movies_collection[index][:movies].length do\n movie_name = movies_collection[index][:movies][mindex]\n mwd_aoh << movie_with_director_name(name, movie_name)\n mindex += 1\n end\n index += 1\n end\n mwd_aoh\nend",
"def movies\n @movies ||= parse_movie_infos\n end",
"def load_movie_details (movies)\n\t\tmovies.each do |movie|\n\t\t\tload_ratings(movie)\n\t\t\tload_reviews(movie)\n\t\t\tload_genres(movie)\n\t\tend\n\t\treturn movies\n\tend",
"def show\n tmdb_id = @movie.tmdb_id\n # mongo_movie = @cli[:TMDBMovies].find(:id => tmdb_id).first\n # @posters = mongo_movie[\"posters\"].uniq.take 5\n # videos = mongo_movie[\"youtube_trailers\"]\n # @urls = videos.map {|v| v[\"urL\"]}\n @crews = @movie.crew_relations.includes(:person).to_a\n @crews = @crews.take 5\n #@workers = @movie.crews\n @crews.sort_by! {|crew| crew.job} \n @casts = @movie.cast_relations.includes(:person).to_a\n @casts.reject! {|cast| cast.character.size == 0}\n @casts.sort_by! {|cast| cast.order}\n num = @movie.genres.size\n if num > 0\n rnd = Random.new\n offset = rnd.rand(num)\n @genre = @movie.genres[offset]\n @related_movies = @genre.movies.take 6\n @related_movies = @related_movies- [@movie]\n if @related_movies.size > 5\n @related_movies = @related_movies.take 5\n end\n else \n @related_movies = []\n end \n #@actors = @movie.casts\n end",
"def movies_with_director_key(name, movies_collection)\n # GOAL: For each Hash in an Array (movies_collection), provide a collection\n # of movies and a directors name to the movie_with_director_name method\n # and accumulate the returned Array of movies into a new Array that's\n # returned by this method.\n #\n # INPUT:\n # * name: A director's name\n # * movies_collection: An Array of Hashes where each Hash represents a movie\n #\n # RETURN:\n #\n # Array of Hashes where each Hash represents a movie; however, they should all have a\n # :director_name key. This addition can be done by using the provided\n # movie_with_director_name method\n \n array = []\n \n \n # pp name\n # pp movies_collection\n \n i = 0\n while i < movies_collection.length\n array[i] = movie_with_director_name(name, movies_collection[i])\n i += 1\n end\n\n array\nend",
"def movies\n # .each - visit everything once\n # .select - select only some whole things\n # .filter - synonym for select\n # .reject - opposite of select/filter\n # .map - 1:1 transformation of array\n # turns each one thing into something\n # given: [1, 2, 3].map {|n| n*n} \n # get: [1, 4, 9]\n self.showings.map do |showing|\n showing.movie\n end.uniq\n end",
"def movies_with_director_key(name, movies_collection)\n dir_movie_array = []\n movie_index = 0\n while movie_index < movies_collection.length do\n dir_movie_array << movie_with_director_name(name, movies_collection[movie_index])\n movie_index += 1\n end\n dir_movie_array\nend",
"def films\n self.screenings.map do |screening|\n screening.festival.title\n end\n end",
"def movie_search\n\n puts \"Please enter the name of the movie you would like to search\"\n input = gets.chomp\n system \"clear\"\n query_response = RestClient.get(\"http://www.omdbapi.com/?s=#{input}&apikey=a2d3299b\") #send query to database to search for movies containing the the user's input in the title\n\n parsed_response = JSON.parse(query_response) #parse the response into a hash\n\n movie_results = parsed_response[\"Search\"].map do |movie| #iterate through the hash and extract the movie titles into an array\n movie[\"Title\"] \n end\n puts \"Your search returned the following results:\"\n\n #todo !iterate through the hash again (movie_reslts) to get the release year of each movie\n movie_years = parsed_response[\"Search\"].map do |movie| #iterate through the hash and extract the movie year into an array\n movie[\"Year\"]\n end\n\n\n movie_results.each.with_index(1).map do |movie, index| #iterate through the array of movie titles and print them to the screen, along with their index # + 1\n puts \"#{index}. #{movie}\"\n end\n find_movie_from_list(movie_results) #allow the user to select a movie from their movie list\n end",
"def get_movies\n\t\t@movies = Movie.order(\"RANDOM()\").where(\"release_date > ?\", 3.years.ago).order('random()').joins(:critic_movies).group('movies.id').having(\"count(movie_id) >= #{CUTOFF}\")\n\t\t.limit(750).to_a\n\t\t@movies.each do | movie | \n\t\t\tmovie.title = movie.title.split.map(&:capitalize).join(' ')\n\t\tend\n\t\t@movies = @movies.to_a.map(&:serializable_hash).to_json\n\t\trender :json => @movies\n\tend",
"def get_movies_from_api\n all_films = RestClient.get('http://www.swapi.co/api/films/')\n film_hash = JSON.parse(all_films) \nend",
"def parse_character_movies(character)\n char_movies = movie_array(character)\n char_movies.each_with_index do |movie, index|\n puts \"#{index + 1} #{movie}\"\n end\nend",
"def fetch_characters\n api = EVEAPI::API.new\n api.api_id = api_id\n api.v_code = v_code\n\n xml = api.get(\"account/APIKeyInfo\")\n characters = []\n xml.xpath(\"//row\").each do |row|\n characters << {\n :name => row['characterName'],\n :id => row['characterID'],\n :corporation_name => row['corporationName'],\n :corporation_id => row['corporationID'],\n :api_id => api_id,\n :v_code => v_code\n }\n end\n characters \n end",
"def customers_at_film()\n sql = \"SELECT * FROM customers INNER JOIN tickets\n ON customers.id = tickets.customer_id WHERE film_id = $1\"\n values = [@id]\n customers = SqlRunner.run(sql, values)\n result = customers.map {|customer_hash| Customer.new(customer_hash)}\nend",
"def scrape\n\tmonday = getMonday\n\n\t# create url to retrieve all movies from current date onwards\n\tallMoviesURL = getMoviesURL(monday)\n\t\n\t# retrieve page\n\tpage = Nokogiri::HTML(open(allMoviesURL))\n\n\t# select the movies\n\tmovieListingNodes = getMovieListingNodes(page)\n\n\t# parse the movies\n\tmovieListings = parseMovieListings(movieListingNodes)\n\t\n\treturn movieListings\nend",
"def movie_data\n response = RestClient.get(\"critics.api.mks.io/movie-genres\")\n JSON.parse(response)\nend",
"def run(character)\n \tnumberOfFilms = 0\n \tfor name in get_character_names\n numberOfFilms += 1 if name == character\n \tend\n\t\t numberOfFilms\n end"
] |
[
"0.796758",
"0.7963785",
"0.7825746",
"0.7723475",
"0.7679142",
"0.7624706",
"0.75895137",
"0.7521909",
"0.75184345",
"0.7497967",
"0.749589",
"0.7487098",
"0.7464824",
"0.7322385",
"0.726702",
"0.72108006",
"0.7207704",
"0.6977728",
"0.69609106",
"0.69478554",
"0.69268864",
"0.69143975",
"0.68734324",
"0.6794812",
"0.6794653",
"0.67854846",
"0.67377955",
"0.67345655",
"0.66733015",
"0.6613181",
"0.65785074",
"0.6371589",
"0.62074643",
"0.61786175",
"0.6143645",
"0.6022657",
"0.599993",
"0.5974168",
"0.5934483",
"0.5913403",
"0.5905191",
"0.5861802",
"0.5857431",
"0.5843227",
"0.5841069",
"0.5835417",
"0.58130115",
"0.58075935",
"0.58043975",
"0.5766675",
"0.57656777",
"0.5764675",
"0.57549226",
"0.5735117",
"0.5726371",
"0.5721311",
"0.5714923",
"0.5712991",
"0.5712536",
"0.5662352",
"0.56414175",
"0.563973",
"0.5638626",
"0.56350565",
"0.5627326",
"0.56243247",
"0.5622361",
"0.5586525",
"0.5560904",
"0.55554605",
"0.55177903",
"0.548613",
"0.54839283",
"0.54757446",
"0.54690653",
"0.5461175",
"0.5423873",
"0.54082835",
"0.54009736",
"0.5398862",
"0.5394579",
"0.53918",
"0.53668416",
"0.5322483",
"0.53178126",
"0.5311011",
"0.5283601",
"0.52656174",
"0.5250784",
"0.5245532",
"0.5236593",
"0.5228153",
"0.52247137",
"0.52219296",
"0.5207791",
"0.52015716",
"0.5198945",
"0.5194211",
"0.51903045",
"0.5170132"
] |
0.58369666
|
45
|
GET /size_groups/1 GET /size_groups/1.xml
|
def show
@size_group = SizeGroup.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.xml { render :xml => @size_group }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @size_group = SizeGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def create\n @size_group = SizeGroup.new(params[:size_group])\n result = @size_group.save\n if result\n for size in params[:size]\n new_size = Size.new(size)\n new_size.save\n @size_group.sizes << new_size\n end\n end\n respond_to do |format|\n if result\n flash[:notice] = 'SizeGroup was successfully created.'\n format.html { redirect_to([:admin, @size_group]) }\n format.xml { render :xml => @size_group, :status => :created, :location => @size_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end",
"def index\n respond_to do |format|\n format.html { @groups = Group.get_groups(current_user, params) }\n format.xml { render :xml => Group.get_groups(params.merge({:show => 'all'})) }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n\n @group_definitions = GroupDefinition.find(:all)\n\n render :xml => @group_definitions\n end",
"def index\n\n @groups = Group.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def destroy\n @size_group = SizeGroup.find(params[:id])\n @size_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_size_groups_url) }\n format.xml { head :ok }\n end\n end",
"def index\n @small_groups = SmallGroup.all\n end",
"def show\n @utilization_metrics_by_node_group = @object\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @utilization_metrics_by_node_group.to_xml(:dasherize => false) }\n end\n end",
"def index\n @groups = Group.all\n @title = \"Groups\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n\n @groups = Group.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n format.json { render :json => @groups }\n end\n end",
"def show\n\n @group_definition = GroupDefinition.find(params[:id])\n\n render :xml => @group_definition\n end",
"def size\n\t\t\t@groups.size\n\t\tend",
"def index\n #@groupings = Grouping.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groupings }\n end\n end",
"def index\n @sizes = Size.all\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def index\n @slicegroups = Slicegroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @slicegroups }\n end\n end",
"def index\n @groups = WorkGroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @giving_groups = GivingGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @giving_groups }\n end\n end",
"def index\n @image_gallery_groups = ImageGalleryGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @image_gallery_groups }\n end\n end",
"def index\n @user_groups = UserGroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_groups }\n end\n end",
"def show\n @group_list = GroupList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def index\n @user_groups = UserGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @user_groups }\n end\n end",
"def list\n @sizes = Admin::Size.all\n\n render json: { sizes: @sizes }\n end",
"def show\n render :partial => 'element_container', :object => @size_group\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n\n format.xml { render :xml => @subgroup }\n end\n end",
"def show\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group }\n format.xml { render xml: @group }\n end\n end",
"def index\n @groups = SuperSimpleCms::Group.find(:all, :order=>:position)\n\n respond_to do |format|\n format.html { render :template => 'admin/groups/index' }\n format.xml { render :xml => @groups }\n end\n end",
"def index\n @master_sizes = Master::Size.all\n end",
"def index\n @expensegroups = Expensegroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @expensegroups }\n end\n end",
"def show\n @attribute_group = AttributeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @attribute_group }\n end\n end",
"def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_retention }\n end\n end",
"def index\n respond_to do |format|\n format.html { @sizes = Size.all }\n format.json { @sizes = Size.order(:name) }\n end\n end",
"def index\n @request_groups = RequestGroup.all\n end",
"def show\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_group }\n end\n end",
"def show\n @group = Group.find(params[:id])\n\n @list_group_subgroups = @group.group_subgroups.paginate :page => params[:subgroups_page], :per_page => 10\n @list_group_members = @group.group_members.paginate :page => params[:members_page], :per_page => 10\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @add_to_group = AddToGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @add_to_group }\n end\n end",
"def get_group\n send_request(FUNCTION_GET_GROUP, [], '', 4, 'k4')\n end",
"def index\n @group_stats = GroupStat.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @group_stats }\n end\n end",
"def get_sizes\n @item = Item.find(params[:id])\n @sizes = @item.variants_for(:size, nil, params[:colour])\n respond_to do |format|\n format.json { render :json => @sizes }\n end\n end",
"def list_sizes\n\treturn if authorise_for_web(program_name?,'read') == false \n\n \tif params[:page]!= nil \n\n \t\tsession[:sizes_page] = params['page']\n\n\t\t render_list_sizes\n\n\t\t return \n\telse\n\t\tsession[:sizes_page] = nil\n\tend\n\n\tlist_query = \"@size_pages = Paginator.new self, Size.count, @@page_size,@current_page\n\t @sizes = Size.find(:all,\n\t\t\t\t :limit => @size_pages.items_per_page,\n\t\t\t\t :offset => @size_pages.current.offset)\"\n\tsession[:query] = list_query\n\trender_list_sizes\nend",
"def index\n\n\t\t@groups = Group.find_paginate({:user=> current_user, :page => params[:page], :query => params[:query], :sort => params[:sort], :nb_items => get_nb_items(params[:nb_items]) })\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml { render :xml => @groups }\n\t\t\tformat.json { render :json => @groups }\n\t\tend\n\tend",
"def index\n @provider_groups = ProviderGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @provider_groups }\n end\n end",
"def index\n @group_requests = GroupRequest.all\n end",
"def show\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @objectgrouptoobjectgroup }\n end\n end",
"def show\n @slicegroup = Slicegroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @slicegroup }\n end\n end",
"def index\n @server_sizes = ServerSize.all\n end",
"def index\n\n @user_groups = UserGroup.find(:all)\n\n respond_to do |format|\n format.html { redirect_to :controller => :groups, :action => :index }\n format.xml { render :xml => @user_groups }\n end\n end",
"def show\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end",
"def show\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @outgoing_sms_number_group }\n end\n end",
"def update\n @size_group = SizeGroup.find(params[:id])\n result = @size_group.update_attributes(params[:size_group])\n if result\n for size in params[:size]\n new_size = Size.new(size)\n new_size.save\n @size_group.sizes << new_size\n end\n for id,size in params[:existing_size]\n if size.has_key? :delete\n Size.delete(id)\n else\n this_size = Size.find(id)\n this_size.update_attributes(size)\n end\n end if params[:existing_size]\n end\n \n respond_to do |format|\n if result\n flash[:notice] = 'SizeGroup was successfully updated.'\n format.html { redirect_to([:admin, @size_group]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def index\n @admin_sizes = Size.all\n end",
"def set_sizes\n @size = Size.find(params[:id])\n end",
"def groups(options = {})\n params = { :limit => 200 }.update(options)\n response = get(PATH['groups_full'], params)\n parse_groups response_body(response)\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html\n format.json { render json: @groups }\n end\n end",
"def show\n @group = WorkGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def show\n @targetgroup = Targetgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @targetgroup }\n end\n end",
"def show\n @group_stat = GroupStat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @group_stat }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def index\n @groups = Group.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def index\n @groups = Group.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @groups }\n end\n end",
"def show\n @grupo = Grupo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @grupo }\n end\n end",
"def show\n @target_group = TargetGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @target_group }\n end\n end",
"def list_ns_service_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GroupingObjectsApi.list_ns_service_groups ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling GroupingObjectsApi.list_ns_service_groups, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling GroupingObjectsApi.list_ns_service_groups, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/ns-service-groups\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'default_service'] = opts[:'default_service'] if !opts[:'default_service'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NSServiceGroupListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupingObjectsApi#list_ns_service_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @groups = Group.all\n render_json_serializer(@groups)\n end",
"def show\n @outgoing_sms_content_group = OutgoingSmsContentGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @outgoing_sms_content_group }\n end\n end",
"def index\n @competence_groups = CompetenceGroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @competence_groups }\n end\n end",
"def index\n @rebalancegroup = Rebalancegroup.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @rebalancegroups }\n format.xml {rendder xml: @rebalancegroups}\n end\n end",
"def show\n @giving_group = GivingGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @giving_group }\n end\n end",
"def show\n @group = Group.find_by_param(params[:id])\n @title = \"#{@group.name}'s Group\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def index\n @standard_sizes = StandardSize.all\n end",
"def index\n @mem_groups = MemGroup.page(params[:page]).per(10)\n end",
"def show\n @server_group = ServerGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @server_group.to_json(:include => {:servers => {:include => :vpn_network_interfaces}, :clients => {:include => :vpn_network_interfaces}}) }\n format.xml { render :xml => @server_group.to_xml(:include => {:servers => {:include => :vpn_network_interfaces}, :clients => {:include => :vpn_network_interfaces}}) }\n end\n end",
"def index\n groups = get_collection(assignment.groups) || return\n\n group_data = include_memberships(groups)\n\n respond_to do |format|\n format.xml do\n render xml: group_data.to_xml(root: 'groups', skip_types: 'true')\n end\n format.json { render json: group_data }\n end\n end",
"def show\n @group_of_task = GroupOfTask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_of_task }\n end\n end",
"def quota_requests_by_group(options)\n quota_provision_stats(:quota_find_prov_request_by_group, options)\n end",
"def index\n @adsizes = Adsize.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @adsizes }\n end\n end",
"def index\n @group = Group.find(params[:group_id])\n @surveys = @group.surveys\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @surveys }\n end\n end",
"def list_ns_groups_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GroupingObjectsApi.list_ns_groups ...\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 1000\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling GroupingObjectsApi.list_ns_groups, must be smaller than or equal to 1000.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 0\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling GroupingObjectsApi.list_ns_groups, must be greater than or equal to 0.'\n end\n\n # resource path\n local_var_path = \"/ns-groups\"\n\n # query parameters\n query_params = {}\n query_params[:'cursor'] = opts[:'cursor'] if !opts[:'cursor'].nil?\n query_params[:'included_fields'] = opts[:'included_fields'] if !opts[:'included_fields'].nil?\n query_params[:'member_types'] = opts[:'member_types'] if !opts[:'member_types'].nil?\n query_params[:'page_size'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'populate_references'] = opts[:'populate_references'] if !opts[:'populate_references'].nil?\n query_params[:'sort_ascending'] = opts[:'sort_ascending'] if !opts[:'sort_ascending'].nil?\n query_params[:'sort_by'] = opts[:'sort_by'] if !opts[:'sort_by'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'NSGroupListResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GroupingObjectsApi#list_ns_groups\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def show\n @product_size = ProductSize.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_size }\n end\n end",
"def show\n @partical_size = ParticalSize.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partical_size }\n end\n end",
"def show\n @expensegroup = Expensegroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @expensegroup }\n end\n end",
"def index\n if params[:search]\n @groups = Group.search params[:search], :order => 'created_at DESC'\n else\n @groups = Group.paginate :order => 'created_at DESC', :page => params[:page]\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end",
"def show\n\t\tshow_\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @group }\n\t\t\tformat.json { render :json => @group }\n\t\tend\n\tend",
"def show\n\t\tshow_\n\t\trespond_to do |format|\n\t\t\tformat.html # show.html.erb\n\t\t\tformat.xml { render :xml => @group }\n\t\t\tformat.json { render :json => @group }\n\t\tend\n\tend",
"def index\n @fgroups = Fgroup.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @fgroups }\n end\n end",
"def show\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @routinetoobjectgroup }\n end\n end",
"def index\n @grouped_progress_entries = GroupedProgressEntry.all(current_user,search_criteria)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @grouped_progress_entries }\n end\n end",
"def index\n @tqrdc_groups = Tqrdc::Group.all.page\n end",
"def show\n @group = SuperSimpleCms::Group.find(params[:id])\n\n respond_to do |format|\n format.html { render :template=>'admin/groups/show' }\n format.js { render :template=>'admin/groups/show', :layout=>false}\n format.xml { render :xml => @group }\n end\n end"
] |
[
"0.65454197",
"0.62095326",
"0.6137497",
"0.6137497",
"0.61343664",
"0.61343664",
"0.6099301",
"0.6062929",
"0.60226846",
"0.6018285",
"0.5973926",
"0.59366924",
"0.5931665",
"0.5912144",
"0.58946514",
"0.5890749",
"0.58822984",
"0.5878934",
"0.5878934",
"0.58274955",
"0.58131623",
"0.57820034",
"0.5762908",
"0.5759473",
"0.57578826",
"0.573948",
"0.5739456",
"0.57299626",
"0.572125",
"0.572125",
"0.572125",
"0.572125",
"0.572125",
"0.569473",
"0.5692769",
"0.56918454",
"0.56765014",
"0.5665299",
"0.5648979",
"0.56285745",
"0.5628135",
"0.56155425",
"0.5598856",
"0.55901724",
"0.55861515",
"0.5580386",
"0.5573988",
"0.55715656",
"0.55714315",
"0.55644697",
"0.55597323",
"0.5559625",
"0.55576575",
"0.5548416",
"0.5547418",
"0.55449164",
"0.554287",
"0.5520998",
"0.5518682",
"0.5516014",
"0.55020124",
"0.5500463",
"0.5498387",
"0.54920685",
"0.5469484",
"0.5468041",
"0.5467575",
"0.54674715",
"0.54674715",
"0.5463784",
"0.5456767",
"0.54528373",
"0.54506415",
"0.5445752",
"0.54413486",
"0.5426626",
"0.54266196",
"0.54163885",
"0.541156",
"0.54075325",
"0.5400901",
"0.5399673",
"0.539583",
"0.53935486",
"0.5388974",
"0.5382601",
"0.5380371",
"0.53761995",
"0.5376192",
"0.5371909",
"0.5367862",
"0.53659475",
"0.5364773",
"0.5364773",
"0.536092",
"0.5359067",
"0.5350193",
"0.53429675",
"0.5335028"
] |
0.7347719
|
1
|
GET /size_groups/new GET /size_groups/new.xml
|
def new
@size_group = SizeGroup.new
respond_to do |format|
format.html # new.html.erb
format.xml { render :xml => @size_group }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @size_group = SizeGroup.new(params[:size_group])\n result = @size_group.save\n if result\n for size in params[:size]\n new_size = Size.new(size)\n new_size.save\n @size_group.sizes << new_size\n end\n end\n respond_to do |format|\n if result\n flash[:notice] = 'SizeGroup was successfully created.'\n format.html { redirect_to([:admin, @size_group]) }\n format.xml { render :xml => @size_group, :status => :created, :location => @size_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @add_to_group = AddToGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @add_to_group }\n end\n end",
"def new\n @group = Group.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n \n respond_to do |format|\n format.html\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def new\n @group = Group.new\n \n respond_to do |format|\n format.html\n format.xml { render :xml => @group.to_xml }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n format.xml { render xml: @group }\n end\n end",
"def new\n\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @slicegroup = Slicegroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @slicegroup }\n end\n end",
"def new\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.new\n\t @groups = current_user.get_unique_group_branches.map {|g| g.get_self_and_children?}.flatten\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @attribute_group = AttributeGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attribute_group }\n end\n end",
"def new\n @group_list = GroupList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_list }\n end\n end",
"def new\n @group = Group.new\n @title = 'Create Group'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end",
"def new\n @targetgroup = Targetgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @targetgroup }\n end\n end",
"def new\n @group = WorkGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @group = SuperSimpleCms::Group.new\n\n respond_to do |format|\n format.html {render :template=>'admin/groups/new'}\n format.js {render :template=>'admin/groups/new', :layout=>false}\n format.xml { render :xml => @group }\n end\n end",
"def new\n @routinetoobjectgroup = Routinetoobjectgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @routinetoobjectgroup }\n end\n end",
"def new\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @objectgrouptoobjectgroup }\n end\n end",
"def new\n @giving_group = GivingGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @giving_group }\n end\n end",
"def new\n @group = GROUP.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new #:nodoc:\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.haml\n # format.xml { render :xml => @group }\n end\n end",
"def new\n @target_group = TargetGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @target_group }\n end\n end",
"def new\n add_breadcrumb \"Social\", social_path()\n add_breadcrumb \"Create group\"\n \n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @image_gallery_group = ImageGalleryGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image_gallery_group }\n end\n end",
"def new\n @group_stat = GroupStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_stat }\n end\n end",
"def new\n @groups = Group.all\n respond_to do |format|\n format.html # new.html.haml\n format.xml { render :xml => @person }\n format.json { render :json => @person }\n end\n end",
"def new\n @record_group = RecordGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @record_group }\n end\n end",
"def new\n @lab_group = LabGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @lab_group }\n end\n end",
"def new\n @ail_group = AilGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ail_group }\n end\n end",
"def new\n @provider_group = ProviderGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @provider_group }\n end\n end",
"def new\n @user_group = UserGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user_group }\n end\n end",
"def new\n @groups_happening = GroupsHappening.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @groups_happening }\n end\n end",
"def new\n\t\t@group = Group.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @group }\n\t\t\tformat.json { render :json => @group }\n\t\tend\n\tend",
"def new\n\t\t@group = Group.new\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.xml { render :xml => @group }\n\t\t\tformat.json { render :json => @group }\n\t\tend\n\tend",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.js # new.js.rjs\n format.xml { render :xml => @group }\n format.json { render :json => @group }\n end\n end",
"def new\n @expensegroup = Expensegroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expensegroup }\n end\n end",
"def new\n @fgroup = Fgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fgroup }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n #format.html # new.html.erb\n #format.xml { render :xml => @group }\n format.js { render :action => 'new' }\n end\n end",
"def new\n @group_outing = GroupOuting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_outing }\n end\n end",
"def new\n @jido_grp_rel = JidoGrpRel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @jido_grp_rel }\n end\n end",
"def new\n @grupo = Grupo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @grupo }\n end\n end",
"def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end",
"def new\n @breadcrumb = 'create'\n @ratio_group = RatioGroup.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ratio_group }\n end\n end",
"def new\n @esol_group = EsolGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @esol_group }\n end\n end",
"def new\n @group_request = GroupRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group_request }\n end\n end",
"def new\n @group_of_task = GroupOfTask.new\n @projects = Project.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_of_task }\n end\n end",
"def new\n @server_group = ServerGroup.new\n @account = User.find(session[:user_id]).account\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @server_group }\n end\n end",
"def new\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @outgoing_sms_number_group }\n end\n end",
"def new\n @group = Group.new\n @membership = Membership.new\n @group_permission = GroupPermission.new\n @metro_areas = MetroArea.find(:all)\n @states = State.find(:all)\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @partical_size = ParticalSize.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partical_size }\n end\n end",
"def show\n @size_group = SizeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def show\n @size_group = SizeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def new\n @transaction_group = TransactionGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @transaction_group }\n end\n end",
"def new\n @personnel_group = PersonnelGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @personnel_group }\n end\n end",
"def new\n @size_group = SizeGroup.new\n @product = Product.find(params[:product_id].to_i) if params.has_key? :product_id\n\n render :partial => 'new', :object => @size_group\n end",
"def new\n @group_retention = GroupRetention.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_retention }\n end\n end",
"def new\n @closed_group = ClosedGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @closed_group }\n end\n end",
"def new\n @outgoing_sms_content_group = OutgoingSmsContentGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @outgoing_sms_content_group }\n end\n end",
"def new\n @product_size = ProductSize.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @product_size }\n end\n end",
"def new\n @polco_group = PolcoGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @polco_group }\n end\n end",
"def new\n @prefix_group = PrefixGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prefix_group }\n format.js { render :layout => false }\n end\n end",
"def new\n @group = Group.new\n render json: @group\n end",
"def new\n @group = Group.new\n respond_to do |format|\n #format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group = Group.new\n\n render json: @group\n end",
"def new\n @groupaddrobj = Groupaddrobj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @groupaddrobj }\n end\n end",
"def new\n @item_group = ItemGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_group }\n end\n end",
"def new\n @title = \"Добавление группы характеристик\"\n @group = Group.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group }\n end\n end",
"def new\n @group_map = GroupMap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_map }\n end\n end",
"def new\n @group_report = GroupReport.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group_report }\n end\n end",
"def new\n @group = Group.new(:owner => current_user)\n authorize @group, :new?\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @group }\n end\n end",
"def new\n @resource = Resource.new\n @resource_groups = ResourceGroup.alphabetical.all\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"def new\n @contact_group = ContactGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @contact_group }\n end\n end",
"def create\n @small_group = SmallGroup.new(small_group_params)\n\n respond_to do |format|\n if @small_group.save\n format.html { redirect_to @small_group, notice: 'Small group was successfully created.' }\n format.json { render :show, status: :created, location: @small_group }\n else\n format.html { render :new }\n format.json { render json: @small_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @recruitment_group = RecruitmentGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @recruitment_group }\n end\n end",
"def new\n @pgroup = Pgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pgroup }\n end\n end",
"def new\n @pgroup = Pgroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pgroup }\n end\n end",
"def new\n @laboratory_test_group = LaboratoryTestGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @laboratory_test_group }\n end\n end",
"def new\n @image_gallery_image = @image_gallery_group.images.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @image_gallery_image }\n end\n end",
"def new\n @group.parent_id = params[:group_id]\n \n add_breadcrumb 'Your hubs', :hubs_path\n add_breadcrumb @hub.name, hub_path(@hub)\n unless params[:group_id]\n add_breadcrumb 'New group', new_hub_group_path(@hub)\n else\n add_breadcrumb 'New sub group', hub_group_subgroup_path(@hub, @group.parent)\n end\n \n append_title 'New group'\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @group }\n end\n end"
] |
[
"0.70232415",
"0.70123994",
"0.6879285",
"0.68778497",
"0.68778497",
"0.68588465",
"0.68588465",
"0.68588465",
"0.68588465",
"0.68588465",
"0.68588465",
"0.68588465",
"0.68588465",
"0.68588465",
"0.67709875",
"0.6763431",
"0.67387205",
"0.6655991",
"0.66238534",
"0.6618393",
"0.6602974",
"0.66027254",
"0.6595445",
"0.6593261",
"0.6584003",
"0.656686",
"0.65627307",
"0.6554916",
"0.6550127",
"0.65313077",
"0.6514345",
"0.65076816",
"0.65046716",
"0.6478186",
"0.6467052",
"0.6465271",
"0.64595985",
"0.6427602",
"0.6417603",
"0.64148825",
"0.6383659",
"0.6382149",
"0.6382149",
"0.6372516",
"0.6368665",
"0.63672763",
"0.6360076",
"0.6358738",
"0.6351347",
"0.6349677",
"0.6345808",
"0.6339827",
"0.6339827",
"0.6339827",
"0.6339827",
"0.6339827",
"0.6339827",
"0.6339827",
"0.6339827",
"0.6339377",
"0.6331368",
"0.6331368",
"0.63293105",
"0.63203245",
"0.6318289",
"0.62722194",
"0.62657225",
"0.6238433",
"0.6228475",
"0.62271106",
"0.62018967",
"0.61907226",
"0.61907226",
"0.6183119",
"0.6177022",
"0.6175331",
"0.61743313",
"0.61403745",
"0.6138283",
"0.6126445",
"0.6124944",
"0.6124879",
"0.6112652",
"0.6112359",
"0.6109255",
"0.6107726",
"0.6104101",
"0.609138",
"0.60871655",
"0.6081951",
"0.60655767",
"0.60620344",
"0.6048765",
"0.60418653",
"0.6041855",
"0.6033977",
"0.6033977",
"0.60213387",
"0.602043",
"0.599923"
] |
0.795332
|
0
|
POST /size_groups POST /size_groups.xml
|
def create
@size_group = SizeGroup.new(params[:size_group])
result = @size_group.save
if result
for size in params[:size]
new_size = Size.new(size)
new_size.save
@size_group.sizes << new_size
end
end
respond_to do |format|
if result
flash[:notice] = 'SizeGroup was successfully created.'
format.html { redirect_to([:admin, @size_group]) }
format.xml { render :xml => @size_group, :status => :created, :location => @size_group }
else
format.html { render :action => "new" }
format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n @size_group = SizeGroup.find(params[:id])\n result = @size_group.update_attributes(params[:size_group])\n if result\n for size in params[:size]\n new_size = Size.new(size)\n new_size.save\n @size_group.sizes << new_size\n end\n for id,size in params[:existing_size]\n if size.has_key? :delete\n Size.delete(id)\n else\n this_size = Size.find(id)\n this_size.update_attributes(size)\n end\n end if params[:existing_size]\n end\n \n respond_to do |format|\n if result\n flash[:notice] = 'SizeGroup was successfully updated.'\n format.html { redirect_to([:admin, @size_group]) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @size_group = SizeGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def destroy\n @size_group = SizeGroup.find(params[:id])\n @size_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_size_groups_url) }\n format.xml { head :ok }\n end\n end",
"def create\n @size_group = SizeGroup.new(params[:size_group])\n\n if @size_group.save\n flash[:notice] = 'SizeGroup was successfully created.'\n if params[:product_id]\n render :partial => 'select_option', :object => @size_group\n else\n render :partial => 'element_container', :object => @size_group\n end\n else\n render :partial => 'new', :object => @size_group, :status => 409\n end\n end",
"def resize_node_group 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_resize_node_group_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def add_to_size_group(group, size_groups, max_samples)\n added = false\n size_groups.each do |size_group|\n total_size = size_group.map(&:length).inject(0, :+)\n next if total_size + group.length > max_samples\n size_group.push(group)\n added = true\n end\n size_groups.push([group]) unless added\n end",
"def size_group_params\n params.permit(:buyer_id, :cart_id, :color)\n end",
"def create\n @small_group = SmallGroup.new(small_group_params)\n\n respond_to do |format|\n if @small_group.save\n format.html { redirect_to @small_group, notice: 'Small group was successfully created.' }\n format.json { render :show, status: :created, location: @small_group }\n else\n format.html { render :new }\n format.json { render json: @small_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def postGroupBulk_ingest( group_id, filedata, category_type)\n params = Hash.new\n params['group_id'] = group_id\n params['filedata'] = filedata\n params['category_type'] = category_type\n return doCurl(\"post\",\"/group/bulk_ingest\",params)\n end",
"def update\n\n if @size_group.update_attributes(params[:size_group])\n flash[:notice] = 'SizeGroup was successfully updated.'\n render :partial => 'show', :object => @size_group\n else\n render :partial => 'edit', :object => @size_group, :status => 409\n end\n end",
"def size\n\t\t\t@groups.size\n\t\tend",
"def destroy\n @size_group.destroy\n\n render :nothing => true\n end",
"def group_params\n params.require(:group).permit(:chunk_id, :parentGroup_id, :storylineTags, :age, :era_id, :contentDate, :detailLevel_id, :order, :characterTags, :content_block)\n end",
"def size_params\n params.require(:size).permit :name, :description, :splittable\n end",
"def create\n @size = Admin::Size.new(size_params)\n\n if @size.save\n render json: @size, status: :created#, location: @size\n else\n render json: @size.errors, status: :unprocessable_entity\n end\n end",
"def generate(groups)\n groups_params = groups.inject({}) do |params, (k, v)|\n params[\"groups[#{k}]\"] = 1\n params\n end\n\n response = RouteNGN.put self.class.base_url, {:id => self.id}.merge!(groups_params)\n response.success?\n end",
"def assign_group(group_size, students)\n\nend",
"def size_params\n params.require(:size).permit(:size)\n end",
"def group_params\n params.require(:group).permit(:user_id, :identifier, :name, :description, :group_type, :tags, :member_count, :topic_count, :post_count, :lat, :lng)\n end",
"def group_params\n params.require(:group).permit(:name, :image, :description, :primary_statistics)\n end",
"def group_params\n params.require(:group).permit(:name, :desc, :will_expires_on, :class_project_id, :status, :maximum_stack_limit, :enable_stack_scheduler, :schd_timzone, :schd_shutdown_time, :schd_startup_time,:show_inputs,:enable_expire_time,:enable_start_time,:will_start_on,:maximum_number_of_users, :invite_code, :enable_startup_only, :enable_shutdown_only,:lab_life_in_days,:stack_template_id, stack_template_ids:[])\n end",
"def size_params\n params.require(:size).permit(\n :name,\n :g1,\n :g1h,\n :g2,\n :g2h,\n :g3,\n :g3h,\n :g4,\n :g4h,\n :g5,\n :g5h,\n :g6,\n :g6h,\n :g7,\n :g7h,\n :g8,\n :g8h,\n :g9,\n :g9h,\n :g10,\n :g10h,\n :g11,\n :g11h,\n :g12,\n :g12h,\n :g13,\n :g13h,\n :g14,\n :g14h,\n :g15,\n :g16,\n :g17,\n :g18,\n :g19\n )\n end",
"def createGroup(groupName, gid)\r\n uri = sprintf(\"/api/v1/group_categories/%d/groups\", gid) \r\n \r\n dbg(\"POST #{uri}\")\r\n dbg(\"name=#{groupName}\")\r\n newGroup = $canvas.post(uri, {'name' => groupName})\r\n dbg(newGroup)\r\n return newGroup\r\nend",
"def createGroup(groupName, gid)\r\n uri = sprintf(\"/api/v1/group_categories/%d/groups\", gid) \r\n \r\n dbg(\"POST #{uri}\")\r\n dbg(\"name=#{groupName}\")\r\n newGroup = $canvas.post(uri, {'name' => groupName})\r\n dbg(newGroup)\r\n return newGroup\r\nend",
"def create\n ip = request.location\n @user = current_user\n @group = @user.groups_as_owner.new(params[:group])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n @group.school_id = @user.school_id\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def group_params\n params.require(:group).permit(:number, :name, :color, :flr_id, :user_id, :all_stories, :mot_text, :last_update)\n end",
"def group_params\n params.require(:group).permit(:name, :address, :time, :number_of_members, :picture)\n end",
"def postEntityGroup( entity_id, group_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['group_id'] = group_id\n return doCurl(\"post\",\"/entity/group\",params)\n end",
"def unit_group_params\n params.require(:unit_group).permit(:guid, :price, :group_key, :name, :available_units_count, :total_units_count, :total_non_excluded_units_count, :size, :standard_rate, :floor, :reduced_price, :occupancy_percent, :area, :length, :width, :height, :due_at_move_in, :due_at_move_in_without_fees, :due_monthly, :attribute_description, :description, :average_rent, :active_rate_type, :channel_rate_id, :unit_type_id)\n end",
"def group_params\n params.require(:group).permit(:name, :group_image, user_ids: [])\n end",
"def show\n @size_group = SizeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def show\n @size_group = SizeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def set_sizes\n @size = Size.find(params[:id])\n end",
"def create\n \n @max_ships=50 \n @ship_group = ShipGroup.new(ship_group_params)\n @ship_name =Unit.find(@ship_group.unit_id).name\n respond_to do |format|\n if @ship_group.save\n format.html { redirect_to @ship_group, notice: 'Ship group was successfully created.' }\n format.json { render :show, status: :created, location: @ship_group }\n else\n format.html { render :new }\n format.json { render json: @ship_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def pages_group_params\n params[:pages_group]\n end",
"def update\n if ((params.has_key?(:group_size)) && (not params[:group_size].empty?))\n update_max_group_size(params[:group_size])\n end\n if ((params.has_key?(:group_reader)) && (not params[:group_reader].empty?))\n update_group_readers(params[:group_reader])\n end\n redirect_to admin_path\n end",
"def create\n @s_group = SGroup.new(s_group_params)\n\n respond_to do |format|\n if @s_group.save\n format.html { redirect_to @s_group, notice: 'S group was successfully created.' }\n format.json { render :show, status: :created, location: @s_group }\n else\n format.html { render :new }\n format.json { render json: @s_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def move_users_to_group(group_id, set_of_user_ids)\n set_of_user_ids.each do |id|\n @url = \"http://#{$canvas_host}/api/v1/groups/#{group_id}/memberships\"\n puts \"@url is #{@url}\"\n \n @payload={'user_id': id}\n puts(\"@payload is #{@payload}\")\n \n @postResponse = HTTParty.post(@url, :body => @payload.to_json, :headers => $header )\n puts(\" POST to move user to group has Response.code #{@postResponse.code} and postResponse is #{@postResponse}\")\n end\nend",
"def admin_size_params\n params.require(:size).permit(:name, :code)\n end",
"def group_params\n params.require(:group).permit(:group_id_id)\n end",
"def group_params\n params.require(:group).permit(:name, :book_name, :page_number, :description, :start_date, :end_date, :num_to_read)\n end",
"def master_size_params\n params.require(:master_size).permit(:size)\n end",
"def server_size_params\n params.require(:server_size).permit(:size_name, :model, :cpu, :cpu_cores, :memory, :disk)\n end",
"def ship_group_params\n params.require(:ship_group).permit(:fighting_fleet_id, :ship_id, :number, :group_hitpoints, :unit_name)\n end",
"def group_params\n params.require(:group).permit(:group_category_id, :name, :description, :logo, :banner, :owner_id, :tag_list)\n end",
"def create\n @pages_group = PagesGroup.new(pages_group_params)\n respond_to do |format|\n if @pages_group.save\n format.html { redirect_to @pages_group, notice: 'Pages group was successfully created.' }\n format.json { render :show, status: :created, location: @pages_group }\n else\n format.html { render :new }\n format.json { render json: @pages_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.new(params[:outgoing_sms_number_group])\n\n respond_to do |format|\n if @outgoing_sms_number_group.save\n flash[:notice] = 'OutgoingSmsNumberGroup was successfully created.'\n format.html { redirect_to(@outgoing_sms_number_group) }\n format.xml { render :xml => @outgoing_sms_number_group, :status => :created, :location => @outgoing_sms_number_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @outgoing_sms_number_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def tag_type_group_params\n params.require(:tag_type_group).permit(:color, :name)\n end",
"def create\n params[:group].delete(:domain) unless current_group.shapado_version.has_custom_domain?\n @group = Group.new\n if params[:group][:languages]\n params[:group][:languages].reject! { |lang| lang.blank? }\n end\n @group.safe_update(%w[languages name legend description default_tags subdomain logo forum enable_mathjax enable_latex custom_favicon language theme signup_type custom_css wysiwyg_editor], params[:group])\n\n @group.safe_update(%w[isolate domain private], params[:group]) if current_user.admin?\n\n @group.owner = current_user\n @group.state = \"active\"\n\n respond_to do |format|\n if @group.save\n @group.create_default_widgets\n\n Jobs::Images.async.generate_group_thumbnails(@group.id)\n @group.add_member(current_user, \"owner\")\n flash[:notice] = I18n.t(\"groups.create.flash_notice\")\n format.html { redirect_to(domain_url(:custom => @group.domain, :controller => \"admin/manage\", :action => \"properties\")) }\n format.json { render :json => @group.to_json, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @admin_size = Size.new(admin_size_params)\n\n respond_to do |format|\n if @admin_size.save\n format.html { redirect_to admin_sizes_path, notice: 'Size was successfully created.' }\n format.json { render :show, status: :created, location: @admin_size }\n else\n format.html { render :new }\n format.json { render json: @admin_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"def groups\n groups = []\n @config['groups'].each do |k, v|\n groups << OpenStruct.new(\n name: k,\n size: Size.new(v['size']),\n rss: v['rss'],\n requests: v['requests'],\n path: v['path'])\n end\n groups.freeze\n end",
"def small_group_params\n params.require(:small_group).permit(:leaders, :img_url, :location, :weekday, :event_time, :topic, :contact, :leaders_note_1, :leaders_note_1_active, :leaders_note_2, :leaders_note_2_active, :leaders_note_3, :leaders_note_3_active, :disabled)\n end",
"def create\n @request_group = RequestGroup.new(request_group_params)\n\n respond_to do |format|\n if @request_group.save\n format.html { redirect_to @request_group, \n\t\t\t\t\t\t\t\t\t\t\tnotice: 'Request group was successfully created.' }\n format.json { render action: 'show', status: :created, \n\t\t\t\t\t\t\t\t\t\t\tlocation: @request_group }\n else\n format.html { render action: 'new' }\n format.json { render json: @request_group.errors, \n\t\t\t\t\t\t\t\t\t\t\tstatus: :unprocessable_entity }\n end\n end\n end",
"def quota_requests_by_group(options)\n quota_provision_stats(:quota_find_prov_request_by_group, options)\n end",
"def bulk_params\n params.require(:group_id)\n params.permit(:group_id, :emails)\n end",
"def device_group_params\n params.require(:device_group).permit(:name, :icon, properties_attributes: [:id, :name, :style, :unit, :values, :fa_style])\n end",
"def create\n @utilization_metrics_by_node_group = UtilizationMetricsByNodeGroup.new(params[:utilization_metrics_by_node_group])\n\n respond_to do |format|\n if @utilization_metrics_by_node_group.save\n format.html {\n flash[:notice] = 'UtilizationMetricsByNodeGroup was successfully created.'\n redirect_to utilization_metrics_by_node_group_url(@utilization_metrics_by_node_group)\n }\n format.js { \n render(:update) { |page| \n }\n }\n format.xml { head :created, :location => utilization_metrics_by_node_group_url(@utilization_metrics_by_node_group) }\n else\n format.html { render :action => \"new\" }\n format.js { render(:update) { |page| page.alert(@utilization_metrics_by_node_group.errors.full_messages) } }\n format.xml { render :xml => @utilization_metrics_by_node_group.errors.to_xml, :status => :unprocessable_entity }\n end\n end\n end",
"def group_params\n params.require(:group).permit(\n :group_name, :entity_id, :form_type, :avatar, :remove_avatar\n )\n end",
"def create\n @eqvgroup = Eqvgroup.new(eqvgroup_params)\n if eqvgroup_params[:number].blank?\n @eqvgroup.number = @eqvgroup.test.eqvgroups.order(:number).last.number + 1\n end\n\n respond_to do |format|\n if @eqvgroup.save\n format.html {\n #redirect_to @eqvgroup, notice: 'Eqvgroup was successfully created.'\n redirect_to :back\n }\n format.json { render :show, status: :created, location: @eqvgroup }\n else\n format.html { render :new }\n format.json { render json: @eqvgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def group_params\n params.require(:group).permit(:drive_robot_start, :drive_robot_end, :observe_control_start, :observe_control_end, :observe_robot_start, :observe_robot_end, :passport_number, :in_gallery_start, :in_gallery_end)\n end",
"def event_group_params\n params.require(:event_group).permit(:name, :map_ids => [], :map_attributes => [:id], :shapefile_ids => [], :shapefile_attributes => [:id], :historical_event_ids => [], :historical_event_attributes => [:id])\n end",
"def create\n @attribute_group = AttributeGroup.new(params[:attribute_group])\n\n respond_to do |format|\n if @attribute_group.save\n format.html { redirect_to(@attribute_group, :notice => 'Attribute group was successfully created.') }\n format.xml { render :xml => @attribute_group, :status => :created, :location => @attribute_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @attribute_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def group_params\r\n params.require(:group).permit(:name)\r\n end",
"def eqvgroup_params\n params.require(:eqvgroup).permit(:test_id, :section_id, :number)\n end",
"def group_params\n params.require(:group).permit(:group_name, :user_id, :group_image)\n end",
"def group_params\n params.require(:group).permit(:name, :desc, :icon)\n end",
"def postGroupBulk_update( group_id, data)\n params = Hash.new\n params['group_id'] = group_id\n params['data'] = data\n return doCurl(\"post\",\"/group/bulk_update\",params)\n end",
"def group_params\n params.require(:group).permit(:id, :name)\n end",
"def collection_group_params\n params.require(:collection_group).permit(:name)\n end",
"def create\n\n respond_to do |format|\n\t\t\tformat.html {\n\t\t\t\tsg_params=params[:server_group]\n \t\t\t@server_group = ServerGroup.create({\n\t\t\t\t\t:description => sg_params[:description],\n\t\t\t\t\t:name => sg_params[:name],\n\t\t\t\t\t:vpn_network => sg_params[:vpn_network],\n\t\t\t\t\t:vpn_subnet => sg_params[:vpn_subnet],\n\t\t\t\t\t:vpn_device => sg_params[:vpn_device],\n\t\t\t\t\t:vpn_proto => sg_params[:vpn_proto],\n\t\t\t\t\t:domain_name => sg_params[:domain_name],\n\t\t\t\t\t:owner_name => sg_params[:owner_name],\n\t\t\t\t\t:user_id => session[:user_id]\n\t\t\t\t})\n \t\t\t@server_group.user_id = session[:user_id]\n\t\t\t\tif params[:server_group][\"servers_attributes\"] then\n\t\t\t\t\tparams[:server_group][\"servers_attributes\"].each_pair do |id, hash|\n\t\t\t\t\t\tuser=User.find(session[:user_id])\n\t\t\t\t\t\thash[:account_id] = user.account.id\n\t\t\t\t\t\tserver = Server.new_for_type(hash)\n\t\t\t\t\t\t@server_group.servers << server\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\t\tif params[:server_group][\"client_attributes\"] then\n\t\t\t\t\tparams[:server_group][\"client_attributes\"].each_pair do |id, hash|\n\t\t\t\t\t\tclient = Client.new(hash)\n\t\t\t\t\t\t@server_group.clients << client\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t}\n\t\t\tformat.xml {\n\t\t\t\thash=Hash.from_xml(request.raw_post)\n \t\t\t@server_group=server_group_from_hash(hash)\n\t\t\t}\n\t\t\tformat.json {\n\t\t\t\thash=JSON.parse(request.raw_post)\n\t\t\t\thash={\"server_group\" => hash}\n\t\t\t\t@server_group=server_group_from_hash(hash)\n\t\t\t}\n\tend\n\n respond_to do |format|\n if @server_group.save\n flash[:notice] = 'ServerGroup was successfully created.'\n\t\t@server_group.servers.each do |server|\n\t\t\tAsyncExec.run_job(CreateCloudServer, server.id)\n\t\tend\n #format.html { redirect_to(@server_group) }\n format.html { render :xml => @server_group.to_xml(:include => {:servers => {:include => :vpn_network_interfaces}, :clients => {:include => :vpn_network_interfaces}}), :status => :created, :location => @server_group, :content_type => \"application/xml\" }\n format.json { render :json => @server_group.to_json(:include => {:servers => {:include => :vpn_network_interfaces}, :clients => {:include => :vpn_network_interfaces}}), :status => :created, :location => @server_group }\n format.xml { render :xml => @server_group.to_xml(:include => {:servers => {:include => :vpn_network_interfaces}, :clients => {:include => :vpn_network_interfaces}}), :status => :created, :location => @server_group }\n else\n\n\t\t#@server_group.errors.each do |error|\n\t\t#\tputs error.to_s\n\t\t#end\n\t\tif not @server_group.new_record? then\n\t\t\t@server_group.servers.each do |server|\n\t\t\t\tserver.delete\n\t\t\tend\n\t\t\t@server_group.delete\n\t\tend\n format.html { render :xml => @server_group.errors.to_xml, :status => :unprocessable_entity, :content_type => \"application/xml\" }\n format.json { render :json => @server_group.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @server_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def input_params\n params.require(:grouping).permit(:group_id, :contact_id)\n end",
"def products_color_params\n params.require(:products_color).permit(:size_ids =>[] )\n end",
"def spree_dynamic_bmsm_group_params\n #params.require(:dynamic_bmsm_group).permit(:name, :description)\n params[:dynamic_bmsm_group]\n end",
"def move_users_to_group(group_id, arr_of_user_ids)\n arr_of_user_ids.each { |id|\n populate_group = HTTParty.post(\n \"#{$canvas_url}/api/v1/groups/#{group_id}/memberships\",\n headers: { \"authorization\" => \"Bearer #{$canvas_token}\" },\n body: {\n user_id: id\n } \n )\n }\nend",
"def new_nodegroup(nodegroup_json)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=\"\", nodegroup_json)\nend",
"def max_size\n @group.max_size\n end",
"def test_group_params\n params.require(:test_group).permit(:name, :max_applicants, :drug_id)\n end",
"def group_params\n params.require(:group).permit(:member,:name, :region, :console_id,{:game_ids => []}, :description)\n end",
"def postGroupBulk_delete( group_id, filedata)\n params = Hash.new\n params['group_id'] = group_id\n params['filedata'] = filedata\n return doCurl(\"post\",\"/group/bulk_delete\",params)\n end",
"def create\n @site = Site.new(site_params)\n @site.user_id = current_user.id\n\n if params[:site][:size_ids].present?\n sizesgroup = Size.find params[:site][:size_ids]\n @site.sizes = sizesgroup\n end\n\n respond_to do |format|\n if @site.save\n format.json { render :index, status: :created, location: @site }\n\t\t#format.json { head :no_content }\n\t\tformat.js\n else\n format.json { render json: @site.errors, status: :unprocessable_entity }\n\t\tformat.js { render 'shared/errors' }\n end\n end\n end",
"def adjust_groups(response)\n Group.destroy_all\n delete_matches(response)\n create_groups(response)\n redirect_to root_path\n end",
"def email_group_params\n params.require(:email_group).permit(:name, :description, users_ids: [])\n end",
"def create\n @add_to_group = AddToGroup.new(params[:add_to_group])\n\n respond_to do |format|\n if @add_to_group.save\n format.html { redirect_to(@add_to_group, :notice => 'Add to group was successfully created.') }\n format.xml { render :xml => @add_to_group, :status => :created, :location => @add_to_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @add_to_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def group_params\n params.require(:group).permit(:nom, :salle, :tache)\n end",
"def group_key_params\n params.require(:group_key).permit(:group_total)\n end",
"def group_params\n params.require(:group).permit(:name, :description, :logo, :group_category_id)\n end",
"def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration])\n if @group.save\n params[:group][:users].each do |u|\n Membership.create(group: @group, user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def flavor_group_params\n params.require(:flavor_group).permit(:name, :mnemonic, {flavor_ids: []}, :poster)\n end",
"def create\n @size = Size.new(size_params)\n\n respond_to do |format|\n if @size.save\n format.html { redirect_to @size, notice: 'Size was successfully created.' }\n format.json { render action: 'show', status: :created, location: @size }\n else\n format.html { render action: 'new' }\n format.json { render json: @size.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @esol_group = EsolGroup.new(params[:esol_group])\n\n respond_to do |format|\n if @esol_group.save\n format.html { redirect_to @esol_group, notice: 'Esol group was successfully created.' }\n format.json { render json: @esol_group, status: :created, location: @esol_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @esol_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @group = Group.new(group_params)\n @group.create_robotsurvey()\n @group.create_signupsurvey()\n @group.create_poststudysurvey()\n respond_to do |format|\n if @group.save\n \n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def to_groups\n message = AssignTasksToGroups.new(params).perform\n json_response({message: message}, :created)\n end",
"def create\n @outgoing_sms_content_group = OutgoingSmsContentGroup.new(params[:outgoing_sms_content_group])\n\n respond_to do |format|\n if @outgoing_sms_content_group.save\n flash[:notice] = 'OutgoingSmsContentGroup was successfully created.'\n format.html { redirect_to(@outgoing_sms_content_group) }\n format.xml { render :xml => @outgoing_sms_content_group, :status => :created, :location => @outgoing_sms_content_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @outgoing_sms_content_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def group_params\n params[:group]\n end",
"def group_params\n params[:group]\n end",
"def group_params\n params[:group]\n end",
"def group_params\n params.require(:group).permit(:group_name)\n end",
"def sub_group_params\n params.require(:sub_group).permit(:name, :group_id)\n end",
"def request_group_params\n params.require(:request_group).permit(:title, :description)\n end",
"def group_params\n params.require(:group).permit(:name)\n end"
] |
[
"0.5995169",
"0.58783054",
"0.5840016",
"0.56524163",
"0.55683625",
"0.55562866",
"0.5534543",
"0.55304486",
"0.5512635",
"0.5499622",
"0.54731584",
"0.5427323",
"0.5425655",
"0.5409382",
"0.5392204",
"0.53908646",
"0.53552854",
"0.53524065",
"0.5310443",
"0.52829945",
"0.52774894",
"0.5263141",
"0.5244998",
"0.5244998",
"0.5240593",
"0.52283704",
"0.5222331",
"0.52097315",
"0.5207747",
"0.5202225",
"0.5189787",
"0.5189787",
"0.51693135",
"0.5166603",
"0.5152048",
"0.51404446",
"0.5129453",
"0.5118436",
"0.5100947",
"0.50986314",
"0.50746655",
"0.50638336",
"0.5058216",
"0.5052567",
"0.5040169",
"0.5034743",
"0.50252426",
"0.50236726",
"0.50224847",
"0.5006268",
"0.5004252",
"0.49973562",
"0.4986987",
"0.49867436",
"0.49779877",
"0.4970573",
"0.496821",
"0.49671364",
"0.4964291",
"0.49639866",
"0.49545702",
"0.4954323",
"0.49467304",
"0.4946542",
"0.49438655",
"0.49424562",
"0.493761",
"0.49368945",
"0.49259764",
"0.4920021",
"0.49197346",
"0.49191585",
"0.4906104",
"0.49031103",
"0.4902504",
"0.49004298",
"0.48996958",
"0.48943728",
"0.4888173",
"0.48878294",
"0.4887567",
"0.48825738",
"0.48801664",
"0.48789465",
"0.4874985",
"0.48739672",
"0.48738024",
"0.48674533",
"0.48657057",
"0.48654816",
"0.48646995",
"0.48622742",
"0.48619202",
"0.4858311",
"0.4858311",
"0.4858311",
"0.4856009",
"0.485499",
"0.48547557",
"0.485354"
] |
0.7314921
|
0
|
PUT /size_groups/1 PUT /size_groups/1.xml
|
def update
@size_group = SizeGroup.find(params[:id])
result = @size_group.update_attributes(params[:size_group])
if result
for size in params[:size]
new_size = Size.new(size)
new_size.save
@size_group.sizes << new_size
end
for id,size in params[:existing_size]
if size.has_key? :delete
Size.delete(id)
else
this_size = Size.find(id)
this_size.update_attributes(size)
end
end if params[:existing_size]
end
respond_to do |format|
if result
flash[:notice] = 'SizeGroup was successfully updated.'
format.html { redirect_to([:admin, @size_group]) }
format.xml { head :ok }
else
format.html { render :action => "edit" }
format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def update\n\n if @size_group.update_attributes(params[:size_group])\n flash[:notice] = 'SizeGroup was successfully updated.'\n render :partial => 'show', :object => @size_group\n else\n render :partial => 'edit', :object => @size_group, :status => 409\n end\n end",
"def create\n @size_group = SizeGroup.new(params[:size_group])\n result = @size_group.save\n if result\n for size in params[:size]\n new_size = Size.new(size)\n new_size.save\n @size_group.sizes << new_size\n end\n end\n respond_to do |format|\n if result\n flash[:notice] = 'SizeGroup was successfully created.'\n format.html { redirect_to([:admin, @size_group]) }\n format.xml { render :xml => @size_group, :status => :created, :location => @size_group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @size_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def destroy\n @size_group = SizeGroup.find(params[:id])\n @size_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_size_groups_url) }\n format.xml { head :ok }\n end\n end",
"def update\n if ((params.has_key?(:group_size)) && (not params[:group_size].empty?))\n update_max_group_size(params[:group_size])\n end\n if ((params.has_key?(:group_reader)) && (not params[:group_reader].empty?))\n update_group_readers(params[:group_reader])\n end\n redirect_to admin_path\n end",
"def update\n if @size.update(size_params)\n render json: @size, status: :ok#, location: @size\n else\n render json: @size.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @small_group.update(small_group_params)\n format.html { redirect_to @small_group, notice: 'Small group was successfully updated.' }\n format.json { render :show, status: :ok, location: @small_group }\n else\n format.html { render :edit }\n format.json { render json: @small_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_sizes\n @size = Size.find(params[:id])\n end",
"def update\n logger.info \"Put parameters: #{params.to_json}\"\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def set_small_group\n @small_group = SmallGroup.find(params[:id])\n end",
"def set_size\n @size = Size.find(params[:id])\n end",
"def set_size\n @size = Size.find(params[:id])\n end",
"def show\n @size_group = SizeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def show\n @size_group = SizeGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def new\n @size_group = SizeGroup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @size_group }\n end\n end",
"def destroy\n @size_group.destroy\n\n render :nothing => true\n end",
"def UpdateGroup params = {}\n \n APICall(path: 'groups.json',method: 'PUT',payload: params.to_json)\n \n end",
"def put(obj, which=:groups)\n path = \"/#{which}\"\n path += \"/#{obj['ID']}\" unless obj['ID'].nil? \n resp = self.class.post(path, { :body => obj })\n check_errors resp\n res = resp.parsed_response['Response']['Entry']\n rebuild_groups! res\n res\n end",
"def update\n respond_to do |format|\n if @size.update(size_params)\n format.html { redirect_to [:admin, @size], notice: t('messages.updated', model:Size.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @size.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group.update(group_params)\n respond_with(@group)\n end",
"def update\n\n if @group.update(group_params)\n head :no_content\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"def update\n\n if @size.update_attributes(params[:size])\n flash[:notice] = 'Size was successfully updated.'\n render :partial => 'show', :object => @size\n else\n render :partial => 'edit', :object => @size, :status => 409\n end\n end",
"def update\n respond_to do |format|\n if @s_group.update(s_group_params)\n #format.html { redirect_to @s_group, notice: 'S group was successfully updated.' }\n format.html { redirect_to '/s_groups' }\n format.json { render :show, status: :ok, location: @s_group }\n else\n format.html { render :edit }\n format.json { render json: @s_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @esol_group = EsolGroup.find(params[:id])\n\n respond_to do |format|\n if @esol_group.update_attributes(params[:esol_group])\n format.html { redirect_to @esol_group, notice: 'Esol group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @esol_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = SuperSimpleCms::Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to super_simple_group_path(@group) } \n format.js { redirect_to formatted_super_simple_group_path(@group, :js) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.js { render :action => \"new\", :layout=>false}\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @microsites_group.update(microsites_group_params)\n format.html { redirect_to @microsites_group, notice: 'Microsites group was successfully updated.' }\n format.json { render :show, status: :ok, location: @microsites_group }\n else\n format.html { render :edit }\n format.json { render json: @microsites_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n \n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n\n respond_to do |format|\n if @objectgrouptoobjectgroup.update_attributes(params[:objectgrouptoobjectgroup])\n flash[:notice] = 'Objectgrouptoobjectgroup was successfully updated.'\n format.html { redirect_to(@objectgrouptoobjectgroup) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @objectgrouptoobjectgroup.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @add_to_group = AddToGroup.find(params[:id])\n\n respond_to do |format|\n if @add_to_group.update_attributes(params[:add_to_group])\n format.html { redirect_to(@add_to_group, :notice => 'Add to group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @add_to_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @size.update(size_params)\n format.html { redirect_to @size, notice: 'Size was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @size.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to( view_group_path(@group.label), :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.json { head :no_content }\n else\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @request_group.update(request_group_params)\n format.html { redirect_to @request_group, \n\t\t\t\t\t\t\t\t\t\t\tnotice: 'Request group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @request_group.errors, \n\t\t\t\t\t\t\t\t\t\t\tstatus: :unprocessable_entity }\n end\n end\n end",
"def update\n group = Group.find(params[:id])\n if group.update(group_params)\n render json: group\n else\n render json: group.errors.full_messages, status: :unprocessable_entity\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n if @group.update_attributes(params[:group])\n flash[:notice] = t('flash_msg47')\n @groups = Group.all\n # format.html { redirect_to(@group) }\n # format.xml { head :ok }\n else\n # format.html { render :action => \"edit\" }\n # format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end",
"def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = '{object} was successfully {action}.'[:object_action_notice, \"Group\"[], \"updated\"[]]\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def resize_node_group 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_resize_node_group_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::Longrunning::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @attribute_group = AttributeGroup.find(params[:id])\n\n respond_to do |format|\n if @attribute_group.update_attributes(params[:attribute_group])\n format.html { redirect_to(@attribute_group, :notice => 'Attribute group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attribute_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to groups_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @admin_size.update(admin_size_params)\n format.html { redirect_to admin_sizes_path, notice: 'Size was successfully updated.' }\n format.json { render :show, status: :ok, location: @admin_size }\n else\n format.html { render :edit }\n format.json { render json: @admin_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @os_groups_membership.update(os_groups_membership_params)\n format.html { redirect_to @os_groups_membership, notice: 'Os groups membership was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_groups_membership }\n else\n format.html { render :edit }\n format.json { render json: @os_groups_membership.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Группа обновлена!' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @move_size = MoveSize.find(params[:id])\n\n moving_box_kits = params[:moving_box_kit]\n moving_box_kit_ids = []\n moving_box_kits.each {|k,v| moving_box_kit_ids << k.to_i} if moving_box_kits\n\n respond_to do |format|\n if @move_size.update_attributes(params[:move_size])\n\n @move_size.moving_box_kits.delete_all\n @move_size.moving_box_kits << MovingBoxKit.find(moving_box_kit_ids)\n\n format.html { redirect_to(@move_size, :notice => 'Move size was successfully updated.') }\n format.xml { head :ok }\n else\n @used_card_board_box_products = UsedCardBoardBoxProduct.find(:all, :order => 'pounds')\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @move_size.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @outgoing_sms_content_group = OutgoingSmsContentGroup.find(params[:id])\n\n respond_to do |format|\n if @outgoing_sms_content_group.update_attributes(params[:outgoing_sms_content_group])\n flash[:notice] = 'OutgoingSmsContentGroup was successfully updated.'\n format.html { redirect_to(@outgoing_sms_content_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @outgoing_sms_content_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update options = {}\n\n group_opts = group_options(options) \n\n # tags must be updated using a separate request from the\n # other attributes, *sigh*\n if tags = group_opts.delete(:tags)\n tags.map(&:to_hash).each do |tag|\n tag[:resource_type] = 'auto-scaling-group'\n tag[:resource_id] = name\n end\n client.create_or_update_tags(:tags => tags)\n end\n\n unless group_opts.empty?\n client_opts = group_opts.merge(:auto_scaling_group_name => name)\n client.update_auto_scaling_group(client_opts)\n end\n\n nil\n\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Le groupe a été modifié.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @collection_group.update(collection_group_params)\n format.html { redirect_to @collection_group, notice: 'Collection group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @collection_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @eqvgroup.update(eqvgroup_params)\n format.html { redirect_to @eqvgroup, notice: 'Эквивалентная группа обновлена.' }\n format.json { render :show, status: :ok, location: @eqvgroup }\n else\n format.html { render :edit }\n format.json { render json: @eqvgroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"def addGroupToServer(group)\n path = \"/user/\" + @@conf[\"username\"] + \"/group/\" + group.strip\n res = HttpRequest.new(:put, path).send(@@host)\n puts res\n puts \"CODE: \" + res.code\n\nend",
"def update_nodegroup(nodegroup_json, nodegroup_id)\n nodemgr_rest_call(\"POST\", \"classifier\", \"groups\", $credentials, id=nodegroup_id, nodegroup_json)\nend",
"def update\n @group.name = params['name']\n @group.save\n respond_to do |format|\n format.json { render :show, status: :ok, location: @group }\n end\n end",
"def update\n respond_to do |format|\n if @api_v1_group_update.update(api_v1_group_update_params)\n format.html { redirect_to @api_v1_group_update, notice: 'Group update was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_group_update }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_group_update.errors, status: :unprocessable_entity }\n end\n end\n end",
"def set_admin_size\n @admin_size = Size.find(params[:id])\n end",
"def update\n @group = WorkGroup.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(@group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n params[:grouping].delete :parent_id if (@grouping.root? or (params[:grouping][:parent_id].to_i == params[:id].to_i))\n \n respond_to do |format|\n if @grouping.update_attributes(params[:grouping])\n gflash :success => \"Group updated.\"\n format.html { redirect_to edit_grouping_path(@grouping) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @grouping.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find_by_param(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to(@group, :notice => 'Group was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n flash[:notice] = \"User group <em>#{@user_group.name}</em> updated.\"\n format.html { redirect_to(@user_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @size_group = SizeGroup.new(params[:size_group])\n\n if @size_group.save\n flash[:notice] = 'SizeGroup was successfully created.'\n if params[:product_id]\n render :partial => 'select_option', :object => @size_group\n else\n render :partial => 'element_container', :object => @size_group\n end\n else\n render :partial => 'new', :object => @size_group, :status => 409\n end\n end",
"def update\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n\n respond_to do |format|\n if @outgoing_sms_number_group.update_attributes(params[:outgoing_sms_number_group])\n flash[:notice] = 'OutgoingSmsNumberGroup was successfully updated.'\n format.html { redirect_to(@outgoing_sms_number_group) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @outgoing_sms_number_group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n invite_members\n format.html { redirect_to @group, notice: t('flash.notice.groups.successfully_updated') }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_group(increment)\n end",
"def update\n @meta_data_group = MetaDataGroup.find(params[:id])\n\n respond_to do |format|\n if @meta_data_group.update_attributes(params[:meta_data_group])\n format.html { redirect_to @meta_data_group, notice: 'MetaData group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meta_data_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @size = Admin::Size.new(size_params)\n\n if @size.save\n render json: @size, status: :created#, location: @size\n else\n render json: @size.errors, status: :unprocessable_entity\n end\n end",
"def update\n if @group.update_attributes(params[:group])\n respond_with(@group, only: [:id, :name, :creator_id, :admin_id])\n else\n render_error(404, request.path, 20103, \"Failed to update group info\")\n end\n end",
"def update\n @group = Group.find_by_guid(params[:id])\n respond_to do |format|\n if @group.update_attributes(update_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render json: @group }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @flavor_group.update(flavor_group_params)\n format.html { redirect_to @flavor_group, notice: 'Flavor group was successfully updated.' }\n format.json { render :show, status: :ok, location: @flavor_group }\n else\n format.html { render :edit }\n format.json { render json: @flavor_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def generate(groups)\n groups_params = groups.inject({}) do |params, (k, v)|\n params[\"groups[#{k}]\"] = 1\n params\n end\n\n response = RouteNGN.put self.class.base_url, {:id => self.id}.merge!(groups_params)\n response.success?\n end",
"def update\n respond_to do |format|\n if @resource.update(group_params)\n # Load records in order to refresh index page\n index\n flash[:success] = t('notices.updated_successfully')\n format.html { redirect_to @resource, warning: 'Group was successfully updated.'}\n format.json { render :show, status: :ok, location: @resource }\n else\n format.html { render :edit }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end",
"def update\r\n respond_to do |format|\r\n if @agroup.update(agroup_params)\r\n format.html { redirect_to @agroup, notice: 'Agroup 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: @agroup.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n respond_to do |format|\n if @master_size.update(master_size_params)\n format.html { redirect_to @master_size, notice: 'Size was successfully updated.' }\n format.json { render :show, status: :ok, location: @master_size }\n else\n format.html { render :edit }\n format.json { render json: @master_size.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, :notice => 'Group was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def assign_group(group_size, students)\n\nend",
"def update\n @group = Group.find(params[:id])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to root_path }\n format.js\n # format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n # format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_should_update_group_user_via_API_JSON\r\n # lookup user's membership\r\n get \"memberships/find.json?api_key=testapikey&user_id=4&group_id=1\"\r\n membership = JSON.parse(response.body)\r\n membership_id = membership['id']\r\n assert membership_id == 3, 'Incorrect membership id'\r\n assert membership['role_id'] == Role.find_by_rolename('user').id, 'Incorrect role id'\r\n \r\n # promote user to group admin\r\n put \"/memberships/#{membership_id}.xml\", :api_key => 'testapikey',\r\n :membership => {:user_id => 4,\r\n :group_id => 1,\r\n :role_id => Role.find_by_rolename('group_admin') }\r\n assert_response :success\r\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @group = Group.find(params[:id])\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n counter = 0\n groupCounter = 1\n if !params[:group].nil?\n $inspectparams = params[:group]\n params[:group].each do |group|\n if groupCounter > $groupUpdateNumber || group[:id] == \"\"\n puts \"WORKKKK\"\n break if group[:group_name] == \"\" || group[:end_time] == \"\"\n @group = current_user.groups.build(group_name: group[:group_name].downcase, end_time: group[:end_time], group_day: group[:group_day], conversation_id: group[:conversation_id], time_zone: current_user.time_zone)\n @group.save\n end\n break if group[:group_name] == \"\" || group[:end_time] == \"\"\n @groupUpdate = Group.find_by(id: group[:id])\n @groupUpdate.update(group_name: group[:group_name].downcase, end_time: group[:end_time], time_zone: current_user.time_zone) if !@groupUpdate.nil?\n puts \"this is @group: \" + @group.inspect.to_s\n groupCounter += 1\n counter += 1\n end\n end\n redirect_to root_path, notice: \"successfully updated your classes\"\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @group.update(group_params)\n format.html { redirect_to @group, notice: 'Group was successfully updated.' }\n format.json { render :show, status: :ok, location: @group }\n else\n format.html { render :edit }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.70120364",
"0.69220966",
"0.64207184",
"0.6169009",
"0.61627525",
"0.61554444",
"0.6005169",
"0.5867542",
"0.5837684",
"0.5837",
"0.5837",
"0.582717",
"0.582717",
"0.58034146",
"0.57465315",
"0.57335705",
"0.57080644",
"0.56834555",
"0.568102",
"0.5675042",
"0.5661914",
"0.56580776",
"0.56458026",
"0.56413907",
"0.5629093",
"0.5602896",
"0.55914396",
"0.5575054",
"0.55746263",
"0.5574412",
"0.55738205",
"0.5564129",
"0.55629396",
"0.55538696",
"0.55482626",
"0.5543436",
"0.55356187",
"0.5531221",
"0.5531221",
"0.55227596",
"0.55224234",
"0.5519921",
"0.5519921",
"0.5519921",
"0.5519921",
"0.5519921",
"0.5519921",
"0.5516881",
"0.5498014",
"0.54904073",
"0.54865456",
"0.54821336",
"0.54784685",
"0.5474317",
"0.5461447",
"0.5452456",
"0.54409915",
"0.5437198",
"0.54263186",
"0.5421896",
"0.54197305",
"0.54160947",
"0.5415957",
"0.5407082",
"0.5404665",
"0.5398602",
"0.5395213",
"0.53927505",
"0.53856254",
"0.53783345",
"0.5376625",
"0.5365308",
"0.53607357",
"0.534944",
"0.53479546",
"0.5343355",
"0.53412074",
"0.5340496",
"0.5340324",
"0.5340221",
"0.53373635",
"0.5336218",
"0.5335426",
"0.533",
"0.53207725",
"0.5319786",
"0.5319786",
"0.5319786",
"0.5318502",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307",
"0.5318307"
] |
0.72886235
|
0
|
DELETE /size_groups/1 DELETE /size_groups/1.xml
|
def destroy
@size_group = SizeGroup.find(params[:id])
@size_group.destroy
respond_to do |format|
format.html { redirect_to(admin_size_groups_url) }
format.xml { head :ok }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @size_group.destroy\n\n render :nothing => true\n end",
"def destroy\n Group.rebuild! if nil.|Group.find(:first).rgt\n\t @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @attribute_group = AttributeGroup.find(params[:id])\n @attribute_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(attribute_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @add_to_group = AddToGroup.find(params[:id])\n @add_to_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(add_to_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @outgoing_sms_content_group = OutgoingSmsContentGroup.find(params[:id])\n @outgoing_sms_content_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(outgoing_sms_content_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @grouping.destroy\n\n respond_to do |format|\n format.html { redirect_to(groupings_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n #@s_group.destroy\n @s_group = SGroup.find(params[:id].to_i)\n @s_group.delete_flg = 1\n @s_group.save!\n\n respond_to do |format|\n format.html { redirect_to s_groups_url, notice: 'S group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def netdev_resxml_delete( xml )\n top = netdev_resxml_top( xml )\n par = top.instance_variable_get(:@parent)\n par['delete'] = 'delete'\n end",
"def destroy\n @image_gallery_group = ImageGalleryGroup.find(params[:id])\n @image_gallery_group.destroy\n\n respond_to do |format|\n format.html { redirect_to( admin_image_gallery_groups_url ) }\n format.xml { head :ok }\n end\n end",
"def test_set3_04b_delete_group()\n group = \"test_group\"\n user = \"test_user\"\n \n @test_acl.create_principal(user)\n @test_acl.create_group(group, [\"ALL\"], [user])\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n #puts query\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(1, hits)\n \n @test_acl.delete_principal(group)\n \n query = \"doc(\\\"#{@col_path}Principals.xml\\\")//node()[@id=\\\"#{user}\\\"]/membership/mgroup[@idref=\\\"#{group}\\\"]\"\n handle = @db.execute_query(query)\n hits = @db.get_hits(handle)\n assert_equal(0, hits)\n end",
"def destroy\n @ail_group = AilGroup.find(params[:id])\n @ail_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(ail_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n \n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def service_group_delete(a10, name)\n a10.send(:axapi, 'slb.service_group.delete', 'post', {name: name, format: 'json'})\nend",
"def destroy\n Group.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @expensegroup = Expensegroup.find(params[:id])\n @expensegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(expensegroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @small_group.destroy\n respond_to do |format|\n format.html { redirect_to small_groups_url, notice: 'Small group was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n authorize @group, :destroy?\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(browse_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group.destroy\n\n head :no_content\n end",
"def destroy\n @group = Group.find_by_param(params[:id])\n @group.tuners.clear\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n group = Group.find(params[:group_id])\n\n @subgroup = group.subgroups.find(params[:id])\n @subgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_subgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @radio_group = RadioGroup.find(params[:id])\n @radio_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(radio_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n\n @group_definition = GroupDefinition.find(params[:id])\n @group_definition.destroy\n\n respond_to do |format|\n format.html do\n if request.env['HTTP_REFERER']\n redirect_to(:back)\n else\n redirect_to(group_definitions_url)\n end\n end\n format.xml do\n head :ok\n end\n end\n end",
"def destroy\n @server_group = ServerGroup.find(params[:id])\n xml=@server_group.to_xml\n json=@server_group.to_json\n @server_group.update_attribute('historical', true)\n\tAsyncExec.run_job(MakeGroupHistorical, @server_group.id)\n\n respond_to do |format|\n format.html { redirect_to(server_groups_url) }\n format.json { render :json => json }\n format.xml { render :xml => xml }\n end\n\n end",
"def destroy\n @jido_grp_rel = JidoGrpRel.find(params[:id])\n @jido_grp_rel.destroy\n\n respond_to do |format|\n format.html { redirect_to(jido_grp_rels_url) }\n format.xml { head :ok }\n end\n end",
"def test_delete\n g = [22058]\n Group.delete(g)\n end",
"def destroy\n @group.destroy unless @group.default\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @targetgroup = Targetgroup.find(params[:id])\n @targetgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(targetgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @record_group = RecordGroup.find(params[:id])\n @record_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(record_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @size.destroy\n\n render json: @size, status: :ok#, location: @size\n end",
"def destroy\n @partical_size = ParticalSize.find(params[:id])\n @partical_size.destroy\n\n respond_to do |format|\n format.html { redirect_to(partical_sizes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @objectgrouptoobjectgroup = Objectgrouptoobjectgroup.find(params[:id])\n @objectgrouptoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(objectgrouptoobjectgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @esol_group = EsolGroup.find(params[:id])\n @esol_group.destroy\n\n respond_to do |format|\n format.html { redirect_to esol_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group_of_task = GroupOfTask.find(params[:id])\n @group_of_task.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_of_tasks_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group_stat = GroupStat.find(params[:id])\n @group_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to group_stats_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @routinetoobjectgroup = Routinetoobjectgroup.find(params[:id])\n @routinetoobjectgroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(routinetoobjectgroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @grupo = Grupo.find(params[:id])\n @grupo.destroy\n\n respond_to do |format|\n format.html { redirect_to(grupos_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @machine_engine_size = MachineEngineSize.find(params[:id])\n @machine_engine_size.destroy\n\n respond_to do |format|\n format.html { redirect_to(machine_engine_sizes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.any(:html,:iphone) { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @target_group = TargetGroup.find(params[:id])\n @target_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_target_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n head :no_content\n end",
"def destroy\n @slicegroup = Slicegroup.find(params[:id])\n @slicegroup.destroy\n\n respond_to do |format|\n format.html { redirect_to(slicegroups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @measure_group = MeasureGroup.find(params[:id])\n @measure_group.destroy\n\n respond_to do |format|\n format.html { redirect_to measure_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @meta_data_group = MetaDataGroup.find(params[:id])\n @meta_data_group.destroy\n\n respond_to do |format|\n format.html { redirect_to meta_data_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group_key.destroy\n respond_to do |format|\n format.html { redirect_to group_keys_url }\n format.json { head :no_content }\n end\n end",
"def delete_related_groups\n \n end",
"def destroy\n @outgoing_sms_number_group = OutgoingSmsNumberGroup.find(params[:id])\n @outgoing_sms_number_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(outgoing_sms_number_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @size.destroy\n\n render :nothing => true\n end",
"def destroy\n @group = Group.find(params[:id])\n\n mbs = Membership.where \"group_id = ?\", @group.id\n\n mbs.each do |m|\n m.destroy\n end\n\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @group = WorkGroup.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @user_group = UserGroup.find(params[:id])\n @user_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(user_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group_request.destroy\n respond_to do |format|\n format.html { redirect_to group_requests_url }\n format.json { head :no_content }\n end\n end",
"def delete_group(uuid)\n Uploadcare::Group.delete(uuid)\n end",
"def destroy\n @down_size = DownSize.find(params[:id])\n @down_size.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_down_sizes_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @move_size = MoveSize.find(params[:id])\n @move_size.destroy\n\n respond_to do |format|\n format.html { redirect_to(move_sizes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @content_group_element = ContentGroupElement.find(params[:id])\n @content_group_element.destroy\n\n respond_to do |format|\n format.html { redirect_to content_group_elements_url }\n format.json { head :ok }\n end\n end",
"def deleteEntityGroup( entity_id, gen_id)\n params = Hash.new\n params['entity_id'] = entity_id\n params['gen_id'] = gen_id\n return doCurl(\"delete\",\"/entity/group\",params)\n end",
"def destroy\n @size.destroy\n respond_to do |format|\n format.html { redirect_to sizes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @request_group.destroy\n respond_to do |format|\n format.html { redirect_to request_groups_url }\n format.json { head :no_content }\n end\n end",
"def deleteGroup( group_id)\n params = Hash.new\n params['group_id'] = group_id\n return doCurl(\"delete\",\"/group\",params)\n end",
"def delete_group\r\n if request.post?\r\n @group=Group.find_by_id(params[:id], :conditions=>['account_id = ?',session[:account_id]])\r\n if @group.nil?\r\n flash[:error] = \"Invalid action.\"\r\n else\r\n flash[:success]= \"Group \" + @group.name + \" was deleted successfully \"\r\n @group.destroy\r\n @group_devices = Device.find(:all, :conditions=>['group_id=?',@group.id])\r\n for device in @group_devices\r\n device.icon_id =\"1\"\r\n device.group_id = nil\r\n device.save\r\n end\r\n end\r\n end\r\n redirect_to :action=>\"groups\"\r\n end",
"def destroy\n @adsize = Adsize.find(params[:id])\n @adsize.destroy\n\n respond_to do |format|\n format.html { redirect_to(:action => 'index') and return }\n format.xml { head :ok }\n end\n end",
"def destroy\n @product_size = ProductSize.find(params[:id])\n @product_size.destroy\n\n respond_to do |format|\n format.html { redirect_to(product_sizes_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group_banner = GroupBanner.find(params[:id])\n @group_banner.destroy\n\n respond_to do |format|\n format.html { redirect_to(group_banners_url) }\n format.xml { head :ok }\n end\n end",
"def delete_group(group)\n\t\t\tend",
"def delete_group(group)\n\t\t\tend",
"def destroy\n @lab_group = LabGroup.find(params[:id])\n @lab_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(lab_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @transaction_group = TransactionGroup.find(params[:id])\n @transaction_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(transaction_groups_url) }\n format.xml { head :ok }\n end\n end",
"def del(id, which=:groups)\n resp = self.class.delete(\"/#{which}/#{id}\")\n check_errors resp\n end",
"def delete!\n PoolNode.rmdir(@id)\n super\n Address.delete(@id)\n Subnet.delete(@subnet)\n end",
"def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"def destroy\n @browsenodeid = Browsenodeid.find(params[:id])\n @browsenodeid.destroy\n\n respond_to do |format|\n format.html { redirect_to(browsenodeids_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @giving_group = GivingGroup.find(params[:id])\n @giving_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(giving_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @admin_size.destroy\n respond_to do |format|\n format.html { redirect_to admin_sizes_url, notice: 'Size was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @group = SuperSimpleCms::Group.find(params[:id])\n respond_to do |format| \n if SuperSimpleCms::Group.find(:all).length > 1\n @group.destroy \n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :ok }\n format.xml { head :ok }\n else\n format.html { redirect_to(super_simple_groups_url) }\n format.js { head :failure }\n format.xml { head :failure }\n end\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n format.xml { head :ok }\n end\n end",
"def delete_data(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\")\n req = HTTP::Post.new(uri)\n req.content_type = 'text/xml'\n req.body = '<delete><query>*:*</query></delete>'\n response = @client.send_http(req, true, ['200'])\n end",
"def destroy\n @provider_group = ProviderGroup.find(params[:id])\n @provider_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(provider_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_contact_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group = Group.find(params[:id])\n\t\t@pages = Page.where(:category => 'group', :owner => @group.id)\n\t\t@pages.each do |p|\n\t\t\tp.destroy\n\t\tend\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to groups_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @eqvgroup.destroy\n respond_to do |format|\n format.html { redirect_to eqvgroups_url, notice: 'Эквивалентная группа удалена.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n\n\t\t@group = Group.find(params[:id])\n\t\t@group.destroy\n\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to(groups_url) }\n\t\t\tformat.xml { head :ok }\n\t\tend\n\tend",
"def destroy\n # @group = @hub.groups.get(params[:id])\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_groups_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @contact_group = ContactGroup.find(params[:id])\n @contact_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(contact_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @recruitment_group = RecruitmentGroup.find(params[:id])\n @recruitment_group.destroy\n\n respond_to do |format|\n format.html { redirect_to(recruitment_groups_url) }\n format.xml { head :ok }\n end\n end",
"def destroy\n @group.destroy\n\n respond_to do |format|\n format.html { redirect_to(groups_url) }\n format.xml { head :ok }\n format.js { render :nothing => true }\n end\n end",
"def destroy\n @exam_group = ExamGroup.shod(params[:id])\n authorize! :delete, @exam_group\n batch = @exam_group.batch\n @exam_group.destroy\n flash[:notice] = 'Exam Group deleted successfully!'\n redirect_to exam_group_path(batch)\n end",
"def DeleteGroup id\n \n APICall(path: \"groups/#{id}.json\",method: 'DELETE')\n \n end",
"def destroy\n chef_server_rest.delete(\"nodes/#{name}\")\n end"
] |
[
"0.68580616",
"0.6644248",
"0.65351576",
"0.6386295",
"0.63792574",
"0.6376121",
"0.63417333",
"0.63287413",
"0.62927246",
"0.62733734",
"0.62576354",
"0.62544245",
"0.6248362",
"0.6243852",
"0.62153274",
"0.62153274",
"0.6206107",
"0.6206107",
"0.6206107",
"0.6206107",
"0.6206107",
"0.6206107",
"0.6206107",
"0.6206107",
"0.6201561",
"0.61927575",
"0.61807114",
"0.61753666",
"0.6174216",
"0.6170169",
"0.61657727",
"0.61144555",
"0.61059105",
"0.60938483",
"0.6090288",
"0.60847735",
"0.60830635",
"0.6080223",
"0.6069416",
"0.6067474",
"0.6065155",
"0.606383",
"0.6059754",
"0.60554993",
"0.60465586",
"0.6039091",
"0.6037522",
"0.6036147",
"0.6033343",
"0.60292715",
"0.6022574",
"0.6017864",
"0.60140824",
"0.6009871",
"0.6009448",
"0.60058373",
"0.6002567",
"0.5997073",
"0.59794205",
"0.5971367",
"0.59667605",
"0.5960813",
"0.59597373",
"0.59504074",
"0.59467196",
"0.5943457",
"0.59342533",
"0.5925752",
"0.59242994",
"0.5923477",
"0.5913483",
"0.59108526",
"0.5901277",
"0.59009135",
"0.59000313",
"0.5898275",
"0.5898275",
"0.5890494",
"0.58900875",
"0.58884215",
"0.5885833",
"0.5875719",
"0.58682835",
"0.5867484",
"0.58585775",
"0.58521837",
"0.58501714",
"0.5847966",
"0.5844744",
"0.58415097",
"0.583996",
"0.58361024",
"0.5826816",
"0.5826221",
"0.5822151",
"0.5820415",
"0.5818626",
"0.58126986",
"0.58097917",
"0.5799209"
] |
0.7525298
|
0
|
Get API URL for projects
|
def project_url project_id
server = lookup_server_from_project(project_id)
pivotal_url = server[:url]
{ :url => "#{pivotal_url}/projects/#{project_id}", :token => server[:token] }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def api_url\n \"#{@@base_url}/#{format}/#{resource}?apikey=#{@@api_key}#{parameters}\"\n end",
"def api_url\n \"#{protocol}://api:#{api_key}@#{host}/#{api_version}\"\n end",
"def url\n api_url\n end",
"def api_url(url = '')\n configuration.api_base + url\n end",
"def api_url\n base_url.concat api_query_parameter\n end",
"def api_url\n base_url.concat api_query_parameter\n end",
"def api_url\n api_key? ? base_url.concat(api_query_parameter) : base_url\n end",
"def api_url\n @api_url ||=\"#{base_url}#{@options['api_url']}\"\n end",
"def human_url\n return data()['project_uri']\n end",
"def api_url\n @api_url ||= URI.parse(::File.join(base_url, endpoint))\n end",
"def external_base_url\n Gitlab::Routing.url_helpers.project_url(project)\n end",
"def api_url\n @api_url ||= URI.parse(\"#{super}?#{URI.encode_www_form(query_params)}\")\n end",
"def api_url\n @api_url || DEFAULT_API_URL\n end",
"def api_url\n @api_url || DEFAULT_API_URL\n end",
"def api_url\n @@API_URL\n end",
"def url\n return @url if @url\n\n case environment\n when :production\n PRODUCTION_API_ENDPOINT\n when :sandbox\n SANDBOX_API_ENDPOINT\n end\n end",
"def url\n @url || API_ENDPOINT\n end",
"def githubAPIEndpoint()\n domain = 'api.github.com' unless ENV['HOMEBREW_PIPELINE_GITHUB_DOMAIN']\n return \"https://#{domain}/\"\n end",
"def url_for_project_directory( project, options = nil )\n # setup_project_urls( project )\n # return the base url for this project\n project.domain + project.directory_url\n end",
"def project_url\n project_hash['html_url']\n end",
"def url(path)\n \"#{API}/#{path}\"\n end",
"def api_url\n authentication_credentials_provided? ? \"https://api.gowalla.com\" : \"http://api.gowalla.com\"\n end",
"def base_url\n BASE_URL.dup % [\"%s\", \"%s\", @api_key, \"%s\"] \n end",
"def api_url\n if PagSeguro.developer?\n File.join PagSeguro.config[\"base\"], \"pagseguro_developer/confirm\"\n else\n API_URL\n end\n end",
"def api_uri\n @api_uri ||= URI(api_url)\n end",
"def api_url(path)\n path\n end",
"def api_endpoint(base_url = nil)\n base_url ||= base_github_api_url_for_remote\n if /github.com/ !~ base_url\n \"#{base_url}/api/v3\"\n else\n Octokit::Default::API_ENDPOINT\n end\n end",
"def construct_url\n @@API_URL + city + @@API_KEY\n end",
"def uri\n URI.parse(\"#{@host || DEFAULT_HOST}:#{@port || DEFAULT_PORT}/api\")\n end",
"def stories_url project_id\n server = lookup_server_from_project(project_id)\n pivotal_url = server[:url]\n { :url => \"#{pivotal_url}/projects/#{project_id}/stories\", :token => server[:token] }\nend",
"def api_url\n \"/api/projects/#{self.api_key}/files/#{self.id}/locales/#{self.locale}\"\n end",
"def base_url\n @is_sub_env_specific ? \"#{GlobalConstant::CompanyApi.root_url}#{GlobalConstant::Environment.url_prefix}/api/\"\n : \"#{GlobalConstant::CompanyApi.root_url}api/\"\n end",
"def base_url\n \"http#{configuration[:secure] ? 's' : ''}://#{configuration[:api_url]}/v#{configuration[:api_version]}\"\n end",
"def base_url\n \"http#{configuration[:secure] ? 's' : ''}://#{configuration[:api_url]}/v#{configuration[:api_version]}\"\n end",
"def api_url(resource = \"\", params = {})\n url = URI(\"https://api.github.com/#{resource}\")\n url.query = to_query(params.merge(default_api_params))\n\n url.to_s\n end",
"def get_api_url(endpoint)\n @api_base_url + endpoint\n end",
"def api_host #:nodoc:\n API_URI\n end",
"def make_url(apipath)\n @base_url + \"/api/open-v1.0/\" + apipath\n end",
"def compiled_version_uri\n '/api/projects/by_reference/' +\n ::EasyManageClient.configuration(profile).compile_id.to_s\n end",
"def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"def source_url(project)\n \"github.com/#{project.name}\"\n end",
"def get\n CircleCi.request(conf, '/projects').get\n end",
"def project(project_id)\n resource \"projects/#{project_id}\"\n end",
"def api_root\n root_url << '/api'\n end",
"def api_path\n @api_path ||= find_api_path(base_uri)\n end",
"def api_url path, params = {}\n url = File.join File.join(api_base_url, api_base_path), path\n \"#{url}?#{api_query_string params}\"\n end",
"def api_url\n raise NotImplementedError, \"#{self.class} must implement #api_url!\"\n end",
"def generate_api_url(workspace_bucket_id, filename)\n file = self.get_workspace_file(workspace_bucket_id, filename)\n if file\n file.api_url + '?alt=media'\n else\n ''\n end\n end",
"def api_base_url; @opts[:api_base_url]; end",
"def api_url(url)\n uri = URI(url.to_s)\n\n uri.scheme = server_uri.scheme if uri.scheme.nil?\n uri.host = server_uri.host if uri.host.nil?\n\n # prepend '/api/<version>/' to path if not provided\n unless uri.path =~ /^\\/api\\/\\d+\\//\n uri.path = File.join('/api', version.to_s, uri.path)\n end\n\n uri.to_s\n end",
"def base_url\n URI::HTTPS.build(host: @server, port: @port, path: @api)\n end",
"def endpoint\n cl = self.class.to_s.split(':')[-1].downcase.to_sym\n OMNITRUCK_PROJECTS[name][:endpoints][cl]\n end",
"def url\n @url || File.join(host, \"v1\")\n end",
"def endpoint_url\n # @@api_base + @request.endpoint\n ApiBase + @endpoint\n end",
"def api_url\n @api_url ||= \"https://api.neverbounce.com\"\n end",
"def pull_request_url(api_url)\n # https://api.github.com/repos/typed-ember/ember-cli-typescript/pulls/334\n api_index = api_url.index(\"api\")\n repos_index = api_url.index(\"repos\")\n pulls_index = api_url.index(\"pulls\")\n\n # https://github.com/typed-ember/ember-cli-typescript/pull/334\n html_url = api_url[0..api_index - 1] +\n api_url[api_index + \"api.\".length..repos_index - 1] +\n api_url[repos_index + \"repos/\".length..pulls_index + \"pull\".length - 1] +\n api_url[pulls_index + \"pulls\".length..-1]\n html_url\n end",
"def url_for_project_named(name)\n eval project_path\n end",
"def get_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'GetProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def api_create_url\n \"#{self.name.split(\"::\").last.downcase}\"\n end",
"def api_uri\n @api_uri ||= URI.parse(api_endpoint)\n end",
"def url_for(path, opts = {})\r\n api_host = opts[:api_host] || Moviepilot.config.api_host\r\n version = opts[:api_version] || Moviepilot.config.api_version\r\n [api_host, version, path].join('/')\r\n end",
"def projects\n resource 'projects'\n end",
"def api_base_url(environment)\n GlobalConstant::KycApiBaseDomain.get_base_domain_url_for_environment(environment)\n end",
"def jira_api_url(site, username, password)\n url = format_url(site, username, password)\n \"#{url}/#{REST_API_SEARCH_URL}\"\n end",
"def api_base_url\n \"https://#{platform}.api.riotgames.com\"\n end",
"def base_href\n '/api/v1'\n end",
"def request_url\n base_url = \"http://#{api_host}#{PATH}?\"\n base_url << \"appid=#{app_id}\"\n base_url << \"&callname=#{call_name}\"\n base_url << \"&siteid=#{site_id}\"\n base_url << \"&version=#{API_VERSION}\"\n base_url\n end",
"def get_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:query]['Action'] = 'GetProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:query]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"def api_prefix\n @api_url || DEFAULT_API_PREFIX\n end",
"def apiv2_base_url(opts)\n root_url = service_root_url(opts)\n \"#{root_url}/api/v2\"\n end",
"def api_uri\n options.endpoint\n end",
"def api_url(path_fragment)\n platform.api_url(path_fragment)\n end",
"def base_github_api_url_for_remote\n url = gitlib.remote.expanded_url(remote_name)\n Configuration.url_to_base_github_api_url(url)\n end",
"def latest_version_uri\n '/api/projects/latest_compiled_version'\n end",
"def api_endpoint\n case current_user.environment\n when 'int', 'integration'\n 'http://newapi.int.brandwatch.com'\n when 'rel', 'release', 'stage'\n 'http://newapi.rel.brandwatch.com'\n else\n 'http://newapi.brandwatch.com'\n end\n end",
"def get_api_url\n\t\t\t\"https://#{club_name}.tidyhq.com/api/v1/\"\n\t\tend",
"def endpoint\n \"#{base_url}#{base_url =~ /\\/$/ ? '' : '/'}/api/v3\"\n end",
"def api_url\n 'https://api.geoloqi.com'\n end",
"def full_url\n char = (api_env('URL') =~ /\\?/).nil? ? '?' : '&'\n api_env('URL') + \"#{char}#{api_env('PARAM')}=#{login}\"\n end",
"def api_url(path)\n return path if path.include?('//')\n \"#{api_root}/#{api_version}/#{tenancy_code}/#{path}\"\n end",
"def giturl(project_name, repo_name) ; end",
"def api_url(url = nil)\n handle_url(:api, url)\n end",
"def url\n @url = \"#{@http_mode}://#{self.config.servers[0]}\"\n @url << \"/#{self.config.context}\" if(!self.config.context.empty?)\n #self.config.log.debug_msg(\"Request base URL: #{@url}\")\n @url\n end",
"def api_url\n @sandbox ? \"http://api.sandbox.freelancer.com\":\"http://api.freelancer.com\"\n end",
"def make_project_users_url(input_project_oid)\n rally_url = @rally.rally_url + \"/webservice/\"\n wsapi_version = @rally.wsapi_version\n\n make_project_users_url = rally_url + wsapi_version +\n \"/project/\" + input_project_oid.to_s +\n \"/projectusers.js\"\n\n return make_project_users_url\n end",
"def projects\n Easybill::Api::Projects\n end",
"def base_path\n \"/api/v1\"\n end",
"def workspace_url\n \"https://app.terra.bio/#workspaces/#{self.firecloud_project}/#{self.firecloud_workspace}\"\n end",
"def api_url\n return nil unless @auth\n\n if @auth.empty?\n warn \"There are no API configurations in #{@auth_file}\"\n return nil\n end\n\n if @auth.keys.size > 1\n warn \"There are #{@auth.keys.size} API configurations in #{@auth_file}\"\n return nil\n end\n\n @auth.keys.first\n end",
"def url\n url = \"#{config.url[config.env]}/#{@path}\"\n url = \"#{url}?#{@params.to_param}\" unless @params.empty?\n url\n end",
"def api_url\n default = config('gist.default-url')\n\n @api_url ||= options.gist_api_url\n @api_url ||= default if default && defaults['api-url'].include?(default)\n @api_url ||= normalized_api_urls_from_config\n @api_url.tap { |api_url| set_credential_config_key(api_url) }\n end",
"def api_root_url path_info, query = {}\n root_url :api, path_info, query\n end",
"def uri!\n @uri = URI.parse \"#{@config.http_scheme}://#{@config.host}:#{@config.port}/api/#{@config.api_version}/\"\n end",
"def organization_url\n \"#{organization_base_url}.#{request_format}\"\n end",
"def list\n get 'projects'\n end",
"def url\n \"http://#{host}:#{port}/\"\n end",
"def api_url(endpoint)\n \"https://www.bloc.io/api/v1/#{endpoint}\"\n end",
"def infrastructures_base_url\n \"#{configuration[:on_prem_api_endpoint]}/infrastructures\"\n end",
"def get_github_api(project, endpoint)\n token = \"9874304d5d35c105f590df83c48112ff43518fba\"\n uri = URI.parse(\"https://api.github.com/repos/NuCivic/\" + project + \"/\" + endpoint + '?access_token=' + token)\n request = Net::HTTP::Get.new(uri)\n req_options = {\n use_ssl: uri.scheme == \"https\",\n }\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n JSON.parse(response.body)\n end",
"def base_url\n GlobalConstant::Base.cms[:url] + \"api/preview/\"\n end"
] |
[
"0.74141026",
"0.7386156",
"0.7374278",
"0.7340665",
"0.73117703",
"0.73117703",
"0.7289823",
"0.7239361",
"0.72179276",
"0.7103249",
"0.7100108",
"0.7074547",
"0.70710313",
"0.70709234",
"0.7026073",
"0.70146257",
"0.69928813",
"0.69693124",
"0.6960771",
"0.6940271",
"0.6929427",
"0.69025946",
"0.6894304",
"0.68909675",
"0.6890006",
"0.68837184",
"0.6880077",
"0.68558943",
"0.6844746",
"0.6825256",
"0.68106246",
"0.67970824",
"0.67780983",
"0.67780983",
"0.674041",
"0.6710248",
"0.67015356",
"0.66925484",
"0.66733944",
"0.66695255",
"0.6663591",
"0.66425306",
"0.6634954",
"0.66244394",
"0.661296",
"0.6605951",
"0.65991145",
"0.65945876",
"0.65891075",
"0.65885776",
"0.6583855",
"0.6554676",
"0.65479094",
"0.6536277",
"0.6516494",
"0.6516352",
"0.6492084",
"0.64898515",
"0.6479157",
"0.6466295",
"0.64538413",
"0.6453089",
"0.64523315",
"0.6436964",
"0.6428457",
"0.642005",
"0.64165884",
"0.64083093",
"0.6405839",
"0.64039356",
"0.64004904",
"0.6398102",
"0.63972276",
"0.6385449",
"0.6361069",
"0.635797",
"0.63546884",
"0.6349299",
"0.6349088",
"0.6343669",
"0.6343407",
"0.63366634",
"0.6332299",
"0.63300484",
"0.6324238",
"0.63201964",
"0.63177556",
"0.6317506",
"0.6308895",
"0.63083005",
"0.63068247",
"0.6303353",
"0.62890774",
"0.62819517",
"0.62814415",
"0.62766564",
"0.6268095",
"0.62661755",
"0.6262908",
"0.6262802"
] |
0.8046829
|
0
|
Get API URL for stories
|
def stories_url project_id
server = lookup_server_from_project(project_id)
pivotal_url = server[:url]
{ :url => "#{pivotal_url}/projects/#{project_id}/stories", :token => server[:token] }
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def story_url(story_id)\n \"https://www.pivotaltracker.com/story/show/#{story_id}\"\n end",
"def url\n api_url\n end",
"def url(path)\n \"#{API}/#{path}\"\n end",
"def api_url\n base_url.concat api_query_parameter\n end",
"def api_url\n base_url.concat api_query_parameter\n end",
"def api_url\n ensure_full_data!\n @gapi[\"selfLink\"]\n end",
"def base_url\n 'http://ow.ly/api/1.1/url/shorten'\n end",
"def api_url(url = '')\n configuration.api_base + url\n end",
"def api_url\n \"#{@@base_url}/#{format}/#{resource}?apikey=#{@@api_key}#{parameters}\"\n end",
"def make_url\n # This works for most of the twitter calls\n \"http://ws.audioscrobbler.com/2.0/?method=#{resource_path}&artist=#{identifier}&limit=100&page=#{page}&api_key=#{api_key}&format=json\"\n end",
"def api_url(path)\n path\n end",
"def url\n @url || API_ENDPOINT\n end",
"def api_url\n api_key? ? base_url.concat(api_query_parameter) : base_url\n end",
"def stories(project, api_key, filter='')\n\treq = Net::HTTP::Get.new(\n \"/services/v3/projects/#{project}/stories?filter=#{filter}\",\n {'X-TrackerToken'=>api_key}\n )\n res = Net::HTTP.start(@pt_uri.host, @pt_uri.port) {|http|\n http.request(req)\n }\n\n return res.body\nend",
"def api_url\n @@API_URL\n end",
"def api_url(url = nil)\n handle_url(:api, url)\n end",
"def get_api_url\n\t\t\t\"https://#{club_name}.tidyhq.com/api/v1/\"\n\t\tend",
"def person_url(id)\n 'https://swapi.co/api/people/' + id.to_s\nend",
"def api_url\n @api_url ||= \"https://api.neverbounce.com\"\n end",
"def api_url\n @api_url ||=\"#{base_url}#{@options['api_url']}\"\n end",
"def api_url\n @api_url ||= URI.parse(::File.join(base_url, endpoint))\n end",
"def api_url\n @api_url || DEFAULT_API_URL\n end",
"def api_url\n @api_url || DEFAULT_API_URL\n end",
"def api_url\n @api_url ||= URI.parse(\"#{super}?#{URI.encode_www_form(query_params)}\")\n end",
"def makeURL(path)\n \"#{self.api_endpt + path}?token=#{self.token}\"\n end",
"def url\n @client.url + self.class.path + @sport.to_s\n end",
"def get_api_url_for(path)\n\t\treturn ('https://api.spotify.com' << path)\n\tend",
"def issue_url(api_url)\n # \"https://api.github.com/repos/typed-ember/ember-cli-typescript/issues/322\"\n api_index = api_url.index(\"api\")\n repos_index = api_url.index(\"repos\")\n\n # https://github.com/typed-ember/ember-cli-typescript/issues/322\n html_url = api_url[0..api_index - 1] +\n api_url[api_index + \"api.\".length..repos_index - 1] +\n api_url[repos_index + \"repos/\".length..-1]\n html_url\n end",
"def api_url\n 'https://coderwall.com/%s.json'\n end",
"def make_url(apipath)\n @base_url + \"/api/open-v1.0/\" + apipath\n end",
"def api_url\n Settings.lighthouse_health_immunization.api_url\n end",
"def url\n return @url if @url\n\n case environment\n when :production\n PRODUCTION_API_ENDPOINT\n when :sandbox\n SANDBOX_API_ENDPOINT\n end\n end",
"def api_url\n authentication_credentials_provided? ? \"https://api.gowalla.com\" : \"http://api.gowalla.com\"\n end",
"def base_url\n \"https://api.yelp.com/v3/\"\n end",
"def api_url(id)\n name = get_tourney_name(id)\n return \"https://api.challonge.com/v1/tournaments/uxie#{id}#{name}\"\nend",
"def api_url\n raise NotImplementedError, \"#{self.class} must implement #api_url!\"\n end",
"def api_url\n \"#{protocol}://api:#{api_key}@#{host}/#{api_version}\"\n end",
"def index\n # description of @stories is not necessary - it is handled by decent_exposure\n end",
"def generate_api_url(workspace_bucket_id, filename)\n file = self.get_workspace_file(workspace_bucket_id, filename)\n if file\n file.api_url + '?alt=media'\n else\n ''\n end\n end",
"def get_stories\n api_url = \"#{CONFIG[:api_location]}/projects/#{@id}/stories\"\n @stories = (Hpricot(open(api_url, {\"X-TrackerToken\" => @token.to_s}))/:story).map {|story| Story.new(:story => story, :project_id => @id, :token => @token)}\n end",
"def url\n end",
"def construct_url\n @@API_URL + city + @@API_KEY\n end",
"def url_for(path, opts = {})\r\n api_host = opts[:api_host] || Moviepilot.config.api_host\r\n version = opts[:api_version] || Moviepilot.config.api_version\r\n [api_host, version, path].join('/')\r\n end",
"def full_url\n @full_url ||= (Streaming.streaming_base_url / Streaming.api_version.to_s / \"statuses\" / \"#{@path}.json\")\n end",
"def url\n \"#{@client.site_url}/#{id}\"\n end",
"def build_url(input)\n url = \"#{GOOGLE_BOOKS_API_BASE_URL}#{input}\"\n url\nend",
"def story(story_id)\n Endpoints::Story.new(self).get_story(story_id)\n end",
"def create_url\n \"#{api_url}/gists\"\n end",
"def get_api_url(endpoint)\n @api_base_url + endpoint\n end",
"def get_url endpoint\n url = @url\n if !url.end_with? \"/\"\n url = \"#{url}/\"\n end\n\n \"#{url}wc-api/#{@version}/#{endpoint}\"\n end",
"def api_uri\n @api_uri ||= URI(api_url)\n end",
"def make_url\n [ \"http://ws.audioscrobbler.com/2.0/?method=#{api_method}#{identifier}\",\n \"&limit=#{max_items}&api_key=#{api_key}&format=json\",\n \"&page=#{page}\" ].join(\"\")\n end",
"def full_url\n char = (api_env('URL') =~ /\\?/).nil? ? '?' : '&'\n api_env('URL') + \"#{char}#{api_env('PARAM')}=#{login}\"\n end",
"def api_url(resource = \"\", params = {})\n url = URI(\"https://api.github.com/#{resource}\")\n url.query = to_query(params.merge(default_api_params))\n\n url.to_s\n end",
"def api_url\n @sandbox ? \"http://api.sandbox.freelancer.com\":\"http://api.freelancer.com\"\n end",
"def api_url path, params = {}\n url = File.join File.join(api_base_url, api_base_path), path\n \"#{url}?#{api_query_string params}\"\n end",
"def api_url(path_fragment)\n platform.api_url(path_fragment)\n end",
"def url\n end",
"def api_url\n default = config('gist.default-url')\n\n @api_url ||= options.gist_api_url\n @api_url ||= default if default && defaults['api-url'].include?(default)\n @api_url ||= normalized_api_urls_from_config\n @api_url.tap { |api_url| set_credential_config_key(api_url) }\n end",
"def url\n @url\n end",
"def url\n @url\n end",
"def wiki_url\n \"https://hq.songbirdnest.com/wiki/index.php?title=Release:#{name}_Iteration_Notes#Iteration_#{@number}\"\n end",
"def api_base_url; @opts[:api_base_url]; end",
"def story(id, query = {})\n Request.new(self, '/cdn/stories', query, id).get\n end",
"def story(id, query = {})\n Request.new(self, '/cdn/stories', query, id).get\n end",
"def endpoint\n \"http://api.urlvoid.com/#{identifier}/#{api_key}\"\n end",
"def gist_url\n \"#{api_url}/gists/%s\"\n end",
"def page_url(*args)\n api_apps_path(*args)\n end",
"def url\n response[\"url\"]\n end",
"def base_href\n '/api/v1'\n end",
"def base_url\n GlobalConstant::Base.cms[:url] + \"api/preview/\"\n end",
"def release_url(api_url, title)\n # \"subject\": {\n # \"title\": \"v1.4.4\",\n # \"url\": \"https://api.github.com/repos/typed-ember/ember-cli-typescript/releases/13191777\",\n # \"latest_comment_url\": \"https://api.github.com/repos/typed-ember/ember-cli-typescript/releases/13191777\",\n # \"type\": \"Release\"\n # },\n api_index = api_url.index(\"api\")\n repos_index = api_url.index(\"repos\")\n releases_index = api_url.index(\"releases\")\n\n # https://github.com/typed-ember/ember-cli-typescript/releases/tag/v1.4.4\n html_url = api_url[0..api_index - 1] +\n api_url[api_index + \"api.\".length..repos_index - 1] +\n api_url[repos_index + \"repos/\".length..releases_index + \"releases\".length] +\n \"tag/#{title}\"\n html_url\n end",
"def base_url\n BASE_URL.dup % [\"%s\", \"%s\", @api_key, \"%s\"] \n end",
"def get_url\n \"http://#{self.domain}/#{self.path}#{self.params.it_keys_to_get_param}\"\n end",
"def api_url time=nil\n today = Time.now\n [ \n \"#{config.protocol}:/\", \n API_URL, \n time && (time.year != today.year || time.yday != today.yday) ? \"historical/#{time.strftime(\"%Y-%m-%d\")}.json\" : \"latest.json\"\n ].join('/') + \"?app_id=#{config.app_id}\"\n end",
"def url\n @url\n end",
"def api_url(url)\n uri = URI(url.to_s)\n\n uri.scheme = server_uri.scheme if uri.scheme.nil?\n uri.host = server_uri.host if uri.host.nil?\n\n # prepend '/api/<version>/' to path if not provided\n unless uri.path =~ /^\\/api\\/\\d+\\//\n uri.path = File.join('/api', version.to_s, uri.path)\n end\n\n uri.to_s\n end",
"def api_create_url\n \"#{self.name.split(\"::\").last.downcase}\"\n end",
"def base_url\n \"https://api.beezup.com/\"\n end",
"def url\n \"/article/#{self.to_param}\"\n end",
"def get_url\n URI.parse(\"#{@server}#{URL}\")\n end",
"def human_url\n return data()['project_uri']\n end",
"def build_request_url(params)\n \"http://api.nytimes.com/svc/search/v2/articlesearch.json?\"+params\n end",
"def pull_request_url(api_url)\n # https://api.github.com/repos/typed-ember/ember-cli-typescript/pulls/334\n api_index = api_url.index(\"api\")\n repos_index = api_url.index(\"repos\")\n pulls_index = api_url.index(\"pulls\")\n\n # https://github.com/typed-ember/ember-cli-typescript/pull/334\n html_url = api_url[0..api_index - 1] +\n api_url[api_index + \"api.\".length..repos_index - 1] +\n api_url[repos_index + \"repos/\".length..pulls_index + \"pull\".length - 1] +\n api_url[pulls_index + \"pulls\".length..-1]\n html_url\n end",
"def api_url(endpoint)\n \"https://www.bloc.io/api/v1/#{endpoint}\"\n end",
"def api_url\n @instant = (1..4).to_a if @instant.empty?\n i = @instant.shift\n return \"http://#{i}-instant.okcupid.com/instantevents?random=#{rand}&server_gmt=#{Time.now.to_i}\"\n end",
"def url\n \"/announcements/#{self.year}/#{self.id}\"\n end",
"def base_url\n \"https://api.twitter.com\"\n end",
"def get_url\n @url\n end",
"def oembed_url\n 'https://www.slideshare.net/api/oembed/2?format=json&url='\\\n \"#{source_url}\"\n end",
"def json_url\n \"#{REDDIT_URL_PREFIX}#{permalink}.json\"\n end",
"def api_url(service, options = {})\n \"#{connection.base_url}/api/#{service}?token=#{connection.token}\"\n end",
"def url\n return if article.nil?\n title = article.escaped_full_title\n \"#{wiki.base_url}/w/index.php?title=#{title}&diff=prev&oldid=#{mw_rev_id}\"\n end",
"def api_url\n \"https://connect.gettyimages.com/v1\"\n end",
"def api_query_parameter\n \"?apiKey=#{api_key}&longUrl=#{url}\"\n end",
"def api_url\n Settings.mobile_lighthouse_letters.api_url\n end",
"def feed_url\n client_url = 'https://kitsu.io'\n # Direct to user notifications list when more than one action\n return \"#{client_url}/notifications\" if activities.length > 1\n\n model_type, model_id = activity['foreign_id'].split(':')\n path = ''\n case model_type\n when 'Follow'\n path = \"/users/#{actor_id}\"\n when 'Post'\n path = \"/posts/#{model_id}\"\n when 'Comment'\n path = \"/comments/#{model_id}\"\n when 'PostLike'\n target_id = activity['target'].split(':').last\n path = \"/posts/#{target_id}\"\n when 'CommentLike'\n target_id = activity['target'].split(':').last\n path = \"/comments/#{target_id}\"\n when 'GroupInvite'\n path = \"/group-invite/#{model_id}\"\n end\n\n \"#{client_url}#{path}\"\n end",
"def url\n URI.parse(endpoint).join(path.to_s).to_s\n end",
"def url\n \"/#{self.class.rest_name}s/#{id}\"\n end",
"def generate_url(api_key, page_number, username)\n %W[\n ws.audioscrobbler.com\n /2.0/?method=user.getrecenttracks&user=#{username}&api_key=#{api_key}&format=json&page=#{page_number}\n ]\n end"
] |
[
"0.7448583",
"0.72236496",
"0.6772528",
"0.67207557",
"0.67207557",
"0.67196035",
"0.6717534",
"0.6714422",
"0.67048585",
"0.66923547",
"0.666768",
"0.66118526",
"0.6591959",
"0.6572398",
"0.65012187",
"0.64627016",
"0.6439124",
"0.64307356",
"0.6406254",
"0.6401658",
"0.63900614",
"0.6389773",
"0.6375063",
"0.6366168",
"0.63541055",
"0.6352136",
"0.6338632",
"0.63381535",
"0.6311533",
"0.6307407",
"0.6306187",
"0.6301516",
"0.6281785",
"0.6278754",
"0.6276365",
"0.6260185",
"0.62330127",
"0.6215907",
"0.6212358",
"0.6203976",
"0.6202673",
"0.6195311",
"0.6191566",
"0.61758804",
"0.61737454",
"0.61661834",
"0.6147523",
"0.61294293",
"0.60979605",
"0.6096262",
"0.6094049",
"0.6089018",
"0.60769904",
"0.6071664",
"0.6063569",
"0.60634834",
"0.605773",
"0.6049234",
"0.6048184",
"0.60454017",
"0.60454017",
"0.60225654",
"0.6020947",
"0.6020883",
"0.6020883",
"0.60206807",
"0.60193974",
"0.60167205",
"0.6016314",
"0.60082656",
"0.5989086",
"0.598394",
"0.5982548",
"0.59809387",
"0.5979474",
"0.59756225",
"0.5968517",
"0.5967444",
"0.59673303",
"0.5963508",
"0.59625864",
"0.59624034",
"0.59615034",
"0.5959796",
"0.59593105",
"0.5956403",
"0.59545803",
"0.59536034",
"0.5952355",
"0.5948842",
"0.59408444",
"0.593906",
"0.592219",
"0.5912177",
"0.5911906",
"0.5907435",
"0.59016705",
"0.58992213",
"0.5898972",
"0.5892857"
] |
0.7973754
|
0
|
Given a project id, get the server's information
|
def lookup_server_from_project pid
PT2TODO_CONFIG.each do |token, p|
if p[:project_ids].include? pid
return {:token => token, :url => p[:url], :project_ids => p[:project_ids], :append => p[:append]}
end
end
return nil
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def details\n data = servers_client.get(server_path, json_headers).body\n JSON.parse(data)['server']\n end",
"def project_url project_id\n server = lookup_server_from_project(project_id)\n pivotal_url = server[:url]\n { :url => \"#{pivotal_url}/projects/#{project_id}\", :token => server[:token] }\nend",
"def get_server(id)\n CloudServers::Server.new(self,id)\n end",
"def get_project(project_id)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Get.new(\"/projects/#{project_id}.json\")\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n @result = false\n return {}\n end\n\n result = JSON.parse(response.body, symbolize_names: true)\n return result\n end",
"def find(project_id)\n raw_response = get_request(\"projects/#{project_id}\")\n parse_response(raw_response, :project)\n end",
"def find(project_id)\n raw_response = get_request(\"projects/#{project_id}\")\n parse_response(raw_response, :project)\n end",
"def get_server\n get_general['server']\n end",
"def servers(service_id)\n request :get, \"/services/#{service_id}/servers\"\n end",
"def server_id\n @host.id\n end",
"def get_server(id)\n OpenStack::Compute::Server.new(self,id)\n end",
"def get_server(id)\n OpenStack::Compute::Server.new(self,id)\n end",
"def find_host_by_id(id)\n begin\n json_response = servers_interface.get(id.to_i)\n return json_response['server']\n rescue RestClient::Exception => e\n if e.response && e.response.code == 404\n print_red_alert \"Host not found by id #{id}\"\n exit 1\n else\n raise e\n end\n end\n end",
"def project(project_id, options={})\n response_body = nil\n begin\n response = connection.get do |req|\n req.url \"/api/v1/projects/#{project_id}\", options\n end\n response_body = response.body\n rescue MultiJson::DecodeError => e\n #p 'Unable to parse JSON.'\n end\n \n response_body\n end",
"def project_info(project_key)\n request = ServiceHelper.new base_url: @jira_url, path: \"rest/api/3/project\"\n request.auth 'basic', @jira_user, @jira_token\n request.headers.add 'Accept', 'application/json'\n request.append_to_route project_key\n response = request.get\n raise Exception, response.body unless response.ok?\n\n response.parsed_body\n end",
"def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end",
"def servers\n response = get \"server\"\n data = JSON.parse response.body\n data[\"servers\"][\"server\"]\n end",
"def server(service_id, server_id)\n request :get, \"/services/#{service_id}/servers/#{server_id}\"\n end",
"def project_id\n service.project\n end",
"def project_id\n service.project\n end",
"def project_id\n service.project\n end",
"def server_id\n @server_id ||= Gititback::Support.hostname\n end",
"def project(id)\n self.projects(\"all\").detect { |p| p.id == id }\n end",
"def project(project_id, params = {})\n make_get_request(\"/projects/#{project_id}\", params)\n end",
"def project\n @client.project(:id => project_id)\n end",
"def servers_detailed()\n return get_request(address(\"/servers/detail\"), @token)\n end",
"def get_project_by_id(id)\n require_relative 'telerivet/project'\n Project.new(self, self.do_request(\"GET\", get_base_api_path() + \"/projects/#{id}\"))\n end",
"def show\n @project_server = ProjectServer.find(params[:id].to_i) rescue nil\n respond_to do |format|\n unless @project_server.blank?\n # to provide a version specific and secure representation of an object, wrap it in a presenter\n \n format.xml { render :xml => project_server_presenter }\n format.json { render :json => project_server_presenter }\n else\n format.xml { head :not_found }\n format.json { head :not_found }\n end\n end\n end",
"def project(project_id)\n resource \"projects/#{project_id}\"\n end",
"def project_id\n service.project_id\n end",
"def details\n get(\"project/details\")[\"project\"]\n end",
"def server_info\n return @server_info if @server_info.present?\n response = request :get, SERVER_INFO_PATH\n @server_info = response.error? ? nil :\n response.result.with_indifferent_access\n end",
"def server_info()\n #This is a stub, used for indexing\n end",
"def gcloud_project_id\n stdout = Open3.capture3(\"gcloud config list project\").first\n stdout.scan(/project = (.*)/).first.first\nend",
"def project_id\n data[:project_id]\n end",
"def server_info\n db(\"admin\").command({:buildinfo => 1}, {:admin => true, :check_response => true})\n end",
"def project_id\n @service.project_id\n end",
"def getProjectID()\n result = RestClient.get GITHUB_API + PROJECTS_PATH, :accept => 'application/vnd.github.inertia-preview+json', :'Authorization' => 'token ' + CONFIG['OAUTH']\n result = JSON.parse(result) \n end",
"def get_project(id)\n project = new(get(\"/rest/api/2/project/#{id}\"))\n @@project_cache[project.name] = project\n @@project_cache[project.id] = project\n @@project_cache[project.key] = project\n return project\n end",
"def servers # Only in Ruby API (1.3 compatible)\n\t\t@settings.servers\n\tend",
"def project(project_id, query_params = nil)\n get(\"/projects/#{project_id}\", query_params)\n end",
"def info(session, id)\n read_task('rvpe.host.info', session) do\n call_one_xmlrpc('one.host.info', session, id)\n end\n end",
"def server(token, server_id)\n request(\n __method__,\n :get,\n \"#{api_base}/guilds/#{server_id}\",\n Authorization: token\n )\n end",
"def server_info\n check_connection\n @protocol.server_info\n end",
"def info\n connection.server_info\n end",
"def resolve(auth, server_id)\n MijDiscord::Core::API.request(\n :guilds_sid,\n server_id,\n :get,\n \"#{MijDiscord::Core::API::APIBASE_URL}/guilds/#{server_id}\",\n Authorization: auth\n )\n end",
"def query_server_details(server, port = 3979)\n packet = @udp.query(:udp_client_find_server, server, port)\n packet.payload\n end",
"def info\n response = rpc.request Riakpb::Util::MessageCode::GET_SERVER_INFO_REQUEST\n\n @node = response.node\n @server_version = response.server_version\n\n {:node => @node, :server_version => @server_version}\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def [](id)\n return id if id.respond_to?(:is_project?) && id.is_project?\n if id == :all\n Project.all\n else\n if id.to_s !~ /^(\\/gdc\\/(projects|md)\\/)?[a-zA-Z\\d]+$/\n raise ArgumentError.new('wrong type of argument. Should be either project ID or path')\n end\n\n id = id.match(/[a-zA-Z\\d]+$/)[0] if id =~ /\\//\n\n response = GoodData.get PROJECT_PATH % id\n Project.new response\n end\n end",
"def set_project\n @host = request.host\n\n if @host == 'localhost'\n @prid=64\n @pr_name = 'MEC'\n @pr_desc = 'Eastern Wolf Survey - Searching for Eastern Wolves in Southern Ontario and Quebec'\n return '64'\n end\n\n if @host =~ /7/ \n @prid = 7\n @pr_name = 'CAN'\n @pr_desc = 'Wolf and Coyote DNA Bank'\n return '7' \n else\n if @host =~ /64/\n @prid = 64\n @pr_name = 'MEC'\n @pr_desc = 'Eastern Wolf Survey - Searching for Eastern Wolves in Southern Ontario and Quebec'\n return '64'\n else\n @prid = 0\n @pr_desc = 'unknown project zero'\n return ''\n end\n end\nend",
"def get_project_info()\n print \"\\n--------------------------------------------------------\\n\"\n print \"04) Searching for project: '#{$my_testrail_project}'...\\n\"\n my_proj_info = nil\n\n # First, get all projects...\n uri = 'get_projects'\n begin\n all_PROJECTs = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"\\tEXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to get information about all TestRail projects'\\n\"\n exit ERR_EXIT_GETPROJS\n end\n\n # Try to find our desired project from the list of projects...\n if all_PROJECTs.length > 0\n all_PROJECTs.each do |item|\n if item['name'] == $my_testrail_project\n @tr_proj_info = item\n break\n end\n end\n else\n print \"ERROR: No projects found in TestRail.'\\n\"\n exit ERR_EXIT_NOPROJS\n end\n if @tr_proj_info == nil\n print \"ERROR: Could not find project named: '#{$my_testrail_project}'\\n\"\n exit ERR_EXIT_PROJNF\n end\n p = @tr_proj_info\n print \"\\tfound project:\\n\"\n print \"\\t id = #{p['id']}\\n\"\n print \"\\t name = #{p['name']}\\n\"\n print \"\\t suite_mode = #{p['suite_mode']}\\n\"\n print \"\\t is_completed = #{p['is_completed']}\\n\"\n print \"\\t url = #{p['url']}\\n\"\n if p['announcement'].nil?\n str = 'nil'\n else\n str = p['announcement'].gsub(/\\n/,\"\\n\\t\\t\\t\")\n end\n print \"\\t announcement = #{str}\\n\"\n\n # Get all suites in our project...\n @tr_proj_id = @tr_proj_info['id']\n uri = \"get_suites/#{@tr_proj_id}\"\n begin\n @tr_suites = @tr_con.send_get(uri)\n rescue Exception => ex\n print \"\\tEXCEPTION occurred on TestRail API 'send_get(#{uri})':\\n\"\n print \"\\t#{ex.message}\\n\"\n print \"\\tFailed to get information about all TestRail suites in project.\\n\"\n exit ERR_EXIT_SUITES\n end\n suiteids = Array.new # Build an array of suite ID's for display...\n @tr_suites.each_with_index do |this_suite, index_suite|\n suiteids.push(this_suite['id'])\n end\n print \"\\n\\tFound '#{@tr_suites.length}' suites in the project: '#{suiteids}'\\n\"\n\n return @tr_proj_info, @tr_suites\nend",
"def getProject(project)\r\n\t\t\t\tproject_json = JSON.parse project\r\n\t\t\t\tproject_array = project_json[\"projects\"]\r\n\t\t\t\treturn jsonToProject(project_array[0])\r\n\t\t\tend",
"def server\n @server ||= ScoutScout::Server.first(client_id)\n end",
"def show_all_projects\r\n json = GoodData.get GoodData.profile.projects\r\n puts \"You have this project available:\"\r\n json[\"projects\"].map do |project|\r\n pid = project[\"project\"][\"links\"][\"roles\"].to_s\r\n puts \"Project name: #{project[\"project\"][\"meta\"][\"title\"].bright} Project PID: #{pid.match(\"[^\\/]{32}\").to_s.bright}\"\r\n end\r\n end",
"def getProjectByID(id)\n ret = nil \n @Projects.each do |project| \n ret = project if project.ID == id \n end \n\n return ret \n end",
"def servers\n endpoint = 'https://pcs.baidu.com/rest/2.0/pcs/manage?method=listhost'\n @res = @api.request_json( endpoint )\n end",
"def show\n set_surrogate_key_header \"api/platforms/#{@platform.id}/projects\"\n set_cache_control_headers 3600\n end",
"def select_server\n compute.servers.map { |s| [s.name, s.id] }\n end",
"def project_id\n return @project_id\n end",
"def server_info\n {:node => \"riak@#{node.host}\", :server_version => '2.0'}\n end",
"def project_id(project_key)\n project_info(project_key)['id']\n end",
"def server_name\n return @server_name\n end",
"def project_id\n return @project_id unless @project_id.nil?\n project_number = self.project_number || @workforce_pool_user_project\n\n # if we missing either project number or scope, we won't retrieve project_id\n return nil if project_number.nil? || @scope.nil?\n\n url = \"#{CLOUD_RESOURCE_MANAGER}#{project_number}\"\n\n response = connection.get url do |req|\n req.headers[\"Authorization\"] = \"Bearer #{@access_token}\"\n req.headers[\"Content-Type\"] = \"application/json\"\n end\n\n if response.status == 200\n response_data = MultiJson.load response.body, symbolize_names: true\n @project_id = response_data[:projectId]\n end\n\n @project_id\n end",
"def getProject(projectName)\n data = CLIENT.repository(projectName)\n return data\nend",
"def get_server_version\n server_info[:server_version]\n end",
"def project_id\n return @project_id unless @project_id.nil?\n project_number = self.project_number || @workforce_pool_user_project\n\n # if we missing either project number or scope, we won't retrieve project_id\n return nil if project_number.nil? || @scope.nil?\n\n url = \"#{CLOUD_RESOURCE_MANAGER}#{project_number}\"\n response = connection.get url do |req|\n req.headers[\"Authorization\"] = \"Bearer #{@access_token}\"\n req.headers[\"Content-Type\"] = \"application/json\"\n end\n\n if response.status == 200\n response_data = MultiJson.load response.body, symbolize_names: true\n @project_id = response_data[:projectId]\n end\n\n @project_id\n end",
"def server\n servers[0]\n end",
"def project(id)\n @xml.search(\"object[@id='#{id}']\")\n end",
"def index\n @servers = @site.servers\n end",
"def srvhost\n datastore['SRVHOST']\n end",
"def show\n @subsystem = Subsystem.find(params[:id])\n @project = @subsystem.project\n end",
"def projects_for_client\n @tasksheet = Tasksheet.new\n @key = params[:id]\n #find the project based on the client id\n @projects = Project.where(client_id: \"#{params[:client][\"#{params[:id]}\"]}\").collect{ |u| [u.name, u.id] }\n end",
"def get\n CircleCi.request(conf, '/projects').get\n end",
"def server\n @server.to_s\n end",
"def project\n request :project\n end",
"def project\n service.project\n end",
"def list_projects(company_id: )\n url = \"#{@base_url}/vapid/projects?company_id=#{company_id}\"\n HTTParty.get(url, headers: procore_headers(token: @customer_info[:token], company_id: @customer_info[:company_id] )).parsed_response\n end",
"def server_port(id = '__default__')\n @servers[id].port\n end",
"def get_server_id\n return nil\n end",
"def versions_id(project_key)\n request = ServiceHelper.new base_url: @jira_url, path: \"rest/api/3/project/\"\n request.auth 'basic', @jira_user, @jira_token\n request.headers.add 'Accept', 'application/json'\n request.append_to_route \"#{project_key}/versions\"\n response = request.get\n raise Exception, response.body unless response.ok?\n\n response.parsed_body\n end",
"def server_one\n\t\tServerOne.find(server_one_id)\n\tend",
"def server(id)\n id = id.resolve_id\n return @servers[id] if @servers[id]\n\n LOGGER.out(\"Resolving server #{id}\")\n begin\n response = API::Server.resolve(token, id)\n rescue Discordrb::Errors::NoPermission\n return nil\n end\n server = Server.new(JSON.parse(response), self)\n @servers[id] = server\n end",
"def project(key)\n @tracker.getProjects.detect { |pro| pro.key == key }\n end",
"def environment(project, id)\n get(\"/projects/#{url_encode project}/environments/#{id}\")\n end",
"def show\n @info = Info.find(params[:id])\n @subproject = @info.subproject\n @project = @subproject.project\n end",
"def get_projects\n me = request('/services/v5/me')\n me['projects']\n end",
"def info_all(vid)\n perform_request(:action => 'vserver-infoall', :vserverid => vid)\n returned_parameters\n end",
"def get_devserver\n devserver = all_info[:devserver]\n if devserver!=nil\n return devserver.split(':').last\n end\n end",
"def servers\n servers_for\n end",
"def view\n @server = Server.find(params[:id])\n end",
"def project_projects_id_get_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ProjectsApi.project_projects_id_get ...\"\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 ProjectsApi.project_projects_id_get\"\n end\n # resource path\n local_var_path = \"/project/projects/{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\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['BasicAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Project')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectsApi#project_projects_id_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def project_id\n project_id = Util::Git.get_config KEY_PROJECT_ID, :inherited\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n client = TrackerApi::Client.new(:token => api_token)\n\n client.projects.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Util::Git.set_config KEY_PROJECT_ID, project_id, :local\n puts\n end\n\n project_id\n end",
"def project\n threaded[:project]\n end",
"def info\n result = []\n Server.all.each do |server|\n result << server.short_result\n end\n\n status_key = makeStatusKey(result)\n render :json => {servers:result}.merge(status_key)\n\n end"
] |
[
"0.67969173",
"0.648968",
"0.64702517",
"0.6435057",
"0.64251554",
"0.64251554",
"0.6384335",
"0.63254493",
"0.6290833",
"0.62401676",
"0.62401676",
"0.619968",
"0.61897004",
"0.61771",
"0.61661965",
"0.61661965",
"0.6119398",
"0.61099523",
"0.61099523",
"0.61099523",
"0.6091373",
"0.60578775",
"0.60541385",
"0.6011542",
"0.6010181",
"0.5999522",
"0.59953266",
"0.59833086",
"0.5980478",
"0.59777576",
"0.5959716",
"0.59464973",
"0.5927078",
"0.58942854",
"0.5889495",
"0.58625495",
"0.58574355",
"0.58424133",
"0.579332",
"0.5780993",
"0.57695675",
"0.5759489",
"0.5748242",
"0.5726069",
"0.5665753",
"0.56581366",
"0.5657966",
"0.5635666",
"0.5635666",
"0.5635666",
"0.5635666",
"0.5635666",
"0.5635666",
"0.5635666",
"0.5631166",
"0.56170714",
"0.5606374",
"0.56035274",
"0.5600789",
"0.5599025",
"0.55963737",
"0.5594458",
"0.55934846",
"0.55915666",
"0.5576192",
"0.5568458",
"0.5564004",
"0.5559764",
"0.55563253",
"0.55529755",
"0.5551899",
"0.5549011",
"0.55469894",
"0.5545368",
"0.5543737",
"0.5542116",
"0.55386376",
"0.5533312",
"0.55323917",
"0.55225575",
"0.5518481",
"0.55152315",
"0.5514058",
"0.54993755",
"0.54828626",
"0.54733485",
"0.5472129",
"0.5470276",
"0.54569495",
"0.5456498",
"0.5446754",
"0.544042",
"0.5438447",
"0.54310894",
"0.54286546",
"0.5411978",
"0.5411854",
"0.541127",
"0.5410809",
"0.540928"
] |
0.6733728
|
1
|
Given a Pivotal Tracker `state`, give back a task prioritization.
|
def map_state(state)
@state_mapping.each do |key, value|
return key if value.include? state
end
:today
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def normalize_state(state)\n val = state.is_a?(Integer) ? state : STATES[state]\n\n case\n when val.nil?\n raise \"Invalid task state #{state.inspect}\"\n when val >= ERROR_STATE_THRESHOLD\n return val - ERROR_STATE_THRESHOLD\n when val >= STEADY_STATE_THRESHOLD\n return val - STEADY_STATE_THRESHOLD\n else\n return val\n end\n end",
"def state_order_clause\n priorities = { draft: 0, published: 1, unpublished: 1, superseded: 2 }.slice(*states)\n return unless priorities.values.uniq.count > 1\n\n Arel.sql(\"CASE state #{priorities.map { |k, v| \"WHEN '#{k}' THEN #{v} \" }.join} END\")\n end",
"def current_state\n if self.steps.where(state: 'reproved').exists?\n 'reproved'\n elsif self.steps.pluck(:state).uniq == ['approved']\n 'approved'\n else\n 'waiting'\n end\n end",
"def priority()\n if (self.placed_date)\n if (self.complete?)\n return 11 # Complete\n else\n return 13 # Oustanding\n end\n else\n return 12 # In progress\n end\n end",
"def humanize_proposal_state(state)\n I18n.t(state, scope: \"decidim.proposals.answers\", default: :not_answered)\n end",
"def css_task_state_for(task_state)\n task_state.name.downcase.gsub(' ', '_')\n end",
"def current_state(name)\n task = get_task(name)\n case\n when task.nil?\n \"Not Created\"\n when task.State >= 0 && task.State <= 4\n [\"Unknown\", \"Disabled\", \"Queued\", \"Ready\", \"Running\"].fetch(task.State)\n when task.State == 3 && task.LastTaskResult == 0\n \"Completed\"\n end\n end",
"def friendly_state\r\n return '' if current_state == 'unstarted'\r\n return 'in progress' if current_state == 'started'\r\n current_state\r\n end",
"def execution_state_changed(task, state)\n if !state.execution_finished?\n return\n end\n\n inc_prereq_count\n if state.ok?\n inc_prereq_ok_count\n end\n # puts \"i am #{name} and #{task.name} finished with #{state}\\nprereq_count: #{prereq_count}\\nprereq_ok_count: #{prereq_ok_count}\\nprerequisites.size: #{prerequisites.size} - #{prerequisites.join(', ')}\"\n\n if prereqs_finished?\n if prereqs_ok?\n add_for_execution(@task_args)\n else\n execution_state_mutex.synchronize do\n self.execution_state = ExecutionState.failed_because_of_prereq\n end\n end\n end\n end",
"def find_state_by_name(name)\n find_task_by_name(\"#{name}_state\")\n end",
"def state_probability(state_id)\n if $data_states[state_id].nonresistance\n return 100\n else\n rank = enemy.state_ranks[state_id]\n return [0,100,80,60,40,20,0][rank]\n end\n end",
"def determine_state(order)\n return 'pending' if self.inventory_units.any? { |unit| unit.backordered? }\n return 'shipped' if state == 'shipped'\n return 'delivered' if state == 'delivered'\n # Original, that resulted in emails being delivered several times:\n # order.payment_state == 'balance_due' ? 'pending' : 'ready'\n # Updated version that should prevent that from happening:\n order.payment_state == 'balance_due' ? 'pending' : 'ready'\n \n end",
"def get_test_priority(test_name)\n unless @test_priorities.has_key?(test_name)\n priority = @test_database.get_test_average_time(test_name, 10, Float::MAX)\n @test_priorities[test_name] = priority\n end\n\n @test_priorities[test_name]\n end",
"def state=(s)\n @tasks.each_value do |task|\n task.state = s\n end\n end",
"def task_state(task_id)\n api.get_task_state(task_id)\n end",
"def human_state_name\n I18n.t \"activerecord.state_machines.tramway/core/application_record.state.states.#{state}\"\n end",
"def name_of(state)\n state = state.to_i\n return case state\n when -2 then \"DISCARDED\"\n when -1 then \"INIT\"\n when 0 then \"SUCCEEDED\"\n when 1 then \"WAIT\"\n when 2 then \"RUNNING\"\n when 3 then \"SUSPEND\"\n when 4 then \"FAILED\"\n else raise \"unknown state #{state}\"\n end\n end",
"def set_task_state\n @task_state = TaskState.find(params[:id])\n end",
"def state\n case pipeline.status\n when 'scheduled', 'created', 'pending', 'preparing', 'waiting_for_resource' then 'pending'\n when 'running' then 'in_progress'\n when 'success' then 'successful'\n when 'failed' then 'failed'\n when 'canceled', 'skipped' then 'cancelled'\n else\n 'unknown'\n end\n end",
"def for_state(state)\n labels_by_state[state]\n end",
"def transform_workflow_state\n @workflow_state ||= begin\n assessment = assessment_submission.assessment\n if assessment.as_assessment_type == 'Assessment::Training'\n if answers_of_same_question.size > 1 && id != latest_answer.id\n # For trainings, all previous answers should be graded.\n return :graded\n end\n end\n\n # Code goes here for missions and trainings with only one answer\n case assessment_submission.status\n when 'graded'\n :graded\n when 'submitted'\n :submitted\n else\n :attempting\n end\n end\n end",
"def state\n [@identifier, @estimated_time, @priority, @completed_at]\n end",
"def execution_state\n return :pending if self.test_executions.empty?\n\n self.test_executions.ordered_by_date.first.state\n end",
"def extended_state\n\t if self.state == 'complete'\n \t if !self.accepted_at\n \t 'submitted'\n elsif self.accepted_at && (self.packed_at == nil) && self.shipment_state != 'shipped'\n 'accepted'\n elsif self.packed_at && (self.shipment_state != 'shipped' && self.shipment_state != 'delivered')\n 'ready_for_pick_up'\n elsif self.shipment_state == 'shipped'\n 'shipped'\n elsif self.shipment.state == 'delivered'\n 'delivered'\n end\n else\n self.state\n end\n end",
"def best_strategy(state)\n build_best(state.pile_size)\n puts \"Good states=#{@good_states}\"\n tgts = targets(state.pile_size)\n tgts.each do |tg|\n op = state.op_to(tg, @ops) \n return op if op\n end\n nil\n end",
"def state\n if completed\n \"complete\"\n else\n if complete_by < Time.now\n \"incomplete-late\"\n else\n \"incomplete-upcoming\"\n end\n end\n end",
"def set_approval_state(state)\n return unless self.class.approvable_field\n send(\"#{self.class.approvable_field}=\".to_sym, state)\n end",
"def set_task_priority\n @task_priority = TaskPriority.find(params[:id])\n end",
"def order_state(order)\n state = order.state.present? ? order.state : 'pending'\n t(\"order_states.#{state}\")\n end",
"def acquire_priority\n case @event['status']\n when '0', '1'\n 'low'\n when '2', '3'\n 'normal'\n end\n end",
"def next_step_task\n if self.tracker_task_id == 1\n return \"Assign Manager\"\n elsif self.tracker_task_id == 2\n return \"Create Estimate\"\n elsif self.tracker_task_id == 3\n return \"Send Estimate\"\n elsif self.tracker_task_id == 4\n return \"Create Contract\"\n elsif self.tracker_task_id == 5\n return \"Send Contract\"\n elsif self.tracker_task_id == 6\n return \"Invoice Customer\"\n end\n end",
"def update\n state = task_params[:state]\n prev_state = @task.state\n\n # Restrict access for non-admins unless\n # new state is 'in progress' or 'done' or missed in params\n check_if_admin unless ['in progress', 'done', nil].include?(state) and (\n # task belongs to user\n @task.user_id == @person.id or\n # user assigns task for himself AND task has not owner AND task is open\n task_params[:user_id] == @person.id && @task.user_id.nil? && prev_state == 'open')\n\n if @task.update(task_params)\n @task.decrease_reward if state == 'failed' && prev_state != 'failed'\n send_reward if state == 'verified' && prev_state != 'verified'\n render :show, status: :ok, location: @task\n else\n render json: @task.errors, status: :unprocessable_entity\n end\n end",
"def task_state_params\n params.require(:task_state).permit(:name)\n end",
"def assigned_to_location\n return COPY::CASE_LIST_TABLE_POST_DECISION_LABEL if root_task&.status == Constants.TASK_STATUSES.completed\n\n active_tasks = tasks.where(status: [Constants.TASK_STATUSES.in_progress, Constants.TASK_STATUSES.assigned])\n return most_recently_assigned_to_label(active_tasks) if active_tasks.any?\n\n on_hold_tasks = tasks.where(status: Constants.TASK_STATUSES.on_hold)\n return most_recently_assigned_to_label(on_hold_tasks) if on_hold_tasks.any?\n\n return most_recently_assigned_to_label(tasks) if tasks.any?\n\n status_hash[:type].to_s.titleize\n end",
"def by_priority; end",
"def approval_state\n if self.class.approvable_field\n send(self.class.approvable_field)\n elsif approval.present?\n approval.state\n end\n end",
"def priority(ant)\n mod = modifier(ant)\n ant.prior - mod.get_setup_time(ant)\n end",
"def fetch_pre_decision_status\n if pending_schedule_hearing_task?\n :pending_hearing_scheduling\n elsif hearing_pending?\n :scheduled_hearing\n elsif evidence_submission_hold_pending?\n :evidentiary_period\n elsif at_vso?\n :at_vso\n elsif distributed_to_a_judge?\n :decision_in_progress\n else\n :on_docket\n end\n end",
"def bystate(s)\n s.delete(\",\").gsub(/(.+)(..)$/) {|a| \"..... \" + $1 + STATES[$2]}.split(\"\\n\").sort.group_by {|s| s[/ \\w+$/]}.sort.join(\"\\r\\n\").strip\nend",
"def update_pr_state(state)\n @repo ||= pr_json.base.repo.full_name\n @number ||= pr_json.number\n api.update_pull_request(@repo, @number, state: state)\n end",
"def evaluate_review_state(state)\n net_pluses = 0\n\n if state == \"approved\"\n net_pluses = 1\n elsif state == \"changes_requested\"\n net_pluses = -1\n end\n\n return net_pluses\n end",
"def state_from_pending current_state, parent_states\n new_state, _ = self.statemap['on_pending'][current_state].find { |_, required_parent_states|\n (parent_states - required_parent_states).empty?\n }\n new_state\n end",
"def sorted(tasks)\n tasks.sort_by {|task| task[:priority]}\nend",
"def up\n task = Task.find(params[:task_id])\n onCurrentPriority = Task.where(:user_id => current_user.id).where(\"priority = #{task.priority}\").count\n if (onCurrentPriority > 1) then\n task.priority += 1\n else\n nextTask = Task.where(:user_id => current_user.id).where(\"priority > #{task.priority}\").order(:priority).limit(1).first\n if nextTask then\n task = Task.find(params[:task_id])\n task.priority, nextTask.priority = nextTask.priority, task.priority\n nextTask.save\n end\n end\n task.save\n # Ignore errors!\n @tasks = Task.where(:user_id => current_user.id).order('priority desc')\n respond_to do |format|\n format.html { render :partial => 'tasks' }\n format.json { render json: @tasks }\n format.js { }\n end\n end",
"def prioritize_submenu\n\t\tputs \"Enter number of task to prioritize:\"\n\t\tchoice = get_choice.to_i\n\t\t@todo_list.prioritize_item choice\n\t\tprint_menu\n\tend",
"def proposal_state_css_class(state)\n case state\n when \"accepted\"\n \"text-success\"\n when \"rejected\"\n \"text-alert\"\n when \"evaluating\"\n \"text-info\"\n else\n \"text-warning\"\n end\n end",
"def next_state\n STATES.find do |_, state|\n state[:probability] && state[:probability] > rand\n end\n end",
"def state\n if completed?\n :complete\n elsif started\n :in_progress\n else\n :not_started\n end\n end",
"def main_state\n if start_step?\n return \"START\"\n elsif finish_step? && finished?\n return \"FINISH\"\n elsif state == \"ACTION\" && !params_hash[\"manual\"]\n return \"PROCESS\"\n elsif state == \"WAITFOR\"\n return \"PROCESS\"\n else\n return state\n end\n end",
"def start(state)\n parse_names\n if @starting_state\n raise ArgumentError, \"this state machine already has a starting \"\\\n \"state, use #depends_on to run more than one task at startup\"\n end\n @starting_state = validate_task(state)\n end",
"def determine_state(order)\n\n return 'canceled' if order.canceled?\n return 'pending' unless order.can_ship?\n\n return 'shipped' if shipped?\n\n end",
"def get_state\n \"Treasury state: #{@resources}\"\n end",
"def initial_state\n :pending\n end",
"def compute\n if open_pre_docket_task?\n :pre_docketed\n elsif open_distribution_task? && !open_timed_hold_task?\n :not_distributed\n elsif active_judge_assign_task?\n :distributed_to_judge\n elsif assigned_attorney_task?\n :assigned_to_attorney\n elsif active_colocated_task?\n :assigned_to_colocated\n elsif attorney_task_in_progress?\n :in_progress\n elsif active_judge_decision_review_task?\n :ready_for_signature\n elsif active_sign_task?\n :signed\n elsif completed_dispatch_task? && open_tasks.empty?\n :dispatched\n elsif completed_dispatch_task?\n :post_dispatch\n elsif docket_switched?\n :docket_switched\n elsif cancelled_root_task?\n :cancelled\n elsif misc_task?\n :misc\n elsif open_timed_hold_task?\n :on_hold\n else\n :unknown\n end\n end",
"def get_top_priority\n topTaskQuery = \"SELECT * FROM tasks\n WHERE project_id = ?\n ORDER BY priority DESC LIMIT 1\",self.project\n result = Task.find_by_sql(topTaskQuery)\n (result.first ? result.first.priority : -1)\n end",
"def taskswap priority\n @cur_proc_id = @queue[priority].shift||@cur_proc_id\n (@queue[priority] << @cur_proc_id) if priority == 0\n @timeslice = 0\n end",
"def todo_state\n return :normal if !self.wip_total\n return :urgent if self.wip_total > WIP_TOTAL_URGENT\n return :warn if self.wip_total > WIP_TOTAL_WARN\n\n return :normal if !self.lane\n return :urgent if self.lane.urgent_limit and self.wip_current > self.lane.urgent_limit\n return :warn if self.lane.warn_limit and self.wip_current > self.lane.warn_limit\n return :normal\n end",
"def in_progress_build\n active_states = [\"deploying\", \"testing\", \"monitoring\", \"awaiting_confirmation\"]\n builds_dataset.reverse_order(:id).filter(:state => active_states).first\n end",
"def humanize_collaborative_draft_state(state)\n I18n.t(\"decidim.proposals.collaborative_drafts.states.#{state}\", default: :open)\n end",
"def priorities\n Sifter.\n get(\"/api/priorities\").\n parsed_response[\"priorities\"]\n end",
"def index\n @task_priorities = TaskPriority.all.order(level: :desc)\n end",
"def calculated_pub_state\n states = resources.map { |res| res.curation_activities&.last&.status }.compact\n\n return 'withdrawn' if states.last == 'withdrawn'\n\n states.reverse_each do |state|\n return state if %w[published embargoed].include?(state)\n end\n\n 'unpublished'\n end",
"def states\n (ex_attr_normal_states + perpetual_states).compact.\n sort{|s1, s2| s2.priority <=> s1.priority}\n end",
"def index\n if Task::TASK_STATES.include?(params[:state]) then\n @tasks = @tasklist.tasks.where(:tstate => params[:state])\n else\n @tasks = @tasklist.tasks\n render action: \"index\", :notice => \"Wrong state. All tasks are listed.\"\n end\n end",
"def to_task(name, priority = 1)\r\n {\"name\" => name, \"priority\" => priority}\r\nend",
"def priority=(*) end",
"def activate_best_chain(state)\n mostwork_tip_hash = @storage.mostwork_tip_hash\n mainchain_tip_hash = @storage.mainchain_tip_hash\n return unless mostwork_tip_hash\n\n while mostwork_tip_hash != mainchain_tip_hash\n block = @storage.valid_block_for_hash(mostwork_tip_hash)\n self.add_block(block, state)\n mostwork_tip_hash = @storage.mostwork_tip_hash\n mainchain_tip_hash = @storage.mainchain_tip_hash\n end\n end",
"def most_important(tasks)\r\n min_val_index = tasks.map {|task| task[\"priority\"]}.each_with_index.min\r\n tasks[min_val_index[1]]\r\nend",
"def sorted(tasks)\r\n tasks.sort_by {|task| task[\"priority\"]}\r\nend",
"def booking_state_name(state)\n case state\n when :pending\n s_(\"BookingStateName|Pending\")\n when :accepted\n s_(\"BookingStateName|Accepted\")\n when :rejected\n s_(\"BookingStateName|Rejected\")\n when :canceled\n s_(\"BookingStateName|Canceled\")\n else\n s_(\"BookingStateName|Undefined\")\n end\n end",
"def hpt\n @checklists = Checklist.get_checklist_entries(current_user).get_pending_tasks.get_high_priority_tasks.paginate(page: params[:page])\n end",
"def log_status(state = nil)\n I18n.with_locale(:cn) do\n I18n.t \"models.order.status.#{ORDER_STATUS.key((state||self.status).to_i).downcase}\"\n end\n end",
"def priority(*) end",
"def vm_state(state)\n case state\n when 'poweredOn'\n 'RUNNING'\n when 'suspended'\n 'POWEROFF'\n when 'poweredOff'\n 'POWEROFF'\n else\n 'UNKNOWN'\n end\n end",
"def next_available_immediate_task\n\t\timmediate_tasks.select{ |t| !t.completed? }.sort_by(&:rank).first\n\tend",
"def get_task_state(token_id)\n data = { 'id' => token_id }\n return query_api \"/task/progress?id=\" + token_id, data, \"POST\"\n end",
"def define_state_predicate; end",
"def translate_state_from(workflow)\n workflow.current_state\n end",
"def move(state)\n @iteration_count = 0\n #make an array of all possible moves\n choices = []\n state.legal_moves.each do |move| \n hash = tabulate_outcomes(move)\n hash[:move] = move\n choices << hash\n end\n puts \"Finished tabulation in #{@iteration_count} calls.\"\n \n #pick best worst case scenario\n best = choices.sort_by { |c| [-c[:worst], -c[@playing_mark]] }.first\n return best[:move]\n end",
"def transition_probability(state, action, next_state)\n if state == :stop || terminii.member?(state)\n action == :stop && next_state == :stop ? 1 : 0\n else\n # agent usually succeeds in moving forward, but sometimes it ends up\n # moving left or right\n move = case action\n when '^' then [['^', 0.8], ['<', 0.1], ['>', 0.1]]\n when '>' then [['>', 0.8], ['^', 0.1], ['v', 0.1]]\n when 'v' then [['v', 0.8], ['<', 0.1], ['>', 0.1]]\n when '<' then [['<', 0.8], ['^', 0.1], ['v', 0.1]]\n end\n move.map do |m, pr|\n m_state = [state[0] + MOVES[m][0], state[1] + MOVES[m][1]]\n m_state = state unless states.member?(m_state) # stay in bounds\n pr if m_state == next_state\n end.compact.inject(:+) || 0\n end\n end",
"def get_priority(id)\n case id.to_i\n when 4\n return 'Critical'\n when 3\n return 'Low'\n when 2\n return 'Medium'\n when 1\n return 'High'\n else\n return 'Unknown'\n end\n end",
"def priorities\n @priorities ||= [:highest, :high, :normal, :low, :lowest]\n end",
"def orderStates\n @states = Hash.new\n @states[0] = \"Processing\"\n @states[1] = \"Shipped\"\n @states[2] = \"Delivered\"\n @states[3] = \"Cancelled\"\n end",
"def state\n status.state name\n end",
"def testSingleSuccessorGreaterPriority\n # Create 2 tasks of different priorities to 2 resources, 1 successor of the other\n executeSimpleTest(\n [ [ 'T1', 'R1', 200, 2, [], ' =='],\n [ 'T2', 'R2', 100, 2, ['T1'], '=='] ] )\n end",
"def pre_generation_hook(task)\n# opName = \"getExtendedStateMapping\"\n# if task.extended_state_support? && !task.operations.include?(opName)\n# method = \" std::vector<std::string> ret;\\n\"\n# states = task.each_state.to_a\n# states.each_with_index do |(state_name, state_type), i|\n# method += \" ret.push_back(\\\"#{task.state_local_value_name(state_name, state_type)}\\\"); \\n\"\n# end\n# method += \" return ret;\"\n# \n# task.hidden_operation(opName).\n# returns(\"std::vector<std::string>\").\n# base_body(method).\n# doc(\"returns a vector of string, that corresponds to the extended task states on the state port\").\n# runs_in_caller_thread\n# end \n end",
"def transitive_states\n states.select do |state|\n state.end_with? 'IN_PROGRESS'\n end\n end",
"def mt_state( state ) \n case state\n when MaintenanceRequest::OPEN\n return \"פתוח\";\n when MaintenanceRequest::IN_PROGRESS\n return \"בטיפול\";\n when MaintenanceRequest::SOLVED\n return \"תוקן\";\n when MaintenanceRequest::REJECTED\n return \"נדחה\";\n when MaintenanceRequest::DEBIT_PENDING\n return \"תוקן וממתין לחיוב\";\n when MaintenanceRequest::DEBIT_DONE\n return \"חוייב\";\n else\n return \"(#{state})\";\n #throw \"unknown mt req state: #{state}\";\n end\n end",
"def current_sort_state(params)\n @sortable && sort_pairs(params).detect{|pair| pair[0]==self.name.to_s} || []\n end",
"def testTasksReorderingWithPredecessor\n # TODO: Code the interchangeable days feature, and uncomment after\n# executeSimpleTest(\n# [ [ 'T1', 'R1', 800, 4, [], '=== ='],\n# [ 'T2', 'R2', 100, 2, ['T3'], '=='],\n# [ 'T3', 'R1', 500, 2, ['T4'], ' =='],\n# [ 'T4', 'R3', 900, 2, [], ' =='],\n# [ 'T5', 'R4', 200, 5, ['T4'], '====='] ] )\n executeSimpleTest(\n [ [ 'T1', 'R1', 800, 4, [], '== =='],\n [ 'T2', 'R2', 100, 2, ['T3'], '=='],\n [ 'T3', 'R1', 500, 2, ['T4'], ' =='],\n [ 'T4', 'R3', 900, 2, [], ' =='],\n [ 'T5', 'R4', 200, 5, ['T4'], '====='] ] )\n end",
"def calculate_and_change_status\n return @status.not_a_plan! if !task.basis_plan?\n return @status.singular! if task.singular_basis_matrix?\n return @status.optimal! if task.sufficient_for_optimal?\n return @status.unlimited! if task.positive_z_index == nil # if z <= 0, target function is unlimited\n @status.step_completed!\n end",
"def smallest_task(tasks)\n tasks.min_by { |task| task.arrival_time }\n end",
"def state\n params['state']\n end",
"def getprequal\r\n street = MiscFunctions.addressStringClean(params[:street])\r\n citystatezip = MiscFunctions.addressStringClean(params[:citystatezip])\r\n geo_data = GeoFunctions.getGoogleGeoByAddress(street, citystatezip)\r\n\r\n # PDQ params\r\n pdq_params = {:path => \"Mls\"}\r\n runID = \"#{pdq_params[:path]}: #{Date.today.to_s}\"\r\n\r\n # Run PDQ (if needed)\r\n a = PdqEngine.computeDecision(geo_data, params, runID)\r\n\r\n output = Output.find_by(place_id: geo_data[:placeId])\r\n\r\n if output.reason.to_s.include? \"Approved\"\r\n decision = \"Approved\"\r\n else\r\n decision = output.reason.to_s.gsub(\"[\",\"\").gsub(\"]\",\"\").gsub(\"\\\"\",\"\").gsub(\"\\\"\",\"\").gsub(\"nil\",\"\").gsub(\",\",\"\").strip()\r\n end\r\n\r\n render :json => decision.to_json\r\n end",
"def schedule_with_state(state, action)\n raise 'action cannot be nil' unless action\n\n schedule_relative_with_state(state, 0, action)\n end",
"def fulfillment_status\n self.current_state\n end",
"def show\n @task_state = TaskState.find(params[:id])\n\n if params[:next_version]\n @task_state = @task_state.next_version\n elsif params[:prev_version]\n @task_state = @task_state.version_at(1.hours.ago)\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @task_state }\n end\n end",
"def first_preprocessing(save=false)\n @@PREPROCESSING_TASKS.find do |t|\n not ignore_task?(t) and not add_result(t, save).nil?\n end\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 state_label\n self.state == 3 ? \"Confirmado\" : \"Borrador\"\n end",
"def pending\n add_breadcrumb \"Ordenes de Trabajo pendientes\"\n @assigned_work_orders = WorkOrder.where(user_assigned:current_user).where(state:1).paginate(:page => params[:pa])\n end"
] |
[
"0.6274295",
"0.57839906",
"0.57239395",
"0.5586477",
"0.5463893",
"0.54568666",
"0.5427778",
"0.5398577",
"0.5335542",
"0.52960336",
"0.52771366",
"0.52760226",
"0.5241638",
"0.52231234",
"0.5212394",
"0.51902133",
"0.5189937",
"0.518529",
"0.51753217",
"0.51475793",
"0.51426977",
"0.513195",
"0.51149714",
"0.5085066",
"0.50516057",
"0.5029632",
"0.50264",
"0.50025016",
"0.49855754",
"0.4969164",
"0.4960447",
"0.4941495",
"0.4932627",
"0.49282768",
"0.491403",
"0.4902425",
"0.490085",
"0.4891938",
"0.48848265",
"0.48810914",
"0.48794943",
"0.48751166",
"0.48748612",
"0.4835034",
"0.4814332",
"0.48128694",
"0.4792088",
"0.47888315",
"0.47813007",
"0.47748524",
"0.47732514",
"0.47727904",
"0.47593907",
"0.47521397",
"0.47456184",
"0.47413126",
"0.47374633",
"0.47282603",
"0.47253188",
"0.4718662",
"0.4702845",
"0.46994647",
"0.46969068",
"0.46899626",
"0.4683611",
"0.46768358",
"0.4674249",
"0.46737587",
"0.46642044",
"0.46596715",
"0.4653843",
"0.46472025",
"0.46445",
"0.4638092",
"0.46353298",
"0.46340433",
"0.4632989",
"0.46243858",
"0.4616897",
"0.46164533",
"0.46146885",
"0.46143988",
"0.4600727",
"0.45968503",
"0.4595069",
"0.4587658",
"0.45771784",
"0.45713332",
"0.45671266",
"0.45656294",
"0.4560526",
"0.4555439",
"0.45534825",
"0.45506534",
"0.45502606",
"0.45476234",
"0.45449665",
"0.45407462",
"0.45387736",
"0.4535501",
"0.45206302"
] |
0.0
|
-1
|
Call the Pivotal Tracker API with the given `url`. This method provides the API Token as a HTTP Header.
|
def pivotal_tracker(server)
clnt = HTTPClient.new
clnt.get(server[:url], nil, { "X-TrackerToken" => server[:token] })
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def call_gh_api(url)\n auth = \"Bearer #{session[:access_token]}\"\n HTTParty.get(url, headers: { 'Authorization' => auth })\n end",
"def get(url)\n login unless token\n response = client.request(request(url, token))\n end",
"def get_token(url)\n req = Net::HTTP::Post.new('/', initheader = {'Content-Type' => 'application/json'})\n req.body = {url: url, format: 'json'}.to_json\n res = @http.request(req)\n data = JSON::parse(res.body)\n data['trunct']['token']\n end",
"def api_token\n api_token = @options[:api_token] || Git.get_config(KEY_API_TOKEN, :inherited)\n\n if api_token.blank?\n api_token = ask('Pivotal API Token (found at https://www.pivotaltracker.com/profile): ').strip\n Git.set_config(KEY_API_TOKEN, api_token, :local) unless api_token.blank?\n puts\n end\n\n api_token\n end",
"def api_token\n api_token = Util::Git.get_config KEY_API_TOKEN, :inherited\n if api_token.empty?\n api_token = ask('Pivotal API Token (found at https://www.pivotaltracker.com/profile): ').strip\n Util::Git.set_config KEY_API_TOKEN, api_token, :global\n puts\n end\n self.check_config_project_id\n\n api_token\n end",
"def login(api_token, project_ids)\n PivotalTracker::Client.token = api_token\n PivotalTracker::Client.use_ssl = true\n\n @project_ids = project_ids\n @projects = []\n end",
"def request(url)\n return false unless (token = bearer_token)\n\n response = HTTParty.get(\n url,\n headers: {\n Authorization: \"Bearer #{token}\"\n }\n )\n\n return false unless response.code == 200\n\n return JSON.parse(response.body)\n end",
"def api_request(url, user_token)\n request = HTTParty.get(url,\n headers: { 'Accept' => 'application/json',\n 'Authorization' => \"Bearer #{user_token}\" })\n return request\nend",
"def request(url, token)\n headers = { \"Authorization\" => \"Splunk #{token}\" }\n Net::HTTP::Get.new(url, headers)\n end",
"def get(url, params = {})\n params['circle-token'] = configuration.circleci_token\n Faraday.get(url + '?' + params.map { |key, value| \"#{key}=#{value}\" }.join('&'))\n end",
"def request(url,token = nil)\n url = URI(\"#{url}&api_key=#{token}\")\n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n request = Net::HTTP::Get.new(url)\n response = https.request(request)\n return JSON.parse(response.read_body)\n end",
"def request_get(token)\n url = \"https://api.spotify.com/v1/browse/new-releases?limit=2\"\n\n options = {\n headers: {\n \"Content-Type\": 'application/json',\n \"Accept\": 'application/json',\n \"Authorization\": \"Bearer #{token}\"\n }\n }\n\n return my_request = HTTParty.get(url, options)\nend",
"def send_request(url)\n verify_credentials!\n\n api_response = nil\n\n complete_url = Applitrack.api_base + url\n uri = URI(complete_url)\n\n Net::HTTP.start(uri.host, uri.port,\n use_ssl: uri.scheme == 'https') do |http|\n\n request = Net::HTTP::Get.new(uri.request_uri)\n request.basic_auth(Applitrack.username, Applitrack.password)\n\n api_response = http.request(request)\n if api_response.code != \"200\"\n raise api_error(api_response)\n end\n end\n\n api_response\n end",
"def request_json(url)\n JSON.parse(@access_token.get(\"#{SITE}#{url}\").body)\n end",
"def call_gnews_url(url)\n result = \n HTTP.headers(\n 'Accept' => 'application/json',\n 'x-api-key' => \"#{@gnews_token}\" ).get(url)\n Response.new(result).response_or_error\n end",
"def request_token\n self.token = Pivotal::Client.fetch_token(email, password)\n end",
"def api(uri, request = :get)\n JSON.parse(\n `curl --request #{request.to_s.upcase} -s -S --header \"PRIVATE-TOKEN: $GITLAB_TOKEN\" \"$GITLAB_BASE_URL/api/v4/#{uri}\"`\n )\nend",
"def make_request(url)\n res = Typhoeus::Request.new(\n url,\n method: :get,\n headers: {\n \"Accept-Charset\": \"application/x-www-form-urlencoded; charset=UTF-8\",\n \"Accept-Language\" => \"en-US,en;q=0.9,pt;q=0.8\",\n \"X-Riot-Token\" => @api_key.to_s,\n \"User-Agent\": \"https://github.com/drish/rioter\"\n }\n ).run\n parse!(res)\n end",
"def get_with_app(url)\n github_api_conn.get do |request|\n request.url url\n\n request.headers['Authorization'] = \"Token #{access_token}\"\n request.headers['Accept'] = accept_header\n end\n end",
"def request(url,token = nil)\n url = URI(\"#{url}&api_key=#{token}\") # se quita uri y parentesis\n #puts url_string\n \n \n https = Net::HTTP.new(url.host, url.port)\n https.use_ssl = true\n request = Net::HTTP::Get.new(url)\n response = https.request(request)\n data = JSON.parse(response.read_body)\n #puts data\nend",
"def get_token_response(url)\n JSON.parse(access_token.get(\"/#{api_version}#{url}\").body)\n end",
"def post(url, params = {})\n raise OAuthUnauthorized if !access_token\n access_token.post(url, params)\n end",
"def post(url, params = {})\n raise OAuthUnauthorized if !access_token\n access_token.post(url, params)\n end",
"def post(url, token, params, headers)\n puts \"post to #{url}\"\n uri = URI.parse(url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n req = Net::HTTP::Post.new(uri.path, headers)\n req['Authorization'] = \"token #{token}\" if token\n\n return http.request(req, params)\nend",
"def destroy\n api_url = URI.parse(\"http://www.pivotaltracker.com/services/v2/projects/#{@project_id}/stories/#{@id}\")\n response = Net::HTTP.start(api_url.host, api_url.port) do |http|\n http.delete(api_url.path, {\"X-TrackerToken\" => @token.to_s})\n end\n end",
"def get(url)\n raise OAuthUnauthorized if !access_token\n access_token.get(url)\n end",
"def get(url)\n raise OAuthUnauthorized if !access_token\n access_token.get(url)\n end",
"def telemetry(url)\n get_request(URI(url), true, false)\n end",
"def request_token\n url = \"#{root_url}/oauth/authenticate\"\n body = {\n username: IdentityConfig.store.usps_ipp_username,\n password: IdentityConfig.store.usps_ipp_password,\n grant_type: 'implicit',\n response_type: 'token',\n client_id: IdentityConfig.store.usps_ipp_client_id,\n scope: 'ivs.ippaas.apis',\n }\n\n faraday.post(url, body) do |req|\n req.options.context = { service_name: 'usps_token' }\n end.body\n end",
"def hit_api_local\n # Authentication info\n pass = ENV['stugov_api_user']\n priv = ENV['stugov_api_pass']\n # Our base URL hosted on stugov's server\n base_url = ENV['stugov_api_base_url']\n\n # We make a sha256 hash of this in binary format, then base64 encode that\n digest = Base64.encode64(OpenSSL::HMAC.digest(OpenSSL::Digest.new(\"sha256\"), priv, pass)).chomp\n\n url = base_url + \"?resource=\" + @resource + @url_options\n return send_request(url, digest)\n end",
"def fetch\n Net::HTTP.start(url.host, url.port, use_ssl: true) do |http|\n req = Net::HTTP::Post.new(url)\n req[\"Accept\"] = \"application/json\"\n data = {\n \"client_id\" => client_id,\n \"client_secret\" => client_secret,\n \"grant_type\" => \"client_credentials\",\n \"scope\" => \"/read-public\"\n }\n req.set_form_data(data)\n body = http.request(req).body\n JSON.parse(body)[\"access_token\"]\n end\n end",
"def signed_get_request url\n token=jwt_get_signature url\n HTTParty.get('http://localhost:5000'+url,\n headers:{\n \"Authorization\"=>\"JWT token=\\\"#{token}\\\"\",\n \"Content-Type\"=> \"application/json;charset=utf-8\"\n }\n )\n end",
"def url_report(url)\n URLReport.new(api_key: @api_key, resource: url).response\n end",
"def call_api\n @client.build_url\n @client.get\n assign_data\n end",
"def make_api_call(url, api_params)\n RestClient.post(url, api_params, content_type: :json)\n end",
"def api_token\n client.get(\"/user/api_token\").fetch(\"result\")\n end",
"def post(url, params)\n params = convert_hash_keys(params)\n @access_token = params.delete('access_token') if params['access_token']\n return connection.post(url, params)\n end",
"def request_post\n url = \"https://accounts.spotify.com/api/token\"\n\n options = {\n headers: {\n \"Authorization\" => encoding,\n },\n body: {\n \"grant_type\" => 'client_credentials',\n }\n }\n\n return my_request = HTTParty.post(url, options)\nend",
"def request(url)\n # Allow the user to specify the full URL.\n remainder = url[0, base.length] == base ? url.sub(base, '') : url\n\n request = nil\n delim = remainder.include?('?') ? '&' : '?'\n @limiter.times 1 do\n request = NYTResponse.new(\"#{base}#{remainder}#{delim}api-key=#{key}\")\n end\n request\n end",
"def request_token\n json = cli.perform_quietly %Q(curl -u '#{username}:#{password}' -d '{\"scopes\": [\"repo\"], \"notes\": \"Octopolo\"}' https://api.github.com/authorizations)\n self.auth_response = JSON.parse json\n end",
"def apiCall(token)\n # Authorize the client and construct a Google+ service.\n $client.authorization.update_token!(token)\n plus = $client.discovered_api('plus', 'v1')\n\n # Get the list of people as JSON and return it.\n response = $client.execute!(plus.people.get, :userId => 'me').body\n puts response.inspect\nend",
"def create_token\n return api_call('request-token',{\"apiKey\"=> @@_api_key });\n end",
"def info(url)\n rest = RestClient::Request.execute(\n method: :get,\n url: url,\n user: ENV['USER'],\n password: ENV['KEY'],\n headers: {\"Content-Type\" => \"application/json\"}\n )\n JSON.parse(rest, :symbolize_names => true)\n rescue RestClient::Exception\n \"Sorry something went wrong with the API\"\n end",
"def request_api(url)\n begin\n response = RestClient.get(url)\n print(\"response: \", response)\n JSON.parse(response)\n rescue\n return nil\n end\n \n \n end",
"def api_post(url, oauth_token, params = {})\n RestClient.reset_before_execution_procs\n RestClient.add_before_execution_proc do |req, _|\n req[\"Authorization\"] = \"OAuth #{ oauth_token }\"\n end\n send_params = { client_id: @client_id, client_secret: @client_secret }.merge(params)\n result = RestClient.post url, send_params.to_json, content_type: :json, accept: :json\n case response.code\n when 200\n JSON.parse(result.body)[\"response_data\"]\n else\n { error: JSON.parse(result.body), status: result.code }\n end\n rescue RestClient::Exception => e\n { error: JSON.parse(e.response.body), status: e.response.code }\n end",
"def fetch(url, opts)\n headers = {}\n\n if opts.key?(:github_token) and url.start_with?('https://api.github.com/')\n headers['Authorization'] = \"token #{opts[:github_token]}\"\n elsif ENV['GITHUB_TOKEN'] and url.start_with?('https://api.github.com/')\n headers['Authorization'] = \"token #{ENV['GITHUB_TOKEN']}\"\n end\n\n opts[:logger].debug(\"Fetching #{url}\")\n response = Request.run(url, { connecttimeout: 15, headers: headers })\n\n if response.success?\n response.body\n else\n reason = response.timed_out? ? \"Timed out while connecting to #{url}\" : \"Couldn't fetch #{url} (response code #{response.code})\"\n opts[:logger].error(reason)\n raise reason\n end\n end",
"def post_curl\n `curl -X \"POST\" -H \"Authorization: Basic #{_encode}\" -d grant_type=client_credentials https://accounts.spotify.com/api/token`\n end",
"def api_call(path)\n url = \"https://api.github.com#{path}\"\n url << \"?access_token=#{ENV['GITHUB_API_TOKEN']}\" if ENV['GITHUB_API_TOKEN']\n resp = get(url)\n if resp.code.to_i != 200\n nil\n else\n data = resp.body\n JSON.parse(data)\n end\nend",
"def initialize(token, url, params = {})\n super(token, url)\n @params = {\n grant_type: \"password\",\n client_id: ENV[\"SHOWOFF_CLIENT_ID\"],\n client_secret: ENV[\"SHOWOFF_CLIENT_SECRET\"],\n }.merge(params)\n @header = ShowoffHeader.new().perform\n end",
"def call_poke_url(url)\n JSON.parse(\n HTTP\n .get(URI(url))\n )\nend",
"def gettoken(url,username,password,tenant)\n url1 = \"#{url}/identity/api/tokens\"\n uri = URI.parse(url1)\n request = Net::HTTP::Post.new(uri)\n request.content_type = \"application/json\"\n request[\"Accept\"] = \"application/json\"\n request.body = JSON.dump({\n \"username\" => username,\n \"password\" => password,\n \"tenant\" => tenant\n })\n\n req_options = {\n use_ssl: uri.scheme == \"https\",\n verify_mode: OpenSSL::SSL::VERIFY_NONE,\n }\n\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n token_output = response.body\n token_json = JSON.parse(token_output)\n vra_token = token_json[\"id\"]\n return vra_token\n end",
"def initialize(options={})\n url = options.fetch(:url, 'https://www.pivotaltracker.com')\n @url = Addressable::URI.parse(url).to_s\n @api_version = options.fetch(:api_version, '/services/v5')\n @logger = options.fetch(:logger, ::Logger.new(nil))\n adapter = options.fetch(:adapter, :excon)\n connection_options = options.fetch(:connection_options, { ssl: { verify: true } })\n @auto_paginate = options.fetch(:auto_paginate, true)\n @token = options[:token]\n raise 'Missing required options: :token' unless @token\n\n @connection = Faraday.new({ url: @url }.merge(connection_options)) do |builder|\n # response\n builder.use Faraday::Response::RaiseError\n builder.response :json\n\n # request\n builder.request :multipart\n builder.request :json\n\n builder.use TrackerApi::Logger, @logger\n builder.adapter adapter\n end\n end",
"def getUrlReport(url)\n\t\t\tresponse = RestClient.post(\n\t\t\t\t'https://www.virustotal.com/vtapi/v2/url/report',\n\t\t\t\t'resource' => url,\n\t\t\t\t'apikey' => @key )\n\t\t\tJSON.parse(response)\n\t\tend",
"def useToken(subdomain, oauth_token)\n\tpayload = {ticket: {\n subject: \"Ruby OAuth Authenticated Ticket\", \n comment: {\n \tbody: \"Ticket Created!\"\n }\n }\n }\n header = {'Content-Type': 'application/json', 'Authorization': 'BEARER ' + oauth_token}\n puts header\n\turi = URI.parse(\"https://\"+subdomain+\".zendesk.com/api/v2/tickets.json\")\n\thttp = Net::HTTP.new(uri.host, uri.port)\n\thttp.use_ssl = true\n\trequest = Net::HTTP::Post.new(uri.request_uri, header)\n\trequest.body = payload.to_json\n\tputs \"Making authenticated request\"\n\tresponse = http.request(request)\n\tdata = JSON.parse(response.body)\n\tputs data\n\tputs \"Success!\"\n\nend",
"def get(url, options={})\n opts = {access_token: token}.merge options\n Getter.new(url, opts).get\n end",
"def url\n api_url\n end",
"def make_api_call_for_order_creation(url, api_params, access_token)\n RestClient.post(url, api_params, Authorization: \"Bearer #{access_token}\", content_type: :json)\n end",
"def get_token\n get(TOKEN_URL)\n end",
"def request(url)\n\n # For catch 4xx and 5xx HTTP errors\n has_errors = false\n\n # Send request to vendor API\n http = Curl.get(url) do |http|\n\n # On 4xx errors\n http.on_missing do\n has_errors = true\n end\n\n # On 5xx errors\n http.on_failure do\n has_errors = true\n end\n\n end\n\n raise \"Error from TRADO API - #{http.body_str}\" if has_errors\n\n JSON.parse(http.body_str)['data']\n\n end",
"def get_github_api(project, endpoint)\n token = \"9874304d5d35c105f590df83c48112ff43518fba\"\n uri = URI.parse(\"https://api.github.com/repos/NuCivic/\" + project + \"/\" + endpoint + '?access_token=' + token)\n request = Net::HTTP::Get.new(uri)\n req_options = {\n use_ssl: uri.scheme == \"https\",\n }\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n JSON.parse(response.body)\n end",
"def call(path, http_method: :get, body: {}, header: {})\n # add bearer token to header\n header[:authorization] = \"Bearer #{access_token}\"\n return ShakeTheCounter::API.call(path, http_method: http_method, body: body, header: header)\n end",
"def call_yt_url(url)\n result = HTTP.get(url)\n successful?(result) ? result : raise_error(result)\n end",
"def endpoint\n \"http://api.urlvoid.com/#{identifier}/#{api_key}\"\n end",
"def api_call verb, url, form_params, options\n conn = get_connection(url: IONIC_PUSH_URL)\n\n conn.basic_auth(ENV['IONIC_PUSH_PRIVATE_KEY'], '')\n\n conn.headers['Content-Type'] = 'application/json'\n conn.headers['X-Ionic-Application-Id'] = IONIC_APP_ID\n\n perform_request_with_raise_or_not verb, conn, url, form_params\n end",
"def token\n validate_arguments!\n\n display Turbot::Auth.api_key\n end",
"def scanUrl(url)\n\t\t\tresponse = RestClient.post(\n\t\t\t\t'https://www.virustotal.com/vtapi/v2/url/scan',\n\t\t\t\t'url' => url,\n\t\t\t\t'apikey' => @key )\n\t\t\tresult = JSON.parse(response)\n\t\tend",
"def call_introspection_api(token, scopes, subject)\n return call_api(\"/api/auth/introspection\", {\n \"token\" => token,\n \"scopes\" => scopes,\n \"subject\" => subject\n })\nend",
"def get url\n puts \"COMMUNICATING WITH TOGGL SERVER COMMUNICATING WITH TOGGL SERVER\"\n uri = URI.parse( url )\n http = Net::HTTP.new( uri.host, uri.port )\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Get.new( uri.request_uri )\n request.basic_auth( @api_key, \"api_token\" )\n request[\"Content-Type\"] = \"application/json\"\n response = http.request( request )\n \n if response.code.to_i==200 # OK\n hash = JSON.parse( response.body )\n elsif response.code.to_i==403 # Authentication\n raise Exceptions::AuthenticationError\n else\n puts \"Error, code #{ response.code }.\"\n puts response.body\n end\n end",
"def show\n Labtech.get_token\n @last_ticket = Labtech.last_labticket\n end",
"def call_authorization_issue_api(ticket, subject, authTime)\n return call_api(\"/api/auth/authorization/issue\", {\n \"ticket\" => ticket,\n \"subject\" => subject,\n \"authTime\" => authTime\n })\nend",
"def call_token_api(params, clientId, clientSecret)\n return call_api(\"/api/auth/token\", {\n \"parameters\" => URI.encode_www_form(params),\n \"clientId\" => clientId,\n \"clientSecret\" => clientSecret\n })\nend",
"def tracker_script_url\n \"https://#{ENV['COLLECTOR_HOST']}/track-#{token}.js\"\n end",
"def post(url, params = {})\n post_auth_hash = {\n \"oauth_consumer_key\" => \"#{@consumer_key}\",\n \"oauth_token\" => \"#{@access_token[\"oauth_token\"]}\",\n \"oauth_signature_method\" => \"HMAC-SHA1\",\n \"oauth_timestamp\" => timestamp,\n \"oauth_nonce\" => nonce,\n \"oauth_version\" => \"1.0\",\n }\n\n # set signature\n post_auth_hash[\"oauth_signature\"] = generate_access_signature(generate_signature_base_string(\"POST\", url, post_auth_hash, params))\n\n # post with auth header\n return MyHttp.post(url, params, {\n \"Authorization\" => \"OAuth #{generate_auth_header(post_auth_hash)}\",\n \"Content-Type\" => \"application/x-www-form-urlencoded\",\n })\n end",
"def call\n JsonWebToken.encode(user_id: api_user.id) if api_user\n end",
"def request(url, api_key)\n rover = get_data(\"#{url}#{api_key}\")\n\n return rover\nend",
"def api_url(url = nil)\n handle_url(:api, url)\n end",
"def establish_connection(url, token)\n Faraday.new(url: url) do |faraday|\n faraday.request :json\n faraday.headers[\"Authorization\"] = token\n faraday.headers['Accept'] = 'application/json'\n faraday.response :json\n faraday.response :raise_error\n faraday.options.open_timeout = 2\n faraday.options.timeout = 100\n faraday.adapter Faraday.default_adapter\n end\n end",
"def post_with_app(url, payload = '')\n github_api_conn.post do |request|\n request.url url\n\n request.headers['Authorization'] = \"Token #{access_token}\"\n request.headers['Accept'] = accept_header\n request.body = payload\n end\n end",
"def get_token\n request.headers[\"Authorization\"]\n end",
"def api_call(path)\n uri = URI(\"#{BASE}/api/#{path}?authorization_username=#{USER}\")\n req = Net::HTTP::Get.new(uri)\n req['Authorization'] = \"Bearer #{TOKEN}\"\n\n res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|\n http.request(req)\n end\n\n unless res.is_a?(Net::HTTPSuccess)\n puts res.inspect\n exit\n end\n\n return JSON.parse(res.body)\nend",
"def access_api(url)\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n\n file = File.open('bin/key.rb')\n request = Net::HTTP::Get.new(url)\n request[\"x-rapidapi-host\"] = 'skyscanner-skyscanner-flight-search-v1.p.rapidapi.com'\n request[\"x-rapidapi-key\"] = file.read\n\n response = http.request(request).read_body\n response_hash = JSON.parse(response) \nend",
"def getToken\n # Takes code from url params\n code = params[\"code\"]\n\n # Requests token from spotify using the users code\n uri = URI.parse(\"https://accounts.spotify.com/api/token\")\n\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true #this helps with the https\n\n request = Net::HTTP::Post.new(uri)\n request.body = \"grant_type=authorization_code&code=#{code}&redirect_uri=#{$redirect_uri_base}%2Fcallback%23playlist&client_id=#{ENV['clientid']}&client_secret=#{ENV['clientsecret']}\"\n\n response = http.request(request)\n\n # Converts JSON into ruby hash\n @data = JSON.parse(response.read_body)\n\n # Calls on user method to get user url for creating a playlist\n user\nend",
"def fetch(url)\n # TODO: support HTTPS too\n @open_params ||= begin\n u = URL(@root_url)\n [u.host, u.port]\n end\n Net::HTTP.start(*@open_params) do |http|\n request = Net::HTTP::Get.new(URL(url).full_path.gsub(/ /, \"%20\"))\n with_sts_auth_retry do\n authenticate(request, {:is_request => true})\n http.request(request)\n end\n end\n end",
"def send_request method, params = {}\n uri = URI.parse(@api_url)\n if Time.now.to_i > @exp + 3600\n get_acces_token\n @exp = Time.now.to_i\n end\n required = { 'access_token' => @access_token, 'method' => method }\n params = required.merge(params)\n params = URI.escape(params.collect{ |k,v| \"#{k}=#{v}\"}.join('&'))\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Post.new(uri.request_uri)\n req['User-Agent'] = \"zhzhussupovkz pleer.com-ruby-api\"\n req.body = params\n res = http.request(req)\n if res.code == \"200\"\n data = res.body\n result = JSON.parse(data)\n else\n puts \"Invalid getting data from server\"\n exit\n end\n end",
"def get_token\n with_monitoring do\n perform(:post, \"/#{config.base_path}/token\", {}, token_headers)\n end\n end",
"def get(url, params = {})\n params = convert_hash_keys(params)\n @access_token = params.delete('access_token') if params['access_token']\n return connection.get(url, params)\n end",
"def tokeninfo(token)\n $client.authorization.update_token!(token)\n oauth2 = $client.discovered_api('oauth2','v2')\n\n puts $client.execute(oauth2.tokeninfo, token).response.body\nend",
"def send_auth_request \n request = AuthorizeRequest.new(:get, action_to_call) do |req|\n req.request_params = params\n end\n request.send_request(Config.url)\n end",
"def request_url\n base_url = \"http://#{api_host}#{PATH}?\"\n base_url << \"appid=#{app_id}\"\n base_url << \"&callname=#{call_name}\"\n base_url << \"&siteid=#{site_id}\"\n base_url << \"&version=#{API_VERSION}\"\n base_url\n end",
"def api_request(url, media_type = '')\n parse_request_result api_request_raw(ensure_max_per_page(url), media_type)\n end",
"def pagerduty\n PagerDuty::API.connect(\n :subdomain => PAGERDUTY_CREDENTIALS[:subdomain],\n :user => PAGERDUTY_CREDENTIALS[:user],\n :password => PAGERDUTY_CREDENTIALS[:password]\n )\nend",
"def git_io(url)\n\t\t\tbegin\n\t\t\t\thttp = Net::HTTP.new(GIT_IO_ENDPOINT.host, GIT_IO_ENDPOINT.port)\n\t\t\t\thttp.use_ssl = true\n\t\t\t\tparams = {url: url}\n\t\t\t\tresponse = http.post(GIT_IO_ENDPOINT, URI.encode_www_form(params))\n\t\t\t\treturn response[\"Location\"]\n\t\t\trescue\n\t\t\t\treturn url\n\t\t\tend\n\t\tend",
"def make_api_call (api_path)\n uri = URI.parse(GPS_CLIENT_SETTINGS[\"url\"] + api_path)\n http = Net::HTTP.new(uri.host, uri.port)\n if uri.scheme==\"https\"\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n request = Net::HTTP::Get.new(uri.request_uri)\n request['API-SECRET'] = client_secret\n response = http.request(request) \n make_adapter_response(response)\n end",
"def post_to_pocket(url,title)\n path = '/v3/add'\n escaped_url = CGI::escape(url)\n escaped_title = CGI::escape(title)\n data = \"consumer_key=#{Consumer_key}&access_token=#{Token}&url=#{escaped_url}\"\n if title != \"\"\n data = data + \"title=#{escaped_title}\"\n end\n resp = pocket_api(path,data)\n if resp[0] == \"200\"\n puts \"Successfuly posted #{url} to Pocket\"\n else\n puts \"Something went wrong! Try to login again\"\n end\nend",
"def authenticate_and_retrieve_project\n begin\n Lighthouse.account = @api_access_options[:account_name] || ''\n Lighthouse.token = @api_access_options[:api_token] || ''\n @project = Lighthouse::Project.find( ( @api_access_options[:project_id] || '' ).to_i )\n rescue\n raise \"Project details could not be retrieved from Lighthouse using the supplied credentials\"\n end\n gather_tickets_and_milestones\n end",
"def apiAuth\n\t\tsignature = \"version=#{$CONFIG[:api_version]}&path=#{$CONFIG[:api_path]}&app_key=#{$CONFIG[:app_key]}&app_secret=#{$CONFIG[:app_secret]}×tamp=#{$CONFIG[:timestamp]}\"\n\t\tsignature_hash = Digest::SHA2.new << signature\n\t\turl = \"#{$CONFIG[:api_url]}#{$CONFIG[:api_version]}#{$CONFIG[:api_path]}?app_key=#{$CONFIG[:app_key]}×tamp=#{$CONFIG[:timestamp]}&signature=#{signature_hash}\"\n\t\n\t\turl\n\tend",
"def get_token\n with_monitoring do\n conn = Faraday.new(\n \"#{Settings.veteran_readiness_and_employment.auth_endpoint}?grant_type=client_credentials\",\n headers: { 'Authorization' => \"Basic #{Settings.veteran_readiness_and_employment.credentials}\" }\n )\n\n request = conn.post\n JSON.parse(request.body)['access_token']\n end\n end",
"def credential(url); end",
"def get_access\n path = '/v3/oauth/authorize'\n data = \"consumer_key=#{Consumer_key}&code=#{Token}\"\n return pocket_api(path,data)\nend",
"def fetch(url, params, method=nil)\n if method && method == 'GET'\n url = build_get_uri(url, params)\n end\n uri = URI.parse(url)\n\n http = Net::HTTP.new(uri.host, uri.port)\n #http.use_ssl = true\n\n if method && method == 'GET'\n req = Net::HTTP::Get.new(uri.request_uri)\n elsif method && method == 'DELETE'\n req = Net::HTTP::Delete.new(uri.request_uri)\n elsif method && method == 'PUT'\n req = Net::HTTP::Put.new(uri.request_uri)\n req.set_form_data(params)\n else\n req = Net::HTTP::Post.new(uri.request_uri)\n req.set_form_data(params)\n end\n req.basic_auth(@id, @token)\n\n return http.request(req)\n end"
] |
[
"0.68637234",
"0.6151754",
"0.6093218",
"0.60747206",
"0.60580873",
"0.6014395",
"0.59499055",
"0.592737",
"0.5898902",
"0.5775516",
"0.57221746",
"0.56850064",
"0.5679265",
"0.5676035",
"0.56410974",
"0.5560159",
"0.5545748",
"0.55317",
"0.54871213",
"0.5484402",
"0.5480123",
"0.5477211",
"0.5477211",
"0.5450613",
"0.5449615",
"0.5400326",
"0.5400326",
"0.5388697",
"0.5384421",
"0.5335421",
"0.53217494",
"0.5291933",
"0.52918863",
"0.52913177",
"0.5283826",
"0.52630675",
"0.526297",
"0.5230709",
"0.5230294",
"0.520306",
"0.51977396",
"0.51916754",
"0.518643",
"0.5186346",
"0.51761985",
"0.51751286",
"0.51736665",
"0.51559633",
"0.5154492",
"0.51510054",
"0.5148276",
"0.51424855",
"0.5130711",
"0.51215297",
"0.5120676",
"0.51206565",
"0.5115379",
"0.51003385",
"0.5089743",
"0.5080006",
"0.5052495",
"0.5050377",
"0.5050309",
"0.50487125",
"0.5041915",
"0.5038584",
"0.50361264",
"0.5034809",
"0.50218314",
"0.5020485",
"0.5016491",
"0.50157434",
"0.50102645",
"0.500764",
"0.50052357",
"0.5003108",
"0.4988101",
"0.49878392",
"0.49850377",
"0.49844608",
"0.4979592",
"0.49641478",
"0.49559015",
"0.4953221",
"0.49524394",
"0.49499813",
"0.4949108",
"0.49414077",
"0.49371514",
"0.49357566",
"0.49340183",
"0.4925307",
"0.49194428",
"0.49167696",
"0.4909635",
"0.4907287",
"0.49034253",
"0.489972",
"0.4895532",
"0.4894701"
] |
0.6553887
|
1
|
Given a project's id (`pid`), get the project's name.
|
def project_name(pid)
Nokogiri::HTML(pivotal_tracker(project_url(pid)).content).css('project > name').text.split(' ').join
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def project_name\n return project.nil? ? \"nil\" : project.name\n end",
"def name\n project.name\n end",
"def name\n project.name\n end",
"def get_project_name\n project_id = params[:project_id]\n name_from_repository = payload.fetch(\"repository\", {}).fetch(\"name\", nil)\n project_id || name_from_repository\n end",
"def get_project_name(id)\n con = PG::Connection.connect(\"localhost\",5432,nil,nil,\"aaa\",\"admin\")\n sql = \"SELECT name \"\n sql += \"FROM projects \"\n sql += \"WHERE id='#{id}' \"\n res = con.exec(sql)\n con.close\n name = \"NA\"\n name = res[0]['name'] if res.num_tuples > 0\nend",
"def project_name\n self.project ? self.project.name : NOT_SET\n end",
"def project_name\n DeliveryGolang::Helpers.project_name(node)\n end",
"def project_name\n if arguments[1]\n arguments[1]\n else\n File.basename(repo.root)\n end\n end",
"def project_name\n \"$PROJECT_NAME v.$PROJECT_VERSION\"\n end",
"def project_name(node)\n node['delivery']['change']['project'] if is_change_loaded?(node)\n end",
"def project(name)\n @projects.find { |p| p.name == name }\n end",
"def project_name\n return config['project_name'] if config['project_name']\n # using Dir.pwd will return something like: \n # /var/www/apps/staging.sweetspot.dm/releases/20061006155448\n # instead of\n # /var/www/apps/staging.sweetspot.dm/current\n pwd = ENV['PWD'] || Dir.pwd\n #another hack..ugh. If using standard capistrano setup, pwd will be the 'current' symlink.\n pwd = File.dirname(pwd) if File.symlink?(pwd)\n File.basename(pwd)\n end",
"def project_identifier(p, length=26)\n truncate([p.shortname, p.description].join(\" - \"), :length => length)\n end",
"def name\n 'Project'\n end",
"def name_and_project\n return name unless project\n\n \"#{::ERB::Util.h name} | #{::ERB::Util.h project.name}\".html_safe\n end",
"def projectizeName(filename)\n return ApplicationController.projectizeName(filename)\n end",
"def project_by_name(project_name)\n projects.find { |project| project['name'].casecmp(project_name) == 0 }\n end",
"def project_title(id)\n project = @xml.search(\"object[@id='#{id}']\")\n title = project.search(\"attribute[@name='title']\")\n clean(title.innerHTML.to_s)\n end",
"def project(id)\n self.projects(\"all\").detect { |p| p.id == id }\n end",
"def display_resource(project)\n project.name\n end",
"def project_name\n # using Dir.pwd will return something like: \n # /var/www/apps/staging.sweetspot.dm/releases/20061006155448\n # instead of\n # /var/www/apps/staging.sweetspot.dm/current\n pwd = ENV['PWD'] || Dir.pwd\n #another hack..ugh. If using standard capistrano setup, pwd will be the 'current' symlink.\n pwd = File.dirname(pwd) if File.symlink?(pwd)\n File.basename(pwd)\n end",
"def name\n @name ||= @project.dir.path.match(/.*\\/(.*)$/).nil? ? \"unknown\" : $1\n end",
"def getProjectId(project_name)\n\tprojects = $client.Project.all\n\tid = \"\"\n\tprojects.each do |project|\n\t\tif project.name == project_name\n\t\t\tid = project.id\n\t\t\twrite_to_file(\"Project id #{id} was successfully found for #{project_name}\", \"info\")\n\t\tend \n\tend\n\treturn id\nend",
"def project_name(new_name = T.unsafe(nil)); end",
"def rings_project_name\n \"#{root_project_name}#{RINGS_PREFIX}\"\n end",
"def project_get(project)\n project_find(project)\n projects = @project.all('a[class=table-link]') if @project\n\n project_names = []\n if projects\n projects.each do |proj|\n project_names << proj.text\n end\n else\n project_names = nil\n end\n project_names\n end",
"def find_project(name)\n get(\"/projects/#{name}\")\n end",
"def find_project(name)\n get(\"/projects/#{name}\")\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 project_id project_name\n if @version < \"1.0\"\n project = projects.find { |project| project[:name] == project_name }\n else\n project = project_by_name(project_name).first\n end\n\n project.nil? ? nil : project[:id].to_i\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n @grpc.name.split(\"/\")[1]\n end",
"def project_id\n data[:project_id]\n end",
"def get_project_name(dir = Dir.pwd, _options = {})\n path = normalized_path(dir)\n path = FalkorLib::Git.rootdir(path) if FalkorLib::Git.init?(path)\n File.basename(path)\n end",
"def project(project_id)\n resource \"projects/#{project_id}\"\n end",
"def project\n params['project'].gsub('_', '-')\n end",
"def find_procname(pid)\n\tname = nil\n\t@client.sys.process.get_processes.each do |proc|\n\t\tif proc['pid'] == pid.to_i\n\t\t\tname = proc['name']\n\t\tend\n\tend\n\treturn name\nend",
"def project_id\n service.project\n end",
"def project_id\n service.project\n end",
"def project_id\n service.project\n end",
"def unique_name\n \"#{project.name} / #{name}\"\n end",
"def project_id(project_key)\n project_info(project_key)['id']\n end",
"def project_path(name)\n project_map[name.to_s]\n end",
"def find_project\r\n @project = Project.find(params[:id])\r\n @html_title = @project.name\r\n rescue ActiveRecord::RecordNotFound\r\n render_404\r\n end",
"def project(key)\n @tracker.getProjects.detect { |pro| pro.key == key }\n end",
"def to_s\n project.path_to_name\n end",
"def repo_name\n @repo_name ||= InchCI::ProjectUID.new(uid).repo_name\n end",
"def gcloud_project_id\n stdout = Open3.capture3(\"gcloud config list project\").first\n stdout.scan(/project = (.*)/).first.first\nend",
"def get_project (project_name)\n\t\tproject = Project.find_by_name(project_name)\n\t\tif project\n\t\t\tif (project.accessibility == 1 or (user_signed_in? and project.user == current_user))\n\t\t\t\treturn project, nil\n\t\t\telse\n\t\t\t\treturn nil, I18n.t('controllers.application.get_project.private', :project_name => project_name)\n\t\t\tend\n\t\telse\n\t\t\treturn nil, I18n.t('controllers.application.get_project.not_exist', :project_name => project_name)\n\t\tend\n\tend",
"def project_id\n @attributes[:project_id]\n end",
"def find(project_id)\n raw_response = get_request(\"projects/#{project_id}\")\n parse_response(raw_response, :project)\n end",
"def find(project_id)\n raw_response = get_request(\"projects/#{project_id}\")\n parse_response(raw_response, :project)\n end",
"def get_project_identifier\n identifier = params[:project_id] || params[:repository_name]\n raise ActiveRecord::RecordNotFound, 'Project identifier not specified' if identifier.nil?\n return identifier\n end",
"def getProject(project)\r\n\t\t\t\tproject_json = JSON.parse project\r\n\t\t\t\tproject_array = project_json[\"projects\"]\r\n\t\t\t\treturn jsonToProject(project_array[0])\r\n\t\t\tend",
"def project_id\n return @project_id\n end",
"def project(project_id, params = {})\n make_get_request(\"/projects/#{project_id}\", params)\n end",
"def project\n threaded[:project]\n end",
"def name(other_user)\n return self.which_profile(other_user).ring.projected_name\n end",
"def project_id\n project_id = Util::Git.get_config KEY_PROJECT_ID, :inherited\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n client = TrackerApi::Client.new(:token => api_token)\n\n client.projects.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Util::Git.set_config KEY_PROJECT_ID, project_id, :local\n puts\n end\n\n project_id\n end",
"def project_id\n project_id = @options[:project_id] || Git.get_config(KEY_PROJECT_ID, :inherited)\n\n if project_id.empty?\n project_id = choose do |menu|\n menu.prompt = 'Choose project associated with this repository: '\n\n PivotalTracker::Project.all.sort_by { |project| project.name }.each do |project|\n menu.choice(project.name) { project.id }\n end\n end\n\n Git.set_config(KEY_PROJECT_ID, project_id, :local)\n puts\n end\n\n project_id\n end",
"def user_name\n @user_name ||= InchCI::ProjectUID.new(uid).user_name\n end",
"def getProjectByID(id)\n ret = nil \n @Projects.each do |project| \n ret = project if project.ID == id \n end \n\n return ret \n end",
"def project_slug\n DeliveryGolang::Helpers.project_slug(node)\n end",
"def player_name(id)\n name = Player.find(id)\n end",
"def name(id)\n @id_to_name[id]\n end",
"def get_project_by_id(id)\n require_relative 'telerivet/project'\n Project.new(self, self.do_request(\"GET\", get_base_api_path() + \"/projects/#{id}\"))\n end",
"def project_code\n name[PROJECT_CODE_FORMAT]\n end",
"def find_project(project_id)\n # check if we already fetched the project\n @projects.each do |proj|\n return proj if proj.id == project_id\n end\n # project not found, fetch it\n @projects << PivotalTracker::Project.find(project_id)\n @projects.last\n end",
"def project_model_text_from_name(name)\n if text = available_projects[name]\n return text\n else\n raise OroGen::ProjectNotFound, \"#{client} has no project called #{name}, available projects: #{available_projects.keys.sort.join(\", \")}\"\n end\n end",
"def ingenerator_project_name\n unless node['project'] && node['project']['name']\n raise ArgumentError.new('You must configure a node[project][name] attribute')\n end\n node['project']['name']\n end",
"def display_pending_refund_payments_projects_name\n source.pending_refund_payments_projects.map(&:name).uniq\n end",
"def get_project_by_id_or_name(id_or_name)\n rtn = nil\n if fpermit?('site_admin', nil) || current_user().has_role?('project_reviewer') then\n in_used_projects = \"\"\n else\n in_used_projects = \"(#{Project.in_used_projects()} or #{Project.pending_projects()})\" #include pending projects for pending status.\n end\n\n case id_or_name\n when /^\\d+$/\n rtn = Project.find_by_id(id_or_name, :conditions => in_used_projects)\n when Project::NAME_REGEX\n in_used_projects = \" and #{in_used_projects}\" if(in_used_projects != \"\")\n if rtn = Project.in_used.find(:first, :select => 'id', :conditions => [\"name = ? #{in_used_projects}\", id_or_name])\n yield rtn.id\n return\n end\n end\n\n if not rtn or (rtn.status == Project::STATUS[:PENDING] and in_used_projects != \"\" and (rtn.creator != current_user().id or controller_name != 'projects' or (action_name != 'edit' and action_name != 'update'))) #project not ready. pending and not allow actions.\n flash[:warning] = \"Project '#{id_or_name}' does not exist, or it has be deactivated.\"\n redirect_to root_path\n elsif in_used_projects == \"\" and rtn.status != Project::STATUS[:READY] #admin & reviewer messages\n flash.now[:warning] = \"Project is not READY. Status is #{Project.status_to_s(rtn.status)}.\"\n end\n rtn\n end",
"def display_pending_refund_payments_projects_name\n object.pending_refund_payments_projects.map(&:name).uniq\n end",
"def webistrano_project_name\n self.name.underscore.gsub(/[^a-zA-Z0-9\\-\\_]/, '_')\n end",
"def webistrano_project_name\n self.name.underscore.gsub(/[^a-zA-Z0-9\\-\\_]/, '_')\n end",
"def find_project\n identifier = get_project_identifier\n project = Project.find_by_identifier(identifier.downcase)\n raise ActiveRecord::RecordNotFound, \"No project found with identifier '#{identifier}'\" if project.nil?\n return project\n end",
"def project_name_check\n return $browser.h1.as[1].text\n end",
"def details\n get(\"project/details\")[\"project\"]\n end",
"def get_project_oid(project_name)\n\n # compare project_name against all projects on the server, return oid when found\n @conn.bimsie1_service_interface.getAllProjects( false, true ).each do |project|\n if project[\"name\"] == project_name\n return project[\"oid\"]\n end\n end\n\n # if not found, raise error\n raise \"No project found with name '\" + project_name + \"'.\"\n end",
"def project(project_id, query_params = nil)\n get(\"/projects/#{project_id}\", query_params)\n end",
"def find_project(name)\n login unless authenticated?\n response = RestClient.get(resource_url(\"projects/#{URI.escape(name)}\"), :cookies => @cookies)\n project = JSON.parse response.body\n return project['name'] == name ? project : nil\n rescue RestClient::ResourceNotFound\n return nil\n end",
"def project_slug\n DeliveryTruck::Helpers.project_slug(node)\n end",
"def project\n object.project.id\n end",
"def project_id\n @service.project_id\n end",
"def find_project\n identifier = params[:project_id]\n scope = Project.active.has_module(:repository)\n project = scope.find_by_identifier(identifier.downcase)\n raise ActiveRecord::RecordNotFound unless project\n return project\n end",
"def find_project_by_project_name(project_name)\n row = @db.get_first_row('select * from projects where project_name = ?', project_name)\n return {\n id: row[0],\n project_name: row[1],\n target_dollar_amount: row[2]\n }\n end",
"def change_name!\n @project[:name] = \"#{@project[:name]}-PR#{@number}\" if @project[:name]\n @project[:value][:name] = \"#{@project[:value][:name]}-PR#{@number}\" if @project[:value][:name]\n end",
"def find_project(workspace, name)\r\n project = nil\r\n if ( name != \"Parent\")\r\n project = workspace.projects.find { |p| p.name == name && p.state == \"Open\" }\r\n if project == nil\r\n print \"Project \", name, \" not found\\n\"\r\n end\r\n end\r\n project\r\nend",
"def getProjectName()\n\tcurl = 'git config --local remote.origin.url|sed -n \"s#.*/\\([^.]*\\)\\.git#\\1#p\"'\n\tresult = `#{curl}`\n\treturn result.strip()\nend",
"def project(id)\n @xml.search(\"object[@id='#{id}']\")\n end",
"def group_name_from_pid(value)\n begin\n group = Hydramata::Group.load_instance_from_solr(value)\n rescue => e\n logger.debug(\"DEBUG: Helper method group_name_from_pid raised an error when loading #{value}. Error was #{e}\")\n end\n group.nil? ? value : group.title\n end",
"def project_id\n return self.project_id\n end",
"def project_id\n service.project_id\n end",
"def project_id\n @gapi.job_reference.project_id\n end",
"def get_project_profile(uid, pid)\n cl = client(\"Projects\", uid)\n response = cl.call(:get_project_profile, message: { projectid: pid })\n\n fields = [ response.to_hash[:get_project_profile_response][:return][:attributes] ].flatten.map do |f|\n ProfileField.new(f[:name], f[:data_type], f[:optional], f[:access], f[:description], f[:format], f[:format_description], f[:length_hint], f[:value])\n end\n\n return ProfileFields.new(fields)\n rescue Savon::SOAPFault => e\n process_error e\n end"
] |
[
"0.72045237",
"0.7092095",
"0.7092095",
"0.7077162",
"0.69105375",
"0.6875942",
"0.6819747",
"0.6638206",
"0.66316247",
"0.6622742",
"0.65775937",
"0.654773",
"0.64752764",
"0.64124054",
"0.64104426",
"0.64066786",
"0.6398371",
"0.6375751",
"0.63715607",
"0.636676",
"0.6354798",
"0.6352127",
"0.6312916",
"0.62482744",
"0.6245826",
"0.6228937",
"0.6204859",
"0.6204859",
"0.61813545",
"0.6179828",
"0.6154781",
"0.6154781",
"0.6154781",
"0.6154781",
"0.6154781",
"0.6154781",
"0.6154781",
"0.6122931",
"0.61088866",
"0.60782903",
"0.6067076",
"0.6060311",
"0.60527027",
"0.60527027",
"0.60527027",
"0.6036565",
"0.6033252",
"0.6019877",
"0.60100156",
"0.60063714",
"0.6000308",
"0.5991258",
"0.59827214",
"0.59752935",
"0.59433126",
"0.5932743",
"0.5932743",
"0.5927001",
"0.5925637",
"0.5911183",
"0.5904978",
"0.5899302",
"0.58818746",
"0.58484423",
"0.58442736",
"0.5844201",
"0.5841458",
"0.5828924",
"0.58160114",
"0.5805434",
"0.58036983",
"0.57987154",
"0.57881266",
"0.5783831",
"0.577709",
"0.57587266",
"0.5756931",
"0.5747691",
"0.57423365",
"0.57423365",
"0.5737333",
"0.5734038",
"0.57146156",
"0.5713901",
"0.5708029",
"0.5705711",
"0.569734",
"0.56919515",
"0.5685722",
"0.568183",
"0.5679878",
"0.56796706",
"0.5661291",
"0.56525016",
"0.5649803",
"0.5622885",
"0.56205183",
"0.560699",
"0.56022376",
"0.5602038"
] |
0.74874276
|
0
|
Given a project's id, and the body of the response from Pivotal Tracker's Stories API, return a list of strings in todo.txt format.
|
def my_todos(project_id, body)
body.css('stories > story').select do |s|
s.css('owned_by').text == OWNER
end.inject({}) do |tasks, s|
state = map_state s.css('current_state').text
tasks[state] ||= []
tasks[state] << s
tasks
end.map do |priority_group, stories|
stories.map{|s| format_todotxt project_id, priority_group, s}
end.flatten
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def get_items(projectid, todolistid)\n get(\"projects/#{projectid}/todolists/#{todolistid}.json\")\n end",
"def get_completed(projectid)\n get(\"projects/#{projectid}/todolists/completed.json\")\n end",
"def todos(project_id)\n return [] if project_id.blank? || !basecamp\n @todos[project_id] ||= Basecamp::TodoList.all(project_id, false)\n end",
"def lists(project_id, complete=nil)\n records \"todo-list\", \"/projects/#{project_id}/todos/lists\", :complete => complete\n end",
"def get_all_withassigned(projectid)\n get(\"projects/#{projectid}/assigned_todos.json\")\n end",
"def create(name, description, projectid)\n body = {:name => name, :description => description}\n post(\"projects/#{projectid}/todolists.json\", JSON.generate(body))\n end",
"def get_list(id)\n record \"/todos/list/#{id}\"\n end",
"def get_task_list(id)\n response = request(\n :expects => 200,\n :idempotent => true,\n :method => 'GET',\n :parser => Fog::ToHashDocument.new,\n :path => \"tasksList/#{id}\"\n )\n ensure_list! response.body, :Task\n response\n end",
"def get_tasks_in_project(project_id)\n body = get_json_data(\"https://app.asana.com/api/1.0/tasks?project=#{project_id}&assignee=me\")\n tasks = {}\n body[\"data\"].each do |element|\n tasks[element[\"id\"]] = element[\"name\"].gsub(\"'\", '').gsub(\"\\n\", '')\n end\n\n tasks\n end",
"def task_list\n self.tasks.map do |task|\n task.text\n end\n end",
"def get_tasks_from_todoist\n return Todoist::Task.uncompleted(PROGRAMMING_PROJECT_ID)\n end",
"def get(id:)\n list = client.get_list(id: id)\n\n Todoable::List.new(list)\n end",
"def tasks(project_id)\n account = Config.details \n c = FreshBooks::Client.new(account[\"account\"], account[\"token\"])\n c.task.list :project_id => project_id\n end",
"def show_todo(id)\n filename = find_filename_for_todo(id)\n todo = create_todo_hash_from_file(filename)\n pretty_print_todo(todo)\nend",
"def todos\n output = `bin/rails notes`\n return if output&.empty?\n\n heading('TODO\\'s', output)\n end",
"def read_todos(filename)\n File.readlines(filename)\nend",
"def list_todos(model)\n # print the todos to the screen\n\n model.each do |todo|\n # each todo is a hash\n puts generate_todo_string(todo)\n end\n end",
"def list_todo_items(opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n {}\n \n )\n\n # resource path\n path = path_replace(\"/v1/users/self/todo\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_params(options, query_param_keys)\n if opts[:next_page]\n pagination_params = page_params_load(:get, path)\n query_params.merge! pagination_params if pagination_params\n end\n response = mixed_request(:get, path, query_params, form_params, headers)\n page_params_store(:get, path)\n response\n \n end",
"def todos\n subcomponents[\"VTODO\"]\n end",
"def list_tasks\r\n unless tasks\r\n puts \"No tasks yet. Add one!\"\r\n return\r\n end\r\n # Pretty-format hash and print\r\n print \" \" + \"ITEM\".ljust(30) + \" | \" +\r\n \"WHEN DUE\".ljust(15) + \" | \" +\r\n \"WHEN ADDED\".ljust(15) + \"\\n\"\r\n tasks.each do |task|\r\n print \"<#{tasks.find_index(task) + 1}>\".ljust(5) +\r\n task[:text].ljust(30) + \" | \" +\r\n task[:due].ljust(15) + \" | \" +\r\n task[:time].ljust(15) + \"\\n\"\r\n end\r\n end",
"def tickets_for_project(project_id)\n tickets = send(:get , \"/api/v1/projects/#{project_id}/tickets.json\")\n\n process_list_response( tickets , Unfuddled::Ticket )\n end",
"def todo_list\n TodoList.find_by(user_id: current_user['sub'])\n end",
"def create_list(project_id, list)\n record \"/projects/#{project_id}/todos/create_list\", list\n end",
"def getList fields = [\"*\"]\n\t\tputs \"here\"\n\t\ttickets = @tickets.read fields\n\t\tputs \"here jjj\"\n\t\toutput = \"Projects:\\n\"\n\n\t\ttickets.each do |row|\n\t\t\toutput += \"| \"\n\t\t\trow.each do |cell|\n\t\t\t output += \"#{cell[1]} | \"\n\t\t\tend\n\t\t\toutput += \"\\n\"\n\t\tend\n\t\toutput\n\tend",
"def todo\n @tasks = TaskDecorator.decorate_collection Task.getReadyToDoTasks\n render \"v1/tasks/index\"\n end",
"def get_all_completed_items(params = {})\n if params[\"until\"]\n params[\"until\"] = ParseHelper.format_time(params[\"until\"])\n end\n if params[\"since\"]\n params[\"since\"] = ParseHelper.format_time(params[\"since\"])\n end\n \n result = @client.api_helper.get_response(Config::TODOIST_COMPLETED_GET_ALL_COMMAND, params)\n items = ParseHelper.make_objects_as_array(result[\"items\"])\n projects = ParseHelper.make_objects_as_array(result[\"projects\"])\n return {\"items\" => items, \"projects\" => projects}\n end",
"def todos(id, sort = 'recent', options = {})\n deprecated(\"todos\", \"list_todos\")\n get(\"users/#{id}/todos\", { :sort => sort }.merge(options)).todos\n end",
"def create(params, projectid, todolistid)\n\n data = params[:due_at]\n data = Date.parse(data.to_a.sort.collect{|c| c[1]}.join(\"-\"))\n\n body =\n {\n :content => params[:content],\n :due_at => data,\n :assignee =>\n {\n :id => params[:assignee_id],\n :type => params[:assignee_type]\n }\n }\n\n post(\"projects/#{projectid}/todolists/#{todolistid}/todos.json\", JSON.generate(body))\n\n end",
"def set_todo_list\n begin\n @todo_list = current_user.todo_lists.where(project_id: params[:project_id]).find(params[:id])\n rescue => exception\n head 401\n end\n end",
"def list(m, target)\n target.gsub!(/^\\s+/,\"\") #remove leading whitespace\n results = []\n read(:tasks).each do |record|\n unless target.empty?\n target_regex = /#{target}/\n if record[\"tag\"] =~ target_regex || record[\"creator\"] =~ target_regex\n results << record\n end\n end\n end\n m.reply \"==== found #{results.length} results. ====\"\n # sort by last bumped\n sorted = results.sort do |x,y| \n xd = DateTime.iso8601(x[\"bumped\"]) \n yd = DateTime.iso8601(y[\"bumped\"]) \n yd <=> xd\n end\n sorted.each_with_index do |r, ind|\n m.reply \"!#{r[\"id\"]} ##{r[\"tag\"]} '#{r[\"text\"]}'; created by #{r[\"creator\"]}\"\n end\n m.reply \"==== **** ====\"\n end",
"def do_list\n now_playing = find_id_now_playing(current_status)\n output = []\n current_playlist.each do |elt|\n marker = (elt['id'].to_s == now_playing ? '*' : ' ')\n output.push format(\"%s %03d - %s\\n\", marker, elt['id'], cleanup_pathname(elt['uri']))\n end\n return output.join\n end",
"def get_notes_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ProjectsApi#get_notes ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling get_notes\" if id.nil?\n \n # resource path\n path = \"/Projects/{id}/Notes\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'updated_after_utc'] = opts[:'updated_after_utc'] if opts[:'updated_after_utc']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\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\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<APINote>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectsApi#get_notes\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def get_todo model, cohort\n return [] unless model && cohort\n ids = adminned_memberships_by_tag(cohort).map(&:id)\n records = model.where(membership_id: ids).todo\n end",
"def get_my_issues\n get_json( GITHUB_ISSUES_URL ).each do |item|\n puts \"#{ item[ 'repository' ][ 'full_name' ] }: ##{ item[ 'number' ] } #{ item[ 'title' ] } | href=#{ item[ 'html_url' ] }\"\n end\nend",
"def arrayOfChanges\n #we could also use Ruby/Git here, but that feels like an overkill right #now.\n gitChanges = `git diff #{@args[:taskpaper_file]} | grep '^\\+' | grep -i '\\@done'`\n return gitChanges.split(\"\\n\").collect{ |line| Task.new(line.gsub(/^\\+\\ ?/, \"\"))}\n end",
"def printNotDone\n notDoneList = \"\"\n @toDoListArray.each do |e|\n if !e.status\n notDoneList = notDoneList + e.printItem + \" \"\n end\n end\n notDoneList\n end",
"def printDone\n doneList = \"\"\n @toDoListArray.each do |e|\n if e.status\n doneList = doneList + e.printItem + \" \"\n end\n end\n doneList\n end",
"def create_task(list_id, text)\n path = \"lists/#{list_id}/tasks\"\n params = {task: {text: text}}\n request(path, params, :post)\n\n # output full list again\n show_list(list_id)\n end",
"def index\n @todo_projects = TodoProject.all\n end",
"def export_project(project)\n return [\n project.id,\n project.name,\n project.description,\n project.homepage,\n project.is_public ? 1 : 0,\n project.parent ? project.parent.identifier : nil,\n project.created_on ? project.created_on.strftime('%Y-%m-%d %H:%M:%S') : nil,\n project.updated_on ? project.updated_on.strftime('%Y-%m-%d %H:%M:%S') : nil,\n project.identifier,\n project.status,\n project.enabled_module_names * ',',\n project.trackers.collect(&:name) * ',',\n project.issue_custom_fields.collect(&:name) * ',',\n ]\n end",
"def list_tasks(api_object)\n puts \"Current Tasks:\"\n doc = Nokogiri::XML.parse api_object.read\n puts doc\n descriptions = doc.xpath('tasks/task/description').collect {|e| e.text }\n puts descriptions.join(\", \")\n puts \"\"\nend",
"def find_list(id)\n check_token\n response = self.class.get(\"/lists/#{id}\", headers: headers)\n check_and_raise_errors(response)\n Todoable::List.build_from_response(response.parsed_response)\n end",
"def todos #:nodoc:\n components Icalendar::Vtodo\n end",
"def index\n @project_todo_comments = @project_todo.project_todo_comments.all\n end",
"def project_commits(id)\n begin\n JSON(RestClient.get GITLAB_WS_URL + \"projects/#{id}/repository/commits\", {:private_token => GITLAB_TOKEN}).reverse\n rescue Exception\n return []\n end\n end",
"def list_tasks\n # ASK REPO for the tasks\n tasks = @task_repository.all\n # ASK VIEW to display them\n @tasks_view.display(tasks)\n end",
"def get_tasks_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: ProjectsApi#get_tasks ...\"\n end\n \n # verify the required parameter 'id' is set\n fail \"Missing the required parameter 'id' when calling get_tasks\" if id.nil?\n \n # resource path\n path = \"/Projects/{id}/Tasks\".sub('{format}','json').sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'updated_after_utc'] = opts[:'updated_after_utc'] if opts[:'updated_after_utc']\n query_params[:'top'] = opts[:'top'] if opts[:'top']\n query_params[:'skip'] = opts[:'skip'] if opts[:'skip']\n query_params[:'brief'] = opts[:'brief'] if opts[:'brief']\n query_params[:'count_total'] = opts[:'count_total'] if opts[:'count_total']\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\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<APITask>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectsApi#get_tasks\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def index\n @what_fixed_to_dos = WhatFixedToDo.all\n end",
"def get_work_items_for(issue_id)\n get(\"issue/#{issue_id}/timetracking/workitem/\")\n response.parsed_response\n end",
"def index\n @todoitems = @todolist.todoitems.order(:created_at)\n end",
"def tasks(list)\n list_obj = list.is_a?(Wunderlist::List) ? list : lists[list]\n list = list.id if list.is_a? Wunderlist::List\n\n request = prepare_request(Net::HTTP::Get.new \"#{@path}/ajax/lists/id/#{list}\")\n response = @http.request request\n result = []\n\n Nokogiri::HTML(JSON.parse(response.body)[\"data\"]).css(\"li.more\").each do |html_task|\n task = Wunderlist::Task.new\n task.id = html_task.attributes[\"id\"].value.to_i\n task.name = html_task.css(\"span.description\").first.content\n task.important = html_task.css(\"span.fav\").empty? ? false : true\n task.done = html_task.attributes[\"class\"].value.split(\" \").include?(\"done\")\n html_timestamp = html_task.css(\"span.timestamp\")\n task.date = Time.at(html_timestamp.first.attributes[\"rel\"].\n value.to_i).to_date unless html_timestamp.empty?\n task.note = html_task.css('span.note').first.content\n task.api = self\n task.list = list_obj\n\n result << task\n end\n\n result\n end",
"def index\n @project_detail_strings = ProjectDetailString.all\n end",
"def create_todo(todo)\n post_params = {\n :body => todo.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n \n response = Logan::Client.post \"/projects/#{@project_id}/todolists/#{@id}/todos.json\", post_params\n Logan::Todo.new response\n end",
"def show\n json_response(@todo)\n end",
"def tickler_todos\n todos.ticklers.order('completed_time DESC')\n end",
"def show_completed_items\n return @to_do_item.select { |x| x.is_done? == true }\n end",
"def index\n @todo_items = @todo_list.todo_items.all.order(\"completed ASC\") \n end",
"def stories(project, api_key, filter='')\n\treq = Net::HTTP::Get.new(\n \"/services/v3/projects/#{project}/stories?filter=#{filter}\",\n {'X-TrackerToken'=>api_key}\n )\n res = Net::HTTP.start(@pt_uri.host, @pt_uri.port) {|http|\n http.request(req)\n }\n\n return res.body\nend",
"def show\n @project_todo = @project.project_todos.find(params[:id])\n end",
"def dueToday\n dueTodayList = \"\"\n @toDoListArray.each do |e|\n if !e.status && e.dueDate == Date.today\n dueTodayList = dueTodayList + e.printItem + \" \"\n end\n end\n dueTodayList\n end",
"def read_tasks\n JSON.parse(File.read(\"tasks.json\"))\nend",
"def items\n response = @client.request :get, \"#{LISTS_PATH}/#{@id}\"\n raise(StandardError, 'unexpected response') unless response\n response['items']&.map { |i| TodoableItem.new self, i, @client }\n end",
"def all_todos\n (global_todos.where(language: I18n.locale).to_a.delete_if{ |gt| local_todos.map(&:title).include?(gt.title) } + local_todos)\n end",
"def index\n @todoit_lists = TodoitList.all\n end",
"def tasks\n render json: [{id: 1, name: 'One'}, {id: 2, name: 'Two'}]\n end",
"def tasks(tasklist_id = '@default')\n get gtasks_tasks_url(tasklist_id)\n end",
"def index\n @project_todos = @project.project_todos.all\n \n #render :json => @project_todos\n \n end",
"def get_projects_list(course_id, year_id)\n\t\t#https://www.dei.uc.pt/weboncampus/class/getprojects.do?idclass=419&idyear=6\n\t\t@projects = Array.new\n\t\ttmp = WocFile.new(:year => @@year_names[year_id], :course => CONFIG[\"course_names\"][course_id], :section => \"projects\")\n\t\tresponse = self.auth_get(\"/weboncampus/class/getprojects.do?idclass=#{course_id}&idyear=#{year_id}\")\n\t\tdoc = Hpricot(response.body).search(\"td[@class='contentcell]\")[1].search(\"table\")[1].search(\"td\").each do |td|\n\t\t\tcase td.inner_html\n\t\t\twhen /^\\s*<strong>.*<\\/strong>\\s*$/\n\t\t\t\t#title\n\t\t\t\ttmp = WocFile.new(:year => @@year_names[year_id], :course => CONFIG[\"course_names\"][course_id], :section => \"projects\")\n\t\t\t\ttmp.title = td.inner_html.match(/<strong>(.*)<\\/strong>/)[1]\n\t\t\twhen /\\s*<table(.|\\n)*/\n\t\t\t\tnext\n\t\t when />\\d{4}-\\d{2}-\\d{2}</\n\t\t \tdate = td.inner_html.match(/(\\d{4}-\\d{2}-\\d{2})/)[1]\n\t\t \ttmp.published_at = date\n\t\t \tnext\n\t\t\twhen /.*<a href=(.|\\n)*/\n\t\t\t\tdownload_link = td.inner_html.match(/.*<a href=\"(.*)\"(.|\\n)*/)[1]\n\t\t\t\tlink_bits = download_link.match(/\\/weboncampus\\/getFile.do\\?tipo=(\\d*)&id=(\\d*)/)\n\t\t\t\ttmp.file_type = link_bits[1]\n\t\t\t\ttmp.file_id = link_bits[2]\n\t\t\t\t@projects << tmp\n\t\t\t\tnext\n\t\t\twhen /^ $/\n\t\t\t\tnext\n\t\t\twhen /\\s*(<span)|(<b>)|(<font)(.|\\n).*/\n\t\t\t\tnext\n\t\t\telse\n\t\t\t\t#sec_description\n\t\t\t\ttmp.description = td.inner_html.strip\n\t\t\tend\n\t\tend\n\t\treturn @projects\n\trescue\n\t\treturn @projects\n\tend",
"def read_todo\n update\n end",
"def index\n @project = Project.find(params[:project_id])\n @to_dos = @project.to_dos.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @to_dos }\n end\n end",
"def todo\n sort :task_occurrence, default_column: :deadline, default_direction: :desc\n add_crumb t('breadcrumbs.todos'), community_schedule_todo_path(@community)\n @task_occurrences = @community.task_occurrences.for_user_or_open(@user).todo.order(sort_column + ' ' + sort_direction).paginate(page: params[:page],per_page: 20)\n end",
"def todos\n remaining_todos + completed_todos\n end",
"def list_tasks\n tasks = @repository.all\n @view.display_tasks(tasks)\n end",
"def list(project_id, options)\n @_client.get(resource_root(project_id), options)\n end",
"def index\n @todolist = Todolist.find(params[:todolist_id])\n @task = @todolist.tasks.find(params[:id])\n\n @tasks = @todolist.tasks.where(completed: false).order('created_at ASC')\n @completed_tasks = @todolist.tasks.where(completed: true).order('updated_at')\n end",
"def index\n @to_dos = ToDo.all\n end",
"def add_list_of_projects(object, html, projects)\n return if projects.blank?\n\n head2 = :show_name_create_draft.t + \": \"\n list = [head2] + projects.map do |project|\n item = link_to(*new_description_for_project_tab(object, project))\n indent + item\n end\n html2 = list.safe_join(safe_br)\n html += tag.p(html2)\n html\n end",
"def parse_tasks(text)\n li_tag = '<li class=\"task-list-item\">'\n unchecked_box = '<input type=\"checkbox\" value=\"on\" disabled />'\n checked_box = unchecked_box.sub(/\\/>$/, 'checked=\"checked\" />')\n\n # Regexp captures don't seem to work when +text+ is an\n # ActiveSupport::SafeBuffer, hence the `String.new`\n String.new(text).gsub(Taskable::TASK_PATTERN_HTML) do\n checked = $LAST_MATCH_INFO[:checked].downcase == 'x'\n p_tag = $LAST_MATCH_INFO[:p_tag]\n\n if checked\n \"#{li_tag}#{p_tag}#{checked_box}\"\n else\n \"#{li_tag}#{p_tag}#{unchecked_box}\"\n end\n end\n end",
"def index(file) \n\n file = File.open(file, \"r\")\n tasks = file.readlines\n file.close\n\n return tasks\n\nend",
"def release_notes\n notes = []\n projects.map { |project| notes << project.release_notes(tag_full_name) }\n notes.compact.join(\"\\n\")\n end",
"def list_repo(repo_id)\n response = HTTParty.get(\n GIT_BASE_URL + 'projects/' + repo_id.to_s,\n :headers => {\n 'PRIVATE-TOKEN' => GIT_TOKEN\n }\n )\n Rails.logger.info \"Git server response (list repo): #{response}\"\n return response['content']\n end",
"def get_todo (nb)\n # TODO: parse todo to remove the priority\n line = IO.readlines(TODO_FILE)[nb-1]\n if line.match '^\\(([A-Z])\\)'\n line.slice!(0..4)\n end\n line\n end",
"def index\n @task_lists = @project.task_lists.all\n\n respond_with @task_lists\n end",
"def tasks\n @todos = Todo.all\n render json: @todos\n end",
"def set_todo\n @todo = @project.todos.find(params[:id])\n end",
"def tasks(project_id, story_id, options = {})\n get(\"projects/#{project_id}/stories/#{story_id}/tasks\", options).tasks\n end",
"def call\n list = JSON.parse(Base64.urlsafe_decode64(@params['list']))\n Success(list)\n rescue StandardError\n Failure(Value::Result.new(status: :bad_request,\n message: 'Project list not found'))\n end",
"def create_text\n songs.inject(\"\") do |list, song|\n list << \"#{song.filename}, #{song.title}\\n\"\n end\n end",
"def get_and_format_todos(method_hash, uniqname, provider_args)\n\n unless method_hash[provider_args[:provider_type]].nil?\n # call with extra argument if necessary\n raw_todos = provider_args[:canvas_course_list] ? method_hash[provider_args[:provider]].(uniqname, provider_args[:canvas_course_list]) : method_hash[provider_args[:provider]].(uniqname)\n result = raw_todos.result\n todos = method_hash[provider_args[:formatter]].(result).toDoLms\n todos = WAPIResultWrapper.new(WAPIStatus::SUCCESS, provider_args[:wapi_msg], todos)\n end\n\n todos\n end",
"def get_all\n Rutodo::Database::Todo.map(&:as_entity)\n end",
"def refresh\n response = Logan::Client.get \"/projects/#{project_id}/todos/#{id}.json\"\n initialize(response.parsed_response)\n end",
"def refresh\n response = Logan::Client.get \"/projects/#{project_id}/todos/#{id}.json\"\n initialize(response.parsed_response)\n end",
"def index\n @project = Project.find(params[:project_id])\n @tasks = @project.tasks.order('id DESC')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end",
"def index\n @project = Project.find(params[:project_id])\n @tasks = @project.tasks\n end",
"def user_todos user_id=\"self\", options={}\n response = get(\"/lists/#{user_id}/todos\", options)[\"response\"]\n Foursquared::Response::List.new(self, response[\"list\"])\n end",
"def get_tasks(tasklist)\n tasklist_id = tasklist[\"id\"]\n tasklist.tasks = @client.execute(\n api_method: @api.tasks.list,\n parameters: {tasklist: tasklist_id}\n ).data.to_hash[\"items\"]\n end",
"def index\n @thing_to_dos = ThingToDo.all\n end",
"def index\n @thing_to_dos = ThingToDo.all\n end",
"def to_do_list\n if current_staff.on_duty?\n @task_assignments = current_staff.currently_assigned_tasks\n end\n \n respond_to do |format|\n format.html # to_do_list.html.erb\n format.xml { render :xml => @task_assignments }\n end\n end",
"def get_completed_todos\n return Todo.where({\"user_id\" => self.id, \"completed\" => true})\n end"
] |
[
"0.6820073",
"0.67624336",
"0.6753962",
"0.66622216",
"0.64492136",
"0.6207838",
"0.6175382",
"0.60986507",
"0.60693455",
"0.5954329",
"0.5948362",
"0.58631736",
"0.5756917",
"0.57211804",
"0.57176006",
"0.5713984",
"0.5556455",
"0.55495805",
"0.5544898",
"0.55428237",
"0.5541835",
"0.5534342",
"0.55248576",
"0.5521444",
"0.5504458",
"0.5500863",
"0.54135036",
"0.54127216",
"0.5410483",
"0.53610474",
"0.5352448",
"0.53434914",
"0.5335369",
"0.53112435",
"0.53091985",
"0.5307502",
"0.5298521",
"0.5285669",
"0.5272379",
"0.5259848",
"0.5258088",
"0.52455646",
"0.524283",
"0.52298164",
"0.5222441",
"0.52215296",
"0.52182657",
"0.5214323",
"0.52018857",
"0.5199046",
"0.5196238",
"0.51853395",
"0.5184515",
"0.5183922",
"0.51794666",
"0.5171846",
"0.516893",
"0.51622117",
"0.5140117",
"0.5137167",
"0.51369846",
"0.5132955",
"0.5128371",
"0.51066",
"0.5094766",
"0.50924885",
"0.50874764",
"0.50791043",
"0.5077032",
"0.50685173",
"0.50663155",
"0.50594336",
"0.5041672",
"0.50325084",
"0.503185",
"0.503003",
"0.5027484",
"0.5022986",
"0.50196064",
"0.50149703",
"0.5012556",
"0.50082546",
"0.5003139",
"0.49888232",
"0.49716154",
"0.4958679",
"0.49585965",
"0.49353766",
"0.49327528",
"0.49294874",
"0.49269867",
"0.49269867",
"0.49251997",
"0.49250937",
"0.4921872",
"0.49197826",
"0.49194595",
"0.49194595",
"0.4915806",
"0.49120227"
] |
0.63672274
|
5
|
Formats a Pivotal Tracker story in the todo.txt format. Letterbased priorities are given to it depending on what the story's current status is. The story's labels and story type are todo.txt's contexts, while the story's project name is the todo's story. The URL of the story is also added to the
|
def format_todotxt(project_id, priority_group, story)
task_priority =
case priority_group
when :today then "(A)"
when :next then "(B)"
when :someday then "(C)"
end
done = task_priority.nil?
# TODO: escape newlines...
title = story.css('name').text
url = story.css('url').text
story_id = story.css('id').text
story_type = story.css('story_type').text
labels = story.css('labels').text.split(',')
d = Date.parse(story.css('updated_at').text)
updated_at = d.strftime("%Y-%m-%d")
pname = project_name(project_id)
append = lookup_server_from_project(project_id)[:append]
task = ""
task << "x #{updated_at} " if done
task << "#{task_priority} " unless task_priority.blank?
task << title
task << " @#{story_type}" unless story_type.blank?
task << labels.map{|l| " @#{l}"}.join
task << " +#{pname}" unless pname.blank?
task << " url:#{url}" unless url.blank?
task << " @frompivotal"
task << " #{append}" unless append.blank?
task
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def my_todos(project_id, body)\n body.css('stories > story').select do |s|\n s.css('owned_by').text == OWNER\n end.inject({}) do |tasks, s|\n state = map_state s.css('current_state').text\n tasks[state] ||= []\n tasks[state] << s\n tasks\n end.map do |priority_group, stories|\n stories.map{|s| format_todotxt project_id, priority_group, s}\n end.flatten\nend",
"def show_todo(id)\n filename = find_filename_for_todo(id)\n todo = create_todo_hash_from_file(filename)\n pretty_print_todo(todo)\nend",
"def update_comment_text(story_data, bug_task, build_number)\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 (story_data.current_state != 'finished' && story_data.current_state != 'delivered' && story_data.current_state != 'accepted')\n txt << \"\\n\\nNOTE: this story is not in the expected status 'Finished'... please verify and update status if necessary\"\n end\n txt\n end",
"def text_to_issue(issue, options={})\n title = nil\n subject = nil\n text = options[:tracker] == false ? \"##{issue.id}\" : \"#{issue.tracker} ##{issue.id}\"\n if options[:subject] == false\n title = issue.subject.truncate(60)\n else\n subject = issue.subject\n if truncate_length = options[:truncate]\n subject = subject.truncate(truncate_length)\n end\n end\n only_path = options[:only_path].nil? ? true : options[:only_path]\n s = text\n s << h(\": #{subject}\") if subject\n s = h(\"#{issue.project} - \") + s if options[:project]\n s\n end",
"def create_note(project_id, story_id, text, options = {})\n options = { :note => options.merge!(:text => text) }\n post(\"projects/#{project_id}/stories\", options).note\n end",
"def format_issue(issue, repo)\n splitter = /^[# ]*release note.*/i\n underlines = /^[=\\-#]+$/\n heading_prefix = repo.match('-') ? \"#{drop_prefix(repo)}: \" : ''\n\n # Start polishing the issue body into release note text\n issue_body = issue['body']&.gsub(/\\r\\n/, \"\\n\")&.strip || ' '\n\n # Attempt to split release notes from the body with the splitter\n release_note = issue_body.split(splitter, 2).last.strip\n\n # Attempt header & further content extraction, if there was no splitter\n if release_note == issue_body\n # Discard everything before the first heading\n release_note = issue_body.split(/^#/, 2).last\n # Re-add the first \"#\", if the header split worked\n release_note = \"##{release_note}\" unless release_note == issue_body\n end\n\n # Remove extraneous lines, like ==== ---- ####\n release_note.sub!(/^.*$/, '').strip! if release_note.split(\"\\n\").first&.match(underlines)\n\n # Handle underline-style headings at the top; converting to ATX-stle\n release_note.sub!(/^(.*)$\\n^.*$/, '## \\1') if release_note.split(\"\\n\")[1]&.match(underlines)\n\n # Prepend an issue title when a heading wasn't extracted\n issue_title = release_note&.match(/^#/) ? '' : \"## #{heading_prefix}#{issue['title']}\\n\\n\"\n\n puts issue.to_yaml if @options.debug\n\n state_info = if @options.preview\n state = issue['state']\n if state == 'open'\n alert = 'warn'\n included = '(will not be included) '\n merged = 'OPEN'\n else\n alert = 'note'\n included = ''\n merged = 'merged'\n end\n url = issue['html_url']\n \"State: **#{merged}** #{included}@ <#{url}>\\n{:.#{alert}}\\n\\n\"\n else\n ''\n end\n\n full_note = \"#{issue_title}#{release_note.strip}\"\n # Normalize headings to H2\n .sub(/^#+/, '##')\n .sub(/\\n\\n/, \"\\n\\n#{state_info}\")\n\n process_images(full_note)\nend",
"def update_story(story_data, story_task, build_number)\n # get last comment\n last_obj = story_data.notes.all.last\n last_comment = last_obj.text if last_obj\n\n # if state is 'Finished', update it to delivered\n if (story_data.current_state == 'finished')\n puts \"marking story #{story_task[:task_num]} as 'delivered'\"\n story_data.update(:current_state => 'delivered') if !@dryrun\n elsif (story_data.current_state != 'delivered')\n #if not finished or delivered, write error\n puts \"story #{story_task[:task_num]} in unexpected state '#{story_data.current_state}', not updating state.\"\n end\n\n if (!last_comment || !last_comment.start_with?(FIXED_COMMENT_PREFIX))\n # if there's no comments yet, or if that comment doesn't start with FIXED_COMMENT_PREFIX\n comment_text = update_comment_text(story_data, story_task, build_number)\n story_data.notes.create(:text => comment_text) if !@dryrun\n # do we need to add :noted_at => '06/29/2010 05:00 EST' attribute in above call?\n puts \"adding comment to story #{story_task[:task_num]}:\\n#{comment_text}\"\n end\n end",
"def listing_added_template\n one_line_story_template \"{*actor*} added following: {*show_link*} to his/her library.\"\n short_story_template \"{*actor*} added following. \", \"It is {*show_link*}.\"\n end",
"def create_on_task(client, task: required(\"task\"), text: required(\"text\"), options: {}, **data)\n with_params = data.merge(text: text).reject { |_,v| v.nil? || Array(v).empty? }\n self.new(parse(client.post(\"/tasks/#{task}/stories\", body: with_params, options: options)).first, client: client)\n end",
"def story(story_content)\n story_content = story_content.strip.split(/[ \\t]*\\n+[ \\t]*/).map {|line| \" #{line}\\n\" }.join \n #metadata[:example_group][:description] << \"\\n\"+story_content+\"\\n\"\n metadata[:example_group][:full_description] << \"\\n\"+story_content+\"\\n\"\n end",
"def createJobSummary\n comment = \"PR cannot be merged due to following issues:\\n\"\n if MAINTAINERS_FAILED_VALIDATION.length() != 0\n comment += \"- Maintainers\\n\"\n for issueObject in MAINTAINERS_FAILED_VALIDATION do\n comment += \"\\t- `#{issueObject[:title]}`\\n\"\n for issue in issueObject[:issues] do\n comment += \"\\t\\t- #{issue}\\n\"\n end\n end\n end\n if OSSPROJECTS_FAILED_VALIDATION.length() != 0\n comment += \"- OSS Projects\\n\"\n for issueObject in OSSPROJECTS_FAILED_VALIDATION do\n comment += \"\\t- `#{issueObject[:title]}`\\n\"\n for issue in issueObject[:issues] do\n comment += \"\\t\\t- #{issue}\\n\"\n end\n end\n end\n if SOCIALGOOD_FAILED_VALIDATION.length() != 0\n comment += \"- Social Good Projects\\n\"\n for issueObject in SOCIALGOOD_FAILED_VALIDATION do\n comment += \"\\t- `#{issueObject[:title]}`\\n\"\n for issue in issueObject[:issues] do\n comment += \"\\t\\t- #{issue}\\n\"\n end\n end\n end\n @logger.info(\"Summary: #{comment}\")\n File.write(ENV[\"GITHUB_STEP_SUMMARY\"], comment)\nend",
"def save_instructions\n file = 'TODO'\n text = \"### TO-DO for #{name.upcase} feature:\\n\\n#{instructions}\\n\\n\\n\"\n\n in_root do\n create_file file unless File.exists? file\n append_to_file file, text\n end\n end",
"def generateReleaseNote_TXT\r\n rSuccess = true\r\n\r\n logOp('Generating release note in TXT format') do\r\n lStrWhatsNew = ''\r\n if (@ReleaseComment != nil)\r\n lStrWhatsNew = \"\r\n== What's new in this release\r\n\r\n#{@ReleaseComment}\r\n\r\n\"\r\n end\r\n File.open(\"#{@DocDir}/ReleaseNote.txt\", 'w') do |oFile|\r\n oFile << \"\r\n= Release Note for #{@ReleaseInfo.project_info[:name]} - v. #{@ReleaseVersion}\r\n\r\n== Development status: #{@ReleaseInfo.project_info[:dev_status]}\r\n\r\n#{lStrWhatsNew}\r\n== Detailed changes with previous version\r\n\r\n#{getLastChangeLog.join}\r\n\r\n== Useful links\r\n\r\n* Project web site: #{@ReleaseInfo.project_info[:web_page_url]}\r\n* Download: https://sourceforge.net/projects/#{@ReleaseInfo.project_info[:project_unix_name]}/files/#{@ReleaseVersion}/#{@GemName}/download\r\n* Author: #{@ReleaseInfo.author_info[:name]} (#{@ReleaseInfo.author_info[:web_page_url]}) (Mail: #{@ReleaseInfo.author_info[:email]})\r\n* Browse RDoc: #{@ReleaseInfo.project_info[:web_page_url]}rdoc/#{@ReleaseVersion}\r\n* Browse source: #{@ReleaseInfo.project_info[:browse_source_url]}\r\n* View complete ChangeLog: #{@ReleaseInfo.project_info[:browse_source_url]}ChangeLog?view=markup\r\n* View README file: #{@ReleaseInfo.project_info[:browse_source_url]}README?view=markup\r\n\"\r\n end\r\n end\r\n\r\n return rSuccess\r\n end",
"def log2file(filename = File.basename($0) + '.todo', level = Log4r::ALL)\r\n @logger.add( Log4r::FileOutputter.new('ToDo', \r\n :filename => filename,\r\n :level => level,\r\n :formatter => FixmeFormatter \r\n ))\r\n \r\n end",
"def pt_print\n @task = Task.includes(:assignment).find(params[:task_id])\n @assignment = @task.assignment\n @titles = Title.build_paragraph_title_collection(@task.id,current_user.id)\n end",
"def todo_tag(text); end",
"def display_and_save_description(label, description)\n puts \"Starting round: #{label}\"\n puts description\n\n output = File.open(\"challenges/#{label}.txt\", 'w')\n output << description\n output.close\n puts \"Challenge description saved to file: #{output.path}.\"\n\n 'OK'\nend",
"def toodle_to_taskwarrior(task)\n twtask = {}\n twtask[:toodleid] = task[:id]\n twtask[:description] = task[:title]\n twtask[@due_field] = from_toodle_date(task[:duedate].to_i) if task[:duedate]\n twtask[:tags] = task[:tag].split(\",\").map(&:strip) if task[:tag]\n twtask[:project] = toodle_folder_to_tw(task[:folder]) if task[:folder]\n twtask[:priority] = toodle_priority_to_tw(task[:priority]) if task[:priority]\n twtask[:status] = task[:completed] ? \"completed\" : \"pending\"\n twtask[:uuid] = SecureRandom.uuid\n twtask[:entry] = Time.now.to_i\n if task[:context]\n con = toodle_context_to_tw(task[:context])\n twtask[:tags] = twtask[:tags] ? twtask[:tags].concat([ con ]) : [con]\n end\n\n twtask\n end",
"def build_output(items, no_of_issues, v_name, r_date, n_branch, target)\n target = target\n\n output_filename = v_name + '_changelog_for_' + target + '.txt'\n out_file = File.new(output_filename, 'w')\n\n # Categories counter\n c_cnt = 0\n # Issues with category counter\n i_cnt = 0\n # Issues without category counter\n nc_i_cnt = 0\n\n if target == 'packaged_file'\n out_file << \"== #{r_date} v#{v_name}\\n\\n\"\n elsif target == 'website'\n out_file << \"h1. Changelog #{v_name}\\n\\n\" if n_branch == true\n out_file << \"h2. version:#{v_name} (#{r_date})\\n\\n\"\n end\n\n # Print the categories...\n items.each do |key, values|\n key = key.empty? ? '-none-' : key\n\n if target == 'packaged_file'\n out_file << \"=== [#{key}]\\n\"\n elsif target == 'website'\n out_file << \"h3. [#{key}]\\n\"\n end\n out_file << \"\\n\"\n (c_cnt += 1) unless key == '-none-'\n\n # ...and their associated issues\n values.each do |val|\n out_file << \"* #{val['tracker']} ##{val['id']}: #{val['subject']}\\n\"\n key == '-none-' ? (nc_i_cnt += 1) : (i_cnt += 1)\n end\n out_file << \"\\n\"\n end\n\n summary(v_name, target, i_cnt, nc_i_cnt, no_of_issues, c_cnt)\n\n out_file.close\n end",
"def create\n @story = Story.new(story_params)\n @story.project_id = params[:project_id] if current_user.projects.where(id: params[:project_id])\n @story.state = \"to do\"\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story.project, notice: 'Story was successfully created.' }\n format.json { render :show, status: :created, location: @story }\n else\n format.html { render :new }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_pivotal_stories(stories, build_number)\n puts \"Updating pivotal stories...\"\n # update pivotal stories\n stories.each do |story|\n story_data = find_story_by_id(story[:task_num])\n if (story_data)\n # story was found, update comments and status\n update_story(story_data, story, build_number)\n # set story title in task object\n story[:task_name] = story_data.name\n else\n # unknown story, notify author of commit\n @email_reporter.notify_story_id_not_found(story)\n end\n end\n end",
"def create_goal_file\n File.open(\"Goal/goal#{file_counter}.txt\", 'w') { |file| file.write(\"#{final_name_info}\") }\nend",
"def create\n @story = Story.new(story_params)\n @story.project_id = params[:project_id]\n\n respond_to do |format|\n if @story.save\n activity = @story.create_activity :create, owner: current_user, recipient: Project.find(@story.project_id)\n @notif = Notification.new\n @notif.notifs_create(@story, activity.id) \n format.html { redirect_to project_path(id: @story.project_id), notice: 'Story was successfully created.' }\n format.json { render :show, status: :created, location: @story }\n else\n format.html { render :new }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\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 write_taskwarrior_file\n open(@task_file, 'w') do |f|\n local_tasks.each do |t|\n t[:tags] = t[:tags].join(\",\") if t[:tags]\n f.puts('[' + t.collect{|k, v| %Q{#{k}:\"#{v}\"} }.join(\" \") + ']')\n end\n end\n end",
"def create_note\n trap('SIGINT') do\n warn \"\\nCanceled\"\n exit!\n end\n # First make sure there isn't already a buildnotes file\n filename = find_note_file\n if filename\n system 'stty cbreak'\n fname = \"\\e[1;33m#{filename}\\e[1;37m\"\n yn = color_single_options(%w[y N])\n $stdout.syswrite \"#{fname} exists and appears to be a build note, continue anyway #{yn}\\e[1;37m? \\e[0m\"\n res = $stdin.sysread 1\n res.chomp!\n puts\n system 'stty cooked'\n\n unless res =~ /y/i\n puts 'Canceled'\n Process.exit 0\n end\n end\n\n title = File.basename(Dir.pwd)\n printf \"\\e[1;37mProject name \\e[0;32m[#{title}]\\e[1;37m: \\e[0m\"\n input = gets.chomp\n title = input unless input.empty?\n\n summary = ''\n printf \"\\e[1;37mProject summary: \\e[0m\"\n input = gets.chomp\n summary = input unless input.empty?\n\n ext = 'md'\n printf \"\\e[1;37mChoose build notes file extension \\e[0;32m[md]\\e[1;37m: \\e[0m\"\n input = gets.chomp\n ext = input unless input.empty?\n\n note = <<~EOBUILDNOTES\n # #{title}\n\n #{summary}\n\n ## File Structure\n\n Where are the main editable files? Is there a dist/build folder that should be ignored?\n\n ## Build\n\n What build system/parameters does this use?\n\n @run(./build command)\n\n ## Deploy\n\n What are the procedures/commands to deploy this project?\n\n ## Other\n\n Version control notes, additional gulp/rake/make/etc tasks...\n\n EOBUILDNOTES\n\n note_file = \"buildnotes.#{ext}\"\n\n if File.exist?(note_file)\n system 'stty cbreak'\n yn = color_single_options(%w[y N])\n file = \"\\e[1;33m#{filename}\"\n $stdout.syswrite \"\\e[1;37mAre you absolutely sure you want to overwrite #{file} #{yn}\\e[1;37m? \\e[0m\"\n res = $stdin.sysread 1\n res.chomp!\n puts\n system 'stty cooked'\n\n unless res =~ /y/i\n puts 'Canceled'\n Process.exit 0\n end\n end\n\n File.open(note_file, 'w') do |f|\n f.puts note\n puts \"Build notes for #{title} written to #{note_file}\"\n end\n end",
"def generateReleaseNote_HTML\r\n rSuccess = true\r\n\r\n logOp('Generating release note in HTML format') do\r\n lLastChangesLines = []\r\n getLastChangeLog.each do |iLine|\r\n lLastChangesLines << iLine.\r\n gsub(/\\n/,\"<br/>\\n\").\r\n gsub(/^=== (.*)$/, '<h3>\\1</h3>').\r\n gsub(/^\\* (.*)$/, '<li>\\1</li>').\r\n gsub(/Bug correction/, '<span class=\"Bug\">Bug correction</span>')\r\n end\r\n lStrWhatsNew = ''\r\n if (@ReleaseComment != nil)\r\n lStrWhatsNew = \"\r\n<h2>What's new in this release</h2>\r\n#{@ReleaseComment.gsub(/\\n/,\"<br/>\\n\")}\r\n \"\r\n end\r\n File.open(\"#{@DocDir}/ReleaseNote.html\", 'w') do |oFile|\r\n oFile << \"\r\n<html>\r\n <head>\r\n <link rel=\\\"shortcut icon\\\" href=\\\"#{@ReleaseInfo.project_info[:favicon_url]}%>\\\" />\r\n <style type=\\\"text/css\\\">\r\n body {\r\n background: #fdfdfd;\r\n font: 14px \\\"Helvetica Neue\\\", Helvetica, Tahoma, sans-serif;\r\n }\r\n img {\r\n border: none;\r\n }\r\n h1 {\r\n text-shadow: rgba(135,145,135,0.65) 2px 2px 3px;\r\n color: #6C8C22;\r\n }\r\n h2 {\r\n padding: 2px 8px;\r\n background: #ccc;\r\n color: #666;\r\n -moz-border-radius-topleft: 4px;\r\n -moz-border-radius-topright: 4px;\r\n -webkit-border-top-left-radius: 4px;\r\n -webkit-border-top-right-radius: 4px;\r\n border-bottom: 1px solid #aaa;\r\n }\r\n h3 {\r\n padding: 2px 32px;\r\n background: #ddd;\r\n color: #666;\r\n -moz-border-radius-topleft: 4px;\r\n -moz-border-radius-topright: 4px;\r\n -webkit-border-top-left-radius: 4px;\r\n -webkit-border-top-right-radius: 4px;\r\n border-bottom: 1px solid #aaa;\r\n }\r\n .Bug {\r\n color: red;\r\n font-weight: bold;\r\n }\r\n .Important {\r\n color: #633;\r\n font-weight: bold;\r\n }\r\n ul {\r\n line-height: 160%;\r\n }\r\n li {\r\n padding-left: 20px;\r\n }\r\n </style>\r\n </head>\r\n <body>\r\n <a href=\\\"#{@ReleaseInfo.project_info[:web_page_url]}\\\"><img src=\\\"#{@ReleaseInfo.project_info[:image_url]}\\\" align=\\\"right\\\" width=\\\"100px\\\"/></a>\r\n <h1>Release Note for #{@ReleaseInfo.project_info[:name]} - v. #{@ReleaseVersion}</h1>\r\n <h2>Development status: <span class=\\\"Important\\\">#{@ReleaseInfo.project_info[:dev_status]}</span></h2>\r\n#{lStrWhatsNew}\r\n <h2>Detailed changes with previous version</h2>\r\n#{lLastChangesLines.join}\r\n <h2>Useful links</h2>\r\n <ul>\r\n <li><a href=\\\"#{@ReleaseInfo.project_info[:web_page_url]}\\\">Project web site</a></li>\r\n <li><a href=\\\"https://sourceforge.net/projects/#{@ReleaseInfo.sf_info[:project_unix_name]}/files/#{@ReleaseVersion}/#{@GemName}/download\\\">Download</a></li>\r\n <li>Author: <a href=\\\"#{@ReleaseInfo.author_info[:web_page_url]}\\\">#{@ReleaseInfo.author_info[:name]}</a> (<a href=\\\"mailto://#{@ReleaseInfo.author_info[:email]}\\\">Contact</a>)</li>\r\n <li><a href=\\\"#{@ReleaseInfo.project_info[:web_page_url]}rdoc/#{@ReleaseVersion}\\\">Browse RDoc</a></li>\r\n <li><a href=\\\"#{@ReleaseInfo.project_info[:browse_source_url]}\\\">Browse source</a></li>\r\n <li><a href=\\\"#{@ReleaseInfo.project_info[:browse_source_url]}ChangeLog?view=markup\\\">View complete ChangeLog</a></li>\r\n <li><a href=\\\"#{@ReleaseInfo.project_info[:browse_source_url]}README?view=markup\\\">View README file</a></li>\r\n </ul>\r\n </body>\r\n</html>\r\n\"\r\n end\r\n end\r\n\r\n return rSuccess\r\n end",
"def CreateTasksForUserStory (aUserStory, tasks)\n\n\trally = RallyRestAPI.new(:base_url => @base_url, :username => @user_name, :password => @password)\n\n\tquery_result = rally.find(:hierarchical_requirement) {equal :formatted_i_d, aUserStory}\n\n\tuserStory = query_result.results.first\n\n\ttasks.each { |task| \n\n\t\tfields = {\n\t\t\t :work_product => userStory,\n\t\t\t :name => task,\n\t\t\t :state => \"Defined\",\n\t\t\t :estimate => 1,\n\t\t\t :to_do => 1\n\t\t}\n\n\t\trally.create(:task, fields)\n\n\t\tprint aUserStory + \":\" + task + \" - OK\\n\"\n\t}\nend",
"def parse_task(t)\n @builder.outline(\"text\" => t[\"name\"], \"type\" => \"link\", \"url\" => t[\"url\"], \"created\" => t[\"created\"]) do\n \tt[\"tasks\"].each { |st| parse_task(st) }\n end\n end",
"def task_status_to_task_link_text(task_status)\n status_description = { 'passing' => 'view',\n 'failing' => 'retry',\n 'testing' => 'testing...',\n 'incomplete' => 'start' }\n status_description[task_status]\nend",
"def create\n @tracker = Tracker.new()\n @tracker.period = params[:period]\n @tracker.user_id = current_user.id\n @user = User.find(current_user.id)\n\n respond_to do |format|\n if @tracker.save\n \n @fields = [Field.new(), Field.new(), Field.new()]\n\n @lastfields = Field.all.order(\"id desc\").limit(3).reverse\n\n if not @lastfields.any? \n @fields[0].title = \"Progress\" \n @fields[1].title = \"Plan\"\n @fields[2].title = \"Problems\"\n else\n @fields[0].title = @lastfields[0].title \n @fields[1].title = @lastfields[1].title\n @fields[2].title = @lastfields[2].title\n end\n\n @fields.each do |f|\n f.tracker_id = @tracker.id\n f.save\n\n @entries = [Entry.new(), Entry.new(), Entry.new()]\n @entries.each do |e|\n e.field_id = f.id\n e.task = \"Click here to edit goal\"\n e.save\n\n end\n\n \n end\n\n format.html { redirect_to @user, notice: 'Tracker was successfully created.' }\n format.json { render :show, status: :created, location: @tracker }\n else\n format.html { render :new }\n format.json { render json: @tracker.errors, status: :unprocessable_entity }\n end\n end\n end",
"def taskwarrior_to_toodle(task)\n toodletask = {}\n toodletask[:title] = task[:description]\n toodletask[:id] = task[:toodleid] if task[:toodleid]\n toodletask[:duedate] = to_toodle_date(task[@due_field].to_i) if task[@due_field]\n toodletask[:completed] = to_toodle_date(task[:end].to_i) if task[:end]\n toodletask[:priority] = tw_priority_to_toodle(task[:priority]) if task[:priority]\n toodletask[:folder] = tw_project_to_toodle(task[:project]) if task[:project]\n if task[:tags]\n context = task[:tags].find{|i| i.start_with? '@' }\n if context\n toodletask[:context] = tw_context_to_toodle(context)\n task[:tags] = task[:tags].select{|t| not t.start_with? '@'}\n end\n toodletask[:tag] = task[:tags].join(\",\")\n end\n toodletask\n end",
"def story(project)\n $LOG.debug(\"#{self.class}:#{__method__}\")\n story_id = Util::Git.get_config KEY_STORY_ID, :branch\n $LOG.debug(\"story_id:#{story_id}\")\n project.story story_id.to_i\n end",
"def customizeTemplate( \n _displayFormat = \"points\" # specify the type {values, points}\n )\n\n template = File.read(@filename)\n\n\n template.sub!('*****DETAIL*****', @dailyActivity.to_s)\n template.sub!('*****BADGES*****', [].to_s) # empty for now.\n template.sub!('*****FORMAT*****', \"\\\"#{_displayFormat}\\\"\")\n\n template.sub!('*****TOTAL*****', @dailyTotals.to_s)\n template.sub!('*****TARGET*****', @goalTarget.to_s)\n template.sub!('*****START*****', \"\\\"#{@startDate}\\\"\")\n template.sub!('*****END*****', \"\\\"#{@endDate}\\\"\")\n template.sub!('*****NAME*****', \"\\\"#{@name}\\\"\")\n\n return template\n end",
"def story(id)\n TrackR::Story.new(:story_id => id, :project_id => @id, :token => @token)\n end",
"def create(params, projectid, todolistid)\n\n data = params[:due_at]\n data = Date.parse(data.to_a.sort.collect{|c| c[1]}.join(\"-\"))\n\n body =\n {\n :content => params[:content],\n :due_at => data,\n :assignee =>\n {\n :id => params[:assignee_id],\n :type => params[:assignee_type]\n }\n }\n\n post(\"projects/#{projectid}/todolists/#{todolistid}/todos.json\", JSON.generate(body))\n\n end",
"def write_taskwarrior_file(file, tasks)\n open(file, 'w') do |f|\n tasks.sort_by(&:toodleid).each do |t|\n t.tags = t.tags.join(\",\") if not t.tags.to_s.empty?\n f.puts('[' + t.to_h.collect{|k, v| %Q{#{k}:\"#{v}\"} }.join(\" \") + ']')\n end\n end\n end",
"def issue_notes_for(name, version, issues, notes)\n notes << \"\\n### #{name} Issues resolved for #{version}\\n\\n\"\n do_references = ENV['REFERENCES']\n\n issues.reverse.each do |issue|\n if do_references\n notes << %Q{[#{issue[0]}]:#{issue[2]}\\n}\n else\n notes << %Q{- [#{issue[0]} - #{issue[1]}](#{issue[2]})\\n}\n end\n end\n notes\nend",
"def timeline_title\n if completed?\n \"Hearing type converted from #{appeal.readable_previous_hearing_request_type_for_task(id)}\"\\\n \" to #{appeal.readable_current_hearing_request_type_for_task(id)}\"\n end\n end",
"def create_todo_hash_from_file(filename)\n todo = Hash.new()\n\n todo['filename'] = filename\n\n file_path = TODOS_DIRECTORY + '/' + filename\n lines = File.read(file_path).split(\"\\n\")\n\n read_mode = 'not_body'\n todo['body'] = ''\n\n for line in lines\n if line.empty?\n next\n elsif line.include?(': ')\n key_and_value = line.split(': ')\n key = key_and_value[0]\n value = key_and_value[1]\n\n if key == 'title'\n todo['title'] = value\n elsif key == 'status'\n todo['status'] = value\n end\n\n elsif line == '---'\n # Once we hit the triple-dashes, that means the rest of the file\n # is the body of the item.\n read_mode = 'body'\n\n elsif read_mode == 'body'\n todo['body'] += line + \"\\n\"\n end\n end\n\n if !todo.has_key?('status')\n # The default status is 'pending'.\n todo['status'] = 'pending'\n end\n\n return todo\nend",
"def create\n @journal = current_user.journals.find(params[:journal_id])\n @task = @journal.tasks.find(params[:task_id])\n @task.descriptions.create\n redirect_to journal_task_path(@journal, @task)\n end",
"def create_traces_text_from_traces_array(traces_array) #{\n rally_host = $my_base_url.split(\"/\")[-2]\n detail_url_prefix = \"https://#{rally_host}/#/detail/userstory\"\n traces_markup = '<p><b>Caliber TRACES</b></p><br/>'\n trace_counter = 1\n\n traces_array.each do | this_trace |\n story_oid = @story_TagFidOidName_by_reqid[this_trace][1]\n if !story_oid.nil? then\n this_trace_name = this_trace\n story_url_detail = \"#{detail_url_prefix}/#{story_oid}\"\n this_trace = \"<a href=\\\"#{story_url_detail}\\\">#{this_trace_name}</a>\"\n end\n \n traces_markup += trace_counter.to_s + \". \"\n traces_markup += this_trace\n traces_markup += '<br/>'\n trace_counter += 1\n end \n return traces_markup\nend",
"def tell_Story(paragraph)\r\n puts paragraph\r\n end",
"def textile_p_withtoc(tag, atts, cite, content)\n # removes wiki links from the item\n toc_item = content.gsub(/(\\[\\[([^\\]\\|]*)(\\|([^\\]]*))?\\]\\])/) { $4 || $2 }\n # sanitizes titles from links\n # see redcloth3.rb, same as \"#{pre}#{text}#{post}\"\n toc_item.gsub!(LINK_RE) { [$2, $4, $9].join }\n # sanitizes image links from titles\n toc_item.gsub!(IMAGE_RE) { [$5].join }\n # removes styles\n # eg. %{color:red}Triggers% => Triggers\n toc_item.gsub! %r[%\\{[^\\}]*\\}([^%]+)%], '\\\\1'\n \n # replaces non word caracters by dashes\n anchor = toc_item.gsub(%r{[^\\w\\s\\-]}, '').gsub(%r{\\s+(\\-+\\s*)?}, '-')\n \n unless anchor.blank?\n if tag =~ /^h(\\d)$/\n @toc << [$1.to_i, anchor, toc_item]\n end\n atts << \" id=\\\"#{anchor}\\\"\"\n content = content + \"<a href=\\\"##{anchor}\\\" class=\\\"wiki-anchor\\\">¶</a>\"\n end\n textile_p(tag, atts, cite, content)\n end",
"def tell_Story(paragraph)\r\n puts paragraph\r\n end",
"def parse_project(p)\n @builder.outline(\"text\" => p[\"name\"], \"type\" => \"link\", \"url\" => p[\"url\"], \"created\" => p[\"created\"]) do\n p[\"tasks\"].each { |t| parse_task(t) }\n end\n end",
"def format_text(title, url, url_title_time_ary)\n s = \"Title: #{title}¥nURL: #{url}¥n¥n\"\n url_title_time_ary.each do |aurl, atitle, atime|\n s << \"* (#{atime})#{atitle}¥n\"\n s << \" #{aurl}¥n\"\n end\n s\nend",
"def send_story_note!(message,story_id)\n return unless project\n if story = project.stories.find(story_id)\n story.notes.create(:text => message, :noted_at => Time.now) # add a new note\n end\n end",
"def convert_document_pptx_to_txt_with_http_info(input_file, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConvertDocumentApi.convert_document_pptx_to_txt ...'\n end\n # verify the required parameter 'input_file' is set\n if @api_client.config.client_side_validation && input_file.nil?\n fail ArgumentError, \"Missing the required parameter 'input_file' when calling ConvertDocumentApi.convert_document_pptx_to_txt\"\n end\n # resource path\n local_var_path = '/convert/pptx/to/txt'\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', 'text/json', 'application/xml', 'text/xml'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n\n # form parameters\n form_params = {}\n form_params['inputFile'] = input_file\n\n # http body (model)\n post_body = nil\n auth_names = ['Apikey']\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 => 'TextConversionResult')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConvertDocumentApi#convert_document_pptx_to_txt\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def todos\n output = `bin/rails notes`\n return if output&.empty?\n\n heading('TODO\\'s', output)\n end",
"def add_todo\n puts\n desc = description('Todo description (required):')\n return if desc.nil?\n due = due_date\n priority = item_priority\n @list.add('todo',desc, { due: due, priority: priority})\n puts\n end",
"def formatted_file_list(title, source_files); end",
"def create_todo(fact, todo_id = nil)\n response = basecamp_connection.post(\"/todo_items/#{todo_id}/time_entries.xml\",\n \"<time-entry>\n <person-id>#{fact.activity.category.account.user_id}</person-id>\n <date>#{fact.start_time.to_date}</date>\n <hours>#{fact.hours}</hours>\n <description>#{fact.description.gsub(/\\&/, \"&\")}</description>\n </time-entry>\", \"Content-Type\" => \"application/xml\")\n if response.code == '201'\n time_entry_id = response['location'].split('/').last\n fact.time_entry.update_attribute(:time_entry_id, time_entry_id)\n return true\n else\n puts response.inspect\n return false\n end\n end",
"def story_params\n params.require(:story).permit(:name, :project_id, :status, :description, :story_type, :owner)\n end",
"def create\n @story = Story.new(params[:story])\n @story.title[0]=@story.title[0].capitalize\n\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story, notice: 'Nowa baśń została dodana.' }\n format.json { render json: @story, status: :created, location: @story }\n else\n format.html { render action: \"new\" }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def task_title(item)\n num_chars = @max_chars - item.size - @taskprefix.size - 2\n computed_line = (@linecharcmds * num_chars)\n $pastel.yellow(@taskprefix) + $pastel.bold(item) + \" \" + $pastel.yellow.dim(computed_line)\n end",
"def description\n \"This task simply attaches a note entity to the current entity.\"\nend",
"def format_input(input)\n raise EmptyInput, 'No content in entry' if input.nil? || input.strip.empty?\n\n input_lines = input.split(/[\\n\\r]+/).delete_if(&:ignore?)\n title = input_lines[0]&.strip\n raise EmptyInput, 'No content in first line' if title.nil? || title.strip.empty?\n\n date = nil\n iso_rx = /\\d{4}-\\d\\d-\\d\\d \\d\\d:\\d\\d/\n date_rx = /^(?:\\s*- )?(?<date>.*?) \\| (?=\\S)/\n\n raise EmptyInput, 'No content' if title.sub(/^.*?\\| */, '').strip.empty?\n\n title.expand_date_tags(Doing.setting('date_tags'))\n\n if title =~ date_rx\n m = title.match(date_rx)\n d = m['date']\n date = if d =~ iso_rx\n Time.parse(d)\n else\n d.chronify(guess: :begin)\n end\n title.sub!(date_rx, '').strip!\n end\n\n note = Note.new\n note.add(input_lines[1..-1]) if input_lines.length > 1\n # If title line ends in a parenthetical, use that as the note\n if note.empty? && title =~ /\\s+\\(.*?\\)$/\n title.sub!(/\\s+\\((?<note>.*?)\\)$/) do\n m = Regexp.last_match\n note.add(m['note'])\n ''\n end\n end\n\n note.strip_lines!\n note.compress\n\n [date, title, note]\n end",
"def format_issue i, width = columns\n return unless i['created_at']\n ERB.new(<<EOF).result binding\n<% p = i['pull_request']['html_url'] if i.key?('pull_request') %>\\\n<%= bright { no_color { indent '%s%s: %s' % [p ? '↑' : '#', \\\n*i.values_at('number', 'title')], 0, width } } %>\n@<%= i['user']['login'] %> opened this <%= p ? 'pull request' : 'issue' %> \\\n<%= format_date DateTime.parse(i['created_at']) %>. \\\n<% if i['merged'] %><%= format_state 'merged', format_tag('merged'), :bg %><% end %> \\\n<%= format_state i['state'], format_tag(i['state']), :bg %> \\\n<% unless i['comments'] == 0 %>\\\n<%= fg('aaaaaa'){\n template = \"%d comment\"\n template << \"s\" unless i['comments'] == 1\n '(' << template % i['comments'] << ')'\n} %>\\\n<% end %>\\\n<% if i['assignee'] || !i['labels'].empty? %>\n<% if i['assignee'] %>@<%= i['assignee']['login'] %> is assigned. <% end %>\\\n<% unless i['labels'].empty? %><%= format_labels(i['labels']) %><% end %>\\\n<% end %>\\\n<% if i['milestone'] %>\nMilestone #<%= i['milestone']['number'] %>: <%= i['milestone']['title'] %>\\\n<%= \" \\#{bright{fg(:yellow){'⚠'}}}\" if past_due? i['milestone'] %>\\\n<% end %>\n<% if i['body'] && !i['body'].empty? %>\n<%= indent i['body'], 4, width %>\n<% end %>\n\nEOF\n end",
"def story\n return @story if @story\n story_id = Git.get_config(KEY_STORY_ID, :branch)\n if story_id.blank? && (matchdata = /^[a-z0-9_\\-]+\\/(\\d+)(-[a-z0-9_\\-]+)?$/i.match(Git.current_branch))\n story_id = matchdata[1]\n Git.set_config(KEY_STORY_ID, story_id, :branch) unless story_id.blank?\n end\n if story_id.blank?\n story_id = ask('What Pivotal story ID is this branch associated with?').strip\n Git.set_config(KEY_STORY_ID, story_id, :branch) unless story_id.blank?\n end\n return nil if story_id.blank?\n return (@story = Story.new(project, project.stories.find(story_id.to_i), branch_name: Git.current_branch))\n end",
"def format_issue(issue)\n t(config.jira.format == 'one-line' ? 'issue.oneline' : 'issue.oneline',\n key: issue.key,\n summary: issue.summary,\n status: issue.status.name,\n assigned: optional_issue_property('unassigned') { issue.assignee.displayName },\n url: format_issue_link(issue.key))\n end",
"def save\n raise ArgumentError, 'Can not update a story with an unknown project_id.' if project_id.nil?\n\n Endpoints::Story.new(client).update(self, UpdateRepresenter.new(self))\n end",
"def create\n @project_story = ProjectStory.new(project_story_params)\n\n respond_to do |format|\n if @project_story.save\n format.html { redirect_to @project_story, notice: 'Project story was successfully created.' }\n format.json { render :show, status: :created, location: @project_story }\n else\n format.html { render :new }\n format.json { render json: @project_story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def title\n # Title of the tracker line\n case obj_type\n when \"Post\"\n obj.subject\n when \"Comment\"\n obj.subj\n end\n end",
"def story_url(story_id)\n \"https://www.pivotaltracker.com/story/show/#{story_id}\"\n end",
"def create\n @todo = Todo.new(params[:todo])\n\n respond_to do |format|\n if @todo.save\n case params[\"commit\"]\n when \"Save and Back to the project\" then format.html { redirect_to todos_path(:filter_project => @todo.project.id, :filter_status => params[:hidden][:filter_status], :exclude_status => params[:hidden][:exclude_status]), notice: 'Todo was successfully created.' }\n when \"Save and Insert\" then format.html {redirect_to new_todo_path(:filter_project => @todo.project.id, :filter_status => params[:hidden][:filter_status], :exclude_status => params[:hidden][:exclude_status]), notice: 'Todo was successfully created.' }\n else\n format.html { redirect_to todo_path(:id => @todo.id, :filter_project => @todo.project.id, :filter_status => params[:hidden][:filter_status], :exclude_status => params[:hidden][:exclude_status]), notice: 'Todo was successfully created.' }\n format.json { render json: @todo, status: :created, location: @todo }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def story(id)\n Story.new(:story_id => id, :project_id => @id, :token => @token)\n end",
"def todo\n sort :task_occurrence, default_column: :deadline, default_direction: :desc\n add_crumb t('breadcrumbs.todos'), community_schedule_todo_path(@community)\n @task_occurrences = @community.task_occurrences.for_user_or_open(@user).todo.order(sort_column + ' ' + sort_direction).paginate(page: params[:page],per_page: 20)\n end",
"def todo_params\n params.require(:todo).permit(:content, :status, :project_id, :creator_id)\n end",
"def overview( *settings )\r\n txt = []\r\n txt << \"List of ToDos/FixMes:\"\r\n @codelines.each do |key, todo|\r\n txt << todo.infoline(settings)\r\n end\r\n txt.join(\"\\n\")\r\n end",
"def format_track_description(text)\n return \"\" unless text\n\n nofollowize(CommonMarker.render_doc(text, :SMART, [:autolink]).to_html(:HARDBREAKS)).html_safe\n end",
"def create\n @text_story = current_user.text_stories.new(params[:text_story])\n @text_story.save\n\n respond_to do |format|\n if @text_story.save\n format.html { redirect_to profile_index_url, notice: 'Text story was successfully created.' }\n format.json { render json: @text_story, status: :created, location: @text_story }\n else\n format.html { render action: \"new\" }\n format.json { render json: @text_story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_report()\n report = <<STR_END\n#### STEPS TO REPRODUCE BUG ####\n\n#{@list_steps_text.get_value}\n\n\n#### DESCRIPTION OF BUG ####\n\n#{@description_text.get_value}\n\n--#{@reproduce_check.get_value}\n--#{@past_check.get_value}\n\n\n#### SESSION LOG ####\n\n#{@parent.log_text.get_value}\n\n\n--------------------------------------------------------------------------------\n#{IO.readlines($attr[:name]).join(\"\\n\") if $attr[:name]}\nSTR_END\n \n fname = \"bugs/#{Time.now.to_s.split(\" \").join(\"_\")}_#{$attr[:name].split(/[\\/\\\\]/).join(\"_\") if $attr[:name]}_bug\"\n File.open(fname, 'w') {|fout| fout.write(report)}\n prompt = MessageDialog.new(self, \"Bug report saved to file: #{fname}\\nPlease email this file to the developer!\",\n \"Bug Report Created\", OK)\n exit_dlg() if prompt.show_modal == ID_OK\n end",
"def save_file\n\tcounter = 1;\n\ttime = Time.now.strftime(\"%d/%m/%Y\")\n\treport_file_puts \"\"\n\treport_file_puts \"Title of saved TodoList: #{@title}\"\n\treport_file_puts \"Save time: #{time}\"\n\treport_file_puts \"----------------------------\"\n\t\t@items.each do |item|\n\n\t\treport_file_puts \"#{counter.to_s} #{item.description} Completion status: #{item.completed_status.to_s}\"\n\t\tcounter +=1;\t\n\tend\t\nend",
"def create\n @user_story = UserStory.new(params[:user_story])\n @user_story.project_id = @project.id\n last_us =UserStory.find(:first, :conditions => [\"project_id = ?\",@project.id], :order => \"us_number DESC\")\n @user_story.us_number = last_us.nil? ? 1 : last_us.us_number + 1\n \n if @user_story.save\n render :update do |p|\n if @user_story.sprint.nil?\n unassigned_us = UserStory.find(:all, :conditions => [\"version_id is null and project_id = ?\", @project.id])\n p.replace \"no_US_0\", \"\" if UserStory.find(:all, :conditions => [\"version_id is null and project_id = ?\",@project.id], :order => \"priority ASC\").size == 1\n p.insert_html :bottom, 'sprint_0', :partial => \"user_stories/backlog_item\", :locals => {:user_story => @user_story, :count => unassigned_us.size + 1}\n p[\"tab_us_#{@user_story.id}\"].visual_effect :highlight, :duration => 2\n else\n if params[:target].blank?\n p.insert_html :bottom, \"sprint_#{@user_story.version_id}\", :partial => \"user_stories/sprint_item\", :locals => {:user_story => @user_story, :count => @user_story.sprint.user_stories.size + 1}\n p[\"tab_us_#{@user_story.id}\"].visual_effect :highlight, :duration => 2\n p[\"no_US_#{@user_story.version_id}\"].visual_effect :blind_up, :duration => 1\n else\n if params[:target].eql? \"show\"\n p.insert_html :bottom, \"dashboard_main_table\", :partial => \"user_stories/us_for_show\", :locals => {:user_story => @user_story, :count => (@user_story.sprint.user_stories.count + 1)}\n end\n end\n end \n end\n else\n respond_to do |format|\n format.html { render :action => \"new\" }\n format.xml { render :xml => @user_story.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def call(_obj, args, ctx)\n Story.create(\n title: args[\"title\"],\n user_id: args[\"user_id\"],\n content: args[\"content\"]\n )\n end",
"def apply(issues)\n if @format_type == :strings then\n keys = issues.map do |issue|\n fmt = @format\n fmt = fmt.join(' ') if fmt.kind_of? Array\n res = JiraMule::IssueRender.render(fmt, issue.merge(issue[:fields]), @custom_tags)\n bolden(issue, res)\n end\n (@header or '').to_s + keys.join(\"\\n\") + (@footer or '').to_s\n\n elsif [:table, :table_rows, :table_columns].include? @format_type then\n @format = [@format] unless @format.kind_of? Array\n rows = issues.map do |issue|\n issue = issue.merge(issue[:fields])\n @format.map do |col|\n if col.kind_of? Hash then\n col = col.dup\n str = col[:value] or \"\"\n res = JiraMule::IssueRender.render(str, issue, @custom_tags)\n col[:value] = bolden(issue, res)\n col\n else\n res = JiraMule::IssueRender.render(col, issue, @custom_tags)\n bolden(issue, res)\n end\n end\n end\n if @format_type == :table_columns then\n rows = rows.transpose\n end\n header = (@header or [])\n header = [header] unless header.kind_of? Array\n Terminal::Table.new :headings => header, :rows=>rows\n end\n end",
"def story_params\n params.require(:story).permit(:title, :description, :point_value, :content, :stage, :project_id)\n end",
"def show\n @stories = []\n stories = @project.stories\n\n story_ids = []\n stories.each { |story| story_ids << story.id }\n tasks = @user.task_tracker_interface.tasks.where(story_id: story_ids)\n\n stories.each do |story|\n new_story = story.attributes\n new_story[:tasks] = tasks.select { |task| task.story_id == story.id }\n @stories.append(new_story)\n end\n end",
"def create\n @task = @trial.tasks.new(task_params)\n\n respond_to do |format|\n if @task.save\n comment_task_create_action\n format.html { redirect_to [@committee, @trial], notice: t(:task_successfully_created) }\n else\n format.html do\n redirect_to [@committee, @trial],\n alert: @task.errors.full_messages.to_sentence\n end\n end\n end\n end",
"def format_title_and_ref(doc_info)\n unless doc_info.title\n @nof_missing_titles += 1\n doc_info.title = \"NO TITLE FOUND (#{@nof_missing_titles}) !\"\n end\n\n # Manipulate the doc title if we have a doc id\n title = if !doc_info.doc_id.nil? && @manage_docid\n \"#{doc_info.doc_id} - #{doc_info.title}\"\n else\n doc_info.title\n end\n\n [title, \"<<#{doc_info.rel_path}#,#{title}>>\",\n \"<<#{Giblish.to_valid_id(doc_info.title)},details>>\\n\"]\n end",
"def save\n @filename = @filename || gen_filename\n file = File.open(File.join(@dir, @filename), 'w') { |f|\n f.puts @issue.to_yaml\n }\n end",
"def notify_story_id_not_found(task)\n str = <<eos\nHi, this is the Git reporting script. Your Git commit logs indicate that you finished story %s but I can't\nfind that story in Pivotal Tracker. Perhaps the project ID of the Pivotal project for this story hasn't\nbeen added to deploynotify_cfg.yml yet. Please check this and manually set your Pivotal story to 'delivered.'\neos\n str = sprintf(str, task[:task_num]) + printable_commit_data(task)\n email_message(\"ACTION REQUIRED - invalid story ID\", str, task[:commits].last[:author_email])\n end",
"def todo_params\n params.require(:todo).permit(:content, :deadline, :status, :project_id, :creator_id, :executor_id)\n end",
"def label_tests_summary(path:) \n json = File.read(path.to_s)\n data = JSON.parse(json)\n data[\"tests_summary_messages\"].each { |message| \n if !message.empty?\n message.insert(1, \"**📢 [\" + read_platform_from_file(path: path) + \"]**\")\n end\n }\n File.open(path.to_s,\"w\") do |f|\n f.puts JSON.pretty_generate(data)\n end \n end",
"def create_text(config)\n info \"Running findbugs with results printed to stdout\"\n config.ant.findbugs :home=>config.findbugs_home,\n :output => \"text\",\n :debug => config.debug,\n :effort => config.effort,\n :failOnError => config.fail_on_error do\n # puts \"attributes: #{config.ant.inspect}\"\n #puts \"auxclasspath: #{config.aux_classpath}, #{config.aux_classpath == nil}\"\n if config.aux_classpath != nil\n config.ant.auxClasspath :path => config.aux_classpath\n end\n config.ant.sourcePath :path => config.src_path\n config.ant.method_missing :class, :location => config.class_location\n end\n end",
"def copy_to_log_file(file,action,options = {})\n if (options[:to_do_list] && action ==\"Task creation\")\n file.puts(\"#{Time.now} : #{action} #{options[:to_do_list].last.description} \")\n end\n if (options[:to_do_list] && action ==\"Task deletion\")\n file.puts(\"#{Time.now} : #{action} #{options[:to_do_list].at(options[:id]).description}\")\n end\n if action ==\"List name update\"\n file.puts(\"#{Time.now} : #{action}\")\n end\n end",
"def homework(title, topic, date, thesis_statement, pronoun)\n\tparagraph = \"#{title}/n The #{topic} was an interesting topic. It happened in #{date}. \n\tI feel that #{topic} was a very important part of #{date} because \n\t#{pronoun}. #{thesis_statement}. This is what made #{topic} really \n\tinteresting part of #{date} and an important part of history.\"\n\treturn paragraph\nend",
"def format_flake_comment(prefix, flake_config, team_ids)\n flake_label = flake_config['label']\n flake_repo = flake_config['repo']\n org_repo = \"#{Properties['github_user']}/#{flake_repo}\"\n flake_label_query = CGI.escape(\"label:#{flake_label}\")\n issue_link = \"https://github.com/#{org_repo}/issues?q=#{flake_label_query}\"\n new_issue_link = \"https://github.com/#{org_repo}/issues/new\"\n\n \"\n#{prefix}\n - If the proposed changes in this pull request caused the job to fail, update this pull request with new code to fix the issue(s).\n - If flaky tests caused the job to fail, leave a comment with links to the GitHub issue(s) in the `#{org_repo}` repository with the [`#{flake_label}` label](#{issue_link}) that are tracking the flakes. If no issue already exists for the flake you encountered, [create one](#{new_issue_link}).\n - If something else like CI system downtime or maintenance caused the job to fail, contact a member of #{format_teams(team_ids)} to trigger the job again.\n \"\n end",
"def story_params\n params.require(:story).permit(:user_id, :working_article_id, :reporter, :group, :date, :subject_head, :title, :subtitle, :body, :quote, :status, :summitted_section, :char_count, :published, :path, :category_code, :price, :content, story_type: [])\n end",
"def create\n \n if params[:todo][:model]\n m = params[:todo][:model]\n m_id = (m + \"_id\").to_sym\n params[:todo].delete(:model)\n end\n \n @todo = Todo.new(params[:todo].except(\"sub_id\",\"sub_class\",\"todo\"))\n\n respond_to do |format|\n if @todo.save\n \n format.html { \n # this is the part where the todo is going to be saved to google\n if @todo.api\n session[:todo_id] = @todo.id\n session[:destination] = '/todos/google_create'\n redirect_to \"/auth/google_oauth2\"\n return\n end\n \n if !m.blank? && !params[:todo][m_id].blank?\n \n tl(m.capitalize,params[:todo][m_id],\"Assigned to \" + @todo._ato.name,\n @todo.topic.name + ' task, due on ' + params[:todo][:duedate],'todo',params[:todo][:assigned_to])\n \n redirect_to \"/#{m.pluralize.downcase}/\" + params[:todo][m_id].to_s \n else\n \n tl(\"Todo\",@todo.id,\"Assigned to \" + @todo._ato.name,\n @todo.topic.name + ' task, due on ' + params[:todo][:duedate],'todo',params[:todo][:assigned_to])\n \n redirect_to todos_path\n end\n }\n format.json { render json: @todo, status: :created, location: @todo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n \n end",
"def report_files_with_subtitles_that_require_review(options)\n if config.setting(:is_primary_repo)\n raise \"This command can only be used in foreign repos.\"\n end\n\n fwstrr = {\n subtitles_not_exported: {\n st_ops_and_content_changes: [],\n content_changes_only: [],\n autosplit: []\n },\n subtitles_exported: []\n }\n files_found_count = 0\n total_file_count = 0\n\n Repositext::Cli::Utils.read_files(\n config.compute_glob_pattern(\n options['base-dir'] || :content_dir,\n options['file-selector'] || :all_files,\n options['file-extension'] || :json_extension\n ),\n /\\.data\\.json\\z/,\n nil,\n \"Reading data.json files\",\n options\n ) do |data_json_file|\n total_file_count += 1\n fd = data_json_file.read_data\n filename = data_json_file.filename\n subtitles_have_been_exported = '' != fd['exported_subtitles_at_st_sync_commit'].to_s.strip\n st_tr = (fd['st_sync_subtitles_to_review'] || {})\n next if st_tr.none?\n st_tr_keys = st_tr.keys\n st_tr_cnt = st_tr_keys.count\n desc = nil\n if subtitles_have_been_exported\n # No further distinction required\n files_found_count += 1\n if st_tr.any? { |e| ['all', ['autosplit']] == e }\n # all sts need to be reviewed, don't print details\n fwstrr[:subtitles_exported] << [filename, 'all', []]\n else\n # only some sts need to be reviewed, print details\n # Add subtitle index + type of change to this file group\n # st_tr: { \"6938579\" => [\"content_change\"], \"2756941\" => [\"content_change\"] }\n subtitles = data_json_file.corresponding_content_at_file.subtitles\n st_tr_attrs = st_tr.map { |stid, ops|\n st = subtitles.detect { |e| stid == e.persistent_id }\n # st may not exist if it was deleted via merge or delete operation.\n idx = ((st && st.tmp_index) || '[N/A]').to_s.rjust(5, ' ')\n { index: idx, operations: ops.join(', ') }\n }\n fwstrr[:subtitles_exported] << [filename, st_tr_cnt, st_tr_attrs]\n end\n desc = \" - subtitles have been exported, has #{ st_tr_cnt } subtitles to review\".color(:blue)\n else\n # subtitles have not been exported, further distinguish kinds of changes\n if data_json_file.is_autosplit?\n # This file is autosplit\n files_found_count += 1\n fwstrr[:subtitles_not_exported][:autosplit] << [filename, 'all']\n desc = \" - subtitles have not been exported, was autosplit\".color(:blue)\n elsif st_tr.all? { |stid,ops| ops.all? { |op| 'content_change' == op } }\n # content_changes only\n files_found_count += 1\n fwstrr[:subtitles_not_exported][:content_changes_only] << [filename, st_tr_cnt]\n desc = \" - subtitles have not been exported, #{ st_tr_cnt } content_changes to review\".color(:blue)\n else\n # st ops and content_changes\n files_found_count += 1\n # Add subtitle index + type of change to this file group\n # st_tr: { \"6938579\" => [\"content_change\"], \"2756941\" => [\"content_change\"] }\n subtitles = data_json_file.corresponding_content_at_file.subtitles\n st_tr_attrs = st_tr.map { |stid, ops|\n st = subtitles.detect { |e| stid == e.persistent_id }\n # st may not exist if it was deleted via merge or delete operation.\n idx = ((st && st.tmp_index) || '[N/A]').to_s.rjust(5, ' ')\n { index: idx, operations: ops.join(', ') }\n }\n fwstrr[:subtitles_not_exported][:st_ops_and_content_changes] << [filename, st_tr_cnt, st_tr_attrs]\n desc = \" - subtitles have not been exported, #{ st_tr_cnt } st_ops and content_changes to review\".color(:blue)\n end\n end\n $stderr.puts desc\n end\n if files_found_count > 0\n $stderr.puts \"\\nThe following #{ files_found_count } files have subtitles requiring review\".color(:blue)\n $stderr.puts '-' * 80\n if(fs = fwstrr[:subtitles_not_exported][:st_ops_and_content_changes]).any?\n $stderr.puts \" With st ops (subtitles not exported yet):\".color(:blue)\n fs.each { |(fn, cnt, sts_tr)|\n $stderr.puts \" * #{ fn } (#{ cnt })\"\n sts_tr.each { |st_tr|\n $stderr.puts \" - index #{ st_tr[:index] }: #{ st_tr[:operations] }\"\n }\n }\n end\n if(fs = fwstrr[:subtitles_not_exported][:content_changes_only]).any?\n $stderr.puts \" With content_changes (subtitles not exported yet):\".color(:blue)\n fs.each { |(fn, cnt)| $stderr.puts \" * #{ fn } (#{ cnt })\" }\n end\n if(fs = fwstrr[:subtitles_not_exported][:autosplit]).any?\n $stderr.puts \" Autosplit (subtitles not exported yet):\".color(:blue)\n fs.each { |(fn, cnt)| $stderr.puts \" * #{ fn } (#{ cnt })\" }\n end\n if(fs = fwstrr[:subtitles_exported]).any?\n $stderr.puts \" Subtitles already exported:\".color(:blue)\n # fs.each { |(fn, cnt)| $stderr.puts \" * #{ fn } (#{ cnt })\" }\n fs.each { |(fn, cnt, sts_tr)|\n $stderr.puts \" * #{ fn } (#{ cnt })\"\n sts_tr.each { |st_tr|\n $stderr.puts \" - index #{ st_tr[:index] }: #{ st_tr[:operations] }\"\n }\n }\n end\n $stderr.puts\n end\n end",
"def add_todo(string)\n write_message(:todo, string)\n end",
"def format_title_and_ref(node)\n conv_info = node.data\n\n # Use docid and title in title reference\n title_ref = (conv_info.docid.nil? ? \"\" : \"#{conv_info.docid} - \") + conv_info.title\n\n # find relative source path from the file to this tree's root\n p = node.pathname.relative_path_from(@tree.pathname).sub_ext(\".adoc\")\n\n # remove html markup in the title for displaying in the tree\n stripped_title = title_ref.gsub(/<.*?>/, \"\")\n [stripped_title, \"<<#{p}#,#{stripped_title}>>\",\n \"<<#{Giblish.to_valid_id(node.pathname.to_s, \"_\", \"_\", true)},details>>\\n\"]\n end",
"def format_local_yaml()\n prev = nil\n index_to_add = Array.new\n n = 0\n ifile = File.open( \"local.yaml\" )\n local_data = ifile.readlines\n ifile.close\n local_data.each_with_index { |line, index|\n if(index == 0)\n next\n end\n if(line =~ /^type:/)\n if not(prev =~ /---/)\n index_to_add.push(index+n)\n n=n+1\n end\n end\n prev = line\n }\n index_to_add.each { |i|\n local_data.insert(i, '---')\n }\n File.open(\"local.yaml\", \"w+\") do |f|\n f.puts(local_data)\n end\nend",
"def write_tweet(item)\n prefix = @recipient ? \"@#{@recipient} \" : \"\"\n\n source_title = item.source_title\n title = item.title\n link = item.link\n title_delimiter = \": \"\n link_delimiter = \" \"\n\n counter = MAX_TWEET_SIZE\n counter -= prefix.size\n counter -= title_delimiter.size\n counter -= link_delimiter.size\n counter -= T_CO_LINK_SIZE\n\n actual = counter\n actual -= source_title.size\n actual -= title.size\n\n if actual < 0\n chop = counter / 2\n source_title = source_title[0, chop]\n title = title[0, chop]\n end\n\n [prefix, source_title, title_delimiter, title, link_delimiter, link].join(\"\")\n end",
"def osk_c_lesson_create_scr(lesson_id, lesson_info)\n\n # Had trouble with quotes in scr_header & cleaner to do outside of string\n lesson_time_stamp = lesson_info[\"time-stamp\"] \n lesson_title = lesson_info[\"title\"] \n lesson_objective = lesson_info[\"objective\"]\n lesson_src_file = lesson_info[\"src-file\"]\n\n # Build LABEL statements with JSON defined objective text\n objective_str = \"\"\n lesson_objective.each do |objective|\n objective_str << \"LABEL \\\"#{objective}\\\"\\n \"\n end\n\n # Build view lesson/solution COMBOBOX dropdown lists\n # based on the lesson definition JSON file not the\n # user's current status JSON file\n\n lesson_base_dir = File.join(CfSat::TUTOR_LESSON_DIR,lesson_id.to_s)\n base_json_file = File.join(lesson_base_dir,CfSat::LESSON_JSON_BASE_FILE)\n base_lesson_json = File.read(base_json_file)\n base_lesson_info = JSON.parse(base_lesson_json)\n base_src_file = base_lesson_info[\"src-file\"]\n \n lesson_src_dropdown = \"\"\n base_src_file.each do |src_file|\n src_filename = src_file[0]\n status = src_file[1]\n if (status[\"completed\"] == false)\n lesson_src_dropdown << \"'#{src_filename}' \"\n end\n end\n \n scr_header = \"\n \n ###############################################################################\n # OSK C Lesson Screen\n #\n # Notes:\n # 1. Do not edit this file because it is automatically generated and your\n # changes will not be saved.\n # 2. File created by osk_c_tutor_scr.rb on #{Osk::time_stamp}\n #\n # License:\n # Written by David McComas, licensed under the copyleft GNU General Public\n # License (GPL). \n #\n ###############################################################################\n <% \n require 'osk_c_lesson_scr' \n %>\n SCREEN AUTO AUTO 0.5\n GLOBAL_SETTING BUTTON BACKCOLOR 221 221 221\n \n NAMED_WIDGET title TITLE \\\"Lesson #{lesson_id} - #{lesson_title}\\\"\n SETTING BACKCOLOR 162 181 205\n SETTING TEXTCOLOR black\n\n VERTICALBOX \\\"Objective\\\"\n #{objective_str}\n END # Objectives\n\n VERTICALBOX \\\"References\\\"\n\n MATRIXBYCOLUMNS 4\n BUTTON 'Lesson Slides' 'osk_c_lesson_cmd(self,\\\"REF_SLIDES\\\")'\n BUTTON 'OSK App Dev' 'osk_c_lesson_cmd(self,\\\"REF_OSK_APP_DEV\\\")'\n BUTTON 'Tutorial Guide' 'osk_c_lesson_cmd(self,\\\"REF_TUTORIAL\\\")'\n LABEL ' '\n END # Matrix\n\n END # References\n \n VERTICALBOX \\\"Update Source Files\\\"\n\n MATRIXBYCOLUMNS 3 5 5\n BUTTON 'View Lesson' 'osk_c_lesson_src(self,\\\"SRC_VIEW_LESSON\\\")'\n NAMED_WIDGET lesson_src_file COMBOBOX #{lesson_src_dropdown}\n LABEL ' '\n\n BUTTON 'View Solution' 'osk_c_lesson_src(self,\\\"SRC_VIEW_SOLUTION\\\")'\n NAMED_WIDGET solution_src_file COMBOBOX #{lesson_src_dropdown}\n LABEL ' '\n\n BUTTON 'Edit Current FSW' 'osk_c_lesson_src(self,\\\"SRC_EDIT_CURRENT\\\")'\n NAMED_WIDGET current_src_file COMBOBOX 'app_cfg.h' 'osk_c_demo_app.h' 'osk_c_demo_app.c' 'msglog.h' 'msglog.c' 'msglogtbl.h' 'msglogtbl.c'\n LABEL ' '\n END\n \n END\n\n VERTICALBOX \\\"Completed\\\"\n\n MATRIXBYCOLUMNS 3 5 5\n \"\n \n scr_trailer = \"\n END # Matrix\n END # Completed\n\n\n VERTICALBOX \\\"Application\\\"\n MATRIXBYCOLUMNS 4 5\n \n BUTTON 'Build' 'osk_c_lesson_cmd(self,\\\"APP_BUILD\\\")'\n BUTTON 'Run' 'osk_c_lesson_cmd(self,\\\"APP_RUN\\\")'\n BUTTON 'Screen' 'osk_c_lesson_cmd(self,\\\"APP_SCREEN\\\")'\n LABEL ' '\n \n END\n END # Application\n \"\n\n scr_file = Osk::cfg_target_dir_file(\"CFSAT\",\"screens\",\"osk_c_lesson_scr.txt\")\n \n begin\n \n # Always overwrite the temp file \n File.open(scr_file,\"w\") do |f| \n \n f.write (scr_header)\n\n # Even though loop didn't work out, I left common screen pattern of dynamic text\n # between header and footer strings\n scr_text = \"\n NAMED_WIDGET app_cfg_h CHECKBUTTON 'app_cfg.h' #{((lesson_src_file[\"app_cfg.h\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n LABEL ' '\n LABEL ' '\n\n NAMED_WIDGET osk_c_demo_app_h CHECKBUTTON 'osk_c_demo_app.h' #{((lesson_src_file[\"osk_c_demo_app.h\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n NAMED_WIDGET osk_c_demo_app_c CHECKBUTTON 'osk_c_demo_app.c' #{((lesson_src_file[\"osk_c_demo_app.c\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n LABEL ' '\n \n NAMED_WIDGET msglog_h CHECKBUTTON 'msglog.h' #{((lesson_src_file[\"msglog.h\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n NAMED_WIDGET msglog_c CHECKBUTTON 'msglog.c' #{((lesson_src_file[\"msglog.c\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n LABEL ' '\n\n NAMED_WIDGET msglogtbl_h CHECKBUTTON 'msglogtbl.h' #{((lesson_src_file[\"msglogtbl.h\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n NAMED_WIDGET msglogtbl_c CHECKBUTTON 'msglogtbl.c' #{((lesson_src_file[\"msglogtbl.c\"])[\"completed\"] == true)? \"CHECKED\" : \"UNCHECKED\"}\n LABEL ' '\n\n BUTTON 'Save Status' 'osk_c_lesson_cmd(self,\\\"LESSON_SAVE_STATUS\\\")'\n BUTTON 'Lesson Complete' 'osk_c_lesson_cmd(self,\\\"LESSON_COMPLETE\\\")'\n LABEL ' '\n \"\n \n f.write (scr_text)\n \n f.write (scr_trailer)\n\n end # File\n \n rescue Exception => e\n puts e.message\n puts e.backtrace.inspect \n end\n\nend",
"def create\n @story = Story.new(params[:story])\n\t\t@title = \"Nowy news\"\n respond_to do |format|\n if @story.save\n format.html { redirect_to @story, notice: 'Wiadomość utworzono pomyślnie.' }\n format.json { render json: @story, status: :created, location: @story }\n else\n format.html { render action: \"new\" }\n format.json { render json: @story.errors, status: :unprocessable_entity }\n end\n end\n end",
"def step_to_text(step)\n [\n step[:status].to_s.upcase,\n step[:name],\n step[:actions].reject(&:blank?).join(' '),\n step[:info].reject(&:blank?).join(' ')\n ].map{|text| dumb_strip_html(text)} \\\n .reject(&:blank?) \\\n .join(' - ')\n end",
"def create_todo(todo)\n post_params = {\n :body => todo.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n \n response = Logan::Client.post \"/projects/#{@project_id}/todolists/#{@id}/todos.json\", post_params\n Logan::Todo.new response\n end"
] |
[
"0.5548532",
"0.5497139",
"0.5434224",
"0.54246116",
"0.5349843",
"0.5301151",
"0.5189603",
"0.51767135",
"0.5167253",
"0.5122934",
"0.5066005",
"0.5065631",
"0.5051362",
"0.4954177",
"0.49262172",
"0.4900673",
"0.48756233",
"0.4872546",
"0.4846569",
"0.48429677",
"0.48277056",
"0.48177135",
"0.4812958",
"0.48093963",
"0.4807348",
"0.47836688",
"0.47671032",
"0.4763413",
"0.4761005",
"0.47577685",
"0.4756352",
"0.47551835",
"0.47481054",
"0.47472316",
"0.47429338",
"0.4741397",
"0.4723567",
"0.47065583",
"0.4702565",
"0.46849012",
"0.46776024",
"0.46710724",
"0.46623364",
"0.466113",
"0.4648962",
"0.46457922",
"0.46405175",
"0.46404436",
"0.46394026",
"0.4638337",
"0.4632382",
"0.4628825",
"0.4624808",
"0.46226403",
"0.46222547",
"0.46125123",
"0.46012932",
"0.45947823",
"0.45889497",
"0.4584962",
"0.4579697",
"0.4563514",
"0.4557736",
"0.45536643",
"0.45437697",
"0.453995",
"0.45338678",
"0.4532962",
"0.4532206",
"0.45244765",
"0.45215634",
"0.4507439",
"0.45060545",
"0.45029074",
"0.4496788",
"0.44955763",
"0.44947627",
"0.4490423",
"0.44893378",
"0.44871816",
"0.44822657",
"0.4481595",
"0.44803393",
"0.44788438",
"0.44751912",
"0.4473726",
"0.4471507",
"0.4469486",
"0.44659242",
"0.44653323",
"0.44620773",
"0.4461553",
"0.4458034",
"0.4453561",
"0.4451828",
"0.44452554",
"0.44418263",
"0.4435991",
"0.44352043",
"0.4433257"
] |
0.6737708
|
0
|
GET /extrainfos GET /extrainfos.json
|
def index
@extrainfos = Extrainfo.all
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @exercises }\n end\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def index\n @eicons = Eicon.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eicons }\n end\n end",
"def index\n @do_exercises = DoExercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @do_exercises }\n end\n end",
"def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"def getex\n url = prefix + \"getex\" + id_param\n return response(url)\n end",
"def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end",
"def show\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expediente }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def show\n @exura = Exura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @exura }\n end\n end",
"def index\n @exercises = Exercise.paginate(:page => params[:page], :per_page => 10).order('created_at DESC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @exercises }\n end\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end",
"def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\n end\n end",
"def index\n @essays = Essay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @essays }\n end\n end",
"def index\n @excuses = Excuse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @excuses }\n end\n end",
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def show\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estatuto }\n end\n end",
"def index\n @api_v1_exercises = Api::V1::Exercise.all\n end",
"def show\n @excepcion_entrega = ExcepcionEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excepcion_entrega }\n end\n end",
"def index\n render json: @fiestas\n end",
"def index\n @exercises = Exercise.all\n @user = current_user # changed get logged user\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end",
"def index\n @ef_pares = EfPare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_pares }\n end\n end",
"def index\n @my_exams = MyExam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_exams }\n end\n end",
"def index\n @eobs = Eob.assigned\n @title = \"Posted EOBs\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eobs }\n end\n end",
"def index\n @estadios = Estadio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @estadios }\n end\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def index\n @frais_annexes = FraisAnnex.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_annexes }\n end\n end",
"def index\n @content_explores = ContentExplore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @content_explores }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def index\n @ofertas = Oferta.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 => @ofertas }\n end\n end",
"def show \n est = @establecimiento\n respond_to do |format|\n format.html\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n render :json => {:nombre => @establecimiento.nombre, direccion: @establecimiento.direccion, :latitud => @establecimiento.latitud,\n :longitud => @establecimiento.longitud, :descripcion => @establecimiento.descripcion, :imagen => @establecimiento.foto.url(:small),\n :comentarios => @establecimiento.EstComentarios.map { |comentario| { :descripcion => comentario.descripcion, :usuario => comentario.usuario.nombre } } } \n\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n }\n end\n #No tiene restricciones, queda abierto para el API\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 @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def index\n @electors = Elector.all\n\n render json: @electors\n end",
"def index\n @extras = Extra.all\n\n render json: @extras\n end",
"def show\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etape }\n end\n end",
"def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def show\n @escala = Escala.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @escala }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @exercise }\n end\n end",
"def index\n @equipos = Equipo.all\n render json: @equipos, status: :ok\n end",
"def show\n @etsy = Etsy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etsy }\n end\n end",
"def index\n @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end",
"def index\n @episodes = Episode.all\n\n render json: @episodes\n end",
"def ejemplares\n\t\tsnib = Geoportal::Snib.new\n\t\tsnib.params = params\n\t\tsnib.ejemplares\n\t\t\n\t\trender json: snib.resp\n\tend",
"def index\n @ideas = Idea.current_ideas_for(current_user).entries\n respond_with(@ideas) do |format|\n format.json { render json: @ideas }\n end\n end",
"def index\n @foros = Foro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foros }\n end\n end",
"def index\n @antecedentes = Antecedente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @antecedentes }\n end\n end",
"def index\n @exercise_templates = ExerciseTemplate.all\n render json: @exercise_templates\n end",
"def index\n @expertises = Expertise.all\n\n render json: @expertises\n end",
"def index\n @offers = Offer.all\n respond_to do |format|\n format.jsonapi { render jsonapi: @offers }\n format.html { @offers }\n end\n end",
"def index\n @expressions = Expression.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expressions }\n end\n end",
"def show\n @excercise = Excercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @excercise }\n end\n end",
"def index\n @exercise_sets = ExerciseSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_sets }\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 @eou = Eou.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @eou }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def show\n @especy = Especie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @especy }\n end\n end",
"def index\n @assuntos = Assunto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @assuntos }\n end\n end",
"def show\n @exercise = Exercise.find_by_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def index\n @exposures = Exposure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @exposures }\n end\n end",
"def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end",
"def index\n # @prenotations = Prenotation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prenotations }\n end\n end",
"def index\n @exhibits = Exhibit.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exhibits }\n end\n end",
"def show\n @do_exercise = DoExercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @do_exercise }\n end\n end",
"def show\n @estoque = Estoque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estoque }\n end\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def 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 @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @examples }\n end\n end",
"def index\n @asociados = Asociado.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @asociados }\n end\n end",
"def index\n @listes = Liste.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @listes }\n end\n end",
"def index\n @ordenes = Orden.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ordenes }\n end\n end",
"def show\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibition }\n end\n end",
"def show\n @estacionamiento = Estacionamiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estacionamiento }\n end\n end",
"def index\n @evaluaciones = Evaluacion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @evaluaciones }\n end\n end",
"def index\n @ativo_outros = AtivoOutro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ativo_outros }\n end\n end",
"def index\n @expression_relationships = ExpressionRelationship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expression_relationships }\n end\n end",
"def index\n @acuerdos = Acuerdo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @acuerdos }\n end\n end",
"def index\n fact = to_json(Fact.last)\n tip = to_json(Tip.last)\n quote = to_json(Quote.last)\n expert_opinion = to_json(ExpertOpinion.last)\n faq = to_json(Faq.last)\n article = to_json(Article.last)\n testimony = to_json(Testimony.last)\n documentary = to_json(Documentary.last)\n \n json_response({ \n fact: fact,\n tip: tip, \n quote: quote,\n expert_opinion: expert_opinion,\n faq: faq,\n article: article,\n testimony: testimony,\n documentary: documentary\n })\n end",
"def show\n @excuse = Excuse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excuse }\n end\n end",
"def index\n @training_contents = TrainingContent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_contents }\n end\n end",
"def index\n @ejes = Eje.all\n end",
"def index\n render json: { \"Exercice Technique\" => \"Transporter Organizations Colisweb backend developer exercise\", \"Poste visé\" => \"Développeur Back Ruby, Alternance\", \"Candidat\" => \"Gressier Jimmy\"}\n end",
"def index\n @educations = Education.all\n render json: @educations\n end",
"def show\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def index\n @offices = Office.all\n json_response(@offices)\n end",
"def index\n @ginasios = Ginasio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ginasios }\n end\n end"
] |
[
"0.70912194",
"0.6750656",
"0.6750656",
"0.6717262",
"0.6717262",
"0.66976696",
"0.6588717",
"0.6588717",
"0.65684223",
"0.65508723",
"0.6548687",
"0.65482914",
"0.6543604",
"0.6428262",
"0.63707566",
"0.6364797",
"0.6351876",
"0.63381296",
"0.63135093",
"0.63132095",
"0.6263719",
"0.6262659",
"0.62576795",
"0.6257635",
"0.6240177",
"0.6222909",
"0.6222858",
"0.62037075",
"0.61968267",
"0.6154852",
"0.6153752",
"0.6151133",
"0.614325",
"0.6140714",
"0.613984",
"0.6138689",
"0.613284",
"0.61320335",
"0.613144",
"0.613144",
"0.6125082",
"0.6120677",
"0.6114932",
"0.611103",
"0.60987973",
"0.609767",
"0.6090889",
"0.60772336",
"0.6076231",
"0.6075048",
"0.60720146",
"0.6067082",
"0.6065974",
"0.60650474",
"0.606269",
"0.6055018",
"0.6039616",
"0.60381967",
"0.6037176",
"0.6035618",
"0.60343224",
"0.6025158",
"0.6011728",
"0.6009062",
"0.60058063",
"0.60055554",
"0.60019964",
"0.60001373",
"0.5995686",
"0.59851336",
"0.5984382",
"0.59837747",
"0.5978587",
"0.59762144",
"0.59747374",
"0.59639776",
"0.5952556",
"0.59427327",
"0.5942398",
"0.5940811",
"0.5930344",
"0.59296745",
"0.59261745",
"0.59239644",
"0.59198654",
"0.59192884",
"0.59139943",
"0.5910824",
"0.5910537",
"0.5908624",
"0.59037226",
"0.5898518",
"0.589696",
"0.58943397",
"0.58806694",
"0.5878496",
"0.58767575",
"0.5873479",
"0.5866873",
"0.58668673"
] |
0.6415768
|
14
|
GET /extrainfos/1 GET /extrainfos/1.json
|
def show
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def index\n @expedientes = Expediente.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expedientes }\n end\n end",
"def getex\n url = prefix + \"getex\" + id_param\n return response(url)\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def index\n @exercises = Exercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @exercises }\n end\n end",
"def show\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exalt }\n end\n end",
"def index\n @do_exercises = DoExercise.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @do_exercises }\n end\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def index\n @api_v1_exercises = Api::V1::Exercise.all\n end",
"def show\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expediente }\n end\n end",
"def index\n @extrainfos = Extrainfo.all\n end",
"def show\n @exura = Exura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @exura }\n end\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def getex\n url = prefix + \"getex\"\n return response(url)\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def index\n @eicons = Eicon.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eicons }\n end\n end",
"def show\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @exercise }\n end\n end",
"def show\n @exercise = Exercise.find_by_id(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise }\n end\n end",
"def show\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estatuto }\n end\n end",
"def show\n @excepcion_entrega = ExcepcionEntrega.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excepcion_entrega }\n end\n end",
"def index\n @exercises = Exercise.paginate(:page => params[:page], :per_page => 10).order('created_at DESC')\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @exercises }\n end\n end",
"def consulta\n fiesta = Fiesta.all\n render json: fiesta\n end",
"def index\n @ofertas = Oferta.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 => @ofertas }\n end\n end",
"def show\n @do_exercise = DoExercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @do_exercise }\n end\n end",
"def show\n @exprience = Exprience.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exprience }\n end\n end",
"def show\n @ejercicio = Ejercicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ejercicio }\n end\n end",
"def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"def show\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etape }\n end\n end",
"def show\n @especy = Especie.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @especy }\n end\n end",
"def index\n render json: @fiestas\n end",
"def show\n @etnia = Etnia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etnia }\n end\n end",
"def show\n @excercise = Excercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @excercise }\n end\n end",
"def expiracion\n @usuario = Usuario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usuario }\n end\n end",
"def index\n @exercises = Exercise.all\n @user = current_user # changed get logged user\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercises }\n end\n end",
"def show\n @estudiante = Estudiante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estudiante }\n end\n end",
"def index\n @coordenador_estagios = CoordenadorEstagio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @coordenador_estagios }\n end\n end",
"def index\n @dia_eventos = DiaEvento.all\n render json: @dia_eventos\n end",
"def index\n @exercise_sets = ExerciseSet.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exercise_sets }\n end\n end",
"def show\n @escala = Escala.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @escala }\n end\n end",
"def show\n @exhibition = Exhibition.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exhibition }\n end\n end",
"def index\n @establecimientos = Establecimiento.all\n respond_to do |format|\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n\n ests = @establecimientos.map { |establecimiento| { :nombre_establecimiento => establecimiento.nombre, :id => establecimiento.id, \n :descripcion => establecimiento.descripcion, :longitud => establecimiento.longitud,\n :latitud => establecimiento.latitud, :direccion => establecimiento.direccion, :imagen => establecimiento.foto.url(:small),\n :eventos => establecimiento.eventos.map { |evento| { :nombre => evento.nombre } } } } \n render json: ests\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n\n }\n format.html { redirect_to :controller=>'login', :action=>'login' } #solo el app movil puede revisar toda la lista de establecimientos.\n end\n end",
"def index\n logement = Logement.find_by(id:params[:logement_id])\n equipement = logement.equi_securites[0].title\n equipements = logement.equi_securites[0]\n\n render json: {\n securites:equipement,\n fichier:equipements\n }\n end",
"def show \n est = @establecimiento\n respond_to do |format|\n format.html\n format.json { \n\n if (params[:appkey].eql? appkey) #si el appkey es correcto\n render :json => {:nombre => @establecimiento.nombre, direccion: @establecimiento.direccion, :latitud => @establecimiento.latitud,\n :longitud => @establecimiento.longitud, :descripcion => @establecimiento.descripcion, :imagen => @establecimiento.foto.url(:small),\n :comentarios => @establecimiento.EstComentarios.map { |comentario| { :descripcion => comentario.descripcion, :usuario => comentario.usuario.nombre } } } \n\n else\n render json: {:error => \"No autorizado\"}\n end\n\n\n }\n end\n #No tiene restricciones, queda abierto para el API\n end",
"def index\n @estadios = Estadio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @estadios }\n end\n end",
"def index\n @frais_annexes = FraisAnnex.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @frais_annexes }\n end\n end",
"def index\n @my_exams = MyExam.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @my_exams }\n end\n end",
"def index\n @excuses = Excuse.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @excuses }\n end\n end",
"def index\n @empresas = Empresa.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @empresas }\n end\n end",
"def index\n @content_explores = ContentExplore.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @content_explores }\n end\n end",
"def show\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n render json: @oferta_academica\n end",
"def index\n @exercise_templates = ExerciseTemplate.all\n render json: @exercise_templates\n end",
"def index\n @employes = Employe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employes }\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 @essays = Essay.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @essays }\n end\n end",
"def index\n @experiments = Experiment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @experiments }\n end\n end",
"def index\n @eobs = Eob.assigned\n @title = \"Posted EOBs\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @eobs }\n end\n end",
"def index\n @extras = Extra.all\n\n render json: @extras\n end",
"def index\n @instituicoes = Instituicao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @instituicoes }\n end\n end",
"def show\n @daily_exercise = DailyExercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_exercise }\n end\n end",
"def show\n @exercise_instruction = ExerciseInstruction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise_instruction }\n end\n end",
"def show\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exam }\n end\n end",
"def show\n @soiree = Soiree.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @soiree }\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 @detalles = Detalle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @detalles }\n end\n end",
"def index\n @expertises = Expertise.all\n\n render json: @expertises\n end",
"def show\n @estoque = Estoque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estoque }\n end\n end",
"def show\n @excuse = Excuse.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @excuse }\n end\n end",
"def index\n fact = to_json(Fact.last)\n tip = to_json(Tip.last)\n quote = to_json(Quote.last)\n expert_opinion = to_json(ExpertOpinion.last)\n faq = to_json(Faq.last)\n article = to_json(Article.last)\n testimony = to_json(Testimony.last)\n documentary = to_json(Documentary.last)\n \n json_response({ \n fact: fact,\n tip: tip, \n quote: quote,\n expert_opinion: expert_opinion,\n faq: faq,\n article: article,\n testimony: testimony,\n documentary: documentary\n })\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def show\n @patient_exercise = PatientExercise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patient_exercise }\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 show\n @idiom = Idiom.find(params[:id])\n @essays = Essay.where(idiom_id: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idiom }\n end\n end",
"def show\n @clientepedido = Clientepedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientepedido }\n end\n end",
"def show\n @estacionamiento = Estacionamiento.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @estacionamiento }\n end\n end",
"def index\n @ef_pares = EfPare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ef_pares }\n end\n end",
"def show\n @eicon = Eicon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @eicon }\n end\n end",
"def index\n @foros = Foro.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @foros }\n end\n end",
"def show\n @etsy = Etsy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @etsy }\n end\n end",
"def show\n @aliexpress = Aliexpress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @aliexpress }\n end\n end",
"def show\n @entrada_inventario = EntradaInventario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrada_inventario }\n end\n end",
"def index\n @training_contents = TrainingContent.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @training_contents }\n end\n end",
"def show\n @testis = Teste.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testis }\n end\n end",
"def index\n @exposures = Exposure.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @exposures }\n end\n end",
"def show\n @leye = Leye.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @leye }\n end\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @examples }\n end\n end",
"def show\n @eou = Eou.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @eou }\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 @economia4 = Economia4.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @economia4 }\n end\n end",
"def index\n # @prenotations = Prenotation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @prenotations }\n end\n end",
"def show\n @exercise_log = ExerciseLog.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @exercise_log }\n end\n end",
"def show\n begin\n @example = Example.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n # last URL parameter is not example ID, but the example's number\n @example = @language.examples.where(number: params[:id].to_i).first\n end\n @examples = [@example]\n respond_to do |format|\n format.html { render 'examples/index' } # also show index.html.erb\n format.json { render json: @example }\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 index\n @expressions = Expression.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @expressions }\n end\n end",
"def listex\n url = prefix + \"listex\"\n return response(url)\n end",
"def index\n @episodes = Episode.all\n\n render json: @episodes\n end",
"def show\n @exercises = Exercise.where(\"chapter_id = ?\", params[:id]).order(:number)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @chapter }\n end\n end",
"def index\n @enderecos = Endereco.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @enderecos }\n end\n end",
"def index\n @api_v1_todos = Todo.all\n render json: @api_v1_todos\n end"
] |
[
"0.68307173",
"0.66964424",
"0.6681035",
"0.6681035",
"0.66382146",
"0.6577036",
"0.6500297",
"0.6496961",
"0.6496961",
"0.643135",
"0.6421866",
"0.63804084",
"0.6380173",
"0.6364772",
"0.6364772",
"0.6352904",
"0.6352904",
"0.6300894",
"0.62972283",
"0.6280225",
"0.62801474",
"0.6264834",
"0.6261829",
"0.623646",
"0.62016857",
"0.61876756",
"0.61713344",
"0.61469036",
"0.61336505",
"0.61050695",
"0.6101351",
"0.6075292",
"0.60744077",
"0.6074364",
"0.6070502",
"0.60539275",
"0.605323",
"0.60525584",
"0.60480905",
"0.60473895",
"0.60458857",
"0.6024915",
"0.60211366",
"0.60209453",
"0.6015451",
"0.6008983",
"0.60004205",
"0.5996349",
"0.5980503",
"0.59783125",
"0.59777933",
"0.5967129",
"0.59626377",
"0.5962173",
"0.5961953",
"0.5957551",
"0.5957227",
"0.59504104",
"0.5946245",
"0.5945863",
"0.5944563",
"0.59397817",
"0.59379166",
"0.59348214",
"0.5934288",
"0.59284085",
"0.59276515",
"0.59276223",
"0.5921573",
"0.5913177",
"0.5913138",
"0.59130347",
"0.5910927",
"0.5910582",
"0.5909753",
"0.59088266",
"0.5907081",
"0.59012026",
"0.59009737",
"0.58976823",
"0.58967805",
"0.58937585",
"0.5892345",
"0.5892299",
"0.58868754",
"0.5885777",
"0.58846503",
"0.5883044",
"0.58798724",
"0.58798724",
"0.5875195",
"0.5873076",
"0.58624893",
"0.5859762",
"0.5859138",
"0.5855167",
"0.5846695",
"0.58460397",
"0.58428705",
"0.58296305",
"0.58291805"
] |
0.0
|
-1
|
POST /extrainfos POST /extrainfos.json
|
def create
@extrainfo = Extrainfo.new(extrainfo_params)
respond_to do |format|
if @extrainfo.save
format.html { redirect_to @extrainfo, notice: 'Extrainfo was successfully created.' }
format.json { render :show, status: :created, location: @extrainfo }
else
format.html { render :new }
format.json { render json: @extrainfo.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n @exura = Exura.new(params[:exura])\n\n respond_to do |format|\n if @exura.save\n format.html { redirect_to @exura, :notice => 'Exura was successfully created.' }\n format.json { render :json => @exura, :status => :created, :location => @exura }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @exura.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend",
"def create\n @exosuit = Exosuit.new(exosuit_params)\n\n respond_to do |format|\n if @exosuit.save\n format.html { redirect_to @exosuit, notice: 'Exosuit was successfully created.' }\n format.json { render :show, status: :created, location: @exosuit }\n else\n format.html { render :new }\n format.json { render json: @exosuit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exalt = Exalt.new(params[:exalt])\n\n respond_to do |format|\n if @exalt.save\n format.html { redirect_to @exalt, notice: 'Exalt was successfully created.' }\n format.json { render json: @exalt, status: :created, location: @exalt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exalt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipo_exame = TipoExame.new(tipo_exame_params)\n\n respond_to do |format|\n if @tipo_exame.save\n format.html { redirect_to @tipo_exame, notice: 'Tipo exame was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_exame }\n else\n format.html { render :new }\n format.json { render json: @tipo_exame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exemption = Exemption.new(exemption_params)\n\n respond_to do |format|\n if @exemption.save\n format.html { redirect_to @exemption, notice: 'Exemption was successfully created.' }\n format.json { render :show, status: :created, location: @exemption }\n else\n format.html { render :new }\n format.json { render json: @exemption.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 @example = Example.new(example_params)\n @ex = example_params\n @ex[:deleted] = 0\n @ex[:ex_japanese]= @ex[:ex_japanese].strip\n @ex[:ex_vietnamese] = @ex[:ex_vietnamese].strip\n @example = Example.new(@ex)\n respond_to do |format|\n if @example.save\n format.html { redirect_to @example, notice: 'Example was successfully created.' }\n format.json { render action: 'show', status: :created, location: @example }\n else\n format.html { render action: 'new' }\n format.json { render json: @example.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expediente = Expediente.new(params[:expediente])\n \n respond_to do |format|\n if @expediente.save\n format.html { redirect_to @expediente, notice: 'Expediente was successfully created.' }\n format.json { render json: @expediente, status: :created, location: @expediente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expediente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exemplaresproduto = Exemplaresproduto.new(exemplaresproduto_params)\n\n respond_to do |format|\n if @exemplaresproduto.save\n format.html { redirect_to @exemplaresproduto, notice: 'Exemplaresproduto was successfully created.' }\n format.json { render :show, status: :created, location: @exemplaresproduto }\n else\n format.html { render :new }\n format.json { render json: @exemplaresproduto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estatuto = Estatuto.new(params[:estatuto])\n\n respond_to do |format|\n if @estatuto.save\n format.html { redirect_to @estatuto, notice: 'Estatuto was successfully created.' }\n format.json { render json: @estatuto, status: :created, location: @estatuto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estatuto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def exame_create_params\n params.require(:exame).permit(:nome, :tipo)\n end",
"def create\n @excepcion_entrega = ExcepcionEntrega.new(params[:excepcion_entrega])\n\n respond_to do |format|\n if @excepcion_entrega.save\n format.html { redirect_to @excepcion_entrega, notice: 'Excepcion entrega was successfully created.' }\n format.json { render json: @excepcion_entrega, status: :created, location: @excepcion_entrega }\n else\n format.html { render action: \"new\" }\n format.json { render json: @excepcion_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expedient = Expedient.new(expedient_params)\n\n respond_to do |format|\n if @expedient.save\n format.html { redirect_to expedients_url, notice: 'Se creó un nuevo expediente' }\n format.json { render :show, status: :created, location: @expedient }\n else\n format.html { render :new }\n format.json { render json: @expedient.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etnia = Etnia.new(params[:etnia])\n\n respond_to do |format|\n if @etnia.save\n format.html { redirect_to @etnia, notice: 'Etnia was successfully created.' }\n format.json { render json: @etnia, status: :created, location: @etnia }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etnia.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etape = Etape.new(params[:etape])\n\n respond_to do |format|\n if @etape.save\n format.html { redirect_to @etape, notice: 'Etape was successfully created.' }\n format.json { render json: @etape, status: :created, location: @etape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @orden_examan = OrdenExaman.new(orden_examan_params)\n\n respond_to do |format|\n if @orden_examan.save\n format.html { redirect_to @orden_examan, notice: 'Orden examan was successfully created.' }\n format.json { render :show, status: :created, location: @orden_examan }\n else\n format.html { render :new }\n format.json { render json: @orden_examan.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @api_v1_exercise = Api::V1::Exercise.new(api_v1_exercise_params)\n\n respond_to do |format|\n if @api_v1_exercise.save\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_exercise }\n else\n format.html { render :new }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @tipos_encuestum = TiposEncuestum.new(tipos_encuestum_params)\n\n respond_to do |format|\n if @tipos_encuestum.save\n format.html { redirect_to @tipos_encuestum, notice: 'Tipos encuestum was successfully created.' }\n format.json { render :show, status: :created, location: @tipos_encuestum }\n else\n format.html { render :new }\n format.json { render json: @tipos_encuestum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, :notice => 'exercise was successfully created.' }\n format.json { render :json => @exercise, :status => :created, :location => @exercise }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @elecapp = Elecapp.new(from: params[:from], to: params[:to], text: params[:text], date: params[:date], ATXid: params[:ATXid], linkId: params[:linkId])\n respond_to do |format|\n if @elecapp.save\n format.html { redirect_to @elecapp, notice: \"saved successfully\"}\n format.json { render json: @elecapp}\n end\n end\n end",
"def create\n @especy = Especie.new(params[:especy])\n\n respond_to do |format|\n if @especy.save\n format.html { redirect_to @especy, notice: 'Especie was successfully created.' }\n format.json { render json: @especy, status: :created, location: @especy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @especy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etapa = Etapa.new(etapa_params)\n\n respond_to do |format|\n if @etapa.save\n format.html { redirect_to @etapa, notice: 'Etapa fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @etapa }\n else\n format.html { render :new }\n format.json { render json: @etapa.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @eje = Eje.new(eje_params)\n\n respond_to do |format|\n if @eje.save\n format.html { redirect_to @eje, notice: 'Eje was successfully created.' }\n format.json { render :show, status: :created, location: @eje }\n else\n format.html { render :new }\n format.json { render json: @eje.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @appwebexemp = Appwebexemp.new(appwebexemp_params)\n\n respond_to do |format|\n if @appwebexemp.save\n format.html { redirect_to @appwebexemp, notice: 'Appwebexemp was successfully created.' }\n format.json { render :show, status: :created, location: @appwebexemp }\n else\n format.html { render :new }\n format.json { render json: @appwebexemp.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @oferta_academica = OfertaAcademica.new(params[:oferta_academica])\n\n if @oferta_academica.save\n render json: @oferta_academica, status: :created, location: @oferta_academica\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end",
"def create\n @dia_evento = DiaEvento.new(dia_evento_params)\n\n if @dia_evento.save\n render json: @dia_evento, status: :created, location: @dia_evento\n else\n render json: @dia_evento.errors, status: :unprocessable_entity\n end\n end",
"def create\n @exam = Exam.new(exam_params)\n @exam.patient = @patient\n\n if @exam.save\n render json: @exam, include: [:point_po, :point_or, :point_n, :point_a], methods: :maxillary_depth_angle, status: :created\n else\n render json: @exam.errors, status: :unprocessable_entity\n end\n end",
"def create\n @eintrag = Eintrag.new(eintrag_params)\n\n respond_to do |format|\n if @eintrag.save\n format.html { redirect_to @eintrag, notice: 'Eintrag was successfully created.' }\n format.json { render :show, status: :created, location: @eintrag }\n else\n format.html { render :new }\n format.json { render json: @eintrag.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expression_of_interest = ExpressionOfInterest.new(expression_of_interest_params)\n\n respond_to do |format|\n if @expression_of_interest.save\n format.html { redirect_to @expression_of_interest, notice: 'Expression of interest was successfully created.' }\n format.json { render :show, status: :created, location: @expression_of_interest }\n else\n format.html { render :new }\n format.json { render json: @expression_of_interest.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @esjiaoben = Esjiaoben.new(esjiaoben_params)\n\n respond_to do |format|\n if @esjiaoben.save\n format.html { redirect_to @esjiaoben, notice: 'Esjiaoben was successfully created.' }\n format.json { render :show, status: :created, location: @esjiaoben }\n else\n format.html { render :new }\n format.json { render json: @esjiaoben.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' }\n format.json { render json: @exercise, status: :created, location: @exercise }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exercise.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 @exapmle = Exapmle.new(exapmle_params)\n\n respond_to do |format|\n if @exapmle.save\n format.html { redirect_to @exapmle, notice: 'Exapmle was successfully created.' }\n format.json { render :show, status: :created, location: @exapmle }\n else\n format.html { render :new }\n format.json { render json: @exapmle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expertise = Expertise.new(expertise_params)\n\n if @expertise.save\n render json: @expertise, status: :created, location: @expertise\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end",
"def create\n @ejemplo = Ejemplo.new(ejemplo_params)\n\n respond_to do |format|\n if @ejemplo.save\n format.html { redirect_to @ejemplo, notice: 'Ejemplo was successfully created.' }\n format.json { render :show, status: :created, location: @ejemplo }\n else\n format.html { render :new }\n format.json { render json: @ejemplo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exterior = Exterior.new(exterior_params)\n\n respond_to do |format|\n if @exterior.save\n format.html { redirect_to @exterior, notice: 'Exterior was successfully created.' }\n format.json { render :show, status: :created, location: @exterior }\n else\n format.html { render :new }\n format.json { render json: @exterior.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' }\n format.json { render json: @exercise, status: :created, location: @exercise }\n else\n flash.now[:error] = @exercise.errors.full_messages\n format.html { render action: \"new\"}\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\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 @eou = Eou.new(params[:eou])\n\n respond_to do |format|\n if @eou.save\n format.html { redirect_to @eou, :notice => 'Eou was successfully created.' }\n format.json { render :json => @eou, :status => :created, :location => @eou }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @eou.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @estoque = Estoque.new(params[:estoque])\n\n respond_to do |format|\n if @estoque.save\n format.html { redirect_to @estoque, notice: 'Estoque was successfully created.' }\n format.json { render json: @estoque, status: :created, location: @estoque }\n else\n format.html { render action: \"new\" }\n format.json { render json: @estoque.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exp = Exp.new(params[:exp])\n\n respond_to do |format|\n if @exp.save\n format.html { redirect_to @exp, notice: 'Article was successfully posted.' }\n format.json { render json: @exp, status: :created, location: @exp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exp.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 @exercise = Exercise.new(exercise_params)\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' }\n format.json { render action: 'show', status: :created, location: @exercise }\n else\n format.html { render action: 'new' }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @excercise = Excercise.new(params[:excercise])\n\n respond_to do |format|\n if @excercise.save\n format.html { redirect_to @excercise, :notice => 'Excercise was successfully created.' }\n format.json { render :json => @excercise, :status => :created, :location => @excercise }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @excercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @escalation = Escalation.new(escalation_params)\n\n respond_to do |format|\n if @escalation.save\n format.html { redirect_to @escalation, notice: 'Escalation was successfully created.' }\n format.json { render :show, status: :created, location: @escalation }\n else\n format.html { render :new }\n format.json { render json: @escalation.errors, status: :unprocessable_entity }\n end\n end\n end",
"def extrainfo_params\n params.require(:extrainfo).permit(:house_id, :managebool, :managefee, :internet, :television, :cleanfee, :waterfee, :parking, :enterdate, :aircon, :laundary, :pet)\n end",
"def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n flash[:class] = \"alert alert-success\"\n format.html { redirect_to @exercise, :notice => 'exercise was successfully created.' }\n format.json { render :json => @exercise, :status => :created, :location => @exercise }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @exercise = Exercise.all.map{ |c| [c.name, c.id]}\n @training = Training.new(training_params)\n\n respond_to do |format|\n if @training.save\n format.html { redirect_to @training, notice: 'Training was successfully created.' }\n format.json { render :show, status: :created, location: @training }\n else\n format.html { render :new }\n format.json { render json: @training.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @exibitor = Exibitor.new(params[:exibitor])\n\n respond_to do |format|\n if @exibitor.save\n format.html { redirect_to @exibitor, notice: 'Exibitor was successfully created.' }\n format.json { render json: @exibitor, status: :created, location: @exibitor }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exibitor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estagio = Estagio.new(params[:estagio])\n\n respond_to do |format|\n if @estagio.save\n flash[:notice] = 'Estagio was successfully created.'\n format.html { redirect_to(@estagio) }\n format.xml { render :xml => @estagio, :status => :created, :location => @estagio }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @estagio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @expedicao = Expedicao.new(params[:expedicao])\n\n respond_to do |format|\n if @expedicao.save\n flash[:notice] = 'Expedicao was successfully created.'\n format.html { redirect_to(@expedicao) }\n format.xml { render :xml => @expedicao, :status => :created, :location => @expedicao }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @expedicao.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\r\n\r\n respond_to do |format|\r\n if @examen_tipo.save\r\n format.html { redirect_to @examen_tipo, notice: 'Se añadió un nombre de tipo de examen correctamente.' }\r\n format.json { render :show, status: :created, location: @examen_tipo }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @examen_tipo.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def create\n params.permit(:intitule, :estObligatoire, :nombreDeCaractere, :ordre, :sondage_id)\n ajout = QuestionOuverteService.instance.creerQuestionOuverte(params[:intitule], params[:estObligatoire], params[:nombreDeCaractere], params[:ordre], params[:sondage_id])\n (ajout != nil) ? (render json: ajout, status: :ok) : (render json: nil, status: :not_found)\n end",
"def create\n @epiphany = Epiphany.new(epiphany_params)\n\n respond_to do |format|\n if @epiphany.save\n format.html { redirect_to @epiphany, notice: 'Epiphany was successfully created.' }\n format.json { render :show, status: :created, location: @epiphany }\n else\n format.html { render :new }\n format.json { render json: @epiphany.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ess = Esse.new(ess_params)\n\n respond_to do |format|\n if @ess.save\n format.html { redirect_to esses_url, notice: 'Esse was successfully created.' }\n format.json { render :show, status: :created, location: @ess }\n else\n format.html { render :new }\n format.json { render json: @ess.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etsy = Etsy.new(params[:etsy])\n\n respond_to do |format|\n if @etsy.save\n format.html { redirect_to @etsy, notice: 'Etsy was successfully created.' }\n format.json { render json: @etsy, status: :created, location: @etsy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etsy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @do_exercise = DoExercise.new(params[:do_exercise])\n\n respond_to do |format|\n if @do_exercise.save\n format.html { redirect_to @do_exercise, notice: 'Do exercise was successfully created.' }\n format.json { render json: @do_exercise, status: :created, location: @do_exercise }\n else\n format.html { render action: \"new\" }\n format.json { render json: @do_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n exercise = Exercise.create(exercise_params)\n if exercise\n render json: exercise\n else\n render json: {error: 'Workout was not created.'}\n end\n end",
"def create\n @yeji = Yeji.new(yeji_params)\n\n respond_to do |format|\n if @yeji.save\n format.html { redirect_to @yeji, notice: 'Test was successfully created.' }\n format.json { render :show, status: :created, location: @yeji }\n else\n format.html { render :new }\n format.json { render json: @yeji.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @extra = Extra.new(extra_params)\n\n if @extra.save\n render json: @extra, status: :created, location: @extra\n else\n render json: @extra.errors, status: :unprocessable_entity\n end\n end",
"def create\n @etude = Etude.new(etude_params)\n\n respond_to do |format|\n if @etude.save\n format.html { redirect_to @etude, notice: 'Etude was successfully created.' }\n format.json { render :show, status: :created, location: @etude }\n else\n format.html { render :new }\n format.json { render json: @etude.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @introexam = Introexam.new(introexam_params)\n\n respond_to do |format|\n if @introexam.save\n format.html { redirect_to @introexam, notice: 'Introexam was successfully created.' }\n format.json { render :show, status: :created, location: @introexam }\n else\n format.html { render :new }\n format.json { render json: @introexam.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @efectivo = Efectivo.new(efectivo_params)\n\n respond_to do |format|\n if @efectivo.save\n format.html { redirect_to @efectivo, notice: 'Efectivo was successfully created.' }\n format.json { render :show, status: :created, location: @efectivo }\n else\n format.html { render :new }\n format.json { render json: @efectivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @establecimiento = Establecimiento.new(establecimiento_params)\n\n respond_to do |format|\n if @establecimiento.save\n format.html { redirect_to @establecimiento, notice: 'Establecimiento was successfully created.' }\n format.json { render :show, status: :created, location: @establecimiento }\n else\n format.html { render :new }\n format.json { render json: @establecimiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @estadopro = Estadopro.new(estadopro_params)\n\n respond_to do |format|\n if @estadopro.save\n format.html { redirect_to @estadopro, notice: 'Estadopro was successfully created.' }\n format.json { render :show, status: :created, location: @estadopro }\n else\n format.html { render :new }\n format.json { render json: @estadopro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @objeto = Etiqueta.new(etiqueta_params)\n\n respond_to do |format|\n if @objeto.save\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @emmision = Emmision.new(emmision_params)\n\n respond_to do |format|\n if @emmision.save\n format.html { redirect_to @emmision, notice: \"Emmision was successfully created.\" }\n format.json { render :show, status: :created, location: @emmision }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @emmision.errors, status: :unprocessable_entity }\n end\n end\n end",
"def examan_params\n params.require(:examan).permit(:nombre, :etiquetas, :directorio, :cantidad, :asignatura_id, :variantes)\n end",
"def create\n @exercicio_serie = ExercicioSerie.new(exercicio_serie_params)\n\n respond_to do |format|\n if @exercicio_serie.save\n format.html { redirect_to @exercicio_serie, notice: 'O Exercício da Série foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @exercicio_serie }\n else\n format.html { render :new }\n format.json { render json: @exercicio_serie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @esseline = Esseline.new(esseline_params)\n\n respond_to do |format|\n if @esseline.save\n format.html { redirect_to @esseline, notice: 'Esseline was successfully created.' }\n format.json { render :show, status: :created, location: @esseline }\n else\n format.html { render :new }\n format.json { render json: @esseline.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @sexe = Sexe.new(sexe_params)\n\n respond_to do |format|\n if @sexe.save\n format.html { redirect_to @sexe, notice: 'Sexe was successfully created.' }\n format.json { render :show, status: :created, location: @sex }\n else\n format.html { render :new }\n format.json { render json: @sexe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @plan_quirurgico = PlanQuirurgico.new(plan_quirurgico_params)\n @plan_quirurgico.servicios = params[:servicios]\n @plan_quirurgico.estatus = \"En Proceso\"\n puts params\n puts @plan_quirurgico.examen \n respond_to do |format|\n if @plan_quirurgico.save\n format.html { redirect_to @plan_quirurgico, notice: 'El plan quirurgico fue registrado exitosamente.' }\n format.json { render :show, status: :created, location: @plan_quirurgico }\n else\n format.html { render :new }\n format.json { render json: @plan_quirurgico.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @excategory = Excategory.new(excategory_params)\n\n respond_to do |format|\n if @excategory.save\n format.html { redirect_to @excategory, notice: 'Excategory was successfully created.' }\n format.json { render :show, status: :created, location: @excategory }\n else\n format.html { render :new }\n format.json { render json: @excategory.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ev = Ev.new(ev_params)\n\n respond_to do |format|\n if @ev.save\n format.html { redirect_to @ev, notice: 'Ev was successfully created.' }\n format.json { render :show, status: :created, location: @ev }\n else\n format.html { render :new }\n format.json { render json: @ev.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @aliexpress = Aliexpress.new(params[:aliexpress])\n\n respond_to do |format|\n if @aliexpress.save\n format.html { redirect_to @aliexpress, notice: 'Aliexpress was successfully created.' }\n format.json { render json: @aliexpress, status: :created, location: @aliexpress }\n else\n format.html { render action: \"new\" }\n format.json { render json: @aliexpress.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @atividades_extra = AtividadesExtra.new(atividades_extra_params)\n\n respond_to do |format|\n if @atividades_extra.save\n format.html { redirect_to @atividades_extra, notice: 'Atividades extra was successfully created.' }\n format.json { render :show, status: :created, location: @atividades_extra }\n else\n format.html { render :new }\n format.json { render json: @atividades_extra.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @testis = Teste.new(params[:testis])\n\n respond_to do |format|\n if @testis.save\n format.html { redirect_to @testis, notice: 'Teste was successfully created.' }\n format.json { render json: @testis, status: :created, location: @testis }\n else\n format.html { render action: \"new\" }\n format.json { render json: @testis.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @empleado_especialidad = EmpleadoEspecialidad.new(empleado_especialidad_params)\n\n respond_to do |format|\n if @empleado_especialidad.save\n format.html { redirect_to @empleado_especialidad, notice: 'Empleado especialidad was successfully created.' }\n format.json { render :show, status: :created, location: @empleado_especialidad }\n else\n format.html { render :new }\n format.json { render json: @empleado_especialidad.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @extintor = Extintor.new(extintor_params)\n\n respond_to do |format|\n if @extintor.save\n format.html { redirect_to @extintor, notice: 'Extintor was successfully created.' }\n format.json { render :show, status: :created, location: @extintor }\n else\n format.html { render :new }\n format.json { render json: @extintor.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @eleitore = Eleitore.new(eleitore_params)\n\n respond_to do |format|\n if @eleitore.save\n format.html { redirect_to @eleitore, notice: 'Eleitore was successfully created.' }\n format.json { render :show, status: :created, location: @eleitore }\n else\n format.html { render :new }\n format.json { render json: @eleitore.errors, status: :unprocessable_entity }\n end\n end\n end",
"def expedient_params\n params.require(:expedient).permit(:numero, :caratula, :actor, :demandado, :abogado, :telefono_abogado, :email_abogado, :perito_medico, :perito_medico_email, :perito_medico_telefono, :perito_medico_incapacidad, :perito_psicologico, :perito_psicologico_email, :perito_psicologico_telefono, :perito_psicologico_incapacidad, :perito_contable, :perito_contable_email, :perito_contable_telefono, :perito_contable_incapacidad, :ibm, :indenmizacion, :dni, :camara, :fecnac, :gestor, :responsable)\n end",
"def create\n @eitum = Eitum.new(eitum_params)\n\n respond_to do |format|\n if @eitum.save\n format.html { redirect_to @eitum, notice: 'Eitum was successfully created.' }\n format.json { render :show, status: :created, location: @eitum }\n else\n format.html { render :new }\n format.json { render json: @eitum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def POST; end",
"def create\n product_name = competitor_params[:title]\n honestbee_datas = get_honestbee_data (product_name)\n predict_catalog = get_predict_catalog ( product_name )\n save_data_in_postgres (predict_catalog)\n render :json => honestbee_datas\n end",
"def create\n @ezii_robot_experiment = EziiRobotExperiment.new(ezii_robot_experiment_params)\n\n respond_to do |format|\n if @ezii_robot_experiment.save\n format.html { redirect_to @ezii_robot_experiment, notice: 'Ezii robot experiment was successfully created.' }\n format.json { render :show, status: :created, location: @ezii_robot_experiment }\n else\n format.html { render :new }\n format.json { render json: @ezii_robot_experiment.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @responsavel = Responsavel.new(responsavel_params)\n\n if @responsavel.save\n render json: @responsavel, status: :created, location: @responsavel\n else\n render json: @responsavel.errors, status: :unprocessable_entity\n end\n end",
"def create\n @datos_estudiante = DatosEstudiante.new(datos_estudiante_params)\n\n respond_to do |format|\n if @datos_estudiante.save\n format.html { redirect_to @datos_estudiante, notice: 'Datos estudiante was successfully created.' }\n format.json { render :show, status: :created, location: @datos_estudiante }\n else\n format.html { render :new }\n format.json { render json: @datos_estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"def create\n @oferta = Oferta.new(params[:oferta])\n\n respond_to do |format|\n if @oferta.save\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully created.' }\n format.json { render :json => @oferta, :status => :created, :location => @oferta }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @enemigo = Enemigo.new(enemigo_params)\n\n respond_to do |format|\n if @enemigo.save\n format.html { redirect_to @enemigo, notice: 'Enemigo was successfully created.' }\n format.json { render :show, status: :created, location: @enemigo }\n else\n format.html { render :new }\n format.json { render json: @enemigo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @episode = Episode.new(episode_params)\n\n if @episode.save\n render json: @episode, status: :created, location: @episode\n else\n render json: @episode.errors, status: :unprocessable_entity\n end\n end",
"def create\n @depoevento = Depoevento.new(params[:depoevento])\n\n respond_to do |format|\n if @depoevento.save\n format.html { redirect_to @depoevento, notice: 'Depoevento was successfully created.' }\n format.json { render json: @depoevento, status: :created, location: @depoevento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @depoevento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etiquetum = Etiquetum.new(etiquetum_params)\n\n respond_to do |format|\n if @etiquetum.save\n format.html { redirect_to @etiquetum, notice: 'Etiqueta creada!' }\n format.json { render :show, status: :created, location: @etiquetum }\n else\n format.html { render :new }\n format.json { render json: @etiquetum.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @expression = Expression.new expression_params\n respond_to do |format|\n if @expression.save\n format.html { redirect_to @expression, notice: 'Expression was successfully created.' }\n format.json { render json: @expression, status: :created, location: @expression }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expression.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @etf = Etf.new(etf_params)\n @etf.user = current_user\n\n respond_to do |format|\n if @etf.save\n format.html { redirect_to @etf, notice: \"Etf was successfully created.\" }\n format.json { render :show, status: :created, location: @etf }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @etf.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @ejercicio = Ejercicio.new(params[:ejercicio])\n\n respond_to do |format|\n if @ejercicio.save\n format.html { redirect_to @ejercicio, notice: 'Ejercicio was successfully created.' }\n format.json { render json: @ejercicio, status: :created, location: @ejercicio }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ejercicio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @osoba = Osoba.new(params[:osoba])\n\n if @osoba.save\n render json: @osoba, status: :created, location: @osoba\n else\n render json: @osoba.errors, status: :unprocessable_entity\n end\n end",
"def create\n @ephem = Ephem.new(ephem_params)\n\n respond_to do |format|\n if @ephem.save\n format.html { redirect_to @ephem, notice: 'Ephem was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ephem }\n else\n format.html { render action: 'new' }\n format.json { render json: @ephem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @explc = Explc.new(explc_params)\n\n respond_to do |format|\n if @explc.save\n format.html { redirect_to @explc, notice: 'Explc was successfully created.' }\n format.json { render :show, status: :created, location: @explc }\n else\n format.html { render :new }\n format.json { render json: @explc.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.6477917",
"0.6452822",
"0.6386044",
"0.63467216",
"0.6341108",
"0.62873137",
"0.62272525",
"0.61360425",
"0.6111131",
"0.61053085",
"0.60925347",
"0.5999772",
"0.597448",
"0.5958246",
"0.5928762",
"0.592325",
"0.5868088",
"0.5863465",
"0.5855971",
"0.58298975",
"0.5807835",
"0.58072853",
"0.5801967",
"0.57855326",
"0.5780486",
"0.57804847",
"0.5778821",
"0.5778275",
"0.5775858",
"0.57715845",
"0.57621294",
"0.57582486",
"0.57528836",
"0.57517046",
"0.5735542",
"0.57298857",
"0.5716965",
"0.57117355",
"0.5707283",
"0.5706335",
"0.57011336",
"0.57008153",
"0.57005286",
"0.5699335",
"0.5677178",
"0.5672995",
"0.56718415",
"0.5664971",
"0.566143",
"0.56555694",
"0.56522715",
"0.56507117",
"0.56460685",
"0.5639753",
"0.5639396",
"0.56375355",
"0.5635093",
"0.5631338",
"0.56281024",
"0.5624594",
"0.56227183",
"0.56220675",
"0.56203806",
"0.56101024",
"0.56076944",
"0.56061774",
"0.5605578",
"0.56004703",
"0.5595021",
"0.55880874",
"0.55843717",
"0.5584173",
"0.5580303",
"0.5577596",
"0.55756044",
"0.5574078",
"0.5573699",
"0.5571116",
"0.5570748",
"0.55664253",
"0.55585665",
"0.5557131",
"0.55566925",
"0.5548359",
"0.5547699",
"0.5546505",
"0.5543583",
"0.55384177",
"0.5535257",
"0.55341476",
"0.55333555",
"0.55299014",
"0.55294305",
"0.55230236",
"0.55178905",
"0.5516992",
"0.551329",
"0.55091065",
"0.55088323",
"0.5508298"
] |
0.699139
|
0
|
PATCH/PUT /extrainfos/1 PATCH/PUT /extrainfos/1.json
|
def update
respond_to do |format|
if @extrainfo.update(extrainfo_params)
format.html { redirect_to @extrainfo, notice: 'Extrainfo was successfully updated.' }
format.json { render :show, status: :ok, location: @extrainfo }
else
format.html { render :edit }
format.json { render json: @extrainfo.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def patch!\n request! :patch\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 put!\n request! :put\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 api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"def update\n respond_to do |format|\n if @api_v1_exercise.update(api_v1_exercise_params)\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_exercise }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update # PATCH\n raise NotImplementedError\n end",
"def update\n @exalt = Exalt.find(params[:id])\n\n respond_to do |format|\n if @exalt.update_attributes(params[:exalt])\n format.html { redirect_to @exalt, notice: 'Exalt was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exalt.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"def update\n @especy = Especie.find(params[:id])\n\n respond_to do |format|\n if @especy.update_attributes(params[:especy])\n format.html { redirect_to @especy, notice: 'Especie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @especy.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipo_exame.update(tipo_exame_params)\n format.html { redirect_to @tipo_exame, notice: 'Tipo exame was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_exame }\n else\n format.html { render :edit }\n format.json { render json: @tipo_exame.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exosuit.update(exosuit_params)\n format.html { redirect_to @exosuit, notice: 'Exosuit was successfully updated.' }\n format.json { render :show, status: :ok, location: @exosuit }\n else\n format.html { render :edit }\n format.json { render json: @exosuit.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, :notice => 'exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def 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 @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to [@clclass,@exercise], notice: 'Exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: [@clclass,@exercise].errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(objeto_params)\n format.html { redirect_to @objeto, notice: 'Objeto was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update options={}\n client.put(\"/#{id}\", options)\n end",
"def update\n @specie = Specie.find(params[:id])\n\n respond_to do |format|\n if @specie.update_attributes(params[:specie])\n format.html { redirect_to @specie, notice: 'Specie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specie.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @example.update(example_params)\n format.html { redirect_to @example, notice: 'Operação realizada com sucesso.' }\n format.json { render :show, status: :ok, location: @example }\n else\n format.html { render :edit }\n format.json { render json: @example.errors, status: :unprocessable_entity }\n end\n end\n end",
"def UpdateView params = {}\n \n APICall(path: 'views.json',method: 'PUT',payload: params.to_json)\n \n end",
"def update\n @exura = Exura.find(params[:id])\n\n respond_to do |format|\n if @exura.update_attributes(params[:exura])\n format.html { redirect_to @exura, :notice => 'Exura was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exura.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 rm_update path, data, msg\n\n re = rm_request path, data, 'PUT'\n puts re.body\n chk (re.code!='200'), msg + \"\\n#{re.code} #{re.msg}\\n\\n\"\n return true\n\nend",
"def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end",
"def update\n respond_to do |format|\n if @tapioca.update(tapioca_params)\n format.html { redirect_to @tapioca, notice: 'Tapioca was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tapioca.errors, status: :unprocessable_entity }\n end\n end\n end",
"def edit\n respond_with(@exercise)\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 @file_example.update(file_example_params)\n format.html { redirect_to @file_example, notice: 'File example was successfully updated.' }\n format.json { render :show, status: :ok, location: @file_example }\n else\n format.html { render :edit }\n format.json { render json: @file_example.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(url, payload, headers={})\n RestClient.patch url, payload, headers\n end",
"def update\n respond_to do |format|\n if @fascicle.update(fascicle_params)\n format.html { redirect_to @fascicle, notice: 'Fascicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fascicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"def patch(path, **args); end",
"def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:class] = \"alert alert-success\"\n format.html { redirect_to @exercise, :notice => 'exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def patch\n end",
"def update\n @estatuto = Estatuto.find(params[:id])\n\n respond_to do |format|\n if @estatuto.update_attributes(params[:estatuto])\n format.html { redirect_to @estatuto, notice: 'Estatuto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @estatuto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n authorize! :edit, @questionnaire\n\n @questionnaire.load_JSON(params[:questionnaire], current_user)\n\n respond_to do |format|\n# if @questionnaire.update_attributes(params[:questionnaire])\n format.html { redirect_to @questionnaire, notice: 'Kysymyslomakkeen muokkaaminen onnistui.' }\n format.json { head :no_content }\n# else\n# format.html { render action: \"edit\" }\n# format.json { render json: @questionnaire.errors, status: :unprocessable_entity }\n# end\n\n end\n end",
"def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"def update\n respond_to do |format|\n if @exemption.update(exemption_params)\n format.html { redirect_to @exemption, notice: 'Exemption was successfully updated.' }\n format.json { render :show, status: :ok, location: @exemption }\n else\n format.html { render :edit }\n format.json { render json: @exemption.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @treq = Treq.find(params[:id])\n\n respond_to do |format|\n unless params[:treq_files].blank?\n params[:treq_files]['file'].each do |a|\n @treq_file = @treq.treq_files.create!(:file => a, :treq_id => @treq.id)\n end\n end\n if @treq.update_attributes(params[:treq])\n format.html { redirect_to @treq, notice: 'Treq was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @treq.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @excepcion_entrega = ExcepcionEntrega.find(params[:id]) \n\n respond_to do |format|\n if @excepcion_entrega.update_attributes(params[:excepcion_entrega])\n format.html { redirect_to @excepcion_entrega, notice: 'Excepcion entrega was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @excepcion_entrega.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @testis = Teste.find(params[:id])\n\n respond_to do |format|\n if @testis.update_attributes(params[:testis])\n format.html { redirect_to @testis, notice: 'Teste was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @testis.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n fn = params[:id].gsub('DOTDOT','.').gsub('SLASHSLASH','/')\n File.open(fn,'w+') { |f| \n f.puts params[:content]\n }\n respond_to do |format|\n format.json { render json: { success: true} }\n end\n end",
"def update\n respond_to do |format|\n if @exapmle.update(exapmle_params)\n format.html { redirect_to @exapmle, notice: 'Exapmle was successfully updated.' }\n format.json { render :show, status: :ok, location: @exapmle }\n else\n format.html { render :edit }\n format.json { render json: @exapmle.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @request.assign_json_attributes(params) if @request.resume?\n respond_to do |format|\n if @request.update(request_params)\n format.html { redirect_to @request, notice: 'Request was successfully updated.' }\n format.json { render :show, status: :ok, location: @request }\n else\n format.html { render :edit }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end",
"def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end",
"def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end",
"def update\n @expediente = Expediente.find(params[:id])\n\n respond_to do |format|\n if @expediente.update_attributes(params[:expediente])\n format.html { redirect_to @expediente, notice: 'Expediente was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @expediente.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: I18n.t('exercises.updated') }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @one = One.find(params[:id])\n\n respond_to do |format|\n if @one.update_attributes(params[:one])\n format.html { redirect_to @one, notice: 'One was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @one.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @efectivo.update(efectivo_params)\n format.html { redirect_to @efectivo, notice: 'Efectivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @efectivo }\n else\n format.html { render :edit }\n format.json { render json: @efectivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @extra = Extra.find(params[:id])\n\n if @extra.update(extra_params)\n head :no_content\n else\n render json: @extra.errors, status: :unprocessable_entity\n end\n end",
"def update\n @do_exercise = DoExercise.find(params[:id])\n\n respond_to do |format|\n if @do_exercise.update_attributes(params[:do_exercise])\n format.html { redirect_to @do_exercise, notice: 'Do exercise was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @do_exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n# respond_to do |format|\n# if @req.update(req_params)\n format.json { render :json => {:status => 'success'}}\n# format.html { redirect_to @req, notice: 'Req was successfully updated.' }\n# format.json { render :show, status: :ok, location: @req }\n# else\n format.json { render :json => {:status => 'failed'}}\n# format.html { render :edit }\n# format.json { render json: @req.errors, status: :unprocessable_entity }\n# end\n# end\n end",
"def update\n deleted= params[:deleted]\n @ex = example_params\n @ex[:ex_japanese]= @ex[:ex_japanese].strip\n @ex[:ex_vietnamese] = @ex[:ex_vietnamese].strip\n @ex[:deleted] = deleted\n respond_to do |format|\n if @example.update(@ex)\n format.html { redirect_to @example, notice: 'Example was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @example.errors, status: :unprocessable_entity }\n end\n end\n end",
"def jsonapi_update!(attributes)\n assign_jsonapi_attributes(attributes)\n save!\n end",
"def update\n @soiree = Soiree.find(params[:id])\n\n respond_to do |format|\n if @soiree.update_attributes(params[:soiree])\n format.html { redirect_to @soiree, notice: 'Soiree was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @soiree.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @rest_api.update(rest_api_params)\n format.html { redirect_to @rest_api, notice: 'Rest api was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rest_api.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n 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 @documentotipo = Documentotipo.find(params[:id])\n\n respond_to do |format|\n if @documentotipo.update_attributes(params[:documentotipo])\n format.html { redirect_to @documentotipo, notice: 'Documentotipo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documentotipo.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 update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: \"Exercise was successfully updated.\" }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @exercise.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 @tipo_documento = TipoDocumento.find(params[:id])\n\n respond_to do |format|\n if @tipo_documento.update_attributes(params[:tipo_documento])\n format.html { redirect_to @tipo_documento, notice: 'Tipo documento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tipo_documento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exerciseoverview.update(exerciseoverview_params)\n format.html { redirect_to @exerciseoverview, notice: 'Exerciseoverview was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @exerciseoverview.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"def update\n @exercise_instruction = ExerciseInstruction.find(params[:id])\n\n respond_to do |format|\n if @exercise_instruction.update_attributes(params[:exercise_instruction])\n format.html { redirect_to @exercise_instruction.exercise, notice: 'Note was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exercise_instruction.errors, status: :unprocessable_entity }\n end\n end\n end",
"def rest_patch(base_uri,json_payload,params)\n begin\n @response = RestClient.patch(base_uri,json_payload,params)\n rescue => e\n puts @response.code\n end\n return @response\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @exercise.update(exercise_params)\n format.html { redirect_to @exercise, notice: 'Exercise was successfully updated.' }\n format.json { render :show, status: :ok, location: @exercise }\n else\n format.html { render :edit }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ejemplo.update(ejemplo_params)\n format.html { redirect_to @ejemplo, notice: 'Ejemplo was successfully updated.' }\n format.json { render :show, status: :ok, location: @ejemplo }\n else\n format.html { render :edit }\n format.json { render json: @ejemplo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @thirtyfife.update(thirtyfife_params)\n format.html { redirect_to @thirtyfife, notice: 'Thirtyfive was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @thirtyfife.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @example_two.update(example_two_params)\n format.html { redirect_to @example_two, notice: 'Example two was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @example_two.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ephem.update(ephem_params)\n format.html { redirect_to @ephem, notice: 'Ephem was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ephem.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @testfile.update(testfile_params)\n format.html { redirect_to @testfile, notice: 'Testfile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @testfile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @tipoenvolvido.update(tipoenvolvido_params)\n format.html { redirect_to @tipoenvolvido, notice: 'Tipoenvolvido was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoenvolvido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @aliexpress = Aliexpress.find(params[:id])\n\n respond_to do |format|\n if @aliexpress.update_attributes(params[:aliexpress])\n format.html { redirect_to @aliexpress, notice: 'Aliexpress was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @aliexpress.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @employe = Employe.find(params[:id])\n\n respond_to do |format|\n if @employe.update_attributes(params[:employe])\n format.html { redirect_to @employe, notice: 'Employe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @employe.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @etape = Etape.find(params[:id])\n\n respond_to do |format|\n if @etape.update_attributes(params[:etape])\n format.html { redirect_to @etape, notice: 'Etape was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # actions\n path = URI(@endpoint).path\n action = URI(@req.request_uri).path.sub(path, '').split('/')\n action -= ['']\n if action.include?('_history')\n @actions = [action[0], '_history']\n else\n @actions = [action[0]]\n end\n\n # search param\n req_query = URI(@req.request_uri).query\n unless req_query.nil?\n @req_params = URI::decode_www_form(req_query).to_h\n end\n\n # requst method\n if @req.request_method == \"GET\" and @actions.include? '_history'\n @req_method = 'vread'\n elsif @req.request_method == \"GET\" and @req_params != nil\n @req_method = 'search-type'\n elsif @req.request_method == \"PUT\"\n @req_method = 'update'\n elsif @req.request_method == \"POST\"\n @req_method = 'create'\n else\n @req_method = 'read'\n end\n\n # interaction\n int1 = Interaction.last type: @actions[0], code: @req_method\n if int1.nil?\n @present = 0\n else\n @present = int1.id\n @intCode = int1.valueCode\n end\n end",
"def update\n @obj = Obj.find(params[:id])\n\n respond_to do |format|\n if @obj.update_attributes(params[:obj])\n format.html { redirect_to @obj, notice: 'Obj was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @obj.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @ficheiro.update(ficheiro_params)\n format.html { redirect_to @ficheiro, notice: 'File was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ficheiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @oferta_academica = OfertaAcademica.find(params[:id])\n\n if @oferta_academica.update(params[:oferta_academica])\n head :no_content\n else\n render json: @oferta_academica.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @objeto.update(etiqueta_params)\n format.html { redirect_to @objeto, notice: 'Etiqueta was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @inventario = Inventario.find(params[:id])\n @foto = @inventario.foto\n \n @service = InventarioService.new(@inventario, @foto)\n respond_to do |format|\n\n if @inventario.update_attributes(params[:inventario],params[:foto_file])\n format.html { redirect_to(@inventario, :notice => 'Inventario was successfully updated.') }\n format.xml { head :ok }\n else\n\t @foto = @service.foto\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @inventario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"def update\n respond_to do |format|\n if @hack.update_attributes(params[:hack])\n format.html { redirect_to @event, :notices => ['Hack was successfully updated.'] }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @hack.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def put(*args)\n request :put, *args\n end"
] |
[
"0.6490018",
"0.63941336",
"0.6353184",
"0.62906724",
"0.6274898",
"0.6227476",
"0.608346",
"0.6076439",
"0.6041",
"0.60309714",
"0.6018341",
"0.6018341",
"0.60180306",
"0.60087246",
"0.5976015",
"0.5969854",
"0.5966978",
"0.59630626",
"0.5961317",
"0.5929762",
"0.5929762",
"0.5929762",
"0.5889559",
"0.5889559",
"0.58433795",
"0.5835374",
"0.5835374",
"0.58327204",
"0.58293205",
"0.58211964",
"0.58183473",
"0.58159626",
"0.5811951",
"0.5796538",
"0.57948554",
"0.5785177",
"0.578413",
"0.57827276",
"0.57827276",
"0.57790357",
"0.5771349",
"0.5768816",
"0.57677454",
"0.57631576",
"0.57627314",
"0.5757984",
"0.57489187",
"0.57407457",
"0.5740532",
"0.57393193",
"0.57388335",
"0.5738798",
"0.57367164",
"0.5734471",
"0.5731896",
"0.57294226",
"0.57280004",
"0.5726779",
"0.57190615",
"0.5716388",
"0.5707119",
"0.5705779",
"0.5704845",
"0.5692664",
"0.5686313",
"0.56823635",
"0.5681692",
"0.5679575",
"0.5671979",
"0.566862",
"0.56668615",
"0.566182",
"0.5660372",
"0.56584036",
"0.5657714",
"0.56543267",
"0.5649841",
"0.56479675",
"0.5647063",
"0.5646278",
"0.56455725",
"0.56455725",
"0.5644642",
"0.56415254",
"0.5639401",
"0.563166",
"0.56265056",
"0.5625072",
"0.5624992",
"0.5623029",
"0.56211203",
"0.56166565",
"0.5615287",
"0.5615265",
"0.56148493",
"0.5612505",
"0.5611342",
"0.56111956",
"0.56097245",
"0.5608442"
] |
0.64578694
|
1
|
DELETE /extrainfos/1 DELETE /extrainfos/1.json
|
def destroy
@extrainfo.destroy
respond_to do |format|
format.html { redirect_to extrainfos_url, notice: 'Extrainfo was successfully destroyed.' }
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @examan.destroy\n respond_to do |format|\n format.html { redirect_to examen_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(\"/#{id}\")\n end",
"def destroy\n @exura = Exura.find(params[:id])\n @exura.destroy\n\n respond_to do |format|\n format.html { redirect_to exuras_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exalt = Exalt.find(params[:id])\n @exalt.destroy\n\n respond_to do |format|\n format.html { redirect_to exalts_url }\n format.json { head :ok }\n end\n end",
"def delete(path)\n RestClient.delete request_base+path\n end",
"def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end",
"def delete_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 delete path\n make_request(path, \"delete\", {})\n end",
"def destroy\n @api_v1_exercise.destroy\n respond_to do |format|\n format.html { redirect_to api_v1_exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @example.destroy\n respond_to do |format|\n format.html { redirect_to examples_url, notice: 'Operação realizada com sucesso.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @example.update_attributes(:deleted => 1)\n respond_to do |format|\n format.html { redirect_to examples_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exosuit.destroy\n respond_to do |format|\n format.html { redirect_to exosuits_url, notice: 'Exosuit was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def delete\n request(:delete)\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @file_example.destroy\n respond_to do |format|\n format.html { redirect_to file_examples_url, notice: 'File example was successfully destroyed.' }\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 @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to exercises_url }\n format.json { head :no_content }\n end\n end",
"def delete!\n request! :delete\n end",
"def destroy\n @tipo_exame.destroy\n respond_to do |format|\n format.html { redirect_to tipo_exames_url, notice: 'Tipo exame was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n RestClient.delete \"#{REST_API_URI}/contents/#{id}.xml\" \n self\n end",
"def destroy\n @do_exercise = DoExercise.find(params[:id])\n @do_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to do_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @annex = Annex.find(params[:id])\n @annex.destroy\n\n respond_to do |format|\n format.html { redirect_to annexes_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estatuto = Estatuto.find(params[:id])\n @estatuto.destroy\n\n respond_to do |format|\n format.html { redirect_to estatutos_url }\n format.json { head :no_content }\n end\n end",
"def delete\n client.delete(url)\n @deleted = true\nend",
"def destroy\n @testis = Teste.find(params[:id])\n @testis.destroy\n\n respond_to do |format|\n format.html { redirect_to testes_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n request(:delete, path)\n end",
"def delete(*rest) end",
"def destroy\n @oncourse_exercise.destroy\n respond_to do |format|\n format.html { redirect_to oncourse_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @aliexpress = Aliexpress.find(params[:id])\n @aliexpress.destroy\n\n respond_to do |format|\n format.html { redirect_to aliexpresses_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @excepcion_entrega = ExcepcionEntrega.find(params[:id])\n @excepcion_entrega.destroy\n\n respond_to do |format|\n format.html { redirect_to excepcion_entregas_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @expediente = Expediente.find(params[:id])\n @expediente.destroy\n\n respond_to do |format|\n format.html { redirect_to expedientes_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n request 'DELETE', path\n end",
"def do_delete(uri = \"\")\n @connection.delete do |req|\n req.url uri\n req.headers['Content-Type'] = 'application/json'\n end\n end",
"def delete\n start { |connection| connection.request http :Delete }\n end",
"def destroy\n @orden_examan.destroy\n respond_to do |format|\n format.html { redirect_to orden_examen_url, notice: 'Orden examan was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exmedico.destroy\n respond_to do |format|\n format.html { redirect_to exmedicos_url, notice: 'Exmedico was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @line_item1 = LineItem1.find(params[:id])\n @line_item1.destroy\n\n respond_to do |format|\n format.html { redirect_to line_item1s_url }\n format.json { head :no_content }\n end\n end",
"def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end",
"def delete(url, headers = {})\n http :delete, \"#{url}.json\", headers\n end",
"def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end",
"def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\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 delete\n api_client.delete(url)\n end",
"def destroy\n @exposition = Exposition.find(params[:id])\n @exposition.destroy\n\n respond_to do |format|\n format.html { redirect_to expositions_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exapmle.destroy\n respond_to do |format|\n format.html { redirect_to exapmles_url, notice: 'Exapmle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @test1.destroy\n respond_to do |format|\n format.html { redirect_to test1s_url, notice: \"Test1 was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def delete\n render :json => @fiestas.delete_at(params[:id].to_i)\n end",
"def delete endpoint\n do_request :delete, endpoint\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to clclass_exercises_path(@clclass) }\n format.json { head :no_content }\n end\n end",
"def delete\n render json: Alien.delete(params[\"id\"])\n end",
"def delete\n Iterable.request(conf, base_path).delete\n end",
"def delete(path)\n\t\trequest(path, :delete)\n\tend",
"def delete\n RestClient.delete(url, @header) do |rso, req, res|\n setup(rso, req, res)\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 @api_v1_todo.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @htc.destroy\n respond_to do |format|\n format.html { redirect_to htcs_url }\n format.json { head :no_content }\n end\n end",
"def delete\n execute_request('DELETE') do |uri, headers|\n HTTP.http_client.delete(uri, header: headers)\n end\n end",
"def destroy\n @expedicao = Expedicao.find(params[:id])\n @expedicao.destroy\n\n respond_to do |format|\n format.html { redirect_to(expedicoes_url) }\n format.xml { 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 delete!( opts = {} )\n http_action :delete, nil, opts\n end",
"def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url, notice: 'Exercise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url, notice: 'Exercise 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 @exercise.destroy\n respond_to do |format|\n format.html { redirect_to exercises_url, notice: \"Exercise was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"def destroy\n @estagio = Estagio.find(params[:id])\n @estagio.destroy\n\n respond_to do |format|\n format.html { redirect_to(estagios_url) }\n format.xml { head :ok }\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 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 @jedi = Jedi.find(params[:id])\n @jedi.destroy\n\n respond_to do |format|\n format.html { redirect_to jedis_url }\n format.json { head :no_content }\n end\n end",
"def delete\n \n end",
"def delete\n delete_from_server single_url\n end",
"def delete\n api(\"Delete\")\n end",
"def destroy\n @exprience = Exprience.find(params[:id])\n @exprience.destroy\n\n respond_to do |format|\n format.html { redirect_to expriences_url }\n format.json { head :no_content }\n end\n end",
"def destroy\r\n @examen_tipo.destroy\r\n respond_to do |format|\r\n format.html { redirect_to examen_tipos_url, notice: 'El nombre del tipo de examen se eliminó corrctamente.' }\r\n format.json { head :no_content }\r\n end\r\n end",
"def destroy\n @patient_exercise = PatientExercise.find(params[:id])\n @patient_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to patient_exercises_url }\n format.json { head :no_content }\n end\n end",
"def delete(*args)\n prepare_request(:delete, args)\n @@client.add(:delete, @path, *args)\n end",
"def delete\n \n end",
"def destroy\n @cocoon_example.destroy\n respond_to do |format|\n format.html { redirect_to cocoon_examples_url, notice: 'Cocoon example was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @daily_exercise = DailyExercise.find(params[:id])\n @daily_exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to daily_exercises_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @exercise_instruction = ExerciseInstruction.find(params[:id])\n @exercise_instruction.destroy\n\n respond_to do |format|\n format.html { redirect_to @exercise_instruction.exercise }\n format.json { head :no_content }\n end\n end",
"def destroy\n @diemtrentuyen = Diemtrentuyen.find(params[:id])\n @diemtrentuyen.destroy\n\n respond_to do |format|\n format.html { redirect_to diemtrentuyens_url }\n format.json { head :no_content }\n end\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n url = prefix + \"delete\"\n return response(url)\n end",
"def delete\n response = WebPay.client.delete(path)\n response['deleted']\n end",
"def destroy\n @exercise = Exercise.find(params[:id])\n @exercise.destroy\n\n respond_to do |format|\n format.html { redirect_to(exercises_url) }\n format.xml { head :ok }\n end\n end",
"def delete\n\n end",
"def delete(path)\n request(:delete, path)\n end"
] |
[
"0.7043066",
"0.7011445",
"0.6942014",
"0.69308174",
"0.6903876",
"0.6897384",
"0.68756527",
"0.6838577",
"0.6838577",
"0.6838577",
"0.6838577",
"0.6828904",
"0.68108577",
"0.6798737",
"0.6778925",
"0.67766374",
"0.6763466",
"0.67148453",
"0.67148453",
"0.67074263",
"0.67049664",
"0.6697915",
"0.66935337",
"0.66935337",
"0.66935337",
"0.66935337",
"0.66928595",
"0.6685797",
"0.666687",
"0.666166",
"0.6645992",
"0.6630846",
"0.6621754",
"0.6621382",
"0.66178226",
"0.6615838",
"0.6615466",
"0.66050106",
"0.6600415",
"0.6591636",
"0.6587949",
"0.65878063",
"0.65774345",
"0.6576207",
"0.65745056",
"0.6568521",
"0.6566171",
"0.6566088",
"0.6561014",
"0.6557998",
"0.6550478",
"0.65468913",
"0.65463364",
"0.6546032",
"0.6543184",
"0.6541161",
"0.6540105",
"0.6538709",
"0.6536243",
"0.6533813",
"0.65195423",
"0.65148157",
"0.6514146",
"0.6513631",
"0.65126306",
"0.65095526",
"0.65095526",
"0.6505652",
"0.6503265",
"0.6497799",
"0.6495844",
"0.6494823",
"0.64933676",
"0.6492958",
"0.64816767",
"0.64816767",
"0.6481257",
"0.64799935",
"0.64760643",
"0.64738715",
"0.6471351",
"0.6471172",
"0.64700407",
"0.6467025",
"0.6466107",
"0.6463276",
"0.6461662",
"0.64615023",
"0.6460612",
"0.6458562",
"0.64564085",
"0.6452973",
"0.64524174",
"0.6449946",
"0.64447445",
"0.64447445",
"0.6443002",
"0.6438315",
"0.64374477",
"0.64352775"
] |
0.7034075
|
1
|
Use callbacks to share common setup or constraints between actions.
|
def set_extrainfo
@extrainfo = Extrainfo.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 extrainfo_params
params.require(:extrainfo).permit(:house_id, :managebool, :managefee, :internet, :television, :cleanfee, :waterfee, :parking, :enterdate, :aircon, :laundary, :pet)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end",
"def valid_params_request?; end",
"def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end",
"def allowed_params\n params.require(:allowed).permit(:email)\n end",
"def permitted_params\n []\n end",
"def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end",
"def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end",
"def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end",
"def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end",
"def safe_params\n params.require(:user).permit(:name)\n end",
"def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"def check_params; true; end",
"def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"def quote_params\n params.permit!\n end",
"def valid_params?; end",
"def paramunold_params\n params.require(:paramunold).permit!\n end",
"def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend",
"def filtered_parameters; end",
"def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end",
"def filtering_params\n params.permit(:email, :name)\n end",
"def check_params\n true\n end",
"def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend",
"def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend",
"def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end",
"def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end",
"def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend",
"def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end",
"def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end",
"def filtering_params\n params.permit(:email)\n end",
"def active_code_params\n params[:active_code].permit\n end",
"def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end",
"def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end",
"def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end",
"def list_params\n params.permit(:name)\n end",
"def filter_parameters; end",
"def filter_parameters; end",
"def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end",
"def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end",
"def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"def url_whitelist; end",
"def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"def admin_social_network_params\n params.require(:social_network).permit!\n end",
"def filter_params\n params.require(:filters).permit(:letters)\n end",
"def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end",
"def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end",
"def permit_request_params\n params.permit(:address)\n end",
"def sensitive_params=(params)\n @sensitive_params = params\n end",
"def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end",
"def secure_params\n params.require(:location).permit(:name)\n end",
"def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end",
"def question_params\n params.require(:survey_question).permit(question_whitelist)\n end",
"def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end",
"def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end",
"def 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 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.69780594",
"0.678054",
"0.6742781",
"0.67387927",
"0.67346025",
"0.6590683",
"0.6501642",
"0.6495788",
"0.6479752",
"0.64763314",
"0.645457",
"0.6437739",
"0.6377168",
"0.6372484",
"0.6363871",
"0.63179374",
"0.62981373",
"0.6297456",
"0.62916917",
"0.6290227",
"0.628954",
"0.62877893",
"0.62814754",
"0.62416226",
"0.6237962",
"0.62168854",
"0.62127215",
"0.62084496",
"0.61927646",
"0.6176822",
"0.6174079",
"0.6171225",
"0.6161419",
"0.61507314",
"0.6150071",
"0.6145409",
"0.61204594",
"0.61135256",
"0.6105225",
"0.6103249",
"0.6088041",
"0.6079626",
"0.6070542",
"0.6060409",
"0.60198915",
"0.6016795",
"0.6010659",
"0.60103244",
"0.6005393",
"0.6005393",
"0.6000696",
"0.60000104",
"0.59931517",
"0.59916013",
"0.5991397",
"0.5990416",
"0.5979021",
"0.5965926",
"0.59582806",
"0.59579134",
"0.5957629",
"0.5956672",
"0.59518754",
"0.59510773",
"0.5942638",
"0.5937516",
"0.59361875",
"0.59361875",
"0.59336793",
"0.5928626",
"0.5925229",
"0.59243226",
"0.59174913",
"0.5907821",
"0.5907719",
"0.5906177",
"0.59056896",
"0.5897028",
"0.5896294",
"0.5895856",
"0.5893494",
"0.58926904",
"0.589066",
"0.58854234",
"0.58809334",
"0.5878489",
"0.58727074",
"0.5868653",
"0.5866631",
"0.58666086",
"0.5866305",
"0.586484",
"0.58631617",
"0.5861481",
"0.5861059",
"0.5859114",
"0.5858489",
"0.585326",
"0.58530635",
"0.5848788",
"0.58479697"
] |
0.0
|
-1
|
This is a good place to test this stuff, since the filters are simplified.
|
def test_filters
@request.env['HTTP_ACCEPT_LANGUAGE'] = "pt-pt,pt;q=0.5"
good_ajax_request(:test)
assert_nil(@controller.instance_variable_get('@user'))
assert_nil(User.current)
assert_equal(:pt, I18n.locale)
assert_equal(0, cookies.count)
assert_equal({'locale'=>'pt'}, session)
session.delete('locale')
@request.env['HTTP_ACCEPT_LANGUAGE'] = "pt-pt,xx-xx;q=0.5"
good_ajax_request(:test)
assert_equal(:pt, I18n.locale)
session.delete('locale')
@request.env['HTTP_ACCEPT_LANGUAGE'] = "pt-pt,en;q=0.5"
good_ajax_request(:test)
assert_equal(:pt, I18n.locale)
session.delete('locale')
@request.env['HTTP_ACCEPT_LANGUAGE'] = "en-xx,en;q=0.5"
good_ajax_request(:test)
assert_equal(:en, I18n.locale)
@request.env['HTTP_ACCEPT_LANGUAGE'] = "zh-*"
good_ajax_request(:test)
assert_equal(:en, I18n.locale)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def filters; end",
"def filters; end",
"def filters\n end",
"def filter; end",
"def filter; end",
"def filter; end",
"def strict_filters; end",
"def apply_filter\n end",
"def bench_filters\n skip 'TODO'\n end",
"def filter\n end",
"def filters=(_arg0); end",
"def filters=(_arg0); end",
"def add_filters(filters); end",
"def filter!; end",
"def global_filter; end",
"def strict_filters=(_arg0); end",
"def filter_parameters; end",
"def filter_parameters; end",
"def test_add_filter\n flunk\n end",
"def named_filter; end",
"def Filter=(arg0)",
"def filters\n @filters ||= {}\n end",
"def filter_generator; end",
"def test_default_filterchain\n chain = UrlFilters::FilterChain.new(RDig.filter_chain[:http])\n assert_nil chain.apply(Document.create(\"http://www.example.com/affe.htm\"))\n assert_not_nil chain.apply(Document.create(\"http://localhost:3000/affe.html\"))\n assert_nil chain.apply(Document.create(\"http://localhost.com/affe.html\"))\n end",
"def test_filter_creation\n md_report = @twitter_reporter.reports.create(:body => 'here in #21108')\n assert_equal 5, (md_report.filters & %w(annapolis baltimore maryland northamerica unitedstates).map { |c| Filter.find_by_name(c) }).size\n ca_report = @twitter_reporter.reports.create(:body => 'all is well in 94107')\n assert_equal 4, (ca_report.filters & %w(sanfrancisco california northamerica unitedstates).map { |c| Filter.find_by_name(c) }).size\n end",
"def filter\n super\n end",
"def ensure_filters\n # private_methods returns the list of private methods accessible to obj. If the all parameter is set to\n # false, only those methods in the receiver will be listed.\n private_methods(false).grep(/\\Afilter_by_/)&.each { |filter| send(filter) }\n end",
"def filter_argument; end",
"def test_filterchain\n cfg = [\n { UrlFilters::UrlInclusionFilter => /.+html$/ },\n { :hostname_filter => 'test.host' }\n ]\n chain = UrlFilters::FilterChain.new(cfg)\n\n assert_nil chain.apply(Document.create(\"http://test.host/affe.htm\"))\n assert_not_nil chain.apply(Document.create(\"http://test.host/affe.html\"))\n assert_nil chain.apply(Document.create(\"http://test.host.com/affe.html\"))\n end",
"def filter\n\tfilter_disabled\n\tfilter_repeated\n\tfilter_silenced\n\tfilter_dependencies\n end",
"def filter_cache; end",
"def register_filter(mod); end",
"def prepare_filters\n params = instance_values.symbolize_keys\n filters = clean_params(params)\n validate_filters(filters)\n end",
"def initialize\n @filters = []\n end",
"def filter_methods; end",
"def global_filter=(_arg0); end",
"def test_file_filter\n raise Exception.new(\"Unimplemented\")\n end",
"def test_file_filter\n raise Exception.new(\"Unimplemented\")\n end",
"def filters_halted\n end",
"def filters\n @filters ||= {}\n end",
"def filters\n @filters ||= {}\n end",
"def test_filter_bonus\n \t\t\n \t\tfilter = ReferenceFilter.new(@reference)\n \t\tfilter = @filter_decorator_class.new(filter)\n \t\t\n \t\tfiltered_references = filter.filter(@collected_references)\n \t\t\n \t\tassert(filtered_references.is_a?(Array))\n \t\tassert(filtered_references.inject(true){|is_a,item| is_a && item.is_a?(Bibmix::FilteredReference) })\n \t\t\n \t\tfiltered_references.each do |filtered_ref|\n \t\t\tif filtered_ref.reference.pages == @reference.pages\n \t\t\t\tassert_equal(@filter_bonus, filtered_ref.relevance)\n \t\t\t\tassert_equal('id1', filtered_ref.reference.id)\n \t\t\telse\n \t\t\t\tassert_equal(0, filtered_ref.relevance)\n \t\t\t\tassert_equal('id2', filtered_ref.reference.id)\n \t\t\tend\n \t\tend\n \tend",
"def filter *filters\n spawn :@filters, @filters + parse_filter_input(filters)\n end",
"def filter_parameters=(_arg0); end",
"def filter_parameters=(_arg0); end",
"def allowed_filters\n []\n end",
"def add_filter\n @filter = true \n end",
"def ts_apply_filters\n # TODO: Make filters for Thinking Sphinx\n end",
"def entry_filter; end",
"def test_it_can_get_list_of_filters\n VCR.insert_cassette 'filters'\n filters = @api.filters('writer1').reverse\n\n assert_kind_of Array, filters\n assert_equal 2, filters.size\n\n assert_kind_of Hash, filters.first\n assert_kind_of Hash, filters.last\n\n assert_equal \"filter1\", filters.first[\"name\"]\n assert_equal \"filter2\", filters.last[\"name\"]\n assert_equal \"out.c-main.users.name\", filters.first[\"attribute\"]\n assert_equal \"out.c-main.users.name\", filters.last[\"attribute\"]\n assert_equal \"=\", filters.first[\"operator\"]\n assert_equal \"<>\", filters.last[\"operator\"]\n end",
"def test_a_filter_all\n filter = 'filter-all'\n tag_name='All'\n basic_check_list(filter, tag_name)\n end",
"def filter_proc(filters = {})\n lambda do |p|\n (filters[:name].nil? || p.name =~ filters[:name]) &&\n (filters[:appid_name].nil? || p.app_id_name =~ filters[:appid_name]) &&\n (filters[:appid].nil? || p.entitlements.app_id =~ filters[:appid]) &&\n (filters[:uuid].nil? || p.uuid =~ filters[:uuid]) &&\n (filters[:team].nil? || p.team_name =~ filters[:team] || p.team_ids.any? { |id| id =~ filters[:team] }) &&\n (filters[:exp].nil? || (p.expiration_date < DateTime.now) == filters[:exp]) &&\n (filters[:has_devices].nil? || !(p.provisioned_devices || []).empty? == filters[:has_devices]) &&\n (filters[:all_devices].nil? || p.provisions_all_devices == filters[:all_devices]) &&\n (filters[:aps_env].nil? || match_aps_env(p.entitlements.aps_environment, filters[:aps_env])) &&\n true\n end\n end",
"def test_filter\n d1 = create_driver(CONFIG, 'test.no.change')\n time = @time.to_i\n d1.run do\n d1.filter({'message' => '12 20120402182059'}, time)\n d1.filter({'message' => '34 20120402182100'}, time)\n d1.filter({'message' => '56 20120402182100'}, time)\n d1.filter({'message' => '78 20120402182101'}, time)\n d1.filter({'message' => '90 20120402182100'}, time)\n end\n filtered = d1.filtered_as_array\n assert_equal 5, filtered.length\n\n first = filtered[0]\n assert_equal 'test.no.change', first[0]\n assert_equal Time.parse(\"2012-04-02 18:20:59\").to_i, first[1]\n assert_equal '1', first[2]['x']\n assert_equal '2', first[2]['y']\n assert_equal '12 20120402182059', first[2]['message']\n\n second = filtered[1]\n assert_equal 'test.no.change', second[0]\n assert_equal Time.parse(\"2012-04-02 18:21:00\").to_i, second[1]\n assert_equal '3', second[2]['x']\n assert_equal '4', second[2]['y']\n\n third = filtered[2]\n assert_equal 'test.no.change', third[0]\n assert_equal Time.parse(\"2012-04-02 18:21:00\").to_i, third[1]\n assert_equal '5', third[2]['x']\n assert_equal '6', third[2]['y']\n\n fourth = filtered[3]\n assert_equal 'test.no.change', fourth[0]\n assert_equal Time.parse(\"2012-04-02 18:21:01\").to_i, fourth[1]\n assert_equal '7', fourth[2]['x']\n assert_equal '8', fourth[2]['y']\n\n fifth = filtered[4]\n assert_equal 'test.no.change', fifth[0]\n assert_equal Time.parse(\"2012-04-02 18:21:00\").to_i, fifth[1]\n assert_equal '9', fifth[2]['x']\n assert_equal '0', fifth[2]['y']\n\n d2 = create_driver(%[\n tag parsed\n key_name data\n format /^(?<x>.)(?<y>.) (?<t>.+)$/\n ], 'test.no.change')\n time = @time.to_i\n d2.run do\n d2.filter({'data' => '12 20120402182059'}, time)\n d2.filter({'data' => '34 20120402182100'}, time)\n end\n filtered = d2.filtered_as_array\n assert_equal 2, filtered.length\n\n first = filtered[0]\n assert_equal 'test.no.change', first[0]\n assert_equal time, first[1]\n assert_nil first[2]['data']\n assert_equal '1', first[2]['x']\n assert_equal '2', first[2]['y']\n assert_equal '20120402182059', first[2]['t']\n\n second = filtered[1]\n assert_equal 'test.no.change', second[0]\n assert_equal time, second[1]\n assert_nil second[2]['data']\n assert_equal '3', second[2]['x']\n assert_equal '4', second[2]['y']\n assert_equal '20120402182100', second[2]['t']\n\n d3 = create_driver(%[\n tag parsed\n key_name data\n format /^(?<x>[0-9])(?<y>[0-9]) (?<t>.+)$/\n ], 'test.no.change')\n time = @time.to_i\n d3.run do\n d3.filter({'data' => '12 20120402182059'}, time)\n d3.filter({'data' => '34 20120402182100'}, time)\n d3.filter({'data' => 'xy 20120402182101'}, time)\n end\n filtered = d3.filtered_as_array\n assert_equal 2, filtered.length\n\n d3x = create_driver(%[\n tag parsed\n key_name data\n format /^(?<x>\\\\d)(?<y>\\\\d) (?<t>.+)$/\n reserve_data yes\n ], 'test.no.change')\n time = @time.to_i\n d3x.run do\n d3x.filter({'data' => '12 20120402182059'}, time)\n d3x.filter({'data' => '34 20120402182100'}, time)\n d3x.filter({'data' => 'xy 20120402182101'}, time)\n end\n filtered = d3x.filtered_as_array\n assert_equal 3, filtered.length\n\n d4 = create_driver(%[\n tag parsed\n key_name data\n format json\n ], 'test.no.change')\n time = @time.to_i\n d4.run do\n d4.filter({'data' => '{\"xxx\":\"first\",\"yyy\":\"second\"}', 'xxx' => 'x', 'yyy' => 'y'}, time)\n d4.filter({'data' => 'foobar', 'xxx' => 'x', 'yyy' => 'y'}, time)\n end\n filtered = d4.filtered_as_array\n assert_equal 1, filtered.length\n\n d4x = create_driver(%[\n tag parsed\n key_name data\n format json\n reserve_data yes\n ], 'test.no.change')\n time = @time.to_i\n d4x.run do\n d4x.filter({'data' => '{\"xxx\":\"first\",\"yyy\":\"second\"}', 'xxx' => 'x', 'yyy' => 'y'}, time)\n d4x.filter({'data' => 'foobar', 'xxx' => 'x', 'yyy' => 'y'}, time)\n end\n filtered = d4x.filtered_as_array\n assert_equal 2, filtered.length\n\n first = filtered[0]\n assert_equal 'test.no.change', first[0]\n assert_equal time, first[1]\n assert_equal '{\"xxx\":\"first\",\"yyy\":\"second\"}', first[2]['data']\n assert_equal 'first', first[2]['xxx']\n assert_equal 'second', first[2]['yyy']\n\n second = filtered[1]\n assert_equal 'test.no.change', second[0]\n assert_equal time, second[1]\n assert_equal 'foobar', second[2]['data']\n assert_equal 'x', second[2]['xxx']\n assert_equal 'y', second[2]['yyy']\n end",
"def filtered_parameters; end",
"def clean_filters\n cleaned_filters = {}\n self.filters.each do |name, value|\n if (self.filter_options[name.to_sym][:fields].detect{|f| f[:value] == value } rescue false)\n cleaned_filters[name.to_sym] = value\n end\n end\n self.filters = cleaned_filters\n end",
"def initialize()\n @filters ||= []\n end",
"def or_filters_provided?\n true\n end",
"def initialize\n @all_filters = []\n @errors = []\n @conditions = nil\n filters\n reset\n end",
"def set_filters\n @filters = ''\n @filters.concat(\"status:'Available'\")\n unless @manufacturer_or_publisher.blank?\n @filters.concat(\" AND (manufacturer:'#{@manufacturer_or_publisher}'\")\n @filters.concat(\" OR publisher:'#{@manufacturer_or_publisher}')\")\n end\n @filters.concat(\" AND category:'#{@category}'\") unless @category.blank?\n @filters.concat(\" AND seller_name:'#{@seller_name}'\") unless @seller_name.blank?\n end",
"def test_filter_fields\n\n class << @controller\n public :filter_fields\n end\n\n wi = new_wi({ \"a\" => 1, \"b\" => 2, \"_c\" => 3, \"_d\" => 4 })\n\n f0, f1 = @controller.filter_fields(wi)\n\n assert_equal({\"a\"=>1, \"b\"=>2}, f0)\n assert_equal({\"_c\"=>3, \"_d\"=>4}, f1)\n end",
"def filtered_entries; end",
"def assert_query_filters(expected_filters)\n response.body =~ /initFilters\\(\\);\\s*((addFilter\\(.+\\);\\s*)*)/\n filter_init = $1.to_s\n\n expected_filters.each do |field, operator, values|\n s = \"addFilter(#{field.to_json}, #{operator.to_json}, #{Array(values).to_json});\"\n assert_include s, filter_init\n end\n assert_equal expected_filters.size, filter_init.scan(\"addFilter\").size, \"filters counts don't match\"\n end",
"def html_clean_filters( src_key, tree_key = nil )\n\n tree_key = \"#{src_key}_tree\".to_sym unless tree_key\n src_key, tree_key = src_key.to_k, tree_key.to_k\n\n filters = []\n filters << html_parse_filter( src_key, tree_key )\n\n #FIXME: PAGE: filters << TitleExtractor.new, or after?\n\n # FIXME: if src is text, last filter\n # filters << TextCtrlWSFilter.new( ContentKeys::TITLE )\n\n tfc = TreeFilterChain.new( html_tree_filters )\n\n filters << HTMLTreeFilter.new( tree_key, tfc,\n HTMLTreeFilter::Order::DEPTH_FIRST )\n\n #FIXME: First block extractor back to text key?\n\n filters\n end",
"def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = BgWorker.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n BgWorker.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end",
"def validate_filter()\n filter_module = (RUBY_VERSION < '1.9') ? params[:filter] : params[:filter].to_sym\n if (params.key?(:filter) && @source::Filters::constants.include?(filter_module))\n @filter = \"#{@source.name}::Filters::#{params[:filter]}\".constantize\n else\n redirect_to root_path\n end\n end",
"def set_filters\n filter_param_keys = [\n 'brand', 'color',\n 'size', 'department', 'keywords'\n ]\n @filters = []\n filter_param_keys.each do |key|\n if !params[key].blank?\n params[key].split(',').each do |val|\n @filters << {:key => key, :val => val}\n end\n end\n end\n \n \n if params[:price]\n params[:price].split(',').each_slice(2).to_a.each do |range|\n @filters << {:key => 'price', :val => range.join(',')}\n end\n end\n\n if @products\n @brands = @products.facet('brand_facet').rows.sort_by{ |brand| brand.value.capitalize}\n @departments = @products.facet('department_facet').rows\n end\n \n @colors = ['green', 'blue', 'purple', 'red', 'pink', 'beige', 'brown', 'yellow', 'orange', 'black', 'white', 'gray', 'teal', 'glowing', 'gold', 'silver']\n \n if !@taxon.nil? && @taxon.has_size?\n sizes = (Spree::Product.sizes.sort_by{|size| size.position}.map(&:presentation) & @products.facet(\"size_facet\").rows.map(&:value))\n end\n end",
"def test_filters_accessor\n pipeline = Class.new(Pipeline)\n pipeline.use @append_a, @append_b\n assert_equal([@append_a, @append_b], pipeline.filters)\n end",
"def filter2(string)\n\nend",
"def filterable?; @filterable; end",
"def test_filter\n \t\t\n \t\t# Execute the query.\n \t\tresponse = @query.collect_references(@reference)\n \t\t \t\t\n \t\t# The query should result in more than one reference. \n \t\tassert(response.size > 0, 'Query did not find any references.')\n \t\t\n \t\t# Check if the response contains any references which title are equal to the\n \t\t# title of @reference. If so, the filter should result in >0 references after\n \t\t# filtering.\n \t\tfound_similar = false\n \t\t@query.response.each do |collected_ref|\n \t\t\tassert(collected_ref.is_a?(Bibmix::CollectedReference))\n \t\t\tif collected_ref.reference.title == @reference.title\n \t\t\t\tfound_similar = true\n \t\t\tend\n \t\tend\n \t\t\n\t \tassert(found_similar, 'The query did not find any references with the exact same title, so filter will return no refernces.')\n\n\t\t# Construct the filter and execute the filtering procedure.\n \t\tfilter = ReferenceFilter.new(@reference)\n \t\tfilter.filter(@query.response)\n\t \t\n\t \tassert(filter.filtered_references.size > 0)\n\t \t\n\t \tfilter.filtered_references.each do |filtered_ref|\n\t \t\t# Check the similarity between the filtered reference and @reference.\n\t \t\tassert_equal(1.0, filtered_ref.relevance)\n\t \t\t\n\t \t\t# Check if the titles are really equal.\n\t \t\tassert_equal(@reference.title, filtered_ref.collected_reference.reference.title)\n\t \tend\n\tend",
"def filter\n @filter ||= if Platform.linux?\n linux_filter\n elsif Platform.os_x?\n os_x_filter\n else\n raise \"Only works on Linux or OS X\"\n end\n end",
"def filter\n @filter\n end",
"def before_filter; end",
"def filters\n @filters ||= FiltersProvider.new\n end",
"def test_class_filter__class_and_method_match\n class_filter = Class_filter\n \n context = {:class_name => \"Dryml\", :method_name => \"build_a\"}.context\n \n options = {:filters => class_filter} \n exec = Tracing::Filter::Executor.new(options) \n result = exec.filters_allow?('msg', context)\n assert_equal true, result, \"Filter should allow passage\" \n end",
"def filter1(string)\n\nend",
"def liquid_filters\n [\n StylesheetFilter,\n JavascriptFilter,\n AssignToFilter,\n LinkToFilter,\n GoogleAnalyticsFilter,\n GoogleWebmasterToolsFilter,\n GoogleJavascriptFilter,\n TextileFilter,\n DesignResourceFilter,\n AttributeFilter,\n ResourceFilter,\n NodeFilter,\n FormFilter\n ]\n end",
"def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = DevFeedback.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n DevFeedback.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end",
"def after_filter; end",
"def autofilter\n true\n end",
"def reset_filters\n @_filters = []\n end",
"def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = User.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n User.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end",
"def initialize_available_filters\n @@available_filters ||= {}\n end",
"def run_filters\n set_user\n authorize\n end",
"def filters\n mentos(:get_all_filters)\n end",
"def extra_search_actions(items, extra_filters = [], kind = nil)\n (extra_filters || []).each do |filter|\n case filter\n when 'my_country'\n case kind || params[:type]\n when 'people', 'counselors'\n items = items.where(country: current_user.country)\n when 'churches', 'groups'\n items = items.joins(:user).where(users:{ country: current_user.country })\n when 'contents'\n items = items.joins(:user).where(users:{ country: current_user.country })\n when 'events'\n items = items.joins('inner join user_groups on user_groups.id = events.eventable_id and events.eventable_type = \\'UserGroup\\' inner join users on users.id = user_groups.user_id').where('users.country = ?', current_user.country)\n \n # TODO\n end\n when 'my_groups'\n case kind || params[:type]\n when 'people', 'counselors'\n items = items.joins(:user_groups).where(user_groups: {id: current_user.user_groups.pluck(:id)})\n when 'churches', 'groups'\n items = items.where(id: current_user.user_groups.select(:id))\n when 'contents'\n items = items.where(user_id: current_user.user_groups_members.select(:id))\n when 'events'\n items = items.where(id: current_user.user_groups_events.select(:id))\n end\n end\n end\n items\n end",
"def _run_filters(where, action)\n self.class.filters[where].each do |(method_or_filter, options, block)|\n if block\n block.call(self) if _filter_condition_met?(method_or_filter, options, action)\n else\n send(method_or_filter) if _filter_condition_met?(method_or_filter, options, action)\n end\n end\n end",
"def set_filter(opts)\n opts = check_params(opts,[:filters])\n super(opts)\n end",
"def test_filters_no_elements\n stream = FromArray.new([2, 4, 6, 8])\n collected = stream.filter { |num| num % 2 == 0 }.collect\n assert(stream.collect == collected)\n end",
"def initialize_url_filters\n # We use a hash which tells the domains to filter.\n # The hash value tells that if company name contains that string then don't filter\n @url_filter = Hash.new\n @url_filter[\"facebook.com\"] = \"facebook\"\n @url_filter[\"linkedin.com\"] = \"linkedin\"\n @url_filter[\"wikipedia.org\"] = \"wikipedia\"\n @url_filter[\"yahoo.com\"] = \"yahoo\"\n @url_filter[\"zdnet.com\"] = \"zdnet\"\n @url_filter[\"yelp.com\"] = \"yelp\"\n @url_filter[\"yellowpages.com\"] = \"yellowpages\"\n @url_filter[\"thefreelibrary.com\"] = \"thefreelibrary\"\n @url_filter[\"thefreedictionary.com\"] = \"thefreedictionary\"\n @url_filter[\"superpages.com\"] = \"superpages\"\n @url_filter[\"businessweek.com\"] = \"week\"\n @url_filter[\"indiamart.com\"] = \"mart\"\n @url_filter[\"naukri.com\"] = \"naukri\"\n @url_filter[\"monsterindia.com\"] = \"monster\"\n @url_filter[\"answers.com\"] = \"answers\"\n @url_filter[\"sulekha.com\"] = \"sulekha\"\n @url_filter[\"asklaila.com\"] = \"asklaila\"\n @url_filter[\"blogspot.com\"] = \"blogspot\"\n @url_filter[\"manta.com\"] = \"manta\"\n @url_filter[\"zoominfo.com\"] = \"zoom\"\n @url_filter[\"twitter.com\"] = \"twitter\"\n @url_filter[\"hotfrog.com\"] = \"hotfrog\"\n @url_filter[\"amazon.com\"] = \"amazon\"\n end",
"def test_reading_with_filters\n d = create_driver(filter_config)\n d.end_if do\n d.events.size >= 3\n end\n d.run(timeout: 5)\n assert_equal 3, d.events.size\n end",
"def test_10_filter_html\n\t\tprintTestHeader \"filter_html Option\"\n\t\trval = bc = nil\n\n\t\t# Test as a 1st-level param\n\t\tassert_nothing_raised {\n\t\t\tbc = BlueCloth::new( DangerousHtml, :filter_html )\n\t\t}\n\t\tassert_instance_of BlueCloth, bc\n\n\t\t# Accessors\n\t\tassert_nothing_raised { rval = bc.filter_html }\n\t\tassert_equal true, rval\n\t\tassert_nothing_raised { rval = bc.filter_styles }\n\t\tassert_equal nil, rval\n\n\t\t# Test rendering with filters on\n\t\tassert_nothing_raised { rval = bc.to_html }\n\t\tassert_equal DangerousHtmlOutput, rval\n\n\t\t# Test setting it in a sub-array\n\t\tassert_nothing_raised {\n\t\t\tbc = BlueCloth::new( DangerousHtml, [:filter_html] )\n\t\t}\n\t\tassert_instance_of BlueCloth, bc\n\t\t\n\t\t# Accessors\n\t\tassert_nothing_raised { rval = bc.filter_html }\n\t\tassert_equal true, rval\n\t\tassert_nothing_raised { rval = bc.filter_styles }\n\t\tassert_equal nil, rval\n\n\t\t# Test rendering with filters on\n\t\tassert_nothing_raised { rval = bc.to_html }\n\t\tassert_equal DangerousHtmlOutput, rval\n\tend",
"def populate_filters(_inputs)\n super.tap do\n self.class.filters.each do |name, filter|\n next if given?(name)\n\n model_field = self.class.model_field_cache_inverse[name]\n next if model_field.nil?\n\n value = public_send(model_field)&.public_send(name)\n public_send(\"#{name}=\", filter.clean(value, self))\n end\n end\n end",
"def validate_filter\n ensure_filter_only_attributes\n ensure_no_unsupported_filters\n end",
"def global_filter(&block)\n @filters[nil] = block\n end",
"def filter(expr); end",
"def filter(expr); end",
"def filter(&block)\n filters = self.filters << yield\n metaclass.send(:define_method, :_filters) do\n filters\n end\n end",
"def parse_filter(filter_argument = T.unsafe(nil), &filter_proc); end",
"def filter(options={})\n raise NotImplementedError\n end",
"def test_filterchain_config\n RDig.configuration do |conf|\n conf.crawler.include_patterns = /.+html$/\n conf.crawler.include_hosts = 'test.host'\n end\n cfg = [\n { UrlFilters::UrlInclusionFilter => :include_patterns },\n { :hostname_filter => :include_hosts }\n ]\n chain = UrlFilters::FilterChain.new(cfg)\n\n assert_nil chain.apply(Document.create(\"http://test.host/affe.htm\"))\n assert_not_nil chain.apply(Document.create(\"http://test.host/affe.html\"))\n assert_nil chain.apply(Document.create(\"http://test.host.com/affe.html\"))\n end"
] |
[
"0.79483217",
"0.79483217",
"0.7522553",
"0.74829394",
"0.74829394",
"0.74829394",
"0.7412993",
"0.73165345",
"0.7308621",
"0.7274344",
"0.72340125",
"0.72340125",
"0.7215026",
"0.7143447",
"0.71086794",
"0.6999384",
"0.6875659",
"0.6875659",
"0.68176144",
"0.68048793",
"0.67169935",
"0.6664372",
"0.66640943",
"0.66143024",
"0.660015",
"0.6599118",
"0.6579779",
"0.6561316",
"0.65501744",
"0.65106994",
"0.64899576",
"0.6459802",
"0.642768",
"0.6413638",
"0.63874775",
"0.6360977",
"0.63273984",
"0.63273984",
"0.6320721",
"0.6319906",
"0.6319906",
"0.6303583",
"0.62770814",
"0.626887",
"0.626887",
"0.6262465",
"0.62370867",
"0.623694",
"0.6235386",
"0.6229179",
"0.6209909",
"0.6174042",
"0.6111431",
"0.6109119",
"0.61061805",
"0.6104141",
"0.6089872",
"0.6084496",
"0.6082338",
"0.60767657",
"0.6071681",
"0.60669994",
"0.60600215",
"0.6048094",
"0.60457647",
"0.60452783",
"0.6040624",
"0.60331863",
"0.60307443",
"0.60158646",
"0.60137707",
"0.60114247",
"0.60067505",
"0.6005863",
"0.59991825",
"0.59980255",
"0.5990619",
"0.5978499",
"0.5965788",
"0.59621143",
"0.5952934",
"0.5943661",
"0.59385043",
"0.592016",
"0.591546",
"0.5912384",
"0.5908203",
"0.59057814",
"0.5902523",
"0.5880556",
"0.5878029",
"0.5872048",
"0.58629966",
"0.58624554",
"0.58226764",
"0.58199716",
"0.58199716",
"0.58197665",
"0.5817922",
"0.58149385",
"0.58135426"
] |
0.0
|
-1
|
genera la secuencia sugerida para la nueva cuenta a crear, dependiendo del nivel, grupo y antesosor(padre)
|
def secuenciasugerida
#recupera los hijos del padre de la cuenta a crear
hijos = Catalogo.where("padre_id = ? AND activo = ?", idcuenta, true)
#configuracion del nivel a crear
idnivel = Catalogo.find_by(id: idcuenta).nivel_id
nivelh = Nivel.find_by(id: idnivel).numnivel + 1
nivel = Nivel.find_by(numnivel: nivelh)
nrodigitos = nivel.nrodigitos
nrodigitostotal = nivel.nrodigitostotal
digito = 0
aux = 0
hijos.each do |e|
aux = e.codigo.last(nrodigitos).to_i
if digito < aux
digito = aux
end
end
digito = digito + 1
c =""
nrodigitos.times { c = c + "0" }
c = c.to_s + digito.to_s
#codigo sugerido
return c.last(nrodigitos).to_s
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def crear_cuotas\n case params[:adquisicion][:tipo_pago].to_s\n when TIPOS_PAGO[:unico].to_s\n @adquisicion.cuotas.destroy_all\n cuotas = params[:cant_cuotas]\n monto_cuota = @adquisicion.precio / cuotas.to_d\n cuotas.to_i.times do |i|\n @adquisicion.cuotas.create(monto: monto_cuota, concepto: \"Cuota #{i}\")\n end\n when TIPOS_PAGO[:recurrente].to_s\n @adquisicion.cuotas.destroy_all\n meses = params[:cant_meses]\n hoy = Time.zone.today\n dia = params[:dia_del_mes]\n mes = Time.zone.today.month\n ano = Time.zone.today.year\n fecha = Date.new(ano, mes, dia.to_i)\n hoy > fecha ? fecha += 1.month : nil\n meses.to_i.times do |i|\n @adquisicion.cuotas.create(concepto: \"Cuota #{i + 1}\", fecha_vencimiento: fecha, monto: params[:adquisicion][:precio])\n fecha += 1.month\n # mes += 1\n end\n end\n # params[:adquisicion].delete(:cuotas_attributes)\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def inicia_analista\n current_usuario = Usuario.create!(PRUEBA_USUARIO_AN)\n current_usuario.grupo_ids = [20]\n current_usuario.save\n return current_usuario\n end",
"def generate_membership\n Membership.create(taller_id: id, role_id: Role.propietario.id, usuario_id: owner_id, current: true)\n Role.administrador\n Role.operador\n Role.propietario\n end",
"def new_permiso_diario\n @permiso_diario = PermisoDiario.new\n @id = PermisoDiario.next_id\n @solicita = User.get_solicitante(current_user.id)\n @jefe_area = User.get_jefe_area(current_user.id)\n @vehiculos = Vehiculo.get_area_vehiculos(current_user.id)\n end",
"def create\n\n\n @it_inscripcion_registro = current_user.it_inscripcion_registros.build(it_inscripcion_registro_params)\n\n #Se cuenta cuantas personas se han preinscrito a un grupo. Se cuenta con todos los registros no\n #importando que éstos no hayan sido validados. El dato se obtiene a través de todos los registros\n #de preinscripción, el id para el grupo actual se obtiene con @it_inscripcion_registro.grupo_id\n cupos = ItInscripcionRegistro.where(grupo_id: @it_inscripcion_registro.grupo_id).count\n\n #Se localiza si el usuatio tiene un id previo con ese mismo grupo. Si existe se le envia un mensaje\n # y no se permite guardar el registro por segunda ocasión.\n usuario = User.find(current_user.id)\n registro = ItInscripcionRegistro.find_by(user_id: usuario, grupo_id: @it_inscripcion_registro.grupo_id)\n\n #Si el cupo del grupo excede los 25 alunos se le muestra un mensaje al usuario donde se le indica\n #que deberá elegir un grupo distinto, el registro de inscripción no se guardará en la base dde datos_bancos\n #hay que agregar este metodo a las rb de el modelo correspondiente.\n if cupos > 40\n redirect_to new_it_inscripcion_registro_path, notice: \"El grupo ha alcanzado su ocupación máxima. Por favor elija otro grupo\"\n elsif registro.present? && registro.grupo_id == @it_inscripcion_registro.grupo_id\n redirect_to panel_alumnos_path, notice: \"Usted ya tiene registrada una solicitud con este grupo.\"\n else\n\n respond_to do |format|\n if @it_inscripcion_registro.save\n format.html { redirect_to @it_inscripcion_registro, notice: 'El registro de inscripción se creó correctamente.' }\n format.json { render :show, status: :created, location: @it_inscripcion_registro }\n else\n format.html { render :new }\n format.json { render json: @it_inscripcion_registro.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"def agregar_estudiante_a_seccion\n \n if __es_del_grupo_docente && params[:id] && __es_numero_entero?(params[:id]) && SeccionSitioWeb.where(:id => params[:id]).size > 0\n @seccion = \"estudiantes\"\n @seccion_sitio_web = SeccionSitioWeb.where(:id => params[:id]).first\n @cedulas = Usuario.order(\"cedula\").where(:id => Estudiante.all).collect{ |x| x.cedula.to_s}.uniq\n return\n end\n\n redirect_to :asignatura_nombre => @sitio_web.nombre_url, :semestre => @sitio_web.periodo, :controller => \"estudiantes\", :action => \"index\"\n return\n end",
"def create\n \n params[:cour][:ecole_id] = ecole.id if ecole?\n\n #Ajout de la classe en groupe\n params[:cour][:classe_room_id].unshift(params[:cour][:first_classe_room_id])\n\n @creneau = params[:cour][:creneau_debut].to_i \n @nombre_heure = params[:cour][:creneau_fin].to_i - params[:cour][:creneau_debut].to_i + 1\n @classe_rooms = params[:cour][:classe_room_id]\n\n # Enregistrement des cours pour chaque creneau\n @nombre_heure.times do \n # Enregistrement pour chaque chaque par creneau\n @classe_rooms.size.times do |i|\n @cour = current_user.cours.create(enseignant_id: params[:cour][:enseignant_id], matiere_id: params[:cour][:matiere_id], salle_id: params[:cour][:salle_id], creneau_id: @creneau, jour_id: params[:cour][:jour_id], nombre_heure: @nombre_heure, annee_id: params[:cour][:annee_id], ecole_id: params[:cour][:ecole_id], semestre_id: params[:cour][:annee_id], classe_room_id: @classe_rooms[i])\n end\n @creneau = @creneau + 1\n end\n\n\n respond_to do |format|\n if @cour\n format.html { redirect_to @cour, notice: 'Cours was successfully created.' }\n format.json { render :show, status: :created, location: @cour }\n else\n format.html { render :new }\n format.json { render json: @cour.errors, status: :unprocessable_entity }\n end\n end\n end",
"def crear_cuotas\n @servicio.cuotas.destroy_all\n hoy = Time.zone.today\n dia = params[:dia_del_mes]\n mes = Time.zone.today.month\n ano = Time.zone.today.year\n fecha = Date.new(ano, mes, dia.to_i)\n hoy > fecha ? fecha += 1.month : nil\n @servicio.fin = @servicio.inicio + 1.year if @servicio.fin.blank?\n i = 0\n while fecha < @servicio.fin\n i += 1\n @servicio.cuotas.create(concepto: \"Cuota #{i + 1}\", fecha_vencimiento: fecha, monto: params[:servicio][:precio])\n fecha += 1.month\n # params[:servicio].delete(:cuotas_attributes)\n end\n end",
"def new # modificacion para transacciones\n @solicitudrecurso = Solicitudrecurso.new \n\n #cargo los usuarios y los diferentes recursos\n @usuarios=Usuario.find(:all,:order=>\"apellidos\").reject{|u| u.identificador==\"anonimo\"} \n \n \n #identifico los tipos distintos de recurso\n @tipos = Recurso.find(:all).map{ |i| i.descripcion }.uniq\n \n # cargo los dias y horas posibles para los select\n @dias=Dia.find(:all,:conditions=>['en_uso = ?',\"t\"])\n @horas=Horario.find(:all,:conditions=>['en_uso = ?',\"t\"])\n\n #obtengo y formateo la fecha actual \n @dia=@solicitudrecurso.fechareserva=formato_europeo(Date.today)\n\n # esto es para crear un carro no persistente \n session[:tramos_horarios]=Solicitudhoraria.new\n # y una identificacion de tramos horarios para poder borrarlos individualmente. Se ira decrementando\n session[:codigo_tramo]=0\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitudrecurso }\n end\n end",
"def new # modificacion para transacciones\n @solicitudrecurso = Solicitudrecurso.new \n\n #cargo los usuarios y los diferentes recursos\n @usuarios=Usuario.order(\"apellidos\").to_a.reject{|u| u.identificador==\"anonimo\"} \n \n \n #identifico los tipos distintos de recurso\n @tipos = Recurso.all.map{ |i| i.descripcion }.uniq\n \n # cargo los dias y horas posibles para los select\n @dias=Dia.where('en_uso = ?',\"t\").to_a\n @horas=Horario.where('en_uso = ?',\"t\").to_a\n\n #obtengo y formateo la fecha actual \n @dia=@solicitudrecurso.fechareserva=formato_europeo(Date.today)\n\n # esto es para crear un carro no persistente \n session[:tramos_horarios]=Solicitudhoraria.new\n # y una identificacion de tramos horarios para poder borrarlos individualmente. Se ira decrementando\n session[:codigo_tramo]=0\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @solicitudrecurso }\n end\n end",
"def create\n\t\t# Mapeando Departamentos e Seções ativas\n\t\t@secoes = Section.where(\"ativo = 't'\")\n\t\t@departamentos = Departamento.where(\"ativo = 't'\")\n\t\tif !defined?($CarrinhoCompras)\n\t\t\t$CarrinhoCompras = Array.new()\n\t\t\t@totReg = 0\n\t\tend\n\t\tif !defined?($CarrinhoComprasQuant)\n\t\t\t$CarrinhoComprasQuant = Array.new()\n\t\tend\t\n\t\t\n\t\t@totReg = $CarrinhoCompras.size\n\t\t@prod = params[:prod]\n\t\t$CarrinhoCompras[@totReg] = Produt.find(@prod.to_i).id # ID do Produto\n\t\t$CarrinhoComprasQuant[@totReg] = 1 # QUANTIDADE\n\tend",
"def create\n @conteudo = Conteudo.new(params[:conteudo])\n if ( current_user.has_role?('professor_infantil') or current_user.has_role?('professor_fundamental') ) \n @conteudo.disciplina_id= session[:cont_disciplina_id]\n if ( current_user.has_role?('professor_infantil') and current_user.unidade_id != 60)\n @conteudo.disciplina_id=115\n end\n end\n if ( current_user.has_role?('professor_infantil') or current_user.has_role?('professor_fundamental')or current_user.has_role?('pedagogo')) and current_user.unidade_id==60\n @conteudo.classe_id= nil\n else\n @conteudo.classe_id= session[:cont_classe_id]\n end\n @conteudo.atribuicao_id= session[:cont_atribuicao_id]\n @conteudo.ano_letivo = Time.now.year\n @conteudo.unidade_id = current_user.unidade_id\n @conteudo.user_id = current_user.id\n respond_to do |format|\n if @conteudo.save\n session[:new_id]=@conteudo.id\n flash[:notice] = 'Salvo com sucesso.'\n if session[:new_direcao]==1\n session[:new_direcao]=0\n format.html { redirect_to(show_direcao_path) }\n else if session[:new_mqa]=1\n session[:new_mqa]=0\n format.html { redirect_to(show_mqa_path) }\n format.xml { render :xml => @conteudo, :status => :created, :location => @conteudo }\n else\n format.html { redirect_to(@conteudo) }\n format.xml { render :xml => @conteudo, :status => :created, :location => @conteudo }\n\n end\n end\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @conteudo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n authorize! :create_almacen,Sigesp::Solicitud \n unidad = session['unidad'] \n return render json: { unidad: \"Esta Unidad Administrativa no tiene Numero de Control \" }, status: :unprocessable_entity if Sigesp::CtrlRequisicion.control_compra(unidad).nil?\n\n @solicitudes = Sigesp::Solicitud.crear_solicitudes_almacen(sigesp_solicitud_alamcen_params)\n @grupoSolicitud = SolicitudGrupo.new\n @solicitudes.each do |solicitud|\n @grupoSolicitud.solicitudes << solicitud \n end\n if @grupoSolicitud.valid? \n @grupoSolicitud.guardar(unidad,current_usuario)\n return render json: { url: sigesp_solicitudsalmacen_path(@grupoSolicitud.solicitudes[0])} \n else\n return render json:@grupoSolicitud.errors ,status: :unprocessable_entity\n end \n end",
"def create_dup\n self.generate_key\n new = Mensaje.new(self.attributes.merge(:owner_id =>self.recibe_id))\n self.owner_id ||= self.envia_id\n self.save\n new.owner_id = self.recibe_id\n new.save if (new.valid? && !Mensaje.exists?(:clave => self.clave, :owner_id => new.owner_id))\n end",
"def crear_comite_nacional session\n \n transaction do\n \n begin\n \n #ciudad = Ciudad.find(:first, :conditions=>['ciudad.id=?',Oficina.find(session[:oficina]).ciudad_id.to_s],:include=>:estado)\n oficina_id=session[:oficina].to_s\n ########################################\n #1 Verificar si el comite esta cerrado.\n Comite.connection.execute(\"LOCK comite in ACCESS EXCLUSIVE MODE;\")\n ComiteDecisionHistorico.connection.execute(\"LOCK comite_decision_historico in ACCESS EXCLUSIVE MODE;\")\n comite=Comite.find(:first,:include=>['comite_decision_historico'],:conditions=>\" comite_decision_historico.tipo_comite='n' \",:order=>\"comite.id desc\")\n if !comite.nil?\n if comite.vigente==true\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.llenar_datos_instancia')\n else\n ##################################################################\n #2 Todos los tramites del ultimo comite deben tener una decision.\n total=ComiteDecisionHistorico.count(:conditions=>\"tipo_comite='n' and comite_id=#{comite.id} \")\n total_decision=ComiteDecisionHistorico.count(:conditions=>\"tipo_comite='n' and decision is not null and comite_id=#{comite.id} \")\n if total.to_i!=total_decision.to_i\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.datos_creados_deben_tener_decision')\n end\n end\n end\n \n condicion=\" estatus_id=10034 and comite_estadal_id is not null and ( comite_id IS NULL or decision_comite_nacional='D' ) \"\n \n solicitudes=Solicitud.find(:all,:conditions=>condicion)\n \n if !solicitudes.nil? && !solicitudes.empty?\n ParametroGeneral.connection.execute(\"LOCK parametro_general in ACCESS EXCLUSIVE MODE;\")\n parametro_general=ParametroGeneral.find(:first)\n semilla = parametro_general.numeracion_instancia_nacional.to_i + 1\n anio = ParametroGeneral.find(:first).anio_constitucion_comite_vigente\n numero = semilla.to_s+\"-\"+anio.to_s\n parametro_general.numeracion_instancia_nacional = semilla\n parametro_general.save!\n comite = Comite.new\n comite.attributes = {:numero=>numero,:instancia_tipo_id=> 5,:vigente=>true}\n comite.save!\n \n params = {\n :p_numero_comite=>numero,\n :p_comite_id=>comite.id,\n :p_tipo=>'N',\n :p_oficina_id=>0\n }\n \n ejecutar = execute_sp('apertura_comite', params.values_at(\n :p_numero_comite,\n :p_comite_id,\n :p_tipo,\n :p_oficina_id))\n \n logger.info \"Ejecutar =======> #{ejecutar.to_s}\"\n \n #solicitudes.each { |x| \n #x.numero_comite_nacional = numero\n #x.comite_id = comite.id\n #x.decision_comite_nacional = nil\n #x.comentario_comite_nacional = nil\n #x.save!\n #ComiteDecisionHistorico.create(\n #:solicitud_id=> x.id,\n #:comite_id => comite.id,\n #:tipo_comite => 'n',\n #:oficina_id => x.oficina_id\n #)\n #}\n return 1\n else\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.no_existen_tramites_para_nuevo_comite')\n end\n rescue=>detail\n return I18n.t('Sistema.Body.Vistas.InstanciaComiteNacional.Errores.error_en_creacion') + detail.message.to_s\n \n end #------> Fin del Begin\n \n end #------> Fin transacion do\n \n end",
"def create\n\t\tauthorize! :create, TipoPrivilegio\n @tipo_privilegio = TipoPrivilegio.new(tipo_privilegio_params)\n\n respond_to do |format|\n if @tipo_privilegio.save\n\t\t\t\t\t\tsesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n\t\t\t\tTransaccion.create!(\n \t\t\t\tdescripcion: \"Creación del tipo de Privilegio : #{@tipo_privilegio.attributes}\",\n \t\t\t\tsesion_id: sesion.id\n\t\t\t\t)\n format.html { redirect_to @tipo_privilegio\nflash[:success] = 'Tipo privilegio fue creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @tipo_privilegio }\n else\n format.html { render :new }\n format.json { render json: @tipo_privilegio.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @imovel = Imovel.new(params[:imovel])\n \n @imovel.attributes = {:cadastrador_id => current_user.corretor.id } if !current_user.corretor.nil? \n @imovel.attributes = {:ativo => true}\n \n #@caracteristica_imovel.increment!(:contador)\n \n if has_role?(current_user, 'corretor')\n @imovel.attributes = {:ativo => false}\n end\n \n # arranjo temporario porque não tá cadastrando com nome quando é terreno\n if @imovel.tipo_imovel_id == TipoImovel::TERRENO\n @imovel.attributes = {:nome => \"TERRENO LOCALIZADO: \"+@imovel.localizacao}\n \n # Zera os atributos abaixo\n @imovel.attributes = {:quartos => '0'}\n @imovel.attributes = {:suites => '0'}\n @imovel.attributes = {:vagas => '0'}\n @imovel.attributes = {:item_imovel_ids => []}\n end\n \n # Para as buscas no site\n #@imovel.caracteristica_imovels.each do |caracteristica|\n # aux = caracteristica.contador+1\n # caracteristica.update_attribute(:contador, aux)\n #end\n \n respond_to do |format|\n if @imovel.save\n format.html { redirect_to administrativo_imovels_path, notice: 'Imóvel foi cadastrado com sucesso.' }\n format.json { render json: @imovel, status: :created, location: @imovel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @imovel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @conglomerado_semanal = ConglomeradoSemanal.new(conglomerado_semanal_params)\n \n info_curso = Curso.where(grupo: @conglomerado_semanal[:curso]).first\n @conglomerado_semanal[:periodo] = info_curso.periodo\n @conglomerado_semanal[:coordinador_tutores] = info_curso.coordinador_tutores\n @conglomerado_semanal[:campus] = info_curso.campus\n\n @conglomerado_semanal.calcular_datos_semanal()\n \n reportes_quincenals_count = ReporteQuincenal.where(tutor: @conglomerado_semanal[:tutor], curso: @conglomerado_semanal[:curso]).count\n alumnos_count = Curso.select(\"*\").where(tutor: @conglomerado_semanal[:tutor], grupo: @conglomerado_semanal[:curso]).joins(\"INNER JOIN alumno_toma_cursos ON alumno_toma_cursos.curso = cursos.grupo\").count\n if reportes_quincenals_count > 0\n @conglomerado_semanal[:horas_reportes] = 15/((6*alumnos_count)/reportes_quincenals_count)\n else\n @conglomerado_semanal[:horas_reportes] = 0\n end\n \n @conglomerado_semanal.calcular_horas()\n\n respond_to do |format|\n if @conglomerado_semanal.save\n mensaje = \"<b>\" + get_usuario_name_by_cuenta(@conglomerado_semanal[:coordinador_tutores]) + \"</b> ha creado tu reporte <b>final</b> para <b>\" + @conglomerado_semanal[:curso] + \"</b>\"\n Notificacion.crear_notificacion(@conglomerado_semanal[:tutor], mensaje, \"/conglomerado_semanals/\" + @conglomerado_semanal[:id].to_s)\n \n coordinador_campus = Usuario.select(:cuenta).where(campus: @conglomerado_semanal[:campus], rol: STR_ROL_COORDINADOR_CAMPUS).first\n mensaje = \"<b>\" + get_usuario_name_by_cuenta(@conglomerado_semanal[:coordinador_tutores]) + \"</b> ha creado el reporte <b>final</b> de <b>\" + get_usuario_name_by_cuenta(@conglomerado_semanal[:tutor]) + \"</b> para <b>\" + @conglomerado_semanal[:curso] + \"</b>\"\n Notificacion.crear_notificacion(coordinador_campus.cuenta, mensaje, \"/conglomerado_semanals/\" + @conglomerado_semanal[:id].to_s)\n \n format.html { redirect_to conglomerado_semanal_url(@conglomerado_semanal), notice: 'Conglomerado semanal was successfully created.' }\n format.json { render :show, status: :created, location: @conglomerado_semanal }\n else\n format.html { render :new }\n format.json { render json: @conglomerado_semanal.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tauthorize! :create, DetalleGasto\n @detalle_gasto = @informe_gastos.detalle_gastos.new(detalle_gasto_params)\n @detalle_gasto.voluntario_id = current_usuario.id\n respond_to do |format|\n if @detalle_gasto.save\n sesion = Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(descripcion: \"Creación del detalle gasto #{@detalle_gasto.titulo}, descripcion: #{@detalle_gasto.descripcion}, con monto #{@detalle_gasto.monto}, concepto_gasto: #{@detalle_gasto.concepto_gasto.titulo}, voluntario: #{@detalle_gasto.voluntario.nombre}, comprobante: #{@detalle_gasto.comprobante.numero}\",\n sesion_id: sesion.id, \n proyecto_id: @detalle_gasto.informe_gasto.proyecto.id)\n #format.html { redirect_to gestionar_informe_gastos_path(@detalle_gasto.informe_gasto)} #@detalle_gasto, notice: 'Detalle gasto fue creado satisfactoriamente.' }\n format.html { redirect_to new_comprobante_path(:detalle_gasto_id => @detalle_gasto.id)}\n #format.json { render :show, status: :created, location: @detalle_gasto }\n else\n format.html { render :new }\n format.json { render json: @detalle_gasto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def crear\n if user_signed_in?\n unless current_user.employee.nil?\n @permiso_crear = false\n @security_role_type = Security::RoleType.find_by(name: \"Crear\").name\n current_user.employee.security_profile.security_role.security_role_menus.each do |security_role_menu| \n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type| \n if @security_role_type == role_type.security_role_type.name\n @permiso_crear = true\n break\n end\n end\n elsif params[:controller] == \"security/role_type_menus\"\n params[:controller] = \"security/roles\"\n if security_role_menu.security_menu.controller == params[:controller] \n security_role_menu.security_role_type_menus.each do |role_type|\n if @security_role_type == role_type.security_role_type.name\n @permiso_crear = true\n break\n end\n end\n end\n end\n end\n if current_user.username == \"aadmin\"\n @permiso_crear = true\n end\n if params[:action] == \"new\" && @permiso_crear == false\n redirect_to root_path\n end\n return @permiso_crear\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 @grupo = Grupo.new(params[:grupo])\n @grupo.hora_inicio = revisar_los_minutos_de @grupo.hora_inicio\n @grupo.hora_fin = revisar_los_minutos_de @grupo.hora_fin\n \n respond_to do |format|\n if @grupo.save\n flash[:notice] = 'Grupo was successfully created.'\n format.html { redirect_to(@grupo) }\n format.xml { render :xml => @grupo, :status => :created, :location => @grupo }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @grupo.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @caso.current_usuario = current_usuario\n @caso.memo = ''\n @caso.titulo = ''\n\n notificacion = 'Caso creado.'\n if @conscasocount > MAX_CASOS_REFRESCA_AUTOMATICO\n notificacion += \" Por la cantidad de casos (#{@conscasocount})\"+\n \" debe Refrescar para actualizar \" +\n \" el cambio en el listado de casos\"\n end\n respond_to do |format|\n if @caso.save\n if registrar_en_bitacora\n Msip::Bitacora.a(request.remote_ip, current_usuario.id,\n request.url, params, 'Sivel2Gen::Caso',\n @caso.id, 'crear', '')\n end\n\n format.html {\n redirect_to @caso,\n notice: notificacion\n }\n format.json {\n render action: 'show', status: :created, location: @caso,\n layout: 'application'\n }\n else\n format.html {\n render action: 'new', layout: 'application'\n }\n format.json {\n render json: @caso.errors, status: :unprocessable_entity\n }\n end\n end\n begin\n @conscasocount = Conscaso.count\n if @conscasocount <= MAX_CASOS_REFRESCA_AUTOMATICO\n puts Conscaso.refresca_conscaso\n end\n rescue\n puts Conscaso.refresca_conscaso\n end\n end",
"def cria_partida_demo\n \n partida = self.partidas.new(descricao:\"Partida Demo\", tipo: 0, dia_semana: 0)\n partida.save\n\n 14.times do |i|\n partida.jogadors.create(\n nome: \"Jogador #{i}\",\n habilidade: rand(1..5),\n )\n end\n\n end",
"def create\n pedidos_compra = params[:pedidos_compra_ids]\n pedidos_cotizaciones_count = 0\n pedidos_compra.each do |pedido_id|\n @pedido_compra = PedidoCompra.find(pedido_id)\n categorias = @pedido_compra.get_componente_categorias\n proveedores = ComponenteCategoria.get_proveedores(categorias)\n\n # Se genera un pedido de cotizacion para cada proveedor\n proveedores.each do |p|\n proveedor = Proveedor.find(p)\n pedido_cotizacion = PedidoCotizacion.new( proveedor_id: p,\n pedido_compra_id: @pedido_compra.id,\n fecha_generado: DateTime.now,\n estado: PedidosEstados::PENDIENTE,\n user_id: current_user.id)\n\n @pedido_compra.pedido_compra_detalles.each do |d|\n pedido_cotizacion.pedido_cotizacion_detalles.build(componente_id: d.componente_id, cantidad_requerida: d.cantidad, pedido_compra_detalle_id: d.id) if proveedor.componente_categorias.exists?(d.componente.componente_categoria_id)\n end\n\n pedido_cotizacion.save\n pedidos_cotizaciones_count +=1\n end\n\n @pedido_compra.update(estado: PedidosEstados::PROCESADO, fecha_procesado: DateTime.now) if @pedido_compra.estado != PedidosEstados::PROCESADO\n\n end\n flash.notice = \"Se ha generado #{pedidos_cotizaciones_count} pedidos de cotizaciones.\"\n end",
"def create\n @sesiune = Sesiune.new(sesiune_params)\n\n respond_to do |format|\n if @sesiune.save\n\n # duplic temele si domeniile din ultima sesiune si le adaug in baza de date cu sesiune_id asta pe care tocmai am creat-o\n @ultima_sesiune = Sesiune.where(este_deschisa: false).last\n Domeniu.where(sesiune_id: @ultima_sesiune.id).each do |dom|\n nou_dom = Domeniu.create(nume: dom.nume, descriere: dom.descriere, user_id: dom.user_id, sesiune_id: @sesiune.id)\n Tema.where(sesiune_id: @ultima_sesiune.id).where(domeniu_id: dom.id).each do |tema|\n Tema.create(nume: tema.nume, descriere: tema.descriere, domeniu_id: nou_dom.id, este_libera: true, user_id: tema.user_id, sesiune_id: @sesiune.id)\n # ce faci dc user_id-ul temei este un student care a terminat? si th i se desfiinteaza contul?\n end\n end\n\n format.html { redirect_to controlPanel_path, notice: 'Sesiune was successfully created.' }\n format.json { render action: 'show', status: :created, location: @sesiune }\n else\n format.html { render action: 'new' }\n format.json { render json: controlPanel_path.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @caracteristica_imovel = CaracteristicaImovel.new(params[:caracteristica_imovel])\n \n descricao_aux = @caracteristica_imovel.descricao.downcase \n descricao_aux = descricao_aux.titleize\n \n @caracteristica_imovel.attributes = {:contador => '0'}\n @caracteristica_imovel.attributes = {:descricao => descricao_aux}\n \n if has_role?(current_user, 'corretor')\n #@imovel_detalhe.attributes = {:ativo => false}\n end\n \n #@caracteristica_imovel.increment!(:contador)\n \n respond_to do |format|\n if @caracteristica_imovel.save\n # Comentado o trecho que direcionava novamente para a tela de cadastro e não a listagem.\n #format.html { redirect_to new_administrativo_caracteristica_imovel_path, notice: 'Característica '+@caracteristica_imovel.descricao+' foi cadastrada com sucesso.' }\n #format.json { render json: @caracteristica_imovel, status: :created, location: new_administrativo_caracteristica_imovel_path }\n format.html { redirect_to administrativo_caracteristica_imovels_path, notice: 'Característica '+@caracteristica_imovel.descricao+' foi cadastrado com sucesso.' }\n format.json { render json: @caracteristica_imovel, status: :created, location: @caracteristica_imovel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @caracteristica_imovel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @numero = params[:numero]\n @cvv = params[:cvv]\n @fecha_vencimiento = params[:fecha_vencimiento]\n @viaje_id=params[:viaje_id]\n\n @compra_exitosa = false\n\n if !(@numero.nil? || @cvv.nil? || @fecha_vencimiento.nil?)\n\n if @numero.length == 12\n\n if @cvv.length== 3\n\n if DateTime.parse(@fecha_vencimiento) > Date.today\n\n\n arr=params[:adicionales]\n viaje=Viaje.find_by_id(params[:viaje_id])\n\n #POR AHORA HAGO QUE SE RESERVE AUTOMATICAMENTE\n pasaje= Pasaje.new\n if(arr != nil)\n arr.each do |a|\n pasaje.adicionales=pasaje.adicionales.append(Adicional.find_by_id(a))\n end\n end\n pasaje.viaje_id=params[:viaje_id]\n pasaje.user_id=current_user.id\n if (viaje.asientos_restantes !=nil and viaje.asientos_restantes>0)\n viaje.asientos_restantes=viaje.asientos_restantes-1\n viaje.save\n elsif viaje.asientos_restantes<=0\n flash[:danger] = \"Viaje con asientos ocupados\"\n end\n\n pasaje.save\n @compra_exitosa=true\n\n\n else\n flash[:alert]=\"Debe ingresar una fecha posterior a hoy\"\n end\n else\n flash[:alert]=\"Debe ingresar un código de tarjeta válido de tres dígitos\"\n end\n else\n flash[:alert]=\"Debe ingresar una tarjeta válida de doce dígitos\"\n end\n else\n flash[:notice]=\"Debe ingresar una tarjeta válida\"\n end\n\n end",
"def create\r\n @comite_registro = current_user.comite_registros.build(comite_registro_params)\r\n\r\n if @comite_registro.save\r\n flash[:success] = \"Su petición para registrar su comité tutorial fue creada!\"\r\n if current_user.tipos_usuario.tipo == \"Alumno\"\r\n redirect_to alumnos_path\r\n else\r\n redirect_to root_path\r\n end\r\n else\r\n flash[:alert] = \"Su petición para registrar su comité tutorial no pudo ser creada! Revise el formulario.\"\r\n render :new\r\n end\r\n end",
"def create\n\t\tauthorize! :create, AsignacionRol\n @asignacion_rol = AsignacionRol.new(asignacion_rol_params)\n @asignacion_rol.esActual = true\n @asignacion_rol.active = true\n @proyecto = @asignacion_rol.proyecto\n @roles = []\n @rols = Rol.where(tipo_rol: TipoRol.where(nombre:'Proyecto'))\n coor_sist = Rol.where(\"nombre = ?\", 'Coordinador Sistema').first\n asig_func = AsignacionFuncion.where(\"usuario_id = ? AND rol_id = ?\", current_usuario, coor_sist).first\n @rols.each do |rol|\n if rol.nombre != 'Coordinador' || asig_func != nil then\n @roles << rol\n end\n end\n if unica(@asignacion_rol.usuario_id,@asignacion_rol.proyecto_id, @asignacion_rol.rol_id) == true\n\t respond_to do |format|\n\t if @asignacion_rol.save\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n \t\t descripcion: \"Creación asociación rol #{@asignacion_rol.rol.nombre} al usuario #{@asignacion_rol.usuario.nombreUsuario} del proyecto #{@asignacion_rol.proyecto.nombre} : actual = #{ t @asignacion_rol.esActual.to_s}\",\n \t\t sesion_id: sesion.id ,\n \t\t proyecto_id: @asignacion_rol.proyecto.id)\n\t\tformat.html {redirect_to :controller => 'asignacion_roles', :action => 'index',:proyecto_id => @asignacion_rol.proyecto.id } \n\t\tformat.json { render :show, status: :created, location: @asignacion_rol }\n\t else\n params[:usuario_id] = @asignacion_rol.usuario_id\n \t\tformat.html { render :new }\n \t\tformat.json { render json: @asignacion_rol.errors, status: :unprocessable_entity }\n\t end\n\t end\n else\n\t respond_to do |format|\n\t\t format.html { redirect_to :controller => 'asignacion_roles', :action => 'index', :proyecto_id => @asignacion_rol.proyecto.id\n\t\t flash[:danger] = 'El usuario ya se encuentra asignado' } \n\t end\n end\n end",
"def seguir(otro_usuario)\n\t\t# siguiendo << otro_usuario\n\t\trelaciones_activas.create(seguido_id: otro_usuario.id)\n\tend",
"def create\n @service = Service.new(service_params)\n @cuenta = AccountingAccount.new\n @name=@service.nombre \n @idp=@service.cuenta_padre\n respond_to do |format|\n if @service.save \n @cuenta.nombre=@name\n @cuenta.imputable=true\n @cuenta.cuenta=0\n @padres=AccountingAccount.find(@idp)\n @padre=@padres.parent_id\n @padre1=AccountingAccount.where(\"parent_id = ?\", @padre)\n @cuenta.ejercicio=@padres.ejercicio\n @cuenta.parent_id=@padre\n @contar=0;\n @padre1.each do |c|\n @contar = @contar + 1\n end\n @guarda=0\n if @contar < 10\n @padre1.each do |z|\n @guardado=z.grupo\n end\n @guarda=(@guardado*100)+(@guardado*10)+1 \n end\n if @contar>10 \n @contar2=0\n @padre1.each do |n|\n @contar2 = @contar2 + 1 \n if @contar == @contar2\n @guarda=n.grupo\n end\n end\n end\n @cuenta.grupo= @guarda + 1\n @cuenta.save\n format.html { redirect_to accounting_accounts_path, notice: 'El servicio ha sido agregada con exito' }\n format.json { render :show, status: :created, location: @service }\n else\n format.html { render :new }\n format.json { render json: @service.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tauthorize! :create, Postulacion\n @postulacion = Postulacion.new(postulacion_params)\n @postulacion.aceptado=false\n\n respond_to do |format|\n if @postulacion.save\n sesion= Sesion.find_by(usuario_id: current_usuario.id, fechaFin: nil)\n Transaccion.create!(\n\t\t descripcion: \"Creación de la Postulación al proyecto #{@postulacion.proyecto.nombre} del usuario #{@postulacion.usuario.nombreUsuario}: aceptado = #{t @postulacion.aceptado.to_s}\",\n\t\t sesion_id: sesion.id ,\n\t\t proyecto_id: @postulacion.proyecto.id)\n\tformat.html {redirect_to :controller => 'proyectos', :action => 'index'\n\t flash[:success] = 'Se ha registrado tu participación' } \n format.json { render :show, status: :created, location: @postulacion }\n else\n format.html { render :new }\n format.json { render json: @postulacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"def buscar_o_crear_titular(params)\n rep = Representante.where([\"LOWER(nombre) = ?\", params['NOMBRE DEL TITULAR'].downcase]).first\n pais = Pais.find_by_codigo(params['PAIS DEL TITULAR'])\n if rep\n if pais\n rep.pais_id = pais.id\n rep.pais_codigo = pais.codigo\n rep.pais_nombre = pais.nombre\n end\n rep.direccion = params['DIRECCION DEL TITULAR']\n rep.save(:validate => false)\n elsif !params['NOMBRE DEL TITULAR'].blank?\n rep = Representante.new(\n :nombre => params['NOMBRE DEL TITULAR'],\n :direccion => params['DIRECCION DEL TITULAR'],\n :cliente => false,\n :pais_id => pais.try(:id)\n )\n rep.save\n end\n rep.id\n end",
"def postulantes_por_genero\r\n puts \"-------------------------------------------------------------------------------------------------------------------------------------------------------------\"\r\n puts \"-------------------------------------------------------CANTIDAD DE HOMBRES Y MUJERES POSTULANTES-------------------------------------------------------------\"\r\n puts \"-------------------------------------------------------------------------------------------------------------------------------------------------------------\"\r\n begin\r\n alumnos1 = admin.cantidad_hombres_mujeres\r\n vista.mostrarMensaje(alumnos1)\r\n rescue RuntimeError => e\r\n error_handler(e)\r\n end\r\n menu_principal\r\n end",
"def create\n @imovel = Imovel.new(params[:imovel])\n \n @imovel.attributes = {:cadastrado_por_id => current_user.id} \n @imovel.attributes = {:ativo => true}\n \n if has_role?(current_user, 'corretor')\n @imovel.attributes = {:ativo => false}\n end\n \n gerar_codigo_referencia\n \n # arranjo temporario porque não tá cadastrando com nome quando é terreno\n if @imovel.imovel_tipo_id==4\n @imovel.attributes = {:nome => \"TERRENO LOCALIZADO: \"+@imovel.localizacao}\n end\n \n if @imovel.imovel_tipo_id==4\n @imovel.attributes = {:quartos => '0'}\n @imovel.attributes = {:suites => '0'}\n @imovel.attributes = {:vagas => '0'}\n @imovel.attributes = {:imovel_detalhe_ids => []}\n end\n \n respond_to do |format|\n if @imovel.save\n format.html { redirect_to @imovel, notice: 'Imovel foi cadastrado com sucesso.' }\n format.json { render json: @imovel, status: :created, location: @imovel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @imovel.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # valor = params[:pedido][:valor]\n # params[:pedido][:valor] = valor.split( ',').join('.')\n conta = Conta.find_by_cliente_id(params[:pedido][:cliente_id])\n @proteinas_disponiveis = Proteina.where(:disponibilidade => true)\n @acompanhamentos_disponiveis = Acompanhamento.where(:disponibilidade => true)\n @guarnicoes_disponiveis = Guarnicao.where(:disponibilidade => true)\n @saladas_disponiveis = Salada.where(:disponibilidade => true)\n @bebidas_disponiveis = Bebida.where(:disponibilidade => true)\n @sobremesas_disponiveis = Sobremesa.where(:disponibilidade => true)\n #descricao = \"\"\n @pedido = Pedido.new(pedido_params)\n @pedido.conta_id = conta.id.to_i\n # if @pedido.cliente.nil?\n # @pedido.cliente = Cliente.find(current_usuario.cliente.id)\n # @pedido.conta = Conta.find_by_cliente_id(current_usuario.id)\n # end\n # ENTRADAS #\n # acompanhamentos = params[:pedido][:acompanhamento_ids]\n # acompanhamentos.each do |id|\n # if !id.blank?\n # acompanhamento = Acompanhamento.find(id.to_i)\n # @pedido.pedidos_acompanhamentos.new(:acompanhamento_id => id)\n # #@pedido.acompanhamentos << acompanhamento\n # end\n # end\n ###### FINAL ENTRADAS ########\n acompanhamentos = Acompanhamento.where(:disponibilidade => true).count\n for i in 0...acompanhamentos do\n if !params[\"acompanhamento_#{i}\"].blank?\n @pedido.pedidos_acompanhamentos.new(:acompanhamento_id => params[\"acompanhamento_#{i}\"], :quantidade => params[\"quantidade_acompanhamento_#{i}\"])\n end\n end\n\n proteinas = Proteina.where(:disponibilidade => true).count\n for i in 0...proteinas do\n if !params[\"proteina_#{i}\"].blank?\n @pedido.pedidos_proteinas.new(:proteina_id => params[\"proteina_#{i}\"], :quantidade => params[\"quantidade_proteina_#{i}\"])\n end\n end\n\n guarnicoes = Guarnicao.where(:disponibilidade => true).count\n for i in 0...guarnicoes do\n if !params[\"guarnicao_#{i}\"].blank?\n @pedido.pedidos_guarnicoes.new(:guarnicao_id => params[\"guarnicao_#{i}\"], :quantidade => params[\"quantidade_guarnicao_#{i}\"])\n end\n end\n\n saladas = Salada.where(:disponibilidade => true).count\n for i in 0...saladas do\n if !params[\"salada_#{i}\"].blank?\n @pedido.pedidos_saladas.new(:salada_id => params[\"salada_#{i}\"], :quantidade => params[\"quantidade_salada_#{i}\"])\n end\n end\n\n bebidas = Bebida.where(:disponibilidade => true).count\n for i in 0...bebidas do\n if !params[\"bebida_#{i}\"].blank?\n @pedido.pedidos_bebidas.new(:bebida_id => params[\"bebida_#{i}\"], :quantidade => params[\"quantidade_bebida_#{i}\"])\n end\n end\n\n sobremesas = Sobremesa.where(:disponibilidade => true).count\n for i in 0...sobremesas do\n if !params[\"sobremesa_#{i}\"].blank?\n @pedido.pedidos_sobremesas.new(:sobremesa_id => params[\"sobremesa_#{i}\"], :quantidade => params[\"quantidade_sobremesa_#{i}\"])\n end\n end\n\n\n #@pedido.proteinas << Proteina.where(:nome => params[:proteina]).first\n\n # debugger\n # if !params[:arroz].nil?\n # descricao = \"Arroz \"+ params[:arroz] + \",\"\n # end\n # if params[:feijao] = \"Sim\"\n # descricao = descricao + \" Feijao, \"\n # end\n\n # if params[:farofa] == \"Sim\"\n # descricao = descricao + \" Farofa,\"\n # end\n\n # descricao = descricao + params[:proteina] + \", \" + params[:acompanhamento] + \" Salada: \"+ params[:salada]\n # @pedido.descricao = descricao\n # itens = params[:pedido][:item_de_pedidos_attributes]\n\n # if !itens.nil?\n # for i in 0..params[:pedido][:item_de_pedidos_attributes].count do\n # if itens[\"#{i}\"] != nil\n # if itens[\"#{i}\"][:produto_id].blank?\n # itens.delete(\"#{i}\")\n # end\n # else\n # itens.delete(\"#{i}\")\n # end\n # end\n # end\n # if !itens.blank?\n # @pedido.calcular_valor\n # else\n # @pedido.item_de_pedidos.destroy_all\n # @pedido.valor = 0\n # end\n # if !itens.nil?\n # params[:pedido][:item_de_pedidos_attributes].replace(itens)\n # end\n\n @pedido.situacao = \"Em processamento\"\n #parametros[:valor] = @pedido.valor\n\n respond_to do |format|\n if @pedido.save\n @pedido.calcular_valor\n @pedido.conta.calcular_saldo\n #@pedido.adicionar_conta\n #proteina = @pedido.proteina\n #proteina.decrescer\n format.html { redirect_to @pedido }\n format.json { render action: 'show', status: :created, location: @pedido }\n else\n format.html { render action: 'new' }\n format.json { render json: @pedido.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_nova_entidade\r\n\t\tif (Gosu::milliseconds - @ultimo_tempo ) / rand(20 ... 2500) == 1 \r\n\t\t\ttipo_proj = rand(0 ... Meteoros.length )\r\n\t\t\timg_size = Gosu::Image.new(Meteoros[rand(0 ... Meteoros.length )]).width\r\n\t\t\t@entidades << Projetil.new( rand(4 ... (Std_Width_Game-(2*img_size))) , 1, 0, Gosu::Image.new(Meteoros[tipo_proj]), rand(50 ... 300), Meteoros[tipo_proj])\r\n\t\t\t@ultimo_tempo = Gosu::milliseconds\r\n\t\tend\r\n\tend",
"def agregar_estudiante\n\t\t@seccion = \"Estudiantes\"\n @titulo = \"Agregar estudiante\"\n\tend",
"def create\n @usuario = Usuario.new(params[:usuario])\n @usuario.perfil = Perfil.where(\"nome=?\",\"Usuário\").first if @usuario.perfil.nil?\n #if @usuario.senha_flag.blank?\n @usuario.senha_segura = encrypt(@usuario.senha_flag,nil)\n #end\n if params[:peso_novo]\n if @usuario.peso.nil? || params[:peso_novo].to_f != @usuario.peso.peso\n @usuario.pesos << Peso.new(:data=>@usuario.peso.data,:peso=>@usuario.peso.peso) unless (@usuario.peso.nil? || params[:peso_novo].to_f == @usuario.peso.peso)\n # @usuario.peso.create(:peso=>params[:peso_novo],:data=>Date.current,:usuario=>@usuario)\n @usuario.peso = Peso.new(:peso=>params[:peso_novo],:data=>Date.current)\n end\n end\n \n respond_to do |format|\n if @usuario.save\n flash[:success] = \"Cadastro efetuado com sucesso, bem-vindo à Aliments\"\n flash[:subtitle] = \"Para iniciar efetue o login\"\n format.html { redirect_to(@usuario, :notice => 'Usuario was successfully created.') }\n format.xml { render :xml => @usuario, :status => :created, :location => @usuario }\n else\n flash[:error] = \"Não foi possível efetuar seu cadastro.\"\n flash[:subtitle] = \"Verifique os erros e tente novamente\"\n format.html { render :action => \"new\" }\n format.xml { render :xml => @usuario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @usuario_curso = UsuarioCurso.new(usuario_curso_params)\n @usuario_curso.nivel_id = 1\n respond_to do |format|\n if @usuario_curso.save\n ApplicationMailer.cadastro_curso(@usuario_curso).deliver \n format.html { redirect_to @usuario_curso, notice: 'Usuário cadastrado no Curso com sucesso!' }\n format.json { render :show, status: :created, location: @usuario_curso }\n else\n format.html { render :new, @current_usuario => current_usuario }\n format.json { render json: @usuario_curso.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_turno\n unless self.turno\n self.fecha ||= Time.now\n maximo = Audiencia.maximum(:turno, :conditions => [\"adscripcion_id = ? AND DATE(fechahora_atencion) = ?\", self.adscripcion_id, self.fechahora_atencion.strftime(\"%y/%m/%d'\")])\n STDOUT.puts \"Registro nuevo de Turno maximo: #{maximo}\"\n self.turno ||= (maximo && maximo > 0)? maximo + 1 : 1\n end\n end",
"def create\n Cabcompra.transaction do\n @cabcompra = Cabcompra.new(params[:cabcompra])\n @comprobante = Tipocomprobante.find(@cabcompra.tipocomprobante_id)\n if ((@comprobante.tcom_discriminaiva.to_s == 'No') || ((params[:rencompras][:rcom_netorenglon].nil?) || (params[:rencompras][:rcom_netorenglon][0].to_i > 0)))\n idplanilla = Cabcompra.maximum(:id, :conditions => [\"sucursal_id = ?\", session[:sucursal]]) \n @cabcompra.id = [idplanilla.to_i + 1, session[:sucursal]]\n # busco y grabo proveedor_id \n str_tokens = \"\"\n str_tokens = params[:proveedor][:prov_cuit].split(\"|\") if params[:proveedor]\n \n @proveedor = Proveedor.find(:first, :conditions => [\"sucursal_id = ? and prov_codigo = ? \", session[:sucursal], str_tokens[2].lstrip] ) if str_tokens[2] \n @cabcompra.proveedor_id = @proveedor.id[0] if str_tokens[2] \n $proveedor = @proveedor.id[0] if str_tokens[2] #para la validacion de proveedores 1 y 2\n @proveedor.prov_cuit = params[:proveedor][:prov_cuit].to_s if str_tokens[2] # por si vuelve con error\n @cabcompra.ccom_ultmod = DateTime.now\n @cabcompra.ccom_usuario = session[:user].usur_nombre\n @cabcompra.ccom_hastacompro = (params[:cabcompra][:ccom_hastacompro].nil? || params[:cabcompra][:ccom_hastacompro].to_i == 0) ? params[:cabcompra][:ccom_desdecompro] : params[:cabcompra][:ccom_hastacompro]\n str_tokens = @cabcompra.id.to_s.split(\",\") \n $plaegid = params[:cabcompra][:cabplaegreso_id]\n $sucursal = session[:sucursal]\n #graba compra o gasto segun el comprobante tenga o no iva\n if (params[:cabcompra][:ccom_iva].nil? || params[:cabcompra][:ccom_iva].to_d == 0 )\n @cabcompra.ccom_gastocompra = 'GASTO'\n else\n @cabcompra.ccom_gastocompra = 'COMPRA'\n end\n @cabcompra.ccom_gastocompra = 'COMPRA' if @comprobante.tcom_cabecera.to_s == 'S' #para los comprobantes de retenciones\n respond_to do |format|\n if @cabcompra.save\n if ((@comprobante.tcom_discriminaiva.to_s == 'Si') && (params[:rencompras][:rcom_netorenglon][0].to_d > 0) && @comprobante.tcom_cabecera.to_s == 'N') \n grabarenglonescompra()\n end\n \n flash[:notice] = 'El comprobante ha sido creado.'\n if @cabcompra.cabplaegreso_id > 0\n format.html { redirect_to(:controller => 'cabcompras', :action => 'index', :nrope => @cabcompra.ccom_nroplaegreso, :idpe => @cabcompra.cabplaegreso_id) }\n else\n format.html { redirect_to(:controller => 'cabcompras', :action => 'comprobantes', :id => 0) }\n end\n format.xml { render :xml => @cabcompra, :status => :created, :location => @cabcompra }\n else\n params[:idpe] = params[:cabcompra][:cabplaegreso_id]\n params[:nrope] = params[:cabcompra][:ccom_nroplaegreso]\n \n @alicuotaivas = Alicuotaiva.find(:all) \n @rencompra = Rencompra.new\n @jurisdiccions = Jurisdiccion.find(:all, :order =>\"juri_nombre\")\n @cabplaegreso = Cabplaegreso.find([params[:idpe], session[:sucursal]])\n @conceptoegresos = Conceptoegreso.find(:all, :order =>\"cegr_detalle\")\n @tipocomprobantes = Tipocomprobante.find(:all, :order =>\"tcom_nombre\")\n @iva = Tipocomprobante.find(@cabcompra.tipocomprobante_id) \n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @cabcompra.errors, :status => :unprocessable_entity }\n end\n end\n else\n render :text => \"<h7> El comprobante no se guardo porque no cargo ningun detalle (renglón) </h7>\", :layout => 'application' \n end\n end\n end",
"def create\n @certificado = Certificado.new(certificado_params)\n @certificado.system_id = Time.now.strftime '%Y%m%d%H%M%S'\n obtener_coleccion_coladas\n\n respond_to do |format|\n if @certificado.save\n format.html { redirect_to @certificado, notice: 'El certificado fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @certificado }\n else\n 6.times { @certificado.coladas.build }\n format.html { render :new }\n format.json { render json: @certificado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n if params[:token].blank?\n flash[:error] = \"Nu te poti loga cu un camp gol!\"\n render 'new' and return\n end\n\n i_user = IncognitoUser.find_by_token params[:token].strip\n if i_user\n # verifica daca e perioada de evaluare\n data_eval = i_user.grupa.data_evaluare.data\n unless Date.today.between? data_eval, data_eval + GossipLogin::DURATA_PERIOADA_EVALUARE - 1\n flash[:error] = \"Momentan nu puteti evalua nici un curs\"\n render 'new' and return\n end\n \n # mentinem utilizatorul\n session[:user_token] = {token: i_user.token, grupa: i_user.grupa_nume}\n\n\n sesiune = SesiuneActiva.find_by_incognito_user_token(i_user.token)\n if sesiune\n if sesiune.incepere_data > Time.now-600\n flash[:error] = \"Ne pare rau dar proprietarul token-ului este deja logat :D\"\n render 'new'\n else\n sesiune.update_attributes(incepere_data: Time.now)\n redirect_to verificare_path\n end\n else\n SesiuneActiva.create(incognito_user_token: i_user.token, incepere_data: Time.now)\n redirect_to verificare_path\n end\n\n else\n flash[:error] = \"Acel token e invalid....\"\n render 'new'\n end\n\n end",
"def create\n @solicitudrecurso = Solicitudrecurso.new\n @solicitudrecurso.tipo=params[:tipo]\n @solicitudrecurso.fechasol=Date.today\n @solicitudrecurso.horaini=params[:horai]\n @solicitudrecurso.horafin=params[:horaf]\n @solicitudrecurso.fechareserva=session[:fechares]\n @solicitudrecurso.usuario_id=session[:user_id]\n @solicitudrecurso.motivos=params[:motivos]\n nombrecomp = params[:usuario].to_s.split(', ')\n @solicitudrecurso.usuario_id = Usuario.where(\"nombre = :nombre and apellidos = :apellidos\", {:nombre => nombrecomp[1], :apellidos => nombrecomp[0]}).first.id\n \n \n if @solicitudrecurso.save\n familia=Recurso.find_by_identificador(@solicitudrecurso.tipo).descripcion\n @recs=Recurso.where( 'descripcion = ? and disponible = ?',familia,\"t\").to_a\n @ids=@recs.map {|r| r.identificador}\n #session[:fechares]=params[:fecha]\n dia=formato_europeo(session[:fechares])\n #alreves=session[:fechares].to_s.split('-')\n #dia=alreves[2]+\"-\"+alreves[1]+\"-\"+alreves[0]\n @reservas = Solicitudrecurso.where('tipo in (?) and fechareserva = ?', @ids,dia).to_a\n\n respond_to do |format|\n format.js\n end\n \n end\n \n\n end",
"def crear_mov_movimiento\n deudas_comp = com_compra.totales_por_comprobante\n build_mov_movimiento\n\n mov_movimiento.tipo_movimiento = MovMovimiento.tipo_movimientos[:egreso]\n mov_movimiento.hoja = hoja\n mov_movimiento.fecha = com_compra.fecha\n mov_movimiento.ciclo = com_compra.ciclo\n mov_movimiento.emp_clasificacion = com_compra.emp_clasificacion\n mov_movimiento.emp_cuentab = emp_cuentab\n mov_movimiento.concepto = concepto\n mov_movimiento.emp_proveedor = com_compra.emp_proveedor\n mov_movimiento.emp_locacion_id = deudas_comp[comprobante][3]\n mov_movimiento.factura = com_compra.factura\n mov_movimiento.comprobante = deudas_comp[comprobante][4]\n mov_movimiento.tipo_comprobante = deudas_comp[comprobante][5]\n\n # obtiene el porcentaje de pago que se hizo\n porc = monto / com_compra.suma_valores[emp_cuentab.moneda][:total]\n # calcula la cantidad en cada sección\n mov_movimiento.subtotal = com_compra.suma_valores[emp_cuentab.moneda][:subtotal] * porc\n mov_movimiento.iva = com_compra.suma_valores[emp_cuentab.moneda][:iva] * porc\n mov_movimiento.ieps = com_compra.suma_valores[emp_cuentab.moneda][:ieps] * porc\n mov_movimiento.total = monto\n\n #mov_movimiento.save\n end",
"def create\n obtener_datos()\n @ventum = current_user.ventum.new(cliente:@cliente, clave:@clave, fecha:@fecha, iva:@iva, subtotal:@preciofinal ,total:@totalcosto, descuentogeneral: @descglobal, distribuidor: @distribuidor, status: \"En proceso\")\n respond_to do |format|\n if(@ventum.save)\n salvar()\n format.html { redirect_to @ventum, notice: 'Venta almacenada exitosamente!.' }\n else\n format.html { redirect_to eventos_path, notice: 'Fallo el almacenamiento de la venta.' }\n end\n \n end\n end",
"def create\n \n @partecipanti_gruppo = PartecipantiGruppo.new()\n @partecipanti_gruppo.gruppo_id = params[:gruppo_id]\n @partecipanti_gruppo.user_id = current_user.id\n\n respond_to do |format|\n if @partecipanti_gruppo.save\n format.html { redirect_to @partecipanti_gruppo, notice: 'Partecipanti gruppo was successfully created.' }\n format.json { render json: @partecipanti_gruppo, status: :created, location: @partecipanti_gruppo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @partecipanti_gruppo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n if @alumno = User.find(session[:usuario]).grupo.last.alumno.length == 6\n flash[:notice] = \"El limite de alumnos es de 6 personas\"\n redirect_to(home_alumno_path) and return\n end\n\n\n if @alumno = User.find(session[:usuario]).grupo.last.alumno.where(:cedula => params[:alumno]['cedula']).length >0\n flash[:notice] = \"Ya registraste un alumno con esta cedula\"\n @alumno = Alumno.new(alumno_params)\n @__title = \"Crear nuevo alumno\"\n\n render 'new' and return\n end\n\n @alumno = User.find(session[:usuario]).grupo.last.alumno.new(alumno_params)\n\n respond_to do |format|\n if @alumno.save\n format.html { redirect_to grupos_path, notice: '#Nuevo alumno agregado al grupo' }\n format.json { render action: 'show', status: :created, location: @alumno }\n else\n format.html { render action: 'new' }\n format.json { render json: @alumno.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\tif CompetenceGroup.find_by_competence_id_and_alu_group_id(params[:competence_group][:competence_id],params[:competence_group][:alu_group_id])\n flash[:notice] = 'El grupo ya existe.'\n\t\t\t\tredirect_to :controller => 'competences' , :action => 'edit' , :id => params[:competence_group][:competence_id]\n\t\t\t\treturn\n\t\t\n\t\tend\n @competence_group = CompetenceGroup.new(cg_params)\n\n if @competence_group.save\n\t\t\t\t#assign works to all users of groups\t\t\n\t\t\t\t#TODO new method \t all students of group\n\t\tworktype = Work::TEST_TYPE\n\t\t@competence_group.competence.nodes.each do |n|\n\t\tnode_id = n.id\n\t\t@competence_group.alu_group.students.each do |s|\n\t\t\tif not Work.where(student_id: s.id, node_id: node_id)\n\t\t\t\tWork.new(:node_id => node_id , :initialpoints => params[:initialpoints], :student_id => s.id, :worktype => worktype).save\n\t\t\tend\n\t\t\t#successors\n\t\t\tnodes = Array.new\n\t\t\tgetNodesRecursive(Work::ASSIGNEDTOSTUDENT, s.id, node_id, nodes)\n\t\t\tnodes.each do |n|\n\t\t\t\tif not Work.where(student_id: s.id, node_id: n.id)\n\t\t\t\t\tWork.new(:node_id => n.id , :initialpoints => params[:initialpoints], :student_id => s.id, :worktype => worktype).save\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tend\n\t\n flash[:notice] = t('competencegroup_created_success') \n\t\t\t\tredirect_to :controller => 'competences' , :action => 'edit' , :id => @competence_group.competence_id\n else\n render :action => \"newAluGroup\" \n end\n end",
"def create\n cliente_id = params[:venda][:cliente_id]\n desconto = params[:venda][:desconto].to_f\n opcao_pgt = params[:opcaoPgt]\n @venda = Venda.new\n\n cont = 0\n erros = false\n if !params[:venda][:produto_id].nil?\n for produto in params[:venda][:produto_id]\n produto_existente = Produto.find(produto)\n preco_unitario = produto_existente.precoUnitario\n qtd = params[:venda][:quantidade][cont].to_i\n valor_venda = qtd * preco_unitario\n valor_venda *= (1 - (desconto/100))\n valor_venda = valor_venda.round(2)\n\n if opcao_pgt != \"Dinheiro\"\n num_cartao = params[:venda][:num_cartao]\n validade_cartao = params[:venda][:valid_cartao]\n codigo_cartao = params[:venda][:cvv_cartao]\n venda = Venda.new(cliente_id: cliente_id, produto_id: produto, quantidade: qtd, valorVenda: valor_venda, tipo_pgt: opcao_pgt,\n desconto: desconto, num_cartao: num_cartao, validade_cartao: validade_cartao, codigo_cartao: codigo_cartao)\n else\n venda = Venda.new(cliente_id: cliente_id, produto_id: produto, quantidade: qtd, valorVenda: valor_venda,\n tipo_pgt: opcao_pgt, desconto: desconto)\n end\n\n if !venda.save\n erros = true\n for msg in venda.errors.full_messages\n @venda.errors.add(:base, msg)\n end\n else\n produto_existente.qtd_estoque -= qtd\n produto_existente.save\n end\n cont+= 1\n end\n\n respond_to do |format|\n if erros\n format.html { render :new }\n else\n format.html { redirect_to lojas_url, notice: 'Venda realizada com sucesso!' }\n end\n end\n else\n respond_to do |format|\n format.html { render :new }\n end\n end\n end",
"def crear_paquetes_contratados\n @lis_packages = Sale::PackageQuotation.where(sale_quotation_id: self.sale_quotation_id)\n @lis_packages.each do |package|\n package.quantity.times do\n\n Payment::ContractedPackage.create(\n plan_id: self.id,\n colection_package_id: package.colection_package_id,\n price_contracted: package.colection_package.total_amount)\n\n contracted_package = Payment::ContractedPackage.last\n\n # Se crean los productos que se encuentran en los paquetes de una cotizacion\n # y se registran en productos contratados.\n Colection::PackageProduct.where(colection_package_id: package.colection_package_id).each do |product|\n product.quantity.times do\n Payment::ContractedProduct.create(\n plan_id: self.id,\n product_product_id: product.product_product_id,\n user_created_id: self.user_created_id,\n valid_until: Date.today + product.product_products.valid_days,\n payment_contracted_package_id: contracted_package.id)\n end\n end\n end\n end\n end",
"def new\n @permiso_pernocta = PermisoPernocta.new\n @id = PermisoPernocta.next_id\n @solicita = User.get_solicitante(current_user.id)\n @VoBo = User.get_jefe_area(current_user.id)\n @vehiculos = Vehiculo.get_area_vehiculos(current_user.id)\n end",
"def create\n authorize!(:edit, Heb412Gen::Plantillahcm)\n @plantillahcm = Heb412Gen::Plantillahcm.new(plantillahcm_params)\n if !@plantillahcm.nombremenu && @plantillahcm.ruta\n @plantillahcm.nombremenu = File.basename(@plantillahcm.ruta)\n end\n create_gen(@plantillahcm)\n end",
"def create\n @processo = Processo.new(params[:processo])\n\n @processo.usuario_id = current_user.id\n unauthorized! if cannot? :create, @processo\n\n @processo.comentarios.each do |comentario|\n comentario.usuario_id = current_user.id if comentario.new_record?\n end\n anterior = @processo.setor_id\n @processo.tramites.each do |tramite|\n if tramite.new_record?\n tramite.usuario_id = current_user.id\n end\n tramite.setor_id_anterior = anterior\n anterior = tramite.setor_id\n end\n\n @processo.anexos.each do |anexo|\n if anexo.new_record?\n anexo.usuario_id = current_user.id\n end\n end\n \n @processo.setor_id = current_setor.id\n\n if @processo.tramites.size == 0\n @processo.setor_id_atual = @processo.setor_id\n @processo.data_tramite = Date.today\n else\n @processo.setor_id_atual = @processo.tramites.last.setor_id\n end\n\n @processo.errors.clear\n respond_to do |format|\n if @processo.save\n format.html { redirect_to @processo, notice: 'O processo foi criado com sucesso' }\n format.json { render json: @processo, status: :created, location: @processo }\n else\n @processo.errors.each do |key, value|\n flash[key] = value\n end\n format.html { render action: \"new\" }\n format.json { render json: @processo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @administrator_menu_nivel0_menu_nivel1 = Administrator::MenuNivel0::MenuNivel1.new(administrator_menu_nivel0_menu_nivel1_params) \n @administrator_menu_nivel0_menu_nivel1.posicion = Administrator::MenuNivel0::MenuNivel1.where(administrator_menu_nivel0_id: @administrator_menu_nivel0_menu_nivel1.administrator_menu_nivel0_id).count + 1\n \n params[:administrator_menu_nivel0_menu_nivel1][:tipo] = true\n \n respond_to do |format|\n if @administrator_menu_nivel0_menu_nivel1.save\n opcionMenu = Administrator::MenuNivel0.find(@administrator_menu_nivel0_menu_nivel1.administrator_menu_nivel0_id)\n @administrator_menu_nivel0_menu_nivel1.enlace = cambiarEspacioxGiones \"#{opcionMenu.enlace}-#{@administrator_menu_nivel0_menu_nivel1.id.to_s}\"\n if @administrator_menu_nivel0_menu_nivel1.update(administrator_menu_nivel0_menu_nivel1_params)\n format.html { redirect_to administrator_menu_nivel0_menu_nivel1_path(@administrator_menu_nivel0_menu_nivel1), notice: 'la página fue creada exitosamente' }\n format.json { render :show, status: :created, location: @administrator_menu_nivel0_menu_nivel1 }\n else\n format.html { render :new }\n format.json { render json: @administrator_menu_nivel0_menu_nivel1.errors, status: :unprocessable_entity }\n end \n else\n format.html { render :new }\n format.json { render json: @administrator_menu_nivel0_menu_nivel1.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n if current_user.nil?\r\n redirect_to(log_in_path) and return\r\n end\r\n \r\n codigo = params[:codigo_alumno].to_i\r\n personavinculada = params[:asistencia][:persona_vinculada_id].to_i\r\n if codigo == 0\r\n flash[:notice] = 'Ingrese el codigo del alumno'\r\n render :new\r\n else\r\n if !AnioAlumno.find_by_anio_escolar_id_and_alumno_id(anio_escolar.id, codigo)\r\n flash[:notice] = \"El codigo #{codigo} no existe\"\r\n redirect_to(:new_asistencia) and return\r\n end\r\n \r\n @asistencias = Asistencia.por_alumno_fecha(anio_escolar.id, codigo, Date.current)\r\n \r\n ingreso = 0\r\n fecha_hora = Time.now\r\n salida = 0\r\n @asistencias.each do |asistencia|\r\n if asistencia.tipo_movimiento == 1\r\n ingreso = 1\r\n fecha_hora = asistencia.fecha_hora\r\n end\r\n if asistencia.tipo_movimiento == 2\r\n salida = 1\r\n end\r\n end\r\n movimiento = 0\r\n if ingreso == 0 && salida == 0\r\n movimiento = 1\r\n end\r\n if ingreso == 1 && salida == 0\r\n if (Time.now- fecha_hora) > 60\r\n movimiento = 2\r\n end\r\n end\r\n \r\n if movimiento == 2\r\n if Alumno.find(codigo).salida_con_persona == 1\r\n cargarpersonasvinculadas = 0\r\n if personavinculada == 0\r\n if @personasvinculadas.nil?\r\n cargarpersonasvinculadas = 1\r\n else\r\n cargarpersonasvinculadas = 1\r\n end\r\n else\r\n if AlumnoPersonaVinculada.find_by_alumno_id_and_persona_vinculada_id(codigo, personavinculada).nil?\r\n cargarpersonasvinculadas = 1\r\n end\r\n end\r\n if cargarpersonasvinculadas == 1\r\n @personasvinculadas = PersonaVinculada.vinculadas_a(codigo)\r\n flash[:notice] = 'Seleccione la persona que recoge al alumno'\r\n @nuevo = 0\r\n render :new\r\n return\r\n end\r\n end\r\n end\r\n \r\n if movimiento == 0\r\n if salida == 0\r\n flash[:notice] = 'Ha intentado registrar dos veces el ingreso'\r\n else\r\n flash[:notice] = 'Ha intentado registrar dos veces la salida'\r\n end\r\n render :new\r\n @nuevo = 1\r\n else\r\n if personavinculada == 0\r\n personavinculada = nil\r\n end\r\n @asistencia = Asistencia.new(\r\n :anio_alumno_id => AnioAlumno.find_by_anio_escolar_id_and_alumno_id(anio_escolar.id, codigo).id,\r\n :fecha_hora => Time.now,\r\n :usuario => current_user.usuario,\r\n :persona_vinculada_id => personavinculada,\r\n :tipo_movimiento => movimiento\r\n )\r\n if !@asistencia.save\r\n flash[:notice] = 'Ocurrio un error al registrar la asistencia'\r\n format.html { render action: \"new\" }\r\n else\r\n if @guardados.nil?\r\n @guardados = [@asistencia.id]\r\n else\r\n @guardados.push(@asistencia)\r\n end\r\n \r\n if movimiento == 1\r\n @notificar = AlumnoPersonaVinculada.notificar_ingreso(codigo)\r\n else\r\n @notificar = AlumnoPersonaVinculada.notificar_salida(codigo)\r\n end\r\n if !@notificar.empty?\r\n @notificar.each do |alumnopersona|\r\n @persona = PersonaVinculada.find(alumnopersona.persona_vinculada_id)\r\n @alumno = Alumno.find(codigo)\r\n AsistenciaMailer.delay.notificar_asistencia(movimiento, @alumno, @asistencia, @persona) ## Asincrono\r\n end\r\n end\r\n end\r\n redirect_to :controller => 'asistencias', :action => 'new' , :codigo_alumno => codigo\r\n end\r\n end\r\n end",
"def create\r\n @transferencia = Transferencia.new(transferencia_params)\r\n @transferencia.valor = dinheiro_fomatado params[:transferencia][:valor]\r\n set_conta_cliente(@transferencia.cliente_id)\r\n @transferencia.conta_id = Transferencia.checar_numero_conta(params[:transferencia][:numero])\r\n case @transferencia.tipo\r\n when 'transferência'\r\n retorno = Transferencia.valida_transferencia(session[:usuario_email], params[:usu][:senha])\r\n if retorno[:status] == 'falhou'\r\n respond_to do |format|\r\n flash[:alert] = retorno[:msn]\r\n format.html { render :new }\r\n end\r\n else\r\n salvar @transferencia, @cliente_autor\r\n end\r\n else\r\n salvar @transferencia, @cliente_autor\r\n end\r\n end",
"def create\n @foro = Foro.new(params[:foro])\n \n\t # params[:comentario][:created_at_admin]=Time.now.to_s\n # params[:comentario][:textoes]=@foro.textoes\n # params[:comentario][:tituloes]=@foro.tituloes\n # params[:comentario][:titulofr]=@foro.titulofr\n # params[:comentario][:usuarioforo_id]=Usuarioforo.where(\"email = :email AND femmes_id=:f_id\", {:email=>'ada.bazan@quartiersdumonde.org', :f_id=>@foro.femmes_id}).first.id\n # params[:comentario][:revisado]=1\n # params[:comentario][:revisado_fr]=1\n # params[:comentario][:textofr]=@foro.textofr\n # params[:comentario][:foro_id]=@foro.id\n # @comentario = Comentario.create(params[:comentario])\n \n \n respond_to do |format|\n if @foro.save\n ######################\n @comentario=@foro.comentarios.create\n @comentario.created_at=Time.now\n @comentario.tituloes=@foro.tituloes\n @comentario.titulofr=@foro.titulofr\n @comentario.textofr=@foro.descripcionfr\n @comentario.textoes=@foro.descripciones\n sitio=Sitio.where(\"id=:f_id\", {:f_id=>@foro.sitio_id}).first\n if(sitio.femmes_id==1) \n idSitio=1\n else\n idSitio=0\n end\n logger.info idSitio.to_s+\" __________________\"\n @comentario.usuarioforo_id=Usuarioforo.where(\"email = :email AND femmes_id=:f_id\", {:email=>'ada.bazan@quartiersdumonde.org', :f_id=>idSitio}).first.id\n @comentario.foro_id=@foro.id\n @comentario.save\n ###Añadir los campos que quieras \n ###########\n \n \n \n format.html { redirect_to(@foro, :notice => t('exito')) }\n format.xml { render :xml => @foro, :status => :created, :location => @foro }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @foro.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n logger.debug(\"Creando calabaza aa #{params[:deuda][:deuda_original_id]} #{params}\")\n @deuda = Deuda.new(params[:deuda])\n if(params[:deuda].has_key?(:deuda_original_id))\n logger.debug(\"Se slecciono deuda original\")\n if(@deuda.credito.present?)\n logger.debug(\"Estaba asociado con un credito\")\n @deuda.credito.deudas.delete(@deuda)\n end\n @deuda.credito_id=nil\n end\n\n respond_to do |format|\n if @deuda.save\n format.html { redirect_to @deuda, notice: 'Deuda was successfully created.' }\n format.json { render json: @deuda, status: :created, location: @deuda }\n else\n format.html { render action: \"new\" }\n format.json { render json: @deuda.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @clientes = Cliente.all\n @contactos = Cliente.all.order(:nombre).first.contactos\n @horarios = Horario.where(\"cliente_id = ?\", Cliente.all.order(:nombre).first.id)\n #@datosgenerale = Datosgenerale.new(datosgenerale_params)\n @datosgenerale.cliente_id = params[:datosgenerale][:cliente_id]\n\n @datosgenerale.contacto1_id = nil\n @datosgenerale.contacto2_id = nil\n @datosgenerale.contacto3_id = nil\n @datosgenerale.contacto4_id = nil\n @datosgenerale.contacto5_id = nil\n\n\n params[:datosgenerale][:contacto1_id].each_index { |i|\n case i\n when 1\n @datosgenerale.contacto1_id = params[:datosgenerale][:contacto1_id][i]\n when 2\n @datosgenerale.contacto2_id = params[:datosgenerale][:contacto1_id][i]\n when 3\n @datosgenerale.contacto3_id = params[:datosgenerale][:contacto1_id][i]\n when 4\n @datosgenerale.contacto4_id = params[:datosgenerale][:contacto1_id][i]\n when 5\n @datosgenerale.contacto5_id = params[:datosgenerale][:contacto1_id][i]\n else\n #do default case\n end\n\n }\n\n\n @datosgenerale.horario_id = params[:post][:horario_id]\n #@datosgenerale.alta = Date.strptime(params[:datosgenerale][:alta], '%m/%d/%Y')\n if(params[:datosgenerale][:tipocambio]=='1')\n @datosgenerale.tipocambio=true\n else\n @datosgenerale.tipocambio=false\n end\n\n respond_to do |format|\n if @datosgenerale.save\n format.html { redirect_to @datosgenerale, notice: 'Datosgenerale was successfully created.' }\n format.json { render action: 'show', status: :created, location: @datosgenerale }\n else\n format.html { render action: 'new', :layout => \"layout_2\"}\n format.json { render json: @datosgenerale.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @solicitudrecurso = Solicitudrecurso.new\n @solicitudrecurso.tipo=params[:tipo]\n @solicitudrecurso.fechasol=Date.today\n @solicitudrecurso.horaini=params[:horai]\n @solicitudrecurso.horafin=params[:horaf]\n @solicitudrecurso.fechareserva=session[:fechares]\n @solicitudrecurso.usuario_id=session[:user_id]\n @solicitudrecurso.motivos=params[:motivos]\n nombrecomp = params[:usuario][:identificador].to_s.split(', ')\n @solicitudrecurso.usuario_id = Usuario.find(:first, :conditions => \n [\"nombre = :nombre and apellidos = :apellidos\", {:nombre => nombrecomp[1], :apellidos => nombrecomp[0]}]).id\n \n \n if @solicitudrecurso.save\n familia=Recurso.find_by_identificador(@solicitudrecurso.tipo).descripcion\n @recs=Recurso.find(:all, :conditions => ['descripcion = ? and disponible = ?',familia,\"t\"])\n @ids=@recs.map {|r| r.identificador}\n #session[:fechares]=params[:fecha]\n dia=formato_europeo(session[:fechares])\n #alreves=session[:fechares].to_s.split('-')\n #dia=alreves[2]+\"-\"+alreves[1]+\"-\"+alreves[0]\n @reservas = Solicitudrecurso.find(:all, :conditions => ['tipo in (?) and fechareserva = ?', @ids,dia])\n\n render :update do |page|\n page.replace_html(:'reservas', :partial=>\"/solicitudrecursos/recurso_reservado\", :object=>@reservas)\n end\n end\n \n\n end",
"def create\n @analisisregistro = Analisisregistro.new(analisisregistro_params)\n cantidadAlmacenada = @analisisregistro.cantidad_almacenada\n cantidadDesechada = @analisisregistro.cantidad_desechada\n\n @analisisregistro.cantidad = cantidadAlmacenada + cantidadDesechada \n\n @almacenado = Almacenado.new\n @almacenado.cantidad = cantidadAlmacenada\n @almacenado.save\n @desechado = Desechado.new\n @desechado.cantidad = cantidadDesechada \n @desechado.save \n\n respond_to do |format|\n\n if @analisisregistro.save\n \n\n @etiqueta = Etiqueta.new\n\n etiquetaAnalisis = @analisisregistro.etiqueta.etiqueta\n idAnalisis = @analisisregistro.id\n idAnalisisString = idAnalisis.to_s\n\n @etiqueta.etiqueta = etiquetaAnalisis + idAnalisisString + \"-\"\n @etiqueta.formato_id = 2\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Análisis registrado exitosamente.' }\n format.json { render :show, status: :created, location: @analisisregistro }\n else\n format.html { render :new }\n format.json { render json: @analisisregistro.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"def create\n @comentario = current_user.comentarios.build(params[:comentario]) # Asigna solo si comentario asociado a current_user\n\n respond_to do |format|\n if @comentario.save\n format.html { redirect_to @comentario.site, notice: 'Comentario was successfully created.' }\n format.json { render json: @comentario.site, status: :created, location: @comentario }\n else\n format.html { render action: \"new\" }\n format.json { render json: @comentario.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n panne_params[:panne_status]='Non Résolue';\n panne_params[:tech_id]='1';\n @panne = current_user.created_pannes.build(panne_params)\n if @panne.save\n flash[:success] = \"Panne cree!\"\n redirect_to root_url\n else\n @action='new'\n render 'new'\n end\n \n end",
"def new_with_date\n @fecha = Date.parse(params[:date])\n @horarios = Horario.find_by_sql([\"select * from horarios where id not in (select horario_id as id from sesions where fecha = ?) and activo=1 group by hora,minutos order by hora,minutos,sala_id\", @fecha])\n @horario = Horario.find(params[:horario]) if params[:horario]\n @tipos_sesiones = Tiposesion.find(:all, :order => \"descripcion\")\n @tramite = (params[:id]) ? Tramite.find(params[:id]) : Tramite.new\n## @especialistas = User.find_by_sql([\"SELECT u.* FROM users u\n# inner join roles_users ru on u.id=ru.user_id\n# inner join roles r on ru.role_id=r.id\n# where r.name='ESPECIALISTAS' and\n# u.id not in (select mediador_id from sesions WHERE activa = 1 AND fecha = ? AND hora= ? AND minutos= ?) AND\n# u.id not in (select comediador_id from sesions WHERE activa = 1 AND fecha = ? AND hora= ? AND minutos= ?) ORDER BY u.nombre, u.paterno, u.materno#\", @fecha, @horario.hora, @horario.minutos, @fecha, @horario.hora, @horario.minutos ])\n\n @sesion = Sesion.new\n @sesion.fecha = @fecha\n @sesion.horario = @horario\n @fecha_hora_sesion = (@sesion.start_at) ? @sesion.start_at : nil\n #@especialistas = Role.find_by_name(\"ESPECIALISTAS\").usuarios_disponibles_sesiones(@fecha_hora_sesion)\n @mediadores = Role.find_by_name(\"ESPECIALISTAS\").usuarios_disponibles_sesiones_funcion(@fecha_hora_sesion, \"mediador\")\n @comediadores = Role.find_by_name(\"ESPECIALISTAS\").usuarios_disponibles_sesiones_funcion(@fecha_hora_sesion, \"comediador\")\n\n\n if current_user.has_role?(\"admindireccion\")\n render :partial => 'new_with_date', :layout => 'oficial'\n else\n flash[:notice] = \"No tiene privilegios, consulte al administrador del sistema\"\n render :action => \"home\"\n end\n\n\n @fecha = Date.parse(params[:date])\n @horarios = Horario.find_by_sql([\"select * from horarios where id not in (select horario_id as id from sesions where fecha = ?) and activo=1 group by hora,minutos order by hora,minutos,sala_id\", @fecha])\n @horario = Horario.find(params[:horario]) if params[:horario]\n @tipos_sesiones = Tiposesion.find(:all, :order => \"descripcion\")\n @tramite = (params[:id]) ? Tramite.find(params[:id]) : Tramite.new\n @especialistas = User.find_by_sql([\"SELECT u.* FROM users u\n inner join roles_users ru on u.id=ru.user_id\n inner join roles r on ru.role_id=r.id\n where r.name='ESPECIALISTAS' and\n u.id not in (select mediador_id from sesions WHERE activa = 1 AND fecha = ? AND hora= ? AND minutos= ?) AND\n u.id not in (select comediador_id from sesions WHERE activa = 1 AND fecha = ? AND hora= ? AND minutos= ?) ORDER BY u.nombre, u.paterno, u.materno\", @fecha, @horario.hora, @horario.minutos, @fecha, @horario.hora, @horario.minutos ])\n\n\n end",
"def crear\n @quienes_somos = QuienesSomo.new\nend",
"def create\n @requisito = Requisito.new(requisito_params)\n\t\tif current_usuario.asignacion_roles.where(esActual: true, id: Rol.where(nombre: \"Voluntario\"), proyecto: @requisito.actividad.proyecto) && current_usuario.asignacion_roles.where(esActual: true, proyecto: @requisito.actividad.proyecto).count == 1\n\t\t\traise CanCan::AccessDenied if !Requisito.accessible_by(current_ability, :create).include?(Requisito.all.where(actividad: @requisito.actividad).first)\n\t\telse\n\t\t\tauthorize! :create, Requisito\n\t\tend\n respond_to do |format|\n\t if @requisito.unico && @requisito.save\n\t format.html { redirect_to :action => 'new', :actividad_id => @requisito.actividad\n\t\t flash[:success] = 'Requisito fue creado satisfactoriamente.' }\n format.json { render :show, status: :created, location: @requisito }\n else\n\t flash[:danger] = 'Por favor ingrese alguna habilidad correcta'\n format.html { redirect_to :action => 'new', :actividad_id => params[:requisito][:actividad_id] }\n format.json { render json: @requisito.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n #get the current group of the logged in user\n #.where returns an array, even if there's only one value\n #In Ruby, the params function can access the path, the url params, or the body for the needed value\n group = current_user.groups.where(id: params[:group_id]).first\n #The .build method is a built in method of ruby where we can add to a collection without saving it just yet\n #So we're adding a new Chore to the chores collection in our postico db without saving it yet\n @v1_chore = group.chores.build(v1_chore_params)\n @v1_chore.completed = false\n @v1_chore.assigned = false\n @v1_chore.pending = false\n @v1_chore.groupname = group.name\n if @v1_chore.save\n render :create, status: :created\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n\n end\n end",
"def create\n @director_tesis_registro = current_user.director_tesis_registros.build(director_tesis_registro_params)\n\n if @director_tesis_registro.save\n flash[:success] = \"Su petición de registro de director de tesis ha sido creado!\"\n if current_user.tipos_usuario.tipo == \"Alumno\"\n redirect_to alumnos_path\n else\n redirect_to root_path\n end\n else\n flash[:alert] = \"Su petición de registro de director de tesis no pudo ser creada! Revise el formulario.\"\n render :new\n end\n end",
"def create\n espacio = \" \"\n @producto = current_user.productos.new(producto_params)\n ConfirmarMailer.confirmar(@producto).deliver\n respond_to do |format|\n if @producto.save\n\n @encuestadonado = Encuestadonado.new\n @encuestadonado_id = @producto_id\n @encuestadonado.emaildon=@current_user.email\n @encuestadonado.iddon=@current_user.id\n\n\n @encuestadonado.sededon=@current_user.sede\n @encuestadonado.carreradon=@current_user.carrera\n @encuestadonado.sexo=@current_user.sexo\n @encuestadonado.categoria=@producto.categoria\n @encuestadonado.publicacion=@producto.titulo\n @encuestadonado.nompro=@producto.nombre\n @encuestadonado.nombredon=@current_user.nombre + espacio + @current_user.paterno + espacio + @current_user.materno\n\n @encuestadonado.save\n @encuestasolicitante = Encuestasolicitante.new\n @encuestasolicitante.nombredon=@current_user.nombre + espacio + @current_user.paterno + espacio + @current_user.materno\n @encuestasolicitante_id = @producto_id\n @encuestasolicitante.categoria = @producto.categoria\n @encuestasolicitante.publicacion=@producto.titulo\n @encuestasolicitante.nompro=@producto.nombre\n @encuestasolicitante.save\n\n format.html { redirect_to @producto, notice: 'Producto was successfully created.' }\n format.json { render :show, status: :created, location: @producto }\n else\n format.html { render :new }\n format.json { render json: @producto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n \n ref = rand(999999999).to_s.center(9, rand(9).to_s);\n ent = 27035\n\n login = Login.new\n login.email = params[:clinic][:managerEmail]\n login.password = \"qwerty\"\n login.add_role :manager\n\n manager = Manager.new\n \n manager.mobilephone = params[:clinic][:mobilephone]\n\n packageType = params[:packageType]\n p = Package.find(packageType.to_i)\n idP = p.id\n tokenNum = p.n_appointments\n price = p.price\n \n\n packages_clinic = PackagesClinic.new\n packages_clinic.appointment_token = tokenNum\n packages_clinic.start_date = DateTime.now.to_date\n packages_clinic.week = 1\n packages_clinic.package_id = idP\n\n\n p = Payment.new\n timeNow = Time.new;\n p.creation_date = timeNow;\n p.due_date = Time.new.advance(:months => 1);\n p.payed = false;\n p.reference = ref\n p.value = price\n p.entity = ent\n\n\n @clinic = Clinic.new(params[:clinic])\n p.clinic_id = @clinic.id\n\n flag = true\n begin\n Payment.transaction do\n Manager.transaction do\n PackagesClinic.transaction do\n Clinic.transaction do\n Login.transaction do\n login.save\n manager.login_id = login.id\n @clinic.save\n packages_clinic.clinic_id = @clinic.id\n packages_clinic.save\n manager.clinic_id = @clinic.id\n manager.save\n p.save\n end\n end\n end\n end\n end\n rescue ActiveRecord::RecordInvalid => invalid\n flag = false\n end\n\n if flag == true\n respond_to do |format|\n UserMailer.send_email_manager(login.email.to_s,login.password.to_s,@clinic.name.to_s,ref.to_s, ent.to_s, price.to_s).deliver\n format.html { redirect_to @clinic, notice: 'Clinica criado com successo.' }\n end\n else\n respond_to do |format| \n format.html { render action: \"new\", notice: 'Clinica nao foi criado com successo' }\n end\n end\n end",
"def create\n @local_deportivo = LocalDeportivo.new(params[:local_deportivo]) \n \n if(usuario_logueado.rol==\"3\")\n @local_deportivo.estado = \"C\" \n else \n @local_deportivo.estado = \"T\"\n end \n \n @local_deportivo.usuario_id = usuario_logueado.id \n \n if @local_deportivo.save\n if(usuario_logueado.rol==\"3\")\n redirect_to root_url, :notice => \"Su local sido creado satisfactoriamente!\"\n else\n redirect_to root_url, :notice => \"Se ha registrado una solicitud de creacion de Local Deportivo. Esta pendiente de aprobacion por un Administrador\"\n end\n else\n respond_to do |format|\n format.html { render action: \"new\" }\n format.json { render json: @local_deportivo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new_asignar_cliente\n @usuario = Usuario.find(params[:format])\n @usuario.clientes.build\n @clientes = Usuario.where(:admin => 0)\n end",
"def create\n @levels = levels\n @user = User.new(user_params)\n \n if (!current_user)\n @user.tipo = 4\n end\n\n if (current_user)\n if (((current_user.tipo.eql? 2) or (current_user.tipo.eql? 3)) && (@user.tipo.eql? 4))\n elsif (current_user.tipo.eql? 1)\n @user.entidade_id = @user.entidade_id\n else\n @user.entidade_id = current_user.entidade_id\n end\n end\n @user.status = 1\n\n respond_to do |format|\n if @user.save\n if (params[:modal])\n format.html { redirect_to '/reservas/new', notice: 'Usuário foi criado com sucesso.' }\n else\n format.html { redirect_to users_url, notice: 'Usuário foi criado com sucesso.' }\n end\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: '{\"msg\":\"Este já tem cadastro!\"}', status: :unprocessable_entity }\n end\n end\n end",
"def create\n @protocolo = Protocolo.new(protocolo_params)\n @protocolo.usuario_id = current_user.id\n if Protocolo.all.count == 0\n @protocolo.codigo_protocolo = 1\n else\n lastprotocolo = Protocolo.last!\n if lastprotocolo.created_at.year < Date.today.year\n @protocolo.codigo_protocolo = 1\n addlog(\"Ano renovado\")\n else\n @protocolo.codigo_protocolo = lastprotocolo.codigo_protocolo + 1\n end\n end\n @protocolo.ano = Date.today.year\n @protocolo.dt_expedicao = Date.today\n\n respond_to do |format|\n if @protocolo.save\n addlog(\"Protocolo criado\")\n format.html { redirect_to @protocolo, notice: 'Protocolo foi criado.' }\n format.json { render :show, status: :created, location: @protocolo }\n else\n format.html { render :new }\n format.json { render json: @protocolo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n @inscripcion_diplomado = InscripcionDiplomado.new(inscripcion_diplomado_params)\n grupo_id = GruposDiplomado.find_by(diplomado_id: @inscripcion_diplomado.diplomado_id).id\n @inscripcion_diplomado.grupos_diplomado_id = grupo_id\n # Se calcula el número de módulos que tiene el diplomado al que se inscribe\n # el usuario para crear ese mismo número de campos de calificación.\n #modulos = inscripcion_diplomado.grupos_diplomado.numero_modulos\n modulos = ModuloDiplomado.where(diplomado_id: @inscripcion_diplomado.diplomado_id)\n\n respond_to do |format|\n if @inscripcion_diplomado.save\n # Se guardan al mismo tiempo los datos de la inscripción y el número de\n # espacios de calificación para ese usuario.\n modulos.each do |modulo|\n CalificacionModulo.create(calificacion: \"\", inscripcion_diplomado_id: @inscripcion_diplomado.id,\n instructor_id: modulo.instructor_id, numero_modulo: modulo.numero_modulo, asistencia: \"\")\n end\n format.html { redirect_to new_inscripcion_diplomado_path, notice: 'La inscripción al diplomado fue creada correctamente.' }\n format.json { render :show, status: :created, location: @inscripcion_diplomado }\n else\n format.html { render :new }\n format.json { render json: @inscripcion_diplomado.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n if params[:cliente_id] == \"\"\n @pessoa = Pessoa.new(pessoa_params)\n if params[:senha] == \"\"\n @password = SecureRandom.random_number(99999999)\n else\n @password = params[:senha]\n end\n\n @user = User.new\n @user.email = @pessoa.email\n @user.password = @password\n @user.password_confirmation = @password\n if current_user.id == 1\n @user.empresa_id = current_user.empresa_id\n #@user.role = \"ADMIN\"\n else\n @user.empresa_id = 1\n #@user.role = \"USER\"\n end\n\n @user.role = \"USER\"\n\n respond_to do |format|\n if @pessoa.save\n #criando usuário\n @user.pessoa_id = @pessoa.id\n if @user.save\n Userinfo.send_email(@user,current_user.empresa.nome_empresa).deliver\n end\n #relacionando usuário com empresa\n Clienteempresa.create(:empresa_id => current_user.empresa_id, :pessoa_id => @pessoa.id)\n format.html { redirect_to @pessoa, notice: 'Cadastro realizado com sucesso!.' }\n format.json { render :show, status: :created, location: @pessoa }\n else\n format.html { render :new }\n format.json { render json: @pessoa.errors, status: :unprocessable_entity }\n end\n end\n else\n Clienteempresa.create(:empresa_id => current_user.empresa_id, :pessoa_id => params[:cliente_id])\n respond_to do |format|\n format.html { redirect_to pessoas_url, notice: 'Cadastro realizado com sucesso!' }\n format.json { head :no_content }\n end\n end\n\n end",
"def create\n @sessao = Sessao.new(sessao_params)\n psicologos_for_select\n pacientes_for_select\n respond_to do |format|\n @sessao.user = current_user\n if @sessao.save\n format.html { redirect_to @sessao, notice: \"Sessao was successfully created.\" }\n format.json { render :show, status: :created, location: @sessao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @sessao.errors, status: :unprocessable_entity }\n end\n end\n end",
"def gera_posicao\n r = 0\n i = nil\n while 1\n r = rand(2**30 - 1)\n next if r.zero?\n break unless Eleitor.exists?(r)\n end\n self.numero = r\n end",
"def create\n @trabajo = Trabajo.find(params[:trabajo_id])\n presupuestos_de_proveedor = @trabajo.presupuestos.where(:proveedor_id => current_proveedor.perfilable_id).size\n if presupuestos_de_proveedor > 0\n flash[:warning] = \"Ya has presentado un presupuesto para esta solicitud.\"\n redirect_to @trabajo\n return\n end\n \n @presupuesto = @trabajo.presupuestos.build(params[:presupuesto])\n @presupuesto.proveedor_id = current_proveedor.perfilable_id\n \n @path = [@trabajo, @presupuesto]\n @es_el_proveedor = false\n if proveedor_signed_in?\n @es_el_proveedor = @presupuesto.proveedor_id.eql?(current_proveedor.perfilable_id)\n end\n respond_to do |format|\n if @presupuesto.save\n TtpMailer.notificar_presupuesto_recibido(@trabajo,@presupuesto)\n flash[:success] = \"Presupuesto enviado satisfactoriamente.\"\n format.html { redirect_to @presupuesto }\n format.json { render json: @presupuesto, status: :created, location: @presupuesto }\n else\n flash[:error] = \"Ocurrió un error. Revisa el formulario.\"\n format.html { render action: \"new\" }\n format.json { render json: @presupuesto.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n flaggravaprof = 1\n @temposervico = TempoServico.new(params[:tempo_servico])\n # @titulo_professor = TituloProfessor.new(params[:titulo_professor])\n\n# def salva_dados\n @temposervico.ano_letivo = Time.current.strftime(\"%Y\").to_i\n @temposervico.ano1 = (Time.current.strftime(\"%Y\").to_i)-1\n @temposervico.ano2 = Time.current.strftime(\"%Y\").to_i\n @temposervico.dias_rede1 = @temposervico.dias1\n @temposervico.dias_rede2 = @temposervico.dias2\n #somatoria1 = @temposervico.f_abonada1 + @temposervico.f_atestado1 + @temposervico.f_justif1 + @temposervico.f_injustif1 + @temposervico.lic_saude1 + @temposervico.afastamento1 + @temposervico.outras_aus1\n #somatoria2 = @temposervico.f_abonada2 + @temposervico.f_atestado2 + @temposervico.f_justif2 + @temposervico.f_injustif2 + @temposervico.lic_saude2 + @temposervico.afastamento2 + @temposervico.outras_aus2\n somatoria1 = @temposervico.f_abonada1 + @temposervico.f_atestado1 + @temposervico.lic_saude1+ @temposervico.outras_aus1\n somatoria2 = @temposervico.f_abonada2 + @temposervico.f_atestado2 + @temposervico.lic_saude2 + @temposervico.outras_aus2\n\n somatoriaTotal = somatoria1+somatoria2\n if somatoriaTotal > 15\n @temposervico.dias_trab1 = (@temposervico.dias1 - (@temposervico.f_abonada1 + @temposervico.f_atestado1 + @temposervico.f_justif1 + @temposervico.f_injustif1 + @temposervico.lic_saude1 + @temposervico.afastamento1 + @temposervico.outras_aus1))\n # self.dias_efetivos1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 + self.outras_aus1))alterado por solicitação da Alessanda 7/12/2016\n @temposervico.dias_efetivos1 = (@temposervico.dias1 - (@temposervico.f_abonada1 + @temposervico.f_atestado1 + @temposervico.f_justif1 + @temposervico.f_injustif1 + @temposervico.lic_saude1 + @temposervico.afastamento1 ))\n else\n #@temposervico.dias_trab1 = (@temposervico.dias1 - (@temposervico.f_justif1 + @temposervico.f_injustif1))\n ## + @temposervico.afastamento1 foi substituido por - @temposervico.afastamento1 em 2019\n w1=@temposervico.dias_trab1 = (@temposervico.dias1 - (@temposervico.f_justif1 + @temposervico.f_injustif1) - @temposervico.afastamento1)\n #self.dias_efetivos1 = (self.dias1 - (self.f_abonada1 + self.f_atestado1 + self.f_justif1 + self.f_injustif1 + self.lic_saude1 + self.afastamento1 + self.outras_aus1))alterado por solicitação da Alessanda 7/12/2016\n w11=@temposervico.dias_efetivos1 = (@temposervico.dias1 - (@temposervico.f_abonada1 + @temposervico.f_atestado1 + @temposervico.f_justif1 + @temposervico.f_injustif1 + @temposervico.lic_saude1 + @temposervico.afastamento1))\n end\n if somatoriaTotal > 15\n @temposervico.dias_trab2 = (@temposervico.dias2 - (@temposervico.f_abonada2 + @temposervico.f_atestado2 + @temposervico.f_justif2 + @temposervico.f_injustif2 + @temposervico.lic_saude2 + @temposervico.afastamento2 + @temposervico.outras_aus2))\n #self.dias_efetivos2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2 + self.outras_aus2))alterado por solicitação da Alessanda 7/12/2016\n @temposervico.dias_efetivos2 = (@temposervico.dias2 - (@temposervico.f_abonada2 + @temposervico.f_atestado2 + @temposervico.f_justif2 + @temposervico.f_injustif2 + @temposervico.lic_saude2 + @temposervico.afastamento2))\n else\n #@temposervico.dias_trab2 = (@temposervico.dias2 - (@temposervico.f_justif2 + @temposervico.f_injustif2))\n ## + @temposervico.afastamento2 foi substituido por - @temposervico.afastamento2 em 2019\n w2=@temposervico.dias_trab2 = (@temposervico.dias2 - (@temposervico.f_justif2 + @temposervico.f_injustif2)- @temposervico.afastamento2)\n #self.dias_efetivos2 = (self.dias2 - (self.f_abonada2 + self.f_atestado2 + self.f_justif2 + self.f_injustif2 + self.lic_saude2 + self.afastamento2 + self.outras_aus2))alterado por solicitação da Alessanda 7/12/2016\n w22=@temposervico.dias_efetivos2 = (@temposervico.dias2 - (@temposervico.f_abonada2 + @temposervico.f_atestado2 + @temposervico.f_justif2 + @temposervico.f_injustif2 + @temposervico.lic_saude2 + @temposervico.afastamento2))\n end\n @temposervico.subtot_dias = @temposervico.dias_trab1 + @temposervico.dias_trab2\n @temposervico.subtot_efetivo = @temposervico.dias_efetivos1 + @temposervico.dias_efetivos2\n @temposervico.subtot_rede = @temposervico.dias_rede1 + @temposervico.dias_rede2\n @temposervico.subtot_unid = @temposervico.dias_unidade1 + @temposervico.dias_unidade2\n\n\n#def pontuacao_anterior\n professor_id = @temposervico.professor_id\n diasts =0\n efetivots=0\n redets=0\n unidts=0\n anoanteiror = ((Time.current.strftime(\"%Y\").to_i)-1)\n @total_anterior = TempoServico.find(:all , :conditions => ['professor_id =? and ano_letivo = ?',professor_id, anoanteiror])\n\n\n if ((@total_anterior.nil?) or (@total_anterior.empty?))\n @temposervico.total_ant_dias= 0\n @temposervico.total_ant_efetivo= 0\n @temposervico.total_ant_rede= 0\n if (Time.current.strftime(\"%Y\").to_i)< (Time.now.year)\n @temposervico.total_ant_unid= 0\n end\n else\n @total_anterior.each do |tp|\n diasts = tp.total_dias\n efetivots = tp.total_efetivo\n redets = tp.total_rede\n if (Time.current.strftime(\"%Y\").to_i)< (Time.now.year)\n unidts = tp.total_unid\n end\n end\n\n @temposervico.total_ant_dias= diasts\n @temposervico.total_ant_efetivo= efetivots\n @temposervico.total_ant_rede= redets\n @temposervico.total_ant_unid= unidts\n\n\n a1=@temposervico.total_ant_dias\n a2=@temposervico.total_ant_efetivo\n a3=@temposervico.total_ant_rede\n a4=@temposervico.total_ant_unid\n\n end\n\n\n\n# def total_geral\n\n @temposervico.total_efetivo= ((@temposervico.dias_efetivos1 + @temposervico.dias_efetivos2) * 10) + @temposervico.total_ant_efetivo\n\n @temposervico.total_dias\n @temposervico.total_dias= ((@temposervico.dias_trab1 + @temposervico.dias_trab2 ) * 2)+ @temposervico.total_ant_dias\n @temposervico.total_dias\n @temposervico.total_rede= ((@temposervico.dias_rede1 + @temposervico.dias_rede2) * 1) + @temposervico.total_ant_rede\n if (Time.current.strftime(\"%Y\").to_i)< (Time.now.year)\n @temposervico.total_unid= (@temposervico.total_ant_unid + @temposervico.dias_unidade1 + @temposervico.dias_unidade2) * 2\n end\n \n # def geral\n if (Time.current.strftime(\"%Y\").to_i)< (Time.now.year)\n @temposervico.total_geral_tempo_servico = @temposervico.total_dias + @temposervico.total_efetivo + @temposervico.total_rede + @temposervico.total_unid\n else\n @temposervico.total_geral_tempo_servico = @temposervico.total_dias + @temposervico.total_efetivo + @temposervico.total_rede\n end\n\n#def total_pontuacao\n ano = Time.current.strftime(\"%Y\").to_i\n professor =@temposervico.professor_id\n #@tp = TituloProfessor.all(:joins => \"inner join titulacaos on titulo_professors.titulo_id = titulacaos.id\", :conditions =>[\"titulo_professors.professor_id =? and ano_letivo = ? \", $teacher,$ano] )\n #@tp = TituloProfessor.find_by_sql(\"SELECT * FROM titulo_professors tp inner join titulacaos t on tp.titulo_id=t.id where tp.professor_id=\" + ($teacher).to_s + \" and tp.ano_letivo=\"+($ano).to_s )\n @tp = TituloProfessor.find_by_sql(\"SELECT * FROM titulo_professors tp inner join titulacaos t on tp.titulo_id=t.id where tp.professor_id=\" + (professor).to_s + \" and t.tipo = 'PERMANENTE'\")\n @tp1 = TituloProfessor.find_by_sql(\"SELECT * FROM titulo_professors tp inner join titulacaos t on tp.titulo_id=t.id where tp.professor_id=\" + (professor).to_s + \" and t.tipo = 'ANUAL'\" +\" and tp.ano_letivo=\"+(ano).to_s )\n\n if @tp.empty?\n pontostituloP=0\n else\n @tp.each do |tp|\n pontostituloP= (tp.total_permanente)\n end\n end\n if @tp1.empty?\n pontostituloA=0\n else\n @tp1.each do |tp|\n pontostituloA= (tp.total_anual)\n end\n end\n geral_titulo = (pontostituloA+pontostituloP)\n pontuacao_geral = @temposervico.total_geral_tempo_servico + geral_titulo\n \n if session[:altera_tabelas] != 1\n @temposervico.pontuacao_geral = geral_titulo+ @temposervico.total_geral_tempo_servico\n end\n\n\n\n\n# def atualiza_pontos_tabela_professor\n \n @professor= Professor.find(@temposervico.professor_id)\n @professor.total_trabalhado= @temposervico.total_geral_tempo_servico\n @professor.pontuacao_final= geral_titulo + @temposervico.total_geral_tempo_servico\n\n @professor.save\n\n\n\n\n\n\n respond_to do |format|\n if @temposervico.save\n flash[:notice] = 'CADASTRADO COM SUCESSO.'\n format.html { redirect_to(@temposervico) }\n format.xml { render :xml => @temposervico, :status => :created, :location => @temposervico }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @temposervico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def crear_tema\n f = page_of :foro\n @tema = f.children.build(:title => params[:title], :state => 'locked', :mime => 'tema')\n add_response(@tema, params[:name], params[:text])\n if @tema.save\n @nota = \"Tu tema '#{@tema.title}' aparecerá próximamente publicado en el foro.\"\n render :action => 'waiting'\n else\n @error = \"Lo siento, no se ha podido crear el tema. Vuelve a intentarlo dentro de unos minutos\"\n render :action => 'error'\n end\n end",
"def create\n @grua = Grua.new(grua_params)\n @grua.dicc_mantenciones = @grua.set_dicc_mantenciones(@grua.tipo, @grua.horometro)\n\n if @grua.tipo == \"Eléctrica\"\n @grua.mantenciones = [6000, 2000, 1000, 250]\n elsif @grua.tipo == \"Gas\"\n @grua.mantenciones = [2800, 1400, 700, 350]\n elsif @grua.tipo == \"Apilador\"\n @grua.mantenciones = [2000, 1000, 500]\n else @grua.mantenciones = []\n end\n\n respond_to do |format|\n if @grua.save\n format.html { redirect_to @grua, notice: 'Grua creada exitosamente.' }\n format.json { render :show, status: :created, location: @grua }\n else\n format.html { render :new }\n format.json { render json: @grua.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @accounting_account = AccountingAccount.new(accounting_account_params)\n @servicio = Service.new\n respond_to do |format|\n if @accounting_account.save\n ##########################################################\n x=@accounting_account.grupo\n if x<9\n @accounting_account.parent_id=@accounting_account.grupo\n @accounting_account.save\n ############################################################3\n @servicio.nombre=@accounting_account.nombre\n @servicio.descripcion=\"Debe ser agregada\" \n end\n if x>9\n cal=x/100\n @accounting_account.parent_id=cal\n @accounting_account.save\n ############################################################3\n @servicio.nombre=@accounting_account.nombre\n @servicio.descripcion=\"Debe ser agregada\"\n @servicio.save\n @padre1=AccountingAccount.where(\"parent_id = ?\", cal)\n @contar2=0\n @padre1.each do |n| \n if @contar2 == 0\n @guarda=n.id\n end\n @contar2 = @contar2 + 1\n end\n @servicio.cuenta_padre=@guarda\n @servicio.precio=0\n @servicio.save\n end\n \n ##########################################################\n\n account_year = AccountingYear.find(@accounting_account.ejercicio)\n account_plan = account_year.account_plan_id\n cuentas_x_plan = AccountXPlan.new\n cuentas_x_plan.account_plan_id=account_plan\n cuentas_x_plan.accounting_account_id=@accounting_account.id\n cuentas_x_plan.cuenta_superior=@accounting_account.grupo\n cuentas_x_plan.save \n @servicio.save \n format.html { redirect_to accounting_accounts_path, notice: 'La cuenta ha sido agregada con exito' }\n format.json { render :show, status: :created, location: @accounting_account }\n else\n format.html { render :new }\n format.json { render json: @accounting_account.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @subgrupo = Subgrupo.new(params[:subgrupo])\n @subgrupo.empresa = session[:usuario].empresa\n respond_to do |format|\n if @subgrupo.save\n format.html { redirect_to @subgrupo, notice: 'Subgrupo was successfully created.' }\n format.json { render json: @subgrupo, status: :created, location: @subgrupo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @subgrupo.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @pasteurizacion = Pasteurizacion.new(pasteurizacion_params)\n\n cantidadAlmacenada = @pasteurizacion.cantidad_almacenada\n cantidadDesechada = @pasteurizacion.cantidad_desechada\n\n @pasteurizacion.cantidad = cantidadAlmacenada + cantidadDesechada\n\n @almacenado = Almacenado.new\n @almacenado.cantidad = cantidadAlmacenada\n @almacenado.save\n @desechado = Desechado.new\n @desechado.cantidad = cantidadDesechada \n @desechado.save \n\n respond_to do |format|\n if @pasteurizacion.save\n\n @etiqueta = Etiqueta.new\n\n etiquetaPasteurizacion = @pasteurizacion.etiqueta.etiqueta\n idPasteurizacion = @pasteurizacion.id\n idPasteurizacionString = idPasteurizacion.to_s\n\n @etiqueta.etiqueta = etiquetaPasteurizacion + idPasteurizacionString + \"-\"\n @etiqueta.formato_id = 3\n @etiqueta.save\n\n format.html { redirect_to etiqueta_mostrar_path(@etiqueta.id), notice: 'Pasteurización registrada exitosamente.' }\n end\n end\n end",
"def create\n @ventas_seguimiento = Ventas::Seguimiento.new(params[:ventas_seguimiento])\n @ventas_seguimiento.usuario = current_user.name\n @ventas_seguimiento.user = current_user\n\n respond_to do |format|\n if @ventas_seguimiento.save\n format.html { redirect_to @ventas_seguimiento, notice: 'Seguimiento was successfully created.' }\n format.json { render json: @ventas_seguimiento, status: :created, location: @ventas_seguimiento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ventas_seguimiento.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @formulario = Formulario.new(formulario_params)\n @formulario.email = current_user.email\n @formulario.status = \"Pendente\"\n #respond_to do |format|\n # if @formulario.save\n # format.html { redirect_to @formulario, notice: 'Formulario was successfully created.' }\n # format.json { render :show, status: :created, location: @formulario }\n # else\n # format.html { render :new }\n # format.json { render json: @formulario.errors, status: :unprocessable_entity }\n # end\n #end\n manipulacaoControle(@formulario, @formulario.save, 'Formulario', 'created.', :created, :new)\n end",
"def create\n\n @empresa = Empresa.find(:first, :conditions => [\"prefijo = ?\", params[:empresa_id]])\n \n @gtin = params[:gtin] if params[:gtin] != ''\n\n\n params[:producto][:gtin] = Producto.crear_gtin(params[:producto][:id_tipo_gtin], params[:empresa_id], params[:gtin], params[:producto][:codigo_prod]) \n params[:producto][:fecha_creacion] = Time.now\n params[:producto][:id_estatus] = 3\n \n # Se asigna el codigo de producto\n\n params[:producto][:codigo_prod] = params[:producto][:gtin][7..11] if params[:producto][:id_tipo_gtin] == '3' and (@empresa.prefijo.to_s.size == 7 or @empresa.prefijo.to_s.size == 5)\n params[:producto][:codigo_prod] = params[:producto][:gtin][9..11] if params[:producto][:id_tipo_gtin] == '3' and @empresa.prefijo.to_s.size == 9 and @empresa.prefijo.to_s[3..5] == \"400\"\n params[:producto][:codigo_prod] = params[:producto][:gtin][3..6] if params[:producto][:id_tipo_gtin] == '1'\n params[:producto][:codigo_prod] = params[:producto][:gtin][9..12] if params[:producto][:id_tipo_gtin] == '4' \n params[:producto][:codigo_prod] = params[:producto][:gtin][8..12] if params[:producto][:id_tipo_gtin] == '5' # GTIN 14 base 12 \n params[:producto][:codigo_prod] = params[:producto][:gtin][8..12] if params[:producto][:id_tipo_gtin] == '6' and (@empresa.prefijo.to_s.size == 7 or @empresa.prefijo.to_s.size == 5)\n params[:producto][:codigo_prod] = params[:producto][:gtin][10..12] if params[:producto][:id_tipo_gtin] == '6' and @empresa.prefijo.to_s.size == 9 and @empresa.prefijo.to_s[3..5] == \"400\"\n\n params[:producto][:prefijo] = params[:empresa_id]\n\n @producto = Producto.new(params[:producto])\n\n respond_to do |format|\n if @producto.save\n\n Auditoria.registrar_evento(session[:usuario],\"producto\", \"Crear\", Time.now, \"GTIN:#{@producto.gtin} DESCRIPCION:#{@producto.descripcion} TIPO GTIN:#{@producto.tipo_gtin.tipo}\")\n format.html { redirect_to empresa_productos_path, notice: \"EL #{@producto.tipo_gtin.tipo} #{@producto.gtin} fue creado correctamente.\" } \n\n else\n format.html { \n render action: \"new\" } \n end\n end\n end",
"def create\n @pago = Pago.new(pago_params)\n @pagoPendAplicar = @pago.pago_valor\n case @pago.pago_tipoProducto\n when \"RESERVA\"\n reserva = Reserva.where(\"rsrv_codigo = '#{@pago.pago_productoId}'\").take\n detallesReserva = DetalleReserva.where(\"reserva_id = ? AND detRsrv_estadoReserva IN ('I', 'P')\" ,reserva.id)\n @parentPath = \"/reservas/\" + reserva.id.to_s\n if reserva.rsrv_tipoProducto == \"VUELO\" then\n tarifasViaje = tarifas_viaje(reserva.rsrv_productoId, reserva.rsrv_trayectoViaje)\n if tarifasViaje.viaje_tarifas.blank?\n detallesReserva.each do |h|\n if @pagoPendAplicar > 0 then\n h.detRsrv_tarifaCodigo = \"BASE\"\n h.detRsrv_estadoReserva = \"C\"\n if @pagoPendAplicar > tarifasViaje.trf_base then\n h.detRsrv_valor = tarifasViaje.trf_base \n @pagoPendAplicar = @pagoPendAplicar - tarifasViaje.trf_base\n else\n h.detRsrv_valor = @pagoPendAplicar\n @pagoPendAplicar = 0\n end\n end\n h.save\n end\n else\n end\n end \n reserva.rsrv_estadoReserva = \"C\"\n reserva.save\n end\n\n respond_to do |format|\n if @pago.save\n format.html { redirect_to @parentPath, notice: 'Pago creado exitosamente.' }\n format.json { render :show, status: :created, location: @pago }\n else\n format.html { render :new }\n format.json { render json: @pago.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n# TODO ESTA HECHO UNA PORQUERIAAAAAAAAAA\n# base de datos\n @peticion = Peticion.new \n @peticion.solicitudrecurso_id=session[:ident] # params[:solicitudrecurso_id].to_s\n @peticion.diasemana=params[:diasemana]\n @peticion.horaini=params[:horaini]\n @peticion.horafin=params[:horafin]\n#carro\n @peticion=Solicitud.new\n #@peticion.solicitudrecurso_id=session[:ident] # params[:solicitudrecurso_id].to_s\n @peticion.diasemana=params[:diasemana]\n @peticion.horaini=params[:horaini]\n @peticion.horafin=params[:horafin]\n session[:tramos_horarios].solicitudes<<@peticion\n @pet=Solicitud.new\n #@peticion.solicitudrecurso_id=session[:ident] # params[:solicitudrecurso_id].to_s\n @pet.diasemana=params[:diasemana]\n @pet.horaini=params[:horaini]\n @pet.horafin=params[:horafin]\n\n\n\n# AHORA HAY QUE AÑADIR PETICION AL CARRO Y YA ESTA, RECARGAR LA VISION DE LOS TRAMOS CON AJAX\n# PERO EN EL CONTROLLER DE SOLICITUD!!!!!!!! A VER COMO HAGO EL CORTOCIRCUITO RECORDAR EL RETURNS-TO (LIBRO)\n\n session[:peticiones].solicitudes<<@pet # ACCION 6 AQUI ANADO EL TRAMO AL CARRO, LA SIGUIENTE EN SOLIC. CONTROLLER\n \n respond_to do |format|\n if @peticion.save\n \n @peticions=Peticion.all\n format.html { redirect_to(session[:direccion]) }\n format.xml { render :xml => @peticion, :status => :created, :location => @peticion }\n else\n \n format.html { render :action => \"new\" }\n format.xml { render :xml => @peticion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def new\n @coupen = Coupen.new\n value = \"\" \n 50.times{value << (65 + rand(25)).chr}\n #here at value character i need to add at last a coupen id + 1 numeric value\n #so that it will be always a unique also to make concurrent user uniqueness i am adding an user ipaddress at last\n #\n coupen_id = Coupen.last.id\n #because of this coupen_id its always a unique thing.\n \n @coupenvalue = value.to_s + coupen_id.to_s + request.ip\n end",
"def crear_existente\n if request.post?\n if expediente_relacionado = Expediente.find_by_id(params[:expediente_relacionado_id])\n expediente = Expediente.find(params[:expediente_id])\n if not expediente.expedientes_relacionados.include?(expediente_relacionado)\n Expediente.transaction do\n expediente.expedientes << expediente_relacionado \n expediente.save\n expediente_relacionado.expedientes << expediente\n expediente_relacionado.save\n end\n end\n end\n render :update do |page|\n page << \"active_scaffold_update();\"\n end\n end\n end"
] |
[
"0.6265763",
"0.62145287",
"0.62145287",
"0.62145287",
"0.62145287",
"0.62145287",
"0.62145287",
"0.6134717",
"0.6045473",
"0.6026282",
"0.60232174",
"0.6023134",
"0.59959847",
"0.5969039",
"0.596721",
"0.59435815",
"0.5931124",
"0.5926837",
"0.5911679",
"0.591013",
"0.5903899",
"0.58705837",
"0.5859622",
"0.5819616",
"0.57928956",
"0.5786223",
"0.57795185",
"0.5758001",
"0.5753985",
"0.57445264",
"0.5743873",
"0.57052565",
"0.5699272",
"0.5685198",
"0.56845397",
"0.56835437",
"0.56823534",
"0.5668246",
"0.56511307",
"0.5646911",
"0.5644362",
"0.5612073",
"0.55964476",
"0.5590809",
"0.5562333",
"0.5543728",
"0.554175",
"0.5541125",
"0.5529274",
"0.55286473",
"0.5522181",
"0.55169964",
"0.5512847",
"0.5510724",
"0.54979163",
"0.549704",
"0.54641575",
"0.54627556",
"0.5457188",
"0.5455876",
"0.5430711",
"0.5417998",
"0.5417038",
"0.541597",
"0.5413979",
"0.54128546",
"0.54100496",
"0.540975",
"0.5404973",
"0.53967017",
"0.5390774",
"0.53878",
"0.5384433",
"0.53787965",
"0.5378643",
"0.5369488",
"0.5366331",
"0.5359014",
"0.53563553",
"0.5352671",
"0.53362405",
"0.53316647",
"0.5329124",
"0.5323785",
"0.5322456",
"0.53206265",
"0.53175473",
"0.5313702",
"0.5312517",
"0.53097343",
"0.53006446",
"0.5300618",
"0.5296764",
"0.52939755",
"0.52927285",
"0.5288194",
"0.52857727",
"0.5282144",
"0.52732456",
"0.52731943"
] |
0.71432227
|
0
|
only considers quickerydefined attributes that has corresponding _is_synced attribute
|
def autoload_unsynced_quickery_attributes!
model = self.class
new_values = {}.with_indifferent_access
defined_quickery_attribute_names = model.quickery_builders.keys
defined_quickery_attribute_names.each do |defined_quickery_attribute_name|
if has_attribute?(:"#{defined_quickery_attribute_name}_is_synced") && !send(:"#{defined_quickery_attribute_name}_is_synced")
new_values[defined_quickery_attribute_name] = determine_quickery_value(defined_quickery_attribute_name)
new_values[:"#{defined_quickery_attribute_name}_is_synced"] = true
end
end
update_columns(new_values) if new_values.present?
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def _synced?(foreign_key)\n !!_synced[foreign_key]\n end",
"def scrub_synchronization_attribute(deal,attr)\n if deal.class.respond_to?(:textiled_attributes) && deal.class.textiled_attributes.include?(attr)\n new_value = deal.send(\"#{attr}_source\")\n else\n new_value = deal.send(attr)\n end\n end",
"def insync?(is)\n synced = true\n provider.attributes_to_update = Hash.new\n @should[0].each do |k, v|\n unless is[k] == v\n synced = false\n provider.attributes_to_update[k] = v\n end\n end\n synced\n end",
"def shared_attributes\n slice(*TransferRecord::SHARED_ATTRIBUTES).tap do |attributes|\n attributes[\"original_plate_number\"] = current_plate_number\n attributes[\"original_owner\"] = transfer_recevier\n attributes[\"original_owner_idcard\"] = transfer_recevier_idcard\n attributes[\"original_location_city\"] = current_location_city\n attributes[\"original_location_province\"] = current_location_province\n end\n end",
"def range_modified?\n old_record_state = ProcessingSetup.find(self.id)\n if old_record_state.standard_size_count_from != self.standard_size_count_from ||\n old_record_state.standard_size_count_to != self.standard_size_count_to\n return true\n else\n return false\n end\n\nend",
"def insync?\n unless properties[:ensure] == :absent\n properties.each do |k, v|\n if resource[k].to_s != v\n resource[:ensure] = :modified\n break false\n end\n end\n end\n end",
"def are_synced\n where(sync_status: true).to_a\n end",
"def visible_attr \n _storable_attributes\n end",
"def synced?(record)\n record.synced?\n end",
"def fields_need_editing(obj) \n \teditable_fields(obj).select {|k,v| v == true }\n end",
"def observe\n return (@attributes & 0x20 == 0x20)\n end",
"def allowed_to_ship_data?\n return false if (Time.now.to_i - self.synced_at) < 43200\n return true\n end",
"def attributes_for_remote\n ignored = self.class.ignored_attributes\n\n entity.attributes.reject do |a, _|\n ignored.include?(a) || a.end_with?('_count', '_id', '_cache')\n end\n end",
"def property_fix\n properties.each do |thing|\n next unless [:mode, :owner, :group, :seluser, :selrole, :seltype, :selrange].include?(thing.name)\n\n # Make sure we get a new stat objct\n @stat = :needs_stat\n currentvalue = thing.retrieve\n thing.sync unless thing.safe_insync?(currentvalue)\n end\n end",
"def property_fix\n properties.each do |thing|\n next unless [:mode, :owner, :group].include?(thing.name)\n\n # Make sure we get a new stat objct\n @stat = :needs_stat\n currentvalue = thing.retrieve\n thing.sync unless thing.safe_insync?(currentvalue)\n end\n end",
"def is_user_contacts_syncable?\n return get(:should_sync) == true\n end",
"def insync?(is)\n is.delete_if {|k, v| true if not @should[0].has_key?(k)} if is.is_a? Hash\n super(is)\n end",
"def supports_dirty_tracking?(object)\n defined?(::Mongoid::Dirty) && object.respond_to?(\"#{attribute}_changed?\") || super\n end",
"def able_to_set_updated_at?\n !frozen? && !timeless? && (new_record? || changed?)\n end",
"def _synced\n @_synced ||= {}\n end",
"def essential_attributes\n [\"is_transient\",\"id\"]\n end",
"def ready_attributes\n selected_attr_trackers.collect { |ready_or_needed| ready_or_needed.to_s.match /(.*)_ready$/ ; $1&.to_sym }.compact\n end",
"def defensive\n return (@attributes & 0x10 == 0x10)\n end",
"def update_skipped_attributes\n # Skip over this if nothing's being skipped.\n skipped_changed = changed_attributes.keys & draftsman_options[:skip]\n return true unless skipped_changed.present?\n\n keys = self.attributes.keys.select { |key| draftsman_options[:skip].include?(key) }\n attrs = {}\n keys.each { |key| attrs[key] = self.send(key) }\n\n self.reload\n self.update(attrs)\n end",
"def attribute_dirty?(name)\n dirty_attributes.has_key?(properties[name])\n end",
"def belongs_to_synced?(col, owner)\n # The :belongs_to that points to the instance has changed\n return false if get_belongs_to_attr(col) != owner\n\n # The polymorphic reference (_type, _id) columns do not match, maybe it was just saved\n return false if col.polymorphic && !polymorphic_attr_matches?(col, owner)\n\n # The key reference (_id) column does not match, maybe it was just saved\n return false if _get_attr(col.foreign_key) != owner.try(:id)\n\n true\n end",
"def exclude_pending_create_attribute?(obj, prop)\n prop.type < Annotation or super\n end",
"def is_attribute?; end",
"def property_fix\n properties.each do |thing|\n next unless [:mode, :owner, :group].include?(thing.name)\n\n # Make sure we get a new stat object\n @stat = :needs_stat\n currentvalue = thing.retrieve\n thing.sync unless thing.safe_insync?(currentvalue)\n end\n end",
"def values_changed?\n unless tracked_attributes.present?\n raise TrackChangesError, 'Object has not been configured for change tracking.'\n end\n changed = marked_for_destruction? ? true : false\n tracked_attributes.each do |attr|\n break if changed\n if send(\"#{attr}_changed?\")\n changed = send(attr) == send(\"#{attr}_was\") ? false : true\n end\n end\n self.exclude_from_save = !changed\n changed\n end",
"def dirty?(attr=nil)\n _mon.synchronize do\n if(attr)\n dirty.has_key?(attr)\n else\n if(@_checksum)\n !dirty.empty? ||\n @_checksum != Digest::SHA256.hexdigest(MultiJson.dump(data.inspect).to_s)\n else\n true\n end\n end\n end\n end",
"def copyable_attributes; end",
"def frozen?\n @attributes.frozen?\n end",
"def frozen?\n @attributes.frozen?\n end",
"def frozen?\n @attributes.frozen?\n end",
"def read_only?; end",
"def read_only?; end",
"def attribute_accessor?\n false\n end",
"def insync?(is)\n case @resource[:entry_management]\n when :inclusive\n super\n when :minimal\n synced = true\n provider.objectclass_to_update = Array.new\n @should[0].each do |v|\n unless is.include?(v)\n synced = false\n provider.objectclass_to_update << v\n end\n end\n synced\n end\n end",
"def matterful_attributes(options={})\n options = options.dup\n default = options[:default].nil? ? true : options[:default]\n foreign_key = options[:foreign_key].nil? ? true : options[:foreign_key]\n sti = options[:sti].nil? ? true : options[:sti]\n polymorphic = options[:polymorphic].nil? ? true : options[:polymorphic]\n # Set compare_blank_values to false only if you, DO NOT want to update existing information with nil information from the new object\n # For example, sometimes your table has historical data, while source, may only have current. You may want to keep historical data\n # for reference, or if some process relies on it. It's generally not a good idea to delete good data, unless you have to.\n compare_blank_values = options[:compare_blank_values].nil? ? true : options[:compare_blank_values]\n\n # extra keys supplied as array of strings to ignore in comparison\n attributes_to_ignore = options[:extra].nil? ? [] : options[:extra]\n\n # Let's check for and add typical attributes that sti & polymorphic models have, override\n # this by sti: false, polymorphic: false, foreign_key: false\n # by default when looking to compare two objects\n # Customer.find(1).shipping_address.same_as? Address.new(city: 'Chicago')\n # we really only want to see if any of the 'matterfule information changed', like address_line_1 or city.\n # TODO: I guess I could do some smart checking on the model to see what kind of attributes it has.\n # For now we'll just check for all that we want to remove\n if default\n attributes_to_ignore += ['id', 'created_at', 'updated_at']\n end\n # By default we want foreign keys like caegory_id as they provide useful information about current record.\n # Let's say you import a bunch of addresses\n # and they ony matterful change was from shipping to billing category.\n unless foreign_key\n # This will skip polymorphic style foreign keys and only deal with belongs_to style keys\n attributes_to_ignore += attributes.keys.keep_if{|k| k.match(/_id\\z/) && !k.match(/able_id\\z/) }\n end\n if sti\n attributes_to_ignore += ['type']\n end\n # If you are looking at a model that is polymorphic than most like you want to update something\n # like city for an Address , not addressable_id or addresable_type\n # That is more likely type of information to be updated on external import.\n if polymorphic\n attributes_to_ignore += attributes.keys.keep_if{|k| k.match(/able_id\\z/) }\n attributes_to_ignore += attributes.keys.keep_if{|k| k.match(/able_type\\z/) }\n end\n\n # This will only be invoked on blank values\n # Since this gem is used only in the context of ActiveRecord, safe to use blank?, from ActionPack\n # KEEP IN MIND THIS THI WILL NOT CHECK for blanks in sti, foreign, and default attributes\n # it will only check for blank values in keys not in attributes_to_ignore already!!!!\n unless compare_blank_values\n attributes.except(*attributes_to_ignore).keys.each do |key|\n if self.send(key).blank?\n attributes_to_ignore += [key]\n end\n end\n end\n attributes.except(*attributes_to_ignore)\n end",
"def synchronization\n attributes.fetch(:synchronization)\n end",
"def scrooged?\n @attributes.is_a?(ScroogedAttributes)\n end",
"def sync= sync_list\n cur_list = sync \n @removed_from_sync_list = cur_list[:with] - sync_list[:with] if sync_list[:with] && cur_list[:with]\n sync_list[:with] = sync_list[:with].select{|id| id != self.campaign_id } if sync_list[:with]\n super(sync_list.to_json)\n end",
"def attr_dirty?(key)\n @dirty_attribute_keys ||= []\n @dirty_attribute_keys.include?(key.to_sym)\n end",
"def transferred_properties; end",
"def transferred_properties; end",
"def owner_class_attribute_default_matches?(state); end",
"def denormalization_fields_changed?\n @title_field_changed = @trackable_commentable_title != commentable_title\n @state_field_changed = @trackable_commentable_state != commentable_state\n @url_field_changed = @trackable_commentable_url != commentable_url\n @title_field_changed || @url_field_changed || @state_field_changed\n end",
"def is_locked\n @attributes[:is_locked]\n end",
"def read_only_attribute?(attribute)\n !mass_assignment_authorizer.include?(attribute)\n end",
"def dirty?(field)\n @dirty_attrs.member? field \n end",
"def updated?; self_owned? || owners.any?(&remote_siblings.method(:[])) end",
"def is_retrigger\n attributes.fetch(:isRetrigger)\n end",
"def dirty_attributes\n dirty_attributes = {}\n properties = self.properties\n\n original_values.each do |name, old_value|\n property = properties[name]\n new_value = property.get!(self)\n\n dirty = case property.track\n when :hash then old_value != new_value.hash\n else\n property.value(old_value) != property.value(new_value)\n end\n\n if dirty\n property.hash\n dirty_attributes[property] = property.value(new_value)\n end\n end\n\n dirty_attributes\n end",
"def check_predefined_atttributes\n send_ons = [0]\n\n send_ons << created_at_changed? ? 1 : 2\n\n predefiners = PredefinedAttribute.where(send_on: send_ons, table: 'users')\n\n predefiners.each do |predef|\n if self.send(predef.column) == predef.value\n predef.assign_values(self)\n end\n end\n end",
"def insync?(is)\n munge(is) == should\n end",
"def supports_outdated_sync?\n updated_at_field = root.child_hash[outdated_sync_field] if outdated_sync_field\n !!updated_at_field && updated_at_field.value.nil?\n end",
"def ignore_non_read_or_write_attributes\n ['title', 'email', 'expertise_list', 'tool_list', 'mbox_sha1sum']\n end",
"def attr_readonly?(column)\n self.class.readonly_attributes && self.class.readonly_attributes.collect.include?(column.to_s) \n end",
"def modified?\n ((self.created_at != self.updated_at) ||\n (segments.collect { |e| e.audio_asset.authored? && e.audio_asset.delivered? }.include?(true))) \n end",
"def sync_filters\n super.presence || default_sync_filters\n end",
"def ignored_attr_has_changed?\n ignored = @record.paper_trail_options[:ignore] + @record.paper_trail_options[:skip]\n ignored.any? && (changed_in_latest_version & ignored).any?\n end",
"def read_only\n @attributes[:read_only]\n end",
"def remote_sync_other\n @attributes[:remote_sync_other]\n end",
"def sync_local_model_status(model, record)\n true\n end",
"def dirty?\n return !self.headers.first(:name => :dirty).nil?\n end",
"def ignore_if_not_exists\n attributes.fetch(:ignoreIfNotExists)\n end",
"def has_attributes?; end",
"def dirty_attributes\n changed.inject({}) { |h, k| h[k] = attributes[k.to_s]; h }\n end",
"def is_synced_from_on_premises=(value)\n @is_synced_from_on_premises = value\n end",
"def update_same_fields? model, method\n intersection = fields_from_model(model).map(&:to_s) & fields_from_model_method(model, method).map(&:to_s)\n intersection.present?\n end",
"def change\n updated = false\n work.attributes.keys.each do |property|\n if work.send(property).is_a?(Array)\n work.send(\"#{property}=\", work.send(property).collect do |val|\n if val.is_a?(String) && val.strip != val\n updated = true\n val.strip\n else\n val\n end\n end)\n elsif work.send(property).is_a?(String)\n if work.send(property) != work.send(property).strip\n updated = true\n work.send(\"#{property}=\", work.send(property).strip)\n end\n end\n end\n return updated\n end",
"def frozen?\n reload\n @properties.frozen?\n end",
"def insync?(is)\n return true\n end",
"def returnable_attributes\n attrs = dirty_attributes.dup\n self.class.attributes.select {|name, props| props[:writer] != :public}.each do |name, props|\n attrs.delete name\n end\n attrs.delete(:id)\n attrs\n end",
"def settled_attributes\n instance_vars = self.instance_variables.map do |attr|\n attr.to_s[1..-1].to_sym\n end\n\n instance_vars & attributes\n end",
"def attr_with_writable_flag?\n method_name == :attr && args.any? && args.last.type == :true\n end",
"def shared\n Types::Boolean.deserialize(@shared)\n end",
"def sync_type\n if %w(blacklist whitelist).include?(type = self['type'])\n type\n end\n end",
"def update_required?(old_attrs, new_attrs)\n false\n end",
"def only_some_attributes_filled?(ar)\n ar.attributes_filled < AppConfig['contact_info.complete_percentage'].to_f\n end",
"def sync_options; @sync_options ||= table_sync.sync_options; end",
"def check_base_and_sync\n self.sanitize_text\n\n if self.is_maverick?\n Rails.logger.info(\"Updating maverick: #{self.id}\")\n self.attributes = self.base_card.attributes.reject{|k,v| [\"id\",\"house\",\"parent_id\",\"uuid\",\"created_at\",\"house_id\",\"is_maverick\"].include?(k)}\n end\n end",
"def mark_as_modified\r\n update_attribute :synchronized, false\r\n end",
"def readonly_attributes(*attrs)\n @readonly_attributes ||= [:created_at, :updated_at, :completed_at]\n if attrs.any?\n @readonly_attributes.map!(&:to_sym).concat(attrs).uniq!\n setup_attributes(@readonly_attributes, true)\n end\n @readonly_attributes\n end",
"def change_props\n out_of_sync=[]\n # Compare the desired values against the current values\n resource[:properties].each_pair do |prop,should_be|\n is = properties[prop]\n # Current Value == Desired Value\n unless is == should_be\n # Stash out of sync property\n out_of_sync.push(\"%s=%s\" % [prop, should_be])\n end\n end\n out_of_sync\n end",
"def freeze\n @touched_associations.freeze\n\n super\n end",
"def readonly?\n self.class != real_class\n end",
"def origin_aggressive\n return (@attributes & 0x80 == 0x00)\n end",
"def readonly?\n frozen?\n end",
"def changed?\n #card_type_changed?\n ret=(changed & DB_FIELDS).present? || VIRTUAL_FIELDS.any? {|attr| self.send(attr).present?}\n ret\n end",
"def needed_attributes\n selected_attr_trackers.collect { |ready_or_needed| ready_or_needed.to_s.match /(.*)_needed$/ ; $1&.to_sym }.compact\n end",
"def original_attributes\n @record.attributes.symbolize_keys.select do |(attr, _)|\n !%i(created_at updated_at).include?(attr)\n end\n end",
"def insync?(is)\n (is == :present and should == :present and (provider.value == provider.value_saved)) or\n (is == :absent and should == :absent)\n\n end",
"def readonly_attributes\n read_inheritable_attribute(:attr_readonly)\n end",
"def attr_reader(*args)\n super\n comparison_attrs.concat(args)\n end",
"def is_synced_from_on_premises\n return @is_synced_from_on_premises\n end",
"def read_attribute(name)\n case name\n when 'liquid_enabled'.freeze\n true\n else\n super\n end\n end",
"def ignored_associations\n %w().freeze\n end",
"def update_has_attrs\n\t\tunless promotional == true\n\t\t\tself.has_video = (video_album.video_files.size > 0) ? true : false\n\t\t\tself.has_audio = (audio_album.audio_files.size > 0) ? true : false\n\t\t\tself.has_photos = (photo_album.square_photos.size > 0) ? true : false\n\t\t\tself.has_links = (page_links.count > 0 or created_page_link_this_time) ? true : false\n\t\tend\n\t\ttrue\n\tend"
] |
[
"0.6095924",
"0.59599996",
"0.58271426",
"0.5730572",
"0.5705877",
"0.5695839",
"0.5673582",
"0.55953157",
"0.5543445",
"0.55270517",
"0.5524354",
"0.5520179",
"0.5516502",
"0.551319",
"0.55001205",
"0.54952997",
"0.5477083",
"0.5475733",
"0.5455401",
"0.5431728",
"0.5431087",
"0.54255736",
"0.5425496",
"0.54118484",
"0.53920025",
"0.53897494",
"0.5380206",
"0.5373911",
"0.5367002",
"0.53592306",
"0.53575504",
"0.5354329",
"0.53490996",
"0.53490996",
"0.53490996",
"0.53324944",
"0.53324944",
"0.53300446",
"0.5328052",
"0.5320244",
"0.53193444",
"0.53095585",
"0.5299843",
"0.5295783",
"0.52935594",
"0.52935594",
"0.52837044",
"0.5280112",
"0.52772707",
"0.52721345",
"0.5271301",
"0.52705383",
"0.5265988",
"0.5256314",
"0.5247706",
"0.52423775",
"0.5232645",
"0.52295524",
"0.5226432",
"0.5218885",
"0.52093637",
"0.5208358",
"0.5207308",
"0.5206953",
"0.520647",
"0.52055496",
"0.5201607",
"0.52015066",
"0.51989186",
"0.51850736",
"0.51803535",
"0.517728",
"0.5173679",
"0.51730776",
"0.51728857",
"0.51719284",
"0.51695067",
"0.5166558",
"0.516375",
"0.51627886",
"0.51612246",
"0.5154062",
"0.51534754",
"0.5152531",
"0.5149037",
"0.51391083",
"0.51379204",
"0.5137308",
"0.513574",
"0.513231",
"0.5128937",
"0.5127048",
"0.5125105",
"0.5123986",
"0.51238817",
"0.51203024",
"0.5108362",
"0.5105468",
"0.5101662",
"0.5087283"
] |
0.71277004
|
0
|
Public: resolves a template file by looking in the template path. template the template name. extension the extension of the desired template. Returns a string with the full path of the template file, or nil if it is not found.
|
def which(template, extension)
template_with_extension = with_extension(template, extension)
path = absolute_paths.find do |path|
File.exists?(File.join(path, template_with_extension))
end
if path
File.join(path, template_with_extension)
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def find_generic_base_path_for(template_path, extension)\r\n self.generic_view_paths.each do |generic_path|\r\n template_file_name = File.basename(\"#{template_path}.#{extension}\")\r\n generic_file_path = File.join(generic_path, template_file_name)\r\n return generic_file_path if File.file?(generic_file_path)\r\n end\r\n nil\r\n end",
"def template_file\n @template_file || \"#{path}/#{template_name}.#{template_extension}\"\n end",
"def find_template(template, environment = nil)\n if template == File.expand_path(template)\n return template\n end\n\n if template_paths = templatepath(environment)\n # If we can find the template in :templatedir, we return that.\n template_paths.collect { |path|\n File::join(path, template)\n }.each do |f|\n return f if FileTest.exist?(f)\n end\n end\n\n # check in the default template dir, if there is one\n if td_file = find_template_in_module(template, environment)\n return td_file\n end\n\n nil\n end",
"def with_extension(template, extension)\n if has_extension?(template, extension)\n template\n else\n [template, extension].join(\".\")\n end\n end",
"def template_path(extension)\n File.expand_path('../../../views/renderers/' + @dirname + '/' + @placeholder + '.' + extension, __FILE__)\n end",
"def template_path(filename)\n File.join(PatienceDiff::TEMPLATE_PATH, filename)\n end",
"def find_template_sub(t)\n for path in [File.join(juli_repo, Juli::REPO), Juli::TEMPLATE_PATH] do\n template = File.join(path, t)\n return template if File.exist?(template)\n end\n raise Errno::ENOENT, \"no #{t} found\"\n end",
"def template(template_name = 'template.txt')\n File.read([File.dirname(__FILE__), template_name].join('/'))\n end",
"def render_file_path(template)\n template.gsub(%r{.templates/.*?erb}, File.basename(template)).gsub('.erb', '')\n end",
"def template\n possible_templates.find {|t| File.exists? \"#{t}.html\"}\n end",
"def get_template_file(filename)\n if File.exists?(filename)\n templateFile = filename\n else\n templateFile = File.expand_path(\"../../#{filename}\", __FILE__)\n end\n\n File.read(templateFile)\nend",
"def template_path(template)\n File.join(@root, 'templates', self.class::FILES[template])\n end",
"def setup_template_details\n template_extension = @template_path.scan(/\\.(\\w+)\\.?(.*)?/)[0][0]\n get_extension_and_name_from_file(@template_path).merge(\n template_extension: template_extension\n )\n end",
"def get_template(filename)\n File.read(filename)\nend",
"def fetch_template(template_name = nil)\n # Due to security reason, it cannot use templates outside until it will be fixed\n # if GitlabHook::Project::config['template']\n # return GitlabHook::Project::config['template']\n # end\n\n if template_name.nil?\n template_name = @default_template_name\n else\n validate_template_name template_name\n end\n\n File.read(\n File.expand_path(\n configatron.app.path.templates + '/slack/message/' +\n template_name + '.erb')\n )\n end",
"def template_path\n \"#{template_dir}/#{template_name}\"\n end",
"def get_template(template); end",
"def template(filename)\n File.binread(File.join(__dir__, 'templates', filename))\n end",
"def template_for(filename, opts = {})\n # A bunch of potential matches in order of preference.\n candidates = if Gluttonberg.localized?\n # Locale and dialect\n # Locale only\n # Default\n [\n \"#{filename}.#{opts[:locale].slug}.#{opts[:dialect].code}\",\n \"#{filename}.#{opts[:locale].slug}\",\n \"#{filename}\"\n ]\n elsif Gluttonberg.translated?\n # Dialect\n # Default\n [\n \"#{filename}.#{opts[:dialect].code}\",\n \"#{filename}\"\n ]\n else\n [\"#{filename}.*\"]\n end\n # Loop through them and return the first match\n for candidate in candidates \n path = template_dir / candidate + \".*\"\n matches = Dir.glob(path)\n return candidate unless matches.empty?\n end\n # This nil has to be here, otherwise the last evaluated object is \n # returned, in this case the candidates hash.\n nil\n end",
"def template_path\n File.expand_path(File.join('..', '..', '..', 'templates', \"#{template_name}.erb\"), __FILE__)\n end",
"def load_source(template)\n filename = File.join(path, template)\n\n return unless File.file?(filename)\n\n File.read filename\n end",
"def path_and_extension(template_path)\n template_path_without_extension = template_path.sub(/\\.(\\w+)$/, '')\n [template_path_without_extension, $1]\n end",
"def full_template_path_from_application(template_path, extension)\n if Engines.disable_application_view_loading\n nil\n else\n full_template_path_without_engine_additions(template_path, extension)\n end \n end",
"def get_template(params)\n if params[:file_path]\n return get_template_from_file(params[:file_path])\n elsif params[:template]\n return params[:template]\n else\n raise 'A valid template file path or template text is required.'\n end\n end",
"def get_template(name)\n if File.exists?(\"#{repository.path}/#{name}.mustache\")\n IO.read(\"#{repository.path}/#{name}.mustache\")\n else\n IO.read(File.join(File.dirname(__FILE__), \"templates/#{name}.mustache\"))\n end\n end",
"def find_template(template)\n template = locate_config_value(:template_regex) if template.nil?\n # if we got a string then try to find that template exact\n # if no exact template matches, search\n if template.is_a?(String)\n found = get_template(template)\n return found if found\n end\n\n # make sure our nil template gets set to default\n if template.nil?\n template = locate_config_value(:template_regex)\n end\n\n Chef::Log.debug \"Name: #{template.class}\"\n # quick and dirty string to regex\n unless template.is_a?(Regexp)\n template = /#{template}/\n end\n\n # loop over all vm's and find the template\n # Wish there was a better API method for this, and there might be\n # but i couldn't find it\n Chef::Log.debug \"Using regex: #{template}\"\n xapi.VM.get_all_records.each_value do |vm|\n if vm['is_a_template'] && vm['name_label'] =~ template\n Chef::Log.debug \"Matched: #{h.color(vm['name_label'], :yellow)}\"\n found = vm # we're gonna go with the last found\n end\n end\n\n # ensure return values\n if found\n ui.msg \"Using Template: #{h.color(found['name_label'], :cyan)}\"\n return get_template(found['name_label']) # get the ref to this one\n end\n nil\n end",
"def find_tpl_file(fname)\n # add default search directory\n ipath = File.expand_path(File.dirname(__FILE__) + '/../templates')\n opts.tpl_directories << ipath unless opts.tpl_directories.include?(ipath)\n rpath = File.expand_path('./templates')\n opts.tpl_directories << rpath unless opts.tpl_directories.include?(rpath)\n\n fname = 'default.' + fname unless fname =~ /\\./\n cand, buf = [], nil\n fname.split('.').reverse.each do |b|\n buf = buf ? b + '.' + buf : b\n cand.unshift buf\n end\n\n cand.each do |pt|\n opts.tpl_directories.each do |d|\n tpl = d + '/' + pt + '.erb'\n return tpl if File.exists?(tpl)\n end\n end\n\n # raise 'no template file found for ' + opts.template\n nil\n end",
"def template\n @template ||= File.read(template_full_path)\n end",
"def template_path\n File.expand_path(File.join(File.dirname(__FILE__), \"template.rb\"))\n end",
"def load_template(template_path)\n if ! File.exist?(template_path)\n return nil\n end\n\n return File.read(template_path)\nend",
"def full_path\n \"templates/#{filename}\"\n end",
"def template_path\n File.join path, 'templates'\n end",
"def path_to_template name\n \"#{JSPEC_ROOT}/templates/#{name}/.\"\n end",
"def read_template(template)\n File.open(File.join(templates_path, template), 'r').read\n end",
"def use_template_filename\n return nil unless @args[:___use_template___]\n ConfigData.real_type_filename 'templates', @args[:___use_template___]\n end",
"def template_path(path)\n # Add a new template extension here if we need to.\n [ 'haml', 'erb' ].each do |template_extension|\n if path.directory? && (path + \"index.html.#{template_extension}\").file?\n return \"#{path}/index\"\n elsif (path.dirname + (path.basename.to_s + \".html.#{template_extension}\")).file?\n return path.dirname + path.basename.to_s\n end\n end\n nil\n end",
"def template_path\n path = File.expand_path File.join(@template_options[CONFIG_PATH], @template_options[TEMPLATE_NAME])\n # TODO fix and throw some sort of cool exception\n if !File.exists? path\n path = nil\n end\n return path\n end",
"def find_template(template=XAPI_TEMP_REGEX)\n # if we got a string then try to find that template exact \n # if no exact template matches, search\n if template.is_a?(String)\n found = get_template(template)\n return found if found\n end\n\n # make sure our nil template gets set to default\n if template.nil?\n template = XAPI_TEMP_REGEX\n end \n\n Chef::Log.debug \"Name: #{template.class}\"\n # quick and dirty string to regex\n unless template.is_a?(Regexp)\n template = /#{template}/ \n end\n\n # loop over all vm's and find the template \n # Wish there was a better API method for this, and there might be\n # but i couldn't find it\n Chef::Log.debug \"Using regex: #{template}\"\n xapi.VM.get_all_records().each_value do |vm|\n if vm[\"is_a_template\"] and vm[\"name_label\"] =~ template\n Chef::Log.debug \"Matched: #{h.color(vm[\"name_label\"], :yellow )}\"\n found = vm # we're gonna go with the last found \n end\n end\n\n # ensure return values\n if found\n puts \"Using Template: #{h.color(found[\"name_label\"], :cyan)}\"\n return get_template(found[\"name_label\"]) # get the ref to this one\n end\n return nil\n end",
"def get_template_file(file)\n File.join(File.dirname(__FILE__), 'templates', file)\n end",
"def load_template(template)\n IO.read(template).chomp\n end",
"def effective_template(file, env)\n template_file = Puppet::Parser::Files.find_template(file, env)\n if !template_file.nil?\n template_file\n elsif Puppet::FileSystem.exist?(file)\n file\n else\n nil\n end\n end",
"def template_path(template)\n modulepath.each do | path|\n return path if File.exists?(\"#{path}/easy_type/templates/#{template}\")\n end\n fail \"Template #{template} not found in modulepath #{modulepath}\"\n end",
"def resource_and_found_template(template_path, options = {})\n resource, template = template_path.split('/')\n\n raw_template_path = find_template_path(resource, template, options)\n found_template = raw_template_path.split('/').last if raw_template_path\n\n [resource, found_template]\n end",
"def get_template_file\n @config['template']\n end",
"def get_tpl_file(tpl)\n return File.join(@@tpl_dir, tpl + '.' + @@tpl_ext)\n end",
"def read_template(template)\n File.read(template_path(template))\n end",
"def try_picking_template_for_path(template_path)\n self.view_paths.find_template(template_path, template_format)\n end",
"def try_picking_template_for_path(template_path)\n self.view_paths.find_template(template_path, template_format)\n end",
"def get_template_filepath_in_directory( directory, template_file ) \n @logger.debug( \"#{__method__} directory=#{directory}, template_file=#{template_file}\" )\n\n if ! File.exists?( directory ) then\n raise <<-eos\n\n No such directory '#{directory}'.\n \n Option -g should list\n - existing paths OR\n - Gems which includes 'mustache' directory\n \n eos\n\n end\n\n template_path = \"#{directory}/#{template_file}.#{@template_extension}\"\n @logger.info( \"#{__method__} read template_path=#{template_path}\" )\n \n return template_path\n\n end",
"def find_template(name)\n TEMPLATES.find do |fn, _|\n fn == name || fn.split('.').first == name\n end\n end",
"def absolute_template_filename_for(relative_filename)\n File.expand_path(File.join(self.class.template_load_path, relative_filename))\n end",
"def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end",
"def get_template(template)\n xapi.VM.get_by_name_label(template).first\n end",
"def template(name)\n File.join TemplatePath, \"#{name}.rb\"\nend",
"def make_template_path(filename)\n return File.join(templates_dir, filename)\n end",
"def make_template_path(filename)\n return File.join(templates_dir, filename)\n end",
"def find_template(views, name, engine)\n filename = ::File.join(views, \"#{name}.#{engine}\")\n File.exists?(filename) ? filename : nil\n end",
"def template_path\n File.expand_path('../templates', __FILE__)\n end",
"def find_template(opts={})\n if template = opts[:template]\n path = _template_root / template\n elsif action = opts[:action]\n segment = self.class.name.snake_case.split('::').join('/')\n path = _template_root / segment / action\n elsif _layout = opts[:layout]\n path = _template_root / 'layout' / _layout\n else\n raise \"called find_template without an :action or :layout\" \n end \n glob_template(path, opts)\n end",
"def load_template(name)\n filename = locate_template(name)\n File.read(filename)\n end",
"def built_in_template_for(template_name)\n File.join( File.dirname(__FILE__), 'templates', template_name )\n end",
"def template_path\n @template_path ||= @env[:templates_path] || default_settings[:templates_path]\n Pathname.new @template_path\n end",
"def find_template(views, name, engine)\n filename = ::File.join(views, \"#{name}.#{engine}\")\n File.exist?(filename) ? filename : nil\n end",
"def template(*path); end",
"def template_content(template_name)\n File.read(File.join(@options[:templates], template_name))\n end",
"def template_path(name, template_engine:nil) #current_template_engine)\n template_engine ||= '*'\n #puts \"TEMPLATE_path searching with name: #{name}, template_engine: #{template_engine}\"\n ([Vue::Helpers.views_path].flatten.uniq.compact || Dir.getwd).each do |start_path|\n #puts \"TEMPLATE_path searching views-path: #{start_path}\"\n Dir.breadth_first(\"*\", base:start_path) do |path|\n #puts \"TEMPLATE_path inspecting file: #{path}\"\n return path if File.fnmatch(File.join('*', \"#{name}.vue.#{template_engine}\"), path)\n return path if File.fnmatch(File.join('*', \"#{name}.vue\"), path)\n return path if File.fnmatch(File.join('*', name.to_s), path)\n end\n end\n\n return nil\n end",
"def template_source\n @template_source ||= @options[:template_content] || read_file(template_file)\n end",
"def template_full_path\n @template_full_path ||= [template_base_path, template_filename].join('/')\n end",
"def _absolute_template_location(template, type)\n template.match(/\\.#{type.to_s.escape_regexp}$/) ? template : \"#{template}.#{type}\"\n end",
"def template_load_path\n @template_load_path ||= File.expand_path(File.dirname(self.filename))\n end",
"def real_path(filename)\n File.join TEMPLATES_DIR, filename\n end",
"def template_path(template, node)\n cookbook_name = template.cookbook || template.cookbook_name\n cookbook = node.cookbook_collection[cookbook_name]\n cookbook.preferred_filename_on_disk_location(node, :templates, template.source)\nend",
"def template_path_from view, options\n template = view.find_template tentative_template_path(options)\n \n template && template.path\n end",
"def template_name\n self.path.scan(/[^\\/]+$/).first\n end",
"def read_template_file(template_path)\n File.read(@path + '/' + template_path + '.liquid')\n end",
"def template_for path, engine=nil\n templates.cache([path, engine]) do\n if file = template_files(path).first\n ext = File.extname(file)\n ext = ext.empty? ? nil : ext[1..-1]\n engine ||= template_engines[ext].first\n engine.new(file) if engine\n end\n end\n end",
"def template_filepath(filename)\n filepath = File.join(File.dirname(__FILE__), \"coreos/#{filename}.erb\")\n end",
"def read_file(template)\r\n File.read(template)\r\nend",
"def full_template_path\n template_root.join(\"#{@template}.erb\").to_s.squeeze(\"/\")\n end",
"def compile_template_with_guide(extension, template, file_name, local_assigns)\n template = Tourist.trap(template, file_name) if extension.to_sym == :rhtml\n compile_template_without_guide(extension, template, file_name, local_assigns)\n end",
"def template_path\n @options[:template_path]\n end",
"def page_template_filename(page_template)\n ('template_' + page_template)\n end",
"def read_file(template)\n File.read(template)\nend",
"def template_filepath(filename)\n raise ProjectRazor::Error::Slice::InternalError, \"must provide esxi version.\" unless @osversion\n filepath = File.join(File.dirname(__FILE__), \"esxi/#{@osversion}/#{filename}.erb\")\n end",
"def _pick_template(template_path)\n return template_path if template_path.respond_to?(:render)\n\n path = template_path.sub(/^\\//, '')\n if m = path.match(/(.*)\\.(\\w+)$/)\n template_file_name, template_file_extension = m[1], m[2]\n else\n template_file_name = path\n end\n\n # OPTIMIZE: Checks to lookup template in view path\n if template = self.view_paths[\"#{template_file_name}.#{template_format}\"]\n template\n elsif template = self.view_paths[template_file_name]\n template\n elsif (first_render = @_render_stack.first) && first_render.respond_to?(:format_and_extension) &&\n (template = self.view_paths[\"#{template_file_name}.#{first_render.format_and_extension}\"])\n template\n elsif template_format == :js && template = self.view_paths[\"#{template_file_name}.html\"]\n @template_format = :html\n template\n else\n template = ActionView::Template.new(template_path, view_paths)\n template.registerView(self)\n\n if self.class.warn_cache_misses && logger\n logger.debug \"[PERFORMANCE] Rendering a template that was \" +\n \"not found in view path. Templates outside the view path are \" +\n \"not cached and result in expensive disk operations. Move this \" +\n \"file into #{view_paths.join(':')} or add the folder to your \" +\n \"view path list\"\n end\n\n template\n end\n end",
"def mktg_template_filename( options )\n if options[:partial]\n partial = options[:partial]\n if partial =~ /\\//\n partial = partial.sub(/\\/(?!.*\\/)/, '/_')\n else\n partial = \"_#{partial}\"\n end\n if options[:path]\n path = \"#{$pjpp_country_version}/#{$pjpp_template_set}/#{options[:path]}\"\n else\n path = \"#{$pjpp_country_version}/#{$pjpp_template_set}/#{params[:controller]}\"\n end\n return \"#{path}/#{partial}.rhtml\"\n else\n action = options[:action] || params[:action]\n return \"#{$pjpp_country_version}/#{$pjpp_template_set}/#{params[:controller]}/#{action}.rhtml\"\n end\n end",
"def template!(path, full_paths = T.unsafe(nil)); end",
"def template\n Liquid::Template.parse(template_content(template_name))\n end",
"def template( name )\n\t\ttemplate_name = \"#{name}.erb\"\n\t\ttemplate = self.template_search_path.\n\t\t\tmap {|dir| dir + template_name }.\n\t\t\tfind {|tmpl| tmpl.exist? }\n\n\t\ttemplate or raise Foreman::Export::Exception,\n\t\t\t\"Can't find the %p template in any of: %p\" %\n\t\t\t[ name, self.template_search_path.map(&:to_s) ]\n\n\t\terbtmpl = ERB.new( template.read, nil, '<%>' )\n\tend",
"def template\n return @template if @template\n\n # If they sent any instance-level options use that instead of the class's.\n if @template_path || @template_extension || @template_name || @template_file\n @template = templateify(File.read(template_file))\n else\n @template = self.class.template\n end\n end",
"def get_template_from_file(file_path)\n template_text = nil\n\n File.open(file_path, 'r') do |f_in|\n template_text = f_in.read\n end\n\n return template_text\n end",
"def find_template_extension_from_handler_with_generic_paths(template_path, template_format = @template.template_format)\r\n extension = find_template_extension_from_handler_without_generic_paths(template_path, template_format)\r\n if extension.blank? and search_generic_view_paths?\r\n self.class.template_handler_extensions.each do |handler_extension|\r\n return handler_extension if controller.find_generic_base_path_for(template_path, handler_extension)\r\n end\r\n end\r\n extension\r\n end",
"def template_for(path)\n path = File.expand_path(path) \n METHOD_LIST[path] ||= begin\n unless File.exists?(path) \n raise ArgumentError, \"Could not find a template at #{path}.*\"\n end\n inline_template(path)\n end\n end",
"def template(template)\n @template = \"#{Aina::TEMPLATES_DIR}/#{template}\" if template\n end",
"def extensionless_path(file)\n app.cache.fetch(:extensionless_path, file) do\n path = file.dup\n\n end_of_the_line = false\n while !end_of_the_line\n if !::Tilt[path].nil?\n path = path.sub(File.extname(path), \"\")\n else\n end_of_the_line = true\n end\n end\n\n # If there is no extension, look for one\n if File.extname(path).empty?\n input_ext = File.extname(file)\n \n if !input_ext.empty?\n input_ext = input_ext.split(\".\").last.to_sym\n if app.template_extensions.has_key?(input_ext)\n path << \".#{app.template_extensions[input_ext]}\"\n end\n end\n end\n \n path\n end\n end",
"def browse_catalog_for_a_template(catalog_path, template_name)\n template_path = catalog_path.join(template_name)\n\n if Dir.exist?(template_path)\n return template_path\n end\n\n return nil\n end",
"def loadTemplate\n\t\t@template = File.read(@templateFile)\n\tend",
"def loadTemplate\n\t\t@template = File.read(@templateFile)\n\tend",
"def template_content(template_file)\n File.read(File.expand_path(find_in_source_paths(template_file)))\n end",
"def template\n raise \"Template was not loaded: #{@template}\" if !@loadOK\n @template\n end"
] |
[
"0.68350315",
"0.67410886",
"0.6671121",
"0.6603019",
"0.6590045",
"0.65762275",
"0.6571085",
"0.65390545",
"0.6436278",
"0.64287364",
"0.6421778",
"0.6420174",
"0.6385109",
"0.63465685",
"0.63382506",
"0.63286084",
"0.62684655",
"0.6265778",
"0.6265469",
"0.62527573",
"0.6242827",
"0.6229649",
"0.6224104",
"0.61692345",
"0.61630267",
"0.61610603",
"0.61554015",
"0.61443925",
"0.61406636",
"0.6138882",
"0.612685",
"0.61215633",
"0.6116086",
"0.6107046",
"0.61012155",
"0.6091511",
"0.6089627",
"0.6087951",
"0.6078169",
"0.6047432",
"0.60289997",
"0.6010424",
"0.6006458",
"0.60012525",
"0.59986603",
"0.599686",
"0.59798825",
"0.59798825",
"0.5961998",
"0.59436315",
"0.59243435",
"0.5914817",
"0.5914817",
"0.58863944",
"0.5884525",
"0.5884525",
"0.587454",
"0.5869536",
"0.58575517",
"0.58551717",
"0.58546257",
"0.5852193",
"0.5837368",
"0.58167195",
"0.5810631",
"0.5799422",
"0.57895017",
"0.5788824",
"0.57829505",
"0.5771486",
"0.57688355",
"0.5761636",
"0.5759873",
"0.57505476",
"0.5741637",
"0.5739328",
"0.5738216",
"0.5736222",
"0.5735206",
"0.57303756",
"0.57299495",
"0.57249135",
"0.57218677",
"0.57138306",
"0.5694445",
"0.5686869",
"0.5686866",
"0.56787837",
"0.5665519",
"0.5663236",
"0.5662288",
"0.5654999",
"0.5652126",
"0.56338024",
"0.5631332",
"0.5618575",
"0.5617123",
"0.5617123",
"0.56163347",
"0.56160575"
] |
0.776013
|
0
|
Internal: retrieves a list of paths that should be searched by looking the `SNP_PATH` environment variable or falling back to the default path.
|
def dir_list
path_from_env || default_path
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def path_from_env\n ENV['SNP_PATH'] && ENV['SNP_PATH'].split(':')\n end",
"def search_paths\n if Facter::Util::Config.is_windows?\n ENV['PATH'].split(File::PATH_SEPARATOR)\n else\n # Make sure facter is usable even for non-root users. Most commands\n # in /sbin (like ifconfig) can be run as non priviledged users as\n # long as they do not modify anything - which we do not do with facter\n ENV['PATH'].split(File::PATH_SEPARATOR) + [ '/sbin', '/usr/sbin' ]\n end\n end",
"def get_all_path\n # some default directories\n env_paths = []\n env_paths << \"/bin\"\n env_paths << \"/usr/bin\"\n env_paths << \"/usr/local/bin\"\n env_paths << \"/sbin\"\n env_paths << \"/usr/sbin\"\n env_paths << \"/usr/local/sbin\"\n env_paths << \"/opt/bin\"\n env_paths += cmd_exec(\"echo $PATH\").split(\":\")\n env_paths.uniq\n end",
"def paths_from_env(env_var, default)\n split_paths(ENV.fetch(env_var, default))\n end",
"def lookup_paths\n if list = ENV['RUBY_LIBRARY']\n list.split(/[:;]/)\n #elsif File.exist?(path_file)\n # File.readlines(path_file).map{ |x| x.strip }.reject{ |x| x.empty? || x =~ /^\\s*\\#/ }\n elsif ENV['GEM_PATH']\n ENV['GEM_PATH'].split(/[:;]/).map{ |dir| File.join(dir, 'gems', '*') }\n elsif ENV['GEM_HOME']\n ENV['GEM_HOME'].split(/[:;]/).map{ |dir| File.join(dir, 'gems', '*') }\n else\n warn \"No Ruby libraries.\"\n []\n end\n end",
"def default_path\n ['~/.snp']\n end",
"def init_paths\n drive = session.sys.config.getenv('SystemDrive')\n\n files =\n [\n 'unattend.xml',\n 'autounattend.xml'\n ]\n\n target_paths =\n [\n \"#{drive}\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\sysprep\\\\\",\n \"#{drive}\\\\Windows\\\\panther\\\\\",\n \"#{drive}\\\\Windows\\\\Panther\\Unattend\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\\"\n ]\n\n paths = []\n target_paths.each do |p|\n files.each do |f|\n paths << \"#{p}#{f}\"\n end\n end\n\n # If there is one for registry, we add it to the list too\n reg_path = get_registry_unattend_path\n paths << reg_path unless reg_path.empty?\n\n return paths\n end",
"def search_path\n result = []\n\n result += $LOAD_PATH.map { |path| File.expand_path('facter', path) }\n\n if @environment_vars.include?(\"FACTERLIB\")\n result += @environment_vars[\"FACTERLIB\"].split(File::PATH_SEPARATOR)\n end\n\n # silently ignore bad search paths from $LOAD_PATH and FACTERLIB\n result = result.select { |path| valid_search_path?(path) }\n\n # This allows others to register additional paths we should search.\n # We are assuming that these are already absolute paths.\n result += Facter.search_path.select do |path|\n valid = valid_search_path?(path)\n Facter.warn \"Excluding #{path} from search path. Fact file paths must be an absolute directory\" unless valid\n valid\n end\n\n # remove any dups\n result.uniq\n end",
"def paths\n Array(config.path).map(&:to_s)\n end",
"def base_paths\n [Pkg::Config.yum_repo_path, Pkg::Config.apt_repo_staging_path, Pkg::Config.apt_repo_path, '/opt/downloads'].compact\n end",
"def monitored_paths\n paths = Dir['**/*'].select do |path|\n @script.patterns.any? {|p| path.match(p) }\n end\n paths.push(@script.path).compact!\n paths.map {|path| Pathname(path).expand_path }\n end",
"def get_paths(namespace = MAIN_NAMESPACE)\n @paths[namespace] || []\n end",
"def paths_from_project_root\n @paths_from_project_root ||=\n [Config.project_root]\n end",
"def relative_paths(smart_path)\n root = smart_path.generic_path\n found = []\n @path_index.each do |path|\n found << Pathname(path).relative_path_from(Pathname(root)).to_s if smart_path.valid_path?(path)\n end\n found\n end",
"def default_modules_paths\n dirs = []\n do_initialize if Puppet[:codedir].nil?\n # add the puppet-repl directory so we can load any defined functions\n dirs << File.join(Puppet[:environmentpath],default_puppet_env_name,'modules') unless Puppet[:environmentpath].empty?\n dirs << Puppet.settings[:basemodulepath].split(':')\n dirs.flatten\n end",
"def path\n [[\"path\"].concat(ENV['PATH'].split(File::PATH_SEPARATOR))]\n end",
"def paths_from_software_gems\n @paths_from_software_gems ||=\n Array(Config.software_gems).inject([]) do |array, name|\n if (spec = Gem::Specification.find_all_by_name(name).first)\n array << File.expand_path(spec.gem_dir)\n end\n\n array\n end\n end",
"def gem_paths\n @_gem_paths ||= (ENV['GEM_PATH'] || ENV['GEM_HOME']).split(/[:;]/)\n end",
"def search_paths\n # NOTE: Do not cache this list, specific generators\n # will modify it with their own lookups\n create_search_paths.select { |path| File.directory?(path) }\n end",
"def rpaths\n command(:LC_RPATH).map(&:path).map(&:to_s)\n end",
"def paths\n @paths ||= []\n @paths\n end",
"def paths\n @paths ||= []\n @paths\n end",
"def yay_paths\n\t\t\tresult = [current_path,local_yay_path,global_yay_path]\n\t\t\tgempaths.each { |v| \n\t\t\t\tresult.push gempath_to_yaypath(v)\n\t\t\t}\n\t\t\treturn result\n\t\tend",
"def default_assembly_paths\n paths = []\n paths.concat %w( bin ).map{ |dir| \"#{root_path}/#{dir}\"}.select{ |dir| File.directory?(dir) }\n end",
"def default_modules_paths\n dirs = []\n # add the puppet-debugger directory so we can load any defined functions\n dirs << File.join(Puppet[:environmentpath], default_puppet_env_name, 'modules') unless Puppet[:environmentpath].empty?\n dirs << Puppet.settings[:basemodulepath].split(File::PATH_SEPARATOR)\n dirs.flatten\n end",
"def base_paths\n @base_paths ||= find_base_paths\n end",
"def possible_paths_for(path)\n possible_paths[path] ||= [\n paths_from_project_root,\n paths_from_local_software_dirs,\n paths_from_software_gems,\n ].flatten.inject([]) do |array, directory|\n destination = File.join(directory, path)\n\n if File.directory?(destination)\n array << destination\n end\n\n array\n end\n end",
"def default_application_paths\n paths = []\n\n # Followed by the standard includes.\n paths.concat %w(\n config\n lib\n lib/core_ext\n app\n app/models\n app/controllers\n app/converters\n app/helpers\n ).map { |dir| \"#{root_path}/#{dir}\" }.select { |dir| File.directory?(dir) }\n end",
"def cspsearchpath\n eval @paths_key\n end",
"def test_paths_with_dependent_scl\n prefix = '/some/prefix'\n scl_name = 'ruby_x'\n\n ENV['X_SCLS'] = \"#{@scl} #{scl_name}\" # enabled scls\n ENV['GEM_PATH'] = \"#{prefix}/#{scl_name}/root/usr/share/gems\"\n\n default_locations = { :system => \"/opt/cpanel/#{@scl}/root/usr\",\n :local => \"/opt/cpanel/#{@scl}/root/usr/local\",\n :\"#{scl_name}_system\" => \"#{prefix}/#{scl_name}/root/usr\",\n :\"#{scl_name}_local\" => \"#{prefix}/#{scl_name}/root/usr/local\" }\n\n assert_equal default_locations, Gem.default_locations\n\n default_dirs = { :system => { :bin_dir => \"/opt/cpanel/#{@scl}/root/usr/#{@bin_dir}\",\n :gem_dir => \"/opt/cpanel/#{@scl}/root/usr/share/gems\",\n :ext_dir => \"/opt/cpanel/#{@scl}/root/usr/lib64/gems\" },\n :local => { :bin_dir => \"/opt/cpanel/#{@scl}/root/usr/local/#{@bin_dir}\",\n :gem_dir => \"/opt/cpanel/#{@scl}/root/usr/local/share/gems\",\n :ext_dir => \"/opt/cpanel/#{@scl}/root/usr/local/lib64/gems\" },\n :\"#{scl_name}_system\" => { :bin_dir => \"#{prefix}/#{scl_name}/root/usr/#{@bin_dir}\",\n :gem_dir => \"#{prefix}/#{scl_name}/root/usr/share/gems\",\n :ext_dir => \"#{prefix}/#{scl_name}/root/usr/lib64/gems\" },\n :\"#{scl_name}_local\" => { :bin_dir => \"#{prefix}/#{scl_name}/root/usr/local/#{@bin_dir}\",\n :gem_dir => \"#{prefix}/#{scl_name}/root/usr/local/share/gems\",\n :ext_dir => \"#{prefix}/#{scl_name}/root/usr/local/lib64/gems\" } }\n assert_equal default_dirs, Gem.default_dirs\n end",
"def modules_paths\n puppet_environment.full_modulepath\n end",
"def modules_paths\n puppet_environment.full_modulepath\n end",
"def find_whitelisted_path(rpath)\n (Sqreen.whitelisted_paths || []).find do |path|\n rpath.start_with?(path)\n end\n end",
"def new_path_var(env)\n rbenv_root = exec_rbenv_root\n return env['PATH'] if rbenv_root.empty?\n\n re = /^#{Regexp.escape rbenv_root}\\/(versions|plugins|libexec)\\b/\n paths = env['PATH'].split(':')\n paths.reject! { |p| p =~ re }\n\n paths.join(':')\n end",
"def lookup(glob, flags=0)\n pwd = File.expand_path(Dir.pwd)\n home = File.expand_path('~')\n while pwd != '/' && pwd != home\n paths = Dir.glob(File.join(pwd, glob), flags)\n return paths unless paths.empty?\n break if ROOT_INDICATORS.any?{ |r| File.exist?(File.join(pwd, r)) }\n pwd = File.dirname(pwd)\n end\n return []\n end",
"def path_components\n ENV[\"PATH\"].split(File::PATH_SEPARATOR)\n end",
"def known_cookbook_paths\n # Keep a cache of it for performance.\n unless defined?(@cookbook_paths)\n config_file = \"#{@repository_path}/config.rb\"\n @cookbook_paths = (\n ['cookbooks'] +\n if File.exist?(config_file)\n # Read the knife configuration to get cookbook paths\n dsl_parser = DslParser.new\n dsl_parser.parse(config_file)\n cookbook_path_call = dsl_parser.calls.find { |call_info| call_info[:method] == :cookbook_path }\n cookbook_path_call.nil? ? [] : cookbook_path_call[:args].first\n else\n []\n end\n ).\n map do |dir|\n # Only keep dirs that actually exist and are part of our repository\n full_path = dir.start_with?('/') ? dir : File.expand_path(\"#{@repository_path}/#{dir}\")\n full_path.start_with?(@repository_path) && File.exist?(full_path) ? full_path.gsub(\"#{@repository_path}/\", '') : nil\n end.\n compact.\n sort.\n uniq\n end\n @cookbook_paths\n end",
"def locate(bin_glob, env = nil)\n path << ENV[env] if env && ENV.key?(env) && File.exist?(ENV[env])\n\n (path << Dir.pwd).each do |path|\n files = Dir.glob(File.expand_path(File.join(path, bin_glob)))\n return files unless files.empty?\n end\n\n nil\n end",
"def paths\n self.config[:paths]\n end",
"def load_paths\n @_load_paths_was = %w(lib models shared).map { |path| Padrino.root(path) }\n @_load_paths ||= @_load_paths_was\n end",
"def alternate_bin_paths\n [\n PDK::Util::RubyVersion.bin_path,\n File.join(PDK::Util::RubyVersion.gem_home, 'bin'),\n PDK::Util::RubyVersion.gem_paths_raw.map { |gem_path_raw| File.join(gem_path_raw, 'bin') },\n PDK::Util.package_install? ? File.join(PDK::Util.pdk_package_basedir, 'bin') : nil\n ].flatten.compact\n end",
"def list_paths\n @paths = RouteRecognizer.new.initial_path_segments.reject do |path|\n %w(assets rails).include? path\n end\n end",
"def cookbooks_paths\n fetch(:cookbooks_paths).to_a.select { |path| File.exists? path }\n end",
"def mount_paths_listing\n Dir[\"#{mounts_path}/*\"]\n end",
"def paths\n @paths ||= [\n data_path,\n output_path,\n converted_path,\n converted_fail_path,\n unpacked_path,\n unpacked_fail_path,\n recreated_path,\n ]\n end",
"def paths\n f = File.open(@path)\n f.grep(FILE_NAME_PATTERN) { $1 }\n end",
"def require_paths\n raw_data['require_paths'] || []\n end",
"def paths\n configuration.paths\n end",
"def default_load_paths\n return if ENV['DYLD_LIBRARY_PATH'].nil?\n paths = %w(\n models\n controllers\n db\n ).map {|dir| \"#{Pathname.new(ENV['DYLD_LIBRARY_PATH'] + \"../../../\").cleanpath}/#{dir}\" }.select { |dir| File.directory?(dir) }\n end",
"def load_paths\n [root.join('lib'), root.join('spec')].join(':')\n end",
"def get_possible_config_file_names(file_name_prefix='default')\n names = []\n # give priority to environment setting.\n names << ENV['GGB_CONFIG_FILE'] unless ENV['GGB_CONFIG_FILE'].nil?\n # add standard locations.\n names.concat [\"/usr/local/ctools/app/ctools/tl/home/#{file_name_prefix}.yml\", \"./#{file_name_prefix}.yml\", './default.yml']\nend",
"def path\n @paths.each do |name, path|\n raise Exceptions::BadlyConfigured.new(name) unless path.size > 1\n end\n @paths\n end",
"def get_path\n cmd_exec('echo $PATH').to_s\n rescue\n raise \"Unable to determine path\"\n end",
"def possible_paths_dir(opts)\n # partial_path is implemented in each store.\n @storage_paths.map { |path| File.join(path, partial_path(opts)) }\n end",
"def find_paths(dir=\"\")\n base = File.join(@source, dir)\n entries = Dir.chdir(base) { filter_entries(Dir[\"*\"]) }\n paths = []\n\n entries.each do |entry|\n absolute_path = File.join(base, entry)\n relative_path = File.join(dir, entry)\n\n if File.directory?(absolute_path)\n paths.concat find_paths(relative_path)\n else\n paths << absolute_path\n end\n end\n paths\n end",
"def setup_paths\n # This REPLACE_DEFAULT_PATH_WITH_DRIVER constant gets defined by bin/driver when we want\n # to run a command in the context of a driver instead of the main rails app.\n if defined?(REPLACE_DEFAULT_PATH_WITH_DRIVER)\n replace_rails_paths_with_driver(REPLACE_DEFAULT_PATH_WITH_DRIVER)\n else\n add_every_driver_to_rails_paths\n end\n end",
"def default_paths\n [ '.' ]\n end",
"def mysql_config_paths\n ENV['PATH'].split(File::PATH_SEPARATOR).collect do |path|\n [ \"#{path}/mysql_config\", \"#{path}/mysql_config5\" ].\n detect { |bin| File.exist?(bin) }\n end\nend",
"def mysql_config_paths\n ENV['PATH'].split(File::PATH_SEPARATOR).collect do |path|\n [ \"#{path}/mysql_config\", \"#{path}/mysql_config5\" ].\n detect { |bin| File.exist?(bin) }\n end\nend",
"def search_external_path\n Options.external_dir\n end",
"def ignorable_paths\n []\n end",
"def get_win_server_folder_path(ends_with_slash,starting_path,arr,sep)\n list = []\n if Dir.exists?(app_config(:win_ftp_root)) && Dir.chdir(app_config(:win_ftp_root))\n glob_value = ends_with_slash ? \"#{arr.join(sep)}/*\" : \"#{arr.join(sep)}*\"\n count = starting_path.count \"/\"\n glob_value = \"#{starting_path.split(\"/\").last}*\" if count == 1 and starting_path[0] == \"/\"\n #list=Dir.glob(glob_value)\n glob_value_dc = glob_value.downcase\n glob_value_cc = glob_value.camelcase.split(\"::\").join(\"/\")\n glob_value_uc = glob_value.upcase\n list=Dir.glob(glob_value_dc)\n list=list+Dir.glob(glob_value_cc)\n list=list+Dir.glob(glob_value_uc)\n end\n return list\n end",
"def resolve_paths names\n if names.any?\n paths = []\n for name in names\n paths.concat Array(resolve_name name)\n end\n paths\n else\n Array(resolve_as_directory test_dir_name)\n end\n end",
"def available_managed_paths_for_site_creation\n return @available_managed_paths_for_site_creation\n end",
"def configure_paths\n @source = Pathname.new(configuration[:source]).expand_path\n @root = Pathname.new(configuration[:root]).expand_path\n # Systems like Homebrew and Stow symlink the scripts into $PATH,\n # but RUNNER_BASE_DIR is not relative to the symlink.\n if (@source + control_script_name).symlink?\n @source = (@source + control_script_name).realpath.parent\n end\n end",
"def component_paths platform\n @component_paths||={} \n @component_paths['pc']||=FileList[\"#{@current_dir}/**/build.cfg\"].exclude(/\\/gen\\//,/\\/dsl\\//,/\\/programs\\//,/\\/mocks\\//,/\\/common/).pathmap('%d')\n @component_paths['common']||=FileList[\"#{@current_dir}/**/build.cfg\"].exclude(/\\/gen\\//,/\\/dsl\\//,/\\/programs\\//,/\\/mocks\\//).pathmap('%d')\n return @component_paths[platform]+@component_paths['common']\n end",
"def file_path_list\n @file_path_list ||= self.class.default_file_path_list\n end",
"def path\n @path || File.expand_path(ENV['NEXUS_CONFIG'] || DEFAULT_FILE)\n end",
"def sdk_dir_list\n src_dirs = ENV['TM_FLEX_SDK_SEARCH_PATHS'] || FLEX_DIRS.join(\":\")\n src_dirs\n end",
"def _potential_directories\n dirs = []\n dirs << _vim_user_dir\n dirs << _vim_system_dir\n return dirs.compact.map { |dir| File.expand_path(dir) }\n end",
"def configured_require_paths\n return ['lib'] if directory.empty?\n return [File.join(directory, 'lib')] if config.require_paths.empty?\n config.require_paths.map{|p| File.join(directory, p)}\n end",
"def source_paths\n paths = raw_require_paths.dup\n\n if have_extensions?\n ext_dirs = extensions.map do |extension|\n extension.split(File::SEPARATOR, 2).first\n end.uniq\n\n paths.concat ext_dirs\n end\n\n paths.uniq\n end",
"def paths\n @paths ||= {}\n end",
"def possible_paths(opts)\n # file_names is implemented in each store.\n file_names(opts).map { |file_name| possible_paths_file(opts, file_name) }.flatten\n end",
"def default_envs\n {\n \"PATH\" => \"\"\n }\n end",
"def env_path\n \"#{resolve_dir}:#{ENV['PATH']}:#{VENDOR_PATH}\"\n end",
"def paths\n unless @paths\n @paths = []\n @paths << project._(:source, :main, :assets) if File.exist?(project._(:source, :main, :assets))\n end\n @paths\n end",
"def PATH()\n path = []\n list.each do |name|\n lib = Library[name] # TODO: This activates each library, probably not what we want, get max version instead?\n path << lib.bindir if lib.bindir?\n end\n path.join(windows_platform? ? ';' : ':')\n end",
"def defined_paths()\n return root_defined_path_part\n end",
"def paths\n @paths ||= {}.with_indifferent_access\n end",
"def script_path\n @script_paths ||= Pathname.new(source_dir).join(data['script_path'] || './scripts').to_s\n end",
"def existing_paths(opts)\n possible_paths(opts).select { |file| File.exist? file }\n end",
"def load_paths\n unless @load_paths\n @load_paths = []\n \n if File.directory?(app_path)\n @load_paths << app_path\n \n # Sort for consistency across platforms\n @load_paths.concat(Dir[\"#{app_path}/*/\"].map(&:chop).sort!)\n end\n end\n \n @load_paths\n end",
"def page_paths\n @pages_paths ||= Dir[File.join(Serious.pages, '*')].sort\n end",
"def paths_to_pull\n sep = mode == :ssh ? \":\" : \"::\"\n directories.map do |dir|\n \"#{sep}'#{dir.sub(%r{^~/}, \"\").sub(%r{/$}, \"\")}'\"\n end.join(\" \").sub(%r{^#{sep}}, \"\")\n end",
"def preferred_sources(paths)\n paths.collect do |source_path|\n PREFERRED_EXTENSIONS.inject(nil) do |source_file, extension|\n source_file || begin\n path = File.join(@folder, \"#{source_path}.#{extension}\")\n File.exists?(path) ? path : nil\n end\n end\n end.compact\n end",
"def partial_search_paths(requested_partial)\n [].tap do |paths|\n if current_path_nested?\n paths << \"#{current_path.split('/')[0..-2].join('/')}/#{requested_partial.pluralize}\"\n end\n\n paths << current_path\n paths << config(:base_path)\n end.uniq\n end",
"def load_paths\n @load_paths ||= Config::LoadPaths.new\n end",
"def search(f_name) \r\n yield ENV['PATH'].split(';').map {|p| File.join p, f_name}.find {|p| File.file? p and File.executable? p}\r\nend",
"def whereis(prog, path=ENV['PATH'])\n dirs = []\n path.split(File::PATH_SEPARATOR).each do |dir|\n if File::ALT_SEPARATOR\n if prog.include?('.')\n f = File.join(dir,prog)\n if File.executable?(f) && !File.directory?(f)\n if block_given?\n yield f.gsub(/\\//,'\\\\')\n else\n dirs << f.gsub(/\\//,'\\\\')\n end\n end\n else\n Win32Exts.find_all do |ext|\n f = File.join(dir,prog+ext)\n if File.executable?(f) && !File.directory?(f)\n if block_given?\n yield f.gsub(/\\//,'\\\\')\n else\n dirs << f.gsub(/\\//,'\\\\')\n end\n end\n end\n end\n else\n f = File.join(dir,prog)\n if File.executable?(f) && !File.directory?(f)\n if block_given?\n yield f\n else\n dirs << f\n end\n end\n end\n end\n dirs.empty? ? nil : dirs\n end",
"def paths\n Array(@ruhoh.cascade.paths.map{|h| h[\"path\"]}).map { |path|\n collection_path = File.join(path, resource_name)\n next unless File.directory?(collection_path)\n\n collection_path\n }.compact\n end",
"def paths\n Array.new(size) do |index|\n \"/org/gnome/settings-daemon/plugins/media-keys/custom-keybindings/custom#{index}/\"\n end\n end",
"def pathlist\n @path\n end",
"def set_initial_path\n `echo $PATH`.split(':').each do |path|\n add_env_path path\n end\nend",
"def gempaths\n\t\t\treturn Gem.path\n\t\tend",
"def root_path\n environment.paths.detect { |path| pathname.to_s[path] }\n end",
"def rc_dirs; end",
"def common_src_dirs\n\tsrc_dirs_matches = common_src_dir_list.split(\":\")\n\tsrc_dirs_matches\nend",
"def existing_resource_snippets_paths\n Dir[\"#{snippets_path}/*#{template_ext}\"].reject { |path| File.basename(path).start_with?('_') }\n end",
"def find_all_paths\n found_paths = []\n \n explore(found_paths, nil, @start_node)\n \n found_paths\n end"
] |
[
"0.72445565",
"0.68553615",
"0.6469568",
"0.64056104",
"0.639273",
"0.6331441",
"0.6125215",
"0.6104536",
"0.60263735",
"0.59498423",
"0.5897598",
"0.588875",
"0.5884232",
"0.57936925",
"0.5776198",
"0.57615453",
"0.57575643",
"0.5755106",
"0.57244617",
"0.57162446",
"0.5685793",
"0.5685793",
"0.56812465",
"0.5668021",
"0.56142306",
"0.5603138",
"0.5577438",
"0.5553673",
"0.55481887",
"0.5540985",
"0.55392736",
"0.5534394",
"0.55268824",
"0.5516508",
"0.551023",
"0.54905534",
"0.5469628",
"0.5464172",
"0.5462343",
"0.54587734",
"0.5436379",
"0.5419444",
"0.5418013",
"0.53992224",
"0.5396099",
"0.5389925",
"0.53837687",
"0.53721577",
"0.5371883",
"0.53563094",
"0.53487045",
"0.5344083",
"0.5324284",
"0.5303399",
"0.52917",
"0.52859694",
"0.5285884",
"0.5246517",
"0.5246517",
"0.52263945",
"0.5219366",
"0.52086145",
"0.52082217",
"0.5206304",
"0.52026856",
"0.51946336",
"0.51945627",
"0.5188567",
"0.51882964",
"0.51852024",
"0.5182565",
"0.5166954",
"0.51668507",
"0.51628953",
"0.5159413",
"0.515755",
"0.5155962",
"0.5155272",
"0.5154677",
"0.51449496",
"0.5138982",
"0.51345915",
"0.51279306",
"0.51197636",
"0.5119343",
"0.51142544",
"0.5103234",
"0.50992006",
"0.509663",
"0.509427",
"0.50883406",
"0.5074252",
"0.507083",
"0.5059768",
"0.50594604",
"0.50593734",
"0.50560623",
"0.50470036",
"0.50435084",
"0.5039184"
] |
0.6612498
|
2
|
Internal: parses the SNP_PATH environment variable, if it is set. The format of this variable follows the same convention of the shell's PATH variable: a series of directories separated by a collon.
|
def path_from_env
ENV['SNP_PATH'] && ENV['SNP_PATH'].split(':')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def path_components\n ENV[\"PATH\"].split(File::PATH_SEPARATOR)\n end",
"def search_paths\n if Facter::Util::Config.is_windows?\n ENV['PATH'].split(File::PATH_SEPARATOR)\n else\n # Make sure facter is usable even for non-root users. Most commands\n # in /sbin (like ifconfig) can be run as non priviledged users as\n # long as they do not modify anything - which we do not do with facter\n ENV['PATH'].split(File::PATH_SEPARATOR) + [ '/sbin', '/usr/sbin' ]\n end\n end",
"def new_path_var(env)\n rbenv_root = exec_rbenv_root\n return env['PATH'] if rbenv_root.empty?\n\n re = /^#{Regexp.escape rbenv_root}\\/(versions|plugins|libexec)\\b/\n paths = env['PATH'].split(':')\n paths.reject! { |p| p =~ re }\n\n paths.join(':')\n end",
"def path\n [[\"path\"].concat(ENV['PATH'].split(File::PATH_SEPARATOR))]\n end",
"def paths_from_env(env_var, default)\n split_paths(ENV.fetch(env_var, default))\n end",
"def get_path\n cmd_exec('echo $PATH').to_s\n rescue\n raise \"Unable to determine path\"\n end",
"def set_initial_path\n `echo $PATH`.split(':').each do |path|\n add_env_path path\n end\nend",
"def lookup_paths\n if list = ENV['RUBY_LIBRARY']\n list.split(/[:;]/)\n #elsif File.exist?(path_file)\n # File.readlines(path_file).map{ |x| x.strip }.reject{ |x| x.empty? || x =~ /^\\s*\\#/ }\n elsif ENV['GEM_PATH']\n ENV['GEM_PATH'].split(/[:;]/).map{ |dir| File.join(dir, 'gems', '*') }\n elsif ENV['GEM_HOME']\n ENV['GEM_HOME'].split(/[:;]/).map{ |dir| File.join(dir, 'gems', '*') }\n else\n warn \"No Ruby libraries.\"\n []\n end\n end",
"def parse_path(path_chunks)\n path = path_chunks[1]\n subpath_chunks = path.split(\"/\")\n base_dir = subpath_chunks[1]\n remaining_path = subpath_chunks[2..-1].join(\"/\")\n [base_dir, remaining_path]\n end",
"def find_on_path( s )\n # for now, Windows-only; parameter s with or without path\n if ARCH != 'w32'\n return nil\n end\n ENV['PATH'].gsub( \"\\\\\", \"/\" ).split( /;/ ).each do |d|\n d = File.expand_path( d ) # this seems a syntactic operation\n s_full = d.sub( /\\/$/, '' ) + '/' + s\n if test( ?d, d ) and test( ?f, s_full )\n return s_full\n end\n ENV['PATHEXT'].split( /;/ ).each do |e|\n # components of PATHEXT should include leading dot\n s_full = d.sub( /\\/$/, '' ) + '/' + s + e\n if test( ?f, s_full )\n return s_full\n end\n end # do |e|\n end # do |d|\n return nil\nend",
"def scp_path(path)\n if self[:platform].include?('cisco_nexus')\n @home_dir ||= execute('pwd')\n answer = \"#{@home_dir}/#{File.basename(path)}\"\n answer << '/' if /\\/$/.match?(path)\n return answer\n end\n path\n end",
"def cspsearchpath\n eval @paths_key\n end",
"def get_all_path\n # some default directories\n env_paths = []\n env_paths << \"/bin\"\n env_paths << \"/usr/bin\"\n env_paths << \"/usr/local/bin\"\n env_paths << \"/sbin\"\n env_paths << \"/usr/sbin\"\n env_paths << \"/usr/local/sbin\"\n env_paths << \"/opt/bin\"\n env_paths += cmd_exec(\"echo $PATH\").split(\":\")\n env_paths.uniq\n end",
"def path\n env[PATH] ||= (env.has_key?(GIT) ? env[GIT].path : Dir.pwd)\n end",
"def env_path\n \"#{resolve_dir}:#{ENV['PATH']}:#{VENDOR_PATH}\"\n end",
"def path_setup\n raise ArgumentError, \"Required path param missing\" unless path_params?\n path_params.values.join(\".\")\n end",
"def split_file_path(path)\n path.split(File::SEPARATOR, 2) unless path == \"\" or Puppet::Util.absolute_path?(path)\n end",
"def env_path\n @bin_resolver.env_path\n end",
"def unify_path(s)\r\n p = s.frozen? ? s.dup : s\r\n p.gsub!( /\\\\/, '/' )\r\n p = \"#{$1.upcase}/#{$POSTMATCH}\" if p =~ REGEX_DISK\r\n if RUBY_PLATFORM =~ REGEX_CYGWIN\r\n\tif p =~ REGEX_CYGDRIVE\r\n\t p = \"/cygdrive/#{$1.upcase}/#{$POSTMATCH}\" \r\n\telse\r\n\t p.sub!( REGEX_DISK2, '/cygdrive/\\1/' ) if @name == 'PATH'\r\n\tend\r\n end\r\n return p\r\n end",
"def split_nsh_path(path)\n result = [\"\",path]\n result[0] = path.split(\"/\")[2] if path.start_with?(\"//\")\n result[1] = \"/#{path.split(\"/\")[3..-1].join(\"/\")}\" if path.start_with?(\"//\") \n result\n end",
"def add_env_path path\n paths = `/bin/launchctl getenv PATH`.chomp.split(':').map(&:chomp).unshift(path).uniq * ':'\n `/bin/launchctl setenv PATH #{paths}`\n\n ENV['PATH'] = ENV['PATH'].chomp.split(':').unshift(path).map(&:chomp).uniq * ':'\nend",
"def PATH()\n path = []\n list.each do |name|\n lib = Library[name] # TODO: This activates each library, probably not what we want, get max version instead?\n path << lib.bindir if lib.bindir?\n end\n path.join(windows_platform? ? ';' : ':')\n end",
"def path_without_gem_dir\n paths = ENV['PATH'].split(':')\n system_gem_dir = \"#{Bundler.bundle_path}/bin\"\n @logger.debug(\"System gem dir: #{system_gem_dir}\")\n paths.delete_if { |p| p.downcase == system_gem_dir.downcase }\n paths.join(':')\n end",
"def expand_path(path)\n File.expand_path(\n path.gsub(\n 'CLIPPDIR', CLIPPDIR\n ).gsub(\n 'BUILDDIR', BUILDDIR\n )\n )\n end",
"def preprocess_path(path, internal_pwd)\n path = '' unless path\n path.strip!\n\n path = unless File.exists? path\n begin\n instance_eval(path)\n rescue NameError, SyntaxError\n end\n end || path\n\n File.expand_path(path)\n end",
"def root_path\n environment.paths.detect { |path| pathname.to_s[path] }\n end",
"def path_set(new_path)\n if new_path.is_a?(Array)\n new_path = new_path.join(File::PATH_SEPARATOR)\n end\n ENV[\"PATH\"] = new_path\n end",
"def platform_specific_path(path)\n if RUBY_PLATFORM =~ /mswin|mingw|windows/\n system_drive = ENV['SYSTEMDRIVE'] ? ENV['SYSTEMDRIVE'] : \"\"\n path = win_slashify File.join(system_drive, path.split('/')[2..-1])\n end\n\n path\n end",
"def locate_env_index(path)\n regexp = Regexp.new(\"/#{Terraspace.env}/\")\n index = path.index(regexp)\n unless index\n logger.error \"ERROR: Unable to find the #{Terraspace.env} position in the prefix\"\n logger.error \"path used: #{path}\"\n exit 1\n end\n env_chars = Terraspace.env.size + 1\n index + env_chars\n end",
"def path_comps path\n path.nil? || path.empty? ? [] : path[1..(path[-1] == \"/\" ? -2 : -1)].split('/')\n end",
"def add_build_dirs_to_env\n ENV[\"LD_LIBRARY_PATH\"] = BUILD_DIR unless OS.windows?\n paths = ENV[\"PATH\"].split(File::PATH_SEPARATOR)\n return if paths.include?(BUILD_DIR)\n\n ENV[\"PATH\"] = BUILD_DIR + File::PATH_SEPARATOR + ENV[\"PATH\"] if OS.windows?\n end",
"def cygwin_path(path)\n if RUBY_PLATFORM.include?('cygwin') && path.index('/') == 0\n IO.popen(\"cygpath -m #{path.include?(':') ? '-p' : ''} #{path.shellescape}\").readline.chomp.gsub(/;/, '\\\\;')\n else\n path\n end\n end",
"def fetch_path(start_path)\n ['', 'config'].each do |directory|\n ['', '.'].each do |prefix|\n path = File.join(start_path, directory, \"#{prefix}#{@file_name}\")\n return path if File.exist?(path)\n end\n end\n nil\n end",
"def init_paths\n drive = session.sys.config.getenv('SystemDrive')\n\n files =\n [\n 'unattend.xml',\n 'autounattend.xml'\n ]\n\n target_paths =\n [\n \"#{drive}\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\sysprep\\\\\",\n \"#{drive}\\\\Windows\\\\panther\\\\\",\n \"#{drive}\\\\Windows\\\\Panther\\Unattend\\\\\",\n \"#{drive}\\\\Windows\\\\System32\\\\\"\n ]\n\n paths = []\n target_paths.each do |p|\n files.each do |f|\n paths << \"#{p}#{f}\"\n end\n end\n\n # If there is one for registry, we add it to the list too\n reg_path = get_registry_unattend_path\n paths << reg_path unless reg_path.empty?\n\n return paths\n end",
"def path(env)\n env['PATH_INFO']\n end",
"def path_key\n env.keys.grep(/\\Apath\\Z/i).first\n end",
"def abspath path\n if path[0] != '/'\n @homedir + '/' + path\n else\n path\n end\n end",
"def fully_qualified_dir_path?(path)\n path[0, 1] == '/'\n end",
"def canonical_path(path)\n if Gem.win_platform?\n unless File.exist?(path)\n raise PDK::CLI::FatalError, _(\"Cannot resolve a full path to '%{path}' as it does not currently exist\") % { path: path }\n end\n Puppet::Util::Windows::File.get_long_pathname(path)\n else\n File.expand_path(path)\n end\n end",
"def construct_puppet_path(host)\n path = %w[puppetbindir facterbindir hierabindir privatebindir].compact.reject(&:empty?)\n # get the PATH defaults\n path.map! { |val| host[val] }\n path = path.compact.reject(&:empty?)\n # run the paths through echo to see if they have any subcommands that need processing\n path.map! { |val| echo_on(host, val) }\n\n separator = host['pathseparator']\n separator = ':' unless host.is_powershell?\n path.join(separator)\n end",
"def expand_path(path)\n if Rscons.phony_target?(path)\n path\n elsif path.is_a?(Array)\n path.map do |path|\n expand_path(path)\n end\n else\n path.sub(%r{^\\^\\^(?=[\\\\/])}, Rscons.application.build_dir).sub(%r{^\\^(?=[\\\\/])}, @build_root).gsub(\"\\\\\", \"/\")\n end\n end",
"def omnibus_expand_path(*paths)\n dir = File.expand_path(File.join(paths))\n dir = \"\" unless dir && File.directory?(dir)\n dir\nend",
"def default_path\n ['~/.snp']\n end",
"def gem_paths\n @_gem_paths ||= (ENV['GEM_PATH'] || ENV['GEM_HOME']).split(/[:;]/)\n end",
"def cspsearchpath=(array)\n eval @paths_key+\"= array\"\n end",
"def path\n if location =~ /^\\/dev/\n \"dev:#{location}\"\n elsif location =~ /iso$/\n \"iso:#{location}\"\n elsif location.is_a?(Integer)\n \"disc:#{location}\"\n elsif location =~ /^disc/\n location\n else\n raise RuntimeError\n end\n end",
"def path\n if location =~ /^\\/dev/\n \"dev:#{location}\"\n elsif location =~ /iso$/\n \"iso:#{location}\"\n elsif location.is_a?(Integer)\n \"disc:#{location}\"\n elsif location =~ /^disc/\n location\n else\n raise RuntimeError\n end\n end",
"def build_path_from_env(env)\n path = env['PATH_INFO']\n path += \"?#{env['QUERY_STRING']}\" unless env['QUERY_STRING'].nil? || env['QUERY_STRING'].empty?\n path\n end",
"def dir_list\n path_from_env || default_path\n end",
"def expand_dir(s)\n buf = s\n\n throw 'FIXME -- handle $(PACKAGE)' if buf =~ /\\$\\(PACKAGE\\)/\n while buf =~ /\\$/\n old = buf.dup\n @dir.each do |k,v|\n buf.gsub!(/\\$\\(#{k.to_s.upcase}\\)/, v)\n end\n # Crude way of bailing out when there are undefined variables\n # like $(DESTDIR)\n break if old == buf and buf =~ /\\$\\(/\n end\n\n Platform.pathspec(buf)\n end",
"def export_bin_dir\n bin_dir = config[:bin]\n return unless bin_dir\n return if ENV['PATH'].split(':').include? bin_dir\n ENV['PATH'] = \"#{bin_dir}:#{ENV['PATH']}\"\n end",
"def path_dir\n File.split(path).first\n end",
"def within_env?(path)\n path.include?(\"/#{Terraspace.env}/\")\n end",
"def LocationPath(path, parsed); end",
"def convert_to_path_params_segments(some_path)\n segs = strip_bookend_slashes(some_path).split('/')\n \n return segs.map{ |seg|\n if ms = seg.match(/(?<=:)\\w+/)\n ms[0].to_sym\n else\n seg\n end\n }\n end",
"def check_path_for_trailing_slashes\n bad_paths = ENV[\"PATH\"].split(File::PATH_SEPARATOR).select { |p| p[-1..-1] == \"/\" }\n return if bad_paths.empty?\n inject_file_list bad_paths, t(\"cmd.doctor.trailing_slashes\")\n end",
"def mysql_config_paths\n ENV['PATH'].split(File::PATH_SEPARATOR).collect do |path|\n [ \"#{path}/mysql_config\", \"#{path}/mysql_config5\" ].\n detect { |bin| File.exist?(bin) }\n end\nend",
"def mysql_config_paths\n ENV['PATH'].split(File::PATH_SEPARATOR).collect do |path|\n [ \"#{path}/mysql_config\", \"#{path}/mysql_config5\" ].\n detect { |bin| File.exist?(bin) }\n end\nend",
"def path_with_prepended_ruby_bin\n env_path = ENV[\"PATH\"].dup || \"\"\n existing_paths = env_path.split(File::PATH_SEPARATOR)\n existing_paths.unshift(RbConfig::CONFIG[\"bindir\"])\n env_path = existing_paths.join(File::PATH_SEPARATOR)\n env_path.encode(\"utf-8\", invalid: :replace, undef: :replace)\n end",
"def search_path\n result = []\n\n result += $LOAD_PATH.map { |path| File.expand_path('facter', path) }\n\n if @environment_vars.include?(\"FACTERLIB\")\n result += @environment_vars[\"FACTERLIB\"].split(File::PATH_SEPARATOR)\n end\n\n # silently ignore bad search paths from $LOAD_PATH and FACTERLIB\n result = result.select { |path| valid_search_path?(path) }\n\n # This allows others to register additional paths we should search.\n # We are assuming that these are already absolute paths.\n result += Facter.search_path.select do |path|\n valid = valid_search_path?(path)\n Facter.warn \"Excluding #{path} from search path. Fact file paths must be an absolute directory\" unless valid\n valid\n end\n\n # remove any dups\n result.uniq\n end",
"def rpaths\n command(:LC_RPATH).map(&:path).map(&:to_s)\n end",
"def exec_in_path(command)\n ENV['PATH'].split(':').collect {|d| Dir.entries d if Dir.exists? d}.flatten.include?(command)\n end",
"def getNFSPath( exportSentence )\n\t\tif ( exportSentence == nil ) # 'exports' facility not supported\n\t\t\texportSentence = defaultNFSExport()\n\t\tend\n\t\t\n\t\tbegin\n\t\t\tlog \"export=%s\"%exportSentence\n\t\t\tcontent = JSON.parse( exportSentence )\n\t\t\tif ( content != nil )\n\t\t\t\tresult = content[ \"nfs\" ][ \"exportpath\" ]\n\t\t\t\treturn result\n\t\t\tend\n\t\trescue\n\t\telse\n\t\tend\n\t\t\n return nil\n\tend",
"def service_path(service)\n service&.config&.dig(:is_cnfs_service) ? '$CORE_PATH' : '$PLATFORM_PATH'\n end",
"def locate(bin_glob, env = nil)\n path << ENV[env] if env && ENV.key?(env) && File.exist?(ENV[env])\n\n (path << Dir.pwd).each do |path|\n files = Dir.glob(File.expand_path(File.join(path, bin_glob)))\n return files unless files.empty?\n end\n\n nil\n end",
"def split_path(path)\n path.strip.split(/[,;:\\ \\n\\t]/).map{|s| s.strip}\n end",
"def canonical_path(path)\n if Gem.win_platform?\n raise PDK::CLI::FatalError, format(\"Cannot resolve a full path to '%{path}', as it does not currently exist.\", path: path) unless PDK::Util::Filesystem.exist?(path)\n\n PDK::Util::Windows::File.get_long_pathname(path)\n else\n PDK::Util::Filesystem.expand_path(path)\n end\n end",
"def shell_path\n value = shell_name.to_s\n\n if value.match(/^\\//)\n # Absolute path already provided (starts with \"/\")\n value.p\n else\n # Shell name provided, use \"which\" to find the executable\n which(value).p\n end\n end",
"def parseReferencePath(output)\n if(output.match(/BUILD_PATH=\\s+[Ss]equence/) ||\n output.match(/BUILD_PATH=[Ss]equence/))\n @refPath = \"sequence\"\n\n elsif(output.match(/BUILD_PATH=\\s+\\/data/) ||\n output.match(/BUILD_PATH=\\/data/))\n @refPath = output.slice(/\\/data\\/slx\\/references\\/\\S+/)\n \n # Since reference paths starting with /data/slx/references represent\n # format of reference paths in alkek, change the prefix of these paths\n # to match the file-system structure in ardmore.\n @refPath.gsub!(/\\/data\\/slx\\/references/,\n \"/stornext/snfs5/next-gen/Illumina/genomes\")\n\n elsif(output.match(/BUILD_PATH=\\s+\\/stornext/) ||\n output.match(/BUILD_PATH=\\/stornext/))\n # If LIMS already has correct path corresponding to the file\n # system structure in ardmore, return that path without any\n # modifications.\n @refPath = output.slice(/\\/stornext\\/\\S+/)\n end\n end",
"def parse envfile\n path = Pathname.new envfile\n update case path.extname\n when '.pl', '.perl' then parse_perl path\n when '.js', '.json' then parse_json path\n when '.yml', '.yaml' then parse_yaml path\n else parse_xaicron path\n end\n end",
"def parse_path(path)\n if (match = path.match(PATH_REGEX))\n host, secure, dir = match[1], match[2], fix_dir(match[3])\n {\n :name => '%s::%s' % [host, dir],\n :host => host,\n :dir => dir,\n :secure => secure.nil? && :no || :yes\n }\n else\n raise WebappError, \"#{path} is not a valid webapp path\"\n end\n end",
"def gpg2_path\n\t\t\treturn @gpg2_path if @gpg2_path\n\t\t\tusr_local = false\n\t\t\tENV['PATH'].split(':').each do |dir|\n\t\t\t\tif dir == '/usr/local/bin'\n\t\t\t\t\tusr_local = true\n\t\t\t\tend\n\t\t\t\tif File.executable?(dir + '/gpg2')\n\t\t\t\t\t@gpg2_path = dir + '/gpg2'\n\t\t\t\tend\n\t\t\tend\n\t\t\t# check /usr/local/bin even if it wasn't part of PATH\n\t\t\tunless usr_local\n\t\t\t\tif File.executable?('/usr/local/bin/gpg2')\n\t\t\t\t\t@gpg2_path = '/usr/local/bin/gpg2'\n\t\t\t\tend\n\t\t\tend\n @gpg2_path\n\t\tend",
"def path\n @path || File.expand_path(ENV['NEXUS_CONFIG'] || DEFAULT_FILE)\n end",
"def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end",
"def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end",
"def path_from_env(env_var, default)\n to_pathname(ENV.fetch(env_var, default))\n end",
"def windows_path(path)\n path.gsub(/\\//, '\\\\')\n end",
"def find_passenger_config_in_path\n ENV['PATH'].split(':').each do |path|\n if File.exist?(\"#{path}/passenger-config\")\n return \"#{path}/passenger-config\"\n end\n end\n end",
"def split_gem_path(gpaths, home)\n # FIX: it should be [home, *path], not [*path, home]\n\n gem_path = []\n\n if gpaths\n gem_path = gpaths.split(Gem.path_separator)\n # Handle the path_separator being set to a regexp, which will cause\n # end_with? to error\n if gpaths =~ /#{Gem.path_separator}\\z/\n gem_path += default_path\n end\n\n if File::ALT_SEPARATOR\n gem_path.map! do |this_path|\n this_path.gsub File::ALT_SEPARATOR, File::SEPARATOR\n end\n end\n\n gem_path << home\n else\n gem_path = default_path\n end\n\n gem_path.map {|path| expand(path) }.uniq\n end",
"def command_in_path?(command)\n found = ENV['PATH'].split(File::PATH_SEPARATOR).map do |p|\n File.exist?(File.join(p, command))\n end\n found.include?(true)\n end",
"def command_in_path?(command)\n found = ENV['PATH'].split(File::PATH_SEPARATOR).map do |p|\n File.exist?(File.join(p, command))\n end\n found.include?(true)\n end",
"def detect_program_path\n # We first try to detect path using `which` command.\n # If that does not work, we simply ask the user for this path.\n @path = `which youtube-dl`.strip\n @path = Ydl::CONFIG[:youtube_dl_path] if !@path || @path.empty?\n\n mess = 'youtube-dl was not found in your PATH or the specified location.'\n raise RuntimeError, mess if !@path || @path.empty?\n\n @path\n end",
"def dirname_up(path)\n path =~ /(.*)\\\\(.*)$/\n\n return $1 || path\n end",
"def normalize_path(path)\n return '' if path.eql? '<>'\n path =~ PATH\n $~[1].to_s.downcase + normalize_local_part($~[9]) + \"@\" + $~[12].downcase\n end",
"def add_shell_paths(*paths)\n path = shell_env[\"PATH\"] || \"$PATH\"\n paths << path\n\n shell_env.merge! \"PATH\" => paths.join(\":\")\n end",
"def path_check!\n # When installed outside of omnibus, trust the user to configure their PATH\n return true unless omnibus_install?\n\n paths = env[path_key].split(File::PATH_SEPARATOR)\n paths.map! { |p| drive_upcase(Chef::Util::PathHelper.cleanpath(p)) }\n embed_index = paths.index(drive_upcase(Chef::Util::PathHelper.cleanpath(omnibus_embedded_bin_dir)))\n bin_index = paths.index(drive_upcase(Chef::Util::PathHelper.cleanpath(omnibus_bin_dir)))\n if embed_index\n if bin_index\n if embed_index < bin_index\n err(\"WARN: #{omnibus_embedded_bin_dir} is before #{omnibus_bin_dir} in your #{path_key}, please reverse that order.\")\n err(\"WARN: consider using `#{ChefCLI::Dist::EXEC} shell-init <shell>` command to setup your environment correctly.\")\n end\n else\n err(\"WARN: only #{omnibus_embedded_bin_dir} is present in your path, you must add #{omnibus_bin_dir} before that directory.\")\n err(\"WARN: consider using `#{ChefCLI::Dist::EXEC} shell-init <shell>` command to setup your environment correctly.\")\n end\n end\n end",
"def paths_s\n \"['#{paths.join(\"','\")}']\"\n end",
"def input_path\n path = ENV['input_path']\n check_path!(path)\n path\n end",
"def expand_file_path(a_path_string)\n if a_path_string.start_with? '~'\n a_path_string = \"${HOME}\" + a_path_string[1, a_path_string.size-1]\n end\n\n a_path_string = `echo \"#{a_path_string}\"`.chomp\n\n return a_path_string\nend",
"def ruby_bin_path\n #config_section.ruby_bin_path || ENV['_'] =~ /ruby/ ||\n require 'rbconfig'\n File.expand_path(Config::CONFIG['RUBY_INSTALL_NAME'], Config::CONFIG['bindir'])\n end",
"def parseRCFile(path)\n if File.readable?(path)\n File.readlines(path).each { |line|\n line.strip!\n next if !line.match(/^export.*?=/)\n name, value = line.split(/=/, 2)\n name.sub!(/^export /, \"\")\n if !value.nil? and !value.empty?\n value.gsub!(/(^\"|\"$)/, \"\")\n ENV[name] = value if !value.match(/\\$/)\n end\n }\n end\nend",
"def split_paths(paths)\n (paths || '').split(File::PATH_SEPARATOR).map { |p| to_pathname(p) }\n end",
"def subauthorities_path\n if config[:local_path].starts_with?(File::Separator)\n config[:local_path]\n else\n Rails.root.join(config[:local_path]).to_s # TODO: Rails.root.join returns class Pathname, which may be ok. Added to_s because of failing regression test.\n end\n end",
"def gempaths\n\t\t\treturn Gem.path\n\t\tend",
"def parse_value(value)\n if value.include?('$env')\n fetch_environment_variable(value)\n else\n value\n end\n end",
"def path_env(path)\n uri = URI.parse(path)\n {\n 'QUERY_STRING' => uri.query,\n 'SCRIPT_NAME' => '',\n 'PATH_INFO' => uri.path,\n 'SERVER_PORT' => uri.port.to_s,\n 'HTTP_HOST' => uri.host,\n # Hack to avoid Missing rack.input error\n 'rack.request.form_input' => '',\n 'rack.input' => '',\n 'rack.request.form_hash' => {}\n }\n end",
"def spool_dir\n '/var/spool'\n end",
"def spool_dir\n '/var/spool'\n end",
"def search(f_name) \r\n yield ENV['PATH'].split(';').map {|p| File.join p, f_name}.find {|p| File.file? p and File.executable? p}\r\nend",
"def load_path\n paths, file = [\"\"], current_file\n paths << File.dirname(file) if file\n paths + LOAD_PATH\n end"
] |
[
"0.6350788",
"0.61692876",
"0.6108359",
"0.60479987",
"0.6006013",
"0.56962854",
"0.560953",
"0.54449874",
"0.5419041",
"0.53316724",
"0.5322733",
"0.52796775",
"0.523518",
"0.52253497",
"0.52247226",
"0.52175707",
"0.514121",
"0.5131753",
"0.5096797",
"0.5081887",
"0.5060693",
"0.50533444",
"0.5009529",
"0.49659914",
"0.4946158",
"0.4918987",
"0.49166095",
"0.4907472",
"0.4896608",
"0.489554",
"0.48869842",
"0.48639026",
"0.48574916",
"0.4857364",
"0.48511538",
"0.48488876",
"0.48335052",
"0.482845",
"0.47987157",
"0.47877407",
"0.4786462",
"0.47803015",
"0.47777942",
"0.47716632",
"0.47672796",
"0.4747825",
"0.4747825",
"0.4730397",
"0.4725676",
"0.47203186",
"0.47099304",
"0.46938068",
"0.4683882",
"0.46629256",
"0.4654909",
"0.46534753",
"0.46433794",
"0.46433794",
"0.46372527",
"0.4611679",
"0.46011418",
"0.45999295",
"0.45881444",
"0.4587866",
"0.45642072",
"0.45584348",
"0.45581558",
"0.45511702",
"0.4548114",
"0.4545851",
"0.45441896",
"0.45437223",
"0.45420337",
"0.4536485",
"0.4536485",
"0.45346984",
"0.45261922",
"0.45240277",
"0.45109117",
"0.45069617",
"0.45069617",
"0.4504625",
"0.45005828",
"0.44972232",
"0.44922635",
"0.44888958",
"0.447718",
"0.44736674",
"0.44735795",
"0.44681242",
"0.4461632",
"0.44603807",
"0.44551086",
"0.44505823",
"0.44473922",
"0.44422764",
"0.4441174",
"0.4441174",
"0.4440619",
"0.443764"
] |
0.76109356
|
0
|
Internal: The default path to be used when the SNP_PATH environment variable is not set.
|
def default_path
['~/.snp']
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def default_path\n Pathname.pwd.join(*base_config_path, self.class.config_folder)\n end",
"def default_path\n [ (std_path || key).to_s ]\n end",
"def path\n @path || File.expand_path(ENV['NEXUS_CONFIG'] || DEFAULT_FILE)\n end",
"def default_location(path)\n @default_location = File.expand_path(path)\n end",
"def default_command_root\n @default_command_root = resolve_path(\".\") unless defined?(@default_command_root)\n @default_command_root\n end",
"def path_from_env\n ENV['SNP_PATH'] && ENV['SNP_PATH'].split(':')\n end",
"def default_path\n Gem.default_path + [@home]\n end",
"def set_default_path\n unless @resource_config[:path]\n suffix = self.to_s.split('::').last\n @resource_config[:path] = Utility.underscore(suffix)\n end\n end",
"def path(arg = nil)\n set_or_return(:path,\n arg,\n kind_of: String,\n default: ::File.join('/etc/default', app_name))\n end",
"def default_log_path\n if @config.log_root\n File.join(@config.log_root, default_log_file_name)\n else\n nil\n end\n end",
"def default_paths\n [ '.' ]\n end",
"def default_var_path\n monit_name_path('/var/lib/%{name}')\n end",
"def default_path; end",
"def default_path\n nil\n end",
"def default\n path\n end",
"def file_path\n PATH_USER_DEFAULTS\n end",
"def default_directory\n defaults = [ self.cwd_default_directory,\n self.env_default_directory,\n self.localstate_default_directory ]\n dd = nil\n loop do\n dd = defaults.shift\n break if dd or defaults.empty?\n end\n raise Error, \"No default Tyrant Manager home directory found\" unless dd\n return dd\n end",
"def default_install_path\n begin\n ::Rails.root.join 'config', 'initializers', ''\n rescue NameError\n File.join Dir.pwd, 'config', 'initializers', ''\n end\n end",
"def path_from_env(env_var, default)\n to_pathname(ENV.fetch(env_var, default))\n end",
"def default_generation()\n # The default generation\n if File.symlink?(File.join(@target, DEFAULT_SYSTEM_LINK))\n return DEFAULT_SYSTEM_LINK\n end\n\n # Otherwise, we need to re-hydrate a system!\n registration = File.join(@target, \"nix-path-registration\")\n if File.exist?(registration)\n path = File.read(registration)\n .split(\"\\n\")\n .grep(%r{^/nix/store/[a-z0-9]+-nixos-system-})\n .first\n return path if path\n end\n\n System.failure(\"INIT_NOT_FOUND\", \"Stage-2 init not found\", \"Could not find init path for stage-2\", color: \"FF00FF\")\n end",
"def site_creation_default_managed_path=(value)\n @site_creation_default_managed_path = value\n end",
"def default_path\n '/'\n end",
"def default_name\n path.dirname.basename.to_s\n end",
"def default_base_path_name\n self.name.split('::').last.downcase\n end",
"def env_default_directory\n default_dir = ENV['TYRANT_MANAGER_HOME']\n return default_dir if default_dir and is_tyrant_root?( default_dir )\n return nil\n end",
"def default_search_directory\n Figgy.config[\"default_search_directory\"]\n end",
"def localstate_default_directory\n default_dir = File.join( Config::CONFIG['localstatedir'], basedir )\n return default_dir if is_tyrant_root?( default_dir )\n return nil\n end",
"def path\n @path ||= \n (@path_proc && @path_proc.call(self)) || \n default_path\n end",
"def default_or_home_directory\n hd = TyrantManager.home_dir\n begin\n hd = TyrantManager.default_directory\n rescue => e\n # yup, using home\n end\n return hd\n end",
"def base_path(val=nil)\n if val\n @base_path = val\n else\n @base_path || default_base_path_name\n end\n end",
"def default_app_variables_path\n Hanami.root.join(\"apps\", Concierge.app.to_s, \"config\", \"environment_variables.yml\").to_s\n end",
"def base_path path=nil\n if path\n @base_path = path\n end\n @base_path || default_base_path\n end",
"def _default_cookbook_path\n @__default\n end",
"def _default_cookbook_path\n @__default\n end",
"def default_env\n {'BUNDLE_PATH' => '.'}\n end",
"def default_env\n {'BUNDLE_PATH' => '.'}\n end",
"def default_dir(dir)\n Pathname(dir || Pathname.getw)\n end",
"def default_concierge_variables_path\n Hanami.root.join(\"config\", \"environment_variables.yml\").to_s\n end",
"def path\n env[PATH] ||= (env.has_key?(GIT) ? env[GIT].path : Dir.pwd)\n end",
"def default_properties_file\n # try the current directory\n file = File.expand_path(DEF_PROP_FILE_NM)\n return file if File.exists?(file)\n # try home\n home = ENV['HOME'] || ENV['USERPROFILE'] || '~'\n file = File.expand_path(DEF_PROP_FILE_NM, home)\n file if File.exists?(file)\n end",
"def default_test_base_path\n File.join(kitchen_root, Kitchen::DEFAULT_TEST_DIR)\n end",
"def path\n if @path.nil?\n self.path = @@default_cases\n end\n @path\n end",
"def root_path\n environment.paths.detect { |path| pathname.to_s[path] }\n end",
"def default_authoritative_config_directory\n case node['platform_family']\n when 'debian'\n '/etc/powerdns'\n when 'rhel'\n '/etc/pdns'\n end\nend",
"def default_location\n\t\tif @default_location.nil?\n\t\t\tomnifocus_directories = Dir[File.join(container_location, \"com.omnigroup.OmniFocus*\")]\n\n\t\t\tdefault_omnifocus_directories = omnifocus_directories.select{ |path|\n\t\t\t\tFile.basename(path) =~ /com\\.omnigroup\\.OmniFocus\\d+$/\n\t\t\t}\n\n\t\t\tif (default_omnifocus_directories.size == 0)\n\t\t\t\t# If none match the regexp, we return \"\"\n\t\t\t\t@default_location = \"\"\n\t\t\telse\n\t\t\t\t# Otherwise, match highest\n\t\t\t\tlast_omnifocus_directory = default_omnifocus_directories.sort().last()\n\t\t\t\t\n\t\t\t\t@default_location = File.join(\n\t\t\t\t\tlast_omnifocus_directory,\n\t\t\t\t\t\"Data/Library/Application Support/OmniFocus/OmniFocus.ofocus\"\n\t\t\t\t)\n\t\t\tend\n\t\tend\n\n\t\treturn @default_location\n\tend",
"def empty_config_file_path\n ::File.expand_path '../../../support/empty_resolv.conf', __FILE__\n end",
"def path(path = nil)\n @path ||= path || low_name\n end",
"def default_database_file_path\n\t\t\t@default_database_file_path ||= 'config/event_storage.yml'\n\t\tend",
"def cwd_default_directory\n default_dir = Dir.pwd\n return default_dir if is_tyrant_root?( default_dir )\n return nil\n end",
"def get_default_base_dn\n\t\treturn self.root_dse[:namingContexts].first.dn\n\tend",
"def resource_default_config_path\n type_string = instance_variable_defined?(:@new_resource) ? new_resource.declared_type.to_s : resource_name.to_s\n config_path = Array(type_string.gsub(/(grafana_)(config_)?/, '').split('_').join('.'))\n\n Chef::Log.debug(\"resource_default_config_path: Generated config path #{config_path}\")\n raise if nil_or_empty?(config_path)\n\n config_path\n end",
"def default_envs\n {\n \"PATH\" => \"\"\n }\n end",
"def default_path\n \"archangel/fallback/\" + [version_name, \"asset.png\"].compact.join(\"_\")\n end",
"def default_script\n (Dir.entries(path.dirname).select{ |f| f =~ /\\.pbs$/i }.first || Dir.entries(path.dirname).select{ |f| f =~ /\\.sh$/i }.first) if path.dirname.directory?\n end",
"def base_path\n @base_path ||= Dir.pwd\n end",
"def base_path\n @base_path ||= server_path(File.expand_path(Dir.pwd))\n end",
"def get_config_path()\n return ENV['DOCS_CONFIG_PATH'] || CONFIG_PATH_DEFAULT\n end",
"def site_creation_default_managed_path\n return @site_creation_default_managed_path\n end",
"def path\n case @default\n when :open_file\n \"#{root}/\"\n when :open_hg\n \"#{root}/.hg/\"\n when :open_git\n \"#{root}/.git\"\n else\n raise abort \"Unknown opener format #{@default.inspect}\"\n end\n end",
"def default_file_name\n ''\n end",
"def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end",
"def base_dir_for_path_parameters\n @base_dir_for_path_parameters ||=\n if File.basename(loaded_path).start_with?('.rubocop') &&\n loaded_path != File.join(Dir.home, ConfigLoader::DOTFILE)\n File.expand_path(File.dirname(loaded_path))\n else\n Dir.pwd\n end\n end",
"def system_path\n @system_path ||= Pathname.new(__FILE__).dirname.dirname.expand_path.to_s\n end",
"def default_install_dir\n @install_dir ||= CernerSplunk::PathHelpers.default_install_dirs[package][node['os'].to_sym]\n raise \"Unsupported Combination: #{package} + #{node['os']}\" unless @install_dir\n @install_dir\n end",
"def default_ktlint_path\n File.expand_path(File.join(File.dirname(__FILE__), 'bin', 'ktlint'))\n end",
"def default_log_root\n File.join(kitchen_root, Kitchen::DEFAULT_LOG_DIR)\n end",
"def set_default_location\n self.location = Rails.application.config.classifeds_default_location;\n end",
"def to_absolute_path\n File.join('', to.path(:default).to_s)\n end",
"def directory(_mapped_locale, _is_default)\n ''\n end",
"def default_file\n return @default_file if @default_file\n\n if File.exist?(SAVE_FILE)\n File.open(SAVE_FILE) do |f|\n @default_file = Marshal.load(f)\n end\n elsif File.exist?(DEFAULT_FILE)\n @default_file = Pathname.new(DEFAULT_FILE)\n end\n @default_file\n end",
"def default_file\n return @default_file if @default_file\n\n if File.exist?(SAVE_FILE)\n File.open(SAVE_FILE) do |f|\n @default_file = Marshal.load(f)\n end\n elsif File.exist?(DEFAULT_FILE)\n @default_file = Pathname.new(DEFAULT_FILE)\n end\n @default_file\n end",
"def path\n if location =~ /^\\/dev/\n \"dev:#{location}\"\n elsif location =~ /iso$/\n \"iso:#{location}\"\n elsif location.is_a?(Integer)\n \"disc:#{location}\"\n elsif location =~ /^disc/\n location\n else\n raise RuntimeError\n end\n end",
"def path\n if location =~ /^\\/dev/\n \"dev:#{location}\"\n elsif location =~ /iso$/\n \"iso:#{location}\"\n elsif location.is_a?(Integer)\n \"disc:#{location}\"\n elsif location =~ /^disc/\n location\n else\n raise RuntimeError\n end\n end",
"def dummy_path\n rel_path = ENV['DUMMY_APP_PATH'] || 'spec/dummy'\n if @current_path.to_s.include?(rel_path)\n @current_path\n else\n @current_path = File.expand_path(rel_path)\n end\n end",
"def default_path\n \"archangel/\" + [version_name, \"asset.png\"].compact.join(\"_\")\n end",
"def local_nsd_path\n File.join(File.expand_path(File.dirname(__FILE__) + '/../../'), 'data', 'nsd_cccc.txt')\n end",
"def default_value_for(prop)\n case prop\n when :install_path\n \"/opt/#{package_name}\"\n when :omnibus_project\n package_name\n when :downloads_product_page_url\n \"#{Mixlib::Install::Dist::DOWNLOADS_PAGE}/#{product_key}\"\n when :github_repo\n \"#{Mixlib::Install::Dist::GITHUB_ORG}/#{product_key}\"\n when :api_url\n ENV.fetch(\"PACKAGE_ROUTER_ENDPOINT\", Mixlib::Install::Dist::PRODUCT_ENDPOINT)\n else\n nil\n end\n end",
"def paths_from_env(env_var, default)\n split_paths(ENV.fetch(env_var, default))\n end",
"def default_global_config_file\n File.join(File.expand_path(ENV[\"HOME\"]), \".kitchen\", \"config.yml\")\n end",
"def _default_locks_dir\n defined?(Rails) ? Rails.root.join('tmp/pids') : Pathname.new('tmp/pids')\n end",
"def default_path str = nil, &block\n (class << self; self; end).send :define_method, :default_path do \n block_given? ? instance_eval(&block) : str\n end\n end",
"def set_initial_path\n `echo $PATH`.split(':').each do |path|\n add_env_path path\n end\nend",
"def base_path\n Dir.pwd + \"/\"\n end",
"def template_path\n @default_options.fetch(:template_path, nil)\n end",
"def find_default_ca_path; end",
"def default_search_path\n @default_search_path ||= %{\"$user\", public}\n end",
"def directory_path\n @directory_path || Ferver::DEFAULT_FILE_SERVER_DIR_PATH\n end",
"def base_path\n @base_path || self.class.base_path\n end",
"def processor_path\n @processor_path || DEFAULT_PROCESSOR_PATH\n end",
"def log_path\n @options['log_path'] ? File.expand_path(@options['log_path'], @config.root) : default_log_path\n end",
"def return_to_path_or(default_path)\n return session.delete(:return_to_path) if session[:return_to_path]\n default_path\n end",
"def default_uri\n URI.parse('//' + @default_host + '/')\n end",
"def default_generation()\n # Given as a command-line option, most likely from stage-0.\n generation_parameter = System.cmdline().grep(/^mobile-nixos.generation=/).first\n unless generation_parameter.nil?\n return generation_parameter.split(\"=\", 2).last\n end\n\n # Given as a command-line option, from the bootloader (replacement for NixOS's stage-1)\n init_parameter = System.cmdline().grep(/^init=/).first\n if init_parameter == \"init=/init\" then\n $logger.info(\"Skipping '#{init_parameter}' cmdline parameter from quirky device...\")\n else\n unless init_parameter.nil?\n $logger.info(\"Using '#{init_parameter}' cmdline parameter to select generation...\")\n init_parameter = init_parameter.split(\"=\", 2).last\n return init_parameter.rpartition(\"/\").first\n end\n end\n\n # The default generation\n if File.symlink?(File.join(@target, DEFAULT_SYSTEM_LINK))\n $logger.info(\"Using '#{DEFAULT_SYSTEM_LINK}' default generation...\")\n return DEFAULT_SYSTEM_LINK\n end\n\n # Otherwise, we need to re-hydrate a system!\n registration = File.join(@target, \"nix-path-registration\")\n if File.exist?(registration)\n $logger.info(\"Getting NixOS generation from nix-path-registration...\")\n path = File.read(registration)\n .split(\"\\n\")\n .grep(%r{^/nix/store/[a-z0-9]+-nixos-system-})\n .first\n return path if path\n end\n\n System.failure(\"INIT_NOT_FOUND\", \"Stage-2 init not found\", \"Could not find init path for stage-2\", color: \"FF00FF\")\n end",
"def path_prefix\n @path_prefix ||= '/'\n end",
"def root_path(full = true)\n\n if full\n path = Rails.root.join ProgramsDir\n else\n path = Pathname.new ProgramsDir\n end\n\n path.join self.name\n end",
"def default_image_path\n \"default_interest_images/#{name.gsub(/\\s/,'').gsub(/\\W/,'_').downcase}\"\n end",
"def opt_d_rod_path(data)\n if data.first[:snp_rod] || @default_config[:snp_rod]\n \"-D ${GATK_DBSNP}\"\n else\n \"\"\n end\nend",
"def root(path = nil)\n base = File.expand_path(File.dirname(__FILE__))\n path ? File.join(base, path) : base\n end",
"def root_path\n @root_path ||= File.expand_path(File.join('.', '../..'))\n end",
"def config_path\n @config_path ||= local_config_path\n end"
] |
[
"0.720874",
"0.7201132",
"0.6855536",
"0.68170434",
"0.65672755",
"0.65531117",
"0.65386796",
"0.6502629",
"0.64971036",
"0.6458221",
"0.6452482",
"0.6447052",
"0.64297146",
"0.636688",
"0.63502985",
"0.6346362",
"0.6315723",
"0.63072366",
"0.6253574",
"0.623244",
"0.6228113",
"0.6216621",
"0.62104845",
"0.61336625",
"0.6119584",
"0.61114955",
"0.6101373",
"0.60777265",
"0.606883",
"0.6064365",
"0.60642195",
"0.60573405",
"0.60512483",
"0.6044993",
"0.6037851",
"0.6037851",
"0.60294026",
"0.5997943",
"0.5912341",
"0.59023774",
"0.58896446",
"0.5866781",
"0.58533704",
"0.58459634",
"0.5832126",
"0.58129895",
"0.5807123",
"0.5791443",
"0.57854736",
"0.57817996",
"0.5781355",
"0.5774363",
"0.5763018",
"0.5761915",
"0.5759723",
"0.5717184",
"0.56875134",
"0.5684052",
"0.56819683",
"0.5681521",
"0.5667328",
"0.5667328",
"0.565247",
"0.56465983",
"0.5643575",
"0.56407607",
"0.5632026",
"0.5629629",
"0.5595326",
"0.55928254",
"0.55928254",
"0.5582732",
"0.5582732",
"0.55817705",
"0.55816233",
"0.55787116",
"0.553917",
"0.55216",
"0.55214095",
"0.5519521",
"0.55144805",
"0.55041426",
"0.5500282",
"0.549918",
"0.54891026",
"0.54851353",
"0.5478087",
"0.54774344",
"0.547189",
"0.54708654",
"0.546896",
"0.5464857",
"0.5462161",
"0.54595184",
"0.5457053",
"0.544858",
"0.54258204",
"0.5422793",
"0.5410353",
"0.54032516"
] |
0.78266937
|
0
|
Internal: checks if the given name ends with the passed `extension`. template the template file name.
|
def has_extension?(template, extension)
comparison_length = extension.size + 1 # account for the separator `.`
template[-comparison_length, comparison_length] == ".#{extension}"
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def with_extension(template, extension)\n if has_extension?(template, extension)\n template\n else\n [template, extension].join(\".\")\n end\n end",
"def with_file_extension(name, entry_type)\n return name unless File.extname(name.to_s).empty?\n\n extension = extension_for_type(entry_type)\n extension ? \"#{ name }.#{ extension }\" : name\n end",
"def basename\n suffixed? ? name.sub(/\\.#{Regexp.escape(template.name)}$/, '') : name\n end",
"def basename_tmpl\n ##p @cfg[:filename_tmpl]\n mode=Dyndoc.guess_mode(@cfg[:filename_tmpl])\n ##p [\"mode\",mode,Dyndoc.tmplExt[mode]]\n if mode\n name,ext=@cfg[:filename_tmpl].scan(/^(.*)(?:#{Dyndoc.tmplExt[mode].join(\"|\")})$/).flatten.compact\n else\n name,ext=@cfg[:filename_tmpl].scan(/^(.*)(?:_tmpl(\\..*)|(\\.dyn))$/).flatten.compact\n end\n #p [:name,@cfg[:filename_tmpl],name]\n name\n end",
"def template?(name, format)\n glob = dir.join(\"#{name}.#{format}.*\")\n Dir[glob].first\n end",
"def create_file_name(ext = nil)\n ext ||= self.ext\n return name unless ext\n \"#{unique_key}.#{ext}\"\n end",
"def suffix\n name.scan(MetaDep::TEMPLATE_SUFFIX).flatten.first\n end",
"def get_filename filename, extension = 'png'\n unless filename.nil?\n file_extension = get_extension filename\n filename = (file_extension.empty?) ? filename + '.' + extension : filename\n else\n false\n end\n end",
"def ext_of(filename)\n filename =~ extension_regex ? $2 : ''\n end",
"def formatted_filename(name, version, suffix, extension)\n name.gsub(\"#{version}_\", \"\").chomp(File.extname(name)) + \"_#{suffix}.#{extension}\"\n end",
"def file_extension(extension = T.unsafe(nil)); end",
"def processed_filename(filename, extension = nil)\n suffix = \"_#{model.filename_token}\"\n max_processed_filename_size = max_processed_filename_size(suffix)\n filename_without_suffix = filename.slice 0, max_processed_filename_size\n \"#{filename_without_suffix.parameterize}#{suffix}\".tap { |s| s << \".#{extension}\" if extension }\n end",
"def tempfile_extension\n # complexity here is due to supporting mangling non-UTF8 strings (e.g. latin-1 filenames with characters that are illegal in UTF-8)\n b = File.basename(@new_resource.path)\n i = b.index(\".\")\n i.nil? ? \"\" : b[i..].scrub\n end",
"def make_file_name aExtension, *aWords #:nodoc:\n aWords.join(' ').to_file_name.ext(aExtension)\n end",
"def extname() File.extname(path) end",
"def ensure_extension(source, extension)\n if source =~ /^https?:/ || source.end_with?(\".#{extension}\")\n return source\n end\n\n \"#{source}.#{extension}\"\n end",
"def extension\n filename =~ /\\./ ? filename.split('.').last : nil\n end",
"def extname() File.extname(@path) end",
"def extname? path\n (last_dot_idx = path.rindex '.') && !(path.index '/', last_dot_idx)\n end",
"def ext_of(filename)\n filename =~ /((\\.[a-z]+)*)$/ ? $1 : ''\n end",
"def extension\n split_extension(filename)[1] if filename\n end",
"def process(name)\n return unless name\n\n self.ext = File.extname(name)\n self.basename = name[0..-ext.length - 1].gsub(%r!\\.*\\z!, \"\")\n end",
"def collisionless_filename source, extension\n base_name = \"#{source}_scrape_#{Date.today.strftime('%Y-%m-%d')}.#{extension}\"\n unused_filename = base_name\n n = 1\n while File.file?(unused_filename) do\n unused_filename = \"#{base_name}_v#{n}.#{extension}\"\n n += 1\n end\n unused_filename\n end",
"def specific_template_exists?(template)\n template, extension = template.split('.')\n path = File.join(RAILS_ROOT, \"app/views\", template)\n if extension.blank?\n File.exist?(\"#{path}.rhtml\") || File.exist?(\"#{path}.html.haml\")\n else\n File.exist?(\"#{path}.#{extension}\")\n end\n end",
"def error_for_new_doc_name(filename, extension)\n full_file_name = filename + \".\" + extension\n if !(1..20).cover?(filename.size)\n return \"File name must be between 1 and 20 characters\"\n elsif find_by_name(full_file_name)\n return \"File name must be unique\"\n elsif (filename =~ /(^[A-Za-z][A-Za-z0-9_]+)$/).nil?\n return \"Invalid file name. File must begin with an alpha character. The rest of the file name can only contain alphanumeric characters and underscores\"\n end\n nil\nend",
"def uses_extension?\n @format =~ /\\.[^\\.]+$/\n end",
"def extensionize(fname, ext, opts={})\n extname = File.extname(fname)\n return fname if (extname =~ /\\.?#{ext}$/i) == 0\n fname = fname.gsub(/#{extname}$/, '') if opts[:chomp] == true\n return fname.strip + '.' + ext.to_s.gsub(/^\\./, '')\n end",
"def extension\n name.downcase\n end",
"def extname( fn )\n ::File.extname(fn).tr('.', '')\n end",
"def get_extension filename\n unless filename.nil?\n filename.to_s.scan(/\\.([\\w+-]+)$/).flatten\n else\n false\n end\n end",
"def name_without_extension\n tmp = name\n i = tmp.index('.')\n i ? tmp[0...i] : tmp\n end",
"def basename_without_ext; end",
"def basename_for_persp_and_ext(persp, ext)\n \"resource-epo-#{persp}#{ext}\"\n end",
"def extension?\n @extension != \"\"\n end",
"def template_name_and_format_glob(name, format, opts)\n \"#{template_name_and_format(name,format,opts)}.*\"\n end",
"def dotextension(attachment, style_name)\n ext = extension(attachment, style_name)\n ext.empty? ? ext : \".#{ext}\"\n end",
"def extension\n filename = File.extname(self.filename.to_s)\n filename[0] = '' # remove the dot, i.e. (.docx or .pptx)\n filename\n end",
"def export_file_name(extension)\n \"CompSage Report on #{@survey.job_title.gsub(/[\\\\\\/:\\*\\?\"<>\\|]/,' ')}.#{extension}\"\n end",
"def infer_extension\n return if name.nil?\n\n self.extension ||= File.extname(name)\n end",
"def output_filename_for(filename)\n raise \"Filename not given\" unless filename\n extension = File.extname(filename)[1..-1]\n parser = self.class.for_extension(extension).last\n return filename unless parser\n Pathname.new(\"#{File.dirname(filename)}/#{File.basename(filename, \".*\")}.#{parser.finished_extension}\").cleanpath.to_s\n rescue => e\n filename\n end",
"def by_extension(ext); end",
"def file_extension\n filename.split(\".\").last\n end",
"def extname\n File.extname(filename)\n end",
"def template_name_and_format(name, format, opts)\n \"#{name}.#{format}\"\n end",
"def manifest_name(name, type)\n return name if File.extname(name.to_s).empty?\n\n File.basename(name, type)\n end",
"def file_ext(filename)\n File.extname( filename ).gsub(\".\", \"\") rescue nil\n end",
"def file_name(usage)\n usage = usage.to_s unless usage.is_a? String\n if usage =~ /[\\w]+\\.ehtml/\n name = usage.split('.').first\n \"l#{original_page_layout_root.id}#{name}.html.erb\"\n elsif usage =~ /ehtml/\n \"l#{original_page_layout_root.id}.html.erb\"\n else\n \"l#{original_page_layout_root.id}.#{usage}\"\n end\n end",
"def replace_extname(path, extension)\n path.sub(/#{File.extname(path)[1..-1]}$/, extension)\n end",
"def file_suffix\n file_name.split('.').last \n end",
"def template_name_expr; end",
"def template_path(extension)\n File.expand_path('../../../views/renderers/' + @dirname + '/' + @placeholder + '.' + extension, __FILE__)\n end",
"def extension_with_delimiter\n File.extname @filename\n end",
"def specific_template_exists?(template)\n template, extension = template.split('.')\n path = File.join(RAILS_ROOT, \"app/views\", template)\n File.exist?(\"#{path}.#{extension || 'rhtml'}\")\n end",
"def check_and_correct_file_extension\n extension = File.extname(avatar_file_name).downcase\n self.avatar.instance_write(:file_name, \"#{avatar_file_name}.jpg\") if extension.blank?\n end",
"def setup_template_details\n template_extension = @template_path.scan(/\\.(\\w+)\\.?(.*)?/)[0][0]\n get_extension_and_name_from_file(@template_path).merge(\n template_extension: template_extension\n )\n end",
"def page_template_filename(page_template)\n ('template_' + page_template)\n end",
"def output_extension(extension)\n if extension == \".gif\" || extension == \".png\"\n extension\n else\n \".jpg\"\n end\nend",
"def extname; end",
"def extname; end",
"def extname; end",
"def extname; end",
"def find_template(name)\n TEMPLATES.find do |fn, _|\n fn == name || fn.split('.').first == name\n end\n end",
"def file_type file_name \n File.extname( file_name ).gsub /^\\./, '' \n end",
"def sub_ext(ext); end",
"def real_extension(filename)\n ext = File.extname(filename)\n return ext if ext.empty?\n ext = ext[1, ext.length - 1].sub('.', '_').downcase\n e_s = ext.to_sym\n return ext unless ALT_EXTENSIONS.key?(e_s)\n ALT_EXTENSIONS[e_s].dup\n end",
"def extension\n filename = File.extname(self.filename.to_s)\n filename[0] = '' # remove the dot, i.e. (.docx or .pptx)\n filename\n end",
"def normalize_extension(extension)\n extension = extension.to_s\n if extension[/^\\./]\n extension\n else\n \".#{extension}\"\n end\n end",
"def normalize_extension(extension)\n extension = extension.to_s\n if extension[/^\\./]\n extension\n else\n \".#{extension}\"\n end\n end",
"def matchFn(filename)\n\treturn [\".txt\", \".pdf\"].include? File.extname(filename)\nend",
"def basename filename, drop_ext = nil\n if drop_ext\n ::File.basename filename, (drop_ext == true ? (extname filename) : drop_ext)\n else\n ::File.basename filename\n end\n end",
"def extension(attachment, style_name)\n ((style = attachment.styles[style_name.to_s.to_sym]) && style.format) ||\n File.extname(attachment.original_filename).gsub(/^\\.+/, \"\")\n end",
"def getFileExt(file_name)\n \text = file_name.split('.')\n \tif(ext.length > 1)\n \t\tf_ext = ext[ext.length - 1]\n\t\t\n \t\tif(f_ext)\n \t\t\treturn f_ext\n \t\tend\n \tend\n end",
"def extension(attachment, style_name)\n ((style = attachment.styles[style_name.to_s.to_sym]) && style[:format]) ||\n File.extname(attachment.original_filename).sub(/\\A\\.+/, \"\")\n end",
"def basename\n if extension\n basename = filename.split('.')\n basename.pop\n basename.join('.')\n else\n filename\n end\n end",
"def file_extension; end",
"def file_extension; end",
"def file_extension; end",
"def template_name\n name.split(\"::\").last.downcase.gsub(/onebox/, \"\")\n end",
"def path_and_extension(template_path)\n template_path_without_extension = template_path.sub(/\\.(\\w+)$/, '')\n [template_path_without_extension, $1]\n end",
"def file_name\n \"#{@file_name}.#{extension}\"\n end",
"def _output_filename(file)\n sub_strings = File.basename(file).split('.')\n base_name, extensions = sub_strings.first, sub_strings[1..-1]\n\n if extensions.last == 'haml'\n extensions.pop\n if extensions.empty?\n [base_name, options[:default_ext]].join('.')\n else\n [base_name, extensions].flatten.join('.')\n end\n else\n [base_name, extensions, options[:default_ext]].flatten.compact.join('.')\n end\n end",
"def visit_ext?(path)\n @ext_rules.accept?(File.extname(path)[1..-1])\n end",
"def template(name); end",
"def filename_without_extension\n filename.include?('.') ? filename.split('.')[0..-2].join('.') : filename\n end",
"def suggested_filename\n (oas_filename_pattern.presence || DEFAULT_FILENAME_PATTERN)\n .gsub('{{version}}', formatted_version)\n .gsub('{{extension}}', extension)\n end",
"def resolve_ext(file_name)\n SUPPORTED_TEMPLATE_FORMATS.find { |ext| File.exists?(\"#{file_name}.#{ext}\") }\n end",
"def new_ending(sourcefile, type)\n #sourcefile.sub(/\\.[^.]+$/, \".#{type.to_s}\")\n \"#{sourcefile}.#{type.to_s}\"\nend",
"def template_module_name(path); end",
"def check_template_exists(template_path)\n unless File.exist?(template_path)\n puts \"The template #{template_path} does not exist. Are you sure you use the right template name? The template name does not require the extension.\".color(:red)\n exit 1\n end\n end",
"def which(template, extension)\n template_with_extension = with_extension(template, extension)\n\n path = absolute_paths.find do |path|\n File.exists?(File.join(path, template_with_extension))\n end\n\n if path\n File.join(path, template_with_extension)\n end\n end",
"def file_ext\n File.extname(@file_name).downcase\n end",
"def extension\n @ext ||= ( ( e = File.extname( path ) ).empty? ? nil : e )\n end",
"def use_template_filename\n return nil unless @args[:___use_template___]\n ConfigData.real_type_filename 'templates', @args[:___use_template___]\n end",
"def changeFileExtensionTo(filename, extension)\n return \"#{File.basename(filename, File.extname(filename))}.#{extension}\"\nend",
"def sub_ext(repl)\n ext = File.extname(@path)\n self.class.new(@path.chomp(ext) + repl)\n end",
"def extension?\n !@arg[:extension].nil?\n end",
"def check_type_template(type)\n assit_kind_of(String, type)\n file_name = File.join(self.class.path_to_self, @template_dir, \"_#{type}.rhtml\")\n if(FileTest.exists?(file_name))\n File.join(@template_dir, type)\n else\n File.join(@template_dir, \"default\")\n end\n end",
"def extension\n File.basename(root_path)\n end",
"def file_type file_name \n\t\tFile.extname( file_name ).gsub /^\\./, '' \n\tend",
"def filename\n \"wallpaper.#{file.extension}\" if file\n end"
] |
[
"0.6975325",
"0.6791653",
"0.66175735",
"0.6517187",
"0.6449324",
"0.63726413",
"0.6355915",
"0.63004774",
"0.6284425",
"0.6154373",
"0.6081745",
"0.6077228",
"0.6063268",
"0.6059363",
"0.6023971",
"0.60202056",
"0.59951144",
"0.5989277",
"0.5966371",
"0.5961906",
"0.5943594",
"0.5921694",
"0.5913225",
"0.5904723",
"0.5899426",
"0.58776045",
"0.5873959",
"0.5865565",
"0.58558387",
"0.58531845",
"0.5849477",
"0.5846596",
"0.5840315",
"0.5839683",
"0.58314663",
"0.582888",
"0.58264107",
"0.5825133",
"0.5821323",
"0.58209616",
"0.58013093",
"0.57944053",
"0.5793109",
"0.57819843",
"0.57688296",
"0.5765107",
"0.5747047",
"0.57453024",
"0.5739386",
"0.5736368",
"0.5732343",
"0.57294905",
"0.57281506",
"0.57238925",
"0.5723252",
"0.57229567",
"0.5706198",
"0.57053393",
"0.57053393",
"0.57053393",
"0.57053393",
"0.5704493",
"0.57009095",
"0.5700195",
"0.56975335",
"0.5695459",
"0.5685395",
"0.5685395",
"0.56812704",
"0.5680983",
"0.5679601",
"0.56638384",
"0.56589985",
"0.56589663",
"0.5651443",
"0.5651443",
"0.5651443",
"0.56472754",
"0.5636874",
"0.56291455",
"0.5628946",
"0.56261986",
"0.5621449",
"0.5615948",
"0.5615155",
"0.5614692",
"0.56133306",
"0.5611857",
"0.5611414",
"0.56108767",
"0.5606438",
"0.5603715",
"0.5598543",
"0.5595099",
"0.558759",
"0.5585998",
"0.55782837",
"0.55761325",
"0.5573987",
"0.5570228"
] |
0.7559135
|
0
|
Internal: appends a given extension to the template file name, unless it is already present. template the template name. extension the extension to be appended. Examples with_extension('template', 'erb') => 'template.erb' with_extension('template.erb', 'erb') => 'template.erb'
|
def with_extension(template, extension)
if has_extension?(template, extension)
template
else
[template, extension].join(".")
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def add_extension(extension)\n @parts[-1] += extension\n self\n end",
"def has_extension?(template, extension)\n comparison_length = extension.size + 1 # account for the separator `.`\n template[-comparison_length, comparison_length] == \".#{extension}\"\n end",
"def add_extension(extension)\n extensions.push extension\n end",
"def add_extension(path); end",
"def add_extension(path, name = T.unsafe(nil)); end",
"def register_template_handler(extension, handler)\n @@template_handlers[extension.to_sym] = handler\n end",
"def with_file_extension(name, entry_type)\n return name unless File.extname(name.to_s).empty?\n\n extension = extension_for_type(entry_type)\n extension ? \"#{ name }.#{ extension }\" : name\n end",
"def register_template_handler(extension, klass)\n @@template_handlers[extension.to_sym] = klass\n end",
"def register_template_handler(extension, klass)\n @@template_handlers[extension.to_sym] = klass\n end",
"def file_extension(extension = T.unsafe(nil)); end",
"def path_and_extension(template_path)\n template_path_without_extension = template_path.sub(/\\.(\\w+)$/, '')\n [template_path_without_extension, $1]\n end",
"def append_extensions(match, options={})\n unless Find::EXTENSIONS.include?(File.extname(match))\n match = match + '{' + Find::EXTENSIONS.join(',') + '}'\n end\n match\n end",
"def append_template_to_file(app_file, template_file)\n append_file(app_file, template_content(template_file))\n end",
"def enable_extension(extension_name, options = {})\n options[:if_not_exists] = true\n create_extension(extension_name, options).tap { reload_type_map }\n end",
"def replace_extname(path, extension)\n path.sub(/#{File.extname(path)[1..-1]}$/, extension)\n end",
"def which(template, extension)\n template_with_extension = with_extension(template, extension)\n\n path = absolute_paths.find do |path|\n File.exists?(File.join(path, template_with_extension))\n end\n\n if path\n File.join(path, template_with_extension)\n end\n end",
"def extension=(extension)\n instance_set(:extension, extension)\n end",
"def format=(extension); end",
"def add_ext(str,ext)\n ( str.strip=~/\\.#{ext}$/ ) ? str.strip : \"#{str.strip}.#{ext}\"\n end",
"def extension\n filename = File.extname(self.filename.to_s)\n filename[0] = '' # remove the dot, i.e. (.docx or .pptx)\n filename\n end",
"def by_extension(ext); end",
"def add_extension(extension_request)\n extension_request.to_message(@message)\n end",
"def ensure_extension(source, extension)\n if source =~ /^https?:/ || source.end_with?(\".#{extension}\")\n return source\n end\n\n \"#{source}.#{extension}\"\n end",
"def extension\n filename = File.extname(self.filename.to_s)\n filename[0] = '' # remove the dot, i.e. (.docx or .pptx)\n filename\n end",
"def extension\n @extension ||= '.html'\n end",
"def template_path(extension)\n File.expand_path('../../../views/renderers/' + @dirname + '/' + @placeholder + '.' + extension, __FILE__)\n end",
"def setup_template_details\n template_extension = @template_path.scan(/\\.(\\w+)\\.?(.*)?/)[0][0]\n get_extension_and_name_from_file(@template_path).merge(\n template_extension: template_extension\n )\n end",
"def change_extension(file, new_extension)\n file.sub(/\\.[a-zA-Z0-9]+\\z/, new_extension)\n end",
"def extension\n split_extension(filename)[1] if filename\n end",
"def make_file_name aExtension, *aWords #:nodoc:\n aWords.join(' ').to_file_name.ext(aExtension)\n end",
"def process_url_extension(url)\n return url if uses_extension?\n\n url += Silly.html_extensions.include?(ext) ? '.html' : ext\n\n url.gsub(/index|index.html$/, '').gsub(/\\.html$/, '')\n end",
"def add_extension(association, options)\n # if there is a already an extension with this name remove it\n @table_extensions.reject! {|ext| ext.name == association} \n @table_extensions << TableExtension.new(self,association, options)\n @table_extensions.last\n end",
"def add_extension_path(path)\n validate_extension(path)\n @options[:extension_paths] ||= []\n @options[:extension_paths] << path\n end",
"def extensions_for(template_class); end",
"def extensions_for(template_class); end",
"def add_extension(mod, options = {})\n self.extend(mod)\n options = mod.send(:prepare_options, options || {}) if mod.respond_to?(:prepare_options)\n extension_options[mod] = options\n self\n end",
"def dotextension(attachment, style_name)\n ext = extension(attachment, style_name)\n ext.empty? ? ext : \".#{ext}\"\n end",
"def changeFileExtensionTo(filename, extension)\n return \"#{File.basename(filename, File.extname(filename))}.#{extension}\"\nend",
"def infer_extension\n return if name.nil?\n\n self.extension ||= File.extname(name)\n end",
"def extensionless_path(file)\n app.cache.fetch(:extensionless_path, file) do\n path = file.dup\n\n end_of_the_line = false\n while !end_of_the_line\n if !::Tilt[path].nil?\n path = path.sub(File.extname(path), \"\")\n else\n end_of_the_line = true\n end\n end\n\n # If there is no extension, look for one\n if File.extname(path).empty?\n input_ext = File.extname(file)\n \n if !input_ext.empty?\n input_ext = input_ext.split(\".\").last.to_sym\n if app.template_extensions.has_key?(input_ext)\n path << \".#{app.template_extensions[input_ext]}\"\n end\n end\n end\n \n path\n end\n end",
"def add_template_path( args )\n files = args[:files]\n if !(options.templates.frozen?)\n files.each do |fn|\n options.templates << File.expand_path(fn)\n end\n end\n if args[:freeze] == true\n options.templates.freeze\n end\n end",
"def replace_extension path, ext\n base_name = File.basename(path, File.extname(path))\n File.join(File.dirname(path), base_name) + '.' + ext\n end",
"def tempfile_extension\n # complexity here is due to supporting mangling non-UTF8 strings (e.g. latin-1 filenames with characters that are illegal in UTF-8)\n b = File.basename(@new_resource.path)\n i = b.index(\".\")\n i.nil? ? \"\" : b[i..].scrub\n end",
"def normalize_extension(extension)\n extension = extension.to_s\n if extension[/^\\./]\n extension\n else\n \".#{extension}\"\n end\n end",
"def normalize_extension(extension)\n extension = extension.to_s\n if extension[/^\\./]\n extension\n else\n \".#{extension}\"\n end\n end",
"def extension\n @ext ||= ( ( e = File.extname( path ) ).empty? ? nil : e )\n end",
"def create_file_name(ext = nil)\n ext ||= self.ext\n return name unless ext\n \"#{unique_key}.#{ext}\"\n end",
"def append_extensions(*extensions)\n self.extensions.push(*extensions)\n end",
"def extensionize(fname, ext, opts={})\n extname = File.extname(fname)\n return fname if (extname =~ /\\.?#{ext}$/i) == 0\n fname = fname.gsub(/#{extname}$/, '') if opts[:chomp] == true\n return fname.strip + '.' + ext.to_s.gsub(/^\\./, '')\n end",
"def output_extension(extension)\n if extension == \".gif\" || extension == \".png\"\n extension\n else\n \".jpg\"\n end\nend",
"def ext\n @ext ||= path.split('.').size > 1 ? path.split('.')[-1] : 'html'\n end",
"def script_extension\n dup.add_extension(SCRIPT_EXTENSION)\n end",
"def compile_template_with_guide(extension, template, file_name, local_assigns)\n template = Tourist.trap(template, file_name) if extension.to_sym == :rhtml\n compile_template_without_guide(extension, template, file_name, local_assigns)\n end",
"def path_with_extname(path, options); end",
"def path_with_extname(path, options); end",
"def extension(file)\n target_extension || File.extname(file)\n end",
"def tpl_ext=(ext); return @@tpl_ext = ext; end",
"def create_extension(extension_name, options = {})\n options = CREATE_EXTENSION_DEFAULTS.merge(options.symbolize_keys)\n\n sql = ['CREATE EXTENSION']\n sql << 'IF NOT EXISTS' if options[:if_not_exists]\n sql << %Q{\"#{extension_name.to_s}\"}\n sql << \"SCHEMA #{options[:schema_name]}\" if options[:schema_name].present?\n sql << \"VERSION '#{options[:version]}'\" if options[:version].present?\n sql << \"FROM #{options[:old_version]}\" if options[:old_version].present?\n\n sql = sql.join(' ')\n execute(sql)\n end",
"def changeExt(filename, newext) \n\tuseme = filename.dup\n\treturn useme if ['.', '..'].include? filename\n\tif newext != ''\n\t\tnewext = (newext =~ /^\\./) ? newext : (\".\" + newext)\n\tend\n\tuseme.sub!(%r(([^/\\\\])\\.[^./\\\\]*$)) { $1 + newext } || useme + newext\nend",
"def sub_ext(repl)\n ext = File.extname(@path)\n self.class.new(@path.chomp(ext) + repl)\n end",
"def add_content_type(extension, type); end",
"def replace_ext(path, new_ext)\n path.sub(/\\..+$/, '.' + new_ext)\n end",
"def ext_of(filename)\n filename =~ extension_regex ? $2 : ''\n end",
"def output_ext(_ext)\n \".html\"\n end",
"def output_ext(_ext)\n \".html\"\n end",
"def extension=(v) Axlsx::validate_string v; @extension = v end",
"def add_encoded_extension(encoded); end",
"def append_template(filepath, template, tokens = {})\n # TODO: ensure template exists\n # TODO: is \\n included with STDIN?\n _template = template\n filepath = \"#{@dir}/#{@module}/#{filepath}\"\n template = get_template_location << template\n puts \"... Adding template '#{_template}' to '#{filepath}'\"\n contents = File.read(template)\n tokens.each_pair do |token, value|\n if value.class == String && contents.include?(\"[#{token}]\")\n contents.gsub!(/\\[#{token}\\]/, value)\n end\n end\n File.open(filepath, 'a') do |f|\n f.write contents\n end\n end",
"def _append_template(template_file)\n\t\ttemplate_file = @template.dir_path + '/' + template_file if(template_file[0].chr != '/')\n\t\tif(@template._is_recursive(template_file))\n\t\t\t@template._raise_error(__LINE__, 0, \"'#{template_file}' is included recursively\")\n\t\t\treturn false\n\t\tend\n\n\t\tif(\n\t\t\t@contents[@content_index += 1] = SifterTemplate.new(\n\t\t\t\tself, template_file, @embed_flag, @nobreak_flag\n\t\t\t)\n\t\t)\n\t\t\treturn @contents[@content_index]._parse()\n\t\tend\n\n\t\treturn false\n\tend",
"def output_ext(ext)\n \".html\"\n end",
"def processed_filename(filename, extension = nil)\n suffix = \"_#{model.filename_token}\"\n max_processed_filename_size = max_processed_filename_size(suffix)\n filename_without_suffix = filename.slice 0, max_processed_filename_size\n \"#{filename_without_suffix.parameterize}#{suffix}\".tap { |s| s << \".#{extension}\" if extension }\n end",
"def template_extensions\n %w(mod dat)\n end",
"def create_tempfile extension = \"txt\"\n file = Tempfile.new [ @file_name, \".#{extension}\" ]\n @tempfiles << file\n file\n end",
"def extension(attachment, style_name)\n ((style = attachment.styles[style_name.to_s.to_sym]) && style.format) ||\n File.extname(attachment.original_filename).gsub(/^\\.+/, \"\")\n end",
"def add extension, provider\n providers[extension] = provider\n end",
"def maybe_convert_extension(ext); end",
"def register(template_class, *extensions); end",
"def extension_name=(name)\n clear!\n @extension_name = name\n end",
"def add_extension(path)\n unless File.exist?(path)\n raise Error::WebDriverError, \"could not find extension at #{path.inspect}\"\n end\n\n if File.directory? path\n root = path\n else\n unless %w[.zip .xpi].include? File.extname(path)\n raise Error::WebDriverError, \"expected .zip or .xpi extension, got #{path.inspect}\"\n end\n\n root = ZipHelper.unzip(path)\n end\n\n id = read_id_from_install_rdf(root)\n ext_path = File.join(extensions_dir, id)\n\n FileUtils.rm_rf ext_path\n FileUtils.mkdir_p File.dirname(ext_path), :mode => 0700\n FileUtils.cp_r root, ext_path\n end",
"def real_extension(filename)\n ext = File.extname(filename)\n return ext if ext.empty?\n ext = ext[1, ext.length - 1].sub('.', '_').downcase\n e_s = ext.to_sym\n return ext unless ALT_EXTENSIONS.key?(e_s)\n ALT_EXTENSIONS[e_s].dup\n end",
"def file_extension\n filename.split(\".\").last\n end",
"def add_extension_path(path)\n raise Error::WebDriverError, \"could not find extension at #{path.inspect}\" unless File.directory?(path)\n\n @extension_paths << path\n end",
"def extension(attachment, style_name)\n ((style = attachment.styles[style_name.to_s.to_sym]) && style[:format]) ||\n File.extname(attachment.original_filename).sub(/\\A\\.+/, \"\")\n end",
"def enable_extension(name)\n end",
"def remove_extension(extension)\n self.extensions.delete(extension)\n end",
"def file_extension\n FILE_EXTENSION\n end",
"def add(data_type, extension)\n @extensions_for[data_type.to_s] << extension\n end",
"def file_extension; end",
"def file_extension; end",
"def file_extension; end",
"def extension\n filename =~ /\\./ ? filename.split('.').last : nil\n end",
"def _extension_for(thing)\n MIMETypes.extension_for(thing) || @_extension\n end",
"def sub_ext(ext); end",
"def compile_extension(extension, platform)\n compiler_options = compiler_options()\n compiler_class = compiler_class(extension)\n\n compiler_options[:platform] = platform\n\n compiler = compiler_class.new(extension, compiler_options)\n\n compiler.compile\n end",
"def change_extension(filepath, new_ext)\n dirname = File.dirname(filepath)\n extname = File.extname(filepath)\n basename = File.basename(filepath, extname)\n File.expand_path(File.join(dirname, basename + '.' + new_ext))\n end",
"def pure_ext(ext)\n ext = ext.to_s and ext.start_with?('.') ? ext[1..-1] : ext\n end",
"def extension\n File.extname(id)[1..-1] || File.extname(original_filename.to_s)[1..-1]\n end",
"def wix_light_extension(extension)\n unless extension.is_a?(String)\n raise InvalidValue.new(:wix_light_extension, 'be an String')\n end\n\n wix_light_extensions << extension\n end",
"def add_extensions(*extensions)\n self.extensions += extensions\n end",
"def rails_extension\n case format\n when 'css'\n 'css.erb'\n when 'scss'\n 'scss'\n end\n end"
] |
[
"0.6594336",
"0.65772706",
"0.63158554",
"0.63143957",
"0.61433566",
"0.6132027",
"0.61304796",
"0.6016413",
"0.6016127",
"0.59928286",
"0.59236294",
"0.57205904",
"0.56855106",
"0.5682433",
"0.5664156",
"0.5629763",
"0.5608832",
"0.56020075",
"0.55786294",
"0.55632615",
"0.5554673",
"0.55431753",
"0.5536734",
"0.5476415",
"0.5473355",
"0.5471755",
"0.54532945",
"0.54517",
"0.5437072",
"0.54227495",
"0.54187995",
"0.5414744",
"0.54107153",
"0.5393984",
"0.5393984",
"0.5382543",
"0.5362212",
"0.53299874",
"0.5328919",
"0.53089595",
"0.5307642",
"0.53012866",
"0.5295298",
"0.5290428",
"0.5290428",
"0.52789277",
"0.52573353",
"0.5255654",
"0.52392507",
"0.52367836",
"0.5227955",
"0.5224876",
"0.52104664",
"0.52062714",
"0.52062714",
"0.5203003",
"0.52021784",
"0.51985264",
"0.5192408",
"0.51831776",
"0.517741",
"0.51688135",
"0.5157617",
"0.5145784",
"0.51446474",
"0.51356095",
"0.5125122",
"0.5095738",
"0.50835973",
"0.5078945",
"0.5055622",
"0.5048125",
"0.5046797",
"0.5039438",
"0.50318885",
"0.50285006",
"0.50278795",
"0.5024199",
"0.5017406",
"0.50159603",
"0.5012595",
"0.50089383",
"0.49990284",
"0.49844503",
"0.49679497",
"0.49629313",
"0.49613994",
"0.49542356",
"0.49542356",
"0.49542356",
"0.49488103",
"0.4948307",
"0.49464872",
"0.49464688",
"0.4938335",
"0.49380353",
"0.4935718",
"0.49305698",
"0.492852",
"0.49285188"
] |
0.8158917
|
0
|
equation type: dx + ey + f = 0
|
def initialize(x:, y:, k:)
@x_coeff, @y_coeff, @k_coeff = x.to_r, y.to_r, k.to_r
validation
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def equation\n \"du/dt + #{@a} * du/dx = 0, #{@x[0]} < x < #{@x[-1]} and #{@t[0]} < t < #{@t[-1]}, u(0,t) = u(#{@x[-1]}, t)\"\n end",
"def linear_equation(equation)\n #TODO:: calculate\n end",
"def equationValue(a, b, c, d, x)\n\t\tf = ((a+x)/(b+x))**(b + x)\n\t\tf = f - (c/d)\n\t\treturn f\n\tend",
"def compute_es(_T)\n #equation 11\n #t units are celsius, es units are kPa\n es = 0.6108 * Math.exp((17.27 * _T) / (_T + 237.3))\nend",
"def efg\n return 0.0 if fg.zero? || fga.zero?\n\n ((fg.to_f + 0.5 * three_p.to_f)/fga).round(3)\n end",
"def rm_edgy_x() (ppu_x * reg_radius).round + 5 end",
"def f(phase, var)\n A + (B * Math.sin(phase + (D * var)))\nend",
"def act_f()\n (y() >= 0) ? 1.0 : -1.0;\n end",
"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 192:8: INTEGER '.' INTEGER\n integer!\n\n match( 0x2e )\n\n integer!\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n\n end",
"def dy() 0 end",
"def working_equation\n default_equation || ''\n end",
"def omega() \r\n # delta_equinox()[ 3 ]\r\n Celes.faom03(@ta) \r\n end",
"def type_float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n\n\n type = TYPE_FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 211:13: 'float'\n match( \"float\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n\n end",
"def pendiente(x0,y0,xf,yf)\n\t\tif yf == y0 && xf == x0\n\t\t\tm = yo/x0\n\t\telsif xf == x0 && xf < 0\n\t\t\tm = -100000\n\t\telsif xf == x0 && xf >= 0\n\t\t\tm = 1000000\n\t\telse\n\t\t\tm = (yf-y0)/(xf-x0)\n\t\tend\n\t\treturn m\n\tend",
"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 11:3: ( ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ( EXPONENT )? | DECIMAL EXPONENT )\n alt_5 = 2\n alt_5 = @dfa5.predict(@input)\n case alt_5\n when 1\n # at line 11:5: ( '-' )? ( '0' .. '9' )+ '.' ( '0' .. '9' )+ ( EXPONENT )?\n # at line 11:5: ( '-' )?\n alt_1 = 2\n look_1_0 = @input.peek(1)\n\n if (look_1_0 == ?-) \n alt_1 = 1\n end\n case alt_1\n when 1\n # at line 11:5: '-'\n match(?-)\n\n end\n # at file 11:10: ( '0' .. '9' )+\n match_count_2 = 0\n loop do\n alt_2 = 2\n look_2_0 = @input.peek(1)\n\n if (look_2_0.between?(?0, ?9)) \n alt_2 = 1\n\n end\n case alt_2\n when 1\n # at line 11:11: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_2 > 0 and break\n eee = EarlyExit(2)\n\n\n raise eee\n end\n match_count_2 += 1\n end\n\n match(?.)\n # at file 11:26: ( '0' .. '9' )+\n match_count_3 = 0\n loop do\n alt_3 = 2\n look_3_0 = @input.peek(1)\n\n if (look_3_0.between?(?0, ?9)) \n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 11:27: '0' .. '9'\n match_range(?0, ?9)\n\n else\n match_count_3 > 0 and break\n eee = EarlyExit(3)\n\n\n raise eee\n end\n match_count_3 += 1\n end\n\n # at line 11:38: ( EXPONENT )?\n alt_4 = 2\n look_4_0 = @input.peek(1)\n\n if (look_4_0 == ?E || look_4_0 == ?e) \n alt_4 = 1\n end\n case alt_4\n when 1\n # at line 11:38: EXPONENT\n exponent!\n\n end\n\n when 2\n # at line 12:5: DECIMAL EXPONENT\n decimal!\n exponent!\n\n end\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__, 2)\n\n end",
"def compute_Delta(_T)\n #equation 13\n #kPa/C\n _Delta = 4098.0 * (0.6108 * Math.exp(17.27 * _T / (_T + 237.3))) / (_T + 237.3) ** 2\nend",
"def calc_koef(f, fs)\r\n 2 * Math.cos(2 * Math::PI * f / fs)\r\n end",
"def compute_dr(day_of_the_year)\n #equation 23\n #inverse relative distance Earth-Sun\n dr = 1 + 0.033 * Math.cos((2 * Math::PI/365) * day_of_the_year)\nend",
"def calc_equation(x, y)\n return (1000 * x) + (1000 * y) - (x * y) == 500000\nend",
"def get_equation(n)\n eval \"@yp#{n}\"\n end",
"def expression; end",
"def infla(y=40,f=2)\n self.to_f*(f.to_q**y)\n end",
"def exp\n # e^(r+uv)=exp(r)(cos(v)+u*sin(v))\n if is_real?; return Quaternion(Math::exp(@re)); end\n vec=self.vector; v=vec.abs; u = vec/v;\n Math::exp(@re)*(Math::cos(v)+u*Math::sin(v))\n end",
"def initialize(equation)\n self.equation = equation\n end",
"def eq_of_equinox() \r\n cos( Celes.nut06a(@ajd, 0)[ 1 ] + Celes.obl06(@ajd, 0) ) * Celes.nut06a(@ajd, 0)[ 0 ]\r\n end",
"def eccentricity_Earth()\r\n # [-0.0000001235, -0.000042037, 0.016708617].inject(0.0) {|p, a| p * @ta + a}\r\n eoe(@ta) \r\n end",
"def radial_basis(x)\n\t\tMath::E ** ( - (x**2) )\t\t\n\tend",
"def expression\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 29 )\n\n\n value = nil\n\n\n type = nil\n a = nil\n b = nil\n\n\n begin\n # at line 185:5: a= relation (type= ( '&&' | '||' ) b= expression )?\n @state.following.push( TOKENS_FOLLOWING_relation_IN_expression_1389 )\n a = relation\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = a \n # <-- action\n end\n\n # at line 186:3: (type= ( '&&' | '||' ) b= expression )?\n alt_45 = 2\n look_45_0 = @input.peek( 1 )\n\n if ( look_45_0 == T__33 || look_45_0 == T__54 )\n alt_45 = 1\n end\n case alt_45\n when 1\n # at line 186:6: type= ( '&&' | '||' ) b= expression\n type = @input.look\n\n if @input.peek(1) == T__33 || @input.peek(1) == T__54\n @input.consume\n @state.error_recovery = false\n\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n\n mse = MismatchedSet( nil )\n raise mse\n\n end\n\n\n @state.following.push( TOKENS_FOLLOWING_expression_IN_expression_1410 )\n b = expression\n @state.following.pop\n\n # syntactic predicate action gate test\n if @state.backtracking == 0\n # --> action\n value = DoubleOperandExpressionEval.new(type.text, a, b) \n # <-- action\n end\n\n\n end\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 29 )\n\n\n end\n\n return value\n end",
"def propagation_fn(x) 1/(1+Math.exp(-x)) end",
"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n\n \n # - - - - main rule block - - - -\n # at line 344:5: ( ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )? | '.' ( '0' .. '9' )+ ( EXPONENT )? | ( '0' .. '9' )+ EXPONENT )\n alt_12 = 3\n alt_12 = @dfa12.predict( @input )\n case alt_12\n when 1\n # at line 344:9: ( '0' .. '9' )+ '.' ( '0' .. '9' )* ( EXPONENT )?\n # at file 344:9: ( '0' .. '9' )+\n match_count_6 = 0\n while true\n alt_6 = 2\n look_6_0 = @input.peek( 1 )\n\n if ( look_6_0.between?( 0x30, 0x39 ) )\n alt_6 = 1\n\n end\n case alt_6\n when 1\n # at line 344:10: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_6 > 0 and break\n eee = EarlyExit(6)\n\n\n raise eee\n end\n match_count_6 += 1\n end\n\n match( 0x2e )\n # at line 344:25: ( '0' .. '9' )*\n while true # decision 7\n alt_7 = 2\n look_7_0 = @input.peek( 1 )\n\n if ( look_7_0.between?( 0x30, 0x39 ) )\n alt_7 = 1\n\n end\n case alt_7\n when 1\n # at line 344:26: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n break # out of loop for decision 7\n end\n end # loop for decision 7\n # at line 344:37: ( EXPONENT )?\n alt_8 = 2\n look_8_0 = @input.peek( 1 )\n\n if ( look_8_0 == 0x45 || look_8_0 == 0x65 )\n alt_8 = 1\n end\n case alt_8\n when 1\n # at line 344:37: EXPONENT\n exponent!\n\n end\n\n when 2\n # at line 345:9: '.' ( '0' .. '9' )+ ( EXPONENT )?\n match( 0x2e )\n # at file 345:13: ( '0' .. '9' )+\n match_count_9 = 0\n while true\n alt_9 = 2\n look_9_0 = @input.peek( 1 )\n\n if ( look_9_0.between?( 0x30, 0x39 ) )\n alt_9 = 1\n\n end\n case alt_9\n when 1\n # at line 345:14: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_9 > 0 and break\n eee = EarlyExit(9)\n\n\n raise eee\n end\n match_count_9 += 1\n end\n\n # at line 345:25: ( EXPONENT )?\n alt_10 = 2\n look_10_0 = @input.peek( 1 )\n\n if ( look_10_0 == 0x45 || look_10_0 == 0x65 )\n alt_10 = 1\n end\n case alt_10\n when 1\n # at line 345:25: EXPONENT\n exponent!\n\n end\n\n when 3\n # at line 346:9: ( '0' .. '9' )+ EXPONENT\n # at file 346:9: ( '0' .. '9' )+\n match_count_11 = 0\n while true\n alt_11 = 2\n look_11_0 = @input.peek( 1 )\n\n if ( look_11_0.between?( 0x30, 0x39 ) )\n alt_11 = 1\n\n end\n case alt_11\n when 1\n # at line 346:10: '0' .. '9'\n match_range( 0x30, 0x39 )\n\n else\n match_count_11 > 0 and break\n eee = EarlyExit(11)\n\n\n raise eee\n end\n match_count_11 += 1\n end\n\n exponent!\n\n end\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n end",
"def equation\n raise NotImplementedError, \"Define #{__method__}() in the inherited class.\"\n end",
"def ret_d\n result = 0.0\n func = get_func(Fiddle::TYPE_DOUBLE)\n if func\n result = func.call(*@args).to_f\n end\n result\n end",
"def y\n r * Math.sin(theta)\n end",
"def r\n return (x**2.0 + y**2.0 + z**2.0)**0.5\n end",
"def to_float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n type = TO_FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 313:11: 'float:'\n match( \"float:\" )\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__, 11 )\n\n end",
"def x(y)\n return 1.0/2.0 * (y - 1.0)\n end",
"def x(y)\n return 1.0/2.0 * (y - 1.0)\n end",
"def x(y)\n return 1.0/2.0 * (y - 1.0)\n end",
"def getExp ( x , y )\n\texp = x ** y\n\treturn exp\nend",
"def equation\n if p1.x == p2.x\n return \"x - #{p1.x}\"\n elsif p1.y == p2.y\n return \"#{p2.y} - p1.y\"\n end\n\n \"#{a}*x + #{b}*y + #{c} = 0\"\n end",
"def test_Aeq0\n assert_equal( [-5/2.to_f], Equation.solve_quadratic(0, 2, 5) )\n end",
"def in_fahrenheit\n if @type == :f\n @temp\n else\n ((@temp.to_f * 9.0)/5.0) + 32.0\n end\n end",
"def test_simple_equations\t\t\n \tassert_equal 3\t,Equation.new('2+1').resolve\t\n \tassert_equal 3\t,Equation.new('(2+1)').resolve\t\n \tassert_equal 5\t,Equation.new(' 4 + 1').resolve\n \tassert_equal 21\t,Equation.new(' 4*5 + 1').resolve\n \tassert_equal 21\t,Equation.new(' 4 *5 + 1').resolve\n \tassert_equal 19\t,Equation.new(' 4 *5 + -1 ').resolve\n end",
"def Float(p0) end",
"def y!() @y.value end",
"def evaluate_expression vector\n\t\t\t\tsum = 0\n\t\t\t\t@coefficients.length.times { |index|\n\t\t\t\t\tsum+=@coefficients[index]*vector[index]\n\t\t\t\t}\n\t\t\t\treturn 1-Math.exp(-sum**2)\n\t\t\tend",
"def x\n r * Math.cos(theta)\n end",
"def create_equation\n equation =''\n for i in 0..(@operands.size-1)\n if i==0\n equation << @operands[i].to_s\n else\n #binding.pry\n equation << @operators[@operator_value[i-1]].to_s\n equation << @operands[i].to_s\n end\n end\n equation\n end",
"def solve_linear\n unless params[:a].blank? || params[:b].blank?\n @equation = \"#{params[:a]}x + #{params[:b]} = 0\"\n #url = 'http://equation-solver-backend.herokuapp.com/solve'\n url = Sinatra::SERVER_URL # backend server url\n data = { equation: { type: 'linear', a: params[:a], b: params[:b] } }.to_json\n res_body = json_response(http_post(url, data))\n @answer = res_body['success']\n @error = res_body['error']\n else\n flash.now[:error] = \"fields can't be blank!\"\n render '_linear'\n end\n end",
"def expression\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n\n value = nil\n\n\n a = nil\n b = nil\n\n\n begin\n # at line 9:28: a= mul ( ADD b= mul | SUB b= mul )*\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_44 )\n a = mul\n @state.following.pop\n # at line 9:33: ( ADD b= mul | SUB b= mul )*\n while true # decision 1\n alt_1 = 3\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0 == ADD )\n alt_1 = 1\n elsif ( look_1_0 == SUB )\n alt_1 = 2\n\n end\n case alt_1\n when 1\n # at line 10:5: ADD b= mul\n match( ADD, TOKENS_FOLLOWING_ADD_IN_expression_51 )\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_55 )\n b = mul\n @state.following.pop\n\n # --> action\n a += b \n # <-- action\n\n\n when 2\n # at line 11:5: SUB b= mul\n match( SUB, TOKENS_FOLLOWING_SUB_IN_expression_63 )\n @state.following.push( TOKENS_FOLLOWING_mul_IN_expression_67 )\n b = mul\n @state.following.pop\n\n # --> action\n a -= b \n # <-- action\n\n\n else\n break # out of loop for decision 1\n end\n end # loop for decision 1\n\n\n # --> action\n value = a \n # <-- action\n\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n\n end\n\n return value\n end",
"def calculate(op, x, y)\n case op\n when 'plus'\n x.to_f + y.to_f\n when 'minus'\n x.to_f - y.to_f\n when 'divide'\n x.to_f / y.to_f\n when 'multiple'\n x.to_f * y.to_f\n end\nend",
"def dec_e\n end",
"def defla(y=40,f=2)\n self.to_f*((1-(f.fdiv(100)))**y)\n end",
"def math_type\n self\n end",
"def calc(expr)\n expr.split.each_with_object([]) { |e, a|\n if e.match(/\\d+/)\n a << e.to_f\n else\n y, x = a.pop, a.pop\n a << x.send(e, y)\n end\n }.last || 0\nend",
"def derivata2(t)\n y=6*t-6\n return y\nend",
"def test_addition\n test = Calculator.new\n assert_equal(4.0 , test.solve_equation(\"2 2 +\"))\n assert_equal(2.0 , test.solve_equation(\"-2 +\"))\n assert_equal(-18.0 , test.solve_equation(\"-20 +\"))\n end",
"def float!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n\n\n type = FLOAT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 35:8: 'cortable'\n match( \"cortable\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n\n end",
"def double x \n x + x\nend",
"def eagle_view(m, t)\n return (EVALUE**((t*t)/m));\nend",
"def evaluate_expression vector\n\t\t\t\tsum = 0\n\t\t\t\t@coefficients.length.times { |index|\n\t\t\t\t\tsum+=@coefficients[index]*(((vector[index]-0.5)**2)/0.5);\n\t\t\t\t}\n\t\t\t\treturn Math.exp(-sum)\n\t\t\tend",
"def solar_declination(t)\n\te = obliquity_corr(t)\n\tlambda = sun_apparent_lon(t)\n\tMath.asin(Math.sin(e)*Math.sin(lambda))\nend",
"def expf(f)\n typedecl f: Float, foreign: Float\n Math.exp(f)\n end",
"def factor eot\r\n eot.ajd = Date.parse(\"2000-01-01\").jd \r\n tlaa = eot.tl_Aries()\r\n eot.ajd = eot.ajd + 1\r\n tlab = eot.tl_Aries()\r\n dif = (tlab - tlaa) * Eot::R2D \r\n f1 = dif / 360.0 + 1 \r\n 1 / f1\r\nend",
"def x(y)\n return @coefficients[0] / y\n end",
"def e2w(n, m)\n# n = (n+0.938272)*(n+0.938272) - n*n\n n+m\nend",
"def exponent; end",
"def evaluate_equation(string)\n actual_result = eval(string.chars.join(''))\n actual_result\n end",
"def expressions; end",
"def ret_f\n result = 0.0\n func = get_func(Fiddle::TYPE_FLOAT)\n if func\n result = func.call(*@args).to_f\n end\n result\n end",
"def f(x)\n 0.4 * x + 1\nend",
"def test_DiscriminantGeq0\n assert_equal( [-1, -1.5], Equation.solve_quadratic(2, 5, 3) )\n end",
"def flow_expression\n\n @dict.fexp\n end",
"def exp\n\t\t\tmag = self.vec.mag\n\t\t\tMath::exp( self.scalar ) * Quaternion::sv2q( cos(mag), sin(mag) * self.vec/mag )\n\t\tend",
"def equation\n\tputs \"Enter your equation here:\"\n\tprint \"> \"\n\t\tuser_input = gets.chomp.gsub(' ', '').scan(/\\d+|[+-]|[*]|[\\/]|[(]|[)]|[.]/)\n\t\tuser_input = user_input.map do |x| \n\t\t\tif x == \"0\"\n\t\t\t\tx.to_f\n\t\t\telsif x.to_i != 0\n\t\t\t\tx.to_f\n\t\t\telse\n\t\t\t\tx\n\t\t\tend\n\t\tend\n\t\n\t# test the map here\n\t# puts user_input\n\n\tuser_input = user_input.join('')\n\t\tif user_input == 'clear'\n\t\t\texit\n\t\telse \n\t\t\tputs answer = eval(user_input)\n\t\tend\n\t\n\t# puts \"Store answer in memory as 'm'? (y/n)\"\n\t# memory_choice = gets.chomp\n\t# \tif memory_choice == \"y\"\n\t# \t\t@m = answer\n\t# \telsif memory_choice == \"n\"\n\t# \telse\n\t\t\t\n\t# \tend\n\t\t\n\t# exit if user_input == 'clear'\n\twelcome\t\nend",
"def exp\n @exp ||= ComplexNumber.new((Math::E**real).round(15), 0) \\\n * ComplexNumber.new(\n Math.cos(imaginary).round(15),\n Math.sin(imaginary).round(15)\n )\n end",
"def eval\n (num*1.0/den)\n end",
"def solve_for_y(x)\n field.square_roots equation_right_hand_side x\n end",
"def generate_equation(coefficients, constant, reg_type)\n\tif (reg_type == POLYNOMIAL)\n\t\t# Generate polynomail equation\n\t\thighest_power = coefficients.size - 1\n\n\t\t# Loop through each coefficient with index in reverse order injecting into the variable 'equation'\n\t\tequation = coefficients.to_enum.with_index.reverse_each.inject(\"\") do |equation, (coefficient, i)|\n\t\t\tsign = \"++-\"[coefficient <=> 0]\n\t\t\tcoefficient = coefficient.abs\n\t\t\tterm = \"\"\n\t\t\tterm << \" \" if (i < highest_power)\n\t\t\tterm << \"#{sign}\" if (sign == \"-\" or i < highest_power)\n\t\t\tterm << \" \" if (i < highest_power)\n\t\t\tterm << \"#{coefficient}\"\t\n\t\t\tterm << \"x\" if (i > 0)\n\t\t\tterm << \"^#{i}\" if (i > 1)\n\t\t\tequation << term\n\t\tend\n\telsif (reg_type == EXPONENTIAL)\n\t\ta = Math.exp(constant).round(2)\n\t\tb = coefficients[\"x\"].round(2)\n\t\tequation = \"#{a}e^(#{b}x)\"\n\telsif (reg_type == LINEAR)\n\t\ta = constant.round(2)\n\t\tb = coefficients[\"x\"].round(2)\n\t\tsign = \"++-\"[constant <=> 0]\n\t\ta = a.abs\n\t\tequation = \"#{b}x #{sign} #{a}\"\n\telsif (reg_type == LOGARITHMIC)\n\t\ta = constant.round(2)\n\t\tb = coefficients[\"x\"].round(2)\n\t\tsign = \"++-\"[constant <=> 0]\n\t\ta = a.abs\n\t\tequation = \"#{b}ln(x) #{sign} #{a}\"\n\tend\n\n\treturn equation\nend",
"def f(x)\n Math.sin(x)\nend",
"def exponent!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 3)\n\n \n # - - - - main rule block - - - -\n # at line 17:5: ( 'e' | 'E' ) ( '-' )? DECIMAL\n if @input.peek(1) == ?E || @input.peek(1) == ?e\n @input.consume\n else\n mse = MismatchedSet(nil)\n recover(mse)\n raise mse\n end\n\n\n # at line 17:15: ( '-' )?\n alt_6 = 2\n look_6_0 = @input.peek(1)\n\n if (look_6_0 == ?-) \n alt_6 = 1\n end\n case alt_6\n when 1\n # at line 17:15: '-'\n match(?-)\n\n end\n decimal!\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 3)\n\n end",
"def exp(v); Math.exp(v); end",
"def dv; end",
"def formula() @ob.get_formula end",
"def calculate_dx(inDX,inLX,age,mortality)\n if age == age.truncate\n (inLX * calculate_qx(age,mortality)) / 12.0\n else\n inDX\n end\n end",
"def y()\n val = @b;\n @n.times {|i|\n val += @wn[i] * @xn[i];\n }\n return val;\n end",
"def expr\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n value = nil\n e = nil\n\n begin\n # at line 35:5: e= expr1 ( '+' e= expr1 | '-' e= expr1 )*\n @state.following.push( TOKENS_FOLLOWING_expr1_IN_expr_262 )\n e = expr1\n @state.following.pop\n # --> action\n value = e \n # <-- action\n # at line 36:5: ( '+' e= expr1 | '-' e= expr1 )*\n while true # decision 3\n alt_3 = 3\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0 == T__14 )\n alt_3 = 1\n elsif ( look_3_0 == T__15 )\n alt_3 = 2\n\n end\n case alt_3\n when 1\n # at line 36:7: '+' e= expr1\n match( T__14, TOKENS_FOLLOWING_T__14_IN_expr_272 )\n @state.following.push( TOKENS_FOLLOWING_expr1_IN_expr_276 )\n e = expr1\n @state.following.pop\n # --> action\n value += e \n # <-- action\n\n when 2\n # at line 37:7: '-' e= expr1\n match( T__15, TOKENS_FOLLOWING_T__15_IN_expr_286 )\n @state.following.push( TOKENS_FOLLOWING_expr1_IN_expr_290 )\n e = expr1\n @state.following.pop\n # --> action\n value -= e \n # <-- action\n\n else\n break # out of loop for decision 3\n end\n end # loop for decision 3\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end\n \n return value\n end",
"def in_fahrenheit\n \t@f ? @f : @c * 9.0 / 5.0 + 32\n end",
"def eyev\n eye_vector\n end",
"def range(unknown)\n\t\tif(vars[:yo] == 0 && vars[:yf] == 0) then\n\t\t\t#xf - xo = ((vo**2)*(Math.sin(2*theta)))/9.8\n\t\t\tcase unknown\n\t\t\twhen :xf\n\t\t\t\t(((vars[:vo]**2) * (Math.sin(2 * (vars[:theta] / (180/Math::PI))))) / -vars[:ay]) + vars[:xo]\n\t\t\twhen :xo\n\t\t\t\tvars[:xf] - (((vars[:vo]**2) * (Math.sin(2 * (vars[:theta] / (180/Math::PI))))) / -vars[:ay])\n\t\t\twhen :vo\n\t\t\t\t(((vars[:xf] - vars[:xo]) * -vars[:ay]))/Math.sin(2 * (vars[:theta] / (180/Math::PI)))**(1/2.0)\n\t\t\twhen :theta\n\t\t\t\t(Math.asin((((vars[:xf] - vars[:xo]) * -vars[:ay])) / vars[:vo]**2) / 2) * (180/Math::PI)\n\t\t\tend\n\t\tend\n\tend",
"def determinant\n end",
"def expression\r\n # -> uncomment the next line to manually enable rule tracing\r\n # trace_in( __method__, 1 )\r\n result = nil\r\n a = nil\r\n b = nil\r\n\r\n begin\r\n # at line 9:4: a= NUMBER '+' b= NUMBER\r\n a = match( NUMBER, TOKENS_FOLLOWING_NUMBER_IN_expression_28 )\r\n match( T__6, TOKENS_FOLLOWING_T__6_IN_expression_30 )\r\n b = match( NUMBER, TOKENS_FOLLOWING_NUMBER_IN_expression_34 )\r\n # --> action\r\n result = a.text.to_i + b.text.to_i \r\n # <-- action\r\n\r\n rescue ANTLR3::Error::RecognitionError => re\r\n report_error(re)\r\n recover(re)\r\n\r\n ensure\r\n # -> uncomment the next line to manually enable rule tracing\r\n # trace_out( __method__, 1 )\r\n\r\n end\r\n \r\n return result\r\n end",
"def in_fahrenheit\n\t\tif(@unit.to_s == \"f\")\n\t\t\t@degree\n\t\telse\n\t\t\t(@degree * (9.0/5.0)) + 32\n\t\tend\n\tend",
"def f(a)\n return lsin(a) + calcpi() / 2\nend",
"def numeric?; float?; end",
"def operation(x)\n Math.sqrt(x.abs) + 5 * x ** 3\nend",
"def quadratic_equation(a,b,c)\n a = MathLib::MathValidator.validate_input(a)\n b = MathLib::MathValidator.validate_input(b)\n c = MathLib::MathValidator.validate_input(c)\n\n delta = (b * b) - (4 * a * c)\n\n if (delta < 0)\n puts 'Delta is complex number'\n\n return 0\n elsif (delta == 0)\n puts 'quadratic equation has has only 1 answer'\n root1 = -b / (2* a);\n puts \"Roots of quadratic equation is: #{root1}\"\n\n return 0\n elsif (delta > 0)\n puts 'quadratic equation has real numbers'\n root1 = ( -b + Math.sqrt(delta)) / (2 * a)\n root2 = ( -b - Math.sqrt(delta)) / (2 * a)\n puts \"Roots of quadratic equation are: #{root1} || #{root2}\"\n\n return 0\n end\n end",
"def funcion1(x)\n\t y = -x * Math.sin(Math.sqrt(x.abs))\n\t # y = -x * Math.sin(Math.sqrt(x.abs * (Math::PI / 180.0 )))\n\t\ty\n\tend",
"def test_Aeq0Beq0\n assert_equal( nil, Equation.solve_quadratic(0, 0, 5) )\n end",
"def eval_expression\n if @input.to_i.zero?\n @input = eval(@input).to_s\n else\n @input = eval(@input).to_f.to_s\n end\n @output.text = @input\n end",
"def schreiner_equation(p_inert, p_alv, half_time, r_amb, dt)\n k = Math.log(2) / half_time\n p_alv + r_amb * ( dt - 1.0 / k ) - ( p_alv - p_inert - r_amb / k ) * Math.exp( -k * dt )\n end"
] |
[
"0.657003",
"0.6253532",
"0.6112311",
"0.5964109",
"0.56531453",
"0.5639497",
"0.56327915",
"0.5600428",
"0.5560593",
"0.55492884",
"0.5546164",
"0.55413586",
"0.5513886",
"0.5510171",
"0.54946834",
"0.5494127",
"0.5471322",
"0.54445285",
"0.53842735",
"0.53809494",
"0.5377717",
"0.53706324",
"0.5354174",
"0.5344003",
"0.533881",
"0.53386885",
"0.53348964",
"0.5328982",
"0.5301728",
"0.52655673",
"0.5231619",
"0.52172107",
"0.5207529",
"0.5172024",
"0.51703876",
"0.5164706",
"0.5164706",
"0.5164706",
"0.5136528",
"0.51330626",
"0.5128398",
"0.5105403",
"0.5103188",
"0.5096189",
"0.5094603",
"0.50811356",
"0.507372",
"0.50729823",
"0.506997",
"0.5057822",
"0.50568575",
"0.5051005",
"0.5032008",
"0.5023708",
"0.50090706",
"0.5001217",
"0.49983886",
"0.49965125",
"0.4987365",
"0.4987096",
"0.497737",
"0.49726856",
"0.49703836",
"0.4949232",
"0.49408436",
"0.49404144",
"0.49368563",
"0.49312085",
"0.49240136",
"0.49211496",
"0.4919972",
"0.49189594",
"0.4905179",
"0.49029317",
"0.48825413",
"0.4881955",
"0.4881633",
"0.48785946",
"0.48693696",
"0.48654604",
"0.48649484",
"0.48644105",
"0.4862773",
"0.48571536",
"0.48570383",
"0.48523363",
"0.4846428",
"0.48452818",
"0.4837633",
"0.4834494",
"0.48317945",
"0.48294717",
"0.48248464",
"0.4824336",
"0.4824161",
"0.4815312",
"0.48035103",
"0.4802704",
"0.4794195",
"0.47870037",
"0.47676954"
] |
0.0
|
-1
|
We need to sign the customer in ourselves, since iVeri is not sending the relevant data back to us to do so.
|
def sign_the_customer_in
transaction = ::Refinery::Transactions::Transaction.find_by_unique_guid(params['REFERENCE'])
sign_in(:customer, ::Refinery::Customers::Customer.find(transaction.order.customer_id))
@current_cart = get_cart # get the cart again now that the customer is signed in.
#@order = Order.find(params[:order_id])
#if params['CUSTOMER_ID'].present? and @order.customer.id.to_s == params['CUSTOMER_ID'].to_s
# sign_in(:customer, ::Refinery::Customers::Customer.find(params['CUSTOMER_ID']))
# @current_cart = get_cart # get the cart again now that the customer is signed in.
#else
# flash[:alert] = "You are not authorised to view that order's details"
# redirect_to refinery.root_path
#end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def set_customer\n if signed_in?\n # technically we need nothing here\n end\n end",
"def signing_input; end",
"def signing_input; end",
"def yes_email_customer_from_authorizes_side\n add_field 'x_email_customer', 'TRUE'\n end",
"def sign_key; end",
"def authenticate_customer \n label = request_label(:authenticate_customer, customer_id)\n \n @http_request_bundler.add(\n label, \n @url + \"/authenticate_customer\", \n :get,\n head: headers,\n query: { provider_id: provider_id, customer_id: customer_id, customer_token: customer_token }\n ).status!(label)\n end",
"def sign!\n @signed_date_time = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ')\n @signature = Cybersource::Security.generate_signature(signed_data)\n\n self\n end",
"def customer_payment_authorization(invoice) \n @invoice = invoice\n mail(:to => invoice.customer.email, :subject => \"Invoice #{@invoice.invoice_number} ready for payment\")\n end",
"def sign; adapter_class.new(self).sign; end",
"def create\n tpauth = Authentication.find session[:customer_oauth_id]\n if tpauth\n @customer = Customer.new(params[:customer])\n if Customer.count == 0\n # The first customer has administrative privileges.\n @customer.add_roles([:admin])\n end\n @customer.authentications << tpauth\n @customer.save\n session[:customer_id] = @customer.id\n redirect_to edit_customer_registration_path(@customer), :notice => \"Signed In!\"\n else\n redirect_to customer_sign_in_path, \"You need to authenticate first.\"\n end\n end",
"def set_customer\n header = get_header()\n @customer = Authorize.authorize_request(header)\n end",
"def set_customer\n header = get_header()\n @customer = Authorize.authorize_request(header)\n end",
"def test_successful_store_encryption_existing_customer_customer_ref\n test_successful_store_existing_customer_customer_ref(true)\n end",
"def customer_login(customer_reference)\n MerchantPluginProvider.api_not_implemented(self)\n end",
"def signing_key; end",
"def logged_in_customer\n unless customer_logged_in?\n store_location\n flash[:danger] = \"Please log in1.\"\n redirect_to customer_login_url\n end\n end",
"def confirm_authorized_amount(customer_file)\n\t\t@customer_file = customer_file\n\t\t@user = customer_file.customer.user\n\t\t@provider_profile = customer_file.provider.profile\n\t\tsendgrid_category :confirm_authorized_amount\n\t\t@show_logo = true\n\t\tsubject = \"You've authorized payments via Kinstantly\"\n\t\tmail to: @user.email, subject: subject\n\tend",
"def sign\n # parameters: petition_id, email (of petition signer), postcode\n\n # Save the petition signature\n\n db_query(\"\n\n INSERT INTO petition_signatures (petition_id, email)\n\n VALUES (#{params[:petition_id]}, '#{params[:email]}')\n\n \")\n\n # Tell CRM to store this new member, or update existing record\n\n http_post(\"https://crm.example.org/apiv1/upsert_member?email=#{params[:email]}\",\n postcode: params[:postcode])\n\n petition = Petition.find(params[:petition_id])\n\n render inline: \"<p>Thank you for signing #{petition.name}</p>\"\n end",
"def logged_in_customer\n unless customer_logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to customer_login_url\n end\n end",
"def signing_information\n super\n end",
"def customer_token\n @booking_profile.try(:external_password)\n end",
"def verify_action\n if current_user.customer?\n redirect_to root_url\n end\n end",
"def sign()\n # TODO\n end",
"def create_customer(email, token)\n raise \"Not implemented!\"\n end",
"def customer_register(primary_email, customer)\n MerchantPluginProvider.api_not_implemented(self)\n end",
"def register_customer\n @customer = Customer.load(params['From'])\n @log.update(customer_id: @customer.id)\n end",
"def customer_log_in(customer)\n session[:customer_id] = customer.id\n end",
"def remember(customer)\n\t\tcookies.permanent.signed[:customer_id] = customer.id \n\tend",
"def debit_customer_account\n end",
"def signer\n end",
"def set_customer\n @customer = current_customer_user\n end",
"def log_customer_in(customer)\n session[:customer] = customer.id\n end",
"def signing_input=(_); end",
"def signing_input=(_); end",
"def log_in_as(customer)\n session[:customer_id] = customer.id\n end",
"def current_user\n current_customer\n end",
"def sign_agreement\n @is_verify = false\n @candidate = Candidate.find(params[:id])\n @resource = @candidate\n end",
"def sign!(request,options = {})\n consumer.sign!(request,self,options)\n end",
"def logged_in_customer\n unless customer_logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end",
"def registrar_voucher_request_json\n # now build our voucher request from the one we got.\n vreq = Chariwt::VoucherRequest.new\n vreq.signing_cert = FountainKeys.ca.jrc_pub_key\n vreq.nonce = nonce\n vreq.serialNumber = device_identifier\n vreq.createdOn = created_at\n vreq.assertion = :proximity\n vreq.priorSignedVoucherRequest = pledge_request\n self.request = vreq\n jwt = vreq.jose_sign(FountainKeys.ca.jrc_priv_key)\n end",
"def new_customer\n # We are going to auth a customer. We indicate that in the session\n if current_customer\n redirect_to edit_customer_registration_path(current_customer), :notice => \"You are already signed in.\"\n else\n @providers = BuspassAdmin::Application.oauth_providers\n session[:tpauth] = :customer\n @options = \"?tpauth=customer&customer_auth=#{session[:session_id]}&failure_path=#{root_path}\"\n # We will render new_customer and then that will redirect to sessions#create on /auth/;provider/callback\n state_data = { :tpauth => :customer, :customer_auth => session[:session_id], :failure_path => root_path }\n state_urldata = CGI::escape(state_data.to_json)\n @fb_options = \"?state=#{state_urldata}\"\n end\n end",
"def create\n @user = current_user\n @customer = @user.customers.build(params[:customer])\n generated_password = Devise.friendly_token.first(6)\n\n @customer.password = generated_password\n @customer.password_visible = generated_password\n\n respond_to do |format|\n if @customer.save\n format.html { redirect_to user_customer_path(@user, @customer), notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def autosignin\n #LiferayFolder.new(11801)\n @ext_user_id = params[:ext_user_id] \n @user_session = McocExtappSession.where(:external_user_id => @ext_user_id, :is_active => true)\n if (@user_session.first != nil)\n #obtain mcoc_users mapping\n @mcoc_user = McocUser.where(:external_user_id => @ext_user_id)\n if (@mcoc_user.first != nil)\n @user_auto_id = @mcoc_user.first.id\n @user_auto = User.where(:id => @user_auto_id)\n if (@user_auto.first != nil) \n session[:user_id] = @mcoc_user.first.id\n sign_in(:user, User.find(@user_auto))\n redirect_to list_surveys_path\n else\n redirect_to static_pages_notactive_path\n end\n else\n redirect_to static_pages_notactive_path\n end \n else\n redirect_to static_pages_notactive_path\n end\n end",
"def new_customer\n end",
"def sign_cla!\n self.authorized_to_contribute = true\n save!\n end",
"def create_customer\n session[:customer_id] = nil\n session[:customer_oauth_id] = nil\n\n auth = request.env[\"omniauth.auth\"]\n # We should only have one of these.\n oauths = Authentication.where(:provider => auth[\"provider\"],\n :uid => auth[\"uid\"],\n :customer_id.ne => nil,\n :master_id => nil).order(\"created_at desc\").all\n oauth = oauths.first\n oauths.drop(1).each do |oa|\n logger.error \"sessions#create_customer: Removing extra authentications\"\n oa.destroy()\n end\n if oauth\n session[:customer_oauth_id] = oauth.id\n cust = oauth.customer\n if cust != nil\n session[:customer_id] = cust.id\n oauth.last_info = auth[\"info\"]\n oauth.save\n redirect_to my_index_websites_path, :notice => \"Signed in!\"\n else\n redirect_to new_customer_registration_path, :notice => \"Could not find you. Please create an account.\"\n end\n else\n oauth = Authentication.create_with_omniauth(auth)\n session[:customer_oauth_id] = oauth.id\n redirect_to new_customer_registration_path, :notice => \"Need to create an account.\"\n end\n end",
"def welcome(customer)\n @customer = customer\n # @url = \"http://localhost:3000/sign_up\"\n @token = Rails.application.message_verifier('customer').generate(@customer.id)\n mail to: @customer.email\n # binding.pry\n end",
"def add_customer(customer)\n respond_with customer.to_vaulted_billing\n end",
"def add_customer(customer)\n respond_with customer.to_vaulted_billing\n end",
"def customer_info(customer)\n return customer\n end",
"def send_customer(customer)\n request(customer, \"customer\", :post, {method: \"add\"})\n end",
"def signingIn (authentication)\n\n if authentication.instance_of?(Authentications)\n user = Customer.where(:id => authentication.user_id).first\n session[:user_id] = user.id\n current_user.sign_in_count +=1\n current_user.last_sign_in_at = Time.now\n current_user.current_sign_in_at = Time.now\n current_user.last_sign_in_ip = request.remote_ip \n current_user.current_sign_in_ip = request.remote_ip \n current_user.save\n @@logingIn=0\n redirect_to root_path, :notice => \"Logged in successfully\"\n else\n @@logingIn=0\n redirect_to root_path, :notice => \"Sorry! You need to register first \"\n\n end\n\n\nend",
"def new_customer\n @org = Organisation.find_by(permalink: params[:organisation_id])\n @customer = Customer.new\n\n Stripe.api_key = ENV[\"STRIPE_SECRET_KEY\"]\n end",
"def account_approved(approved_customer, approving_manager)\n @customer = approved_customer\n @manager = approving_manager\n mail to: @customer.email, subject: \"You have been approved as a customer with TSHA\"\n end",
"def create_data_to_sign(login, cc, params)\n t = Time.now\n utc_date_time = t.strftime(\"%FT%TZ\")\n $tracer.report(\"UTC Date/Time From #{__method__}, Line: #{__LINE__}: #{utc_date_time}\")\n signed_field_names = 'access_key,profile_id,transaction_uuid,signed_field_names,unsigned_field_names,signed_date_time,locale,transaction_type,reference_number,amount,currency,payment_method,bill_to_forename,bill_to_surname,bill_to_email,bill_to_phone,bill_to_address_line1,bill_to_address_city,bill_to_address_state,bill_to_address_country,bill_to_address_postal_code'.split(',')\n signed_field_name_string = \"access_key profile_id transaction_uuid signed_field_names unsigned_field_names signed_date_time locale transaction_type reference_number amount currency payment_method bill_to_forename bill_to_surname bill_to_email bill_to_phone bill_to_address_line1 bill_to_address_city bill_to_address_state bill_to_address_country bill_to_address_postal_code\"\n field_values = \"61852f33714536a98fe3835ac163c7ee,1979EB50-F7F8-495B-841B-F1C8AC7568B4,#{generate_guid},#{signed_field_name_string},card_type card_number card_expiry_date card_cvn,#{utc_date_time},en,create_payment_token,#{generate_guid},0.00,usd,card,#{params['BillFirstName']},#{params['BillLastName']},#{login},#{params['BillPhone']},#{params['BillLine1']},#{params['BillCity']},#{params['BillState']},#{params['BillCountryCode']},#{params['BillPostalCode']}\".split(',')\n field_values.map { |i| i.include?(',') ? (i.split /,/) : i }\n data_to_sign = Hash[signed_field_names.zip(field_values.map { |i| i.include?(',') ? (i.split /,/) : i })]\n data_to_sign['signed_field_names'] = data_to_sign['signed_field_names'].to_s.gsub(' ',',')\n data_to_sign['unsigned_field_names'] = data_to_sign['unsigned_field_names'].to_s.gsub(' ',',')\n $tracer.report(\"#{data_to_sign.inspect}\")\n #sectok = Security.new\n #signature = sectok.generate_signature(data_to_sign)\n $tracer.report(\"UTC Date/Time From #{__method__}, Line: #{__LINE__}: #{utc_date_time}\")\n return signature = nil, utc_date_time, data_to_sign\nend",
"def charge_user_via_invoice\n customer_id = stripe_user_customer_id\n return unless customer_id.present?\n\n invoice = create_invoice(customer_id)\n create_invoice_items_for_dpc(customer_id, invoice.id)\n resource.identifier.payment_id = invoice.id\n resource.identifier.payment_type = stripe_user_waiver? ? 'waiver' : 'stripe'\n resource.identifier.save\n invoice.send_invoice\n end",
"def vault_customer\n return nil if customer_details.id.nil?\n @gateway.customer.find(customer_details.id)\n end",
"def customer(customer_id)\n client.get \"customers/#{inst_id}/#{customer_id}\"\n end",
"def add_customer_data(request, options)\r\n request.Set(RocketGate::GatewayRequest::MERCHANT_CUSTOMER_ID, options[:customer_id])\r\n request.Set(RocketGate::GatewayRequest::IPADDRESS, options[:ip])\r\n request.Set(RocketGate::GatewayRequest::EMAIL, options[:email])\r\n end",
"def create\n @customer = User.new(customer_params)\n @customer.authority = 'customer'\n respond_to do |format|\n if @customer.save\n if !current_user\n log_in @customer, :customer\n end\n format.html {redirect_to customer_path(@customer), notice: 'Customer was successfully created.'}\n format.json {render :show, status: :created, location: @customer}\n else\n format.html {render :new}\n format.json {render json: @customer.errors, status: :unprocessable_entity}\n end\n end\n end",
"def logged_in_customer\n unless logged_in?\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end",
"def fresh_customer\n Billingly::Customer.create!.tap do |customer|\n session[:customer_id] = customer.id\n end\n end",
"def create_customer_in_gateway\n return success if @payment_nonce_uuid.blank?\n\n r = \"GatewayManagement::Customer::Create::#{@gateway_nonce.gateway_type.camelize}\".constantize.\n new(customer: @customer, client_id: @client.id, gateway_nonce: @gateway_nonce).perform\n\n return r unless r.success?\n\n @gateway_customer_associations = [r.data[:gateway_customer_association]]\n\n @gateway_nonce.status = GlobalConstant::GatewayNonce.used_status\n @gateway_nonce.save!\n\n success\n end",
"def payment_customer_email\n\t\t\t\t\treturn self.customer_email\n\t\t\t\tend",
"def email_merchant_from_authorizes_side(to_this_email)\n add_field 'x_email_merchant', to_this_email\n end",
"def test_successful_store_encryption_non_existing_customer_customer_ref\n test_successful_store_non_existing_customer_customer_ref(true)\n end",
"def signature_key; end",
"def authorize_customer\n unless @reservation.customer == current_customer\n redirect_to reservations_url, notice: 'No touchy!'\n # edit this?\n end\n end",
"def signed_or_encrypted; end",
"def sign_in\n\tputs \n\tchoice = (prompt \"Please choose:\\n1. Sign In\\n2. New Customer\\n\").to_i\n\n\tif choice == 1\n\t\tpin_entry\n\telsif choice == 2\n\t\tnew_cust_reg\n\telse\n\t\tputs `clear`\n\t\tputs \"Invalid response.\"\n\t\tsign_in\n\tend\nend",
"def add_customer_account\n self.create_account! unless self.account\n end",
"def update\n authenticate_customer!\n # We put this in the session in case the user adds an authentication.\n tpauth = Authentication.find session[:customer_oauth_id]\n if tpauth\n @customer = current_customer\n @customer.update_attributes(params[:customer])\n @customer.authentications << tpauth\n @customer.save\n redirect_to edit_customer_registration_path(@customer), :notice => \"Account Updated!\"\n else\n redirect_to customer_sign_in_path, \"You need to authenticate first.\"\n end\n end",
"def create\n @customer = Customer.new(params[:customer])\n @customer.fitment_centre_id = current_fitment_center_user.fitment_center_id\n @customer.guarantee_number = Time.now.to_i\n\n\n respond_to do |format|\n if @customer.save\n\n nexmo = Nexmo::Client.new(key: '8cfe5832', secret: 'f004980a')\n nexmo.send_message(to: \"#{@customer.cell_number}\", from: 'DotDna', text: \"Welcome to DotDna, Your fitment is now complete. Please note your customer number #{@customer.id}. To Download the app please visit http://www.dotdna.co.za/DotDna-1.100.apk\")\n\n @installed_stock = FitmentCenterStock.find(@customer.customer_assets.first.fitment_center_stock_id) rescue nil\n\n if @installed_stock != nil\n\n @installed_stock.qty -= 1\n @installed_stock.save!\n\n end\n\n format.html { redirect_to @customer, notice: 'Customer was successfully created.' }\n format.json { render json: @customer, status: :created, location: @customer }\n\n else\n format.html { render action: \"new\" }\n format.json { render json: @customer.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_payment_method\n authorize(current_employer)\n @customer = Customer.new\n end",
"def sign_certificate\n sign_certificate_for(default)\n end",
"def checkout\n @appointment = current_user.appointments.find(params[:appointment_id])\n\n # TO DO: Process the credit card of the user here\n end",
"def customer(options = nil)\n request = Request.new(@client)\n path = \"/authorization-requests/\" + CGI.escape(@id) + \"/customers\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n body = response.body\n body = body[\"customer\"]\n customer = Customer(self._client)\n return_values.push(customer.fill_with_data(body))\n\n \n return_values[0]\n end",
"def sign_agreement_verify\n @is_verify = true\n @candidate = Candidate.find(params[:id])\n end",
"def auth(params ={})\r\n @PARAM_HASH['TRANSACTION_TYPE'] = 'AUTH'\r\n @PARAM_HASH['AMOUNT'] = params[:amount]\r\n @PARAM_HASH['RRNO'] = params[:trans_id] || ''\r\n @PARAM_HASH['CUST_TOKEN'] = params[:customer_token] if params[:customer_token]\r\n @api = \"bp10emu\"\r\n \r\n if params[:new_customer_token] && params[:new_customer_token] != false\r\n @PARAM_HASH['NEW_CUST_TOKEN'] = params[:new_customer_token] == true ? SecureRandom.hex(8) : params[:new_customer_token]\r\n end\r\n end",
"def client_sign_up\n\n end",
"def set_bank_certificate_contents\n set_node(@template, 'pkif|SenderId', @customer_id)\n set_node(@template, 'pkif|CustomerId', @customer_id)\n set_node(@template, 'pkif|RequestId', request_id)\n set_node(@template, 'pkif|Timestamp', iso_time)\n set_node(@template, 'pkif|InterfaceVersion', 1)\n end",
"def logged_in_customer\n if logged_in?\n if current_person.producer?\n flash[:danger] = \"Content not available for producers.\"\n redirect_back fallback_location: root_url\n end # Else customer is logged in and do nothing\n else\n store_location\n flash[:danger] = \"Please log in.\"\n redirect_to login_url\n end\n end",
"def user_is_customer?\n (user_signed_in? && current_user.is_customer?)\n end",
"def nonce; end",
"def get_customer_id\n return @customer_id\n end",
"def register(customer)\n @customer = customer\n mail(:to => customer.email, :subject => \"Welcome to Fixapp\")\n end",
"def computed_signed_info\n \n llave = CFDI::Key.new @key, @password\n\n return Base64::encode64(llave.sign(OpenSSL::Digest::SHA1.new, CGI::unescapeHTML(self.canonicalized_signed_info.gsub('<TEST/>','').gsub(/\\n/, ''))))\n \n end",
"def sign!(cert)\n openssl_cert = cert.cert # because model -> OpenSSL object\n openssl_cert.serial = self.next_serial\n cert.serial = self.next_serial\n openssl_cert.issuer = ca_cert.subject\n openssl_cert.sign private_key, OpenSSL::Digest::SHA1.new\n self.next_serial = self.next_serial + 1\n self.save\n nil\n end",
"def email_otp\n end",
"def sign_request\n # By default OpenSSL generates an all-zero array for the encriptation vector\n # You can read it here: http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Cipher.html#method-i-iv-3D\n # If you want to declare it, you can take a look at the next couple of lines\n #bytes = Array.new(8,0)\n #iv = bytes.map(&:chr).join\n # We need to decode the secret key\n key = Base64.strict_decode64(credentials[:secret_key])\n # In thee cipher initialization we need to speficy the encryptation like method-length-mode (http://ruby-doc.org/stdlib-1.9.3/libdoc/openssl/rdoc/OpenSSL/Cipher.html#method-c-new).\n # Sermepa needs DES3 in CBC mode\n # The direct way the declare it's: des-ede3-cbc\n # You can also declare like 'des3' wich use CBC mode by default\n des3 = OpenSSL::Cipher::Cipher.new('des-ede3-cbc')\n # OpenSSL use by default PKCS padding. But Sermepa (mcrypt_encrypt PHP function) use zero padding.\n # OpenSSL do not allow zero padding. So we need to disable the default padding and make zero padding by hand\n # Padding in cryptography is to fill the data with especial characteres in order to use the data in blocks of N (https://en.wikipedia.org/wiki/Padding_(cryptography))\n # We need to use blocks of 8 bytes\n block_length = 8\n # We tell OpenSSL not to pad\n des3.padding = 0\n # We want to encrypt\n des3.encrypt\n # Key set\n des3.key = key\n #des3.iv = iv\n order_number = @fields[\"Ds_Merchant_Order\"]\n # Here is the 'magic'. Instead use the default OpenSSL padding (PKCS). We fill with \\0 till the data have\n # a multiple of the block size (8, 16, 24...)\n order_number += \"\\0\" until order_number.bytesize % block_length == 0\n # For example: the string \"123456789\" will be transform in \"123456789\\x00\\x00\\x00\\x00\\x00\\x00\\x00\"\n # data must be in blocks of 8 or the update will break\n key_des3 = des3.update(order_number) + des3.final\n # The next step is to encrypt in SHA256 the resulting des3 key with the base64 json\n result = OpenSSL::HMAC.digest('sha256', key_des3, merchant_parameters_base64_json)\n # The last step is to encode the data in base64\n Base64.strict_encode64(result)\n end",
"def get_customer_id_from_token(jwt_token)\n signed_data = JWT.decode(jwt_token, bc_client_secret, true)\n signed_data[0]['customer']['id'].to_s\nend",
"def customer_id\n @booking_profile.try(:external_user_id)\n end",
"def signup_received(customer)\n @customer = customer\n\n mail :to => customer.email, :subject => \"Thank you\"\n end",
"def create(cust_token, data = {})\n pdata = build_payment_info(data)\n data = FiveDL.build_params(data.merge!(transtype: 'updatecustomer', token: cust_token).merge!(pdata))\n FiveDL::Response.new( FiveDL::Gateway.post('/Payments/Services_api.aspx', data) )\n end",
"def create_customer\n input_param = params[:user] || params[:customer]\n if input_param\n input_param.delete(:password)\n input_param.delete(:password_confirmation)\n input_param.delete(:username)\n if current_user.is_a?(Referral) && input_param[:profile_attributes].present?\n input_param[:referral_category_id] = current_user.referral_category_id\n input_param[:profile_attributes][:referal_id] = current_user.code\n input_param[:profile_attributes][:referal] = current_user.referral_category.name if current_user.referral_category\n end\n end\n\n @customer = Customer.find_or_initialize_by_email(input_param[:email])\n @membership_order = Membership.find(session[:current_premium_id]) if session[:current_premium_id]\n \n if @customer.update_attributes(input_param)\n order.orderable = @customer\n # CustomerMailer.delay.welcome_email(@customer)\n CustomerMailer.delay.welcome_email_admin(@customer)\n \n if order.save && session[:current_premium_id].present?\n redirect_to extra_manage_orders_path\n else\n redirect_to premium_manage_orders_path\n end\n else\n @customer = Customer.new(input_param)\n flash[:errors] = @customer.errors.full_messages.uniq.join(', ')\n prepare_customer_form\n render :new\n end\n end",
"def sign!(request, options = {})\n consumer.sign!(request, self, options)\n end",
"def sign_up_client\n\n end",
"def sign\n validate!\n\n @voter.update(\n data: @data,\n signature: @signature,\n signed_vote_at: Time.now\n )\n\n signer = @signer.new(@admin_key)\n signer.sign(@data.to_i)\n end",
"def synchronize_customer_account\r\n return false unless session[:web_user] && request.post?\r\n \r\n unless (cust_id = session[:web_user].erp_account_number).blank?\r\n customer = ERP::Customer.find_by_account_num(cust_id) ||\r\n ERP::Customer.new(:account_num => cust_id)\r\n customer.synchronize(true)\r\n end\r\n rescue\r\n return false\r\n end",
"def customer(customer_id)\n perform_get_request(\"/customer/#{customer_id}\")\n end"
] |
[
"0.6846734",
"0.63465387",
"0.63465387",
"0.63450724",
"0.6340723",
"0.63189065",
"0.6277125",
"0.6246811",
"0.6063762",
"0.60343224",
"0.60134095",
"0.60134095",
"0.60125744",
"0.59851396",
"0.59639746",
"0.59639627",
"0.5956256",
"0.5952504",
"0.590299",
"0.5901953",
"0.58984256",
"0.5860623",
"0.5859948",
"0.5818971",
"0.5813986",
"0.58129627",
"0.5809169",
"0.58072954",
"0.579555",
"0.57918334",
"0.5788251",
"0.5784849",
"0.57810605",
"0.57810605",
"0.5760321",
"0.575081",
"0.5739691",
"0.5738242",
"0.5727757",
"0.57271653",
"0.5722706",
"0.5717812",
"0.5715402",
"0.57125",
"0.57123893",
"0.5709258",
"0.570376",
"0.5691429",
"0.5691429",
"0.5686183",
"0.5683334",
"0.5683128",
"0.56813926",
"0.56754345",
"0.56602937",
"0.5635788",
"0.56228155",
"0.559284",
"0.55911505",
"0.55901027",
"0.55873793",
"0.5584723",
"0.557873",
"0.5572305",
"0.55721325",
"0.5560553",
"0.55579025",
"0.5554315",
"0.5552954",
"0.555187",
"0.5547959",
"0.55443597",
"0.5543053",
"0.5534713",
"0.55340475",
"0.55297524",
"0.5519273",
"0.55145323",
"0.55135995",
"0.5506356",
"0.54981434",
"0.5495371",
"0.5488998",
"0.5488733",
"0.548158",
"0.54799104",
"0.54786325",
"0.5476656",
"0.54726934",
"0.54719204",
"0.5471815",
"0.5465374",
"0.54645145",
"0.54627246",
"0.54590535",
"0.5456008",
"0.5454277",
"0.54531354",
"0.544883",
"0.5446744"
] |
0.71816576
|
0
|
============================================================= Array of commands for text area toolbar, arranged into command groups.
|
def command_list
options[:commands] || SimpleFormEpicEditor::EpicEditorInput.configuration.commands
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def editor_toolbar\n [\n { name: 'basicstyles', groups: [ 'basicstyles', 'cleanup' ], items: [ 'Bold', 'Italic', 'Underline', 'Strike', '-', 'Subscript', 'Superscript', '-', 'RemoveFormat' ] },\n { name: 'clipboard', groups: [ 'clipboard', 'undo' ], items: [ 'Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo' ] },\n { name: 'editing', groups: [ 'find', 'selection', 'spellchecker' ], items: [ 'Find', 'Replace', '-', 'SelectAll', '-', 'Scayt' ] },\n '/',\n { name: 'paragraph', groups: [ 'align', 'list', 'indent', 'blocks' ], items: [ 'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote' ] },\n { name: 'insert', items: [ 'HorizontalRule', 'SpecialChar' ] },\n { name: 'styles', items: [ 'Format' ] },\n { name: 'others', items: [ '-' ] },\n { name: 'about', items: [ 'About' ] }\n ]\n end",
"def commands\n unless defined? @commands\n @commands = []\n end\n return @commands\n end",
"def commands\n @commands ||= []\n end",
"def command_list\n options[:commands] || SimpleFormWysihtml::WysihtmlInput.configuration.commands\n end",
"def generate_commands\n commands = []\n\n if @session.options.include?(:here) and @index == 0\n commands << \"tmux rename-window \\\"#{@name}\\\"\"\n else\n commands << \"tmux new-window -n \\\"#{@name}\\\"\"\n end\n\n pane_commands = @panes.map do |pane|\n c = pane.generate_commands\n c << \"tmux select-layout \\\"#{@layout}\\\"\" if @layout\n c\n end\n commands << pane_commands\n\n @options.each_pair do |option, value|\n value = \"on\" if value === true\n value = \"off\" if value === false\n commands << \"tmux set-window-option #{option} #{value}\"\n end\n\n commands << \"tmux select-layout \\\"#{@layout}\\\"\" if @layout\n commands << \"tmux select-pane -t #{@panes.map(&:focus).index(true) || 0}\"\n\n commands\n end",
"def commands\n cmds = []\n command_groups = self.template.command_groups\n command_groups.each do |c|\n commands = c.command_group_commands\n commands.each do |cmd|\n cmds << OpenStruct.new( :cmd_id => cmd.id, :name => cmd.Description, :params => cmd.parameters )\n end\n end\n cmds\n end",
"def commands\n @commands ||= [].tap do |c|\n commands_list.each do |command|\n if command.instance_of? String\n c << standard_commands[command].new\n else\n ret_command = send(command)\n c << (ret_command.instance_of?(Hash) ? ret_command.values : ret_command)\n end\n end\n end.flatten\n end",
"def set_commands; end",
"def docopt_commands(width)\n doc = []\n caption_printed = false\n @actions.each do |_name, action|\n action.help or next\n doc << \"Commands:\" unless caption_printed\n caption_printed = true\n helpline = \" #{action.help}\"\n wrapped = word_wrap helpline, width\n doc << \" #{action.usage}\\n#{wrapped}\\n\" unless action.usage == false\n end\n doc\n end",
"def commands\n\t\t{\n\t\t\t\"execute\" => \"Execute a command\",\n\t\t\t\"shell\" => \"Drop into a system command shell\",\n\t\t}\n\tend",
"def get_commands\n %w{ testchoose testnumberedmenu testdisplay_list testdisplay_text testdir saveas1 }\n end",
"def cmds(pool)\n cmds = \"\"\n pool.keys.each do |cmd|\n unless cmds == \"\"\n cmds += ', ' + cmd.to_s \n else\n cmds += cmd.to_s \n end\n end\n cmds += \" and quit!\" if pool == @cli_cmds\n result = \" > Available commands: \" + cmds\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 commands(aspect=:default)\n (@commands ||= begin\n @to = :default\n Hash.new { |h, k| h[k] = Array.new }\n end)[aspect]\n end",
"def previewed_commands\n @commands.map { |cmd| embed_command(cmd) }\n end",
"def commands\r\n @help_commands\r\n end",
"def commands\n @commands.keys.sort\n end",
"def add_commands\n end",
"def commands_list\n out = \"\"\n # If there are no commands set\n if COMMANDS.empty?\n out << \" ooops! commands are not here!\"\n else\n # Get the longest command's name, so we can output it nice 'n' clean\n # This '+ int' at the end is a distance (in spaces) from the longest\n # command to descriptions\n longest = COMMANDS.max_by(&:size).size + 8\n COMMANDS.each do |cmd|\n # Calc, calc.\n spaces = longest - cmd.size\n # Check if there is a 'desc' method\n desc = if eval \"Command::#{cmd}.new.respond_to? 'desc'\"\n # If there is - execute it\n eval \"Command::#{cmd}.new.desc\"\n else\n # If there is not\n \"---\"\n end\n out << \" \" << cmd.downcase.to_s << \" \" * spaces << desc\n # If this command is the last one, don't make a new line\n unless cmd == COMMANDS.last\n out << \"\\n\"\n end\n end\n end\n out\n end",
"def generate_commands\n commands = []\n commands << \"tmux rename-session \\\"#{@name}\\\"\" unless @name.nil?\n commands << @windows.map(&:generate_commands)\n @windows.each { |w| commands << \"tmux select-window -t:#{w.name}\" && break if w.focus }\n commands\n end",
"def commands(list)\n @commands = list.chars\n end",
"def commands\n return [] unless options[\"commands\"]\n options[\"commands\"].map do |options|\n options['parents'] = parents + [name]\n Command.new options\n end\n end",
"def commands\n raise NotImplementedError, \"`command' is not implemented by #{self.class.name}\"\n end",
"def printable_commands(*)\n item = []\n item << banner\n item << (desc ? \"# #{desc.gsub(/\\s+/m, ' ')}\" : \"\")\n [item]\n end",
"def commands; end",
"def commands\n\n {\n 'TODO' => \"This one shout take its sub commands from current(headers/body) variables and the key value should be the command description\n This one should depend on current context\"\n }\n\n end",
"def commands\n COMMANDS\n end",
"def commands\n self.class.command_classes\n end",
"def make_command_list\n add_command(NEW_ICON, :new)\n add_command(ITEM_ICON, :item)\n add_command(WEAPON_ICON, :weapon)\n add_command(ARMOR_ICON, :armor)\n add_command(HEAD_ICON, :head)\n add_command(ARM_ICON, :arm)\n add_command(ACCESSORY_ICON, :accessory)\n add_command(FOOD_ICON, :food)\n add_command(MATERIAL_ICON, :material)\n add_command(KEY_ITEM_ICON, :key_item)\n end",
"def commands\n load_commands unless @commands\n @commands\n end",
"def commands\n args.commands.map do |cmd|\n if cmd.respond_to?(:join)\n cmd.map { |c| c.index(' ') ? \"'#{c}'\" : c }.join(' ')\n else\n cmd.to_s\n end\n end\n end",
"def get_commands\n %w{ testchoosedir testchoosefile testnumberedmenu testdisplay_list testdisplay_text testdir }\n end",
"def make_command_list\n add_command(Vocab::SKILLS, :skills, main_commands_enabled)\n add_command(Vocab::CAPACITIES, :capacities, main_commands_enabled)\n add_command(Vocab::EQUIP, :equip, main_commands_enabled)\n add_command(Vocab::LEARNING, :learning, main_commands_enabled)\n add_command(Vocab::LIBRAIRIES, :librairies, main_commands_enabled)\n add_command(Vocab::ITEM, :item, main_commands_enabled)\n add_command(Vocab::CRAFTING, :crafting, main_commands_enabled)\n add_command(Vocab::STRATEGY, :strategy, main_commands_enabled)\n add_command(Vocab::COOKING, :cooking, main_commands_enabled)\n add_command(Vocab::SYSTEM, :system, main_commands_enabled)\n end",
"def command_names\n commands.map &:name\n end",
"def supported_commands\n commands.keys\n end",
"def textareas; end",
"def create_toolbars\n # TODO\n end",
"def make_command_list\n add_command(Vocab::MANUAL, :manual, manual_enabled?)\n add_command(Vocab::SEMI_AUTO, :semi_auto)\n add_command(Vocab::AUTO, :auto)\n end",
"def subcommands\n @subcommands ||= []\n end",
"def subcommands\n @subcommands ||= []\n end",
"def subcommands\n Properties[self.class] ||= {}\n return Properties[self.class][:subcmds] || []\n end",
"def default_commands_config\n [\n {\n :name => \"Google Quicksearch\", \n :command_id=> 1,\n :tags=>'google'\n },\n {\n :name => \"Gmail Search\", \n :command_id=> 2,\n :tags=>'google mail'\n },\n {\n :name => \"Google \\\"I'm Feeling Lucky\\\" Wikipedia (en) search\",\n :command_id=> 3,\n :tags=>'google wikipedia'\n },\n {\n :name => \"Dictionary Lookup at Reference.com\",\n :command_id=> 4,\n :tags=>\"dictionary reference language english\"\n },\n {\n :name => \"My Queriac Page\",\n :command_id=> 5,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Show a Queriac user command\",\n :command_id=> 6,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Edit a Queriac user command\",\n :command_id=> 7,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name => \"Create a new Queriac user command\",\n :command_id=> 8,\n :tags=>\"queriac bootstrap\"\n },\n {\n :name=> \"Search my Queriac user commands\",\n :command_id=> 645,\n :tags=>\"queriac bootstrap\"\n }\n ]\n end",
"def commands\n\t\t{ }\n\tend",
"def set_commands\n super\n @commands['clear'] = ConsoleCommand_Clear.new(self)\n @commands['confirm'] = ConsoleCommand_Confirm.new(self)\n end",
"def pbCommandMenu(index)\n commands=[\"FIGHT\",\"Jermon\",\"BAG\",\"RUN\"]\n cw = Window_Command.new(192, commands)\n cw.x=0\n cw.y=256\n cw.index=@lastcmd[index]\n pbRefresh\n loop do\n Graphics.update\n Input.update\n pbFrameUpdate(cw)\n if Input.trigger?(Input::C)\n ret=cw.index\n cw.dispose\n @lastcmd[index]=ret\n return ret\n end\n end \n end",
"def commands\n help_list = {}\n @commands.map do |cmd|\n info = Commands.const_get(\"#{cmd}\".capitalize!).info #=> {cmd => \"Description\"}\n help_list[info.keys.first] = info.values.first\n end\n\n return help_list\n end",
"def commands\n {}\n end",
"def make_command_list\n @categories.each { |cat| \n add_command(\"\", cat, false, QuestData::ICONS[cat]) }\n end",
"def cmd_cmds\n puts self.methods.grep(/^cmd_/).map {|m| m[4..-1]} * \" \"\n end",
"def commands\n {\n }\n end",
"def cmd_ids\n print_tree(Editor, 0, true)\n end",
"def get_commands\n return nil\n end",
"def test_cmds(cmds)\n max_x = 7\n max_y = 3\n cmds.push(\"rect 3x2\")\n cmds.push(\"rotate column x=1 by 1\")\n cmds.push(\"rotate row y=0 by 4\")\n cmds.push(\"rotate column x=1 by 1\")\n screen = Array.new(max_x) { |i| Array.new(max_y) { |i| \".\" }}\nend",
"def all_commands\n [client_commands, server_commands].flatten\n end",
"def make_command_list\n add_command(Vocab.reg_username_cmd, :name)\n add_command(Vocab.reg_avatar_cmd, :avatar)\n add_command(Vocab.change_title, :title)\n add_command(Vocab.reg_submit_cmd, :register, @registration_ok)\n end",
"def commands\n @@commands.dup\n end",
"def split_commands(cmd_line); end",
"def help\n [['some command', 'description of some command'],\n ['some other command', 'description of some other command']]\n end",
"def command\n command = []\n i = 0\n until command[i - 1] == 'REPORT'\n get_input_for('Enter Commands (ex. Move)') do |input|\n command[i] = input.upcase\n i += 1\n !command.nil?\n end\n end\n command\n end",
"def docker_commands\n []\n end",
"def commands\n c = {\n \"?\" => \"Help menu\",\n \"background\" => \"Backgrounds the current session\",\n \"exit\" => \"Terminate the hardware bridge session\",\n \"help\" => \"Help menu\",\n \"irb\" => \"Drop into irb scripting mode\",\n \"load\" => \"Load one or more meterpreter extensions\",\n \"run\" => \"Executes a meterpreter script or Post module\",\n \"bgrun\" => \"Executes a meterpreter script as a background thread\",\n \"bgkill\" => \"Kills a background meterpreter script\",\n \"bglist\" => \"Lists running background scripts\",\n \"sessions\" => \"Quickly switch to another session\",\n \"status\" => \"Fetch bridge status information\",\n \"specialty\" => \"Hardware devices specialty\",\n \"reset\" => \"Resets the device (NOTE: on some devices this is a FULL FACTORY RESET)\",\n \"reboot\" => \"Reboots the device (usually only supported by stand-alone devices)\",\n \"load_custom_methods\" => \"Loads custom HW commands if any\"\n }\n\n if msf_loaded?\n c[\"info\"] = \"Displays information about a Post module\"\n end\n\n c\n end",
"def command_list\n collect_do - subcommand_list\n end",
"def commands\n {\n 'help' => 'Help menu',\n 'background' => 'Backgrounds the current shell session',\n 'sessions' => 'Quickly switch to another session',\n 'resource' => 'Run a meta commands script stored in a local file',\n 'shell' => 'Spawn an interactive shell (*NIX Only)',\n 'download' => 'Download files (*NIX Only)',\n 'upload' => 'Upload files (*NIX Only)',\n 'source' => 'Run a shell script on remote machine (*NIX Only)',\n 'irb' => 'Open an interactive Ruby shell on the current session',\n 'pry' => 'Open the Pry debugger on the current session'\n }\n end",
"def commands\n\t\t{\n\t\t\t\"?\" => \"Help menu\",\n\t\t\t\"background\" => \"Backgrounds the current session\",\n\t\t\t\"close\" => \"Closes a channel\",\n\t\t\t\"channel\" => \"Displays information about active channels\",\n\t\t\t\"exit\" => \"Terminate the meterpreter session\",\n\t\t\t\"help\" => \"Help menu\",\n\t\t\t\"interact\" => \"Interacts with a channel\",\n\t\t\t\"irb\" => \"Drop into irb scripting mode\",\n\t\t\t\"migrate\" => \"Migrate the server to another process\",\n\t\t\t\"use\" => \"Load a one or more meterpreter extensions\",\n\t\t\t\"quit\" => \"Terminate the meterpreter session\",\n\t\t\t\"read\" => \"Reads data from a channel\",\n\t\t\t\"run\" => \"Executes a meterpreter script\",\n\t\t\t\"bgrun\" => \"Executes a meterpreter script as a background thread\",\n\t\t\t\"bgkill\" => \"Kills a background meterpreter script\",\n\t\t\t\"bglist\" => \"Lists running background scripts\",\n\t\t\t\"write\" => \"Writes data to a channel\",\n\t\t}\n\tend",
"def list_commands\n puts template(:all, {\n app: File.basename(@app),\n\n cmds: ::WeatherSage::CLI::Help::COMMANDS.values.map { |cmd|\n template(:cmd, cmd)\n }.join(\"\\n\"),\n\n envs: ::WeatherSage::CLI::Env::VARS.map { |row|\n template(:env, row)\n }.join(\"\\n\\n\"),\n })\n end",
"def commands\n {\n \"sample\" => \"A sample command added by the sample plugin\",\n \"notifier_start\" => \"Start session watcher\",\n \"notifier_stop\" => \"Stop session watcher\",\n \"notifier_set_user\" => \"Set Dashboard user name\",\n \"notifier_set_pass\" => \"Set Dashboard password\",\n \"notifier_set_dashboard_url\" => \"Set Dashboard base URL\",\n \"notifier_show_config\" => \"Show notifier config\",\n \"notifier_dashboard_login\" => \"Log in to dashboard\",\n \"notifier_dashboard_permissions\" => \"Get dashbaord user permissions\"\n }\n end",
"def commands\n\t\t{\n\t\t\t\"cat\" => \"Read the contents of a file to the screen\",\n\t\t\t\"cd\" => \"Change directory\",\n\t\t\t\"download\" => \"Download a file or directory\",\n\t\t\t\"edit\" => \"Edit a file\",\n\t\t\t\"getwd\" => \"Print working directory\",\n\t\t\t\"ls\" => \"List files\",\n\t\t\t\"mkdir\" => \"Make directory\",\n\t\t\t\"pwd\" => \"Print working directory\",\n\t\t\t\"rmdir\" => \"Remove directory\",\n\t\t\t\"upload\" => \"Upload a file or directory\",\n\t\t\t\"lcd\" => \"Change local working directory\",\n\t\t\t\"getlwd\" => \"Print local working directory\",\n\t\t\t\"lpwd\" => \"Print local working directory\",\n\t\t\t\"rm\" => \"Delete the specified file\",\n\t\t\t\"del\" => \"Delete the specified file\",\n\t\t\t\"search\" => \"Search for files\"\n\t\t}\n\tend",
"def add_main_commands\n add_command(Vocab::item, :item, main_commands_enabled)\n add_command(Vocab::skill, :skill, main_commands_enabled)\n add_command(Vocab::equip, :equip, main_commands_enabled)\n add_command(Vocab::status, :status, main_commands_enabled)\n end",
"def commands\n @commands ||=\n if superclass.respond_to? :commands\n superclass.commands.clone\n else\n {}\n end\n end",
"def commands\n\t\t\t\t{\n\t\t\t\t\t'twitt_help'\t\t\t\t\t=> \"Displays help\",\n\t\t\t\t\t'twitt_start'\t\t\t\t\t=> \"Start Twitter Plugin after saving settings.\",\n\t\t\t\t\t'twitt_stop'\t\t\t\t\t=> \"Stop monitoring for new sessions.\",\n\t\t\t\t\t'twitt_test'\t\t\t\t\t=> \"Send test message to make sure confoguration is working.\",\n\t\t\t\t\t'twitt_save'\t\t\t\t\t=> \"Save Settings to YAML File #{Twitter_yaml}.\",\n\t\t\t\t\t'twitt_set_consumer_key'\t\t=> \"Sets Twitter Consumer Key.\",\n\t\t\t\t\t'twitt_set_consumer_secret'\t \t=> \"Sets Consumer Secret.\",\n\t\t\t\t\t'twitt_set_oauth_token'\t\t \t=> \"Sets Oauth Token.\",\n\t\t\t\t\t'twitt_set_oauth_token_secret' => \"Sets Oauth Token Secret\",\n\t\t\t\t\t'twitt_set_user'\t\t\t\t=> \"Sets User to whom messages will be sent.\",\n\t\t\t\t\t'twitt_set_source'\t\t\t \t=> \"Sets Source Name from where the messages are sent.\",\n\t\t\t\t\t'twitt_show_parms'\t\t\t \t=> \"Shows currently set parameters.\"\n\n\t\t\t\t}\n\t\t\tend",
"def client_commands\n @client_commands ||= []\n end",
"def map_commands(commands)\n result = []\n commands.each { |c| result.push(*c.split(' ')) }\n\n result\n end",
"def button_texts\n CTRL_TEXTS_PER_MODE[@mode].collect { |data| get_text(data) }\n end",
"def subcommand_list\n return '' unless subcommand?\n\n invoking_command = File.basename($0) # could be rspec, etc\n command_list = subcommand_class.printable_commands\n .sort_by { |a| a[0] }\n .map { |a| a[0].sub!(invoking_command, cli_name); a } # replace with proper comand\n .reject { |a| a[0].include?(\"help [COMMAND]\") } # filter out help\n\n # dress up with markdown\n text = command_list.map do |a|\n command, comment = a[0], a[1].sub(/^# /,'')\n subcommand_name = command.split(' ')[2]\n full_command_path = \"#{cli_name}-#{@command_name}-#{subcommand_name}\"\n full_command_name = \"#{cli_name} #{@command_name} #{subcommand_name}\"\n link = \"_reference/#{full_command_path}.md\"\n\n # \"* [#{command}]({% link #{link} %})\"\n # Example: [lono cfn delete STACK]({% link _reference/lono-cfn-delete.md %})\n \"* [#{full_command_name}]({% link #{link} %}) - #{comment}\"\n end.join(\"\\n\")\n\n <<-EOL\n## Subcommands\n\n#{text}\nEOL\n end",
"def make_command_list\n add_command(\"Start\", :new_game)\n add_command(\"Continue\", :continue, continue_enabled)\n add_command(\"Quit\", :shutdown)\n end",
"def commands\n abstract!\n end",
"def commands\n self.class.commands\n end",
"def parse_cmd commands\n\t\t@commands = commands.split(//)\n\tend",
"def axis_commands(instance, *commands)\n instance.axis_commands(commands)\n end",
"def cmds(*commands, **opts)\n commands.flatten.map { |command| [command, cmd(command, **opts)] }\n end",
"def instructions(cmds)\n cmds.chars.map { |char| COMMANDS.invert[char] }\n end",
"def get_actions\n\n actions = []\n\n unless self.actions.nil? or self.actions.empty?\n actions = self.actions.split(\"\\n\").collect {|entry| entry.split('-') }\n end\n return actions\n end",
"def cmds\n pry(Git::Multi::Commands)\nend",
"def printable_commands(all = true, subcommand = false)\n (all ? all_commands : commands).map do |_, command|\n next if command.hidden?\n item = []\n item << banner(command, false, subcommand)\n item << (command.description ? \"# #{command.description.gsub(/\\s+/m, ' ')}\" : \"\")\n item\n end.compact\n end",
"def list_commands(character, input=nil)\n \t\tcommands = COMMANDS.keys\n \t\t\n\t\tprint_line commands.join(?\\s)\n\t\tprint_line\n\tend",
"def gather_command\n @command = []\n @lines.each do |x|\n if x[0,1].is_i?\n @command.push(x.split(/ /).s_to_i)\n else\n @command.push(x.split(//))\n end\n end\n end",
"def battle_commands\n @battle_commands ||= []\n @battle_commands\n end",
"def run(*commands)\n # if we are in a window context, append commands to default tab.\n if @_context.is_a?(Hash) && @_context[:tabs]\n current = @_context[:tabs]['default'][:commands]\n elsif @_context.is_a?(Hash)\n current = @_context[:commands]\n else\n current = @_context\n end\n current << commands.map do |c|\n c =~ /&$/ ? \"(#{c})\" : c\n end.join(\" && \")\n end",
"def create_command_window\n c_list = []\n @cm_list = []\n CP::MENU_COMMANDS.COMMANDS.each_with_index do |comm, index|\n in_op = comm.size\n if in_op > 3\n in_op -= 1 if comm.include?(:no1)\n in_op -= 1 if comm.include?(:save)\n end\n next if in_op > 3\n c_list.push(comm[0])\n @cm_list.push(index)\n end\n @command_window = Window_Command.new(160, c_list)\n @command_window.index = @menu_index\n save_op = !$game_system.save_disabled\n char_op = $game_party.members.size != 0\n CP::MENU_COMMANDS.COMMANDS.each_with_index do |comm, index|\n i = @cm_list.index(index)\n next unless i\n if comm.include?(:save)\n @command_window.draw_item(i, save_op)\n end\n if comm.include?(:no1)\n @command_window.draw_item(i, char_op)\n end\n end\n end",
"def set_commands\n ConsoleCommand::Properties.each do |cmd_class,data|\n next if data[:debug_only] && !$DEBUG\n next if data[:outside_game]\n next if (data[:session] || 'shell') != self.name\n next if data[:mkxp_only] && !$MKXP\n @commands[data[:name]] = cmd_class.new(self) unless data[:hidden]\n end \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 macmm_remake_command_list\n # Go through the command list in order\n $game_system.macmm_command_list.each { |sym|\n if MA_CustomizableMenu::CUSTOM_COMMANDS.key?(sym)\n macmm_add_custom_command(sym)\n elsif @noncustom_commands.key?(sym)\n # Add default command to the list\n @list.push(@noncustom_commands[sym][1])\n @noncustom_commands.delete(sym)\n else\n p \"Error: MA_MenuBase - No command is set up for #{sym}\"\n end\n }\n # Add all remaining noncustom commands, under the assumption that they are\n # intentionally placed there by an unknown script.\n @noncustom_commands.values.each { |el| @list.insert([el[0], @list.size].min, el[1]) }\n end",
"def valid_commands\n methods.grep(/_command$/).map {|c| c.to_s.gsub(\"_command\", \"\")}\n end",
"def valid_commands\n methods.grep(/_command$/).map {|c| c.to_s.gsub(\"_command\", \"\")}\n end",
"def commands\n {\n \"power_shell\" => \"Execute a powershell command.\",\n \"power_view\" => \"Download and execute Veil's PowerView Framework\",\n \"power_up\" => \"Download and execute the PowerUp Framework\",\n \"power_katz\" => \"Invoke-Mimikatz into memory using PowerShell\",\n \"power_scan\" => \"Invoke-PortScan from meterpreter using PowerShell\"\n }\n end",
"def set_commands\n ConsoleCommand::Properties.each do |cmd_class,data|\n next if data[:debug_only] && !$DEBUG\n next if data[:in_game]\n next if (data[:session] || 'shell') != self.name\n next if data[:mkxp_only] && !$MKXP\n @commands[data[:name]] = cmd_class.new(self) unless data[:hidden]\n end \n end",
"def list_commands\n puts UI_ARROW.light_yellow + \" \" + \"'fight', 'f', or 'battle' to view enemies and fight.\"\n puts UI_ARROW.light_yellow + \" \" + \"'armoury' or 'a' to go to the armoury.\"\n puts UI_ARROW.light_yellow + \" \" + \"'stats' to view your current status.\"\n puts UI_ARROW.light_yellow + \" \" + \"'clear' or 'cls' to clear the screen.\"\n puts UI_ARROW.light_yellow + \" \" + \"'quit', 'q', or 'exit' to abandon your journey.\"\nend",
"def text_area_elements(identifier)\n platform.text_areas_for(identifier.clone)\n end",
"def commands\n @aliases\n end"
] |
[
"0.69749165",
"0.6785098",
"0.67527103",
"0.66377825",
"0.65820795",
"0.6544469",
"0.6330386",
"0.63066477",
"0.62974465",
"0.6295889",
"0.6289949",
"0.62580293",
"0.6246095",
"0.6214037",
"0.6201597",
"0.61950517",
"0.61791986",
"0.616637",
"0.6159494",
"0.6140782",
"0.61385494",
"0.61333793",
"0.6120759",
"0.6118075",
"0.61142516",
"0.6090594",
"0.6070721",
"0.6070559",
"0.60402143",
"0.6030039",
"0.6028962",
"0.60166514",
"0.5997297",
"0.5980297",
"0.59731644",
"0.5967162",
"0.59631646",
"0.5954102",
"0.59473246",
"0.59473246",
"0.59296596",
"0.591856",
"0.59157944",
"0.5906578",
"0.58869654",
"0.5848291",
"0.58479315",
"0.58449423",
"0.58402",
"0.5828277",
"0.5827483",
"0.5798681",
"0.57903343",
"0.5773447",
"0.5750464",
"0.57490236",
"0.5745783",
"0.5721223",
"0.57186455",
"0.5717842",
"0.5711295",
"0.57098085",
"0.570791",
"0.5702719",
"0.5700876",
"0.5699567",
"0.56893325",
"0.56716716",
"0.5669149",
"0.5653538",
"0.564672",
"0.563635",
"0.5632127",
"0.56258583",
"0.5611823",
"0.5596231",
"0.5589247",
"0.55859953",
"0.55779004",
"0.5573722",
"0.5566706",
"0.5554551",
"0.5521178",
"0.55146086",
"0.55060995",
"0.5493591",
"0.54903674",
"0.5487524",
"0.5480041",
"0.547748",
"0.5471371",
"0.5471371",
"0.5453244",
"0.5448763",
"0.5448763",
"0.54419166",
"0.5440505",
"0.5431681",
"0.54270875",
"0.5424872"
] |
0.6497417
|
6
|
GET /events GET /events.json
|
def index
# @events = Event.all
if params[:id]
# get all records with id less than 'our last id'
# and limit the results to 5
@events = Event.where('id < ?', params[:id]).limit(5)
else
@events = Event.limit(5)
end
respond_to do |format|
format.html
format.js
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end",
"def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end",
"def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end",
"def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end",
"def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end",
"def index\n @events = Event.all\n render json: @events, status: 200\n end",
"def index\n @events = Event.all\n render json: @events\n end",
"def index\n @events = current_user.events\n\n render json: @events\n end",
"def index\n @events = Event.find(:all)\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def index\n @events = Event.all\n\n render json: @events\n end",
"def index\n @event = Event.all\n render json: @event\n end",
"def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json do\n render :json => {events: @events}\n end\n end\n end",
"def index\n response = { events: Event.all }\n respond_to do |format|\n format.json { render json: response.to_json }\n format.html { render :index }\n end\n end",
"def get_events\n if @user.uuid.present?\n @events = @user.events.active_events.page(params[:page])\n paginate json: @events, per_page: params[:per_page]\n elsif @user.uuid == \"guest\"\n @events = Com::Nbos::Events::Event.active_events.where(tenant_id: @user.tenant_id)\n render json: @events\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"def index\n\t\t@events = Event.all.order('created_at desc')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @events }\n\t\tend\n\tend",
"def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json \n end\n end",
"def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend",
"def events(project_id, options = {})\n get \"projects/#{project_id}/events\", options\n end",
"def index\n @events = current_user.events\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def show\n @event = Event.find(params[:id])\n render json: @event\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n \n @events = current_user.events\n \n \n respond_to do |format|\n format.html {}\n format.json { render json: Event.events_to_json(@events) }\n end\n end",
"def events\n data[\"events\"]\n end",
"def events\n url = 'https://api.artic.edu/api/v1/exhibitions?limit=35'\n\n res = RestClient.get(url)\n JSON.parse(res)\nend",
"def index\n @events = @calendar.events.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end",
"def index\n\t\t@events = current_user.events\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @events }\n\t\tend\n\tend",
"def index\n @events = @category.events\n render json: @events \n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end",
"def index\n render json: Event.all, status: :ok\n end",
"def show\n render json: @event, status: :ok\n end",
"def index\n @upcoming_events = Event.upcoming\n @past_events = Event.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n respond_with(@events)\n end",
"def get_event(session, options={})\n json_request \"get\", {:session => session}, options\n end",
"def index\n @events = getUpcomingEvents()\n \n @page_title = \"Events\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def get(event_id)\n @client.request \"events/#{event_id}\"\n end",
"def index\n\t\t@events = Event.page(params[:page]).per(10)\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json {\n\t\t\t\trender :json => @events.to_json\n\t\t\t}\n\t\tend\n\n\tend",
"def events\n collection(\"events\")\n end",
"def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not Found\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"def event(event, options = {})\n get \"events/#{event}\", options\n end",
"def past_events\n @events = Event.past\n render json: @events, include: :talks\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def get_event_list ( year )\n get_api_resource \"#{@@api_base_url}events/#{year}\"\n end",
"def index\n begin\n events = Event.all\n render :json => {events: ActiveModel::ArraySerializer.new(events, each_serializer: EventsSerializer), :code => 200}, status: :ok\n rescue Exception => e\n logger.error {\"Error while populating list of events. ErrorMessage: #{e.message}, Params: #{params.inspect}\"}\n render json: {error: e.message, code: 500}\n end\n end",
"def show\n \trender json: @event\n end",
"def show\n @events = fetch_events\n end",
"def show\n render json: EventSerializer.new(@event).as_json, status: 200\n end",
"def list\n @events = Event.coming_events\n respond_to do |format|\n format.html do\n render layout: 'events'\n end\n format.json do \n events = @events.map {|event| {event: event, users: event.users, applied: event.users.include?(current_user) }}\n render json: events \n end\n end\n end",
"def index\n if params[:query].present?\n @events = GroupEvent.send(params[:query])\n else\n @events = GroupEvent.published\n end\n\n render json: @events\n end",
"def fullcalendar_events_json\n events.map do |event|\n {\n id: event.id.to_s,\n title: event.name,\n start: event.starts_at.strftime('%Y-%m-%d %H:%M:%S'),\n end: event.ends_at.strftime('%Y-%m-%d %H:%M:%S'),\n allDay: event.all_day,\n url: event_path(event)\n }\n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_event }\n end\n end",
"def index\n if params[:user]\n @events = Event.where(user: params[:user]).first\n else\n @events = Event.all.order('created_at asc')\n end\n\n render json: @events, :only => [:id, :date, :user, :event_type, :message, :otheruser]\n end",
"def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def details\n get(\"v1/event/#{@id}\")\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event } \n end\n end",
"def index\n @events = Event.all\n @event = Event.new\n\n respond_to do |format|\n format.html\n format.json { render 'events/index', events: @events }\n end\n end",
"def show\n render json: format_event(@event)\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end"
] |
[
"0.8337474",
"0.8240041",
"0.7943668",
"0.79278964",
"0.7768141",
"0.7740975",
"0.7670209",
"0.7665706",
"0.765914",
"0.76425344",
"0.7621046",
"0.761625",
"0.761625",
"0.76141375",
"0.75690866",
"0.75230986",
"0.7489482",
"0.74811614",
"0.7470508",
"0.7442612",
"0.74410146",
"0.7440337",
"0.74389035",
"0.7410911",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.74098724",
"0.7400629",
"0.739856",
"0.73748904",
"0.73687345",
"0.73670644",
"0.7364443",
"0.736428",
"0.73617107",
"0.73617107",
"0.73617107",
"0.73617107",
"0.73617107",
"0.73590285",
"0.73522234",
"0.73342603",
"0.73254657",
"0.732164",
"0.729601",
"0.72958374",
"0.7287818",
"0.7282796",
"0.72739697",
"0.72733605",
"0.7248011",
"0.72444135",
"0.72289705",
"0.72289705",
"0.72235423",
"0.72131395",
"0.72122496",
"0.71830565",
"0.71819556",
"0.7171345",
"0.7134091",
"0.7128304",
"0.7124135",
"0.71229357",
"0.7115039",
"0.7110467",
"0.7110467",
"0.7104101",
"0.7102504",
"0.71024567",
"0.71014696",
"0.7100226",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634",
"0.70999634"
] |
0.0
|
-1
|
GET /events/1 GET /events/1.json
|
def show
@event = Event.find_by_id(params[:id])
@users = DetailedUser.joins('JOIN event_registers ON event_registers.user_id = detailed_users.user_id WHERE event_id = ' + params[:id])
@comments = Comment.where(event_id: params[:id]).order('created_at DESC')
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n @event = Event.find(params[:id])\n render json: @event\n end",
"def get(event_id)\n @client.request \"events/#{event_id}\"\n end",
"def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not Found\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end",
"def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end",
"def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end",
"def index\n @events = Event.all\n render json: @events, status: 200\n end",
"def index\n @event = Event.all\n render json: @event\n end",
"def index\n @events = Event.find(:all)\n respond_to do |format|\n format.html\n format.json\n end\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: @events }\n end\n end",
"def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end",
"def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def details\n get(\"v1/event/#{@id}\")\n end",
"def index\n @events = Event.all\n render json: @events\n end",
"def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myevent }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_event }\n end\n end",
"def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end",
"def index\n @events = Event.all\n\n render json: @events\n end",
"def show\n render json: @event, status: :ok\n end",
"def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json do\n render :json => {events: @events}\n end\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.json { render json: @events }\n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event } \n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def show\n render json: @event\n end",
"def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json \n end\n end",
"def show\n render json: EventSerializer.new(@event).as_json, status: 200\n end",
"def event(event, options = {})\n get \"events/#{event}\", options\n end",
"def index\n response = { events: Event.all }\n respond_to do |format|\n format.json { render json: response.to_json }\n format.html { render :index }\n end\n end",
"def index\n render json: Event.all, status: :ok\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def index\n @events = current_user.events\n\n render json: @events\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def event(id, options = {})\n get \"events/#{id}\", options\n end",
"def index\n @events = Event.all\n @event = Event.new\n\n respond_to do |format|\n format.html\n format.json { render 'events/index', events: @events }\n end\n end",
"def show\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event_type = EventType.find(@event.event_type_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end",
"def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end",
"def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end",
"def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend",
"def index\n @event = Event.find(params[:event_id])\n\n end",
"def index\n @upcoming_events = Event.upcoming\n @past_events = Event.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def show\n \trender json: @event\n end",
"def index\n @events = current_user.events\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n @events = getUpcomingEvents()\n \n @page_title = \"Events\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end",
"def index\n respond_with(@events)\n end",
"def show\n render json: format_event(@event)\n end",
"def show\n @current_event = CurrentEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @current_event }\n end\n end",
"def get_events\n if @user.uuid.present?\n @events = @user.events.active_events.page(params[:page])\n paginate json: @events, per_page: params[:per_page]\n elsif @user.uuid == \"guest\"\n @events = Com::Nbos::Events::Event.active_events.where(tenant_id: @user.tenant_id)\n render json: @events\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"def show\n begin\n @event = Event.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to show invalid event #{params[:id]}\"\n redirect_to events_path, notice: 'Invalid event ID'\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end\n end",
"def index\n @events = @category.events\n render json: @events \n end",
"def index\n\t\t@events = Event.all.order('created_at desc')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @events }\n\t\tend\n\tend",
"def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event, methods: [:talks] }\n end\n end",
"def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end",
"def index\n if params[:user]\n @events = Event.where(user: params[:user]).first\n else\n @events = Event.all.order('created_at asc')\n end\n\n render json: @events, :only => [:id, :date, :user, :event_type, :message, :otheruser]\n end",
"def get_event(session, options={})\n json_request \"get\", {:session => session}, options\n end",
"def index\n \n @events = current_user.events\n \n \n respond_to do |format|\n format.html {}\n format.json { render json: Event.events_to_json(@events) }\n end\n end",
"def show\n @calendar = Calendar.find(params[:id])\n @events = Event.find(@calendar.event_ids)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @calendar }\n end\n end"
] |
[
"0.75029767",
"0.74019474",
"0.7361382",
"0.7348975",
"0.73475033",
"0.7338018",
"0.7317425",
"0.72875094",
"0.72813755",
"0.7246173",
"0.72317284",
"0.7219172",
"0.7219172",
"0.7218839",
"0.7218839",
"0.721464",
"0.7204848",
"0.71989256",
"0.7196662",
"0.71925515",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7192214",
"0.7190171",
"0.7189989",
"0.71858066",
"0.71843475",
"0.71817815",
"0.7178166",
"0.716525",
"0.71637964",
"0.7158998",
"0.71580267",
"0.7120116",
"0.7120116",
"0.7120116",
"0.7120116",
"0.7120116",
"0.7104676",
"0.7098543",
"0.70866513",
"0.7075021",
"0.7071629",
"0.70692325",
"0.70692325",
"0.7067004",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.70606047",
"0.7050251",
"0.7043129",
"0.70385677",
"0.70330113",
"0.7027942",
"0.7025206",
"0.70196456",
"0.6993209",
"0.69843143",
"0.69733816",
"0.69682246",
"0.69497913",
"0.6949218",
"0.6943893",
"0.6929541",
"0.69259447",
"0.6922537",
"0.69194067",
"0.6912311",
"0.6893206",
"0.689077",
"0.687633",
"0.6853893",
"0.6851784"
] |
0.0
|
-1
|
POST /events POST /events.json
|
def create
@event = Event.new(event_params)
respond_to do |format|
if @event.save
# When a host adds an event, he/she gets automatically joined
EventRegister.create(:user_id => current_user.id, :event_id => @event.id)
format.html { redirect_to @event, notice: 'Event was successfully created.' }
format.json { render :show, status: :created, location: @event }
else
format.html { render :new }
format.json { render json: @event.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create_event event, data={}\n data[:event] = event\n post '/event', data\n end",
"def create\n event = Event.new(event_params)\n event.save!\n render json: event\n end",
"def create\n Rails.logger.debug(\"Received event #{params[:event]}\")\n head :ok\n end",
"def create\n @event = Event.new(params[:event])\n\n if @event.save\n render json: @event, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n megam_rest.post_event(to_hash)\n end",
"def create\n @event = Event.new(event_params)\n\n if @event.save\n \tdata = { data: @event, status: :created, message: \"Event was successfully created.\" }\n render :json => data\n else\n \tdata = { data: @event.errors, status: :unprocessable_entity }\n render :json => data\n end\n end",
"def create\n @event = Event.new(event_params)\n if @event.save\n head :created\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n puts params[:event]\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, :notice => 'Event was successfully created.' }\n format.json { render :json => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.json { render :show, status: :created, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.json { render :show, status: :created, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @user = User.find_by_authentication_token(params[:auth_token])\n @event = Event.new.from_json(params[:event])\n @event.user_id = @user.id\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n @event.organizer = current_user\n\n if @event.save\n render json: @event, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def save\n event = params\n # This assumes that all keys exists. Yay no error handling...\n toSave = Event.new(update_type: event[:event],\n start_time: event[:payload][:event][:start_time_pretty],\n end_time: event[:payload][:event][:end_time_pretty],\n location: event[:payload][:event][:location],\n invitee_name: event[:payload][:invitee][:name],\n duration: event[:payload][:event_type][:duration],\n event_kind: event[:payload][:event_type][:kind])\n toSave.save\n render json: {}, status: 200\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, :notice => 'Event was successfully created.' }\n format.json { render :json => @event, :status => :created, :location => @event }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: t(:event_created) }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params['user_id'] = current_user.id if current_user\n @event = Event.new(event_params)\n\n if @event.save\n render json: { location: format_event(@event) }, status: :created\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to \"/#{@event.url}\" }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def push_events\n saved = []\n jsonHash = request.POST[:_json];\n jsonHash.each do |jsonEvent|\n event = Event.new\n event.race_id = jsonEvent[\"raceId\"]\n event.walker_id = jsonEvent[\"walkerId\"]\n event.eventId = jsonEvent[\"eventId\"]\n event.eventType = jsonEvent[\"type\"]\n event.eventData = jsonEvent[\"data\"]\n event.batteryLevel = jsonEvent[\"batL\"]\n event.batteryState = jsonEvent[\"batS\"]\n event.timestamp = Time.zone.parse(jsonEvent[\"time\"])\n if event.save # if new\n saved << jsonEvent[\"eventId\"]\n if event.race_id != 0 # if not unknown race_id\n after_create(event)\n end\n else # if exists\n saved << jsonEvent[\"eventId\"]\n puts \"Not Saved!\" # debug print\n puts jsonEvent # debug print \n end\n end\n render :json => {:savedEventIds => saved}\n end",
"def create\n result = Event::CreateEvent.perform(event_context)\n\n respond_to do |format|\n if result.success?\n @event = result.event\n format.json { render action: 'show', status: :created }\n else\n format.json { render json: { :errors => result.errors.full_messages }, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n if @event.save\n render :show, status: :created, location: @event\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def create\n @event = Events::Event.new(event_params)\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: \"Event #{@event} was successfully created.\" }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: events_path(@event) }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, event: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n params[:event] = convert_datetimes( params[:event] )\n @event = @current_account.events.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # render json: params[:event]\n temp_event = Event.create(\n name: params[:event][:name],\n location: params[:event][:location],\n date: params[:event][:date],\n time: params[:event][:time],\n budget: params[:event][:budget],\n user: current_user\n )\n redirect_to \"/items?event=#{temp_event.id}\"\n end",
"def create\n \n @event = Event.new(event_params)\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: \"Event was successfully created.\" }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event_event = Event::Event.new(params[:event_event])\n\n respond_to do |format|\n if @event_event.save\n format.html { redirect_to @event_event, notice: 'Event was successfully created.' }\n format.json { render json: @event_event, status: :created, location: @event_event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to events_path, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to dashboard_home_path }\n format.json { render 'event', status: :created, event: @event }\n else\n format.html { render dashboard_home_path }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n logger.debug @event.errors.inspect\n format.html { redirect_to @event, notice: 'データが新規作成されました。' }\n format.json { render :show, status: :created, location: @event }\n else\n logger.debug @event.errors.to_hash(true)\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to new_event_path, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, flash: {success: 'Event was successfully created.'} }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: \"Event was successfully created.\" }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: \"Event was successfully created.\" }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, success: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'El evento fue creado exitosamente.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n flash[:success] = \"Event was successfully created.\"\n format.html { redirect_to @event }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\r\n @event = Event.new(event_params)\r\n convert_timezone @event\r\n event_type_status @event\r\n if @event.save_without_exception\r\n update_theme @event\r\n add_event_categories @event\r\n add_event_location @event\r\n create_group_guest_list @event\r\n add_photos @event\r\n # Create Groups and contacts through CSV\r\n contacts_imports\r\n render json: SuccessResponse.new(\r\n code: 200, message: 'Event Created.', location: '/events/List?id=' + @event.id.to_s, eventID: @event.id\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new, adapter: :json, status: :unprocessable_entity\r\n end\r\n end",
"def create\n @event = current_user.events.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: t(:event_success) }\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_events\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Aula cadastrada com sucesso.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to action: :index, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to new_user_event_path(current_user), notice: 'event was successfully created.' }\n format.json\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n @event.url = BASE_URL + @event.name.gsub(' ', '_')\n \n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_event(url, event, payload_type, payload)\n body = {\n :event => event,\n :payload_type => payload_type }\n body[:payload] = payload if payload\n\n http_post(url) do |req|\n req.headers['Content-Type'] = 'application/json'\n req.body = body.to_json\n req.params['verification'] = 1 if event == 'verification'\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to @event, notice: 'Event was successfully created.' }\n format.json { render action: 'show', status: :created, location: @event }\n else\n format.html { render action: 'new' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = @calendar.events.new(event_params)\n respond_to do |format|\n if @event.save\n format.json { render json: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n\n respond_to do |format|\n if @event.save\n flash[:success] = \"Wydarzenie zostało utworzone.\"\n format.html {redirect_to @event}\n format.json {render :show, status: :created, location: @event}\n else\n format.html {render :new}\n format.json {render json: @event.errors, status: :unprocessable_entity}\n end\n end\n end",
"def create\n @event = Event.new(params[:event])\n\n respond_to do |format|\n if @event.save\n format.html { redirect_to event_registration_path(id: @event.id), notice: 'Event was successfully created.' }\n format.json { render json: @event, status: :created, location: @event }\n else\n format.html { render action: \"new\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @event = Event.new(event_params)\n @event.creator = @current_user\n\n if @event.save\n @event.users.each do |user|\n p \"event user = #{user.name}\"\n user.send_event_push(PushTypes::NEW_EVENT, current_user.to_push, @event.title)\n end\n else\n render json: @event.errors, status: :unprocessable_entity\n return\n end\n end",
"def create\n @event = Event.new(event_params)\n if @event.save\n render json: @event, status: 201\n @user_event = UserEvent.create(admin: true, event_id: @event.id, user_id: current_user.id)\n else\n render json: { message: \"Please make sure to fill all required fields.\" }, status: 401\n end\n end",
"def create\n @event = Event.new(event_params)\n respond_to do |format|\n if @event.save\n track_activity @event\n format.html { redirect_to :back, notice: 'Event was successfully created.' }\n format.json { render :show, status: :created, location: @event }\n after_event_created_mail @event\n else\n format.html { render :new }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @myevent = Myevent.new(params[:myevent])\n\n respond_to do |format|\n if @myevent.save\n format.html { redirect_to @myevent, notice: 'Myevent was successfully created.' }\n format.json { render json: @myevent, status: :created, location: @myevent }\n else\n format.html { render action: \"new\" }\n format.json { render json: @myevent.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.7714071",
"0.7611226",
"0.76028967",
"0.7541319",
"0.7444731",
"0.73206913",
"0.73138195",
"0.728203",
"0.7251226",
"0.7235907",
"0.7235907",
"0.7215051",
"0.71682763",
"0.7150409",
"0.7126664",
"0.7118896",
"0.7117831",
"0.71162695",
"0.70964044",
"0.70907074",
"0.7083036",
"0.7081109",
"0.7080767",
"0.7071589",
"0.7057984",
"0.70422375",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7018503",
"0.7016941",
"0.70167124",
"0.70091015",
"0.70081246",
"0.6989661",
"0.6987218",
"0.6970633",
"0.6970633",
"0.6966775",
"0.6948742",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6948119",
"0.6942416",
"0.6936477",
"0.69359535",
"0.69359535",
"0.69318086",
"0.69268054",
"0.6907236",
"0.6905569",
"0.69051725",
"0.6904514",
"0.6902843",
"0.69011873",
"0.6899826",
"0.68961006",
"0.68811166",
"0.68746495",
"0.68642014",
"0.68642014",
"0.6843213",
"0.68419445",
"0.6836244",
"0.68352246",
"0.6820027",
"0.68000513",
"0.6791519"
] |
0.0
|
-1
|
PATCH/PUT /events/1 PATCH/PUT /events/1.json
|
def update
respond_to do |format|
if @event.update(event_params)
format.html { redirect_to @event, notice: 'Event was successfully updated.' }
format.json { render :show, status: :ok, location: @event }
else
format.html { render :edit }
format.json { render json: @event.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def patch_event\n user_id = params[\"user_id\"]\n group_id = params[\"group_id\"]\n event_id = params[\"event_id\"]\n\n #TODO Handle 404 if event not found\n event = Event.find(event_id)\n\n json_body = JSON.parse(request.body.read)\n\n @@event_service.patch_event(json_body, user_id, group_id, event_id)\n\n render status: :ok, text: \"\"\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { head :no_content }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @event.update(event_params(params))\n render json: @event, status: 200\n else\n render :json => @event.errors, :status => 422\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render json: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @event.update(event_params)\n render json: @event, status: 201\n else\n render json: { message: \"Error. Error. Please try again.\"}, status: 400\n end\n end",
"def update\n\tif @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n return forbidden unless user_is_owner\n return bad_request unless @event.update_attributes(event_params)\n render json: @event, status: :ok\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.json { render :show, status: :ok, location: @event }\n else\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @event.update(event_params)\n render json: { location: format_event(@event) }\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n @event.update(status: \"Pending\")\n else\n @reopen = true\n format.json { render json: @event.errors, status: :unprocessable_entity }\n format.html { render :show }\n end\n end\n end",
"def update\n \n \n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: t(:event_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n \n end\n end",
"def update\n @event = Event.find(params[:id])\n\n if @event.update(params[:event])\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def pupdate\n @event = Event.find(params[:id])\n respond_to do |format|\n if @event.update_attributes(JSON.parse(params[:event]))\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n if @event.update(event_params)\n head :no_content\n else\n render json: @event.errors, status: :unprocessable_entity\n end\n end",
"def update\n respond_to do |format|\n if @base_event.update(base_event_params)\n format.json { head :no_content }\n else\n format.json { render json: @base_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html {redirect_to @event, notice: 'Event was successfully updated.'}\n format.json {head :no_content}\n else\n format.html {render action: 'edit'}\n format.json {render json: @event.errors, status: :unprocessable_entity}\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n @event.save!\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n # @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #require \"pry\"; binding.pry\n\n update_users\n\n respond_to do |format|\n if @event.update(event_params)\n sync_update @event\n format.html { redirect_to @event, notice: t(\"successfully_updated\", :model => t(\"models.event\")) }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.using(:shard_one).find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n\n\n\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_path, notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: events_path(@event) }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, :notice => 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @event.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def update\n\n\n\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to '/', notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n\n respond_to do |format|\n if @event.update(event_params)\n\n format.html { redirect_to @event }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n #@event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n event_id = params[:id]\n if event_id.present? && params[:event].present? && @user.uuid.present? && @user.uuid != \"guest\"\n event_params = params[:event]\n @event = Com::Nbos::Events::Event.where(id: params[:id], user_id: @user.id ).first\n if @event.present?\n @event.update(event_params.permit!)\n if @event.save\n render :json => @event\n else\n data = add_error_messages(@event)\n render :json => data\n end\n else\n render :json => {\"messageCode\": \"module.user.unauthorized\", \"message\": \"Unauthorized to update others Event\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end",
"def update\r\n respond_to do |format|\r\n if @event.update(event_params)\r\n format.html { redirect_to @event, notice: 'Event 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: @event.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html do\n gflash :notice\n redirect_to @event\n end\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n if @event_event.update_attributes(params[:event_event])\n format.html { redirect_to @event_event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event_event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n @event = Event.find(params[:id])\n\n respond_to do |format|\n if @event.update_attributes(params[:event])\n format.html { redirect_to @event, notice: 'Event was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to events_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end",
"def update\n if @event.update(event_params)\n \tdata = { data: @event, status: :ok, message: \"Event was successfully updated.\" }\n render :json => data\n else\n \tdata = { data: @event.errors, status: :unprocessable_entity }\n render :json => data\n end\n end",
"def update\n respond_to do |format|\n if @event.update(event_params)\n format.html { redirect_to edit_event_path(@event), notice: 'Event was successfully updated.' }\n format.json { render :show, status: :ok, location: @event }\n else\n format.html { render :edit }\n format.json { render json: @event.errors, status: :unprocessable_entity }\n end\n end\n end"
] |
[
"0.75308925",
"0.7372846",
"0.71773857",
"0.71726954",
"0.7171285",
"0.71428627",
"0.7096435",
"0.7083602",
"0.7083602",
"0.70582867",
"0.7021309",
"0.6990082",
"0.6982827",
"0.6977965",
"0.6960428",
"0.69546765",
"0.69546765",
"0.6952509",
"0.69216263",
"0.69216263",
"0.69216263",
"0.69216263",
"0.69216263",
"0.69216263",
"0.69216263",
"0.69216263",
"0.69216263",
"0.6916418",
"0.6894629",
"0.6883964",
"0.68793255",
"0.6863717",
"0.68586403",
"0.68557703",
"0.68539923",
"0.6846916",
"0.6846916",
"0.6846916",
"0.684046",
"0.68402314",
"0.6835719",
"0.6825515",
"0.6816759",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6814494",
"0.6812348",
"0.6808011",
"0.67935103",
"0.67935103",
"0.67935103",
"0.67935103",
"0.67935103",
"0.67935103",
"0.67935103",
"0.67935103",
"0.6790054",
"0.6782165",
"0.67766607"
] |
0.0
|
-1
|
DELETE /events/1 DELETE /events/1.json
|
def destroy
event = Event.find_by_id(params[:id])
sailing = Sailing.find_by_id(event.sailing_id).cruise_ship_name
@event.destroy
respond_to do |format|
format.html { redirect_to user_dashboard_path, notice: "#{event.event_name} Event in #{sailing} cruise was successfully deleted."}
format.json { head :no_content }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def delete_event\n if params[:id]\n @e = Evento.find(params[:id]).destroy\n end\n render :json => msj = { :status => true, :message => 'ok'}\n end",
"def destroy\n @event = Event.find(params[:id])\n \n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n #@event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n # @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @events = Event.where(event_id: params[:id])\n @events.each.destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n\n end",
"def destroy\n @event_event = Event::Event.find(params[:id])\n @event_event.destroy\n\n respond_to do |format|\n format.html { redirect_to event_events_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url}\n format.json { head :no_content }\n end\n end",
"def destroy\n @myevent = Myevent.find(params[:id])\n @myevent.destroy\n\n respond_to do |format|\n format.html { redirect_to myevents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n\n sync_destroy @event\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html {redirect_to events_url}\n format.json {head :no_content}\n end\n end",
"def destroy\n @calevent = Calevent.find(params[:id])\n @calevent.destroy\n\n respond_to do |format|\n format.html { redirect_to calevents_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n #@event.update_attribute(:deleted, true)\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n render :nothing => true, :status => 200, :content_type => 'text/plain'\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url, notice: t(:event_deleted) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_events_path }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n head :no_content\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Event was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'データが削除されました。' }\n format.json { head :no_content }\n end\n end",
"def delete_event\r\n event = Event.find_by(id: params[:eventid].to_i)\r\n if event.present?\r\n event.update(status: 3)\r\n lt_update_event_status event, 'archived'\r\n render json: SuccessResponse.new(\r\n code: 200,\r\n message: 'Event Deleted.'\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new(\r\n code: 404,\r\n message: 'Event not found!'\r\n ), adapter: :json, status: :not_found\r\n end\r\n\r\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_to_client_path(@client) }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event_request = EventRequest.find(params[:id])\n @event_request.destroy\n\n respond_to do |format|\n format.html { redirect_to event_requests_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Мероприятие успешно удалено.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = current_user.events.find_by_url(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @post_event.destroy\n respond_to do |format|\n format.html { redirect_to post_events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event = @current_account.events.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @evento = Evento.find(params[:id])\n @evento.destroy\n\n respond_to do |format|\n format.html { redirect_to eventos_url }\n format.json { head :ok }\n end\n end",
"def destroy\n @event = Event.find(params[:id])\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @eventtype.events.each do |e|\n e.destroy\n end\n @eventtype.destroy\n respond_to do |format|\n format.html { redirect_to eventtypes_url }\n format.json { head :no_content }\n end\n end",
"def destroy \n @event.destroy \n respond_to do |format|\n format.html { redirect_to events_url, success: 'Event was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.mobile { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"def destroy\n @create_event = CreateEvent.find(params[:id])\n @create_event.destroy\n\n respond_to do |format|\n format.html { redirect_to create_events_url }\n format.json { head :no_content }\n end\n end"
] |
[
"0.769268",
"0.76872975",
"0.76872975",
"0.76872975",
"0.7680665",
"0.7585337",
"0.75682765",
"0.7560537",
"0.75407815",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7540473",
"0.7539941",
"0.75382024",
"0.7537234",
"0.7526631",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75194746",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.75145763",
"0.74953985",
"0.74650526",
"0.7459677",
"0.7453618",
"0.7446788",
"0.74399537",
"0.7439926",
"0.7434689",
"0.7432393",
"0.7401567",
"0.73877174",
"0.73772806",
"0.7371874",
"0.7365335",
"0.7337954",
"0.733497",
"0.733497",
"0.7322736",
"0.73000205",
"0.7296434",
"0.72906893",
"0.7289899",
"0.7289422",
"0.728712",
"0.7284745",
"0.7283742",
"0.72820485",
"0.72724354",
"0.72697437"
] |
0.0
|
-1
|
Use callbacks to share common setup or constraints between actions.
|
def set_event
@event = Event.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 event_params
params.fetch(:event, {}).permit(:creator_id,:sailing_id, :event_name, :start_date , :end_date, :location, :max_participants, :sailing_id, :description, :image)
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
|
TODO: Dynamically get all rows rather than pass 'range'
|
def rows(range = 'Sheet1!A1:E')
get_spreadsheet_data('1eu1Dk67gKnrIgQQ9Fm0Y-RCMzRfZf1UaTQzEt7hjWp0', range)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def rows_range(first = 0, last = nil) # :nodoc:\n raise UserError, 'first must be <= last' unless first <= last\n\n rows = []\n unless columns.empty?\n first.upto(last) do |rnum|\n row = {}\n columns.each do |col|\n row[col.header] = col[rnum]\n end\n rows << row\n end\n end\n rows\n end",
"def content_range(row_range, column_range)\n content[row_range].map { |row| row[column_range] }\n end",
"def rows\r\n @all_rows\r\n end",
"def effective_column(range); end",
"def rows\n @rows ||= star_file.sheets.first.rows\n end",
"def rows( start_row = 1, end_row = data.rows )\n return to_enum(:rows, start_row, end_row) unless block_given?\n ( start_row..end_row ).each { |idx| yield row( idx ) }; self\n end",
"def rows(max: 20)\n (first_row..([last_row, max].min))\n end",
"def rows\n @rows\n end",
"def rows\n @rows\n end",
"def rows\n @rows\n end",
"def rows\n @rows\n end",
"def column_of(range); end",
"def rows \n @r\n end",
"def all_rows\n @rows\n end",
"def data_rows\n @rows[@num_header_rows..-1]\n end",
"def row; end",
"def rows\n @array\n end",
"def rows\n RowCollection.new(@data)\n end",
"def getRows\n return @grid.getRows\n end",
"def rows\n @rows ||= begin\n row_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end",
"def rows\n @rows ||= csv_rows[1..-1]\n end",
"def rows\n @rows ||= csv_rows[1..-1]\n end",
"def rows\n CellCollection.new(@data, @column)\n end",
"def rows\n return @rows\n end",
"def rows\n Array.new self\n end",
"def get_range(column_family, options = {})\n if block_given? || options[:key_count] || options[:batch_size]\n get_range_batch(column_family, options)\n else\n get_range_single(column_family, options)\n end\n end",
"def range_start; range.first; end",
"def range_by_lines(range); end",
"def rows\n @rows ||=\n begin\n rows = []\n @facet_values.each_slice(2) do |pair|\n rows << new_row(pair)\n end\n rows\n end\n end",
"def rows\n @rows.lazy\n end",
"def _range from, to\n\t\trange = `IDBKeyRange.bound(#{from}, #{to})`\n\t\tEnumerator.new do |out, done|\n\t\t\ttry do\n\t\t\t\ttransaction = `#@db.transaction(['kv'], 'readonly')`\n\t\t\t\tstore = `#{transaction}.objectStore('kv')`\n\t\t\t\tindex = `#{store}.index('key')`\n\t\t\t\t%x{#{index}.openCursor(#{range}).onsuccess = function(e) {\n\t\t\t\t\tvar cursor = e.target.result\n\t\t\t\t\tif(cursor) {\n\t\t\t\t\t\t// #{log `cursor.value.key`, `cursor.value.val`}\n\t\t\t\t\t\t// debugger\n\t\t\t\t\t\t#{out << [`cursor.value.key`, `cursor.value.val`]}\n\t\t\t\t\t\tcursor.continue()\n\t\t\t\t\t} else {\n\t\t\t\t\t\t#{done[]}\n\t\t\t\t\t}\n\t\t\t\t}}\n\t\t\tend\n\t\tend.lazy\n\tend",
"def argument_rows\n rows[1..rows.count] || []\n end",
"def rows\n rows_and_cols.first\n end",
"def getIndexRange()\n rangeTime = { :min => nil, :max => nil} ;\n rangeX = { :min => nil, :max => nil} ;\n rangeY = { :min => nil, :max => nil} ;\n rangeZ = { :min => nil, :max => nil} ;\n @sumGridTable.keys.sort.each{|index|\n rangeTime[:min] = safeMin(index[0], rangeTime[:min]) ;\n rangeTime[:max] = safeMax(index[0], rangeTime[:max]) ;\n rangeX[:min] = safeMin(index[1][0], rangeX[:min]) ;\n rangeX[:max] = safeMax(index[1][0], rangeX[:max]) ;\n rangeY[:min] = safeMin(index[1][1], rangeY[:min]) ;\n rangeY[:max] = safeMax(index[1][1], rangeY[:max]) ;\n rangeZ[:min] = safeMin(index[1][2], rangeZ[:min]) ;\n rangeZ[:max] = safeMax(index[1][2], rangeZ[:max]) ;\n }\n return [rangeTime, rangeX, rangeY, rangeZ] ;\n end",
"def rows\n fail \"Implement #{self.class}#rows\"\n end",
"def each\n @reaktor_rows\n end",
"def each_row\n 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 get_row_cells row\n\t\treturn (row * 9...row * 9 + 9).to_a\n\tend",
"def rows\n @pz.group_by.each_with_index { |val, n| row_id(n) }\n end",
"def read_rows\n line_no = 0\n\n @sheet.rows.each do |r|\n line_no += 1\n row = row_as_array(r)\n next if empty_row?(row)\n\n data = convert_row(row, line_no)\n yield data if block_given?\n end\n end",
"def selected_rows(rows_num)\n @row_array = ('A'..\"#{(rows_num + 64).chr}\").to_a\n end",
"def m_range\r\n end",
"def rows\n 1\n end",
"def rows\n rows_to_skip = data_start_index\n cached_columns = columns\n\n Rximport.logger.info \"Parser: Reading rows in sheet #{sheet.name}, starting at row #{data_start_index + 1}\"\n\n data_rows = sheet.simple_rows.lazy\n .drop(rows_to_skip)\n .reject(&:blank?)\n .each_with_index\n .map { |r, idx| Row.new(cached_columns, r, idx + rows_to_skip, sheet.name) }\n\n data_rows.map do |row|\n if block_given?\n yield row\n else\n row\n end\n end\n end",
"def range(from, to)\n from_query(raw_range(from, to))\n end",
"def row(index)\n end",
"def rows\n cells_ordered = cells.order(:y => :desc)\n (0..height).map { |row_id| cells.where(y: row_id) }\n end",
"def values(range = nil)\n result_unflatten = if !::RANGES_JRUBY_BUG\n map { |x| x.v }\n else\n self.v\n end\n result = result_unflatten.flatten\n if range\n relevant_result = []\n result.each_with_index { |row_or_column, i| relevant_result << row_or_column if range.include?(i) }\n relevant_result\n else\n result\n end\n end",
"def rows()\n (cr=@records.get(GRT_COLROW)) ? cr[1] : nil\n end",
"def get_rows(solrparams, params)\n params.key?(:rows) ? solrparams.merge!(:rows => params[:rows]) : solrparams.merge!(:rows => 100000000) # if user passes in the rows they want, use that, else just return everything\n end",
"def rows(opts={'start' => nil, 'limit' => nil})\n Cursor.new({'collection' => link('rows'),\n 'start' => opts['start'],\n 'limit' => opts['limit']}.update(@opts))\n end",
"def cells\n rows.flatten\n end",
"def get_rows(word)\n print_debug \"Getting rows for #{word}\"\n rows = get_base_rows(word, true)\n rows = get_base_rows(word, false) if rows.size == 0\n rows\n end",
"def query_range(left, right)\n \n end",
"def query_range(left, right)\n \n end",
"def rows(table, id, start_time, end_time)\n res = connection.query(\"SELECT UNIX_TIMESTAMP(dtime), counter, rate FROM #{table} WHERE id = #{id} AND dtime >= FROM_UNIXTIME(#{start_time}) AND dtime <= FROM_UNIXTIME(#{end_time})\")\n rows = []\n res.each { |row| rows << [ row[0].to_i, row[1].to_i, row[2].to_i ] }\n return rows\n 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 cells_for_row row, offset, maxcol\n cells = cells_in_row row\n cells = cells[1 .. maxcol]\n cells.select_with_index { |cell, cidx| (cidx % data_cell_span) == offset }\n end",
"def line_range(lineno); end",
"def filter_view_by_oi_range(db, soi, eoi)\n params = {\n :startkey => soi,\n :endkey => eoi\n }\n return db.view('testing/by_automation', params)['rows'].inspect\n end",
"def get_range_data(spreadsheet_id, ranges)\n req_url = spreadsheet_path(\"#{spreadsheet_id}/values:batchGet?#{ranges}\")\n Api.get_with_google_auth(req_url, @access_token).parse\n end",
"def all_rows\n rows = []\n while row = next_row\n rows << row\n end\n return rows\n end",
"def range\n @range ||= set_range\n end",
"def source_range=(_arg0); end",
"def rows\n @rows.to_enum\n end",
"def cell_rows\n cells = []\n\n # for each row\n 1.upto(3).each do |row|\n rows = []\n # for each column\n 1.upto(3).each do |column|\n rows << get_cell_value(row, column)\n end\n\n cells << rows\n end\n\n cells\n end",
"def range; end",
"def range; end",
"def range; end",
"def range\n @cached_range ||= get_range\n end",
"def rows\n @rows ||= _row_args.map.with_index do |row_args, i|\n klass, args = row_args\n\n args = args.dup\n options = args.extract_options!\n proc = _row_scopes[i]\n scope = self.instance_eval(&proc)\n\n klass.new(*args, scope, options)\n end\n end",
"def results_with_rows\n load_from_rows(@dataset.all, true)\n end",
"def region_range(i, opts={})\r\n refresh opts\r\n (@memlist[i][0]..(@memlist[i][1]+@memlist[i][0]))\r\n end",
"def cell_range= range\n start_cell, end_cell = range.split(\":\")\n unless start_cell.nil? || start_cell.match(/^[a-zA-Z]+[1-9][0-9]*$/).nil?\n start_cell = start_cell.upcase\n self.start_column, self.start_row = from_alpha(start_cell.sub(/[0-9]+/,\"\")), start_cell.sub(/[A-Z]+/,\"\").to_i\n self.end_column, self.end_row = nil, nil\n if end_cell.nil?\n self.end_column = self.start_column\n self.end_row = self.start_row\n else\n end_cell = end_cell.upcase\n unless end_cell.match(/^[a-zA-Z]+[1-9][0-9]*$/).nil?\n self.end_column, self.end_row = from_alpha(end_cell.sub(/[0-9]+/,\"\")), end_cell.sub(/[A-Z]+/,\"\").to_i\n else\n start_row = nil\n end\n end\n else\n start_row = nil\n end\n end",
"def range(index:, label:, table_of_contents:)\n subranges = table_of_contents.map.with_index do |entry, subrange_index|\n IIIF::Presentation::Range.new(\n '@id' => uri(image_server, \"#{id}/range/r#{index}-#{subrange_index + 1}\"),\n 'label' => entry[:text],\n 'canvases' => [uri(image_server, \"#{id}/canvas/p#{index}\")]\n )\n end\n\n IIIF::Presentation::Range.new(\n '@id' => uri(image_server, \"#{id}/range/r#{index}\"),\n 'label' => label,\n 'ranges' => subranges\n )\n end",
"def slice_rows(x,y,w,h)\n\t\t(y..y+h-1).each do |i|\n\t\t\tyield @data[i][x..x+w-1]\n\t\tend\n\tend",
"def rows\n @columns.each do |column|\n @rows << Array.new(@columns.size) do |i|\n \"#{column}#{i + 1}\"\n end\n end\n @rows\n end",
"def source_range(*arguments); end",
"def each(&block)\r\n @range.each(&block)\r\n end",
"def row(r)\n ranges = Ranges.new\n @sensors.sort.each{|loc, sen|\n range_at_r = sen.range - (loc.y - r).abs\n next if range_at_r.negative?\n\n ranges.union([loc.x - range_at_r, loc.x + range_at_r])\n }\n\n ranges\n end",
"def index\n @rows = Row.all\n end",
"def getRange(fInd,lInd,datesCSV)\n returnDates = []\n for row in datesCSV\n cutRow = [row[0]]\n for i in fInd..lInd\n if row[i] == \"0\"\n row[i] = \"-\"\n end\n cutRow.append(row[i])\n end\n returnDates.append(cutRow)\n end\n return returnDates\nend",
"def select(range, options = {})\n start, finish = range_pair(range)\n fetch_range :zrangebyscore, start, finish, options\n end",
"def slice(range, options = {})\n start, finish = range_pair(range)\n fetch_range :zrange, start, finish, options\n end",
"def rows\n @rows ||= if ActiveRecord::Base.connection.adapter_name == \"PostgreSQL\"\n result.entries\n else\n [].tap do |row_hashes|\n result.entries.map do |row|\n hash = {}\n result.fields.each do |field|\n hash[field] = row[result.fields.index(field)]\n end\n row_hashes << hash\n end\n end\n end\n end",
"def [](row = 0)\n sheet_data[row]\n end",
"def xrange(key, start = T.unsafe(nil), range_end = T.unsafe(nil), count: T.unsafe(nil)); end",
"def first_line_only(range); end",
"def first_line_only(range); end",
"def first_line_only(range); end",
"def get_range(range)\n r = []\n enum = range.to_enum\n begin\n while (x = enum.next) < @size\n r << get_single_key(x)\n end\n rescue StopIteration\n end\n r.empty? ? nil : r\n end",
"def colrow() @records.get_data(GRT_COLROW); end",
"def build_row_set rows\n return Google::Bigtable::V2::RowSet.new unless rows\n\n if rows.is_a?(Hash)\n return Google::Bigtable::V2::RowSet.new(\n row_keys: rows[:row_keys] || [],\n row_ranges: rows[:row_ranges] || []\n )\n end\n\n Google::Bigtable::V2::RowSet.new(\n row_keys: rows.row_keys.to_a,\n row_ranges: rows.row_ranges.map(&:clone)\n )\n end",
"def retrieve\n get_object(:headers => { :range => 0..0 })\n self\n end",
"def line_range=(_arg0); end",
"def noise_range(row_range, column_range)\n noise[row_range].map { |row| row[column_range] }\n end",
"def get_range_keys(column_family, options = {})\n get_range(column_family,options.merge!(:count => 1)).keys\n end",
"def selection_range(from, to)\n execute(:selection, :range, from, to)\n end",
"def getNodeCoordinateRange(domain = \"grid\")\n qs = <<END_QS1\nSELECT x_max, y_max, z_max\n FROM testbeds\nWHERE node_domain = '#{domain}'\nEND_QS1\n \n result = Array.new\n runQuery(qs) { |x, y, z| \n result.push(x) \n result.push(y) \n result.push(z)\n }\n return result\n end"
] |
[
"0.672839",
"0.67164075",
"0.6694675",
"0.66362226",
"0.6615368",
"0.66138285",
"0.6606335",
"0.6586247",
"0.6586247",
"0.6586247",
"0.6510116",
"0.65025324",
"0.6498556",
"0.6463678",
"0.6440741",
"0.64182705",
"0.6337631",
"0.6328529",
"0.6287581",
"0.6259047",
"0.6258721",
"0.6258721",
"0.6247491",
"0.62230575",
"0.62150884",
"0.61901003",
"0.6181452",
"0.6140033",
"0.6116166",
"0.61141163",
"0.6111172",
"0.6110078",
"0.61035174",
"0.6101871",
"0.609419",
"0.60869956",
"0.60817707",
"0.6068869",
"0.60341245",
"0.6030748",
"0.60256964",
"0.60233057",
"0.60195243",
"0.6000085",
"0.5994859",
"0.5984722",
"0.5978446",
"0.59773976",
"0.59763014",
"0.5973794",
"0.5954787",
"0.5944672",
"0.5934171",
"0.5930166",
"0.5899176",
"0.5899176",
"0.58964014",
"0.588704",
"0.5866992",
"0.58584756",
"0.58568406",
"0.5854656",
"0.5853054",
"0.58480924",
"0.58464545",
"0.5842918",
"0.5842496",
"0.58324885",
"0.58324885",
"0.58324885",
"0.5817465",
"0.58096176",
"0.580611",
"0.5804937",
"0.579677",
"0.57832664",
"0.5783086",
"0.5774165",
"0.5770912",
"0.5713229",
"0.57128906",
"0.57122695",
"0.5711543",
"0.56956464",
"0.56891286",
"0.5686228",
"0.5676458",
"0.56701845",
"0.5661448",
"0.5661448",
"0.5661448",
"0.565478",
"0.5642136",
"0.5640655",
"0.56371623",
"0.5632896",
"0.5629793",
"0.5627902",
"0.5626405",
"0.5615961"
] |
0.7596468
|
0
|
returns array with hospital id, medication_id, number of times medication_id was used at hospital [42, 16765295]=>111
|
def specific_type_of_medication_per_hospital
self.group(:hospital_id, :medication_id).count
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def count_difficulties\n hash = {}\n i = 0\n while i < 20\n hash[i] = 0\n i += 1\n end\n Drink.all.each do |drink|\n hash[drink.ingredient_cards.count] += 1\n end\n puts hash\nend",
"def get_ic_count (access, item_type)\n q = \"SELECT H_id, H_count FROM holdings_H_counts WHERE member_id = ? AND access = ? AND item_type = ?\";\n pq = @@conn.prepare(q);\n h_counts = {1 => 0};\n pq.enumerate(@member_id, access, item_type) do |row|\n h_counts[row[:H_id].to_i] = row[:H_count].to_i;\n end\n\n return h_counts;\n end",
"def get_ic_count (access, item_type)\n q = \"SELECT H_id, H_count FROM holdings_H_counts WHERE member_id = ? AND access = ? AND item_type = ?\";\n pq = @@conn.prepare(q);\n h_counts = {1 => 0};\n pq.enumerate(@member_id, access, item_type) do |row|\n h_counts[row[:H_id].to_i] = row[:H_count].to_i;\n end\n\n return h_counts;\n end",
"def med_stats_hash(_assessed_data); end",
"def get_all_dismantle_count\n count = 0\n groups = [$data_items, $data_armors, $data_weapons]\n for group in groups\n for obj in group\n next if obj.nil?\n count += obj.dismantle_counter\n end # for\n end # for\n return count\n end",
"def developers_count\n person_ids = []\n person_ids += solutions.pluck(:person_id)\n person_ids += bounty_claims.pluck(:person_id)\n person_ids += developer_goals.pluck(:person_id)\n\n person_ids.uniq.length\n end",
"def sentiments_counts\n #This will get the sentiments related to each instance\n x = self.sentiments\n\n #These two lines are instantiated for the while loop below\n y = 0\n sentiments_count = []\n\n #This is a loop taking 'positive', 'negative', or 'neutral' from the instances\n while y < x.count\n sentiments_count << x[y][:sentiment]\n y += 1\n end\n\n #This creates a hash and counts each of the words' occurrences in the array\n #The output will look something like:\n # {\"Positive\" => 2, \"Neutral\" => 1, \"Negative\" => 3}\n hash = sentiments_count.each_with_object(Hash.new(0)) { |word,counts| counts[word] += 1 }\n hash.map {|key, value| puts \"#{key} - #{value}\"}\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 occurences_count\n\t\t\t\t\t\tHash.new(0).tap do |result|\n\t\t\t\t\t\t each { |item| result[item] += 1 }\n\t\t\t\t\t\tend\n\t\t\t\tend",
"def patients\n appointments.map{|appointment| appointment.patient}.uniq\n end",
"def getTechnicianStatsActivities\n #Getting all the tech leads and understudies for each activity\n actTechs = ActivityTech.all.pluck(:tech_lead_id)\n actTechsU = ActivityTech.all.pluck(:tech_ustudy_id)\n \n #putting them in the same set\n actTechs = actTechs + actTechsU \n\n userIDs = User.all.pluck(:id)\n \n userCount = []\n userIDs.each do |id|\n\n #Only add it to the final result if the number of activities > 0\n if actTechs.count(id) != 0 then\n username = User.find(id).display_name\n #get the number of activities by counting the number of occurences of the id\n userCount.push([username, actTechs.count(id)])\n end\n\n end\n \n return userCount\n end",
"def patient_last_drugs_pill_count(patient, ref_date, program_id: nil)\n program = Program.find(program_id) if program_id\n concept_name = ConceptName.find_by_name('Number of tablets brought to clinic')\n optimize_concept = ConceptName.find_by_name('Appointment type')\n return [] if program.blank?\n\n pill_counts = Observation.joins(:encounter).where(\n 'program_id = ? AND encounter.patient_id = ?\n AND DATE(encounter_datetime) = DATE(?) AND concept_id = ?',\n program.id, patient.patient_id, ref_date, concept_name.concept_id\n ).order('encounter.encounter_datetime DESC')\n\n optimize = Observation.joins(:encounter).where(\n 'program_id = ? AND encounter.patient_id = ?\n AND DATE(encounter_datetime) = DATE(?) AND concept_id = ? AND value_text = ?',\n program.id, patient.patient_id, ref_date, optimize_concept.concept_id, 'Optimize - including hanging pills'\n ).order('encounter.encounter_datetime DESC')\n\n return [] unless pill_counts\n return [] if optimize.blank?\n\n values = {}\n\n pill_counts.each do |obs|\n next unless obs.order\n\n drug_order = obs.order.drug_order\n values[drug_order.drug_inventory_id] = obs.value_numeric\n end\n\n values\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 survey_count\n @pub_surveys = Survey.select('id').where(status: 'published')\n @pub_survey_ids = Array.new\n\n @pub_surveys.each do |u|\n @pub_survey_ids.push (u.id)\n end\n \n @user_taken_surveys = UserSurvey.where(user_id: current_login)\n @user_taken_survey_ids = Array.new\n\n @user_taken_surveys.each do |u|\n @user_taken_survey_ids.push (u.survey_id)\n end\n\n @untaken_pub_surveys_ids = Array.new\n\n @pub_survey_ids.each do |u|\n if @user_taken_survey_ids.index(u)\n puts \"it exists\"\n else\n @untaken_pub_surveys_ids.push (u)\n end\n end\n\n if @untaken_pub_surveys_ids.empty?\n count = 0\n else\n count = @untaken_pub_surveys_ids.count\n end\n return count\n end",
"def patients_in_high_value_populations\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), %w[NUMER NUMEX DENEXCEP DENEX])\n end.pluck(:_id)\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 invoice_counts_per_merchant\n groups = invoices_grouped_by_merchant\n counts = groups.map { |id, invoices| invoices.count.to_f }\n end",
"def getMdlrtSbjectInfoList(hospital)\n ykiho = hospital.ykiho\n url = \"http://apis.data.go.kr/B551182/medicInsttDetailInfoService/getMdlrtSbjectInfoList?ServiceKey=QaF1DC23RvHRq4cW5OWsAc4OdF2aocCEzPIVRqamSp5em%2F%2FmLWBcH28Yzp2685EqMzQE%2Fag155d5CBsXxim9Wg%3D%3D&ykiho=\"+ykiho\n name_xml = RestClient.get(url)\n name_doc = Nokogiri::XML(name_xml)\n\n h = Hash.from_xml(name_doc.to_xml)\n unless h['response']['body']['items'].nil?\n return h['response']['body']['items']['item']\n end\n end",
"def matter_status_count\n undisputed=self.matter_facts.collect{|mf| mf.status_id if mf.status_id == CompanyLookup.find_by_lvalue_and_company_id('Undisputed', mf.company_id).id}.compact.size\n disputed=self.matter_facts.collect{|mf| mf.status_id if mf.status_id == CompanyLookup.find_by_lvalue_and_company_id('Disputed By Opposition', mf.company_id).id}.compact.size\n\n [undisputed,disputed]\n end",
"def members_commonest_data2\n data = [['Ethnicity', 'Male', 'Female']]\n members.group(\"meta_info->>'ethnicity'\").pluck(\"meta_info->>'ethnicity'\").delete_empty.each do |v|\n data << [v.to_s.titleize, members.where(\"meta_info->>'ethnicity' = ?\", v.to_s).male.count, members.where(\"meta_info->>'ethnicity' = ?\", v.to_s).female.count]\n end\n data\n end",
"def total_medals_per_team(olympic_data)\n counts = olympic_data.group_by{ |x| x[:\"Team\"] }.map{ |x,y| [x,y.count] }\n counts = Hash[counts]\n return counts\nend",
"def workflow_counts\n render json: {\n exposure: current_user.viewable_patients.where(isolation: false, purged: false).size,\n isolation: current_user.viewable_patients.where(isolation: true, purged: false).size\n }\n end",
"def workflow_counts\n render json: {\n exposure: current_user.viewable_patients.where(isolation: false, purged: false).size,\n isolation: current_user.viewable_patients.where(isolation: true, purged: false).size\n }\n end",
"def counts\n count = Hash.new(0)\n self.each{|ele| count[ele] += 1}\n count\n end",
"def find_origin(table_of_umpires)\n ipl_umpires = Hash.new(0)\n table_of_umpires.each do |table_row|\n ipl_umpires[table_row['Nationality']] += 1 if table_row['Nationality'] != 'India'\n end\n ipl_umpires\nend",
"def communion_members_data(period_data = 'last_month')\n res = user_group_communions\n range, daily_report = period_data.to_s.report_period_to_range\n data = [[period_data.to_s.report_period_to_title, 'Communion', 'No communion']]\n range.each{|d|\n _g = res.where(created_at: d.beginning_of_day..(daily_report ? d.end_of_day : d.end_of_month.end_of_day))\n data << [d.strftime(daily_report ? '%d' : '%Y-%m'), _g.where(answer: true).count,_g.where(answer: false).count] \n }\n data\n end",
"def tester_device_in_bugs_count(testerId, deviceId, bugs_array)\n\tcount = bugs_array.select {|bug| bug['deviceId'] == deviceId && bug['testerId'] == testerId}.count\n\t{\"testerId\" => testerId, \"deviceId\" => deviceId, \"count\" => count}\n\nend",
"def total_medals_per_team(olympic_data)\n\n teams_medals = get_all_olympic_athletes(olympic_data).group_by { |athlete| athlete[\"Team\"] }.map { |k, v| [k, v.size] }.to_h\n\n return ap teams_medals\nend",
"def incorrect_hash(arr)\nincorrectStats = {}\narr.each do |q|\nif incorrectStats[q.question_id]\n incorrectStats[q.question_id] = incorrectStats[q.question_id] + 1\nelse \n incorrectStats[q.question_id] = 1\nend\nend\nincorrectStats\nend",
"def get_sum_defender_facilities\n all_facilities = 0\n @defender_facilities.each do |instance|\n all_facilities = all_facilities + instance.count\n end\n return all_facilities\n end",
"def results_frequency_for_each_combination\n category_id = self.id\n results = Result.where({\"category_id\" => category_id})\n result_hash = Hash.new(0)\n count = 0\n\n results.each do |combo| \n winner = combo.loved_id\n loser = combo.lost_id\n if winner != nil && loser != nil\n result_hash[winner.to_s + \"-\" + loser.to_s] += 1\n end\n end\n return result_hash\n end",
"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",
"def getMEELeadActivitiesCount\n users = User.all.pluck(:id)\n\n activities = []\n users.each do |id|\n #get the activities where the user is the mee lead\n acts = Activity.where(user_id: id)\n\n #only add the result if number of activites > 0\n if acts.length != 0\n username = User.find(id).display_name\n \n #get number by doing.length on the list\n activities.push([username, acts.length])\n end\n end\n return activities\n end",
"def medicinal_uses\n self.object.medicinal_uses.map{|mu| mu.name}.join(', ')\n end",
"def machines_quantity_hash\n answer = {}\n owners = self.owners\n owners.each do |o|\n m = o.machine_id\n if answer[m].nil?\n answer[m] = 1\n else\n answer[m] += 1\n end\n end\n return answer\n end",
"def find_suspect(*numbers)\n suspect_count = Hash.new\n # Count number of times integers occurs in list and tally in hash\n numbers.each { |suspect| suspect_count[suspect] = suspect_count[suspect].to_i + 1 }\n # Integers placed into array of arrays ordered by count \n sorted_count = suspect_count.sort_by {|key, value| value}\n if sorted_count.size == 1\n return sorted_count[0][0]\n elsif sorted_count.size == 0\n return nil\n elsif sorted_count[0][1] < sorted_count[1][1]\n # Returns integer with the fewest instances\n return sorted_count[0][0]\n else\n # If all integers have same count return nil\n return nil\n end\nend",
"def query_num_of_legislators_by_states\n\thash1 = Representative.group(:state).count\n\tarr = hash1.to_a\n\thash2 = Senator.group(:state).count \n\tarr.sort_by! { |arr_within_arr| arr_within_arr[1] + hash2[arr_within_arr[0]] } # looks at the num of sen & rep to sort\n\tarr.reverse!\n\tarr.each do |a| \n\t\tstate = a[0]\n\t\tputs \"#{state}: #{hash2[state]} Senators, #{a[1]} Representative(s)\"\n\tend\nend",
"def patient_in_numerator\n Patient.find(gather_patient_ids).keep_if do |p|\n p.patient_relevant?(measures.pluck(:_id), ['NUMER'])\n end.pluck(:_id)\n end",
"def show_counts (member_id)\n sql = %w<\n SELECT\n COUNT(1) AS c,\n item_type\n FROM\n holdings_memberitem\n WHERE\n member_id = ?\n GROUP BY\n item_type\n ORDER BY\n item_type\n >.join(' ');\n\n query = @conn.prepare(sql);\n query.enumerate(member_id) do |row|\n @log.d(\"#{row[:c]} #{row[:item_type]}\");\n end\nend",
"def get_students_per_location(location_id)\n students_by_year = ActiveRecord::Base.connection.execute(\"SELECT COUNT(DISTINCT student_id) as students, extract(year from date) as year FROM attendances JOIN events ON attendances.event_id = events.id WHERE events.location = #{location_id} GROUP BY year ORDER BY year DESC;\")\n unique_student_count = {}\n \n students_by_year.each do |unique_students|\n unique_student_count[unique_students['year']] = unique_students['students']\n end\n return unique_student_count\n end",
"def count_occurrences(vehicles)\n vehicles.each_with_object(Hash.new(0)) do |vehicle, memo|\n memo[vehicle] += 1\n end\nend",
"def popularities\n result = {}\n @courses.each do |cl|\n result[cl.name] = Hash.new(0)\n end\n @students.each do |student|\n student.each_with_index do |course_choice, i|\n result[course_choice.name][i] += 1\n end\n end\n result\n end",
"def value_counts\n values = @data.each_with_object(Hash.new(0)) do |d, memo|\n memo[d] += 1\n end\n\n Daru::Vector.new(values)\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 offense_counts; end",
"def offense_counts; end",
"def patients\n # appointments\n # self.appointments.collect <- same as map \n ####### \n # self.appointments.map do |appointment|\n # appointment.patient\n # end\n ########\n self.appointments.map{|appointment| appointment.patient}.uniq\n #######\n # self.appointments.map(&:patient).uniq\n #######\n # self.appointments.map(&:patient).to_set\n end",
"def screening_data_count\n\t\tscreening_data.count\n\tend",
"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 find_recipe_hash(missing)\n if self.user_ingredients.length == 0\n recipe_hash = {}\n Recipe.where(\"ingredient_count <= ?\", missing).pluck(:id).each do |id|\n recipe_hash[id] = 0\n end\n else\n pantry_names = self.pantry_names\n recipe_hash = Recipe.select(\"recipes.id\").joins(:ingredients).where(ingredients: {name: pantry_names}).group(\"recipes.id\").having('COUNT(*) >= recipes.ingredient_count - ?', missing).count\n end\n return recipe_hash\n end",
"def insight_counts\n return @insight_counts\n end",
"def show_total_unattendance_number\n puts 'show_total_unattendance_number'\n total_unattendance_number = @data.inject (0) do |mem, e|\n num_exams = e.size - 1.0\n mem + e.last(num_exams).count('00')\n end\n puts total_unattendance_number.to_s\n end",
"def show\n overlap1 = []\n overlap2 = []\n interlibrary_loans = []\n circulations = []\n @analysis_group.monograph_holdings.each do |holding|\n overlap1 << holding.overlap_holdings_count(1)\n overlap2 << holding.overlap_holdings_count(2)\n interlibrary_loans << holding.interlibrary_loans_count\n circulations << holding.circulation_count\n end\n\n #This isn't quite right. Need distinct OCLC Numbers because there will be overlap\n #Maybe something like this will work\n #ActiveRecord::Base.connection.execute(\"SELECT SUM(shared_by) FROM (SELECT * FROM overlap_holdings GROUP BY oclc_number)\")\n\n overlap_overall = OverlapHolding.pluck(:shared_by)\n\n interlibrary_loans_overall = InterlibraryLoan.group(:oclc_number).count.values\n interlibrary_loans_overall.concat(Array.new(zero_interlibrary_loans, 0))\n\n circulations_overall = Circulation.group(:oclc_number).count.values\n circulations_overall.concat(Array.new(zero_circulations, 0))\n\n # max = overlap1.max > overlap_overall.max ? overlap1.max : overlap_overall.max\n # max = overlap2.max > max ? overlap2.max : max\n\n # @overlap1_histogram = overlap1.histogram(10, :min => 0, :max => max)\n # @overlap2_histogram = overlap2.histogram(10, :min => 0, :max => max)\n # @overlap_histogram_overall = overlap_overall.histogram(10, :min => 0, :max => max)\n\n # @interlibrary_loans_histogram = interlibrary_loans.histogram(10, :min => 0, :max => 61)\n # @interlibrary_loans_histogram_overall = interlibrary_loans_overall.histogram(10, :min => 0, :max => 61)\n\n # @circulation_histogram = circulations.histogram(10, :min => 0, :max => 40)\n # @circulation_histogram_overall = circulations_overall.histogram(10, :min => 0, :max => 1300)\n\n # @overlap1_histogram = overlap1.histogram()\n # @overlap2_histogram = overlap2.histogram()\n # @overlap_histogram_overall = overlap_overall.histogram()\n\n # @interlibrary_loans_histogram = interlibrary_loans.histogram()\n # @interlibrary_loans_histogram_overall = interlibrary_loans_overall.histogram()\n\n # @circulation_histogram = circulations.histogram()\n # @circulation_histogram_overall = circulations_overall.histogram()\n\n\n @overlap1_desc = DescriptiveStatistics::Stats.new(overlap1)\n @overlap2_desc = DescriptiveStatistics::Stats.new(overlap2)\n @interlibrary_loans_desc = DescriptiveStatistics::Stats.new(interlibrary_loans)\n @circulations_desc = DescriptiveStatistics::Stats.new(circulations)\n\n @overlap_overall_desc = DescriptiveStatistics::Stats.new(overlap_overall)\n @interlibrary_loans_overall_desc = DescriptiveStatistics::Stats.new(interlibrary_loans_overall)\n @circulations_overall_desc = DescriptiveStatistics::Stats.new(circulations_overall)\n\n \n @interlibrary_loan_items_overall_count = InterlibraryLoan.all.distinct.count(:oclc_number) + zero_interlibrary_loans\n @interlibrary_loan_overall_count = InterlibraryLoan.all.count\n\n @interlibrary_loan_items_count = interlibrary_loans.count\n @interlibrary_loan_count = interlibrary_loans.sum\n\n @circulation_items_overall_count = Circulation.all.distinct.count(:oclc_number) + zero_circulations\n @circulation_overall_count = Circulation.all.count\n\n @circulation_items_count = circulations.count\n @circulation_count = circulations.sum\n\n @overlap_items_overall_count = OverlapHolding.all.distinct.count(:oclc_number)\n @overlap_overall_count = ActiveRecord::Base.connection.execute(\"SELECT SUM(shared_by) FROM (SELECT * FROM overlap_holdings GROUP BY oclc_number)\")[0][0]\n\n @overlap1_item_count = overlap1.count\n @overlap1_count = overlap1.sum\n\n @overlap2_item_count = overlap2.count\n @overlap2_count = overlap2.sum\n\n end",
"def chart_data(codes, hospitals, num_cases)\n data = []\n identifiers = [I18n.t('hospitals')] + codes.map{|code| code.code_display_long }\n hospitals.each do |h|\n ncs = num_cases[h.hospital_id]\n a = [h.name]\n codes.each {|code| a << numcase_number(ncs[code.code]); a << numcase_display(ncs[code.code]) }\n data << a\n end\n [identifiers, data]\n end",
"def count_occurrences(vehicles)\n my_hash = Hash.new\n vehicles.each do |vehicle|\n if my_hash.has_key?(vehicle)\n my_hash[vehicle]+=1\n else\n my_hash[vehicle] = 1\n end\n end\n puts my_hash\nend",
"def get_medals( season_code, pool_code, event_code, medal_code )\r\n # Return medals count set for verifing purposes\r\n exists_event?( season_code, pool_code, event_code ) ? @detail[season_code].detail[pool_code].detail[event_code].get_medals( medal_code ) : 0\r\n end",
"def losing_results_frequency_for_each_nominee\n category_id = self.id\n results = Result.where({\"category_id\" => category_id})\n nominee_hash = Hash.new(0)\n\n results.each do |loser| \n loser = loser.lost_id\n if loser != nil\n nominee_hash[loser] +=1\n end\n end\n tallied_results = nominee_hash.sort_by{ |key, value| value}.reverse.to_h\n return tallied_results\n end",
"def frequencies\n inject(Hash.new(0)) { |h,v| h[v] += 1; h }\n end",
"def cult_population \n by_recruite = BloodOath.all.select{|bloodoath| bloodoath.cult == self}.count \n by_joining = BloodOath.all.select{|bloodoath| bloodoath.follower == self}.count\n total = by_joining + by_recruite\n total \n end",
"def killcount(counselors, jason)\n\tkilled = counselors.select {|counselor| counselor[1] < jason}\n\treturn killed.map {|counselor| counselor[0]}\nend",
"def count_occurrences(vehicles)\n occurences = {}\n uniq_vehicles = Array.new(vehicles.uniq)\n\n uniq_vehicles.each do |vehicle|\n occurences[vehicle] = vehicles.count(vehicle)\n end\n occurences.each { |k, v| puts \"#{k} => #{v}\"}\nend",
"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 stock_list(hash)\n \n # First build array of unique items\n stock=Array.new\n for key,value in hash\n unless stock.include?(value[:item]) \n stock << value[:item]\n end\n end\n \n\n # Then build array with each unique item and its count\n\n return_array = Array.new\n\n for stock_item in stock\n count_of_items = 0\n \n for key,value in hash\n\n if value[:item] == stock_item\n count_of_items += 1 \n end\n end\n\n return_array << [stock_item,count_of_items]\n\n end\n\n return return_array\n\nend",
"def get_dismantle_count(key, id)\n case key\n when :item\n $data_items[id].dismantle_counter\n when :armor\n $data_armors[id].dismantle_counter\n when :weapon\n $data_weapons[id].dismantle_counter\n end # case\n end",
"def patients\n patients_array = []\n Appointment.all.each do |appointment|\n if appointment.doctor == self\n patients_array.push(appointment.patient)\n end\n end\n patients_array.uniq\n end",
"def actor_list(array)\n #the variable actors is equal to a new array that only has the key actors in each of the movies\n actor_in_bond = array.map {|movie| movie[:actor]}\n #list variable gives me the array of unique people out of the list of array\n list = actor_in_bond.uniq\n #variable movies per actor is equal to a iterator that will give me a new array of the movie actor from the list and\n #check the number of times the actor's name shows up in the array actor in bond then it will\n #give me an array of the actors name with the number of movie it is in\n movies_per_actor = list.map {|movie| \"#{movie} => #{actor_in_bond.count(movie)}\"}\n #outputs the list of actors with number of movies they are in\n puts movies_per_actor\nend",
"def count_teaching_profs\n accessed_content = read_csv(\"CSV/Conteudos_Acessados.csv\")\n\n prof_ensinaram = Hash.new\n\n accessed_content.each do |row|\n namespace = row['namespace']\n prof_ensinaram[namespace] ||= Hash.new\n prof = row['teacher_id']\n if row['type'] != 'EXERCISE' and row['type'] != '-' and is_valid_user(prof)\n content = row['title']\n prof_ensinaram[namespace][prof] ||= Hash.new\n prof_ensinaram[namespace][prof][content] ||= 0\n prof_ensinaram[namespace][prof][content] += row['users access'].to_i\n end\n end\n\n n_prof_ensinaram = Hash.new\n\n prof_ensinaram.each do |ns, profs|\n n_prof_ensinaram[ns] ||= 0\n profs.each do |prof, contents|\n n_accessed_contents = 0\n contents.each do |content, n_access|\n n_accessed_contents += 1 if n_access >= $min_access_in_content\n end\n n_prof_ensinaram[ns] += 1 if n_accessed_contents >= $min_accessed_contents\n end\n end\n n_prof_ensinaram\nend",
"def interceptions_per_game\n interceptions.joins(:game).group(\"armchair_analysis_games.wk\").count\n end",
"def counter_skills_id\n [data_battler.counter_skill]\n end",
"def play_count_country_vice(country_lists,device_accesses,listen_medias,sorted_array = [])\n @device_accesses = device_accesses\n @listen_medias = listen_medias\n country_lists.each do |country_name|\n id_lists = @device_accesses.where(:access_country => country_name).map(&:id)\n add_count=[]\n id_lists.each do |id|\n add_count << @listen_medias.where(device_access_id: id).count\n end\n sorted_array << [country_name,add_count.sum]\n end\n sorted_array\n play_hash = Hash[*sorted_array.flatten]\n sorted_play_hash = play_hash.sort_by {|_key, value| value}.reverse\n end",
"def count_freq\n hash = Hash.new(0)\n self.each do |element|\n hash[element] +=1\n end\n return hash\n end",
"def metercount\n @metercount ||= begin\n meter_data = {}\n MetricalData.meters.map do |meter_name, pada_arr|\n arr = pada_arr.map(&:length)\n arr << arr.reduce(&:+)\n meter_data[meter_name] = arr\n end\n MetricalData.regexes.full.each do |r, v|\n meter_name = v.keys.first\n next if meter_data.key?(meter_name)\n source = r.source\n next if source[\"|\"] || source[\"(\"].nil?\n groups = source.scan(/\\(([^()]*)\\)/).flatten\n source.gsub!(/[\\^\\$\\(\\)]/, \"\")\n meter_data[meter_name] = groups.map(&:length) << source.length\n end\n\n meter_data.sort.to_h.deep_freeze\n end\n end",
"def hidratos \n\t\t@hidratos = @azucares + @polialcoles + @almidon\n\t\treturn @hidratos\n\tend",
"def service_count_for_hashes(hash_array)\n hash_array.collect(&:service).collect(&:id).uniq.size\n end",
"def claimed_rewards_by_project\n claimed_rewards_by_project = Hash.new(0)\n self.rewards_selected.each do |reward, frequency|\n selected_reward = Reward.find_by(description: reward)\n claimed_rewards_by_project[selected_reward.project_id] += selected_reward.dollar_amount\n end\n return claimed_rewards_by_project\nend",
"def medir_indicador_res_tipo_1(idacs, mind, fini, ffin)\n { resind: idacs.count, datosint: [] }\n end",
"def mastered_weapon_proficiencies\n self.weapon_categories.map(&:common_weapons).flatten.map(&:id) + self.common_weapons.map(&:id)\n end",
"def bilan(eleve)\n # On met le bilan de l'utilisateur dans un hash bilan[0] \n bilan = Hash.new(0)\n bilan[:student] = Hash.new(0)\n bilan[:teacher] = Hash.new(0)\n bilan[:student][0] = 0\n bilan[:student][1] = 0\n bilan[:student][2] = 0\n bilan[:student][3] = 0\n bilan[:teacher][0] = 0\n bilan[:teacher][1] = 0\n bilan[:teacher][2] = 0\n bilan[:teacher][3] = 0\n \n Context.where(:competence_id => self, :classroom_id => eleve.current_classroom).each do |context|\n bilan[:student][context.note_eleve(eleve).note_eleve] += 1\n bilan[:teacher][context.note_eleve(eleve).note_prof] += 1\n end\n bilan\n end",
"def number_of_unique_activities_completed\n activities.select(\"distinct intervention_uuid\").count\n end",
"def calc_stats\n #puts \"bad_biz = #{@bad_business_records.length}\"\n #puts \"bad_user = #{@bad_user_records.length}\"\n #puts \"good_biz = #{@good_business_records.length}\"\n #puts \"good_user = #{@good_user_records.length}\"\n \n @total_rec_cnt = @bad_business_records.length + @bad_user_records.length +\n\t @good_business_records.length + @good_user_records.length\n @well_formed_rec_cnt = @good_business_records.length + @good_user_records.length\n @malformed_rec_cnt = @bad_business_records.length + @bad_user_records.length\n @biz_rec_cnt = @businesses.length\n @user_rec_cnt = @users.length\n end",
"def count_occurence(array)\n counts = Hash.new(0)\n array.each { |name| counts[name] += 1 }\n puts counts\n\n price_calculator=PriceCalculator.new\n price_calculator.sepitem_quantity(counts)\n\n end",
"def count_total()\n self.regulatory_elements.count\n end",
"def count_stuff\n @members.each do |member|\n if member.active\n @active += 1\n if member.paymentstatus && member.membershipyear.to_i == Time.now.year.to_i\n @paidthisyear += 1\n end\n\n if !member.membergroup.onetimefee || member.membershipyear.to_i == Time.now.year.to_i\n @total += member.membergroup.fee\n end\n\n if @membergroups[member.membergroup.name.to_sym]\n @membergroups[member.membergroup.name.to_sym] = @membergroups[member.membergroup.name.to_sym] + 1\n else\n @membergroups[member.membergroup.name.to_sym] = 1\n end\n\n if @municipalities[member.municipality.to_sym]\n @municipalities[member.municipality.to_sym] = @municipalities[member.municipality.to_sym] + 1\n else\n @municipalities[member.municipality.to_sym] = 1\n end\n\n else\n @deleted += 1\n end\n\n end\n @municipalities = @municipalities.sort_by { |key, value| value }.reverse\n end",
"def get_total_number_of_ships_count_once\n result = Shipment.distinct().count(:ship_id)\n unless result.blank?\n return {value: result, error:nil}\n else\n return {value: 0, error: \"Error: in ShipmentBLL get_total_number_of_ships_count_once()\"}\n end\n end",
"def status_count(segment)\n hash = {}\n hash[:total] = segment.count\n hash[:finalizada] = segment.finalizada(@end_time).count\n hash[:aguardando] = segment.aguardando(@end_time).count\n rejeitadas = segment.rejeitada(@end_time)\n hash[:rejeitada_interno] = rejeitadas.rejeitada_interno.count\n hash[:rejeitada_externo] = rejeitadas.count - hash[:rejeitada_interno]\n return hash\n end",
"def biodiversity_index(specimens)\n all_species = specimens.uniq\n count = {}\n\n all_species.each do |species|\n count[species] = specimens.count(species)\n end\n\n number_of_species = all_species.length\n smallest_population_size = count.values.min \n largest_population_size = count.values.max\n\n number_of_species ** 2 * smallest_population_size / largest_population_size\n \nend",
"def chromosome_count(genome_array)\n ccount = Hash.new(0)\n genome_array.each {|entry| ccount[entry[1]] += 1}\n ccount.each {|chromosome, count| puts \"Chromosome \" + chromosome.to_s + \" has \" + count.to_s + \" SNP data points\" }\n total = 0\n ccount.values.each {|count| total+= count }\n puts \"----\"\n puts total.to_s + \" total data points\"\n return ccount\nend",
"def count_of_patpay_eobs\r\n count = 0\r\n eobs = PatientPayEob.where(\"jobs.id = ?\", get_parent_job_id).\r\n joins(\"join check_informations on check_informations.id = patient_pay_eobs.check_information_id \\\r\n join jobs on jobs.id = check_informations.job_id\")\r\n if !eobs.blank?\r\n count = get_count_of_eobs_containing_image_numbers_that_of_job(eobs)\r\n end\r\n count\r\n end",
"def query_7\n document_ids = Perpetuity[Document].select {|document| document.id}.to_a\n return document_ids.size\nend",
"def count_details\n # TODO respond with xml, only if valid session, otherwise return nil\n team = Team.find_by_id( params[:id] )\n if team\n render json: \"#{I18n.t('meeting.total_attended_meetings')}: \" +\n team.meetings.collect{|row| row.id}.uniq.size.to_s +\n \", #{I18n.t('meeting.total_results_short')}: \" +\n ( team.meeting_individual_results.count + team.meeting_relay_results.count ).to_s\n else\n render json: ''\n end\n end",
"def patient_statuses(patients)\n tabs = {\n closed: patients.monitoring_closed.pluck(:id),\n purged: patients.purged.pluck(:id),\n followup: patients.exposure_followup.pluck(:id),\n symptomatic: patients.exposure_symptomatic.pluck(:id),\n non_reporting: patients.exposure_non_reporting.pluck(:id),\n reviewed: patients.exposure_asymptomatic.pluck(:id),\n under_investigation: patients.exposure_under_investigation.pluck(:id),\n isolation_asymp_non_test_based: patients.isolation_asymp_non_test_based.pluck(:id),\n isolation_symp_non_test_based: patients.isolation_symp_non_test_based.pluck(:id),\n isolation_test_based: patients.isolation_test_based.pluck(:id),\n isolation_non_reporting: patients.isolation_non_reporting.pluck(:id),\n isolation_reporting: patients.isolation_reporting.pluck(:id)\n }\n statuses = {}\n tabs.each do |tab, patient_ids|\n patient_ids.each do |patient_id|\n statuses[patient_id] = tab&.to_s&.humanize&.downcase\n end\n end\n statuses\n end",
"def omission_count\n @omissions.size\n end",
"def list_all_received_ingredients\n ingredient_count_hash = {}\n self.owned_ingredients.each do |owned_ingredient|\n ingredient_count_hash[owned_ingredient.ingredient_id] = owned_ingredient.received_count\n end\n ingredient_count_hash\n end",
"def total_medals_per_team(olympic_data)\n\n team_medals_hash = {}\n\n olympic_data.each do |data|\n\n if team_medals_hash.key?(data[\"Team\"])\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) #SAME TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] += 1\n end\n else\n\n if [\"Gold\", \"Silver\", \"Bronze\"].include?(data[\"Medal\"]) # NEW TEAM, MEDAL\n team_medals_hash[data[\"Team\"]] = 1\n else\n team_medals_hash[data[\"Team\"]] = 0\n\n end\n end\n end\n return team_medals_hash\nend",
"def get_denotation_hids(project_id = nil, span = nil)\n\t\tdenotations.in_project(project_id).in_span(span).pluck(:hid)\n\tend",
"def count_measures\n measures = 0\n \n self.measure_ids.each do |measure|\n measures += 1 if !measure.empty?\n end\n \n return measures\n end",
"def count_occurrences(vehicles)\n occurences = {}\n\n vehicles.each do |vehicle|\n occurences[vehicle] = vehicles.count(vehicle)\n end\n\n occurences.each do |vehicle, count|\n puts \"#{vehicle} => #{count}\"\n end\nend",
"def head_count\n attendances.reduce(0) {|count, attendance|\n # Problem 2 : the if/else conditional based on the plus_one is repected in\n # both the attendss and add_attendance method, not only duplicationm, it\n # looks like feature envy: a code smell wherein a class seems more\n # interested in another object's methods than it is in its own\n count + attendance.heads\n }\n end",
"def activityNotifications(expenditure, d)\n alerts = 0\n total = 0\n sorted_exp = Array.new(201, 0)\n #p d\n #p sorted_exp\n for i in 0..d-1\n sorted_exp[expenditure[i]] += 1\n end\n #p sorted_exp\n for i in d..expenditure.size-1\n median = calc_median(sorted_exp,d)\n #p \"Median #{median}\"\n alerts += 1 if expenditure[i] >= 2*median\n sorted_exp[expenditure[i-d]] -= 1\n sorted_exp[expenditure[i]] += 1\n end\n #p sorted_exp\n alerts\nend",
"def directors_totals(nds)\nresult = []\n r_index=0 \n while r_index < nds.length \n i=0 \n total=0 \n\n n= nds[r_index][:name]\n t= nds[r_index][:movies]\n while i < t.length\n \n k= t[i][:worldwide_gross]\n total += k\n \n i += 1\n end\n r_index += 1\n result << [n , total]\n end\n result.to_h\n end"
] |
[
"0.58500665",
"0.58138436",
"0.58138436",
"0.576875",
"0.57653105",
"0.5693156",
"0.565424",
"0.56382746",
"0.56226605",
"0.5613709",
"0.55733454",
"0.5559981",
"0.5547532",
"0.55389106",
"0.553436",
"0.55102015",
"0.54824936",
"0.54754084",
"0.5461262",
"0.5435352",
"0.53868824",
"0.5368759",
"0.5368759",
"0.5360815",
"0.5343266",
"0.5340222",
"0.5303241",
"0.530101",
"0.5292944",
"0.5268803",
"0.52615166",
"0.52562296",
"0.5255169",
"0.52210927",
"0.5219674",
"0.52115905",
"0.52067405",
"0.5204889",
"0.5204225",
"0.519519",
"0.51898",
"0.517724",
"0.5175336",
"0.5170361",
"0.5166567",
"0.5166567",
"0.51663816",
"0.5166282",
"0.5165698",
"0.5164979",
"0.5164287",
"0.51636857",
"0.5155599",
"0.5137558",
"0.51371735",
"0.5136721",
"0.5133988",
"0.51339406",
"0.5126284",
"0.5124042",
"0.512353",
"0.512205",
"0.5117161",
"0.51094335",
"0.5099455",
"0.509571",
"0.5093569",
"0.50920725",
"0.50912446",
"0.5086257",
"0.5077418",
"0.50700957",
"0.50676453",
"0.5060671",
"0.5060009",
"0.50585455",
"0.5051493",
"0.50497156",
"0.50490505",
"0.50410634",
"0.5038052",
"0.50358456",
"0.50274736",
"0.5026705",
"0.50256723",
"0.502527",
"0.50249773",
"0.50203836",
"0.50158817",
"0.5014835",
"0.5006926",
"0.50060266",
"0.50034004",
"0.5001279",
"0.5000752",
"0.49928224",
"0.49922594",
"0.49794897",
"0.49787655",
"0.49787244"
] |
0.72497386
|
0
|
Never trust parameters from the scary internet, only allow the white list through.
|
def conversation_params
params.require(:conversation).permit(:participant_id).merge(user_id: current_user.id)
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"def allow_params_authentication!; end",
"def allowed_params\n ALLOWED_PARAMS\n end",
"def default_param_whitelist\n [\"mode\"]\n end",
"def param_whitelist\n [:role, :title]\n end",
"def expected_permitted_parameter_names; end",
"def safe_params\n params.except(:host, :port, :protocol).permit!\n end",
"def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"def permitir_parametros\n \t\tparams.permit!\n \tend",
"def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"def param_whitelist\n [:rating, :review]\n end",
"def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"def 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 /driver_records/1 GET /driver_records/1.json
|
def show
@driver_record = DriverRecord.find(params[:id])
respond_to do |format|
format.html # show.html.erb
format.json { render json: @driver_record }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def show\n # Show one record\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def show\n @driver = Driver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver }\n end\n end",
"def index\n @drivers = Driver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drivers }\n end\n end",
"def index\n @drivers = Driver.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drivers }\n end\n end",
"def get_records\n return error_response unless is_get_records_request?\n as_json\n end",
"def new\n @driver_record = DriverRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def get_driver_details\n @resource = Resource.find(params[:id])\n @driver = Driver.find(AgencyStore.find_by_resource_id(params[:id]).driver_id)\n render :layout => false\n end",
"def show\n report_id = params[:id]\n render json: Record.where(report_id: report_id)\n end",
"def show\n\t\t\t\trespond_with Driver.find(params[:id])\n\t\t\tend",
"def index\n # Show all records\n @drivers = Driver.search(params[:search], params[:column]).order(sort_column(Driver, 'name') + ' ' + sort_direction).page(params[:page]).per(10)\n \n get_params()\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @drivers }\n end\n end",
"def show\n render json: Record.where(employee_id: params[:id])\n end",
"def show\n render json: Record.find(params[:id])\n end",
"def show\n render json: Record.find(params[\"id\"])\n end",
"def index\n @record_set = RecordSet.find_by_id(params[:record_set_id].to_i)\n can? :read, @record_set\n @records = Record.find_all_by_record_set_id(@record_set.id)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @records.collect {|r| r.to_jq_record }.to_json }\n end\n end",
"def index\n\t\t\t\trespond_with Driver.all\n\t\t\tend",
"def get_recordings()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/recordings\"))[0]\n end",
"def show\n @driver_license_type = (DriverLicenseType.find_by_sql 'SELECT * FROM driver_license_type WHERE id = ' + params[:id])[0]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver_license_type }\n end\n end",
"def show\n #@record = Record.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @record }\n end\n end",
"def show\n @record = Record.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @record }\n end\n end",
"def show\n @trip_driver = TripDriver.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @trip_driver }\n end\n end",
"def index\n @service_records = ServiceRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @service_records }\n end\n end",
"def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @site_records }\n end\n end",
"def show\n @record = Record.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @record }\n end\n end",
"def get_record(identifier)\n doc = client.get!(CGI.escape(identifier)).body.to_json\n @record_class.build(mint_id(identifier), doc, 'application/json')\n end",
"def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @secret_records }\n end\n end",
"def attendance_result\n history_id = params[\"history_id\"]\n Net::HTTP.get(URI.parse(\"#{ENV['PY_SERVER_URL']}/image_matching/history/#{history_id}\"))\n history_student = HistoryStudent.where(history_id: history_id)\n render json: history_student\n end",
"def show\n @record_id = params[:id]\n\n # run the where clause globally\n @relevant_record = Record.find(@record_id)\n @relevant_attachments = RecordAttachment.where(record_id: @record_id).order(\"id\")\n\n # make the record attachments an array if it isn't already \n if @relevant_attachments.length > 1\n @record_attachments = @relevant_attachments\n else \n @record_attachments = [@relevant_attachments[0]]\n end\n\n respond_to do |format|\n format.html {}\n format.json { render json: {\n record: @relevant_record, \n attachments: @record_attachments,\n }.to_json }\n end\n end",
"def index\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usagerecords }\n end\n end",
"def get_recordings(options = {})\n prepare\n @api.get_recordings(options)\n end",
"def index\n @drivers = Driver.all\n end",
"def index\n @drivers = Driver.all\n end",
"def details\n options = {}\n # include=driver\n # fields[driver]=average_rating\n if params[:fields]\n driver_fields = params[:fields].permit(:driver).to_h.\n inject({}) { |h, (k,v)| h[k.to_sym] = v.split(\",\").map(&:to_sym); h }\n options.merge!(fields: driver_fields)\n end\n\n # multiple associated resources are comma-separated\n if params[:include]\n options[:include] = params[:include].split(\",\").map(&:to_sym)\n end\n\n @trip = Trip.includes(:driver).find_by(id: params[:id])\n\n render json: TripSerializer.new(@trip, options).serializable_hash\n end",
"def index\n @patients = Patient.order('last_name ASC')\n\n #find the latest patient made\n @id = Patient.maximum(:id)\n if(@id != nil)\n @patient = Patient.find(@id)\n File.open(\"public/patient_info.json\", \"w\"){ |f| f << @patient.to_json}\n end\n end",
"def show\n @record_status = RecordStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @record_status }\n end\n end",
"def index\n @person_expense_records = PersonExpenseRecord.all\n\n render json: @person_expense_records\n end",
"def index\n id = params[:id].to_i\n\n if id != 0\n \t @agencies = @agencies.paginate(page: params[:page], per_page: 10).order(:name).find_all_by_id(id)\n if @agencies.any?\n @agency_name = @agencies.first.name\n end\n else\n \t @agencies = @agencies.paginate(page: params[:page], per_page: 10).order(:name).find(:all)\n end\n\n\t\t@records_returned = @agencies.count\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @agencies }\n end\n end",
"def getRecordJSON()\n return @sObjectRecords\nend",
"def index\n @dummy_records = DummyRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @dummy_records }\n end\n end",
"def create\n @driver_record = DriverRecord.new(params[:driver_record])\n respond_to do |format|\n if @driver_record.save\n format.html { redirect_to @driver_record, notice: 'Driver record was successfully created.' }\n format.json { render json: @driver_record, status: :created, location: @driver_record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @driver_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def index\n patient = Patient.find(params[:patient_id])\n @patientrecords = patient.patientrecords\n end",
"def index\n @dairy_plans = DairyPlan.where(:student_id => @student.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dairy_plans }\n end\n end",
"def get_patient\n @patient = Patient.pluck(:id,:name)\n render json: @patient\n end",
"def show\n token_ok, token_error = helpers.API_validate_token(request)\n if not token_ok\n render json: {message: token_error }, status: 401\n else\n rec_id = params[:id].to_i\n begin\n o = Entity.find(rec_id)\n @rec = { \n id: o.id,\n name: o.name,\n address1: o.address1,\n address2: o.address2,\n city: o.city,\n zipcode: o.zipcode,\n state: o.state,\n alias: o.alias,\n entityType: o.entity_type,\n countryId: o.country_id,\n companyId: o.company_id\n }\n rescue ActiveRecord::RecordNotFound\n @rec = {}\n end\n\n respond_to do |format|\n format.json { render json: @rec }\n end\n end\n end",
"def index\n @person = Person.find((params[:person_id]))\n @person_identification_docs = PersonIdentificationDoc.where(\"person_id = ?\", params[:person_id])\n\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @person_identification_docs }\n end\n end",
"def new\n @driver = Driver.new(:event_id => params[:event_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @driver }\n end\n end",
"def index\n sanitized_params = parse_params(client_where_params)\n clients = Client.find_all(sanitized_params)\n render json: clients\n end",
"def index\n @party_records = PartyRecord.order(\"partySet_id, testident, surname, forename\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @party_records }\n end\n end",
"def index\n @records = record_class.all\n end",
"def index\n @driver_profiles = DriverProfile.all\n end",
"def index\n @recruiters = Recruiter.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @recruiters }\n end\n end",
"def index\n @records = Record.all\n end",
"def index\n @records = Record.all\n end",
"def index\n @records = Record.all\n end",
"def index\n @records = Record.all\n end",
"def index\n @records = Record.all\n end",
"def show\n @records_location = RecordsLocation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @records_location }\n end\n end",
"def record(record_id, params = {})\n Record.new(record_id, params).get\n end",
"def record(record_id, params = {})\n Record.new(record_id, params).get\n end",
"def show\n @recinto = Recinto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @recinto }\n end\n end",
"def show\n @service_record = ServiceRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_record }\n end\n end",
"def index\n\t\t\t\t# @reviews = Driver.find_by!(id: params[:driver_id]).driver_reviews#.order('created_at DESC').to_a\n\t\t\t\t@reviews = DriverReview.where(driver_id: params[:driver_id])\n\t\t\tend",
"def pending_drivers\n users = User.needing_driver_verification\n render :json => users, each_serializer: SlimPendingDriverSerializer, root: false, status: 200\n end",
"def index\n @students_records = @student.records\n end",
"def show\n @dummy_record = DummyRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @dummy_record }\n end\n end",
"def show\n @liber777_table = Liber777Table.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @liber777_table }\n end\n end",
"def show\n @record = user_records.find(params[:id])\n respond_with(@record)\n end",
"def index\n authorize! :show, @sensor\n set_filter_dates\n set_granularity\n @records = @sensor.records.where(granularity: @granularity, created_at: @from..@to)\n\n respond_to do |format|\n format.html\n format.json { render json: @records }\n end\n end",
"def fetch(id)\n search(id: id)[:records].first\n end",
"def search\n render json: PersonScantronAppointment.first(10)\n end",
"def index\n @retailers = Retailer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @retailers }\n end\n end",
"def show\n @status_record = StatusRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @status_record }\n end\n end",
"def show\n @hivdrugreport = Hivdrugreport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hivdrugreport }\n end\n end",
"def demos\n get_records \"demo\", \"/demos\"\n end",
"def index\n @servers = getmydata(\"Server\")\n\tpagination\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @servers }\n end\n end",
"def show\n vehicle=Vehicle.where(uid: params[:id]).first\n render :json => {\"vehicle\"=>vehicle }\n end",
"def show_beer\n render json: BreweryDb::ShowBeer.new(params[:beerId]).results\n end",
"def index\n @driver_logs = DriverLog.all\n end",
"def show\n @player_record = PlayerRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @player_record }\n end\n end",
"def index\n @reports = Report.where(user_id: current_user.id, patient_id:@patient.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @reports }\n end\n end",
"def index\n @recruiters = Recruiter.all\n render_json_serializer(@recruiters)\n end",
"def show\n @healthrecord = Healthrecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @healthrecord }\n end\n end",
"def search\n render json: Consultation.first(10)\n end",
"def show\n @death_record_book = DeathRecordBook.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @death_record_book }\n end\n end",
"def index\n @server_records = ServerRecord.all\n end",
"def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"def get(model, id=nil, opts = {})\n name = model_name(model)\n opts.symbolize_keys!\n data = do_restful_action(\"get\", name) do\n self.nagyo[\"#{name}/#{URI.encode(id.to_s)}\"].get({:format => :json, :accept => :json}.merge(opts))\n end\n if id\n # NOTE: if we have an ID and get a Hash - single record matched, \n # otherwise no match and might have returned first page of records\n return data if data.is_a?(Hash)\n else\n return data\n end\n end",
"def index\n @individual_role_records = IndividualRoleRecord.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @individual_role_records }\n end\n end",
"def show\n render json: @person_expense_record\n end",
"def index\n hardware = Hardware.all\n render json: hardware.to_json(:except => [:id])\n end",
"def index\n respond_with ApidDriver.all\n end",
"def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @secret_record }\n end\n end",
"def get_finding_info\n\t\tidDec = params[:idDec].to_i\n\t\tidMap = params[:idMap].to_i\n\t\thallazgo = Finding.where(\"decision_map_id = ? AND governance_decision_id = ?\", idMap, idDec).first\n\t\trespond_to do |format|\n\t\t\tformat.json {render json: hallazgo}\n \tend\n\tend",
"def show\n respond_with ApidDriver.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n respond_with nil\n end",
"def index\n respond_to do |format|\n format.html\n format.json { render json: IndividualDeviceDatatable.new(params) }\n end\n end",
"def show\n @patient_history = PatientHistory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patient_history }\n end\n end",
"def controller_paginated_json(records, options={})\r\n controller_as_paginated_json(records, options)\r\n end",
"def show\n @record = find_record\n respond_to do |format|\n format.html # show.html.erb\n format.json do\n render json: @record.to_json(\n include: {\n grade: {\n except: [:note]\n }\n },\n methods: [:is_excuse?])\n end\n end\n end",
"def show\n send_record_data(TaliaCore::DataTypes::DataRecord.find(params[:id]))\n end",
"def show\n eps = EpV2.select(\"id,title,prelink\").where(\"show_id = #{params[:id]}\")\n .order(\"id DESC\").paginate(:page => params[:page], :per_page => 20)\n\n render :json => eps.to_json\n end"
] |
[
"0.6861106",
"0.6809781",
"0.6809781",
"0.6574814",
"0.6574814",
"0.65286845",
"0.64505",
"0.64355457",
"0.6401136",
"0.62814564",
"0.62053055",
"0.6124168",
"0.60773325",
"0.6062787",
"0.5990919",
"0.5952037",
"0.5906692",
"0.58758545",
"0.58706003",
"0.5868208",
"0.5864481",
"0.5820553",
"0.58162695",
"0.5799683",
"0.5791471",
"0.5779282",
"0.57628244",
"0.57380724",
"0.5720843",
"0.5709068",
"0.5705418",
"0.5705418",
"0.5697763",
"0.56812215",
"0.5678884",
"0.56766105",
"0.5671587",
"0.5663567",
"0.56436324",
"0.5634133",
"0.5632849",
"0.5631645",
"0.5627937",
"0.56203693",
"0.5617402",
"0.55746144",
"0.5559544",
"0.55574614",
"0.5553583",
"0.55500877",
"0.55392855",
"0.55380857",
"0.55380857",
"0.55380857",
"0.55380857",
"0.55380857",
"0.55306256",
"0.55267733",
"0.55267733",
"0.5518854",
"0.55053633",
"0.5480388",
"0.54763",
"0.5475752",
"0.54748744",
"0.5472879",
"0.5465916",
"0.54657245",
"0.54626304",
"0.5458189",
"0.54579926",
"0.54560375",
"0.54472697",
"0.5443101",
"0.54401964",
"0.5435646",
"0.543179",
"0.54296553",
"0.5426052",
"0.5422727",
"0.5419004",
"0.5404304",
"0.5404076",
"0.54011846",
"0.5400984",
"0.53951067",
"0.5385254",
"0.5383921",
"0.5359886",
"0.53547394",
"0.5353835",
"0.5350908",
"0.5348418",
"0.534695",
"0.53450036",
"0.5338165",
"0.5337203",
"0.5333152",
"0.5331835",
"0.5329474"
] |
0.7367887
|
0
|
GET /driver_records/new GET /driver_records/new.json
|
def new
@driver_record = DriverRecord.new
respond_to do |format|
format.html # new.html.erb
format.json { render json: @driver_record }
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def new\n @record = Record.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record }\n end\n end",
"def new\n @record = Record.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record }\n end\n end",
"def new\n @driver = Driver.new(:event_id => params[:event_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @driver }\n end\n end",
"def new\n @record = Record.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @record }\n end\n end",
"def new\n @recinto = Recinto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @recinto }\n end\n end",
"def new\n @record_status = RecordStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record_status }\n end\n end",
"def new\n @dummy_record = DummyRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @dummy_record }\n end\n end",
"def new\n @records_location = RecordsLocation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @records_location }\n end\n end",
"def create\n @driver_record = DriverRecord.new(params[:driver_record])\n respond_to do |format|\n if @driver_record.save\n format.html { redirect_to @driver_record, notice: 'Driver record was successfully created.' }\n format.json { render json: @driver_record, status: :created, location: @driver_record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @driver_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @patient = Patient.find(params[:patient_id])\n @record = @patient.records.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @secret_record }\n end\n end",
"def new\n @registro_record = RegistroRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @registro_record }\n end\n end",
"def new\n @status_record = StatusRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status_record }\n end\n end",
"def new\n @pageType = \"new\"\n @patient = Patient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient }\n end\n end",
"def new\n @trip_driver = TripDriver.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trip_driver }\n end\n end",
"def new\n fetch_data\n @payment = Payment.new(:payment_date => Date.today)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @payment }\n end\n end",
"def new\n doc_no = (RepairRecord.maximum(:doc_no).to_i || 0) + 1\n @repair_record = current_user.reported_repair_records.new(doc_no: doc_no)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @repair_record }\n end\n end",
"def new\n @file_record = FileRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @file_record }\n end\n end",
"def new\n @patent = Patent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patent }\n end\n end",
"def new\n @service_record = ServiceRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @service_record }\n end\n end",
"def new\n @weather_record = WeatherRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @weather_record }\n end\n end",
"def new\n @title = t('view.providers.new_title')\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\n end\n end",
"def new\n @trail = Trail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @trail }\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 @table = Table.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table }\n end\n end",
"def new\n @table = Table.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @table }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @alley }\n end\n end",
"def new\n @database = Database.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @database }\n end\n end",
"def new\n @liverecord = Liverecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @liverecord }\n end\n end",
"def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"def new\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end",
"def new\n @patentcase = Patentcase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @patentcase }\n end\n end",
"def new\n @patient_history = PatientHistory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient_history }\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 respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @patient }\n end\n end",
"def new\n @database = Database.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json=> @database }\n end\n end",
"def new\n @grant_record = GrantRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @grant_record }\n end\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lead }\n end\n end",
"def create\n # Logic to create a driver and submit to DB\n @driver = Driver.new(params[:driver])\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Driver was successfully created.' }\n format.json { render json: @driver, status: :created, location: @driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @atr = Atr.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @atr }\n end\n end",
"def new_driver\n address = params[:newdriveraddress]\n\n coordinates = GoogleAPIGeocoder.do_geocode(address)\n\n if coordinates.nil?\n render json: {success: false, travellers: session[:travellers].to_json, msg: 'Unable to find the location of the given address for the new driver. Please check that it is correct.'}\n else\n driver = Driver.create(name: params[:newdrivername],\n email: params[:newdriveremail],\n address: address,\n number_of_passengers: params[:newdrivernumber_of_passengers],\n latitude: coordinates[0],\n longitude: coordinates[1])\n\n unless session[:travellers].nil?\n session[:travellers] << driver\n else\n travellers = []\n travellers << driver\n session[:travellers] = travellers\n end\n\n if current_user.nil? && !session[:trip].nil?\n session[:trip].travellers << driver\n end\n\n render json: session[:travellers].to_json\n end\n end",
"def new\n @retailer = Retailer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @retailer }\n end\n end",
"def new\n @retailer = Retailer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @retailer}\n end\n end",
"def new_lead\n @lead = Lead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lead }\n end\n end",
"def new\n @importtodb = Importtodb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @importtodb }\n end\n end",
"def new\n @group_record = GroupRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_record }\n end\n end",
"def new\n @player_record = PlayerRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @player_record }\n end\n end",
"def new\n @dummy_table = DummyTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy_table }\n end\n end",
"def new\n @pdb = Pdb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pdb }\n end\n end",
"def new\n @death_record_book = DeathRecordBook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @death_record_book }\n end\n end",
"def new\n @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 @time_record = TimeRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_record }\n end\n end",
"def new\n @major = Major.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @major }\n end\n end",
"def new\n @healthrecord = Healthrecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @healthrecord }\n end\n end",
"def new\n # @retailer = Retailer.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @retailer }\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 @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 @db_pekerjaan = DbPekerjaan.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @db_pekerjaan }\n end\n end",
"def new\n @new_status = NewStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_status }\n end\n end",
"def new\n @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 @new_review = NewReview.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_review }\n end\n end",
"def new\n @liber777_table = Liber777Table.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @liber777_table }\n end\n end",
"def new\n @entity = @klass.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity }\n end\n end",
"def new\n @breadcrumb = 'create'\n @time_record = TimeRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @time_record }\n end\n end",
"def new\n @newspage = Newspage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newspage }\n end\n end",
"def new\n add_breadcrumb :new\n @visit = Visit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @visit }\n end\n end",
"def create\n @driver = Driver.new(driver_params)\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Driver was successfully created.' }\n format.json { render action: 'show', status: :created, location: @driver }\n else\n format.html { render action: 'new' }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def new\n @medrecord = Medrecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @medrecord }\n end\n end",
"def new\n @t = T.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @t }\n end\n end",
"def new\n @identity_table = IdentityTable.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @identity_table }\n end\n end",
"def new\n @newapp = Newapp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newapp }\n end\n end",
"def new\n @record = Umbra::Record.new\n respond_with(@record)\n end",
"def new\n @model = Model.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @model = Model.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @model = Model.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @model = Model.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @model }\n end\n end",
"def new\n @lead = Lead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lead }\n end\n end",
"def new\n @specie = Specie.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @specie }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @page = Page.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end",
"def new\n @statement = Statement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @statement }\n end\n end",
"def new\n @party = Party.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @party }\n end\n end",
"def new\n @click = Click.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @click }\n end\n end",
"def new\n @gene_name = GeneName.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gene_name }\n end\n end",
"def new\n @lid = Lid.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lid }\n end\n end",
"def new\n @railway = Railway.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @railway }\n end\n end",
"def new\n @testdb = Testdb.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @testdb }\n end\n end",
"def new\r\n @page = Page.new\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @page }\r\n end\r\n end",
"def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @page }\n end\n end"
] |
[
"0.7258903",
"0.72587854",
"0.7236554",
"0.718399",
"0.69215286",
"0.6864256",
"0.68528205",
"0.68060476",
"0.67966753",
"0.6787377",
"0.67457736",
"0.6743945",
"0.668736",
"0.66867137",
"0.667267",
"0.66495174",
"0.66326463",
"0.66323626",
"0.66277874",
"0.6599418",
"0.6590101",
"0.6576143",
"0.6566869",
"0.6566869",
"0.6544927",
"0.6522734",
"0.6522734",
"0.65138304",
"0.65105176",
"0.6503273",
"0.6496576",
"0.6496576",
"0.64902455",
"0.64895105",
"0.64687204",
"0.64625245",
"0.64602613",
"0.64567244",
"0.6446756",
"0.6446551",
"0.6440116",
"0.64367163",
"0.64362884",
"0.64344054",
"0.6417194",
"0.6415491",
"0.6413236",
"0.64109844",
"0.64069617",
"0.6400984",
"0.63968384",
"0.6394018",
"0.63914484",
"0.63894",
"0.6378277",
"0.6361395",
"0.6359012",
"0.6359012",
"0.6359012",
"0.6359012",
"0.6359012",
"0.6359012",
"0.6359012",
"0.6352749",
"0.6347042",
"0.6346307",
"0.6346307",
"0.6346307",
"0.634374",
"0.6342564",
"0.6340216",
"0.6339109",
"0.63344973",
"0.63294274",
"0.6328984",
"0.6317547",
"0.6317489",
"0.631684",
"0.63158315",
"0.63136494",
"0.6299844",
"0.6299844",
"0.6299844",
"0.6299844",
"0.62967205",
"0.6296027",
"0.62955254",
"0.62955254",
"0.62955254",
"0.62955254",
"0.62955254",
"0.6286518",
"0.6283416",
"0.62813675",
"0.62797135",
"0.6278235",
"0.6277308",
"0.6276479",
"0.6274987",
"0.6274447"
] |
0.7901467
|
0
|
POST /driver_records POST /driver_records.json
|
def create
@driver_record = DriverRecord.new(params[:driver_record])
respond_to do |format|
if @driver_record.save
format.html { redirect_to @driver_record, notice: 'Driver record was successfully created.' }
format.json { render json: @driver_record, status: :created, location: @driver_record }
else
format.html { render action: "new" }
format.json { render json: @driver_record.errors, status: :unprocessable_entity }
end
end
end
|
{
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
}
|
[
"def create\n # Logic to create a driver and submit to DB\n @driver = Driver.new(params[:driver])\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Driver was successfully created.' }\n format.json { render json: @driver, status: :created, location: @driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\t\t\t\trespond_with Driver.create(params[:driver])\n\t\t\tend",
"def create\n @driver = Driver.new(driver_params)\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Driver was successfully created.' }\n format.json { render action: 'show', status: :created, location: @driver }\n else\n format.html { render action: 'new' }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @driver = @event.drivers.new(params[:driver])\n\n respond_to do |format|\n if @driver.save\n\n for i in 1..@driver.spots do\n @waitlistrider = @event.riders.find_by_waitlist(true)\n @waitlistrider.update_driver(@driver.id) if @waitlistrider\n @waitlistrider.update_waitlist if @waitlistrider\n end\n\n @driver.update_full\n\n format.html { redirect_to [@event, @driver], notice: 'Driver was successfully created.' }\n format.json { render json: @driver, status: :created, location: @driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @record = Record.new(record_params)\n \n if @record.save\n render json: @record\n else\n render error: {error: \"Unable to create record\"}, status: :400\n end\n end",
"def create\n @record = Record.new(params[:record])\n record_set = RecordSet.find_by_id(params[:record][:record_set_id])\n @record.patient_id = record_set.patient_id\n\n respond_to do |format|\n if @record.save\n format.json { render :json => [ @record.to_jq_record ].to_json }\n format.html { render :json => [ @record.to_jq_record ].to_json }\n else\n format.json { render :json => [ @record.to_jq_record.merge({ :error => \"custom_failure\" }) ].to_json }\n end\n end\n end",
"def new\n @driver_record = DriverRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def create\n @references_vehicle_driver = ReferencesVehicleDriver.new(references_vehicle_driver_params)\n\n respond_to do |format|\n if @references_vehicle_driver.save\n @dato = ReferencesVehicleDriver.last\n @dato.token = @dato.driver_id.to_s + @dato.VehiclePerUsuario_id.to_s + @dato.driver.identityCard.to_s\n @dato.save\n format.html { redirect_to profile_index_path, notice: 'References vehicle driver was successfully created.' }\n format.json { render :show, status: :created, location: @references_vehicle_driver }\n else\n format.html { render :new }\n format.json { render json: @references_vehicle_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @driver_profile = DriverProfile.new(driver_profile_params)\n\n respond_to do |format|\n if @driver_profile.save\n format.html { redirect_to @driver_profile, notice: 'Driver profile was successfully created.' }\n format.json { render :show, status: :created, location: @driver_profile }\n post_request\n else\n flash[:error] = \"#{@driver_profile.errors.full_messages.to_sentence}\"\n format.html { render :new }\n format.json { render json: @driver_profile.errors, status: :unprocessable_entity }\n end\n end\n end",
"def push_new_record(record)\n handle_couch_response do\n RestClient.post(local_couch_database_url, record, content_type: :json)\n end\n end",
"def create\n @driver = Driver.create(driver_params)\n @user = current_user\n @driver.set_user!(current_user)\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Driver was successfully created.' }\n format.json { render :show, status: :created, location: @driver }\n else\n format.html { render :new }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create \n @record = current_user.records.new(record_params)\n \n # if the record was saved successfully\n if @record.save\n @record.update_user_json_keys!\n redirect_to records_path\n # else errors\n else\n # reset json\n @saved_json = params[:record][:json]\n render :new\n end\n end",
"def create\n @driver = Driver.new(driver_params)\n respond_to do |format|\n if @driver.save\n login_driver @driver\n format.html { redirect_to @driver, notice: \"Welcome #{@driver.name.upcase}. Your account was successfully created\" }\n format.json { render :show, status: :created, location: @driver }\n else\n format.html { render :new }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @driver_log = DriverLog.new(driver_log_params)\n\n respond_to do |format|\n if @driver_log.save\n format.html { redirect_to @driver_log, notice: 'Driver log was successfully created.' }\n format.json { render :show, status: :created, location: @driver_log }\n else\n format.html { render :new }\n format.json { render json: @driver_log.errors, status: :unprocessable_entity }\n end\n end\n end",
"def add_drivers params\n @driver_hash = JSON.parse(params)\n\n @driver_hash['drivers'].each do |driver|\n add_driver(driver[\"id\"],driver[\"location\"])\n end\n true\n end",
"def test_post_sample_traces\n header 'Content-Type', 'application/json'\n\n (0..4).each do |i|\n data = File.read \"sample-traces/#{i}.json\"\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n assert last_response.ok?\n end\n end",
"def driver_params\n params.require(:driver).permit(:driver_name, :driver_id, :driver_dob, :driver_address, :email, :phone_number, :trailer_capacity, :image)\n end",
"def create\n @driver = Driver.new(driver_params)\n @driver.user_id = current_user.id\n\n url = \"https://dvlasearch.appspot.com/DvlaSearch?apikey=#{Rails.application.credentials.dvla[:dvla_api_key]}&licencePlate=#{@driver.registration_number}\"\n uri = URI(url)\n response = Net::HTTP.get(uri)\n @hash = JSON.parse(response)\n\n if @hash.key?(\"make\")\n @driver.car_info = @hash[\"colour\"] + \" \" + @hash[\"make\"] + \" \" + @hash[\"model\"]\n else\n @driver.car_info = \"Registration number not linked to vehicle!!!\"\n end\n\n @driver.registration_number.upcase!\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Car information registered successfully!' }\n format.json { render :show, status: :created, location: @driver }\n else\n format.html { render :new }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @test_record = TestRecord.new(test_record_params)\n\n\n\n respond_to do |format|\n if @test_record.save\n format.html { redirect_to @test_record, notice: 'Test record was successfully created.' }\n format.json { render :show, status: :created, location: @test_record }\n else\n format.html { render :new }\n format.json { render json: @test_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def post_data(body)\r\n raise ConfigError, 'no json_records' if body.empty?\r\n # Create REST request header\r\n header = get_header(body.bytesize)\r\n # Post REST request \r\n response = RestClient.post(@uri, body, header)\r\n\r\n return response\r\n end",
"def new_driver\n address = params[:newdriveraddress]\n\n coordinates = GoogleAPIGeocoder.do_geocode(address)\n\n if coordinates.nil?\n render json: {success: false, travellers: session[:travellers].to_json, msg: 'Unable to find the location of the given address for the new driver. Please check that it is correct.'}\n else\n driver = Driver.create(name: params[:newdrivername],\n email: params[:newdriveremail],\n address: address,\n number_of_passengers: params[:newdrivernumber_of_passengers],\n latitude: coordinates[0],\n longitude: coordinates[1])\n\n unless session[:travellers].nil?\n session[:travellers] << driver\n else\n travellers = []\n travellers << driver\n session[:travellers] = travellers\n end\n\n if current_user.nil? && !session[:trip].nil?\n session[:trip].travellers << driver\n end\n\n render json: session[:travellers].to_json\n end\n end",
"def create(table, new_record)\n self.post(\"/#{table}/create\", body: {record: new_record})\n end",
"def create\n @record = Record.new(params[:record])\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, :notice => 'Record was successfully created.' }\n format.json { render :json => @record, :status => :created, :location => @record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def driver_params\n json_api_params(Driver,[:first_name,:last_name,:phone_no,:plant_id, :user_id,:enabled]).fetch(:attributes, {})\n end",
"def create\n @record = Umbra::Record.new(record_params)\n\n flash[:notice] = t(\"records.create_success\") if @record.save\n respond_with(@record)\n end",
"def create\n @dummy_record = DummyRecord.new(params[:dummy_record])\n\n respond_to do |format|\n if @dummy_record.save\n format.html { redirect_to @dummy_record, :notice => 'Dummy record was successfully created.' }\n format.json { render :json => @dummy_record, :status => :created, :location => @dummy_record }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @dummy_record.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def create\n records = if file_upload?\n case file_upload_params['records']['file'].content_type\n when 'text/xml' then FileParser::XMLRecordParser.call( file_upload_params['records']['file'].path )\n when 'text/csv' then FileParser::CSVRecordParser.call( file_upload_params['records']['file'].path )\n when 'application/json' then FileParser::JSONRecordParser.call( file_upload_params['records']['file'].path )\n end\n else # non file upload\n form_submission_params['records'].is_a?(Array) ? form_submission_params['records'] : [ form_submission_params['records'] ]\n end\n\n begin\n @report = ReportCreator.new(records).results\n\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @report, status: :ok }\n end\n rescue => exception\n respond_to do |format|\n redirect_to :new, error: \"Invalid Information\", status: :unprocessable_entity\n\n format.json { render status: :unprocessable_entity }\n end\n end\n end",
"def create\n @service_record = ServiceRecord.new(service_record_params)\n\n respond_to do |format|\n if @service_record.save\n format.json { render json: @service_record, serializer: ServiceRecordSerializer }\n else\n format.json { render json: @service_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @server_record = ServerRecord.new(server_record_params)\n\n respond_to do |format|\n if @server_record.save\n format.html { redirect_to @server_record, notice: 'Server record was successfully created.' }\n format.json { render :show, status: :created, location: @server_record }\n else\n format.html { render :new }\n format.json { render json: @server_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @record = Record.new(params[:record])\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render json: @record, status: :created, location: @record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @record = Record.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n respond_with :api,:v1, ApidDriver.create_or_update(params[:apid_driver])\n end",
"def create\n @trip_driver = TripDriver.new(trip_driver_params)\n\n respond_to do |format|\n if @trip_driver.save\n format.html { redirect_to @trip_driver, notice: 'Trip driver was successfully created.' }\n format.json { render json: @trip_driver, status: :created, location: @trip_driver }\n else\n format.html { render action: \"new\" }\n format.json { render json: @trip_driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_records(client)\n puts \" --- create records\" if $VERBOSE\n record = {\n kind: 'Article',\n title: 'Sample',\n text: 'Just some random text.'\n }\n result = client.create(record)\n # Make sure the message has the correct fields and values.\n check_result_code(result)\n ref = result[:ref]\n refute_equal(nil, ref, 'create reply record reference can not be nil')\n refute_equal(0, ref, 'create reply record reference can not be 0')\n\n # create a couple more records\n client.create({\n kind: 'Article',\n title: 'Second',\n text: 'More random text.'})\n client.create({\n kind: 'Article',\n title: 'Third',\n text: 'Even more random text.'})\n ref\n end",
"def leadCreateSfBulk()\n Salesforce.createRecords(@salesforceBulk, 'Lead', @testDataJSON[\"AccountAssignment\"][\"GenerateLeadFromWeb\"][0][\"BuildingName\"])\n end",
"def record_params\n params.require(:record).permit(:name, :info, :year, :performer_id)\n end",
"def driver_params\n params.require(:driver).permit(:name, :tel, :car_number)\n end",
"def create\n @record = current_user.records.build(record_params)\n @record.subscribe(@service)\n respond_to do |format|\n if @record.save\n format.html do\n if current_user.update_second_step!\n #redirect_to social_url, notice: '上のテキストボックスから友達を探してフォローしましょう!!'\n redirect_to api_v1_records_url(access_token: params[:access_token]), notice: '登録しました'\n else\n redirect_to api_v1_records_url(access_token: params[:access_token]), notice: '登録しました'\n end\n end\n format.json { render 'api/v1/records/show' }\n else\n format.html { render action: 'new' }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n @record = Record.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render action: 'show', status: :created, location: @record }\n else\n format.html { render action: 'new' }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createLeadFromStdSalesforce(email)\n puts @testDataJSON['Lead']\n records_to_insert = Hash.new\n records_to_insert.store('Name','Kishor_shinde')\n record = @helper.createRecords(sObject,records_to_insert)\n puts record\n return record \n end",
"def create\n @driver_journey = DriverJourney.new(driver_journey_params)\n\n respond_to do |format|\n if @driver_journey.save\n format.html { redirect_to journeys_path, notice: 'Driver journey was successfully created.' }\n format.json { render action: 'show', status: :created, location: @driver_journey }\n else\n format.html { render action: 'new' }\n format.json { render json: @driver_journey.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n # Loggin data from POST\n logger.debug \"--\" * 50\n logger.debug \"Data from POST: #{params.inspect}\"\n logger.debug \"--\" * 50\n\n @nasp_rail = NaspRail.new(params.keep_if { |key, value| NaspRail.column_names.include? key })\n\n respond_to do |format|\n if @nasp_rail.save\n format.html { redirect_to @nasp_rail, :notice => 'Nova entrada criada com sucesso.' }\n format.json { render :json => @nasp_rail, :status => :created, :location => @nasp_rail }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @nasp_rail.errors, :status => :unprocessable_entity }\n end\n end\n end",
"def save_record(mid, data)\n url = Configuration::PROPERTIES.get_property :url\n url_get_records = Configuration::PROPERTIES.get_property :url_save_record\n\n url_get_records = url_get_records.gsub '{csk}', URI::encode(@credential[:csk])\n url_get_records = url_get_records.gsub '{aci}', URI::encode(@credential[:aci])\n url_get_records = url_get_records.gsub '{mid}', mid.to_s\n\n params = {\n :fields => Dynamicloud::API::DynamicloudHelper.build_fields_json(data)\n }\n\n response = DynamicService::ServiceCaller.call_service url + url_get_records, params, 'post'\n\n json = JSON.parse(response)\n unless json['status'] == 200\n raise json['message']\n end\n\n data['rid'] = json['rid']\n\n data\n end",
"def create\n @record = Airtable::Record.new({Name: params[:name], Description: params[:description]})\n @table.create(@record)\n render plain: \"success\"\n end",
"def create\n @person_expense_record = PersonExpenseRecord.new(person_expense_record_params)\n\n if @person_expense_record.save\n render json: @person_expense_record, status: :created, location: @person_expense_record\n else\n render json: @person_expense_record.errors, status: :unprocessable_entity\n end\n end",
"def create\n @record = Record.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to records_url, notice: '登録しました' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def createLead\n #@testDataJSON['CreateOpportunity'][0]['lead'][0]['email'] = \"test_johnsmith#{rand(99999999999999)}@example.com\"\n\n #puts @driver.current_url()\n #puts @leadsTestData\n #@result= @helper.createSalesforceRecord('Lead',@leadsTestData)\n #puts @result\n #url = @driver.current_url();\n #newUrl = url.split('/')\n #@driver.get \"#{newUrl[0]}//#{newUrl[2]}/#{@result[0]['Id']}\"\n #puts \"Lead created suceessfully\\n \"\n end",
"def create\n @record = record_class.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: \"#{record_class.model_name.singular.humanize} was successfully created.\" }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def driver_params\n params.require(:driver).permit(:CNP, :FIRSTNAME, :SECONDNAME, :StartDate, :EndDate, :INFO, :DESCRIPTION, :active, images: [])\n end",
"def export\n send_data current_user.records.select(:json).order('updated_at desc').collect(&:json).to_json, filename: 'records.json'\n end",
"def create\n # to support array meta from iOS\n if params[:record][:meta].is_a? Array\n params[:record][:meta] = params[:record][:meta].join(\",\")\n end\n\n @record = current_patient.records.new(params[:record])\n\n @record.actual_pill_time_at = Time.zone.parse(params[:record][:actual_pill_time_at])\n\n\n respond_to do |format|\n if @record.save\n if @record.is_android_phone\n @record.swapUVAttribute\n end\n # if Rails.env == 'production'\n # @record.delay.post_processing\n # else\n # @record.post_processing\n # end\n format.json { render json: @record,\n status: :created,\n location: [current_patient, @record] }\n\n format.html { redirect_to [current_patient, @record],\n notice: 'Record was successfully created.' }\n else\n puts @record.errors\n format.json { render json: @record.errors, status: :unprocessable_entity }\n format.html { render action: 'new' }\n end\n end\n end",
"def create\n s = Spooge.new()\n create_status = s.save\n n = generate_random_name\n s.name = n\n s.email = \"#{n}@gmail.com\"\n s.touch_date = DateTime.now\n s.status = STATUS[rand(STATUS.length)]\n\n resp = {:create_status => create_status, :record => s}\n render :json => resp\n end",
"def create_record(record_type, zone_id, name, data, options = {})\n optional_tags= ''\n options.each { |option, value|\n case option\n when :ttl\n optional_tags+= \"<ttl type='integer'>#{value}</ttl>\"\n when :active\n optional_tags+= \"<active>#{value}</active>\"\n when :aux\n optional_tags+= \"<aux>#{value}</aux>\"\n end\n }\n\n request(\n :body => %Q{<?xml version=\"1.0\" encoding=\"UTF-8\"?><record><record_type>#{record_type}</record_type><zone_id type=\"integer\">#{zone_id}</zone_id><name>#{name}</name><data>#{data}</data>#{optional_tags}</record>},\n :expects => 201,\n :method => 'POST',\n :parser => Fog::Parsers::DNS::Slicehost::CreateRecord.new,\n :path => 'records.xml'\n )\n end",
"def new\n @driver = Driver.new(:event_id => params[:event_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @driver }\n end\n end",
"def create_region\n Region.create!(params[:record])\n render :json => {}\n end",
"def create\n @driver = Driver.new(driver_params)\n\n if @driver.images.count>0\n @driver.images.attach(params[:driver][:images])\n end\n\n respond_to do |format|\n if @driver.save\n format.html { redirect_to @driver, notice: 'Driver was successfully created.' }\n format.json { render :show, status: :created, location: @driver }\n else\n format.html { render :new }\n format.json { render json: @driver.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n data = []\n trace_params.each do |p|\n hash = {\n latitude: p[\"latitude\"],\n longitude: p[\"longitude\"]\n }\n data << hash\n end\n\n if Trace.upload_data(data)\n render json: {status: 'OK'}\n else\n render json: @trace.errors, status: :unprocessable_entity\n end\n end",
"def create\n @record = current_user.records.new(record_params)\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n fail_on_type_mismatch(data_params[:type])\n\n record = queried_record_scope.build\n assign_record_attributes(record, permitted_params_for(:create), data_params)\n\n execute_after_initialize_callbacks(record)\n\n execute_before_create_callbacks(record)\n execute_before_save_callbacks(record)\n\n fail RecordInvalidError.new(record, engaged_field_aliases) if record.errors.any?\n\n record.save!\n\n persist_collection_relationships(record)\n\n execute_after_create_callbacks(record)\n execute_after_save_callbacks(record)\n\n render(\n json: record,\n status: :created,\n fields: query_params[:fields],\n include: query_params[:include]\n )\n end",
"def record_params\n params.require(:record).permit(:person_id, :event_id, :date)\n\n end",
"def create\n @regional_data_record = @region.regional_data_records.new(regional_data_record_params)\n\n respond_to do |format|\n if @regional_data_record.save\n format.html { redirect_to [@region, @regional_data_record], notice: 'Regional data record was successfully created.' }\n format.json { render :show, status: :created, location: @regional_data_record }\n else\n format.html { render :new }\n format.json { render json: @regional_data_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def driver_params\n params.require(:driver).permit(:user_id, :registration_number, :car_info)\n end",
"def submit_report(json, cookbookname)\n data = File.read(json)\n uri = URI.parse($SPEC_ENDPOINT)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == \"https\"\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(\"/api/reports\")\n request.add_field('Content-Type', 'application/json')\n request.body = {\n :spec_result => data,\n :hostname => `hostname`.chomp,\n :cookbook_name => cookbookname\n }.to_json\n response = http.request(request)\n end",
"def execute_customer_record_create(qty)\n puts \"Starting to create Customer records... Please give the API time to respond...\\n\"\n qty.times do |t|\n body = FakeCustomer.new.generate\n # puts JSON.pretty_generate(JSON.parse(body.to_json))\n FakeRestActions.new(endpoint: \"Customers\", body: body, access_token: @access_token).post_request\n end\n end",
"def show\n @driver_record = DriverRecord.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @driver_record }\n end\n end",
"def create\n # binding.pry\n @record = Record.create(record_params)\n\n respond_to do |format|\n if @record.save\n # format.html { redirect_to action: \"index\" }\n\n format.html { redirect_to records_url }\n format.js\n # format.html { redirect_to @record, notice: 'Record was successfully created.' }\n # redirect_to action: \"index\"\n\n # redirect_to(@record)\n\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def save\n if row_data[:id] == 0\n row = Vh.new\n else\n row = Vh.find(row_data[:id])\n end\n\n row.name = row_data[:name]\n row.exp1_type = row_data[:exp1_type]\n row.exp1_value = row_data[:exp1_value]\n row.exp2_type = row_data[:exp2_type]\n row.exp2_value = row_data[:exp2_value]\n row.condition = row_data[:condition]\n row.save\n\n render json: {\n data: Vh.all\n }\n end",
"def batch_create\n @values = record_batch_params.values.reject { |p| p.values.all?(&:blank?) }\n @records = record_class.create(@values)\n\n respond_to do |format|\n if @records.all?(&:valid?)\n format.html { redirect_to url_for(action: 'index'), notice: \"#{record_class.model_name.plural.humanize} were successfully created.\" }\n format.json { render :index, status: :created }\n else\n @records = @records.fill(@records.size..BATCH_SIZE) { record_class.new }\n\n format.html { render :batch_new }\n format.json { render json: @records.map(&:errors), status: :unprocessable_entity }\n end\n end\n end",
"def create\n original_content = JSON.parse request.body.read\n if original_content.key? ('source') and (original_content['source'] == 'GeneTalk' or original_content['source'] == 'Phenobot')\n content = JSON.parse Patient.convert(original_content)\n else\n content = original_content\n end\n patient_id = content['case_data']['case_id']\n time = Time.now.strftime('%d_%m_%Y_%H_%M_%S')\n log_dir = File.join(API_LOG, patient_id.to_s)\n unless File.directory?(log_dir)\n FileUtils.mkdir_p(log_dir)\n end\n log_path = File.join(log_dir, time + '.log')\n logger = Logger.new(log_path)\n logger.info 'Receive patient data'\n\n # Log the raw JSON data\n original_f = File.join(log_dir, time + '.json')\n File.open(original_f, \"wb\") { |f| f.write(JSON.pretty_generate(original_content)) }\n\n # if a case doesnt exist, process the request and create a new case\n patient_save = true\n msg = {}\n begin\n ActiveRecord::Base.transaction do\n consumer_id = get_consumer_id()\n lab = Patient.parse_lab(content, consumer_id)\n patient = Patient.find_by(case_id: patient_id, lab_id: lab.id)\n if patient.nil?\n patient = Patient.create_patient(content, consumer_id)\n msg = { msg: MSG_CASE_CREATED }\n else\n # Check if there is pedia service running to avoid\n # overwriting the data\n p_services = patient.pedia_services\n unless p_services.empty?\n p_service = p_services.last\n p_status = p_service.pedia_status\n if p_status.workflow_running?\n msg = { msg: MSG_PEDIA_RUNNING_TRY_LATER }\n respond_to do |format|\n format.json { render plain: msg.to_json,\n status: 400,\n content_type: 'application/json'\n }\n end\n return\n end\n end\n\n # Update patient data\n patient.update_json(content['case_data'])\n msg = { msg: MSG_CASE_UPDATE }\n end\n\n dirname = File.join(\"Data\", \"Received_JsonFiles\", lab.id.to_s)\n dir = \"#{Rails.root}/#{dirname}\"\n FileUtils.mkdir(dir) unless File.directory?(dir)\n\n f = \"#{dir}/#{patient_id}.json\"\n File.open(f, \"wb\") { |f| f.write(JSON.pretty_generate(content)) }\n end\n rescue Exception => e\n logger = Logger.new(log_path)\n logger.error e.message\n e.backtrace.each { |line| logger.error line }\n patient_save = false\n msg = { msg: MSG_CASE_ERROR }\n end\n\n respond_to do |format|\n if patient_save\n format.json { render plain: msg.to_json,\n status: 200,\n content_type: 'application/json'\n }\n else\n msg = { msg: MSG_CASE_ERROR }\n format.json { render plain: msg.to_json,\n status: 400,\n content_type: 'application/json'\n }\n end\n end\n end",
"def post(data)\n jss = self.get_structure() # For referencing purposes\n\n input = self.query_to_hash(data)\n bad_request = false\n resp = nil\n jss.each do |key, value|\n # Check if we have it on the query too\n unless input.has_key? key\n resp = MIDB::Interface::Server.json_error(400, \"Bad Request - Not enough data for a new resource\")\n @engine.http_status = 400\n bad_request = true\n end\n end\n input.each do |key, value|\n # Check if we have it on the structure too\n unless jss.has_key? key\n resp = MIDB::Interface::Server.json_error(400, \"Bad Request - Wrong argument #{key}\")\n @engine.http_status = 400\n bad_request = true\n end\n end\n \n\n # Insert the values if we have a good request\n unless bad_request\n fields = Hash.new\n inserts = Hash.new\n main_table = self.get_structure.values[0].split('/')[0]\n input.each do |key, value|\n struct = jss[key]\n table = struct.split(\"/\")[0]\n inserts[table] ||= []\n fields[table] ||= []\n inserts[table].push \"\\\"\" + value + \"\\\"\"\n fields[table].push struct.split(\"/\")[1]\n if struct.split(\"/\").length > 2\n match = struct.split(\"/\")[2]\n matching_field = match.split(\"->\")[0]\n row_field = match.split(\"->\")[1]\n fields[table].push matching_field\n if @engine.config[\"dbengine\"] == :mysql\n inserts[table].push \"(SELECT #{row_field} FROM #{main_table} WHERE id=(SELECT LAST_INSERT_ID()))\"\n else\n inserts[table].push \"(SELECT #{row_field} FROM #{main_table} WHERE id=(last_insert_rowid()))\"\n end\n end\n end\n queries = [] \n inserts.each do |table, values|\n queries.push \"INSERT INTO #{table}(#{fields[table].join(',')}) VALUES (#{inserts[table].join(',')});\"\n end\n # Connect to the database\n dbe = MIDB::API::Dbengine.new(@engine.config, @db)\n dblink = dbe.connect()\n results = []\n rid = nil\n # Find the ID to return in the response (only for the first query)\n queries.each do |q|\n results.push dbe.query(dblink, q)\n if @engine.config[\"dbengine\"] == :mysql\n rid ||= dbe.extract(dbe.query(dblink, \"SELECT id FROM #{main_table} WHERE id=(SELECT LAST_INSERT_ID());\"), \"id\")\n else\n rid ||= dbe.extract(dbe.query(dblink, \"SELECT id FROM #{main_table} WHERE id=(last_insert_rowid());\"), \"id\")\n end\n end\n @engine.http_status = \"201 Created\"\n resp = {status: \"201 created\", id: rid}\n end\n return resp\n end",
"def create\n \n respond_to do |format| \t \t\n\t \tbegin\t \t\t \t\n\t \t\tmodel = JSON.parse( params[:model] )\n\t \t \n\t \trescue\t \t\n\t \t format.html { render action: \"new\" }\n\t format.json { render json: @record.errors, status: :unprocessable_entity }\n\t \t\n\t \telse\n\t \t\t#@record = Record.where( :email => model[\"email\"] ).first\t \t\t\n\t \t\t\n\t \t\tmodel.delete('authenticity_token')\n\t \t\t\n\t \t\t if @record.nil?\n\t\t \t\t @record = Record.new(model)\n\t\t \t\t @record.save\n\t\t else\n\t\t \tif @record.score < model[\"score\"] || ( @record.score == model[\"score\"] && @record.time > model[\"time\"] )\n\t\t \t\t@record.update_attributes(model)\t\t \t\n\t\t \tend\n\t\t end\n\t\t \n\t\t\tformat.html { redirect_to @record, notice: 'Record was successfully created.' }\n\t\t\tformat.json { render json: @record, status: :created, location: @record }\n\t \t\n\t \tend \n end\n end",
"def driver_params\n params.require(:driver).permit(:name, :age, :city_id, :company_id)\n end",
"def createRecord(sObject,records_to_insert)\n puts \"in @helper::createRecord\"\n puts records_to_insert\n record = @restForce.createRecord(sObject,records_to_insert)\n puts record\n return record\nend",
"def create\n \n dns_entry_response = RestClient.post('https://api.cloudflare.com/client/v4/zones/:zone_identifier/dns_records',:content_type => :json, :accept => :json, :'x-auth-key' => session[:key] :'x-auth-email' => session[:email])\n\n if JSON.parse(dns_entry_response)[\"success\"]\n @dns_entry = DnsEntry.new(dns_entry_params)\n\n respond_to do |format|\n if @dns_entry.save\n format.html { redirect_to @dns_entry, notice: \"Dns entry was successfully created.\" }\n format.json { render :show, status: :created, location: @dns_entry }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @dns_entry.errors, status: :unprocessable_entity }\n end\n end \n\n end\n\n\n end",
"def crud_post(resource_name, service_name, primary_key_name, api_options = {})\n api_options = get_defaults(api_options)\n post '/'+resource_name do\n service = settings.send(service_name)\n\n # Get The data\n begin\n data = JSON.parse(request.body.read)\n rescue Exception => e\n return 422\n end\n\n # Valid POST?\n return 422 unless service.valid_insert?(data)\n\n # Already Exists?\n return 409 if service.exists_by_primary_key?(data[primary_key_name])\n\n # Do Insert\n record = service.insert(data)\n\n # Other Error\n return 500 if record.nil?\n\n # Output new record\n JSON.fast_generate record\n end\n end",
"def serialize_records\n return nil unless last_response.respond_to?(:records)\n\n last_response.records.map do |remote_record|\n record = self.class.allocate\n record.instantiate(remote_record.to_hash)\n record\n end\n end",
"def create\n @tracker = Tracker.new(tracker_params)\n\n if @tracker.save\n render json: @tracker, status: :created, location: @tracker\n else\n render json: @tracker.errors, status: :unprocessable_entity\n end\n end",
"def create(rec)\n @name = rec.fields[\"name\"]\n @address = rec.fields[\"address\"]\n @city = rec.fields[\"city\"]\n @state = rec.fields[\"state\"]\n @zip = rec.fields[\"zip\"]\n @phone << rec.fields[\"phone\"] if !rec.fields[\"phone\"].nil?\n @fax << rec.fields[\"fax\"] if !rec.fields[\"fax\"].nil?\n @email << rec.fields[\"email\"] if !rec.fields[\"email\"].nil?\n end",
"def add_vat_record_with_http_info(vat_records, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: VatRecordApi.add_vat_record ...'\n end\n # verify the required parameter 'vat_records' is set\n if @api_client.config.client_side_validation && vat_records.nil?\n fail ArgumentError, \"Missing the required parameter 'vat_records' when calling VatRecordApi.add_vat_record\"\n end\n # resource path\n local_var_path = '/vat_records'\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(vat_records)\n auth_names = ['api_key']\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 => 'VatRecord')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: VatRecordApi#add_vat_record\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"def new\n @patient = Patient.find(params[:patient_id])\n @record = @patient.records.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @record }\n end\n end",
"def create\n @student_record = StudentRecord.new(student_record_params)\n\n respond_to do |format|\n if @student_record.save\n format.html { redirect_to @student_record, notice: 'Student record was successfully created.' }\n format.json { render :show, status: :created, location: @student_record }\n else\n format.html { render :new }\n format.json { render json: @student_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create_record(zone_id, type, name, content, options={})\n body = %Q{<?xml version=\"1.0\" encoding=\"UTF-8\"?><record><type>#{type}</type><name>#{name}</name><content>#{content}</content>}\n options.each do |k,v|\n body += %Q{<#{k}>#{v}</#{k}>}\n end\n body += %Q{</record>}\n request(\n :body => body,\n :expects => 202,\n :method => 'POST',\n :parser => Fog::Parsers::DNS::Bluebox::CreateRecord.new,\n :path => \"/api/domains/#{zone_id}/records.xml\"\n )\n end",
"def create\n\t\treview = Review.create(:user_id=>params[:review][:user_id], :note_id=>params[:review][:note_id], :status=>params[:review][:status])\n\t\treview.save!\n\n render json: []\n\tend",
"def create\n @device = Device.create!(device_params)\n json_response(@device, :created)\n end",
"def record\n puts \"****************** in record match, params: #{params}\"\n match_id = params[:match_id]\n match = nil\n begin\n puts \"match find : #{params[:match_id]}\"\n match = Match.find_by(id: match_id)\n rescue Exception => exc\n puts \"match not found: #{params['id']}, #{params['tourney_id']}, #{params['round']}\"\n end\n\n\n if match.present?\n match.player1_score = params[:player1_wins]\n match.player2_score = params[:player2_wins]\n match.ties = params[:ties]\n match.round = params[:round]\n puts \"***************** updating existing match: #{match.inspect}\"\n match.save\n else\n puts \"match not present\"\n end\n respond_to do |format|\n match_hash = match.as_json\n puts \"*********** Getting to end of record service, about to render JSON, #{match_hash}\"\n format.json { render :json => match_hash.to_json }\n # format.json { render :json => {:what => 'ever'} }\n end\n end",
"def create\n @trace = Trace.new\n if @trace.save\n @trace.import_points(points_data)\n status = :created\n else\n status = :bad_request\n end\n\n render json: @trace, status: status\n end",
"def create\n\n\t\t\t\t\t# attributes\n\t\t\t\t\tbegin\n\t\t\t\t\t\tattrs = jsonapi_received_attributes\n\t\t\t\t\t\tif attrs\n\t\t\t\t\t\t\tif @jsonapi_record\n\t\t\t\t\t\t\t\t# update\n\t\t\t\t\t\t\t\t@jsonapi_record.update! attrs\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t# create\n\t\t\t\t\t\t\t\t@jsonapi_record = jsonapi_model_class.new attrs\n\t\t\t\t\t\t\t\t@jsonapi_record.save!\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\trescue NameError => e\n\t\t\t\t\t\tjsonapi_render_errors 500, \"Model class not found.\"\n\t\t\t\t\t\treturn\n\t\t\t\t\trescue \n\t\t\t\t\t\tjsonapi_render_errors 500, @jsonapi_record.to_jsonapi_errors_hash\n\t\t\t\t\t\treturn\n\t\t\t\t\tend\n\n\t\t\t\t\t# relationships\n\t\t\t\t\tjsonapi_received_relationships.each do |relationship|\n\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t# to-one\n\t\t\t\t\t\t\t\tif relationship[:definition][:type] == :to_one\n\t\t\t\t\t\t\t\t\t@jsonapi_record.send :\"#{relationship[:definition][:name]}=\", relationship[:params][:data]\n\t\t\t\t\t\t\t\t\tnext\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t# to-many\n\t\t\t\t\t\t\t\t@jsonapi_record.send(relationship[:definition][:name]).send :clear # initialize the relation\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\trelationship[:params][:data].each do |item|\n\t\t\t\t\t\t\t\t\tobject = relationship[:receiver][:class].find_by_id item[:id]\n\t\t\t\t\t\t\t\t\t@jsonapi_record.send(relationship[:definition][:name]).send :<<, object\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\trescue \n\t\t\t\t\t\t\t# Should not happen\n\t\t\t\t\t\t\tjsonapi_render_errors 500, \"Relationship could not be created.\"\n\t\t\t\t\t\t\treturn\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\n\t\t\t\t\tshow\n\t\t\t\tend",
"def postEntityBulkJson( data)\n params = Hash.new\n params['data'] = data\n return doCurl(\"post\",\"/entity/bulk/json\",params)\n end",
"def upload_file_record_json\n initalize_breadcrumb(\"Uploaded File Record(s)\", uploadfilerecord_datauploaders_path) \n @table_name = params[:table_name] \n @table_record=[]\n response = DataUploader.get_table_data_without_pagination(@table_name)\n if response.to_a.size > 0 then \n response.each do |record| \n @table_record.append(record)\n end \n end \n respond_to do |format| \n format.html \n format.js \n format.json { render :json => @table_record}\n end\n\n end",
"def record_params\n params.require(:record).permit(:user_id, :approver_id, :status, :begin_at, :end_at, :address, :tel, :cause, :agent, :agent_office, :agent_office_tel, :agent_mobile, :back_at, :unit_opinion, :leader_opinion, :remark, :back_lat, :back_lon, :travel)\n end",
"def scrape_data_and_create_records link\n\n # Scrapes bracket/game data as JSON \n bracket_json = scrape_bracket link\n games_json = get_games_json bracket_json\n\n create_regions bracket_json\n create_teams games_json\n create_games games_json\n\n end",
"def create\n @driver_application = DriverApplication.new(driver_application_params)\n \n # Always get the current time to save\n @driver_application.created_at = DateTime.current\n\n respond_to do |format|\n if @driver_application.save\n format.html { redirect_to @driver_application, notice: 'Driver application was successfully created.' }\n format.json { render :show, status: :created, location: @driver_application }\n else\n format.html { render :new }\n format.json { render json: @driver_application.errors, status: :unprocessable_entity }\n end\n end\n end",
"def adding_to_hel_ser(record)\n patient_id = get_patient_id_by_alias(record[:patient_id][:root], record[:patient_id][:extension])\n return Logging.logger.error 'Aborting Post to Consent Service, no Patient Id was retrieved for the above record!'\\\n if patient_id.nil?\n\n aliases = [\n {\n system: ENV['SYSTEM'],\n value: record[:assertion_id]\n }\n ]\n effective_period = {\n start: record[:start_date].to_s,\n end: record[:end_date].to_s\n }\n consent_type = record[:assertion_type]\n organization_group = { id: record[:care_provider_id] }\n organization = { id: record[:care_unit_id] }\n personnel = { id: record[:employee_id] }\n\n provision_scope = {\n organizationGroup: organization_group,\n organization: organization,\n personnel: personnel\n }\n consent_type =\n if consent_type == 'Consent'\n 'PATIENT_GRANTED'\n elsif consent_type == 'Emergency'\n 'EMERGENCY_ACCESS'\n else\n 'NOT_FOUND'\n end\n body = {\n aliases: aliases,\n patientId: patient_id,\n createdBy: record[:employee_id],\n consentReasonType: consent_type,\n effectivePeriod: effective_period,\n provisionScope: provision_scope,\n emergencyConsentReason: consent_type,\n provisionType: ENV['PROVISION_TYPE'],\n category: ENV['CATEGORY_CONCEPT'],\n policyRule: ENV['PR_CONCEPT']\n }\n # Post-url: /patients/{patient_id}/patient-consents:\n new_hel_consents = {\n body: body,\n relativeUrl: \"#{ENV['POP_ID']}/patients/#{patient_id}/patient-consents\",\n assertion_id: record[:assertion_id]\n }\n # Send new mapped consent records to HEL service\n post_hel_consents(new_hel_consents)\n end",
"def create_parks_from_api\n url = \"https://developer.nps.gov/api/v1/parks?limit=500&api_key=GhGhpL8DrRdsEAwfu0Mn4gXuhgkdnhVnrEnNfmRx\"\n resp = RestClient.get(url)\n json_hash = JSON.parse(resp)\n park_codes = []\n\n json_hash.each do |data_key, value|\n if data_key[\"data\"]\n value.each do |hash_keys|\n Park.create(park_name: hash_keys[\"fullName\"], park_code: hash_keys[\"parkCode\"])\n \n end\n end\n end\n\nend",
"def get_records\n return error_response unless is_get_records_request?\n as_json\n end",
"def save_records\n return error_response unless is_save_records_request?\n if params[:changes]\n params[:changes].each_value do |changed|\n fields = changed.keys\n record = @record_class.find(changed[fields.delete('recid')])\n if record.present?\n fields.each do |field|\n table, column = get_table_and_column field\n obj = if table == @table_name\n record\n elsif record.respond_to?(table.to_sym)\n record.send(\"#{table}\")\n end\n obj.send(\"#{column}=\", changed[field]) if obj and obj.respond_to?(column.to_sym)\n end\n return error_response unless record.save\n end\n end\n end\n succes_response\n end",
"def create\n @player_record = PlayerRecord.new(params[:player_record])\n\n respond_to do |format|\n if @player_record.save\n format.html { redirect_to @player_record, notice: 'Player record was successfully created.' }\n format.json { render json: @player_record, status: :created, location: @player_record }\n else\n format.html { render action: \"new\" }\n format.json { render json: @player_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n product_name = competitor_params[:title]\n honestbee_datas = get_honestbee_data (product_name)\n predict_catalog = get_predict_catalog ( product_name )\n save_data_in_postgres (predict_catalog)\n render :json => honestbee_datas\n end",
"def create\n @pay_record = PayRecord.new(pay_record_params)\n\n respond_to do |format|\n if @pay_record.save\n format.html { redirect_to @pay_record, notice: 'Pay record was successfully created.' }\n format.json { render action: 'show', status: :created, location: @pay_record }\n else\n format.html { render action: 'new' }\n format.json { render json: @pay_record.errors, status: :unprocessable_entity }\n end\n end\n end",
"def create\n\n file = params[:file].read\n data = JSON.parse(file)\n ActiveRecord::Base.transaction do\n sub_user = data['submitter']['user_name']\n user_array = sub_user.split('.', 2)\n title = ''\n name = ''\n if user_array.length > 1\n title = user_array[0] + '.'\n name = user_array[1][1..-1]\n name_array = name.split(' ')\n first_name = name_array[0]\n last_name = name_array[-1]\n if name_array.length > 2\n first_name = name_array[0..-2].join(' ')\n end\n else\n name = user_array[0]\n name_array = name.split(' ')\n first_name = name_array[0]\n last_name = name_array[-1]\n if name_array.length > 2\n first_name = name_array[0..-2].join(' ')\n end\n end\n\n submitter = Submitter.find_or_create_by(first_name: first_name, last_name: last_name, email:data['submitter']['user_email'], team:data['submitter']['team'], title: title)\n @patient = Patient.create(case_id: data['case_id'], age: data['age'], submitter: submitter, last_name:data['last_name'], first_name:data['first_name'])\n user = User.find_by_email(submitter.email)\n if not user.nil?\n if not user.patients.exists?(@patient.id)\n user.patients << @patient\n end\n end\n if @patient.valid?\n @patient.parse_json(data)\n name = params[:file].original_filename\n path = File.join(\"Data\", \"jsons\", name)\n File.open(path, \"wb\") { |f| f.write(file) }\n end\n end\n\n respond_to do |format|\n if @patient.save\n format.html { redirect_to @patient, notice: 'Patient was successfully created.' }\n format.json { render :show, status: :created, location: @patient }\n else\n format.html { render :new }\n format.json { render json: @patient.errors, status: :unprocessable_entity }\n end\n end \n\n #end\n end"
] |
[
"0.6331399",
"0.62563723",
"0.61658174",
"0.6081424",
"0.60665923",
"0.59789217",
"0.5924245",
"0.5627075",
"0.5605765",
"0.5591048",
"0.5588457",
"0.5579364",
"0.5578564",
"0.557839",
"0.5564735",
"0.55064946",
"0.5502049",
"0.5485057",
"0.5479977",
"0.54617584",
"0.5436395",
"0.5395484",
"0.5383514",
"0.53740835",
"0.53667593",
"0.53600174",
"0.5354739",
"0.53469354",
"0.5346421",
"0.53150153",
"0.5311145",
"0.52960134",
"0.5287007",
"0.5284003",
"0.5274721",
"0.52681315",
"0.52457833",
"0.52426183",
"0.5239977",
"0.5216767",
"0.5212142",
"0.5210692",
"0.5208294",
"0.52062184",
"0.5205076",
"0.5204887",
"0.5202439",
"0.5191834",
"0.5190445",
"0.5190222",
"0.518674",
"0.5182481",
"0.51689005",
"0.5168207",
"0.51673",
"0.5165045",
"0.51647604",
"0.51571894",
"0.51554096",
"0.514829",
"0.51410675",
"0.5136071",
"0.5134536",
"0.51270956",
"0.5121885",
"0.51159924",
"0.51135546",
"0.5112533",
"0.5112452",
"0.5110061",
"0.50983423",
"0.5097791",
"0.50951594",
"0.50937504",
"0.50851405",
"0.50846446",
"0.507024",
"0.5064539",
"0.50570023",
"0.5051506",
"0.50495124",
"0.50460553",
"0.504204",
"0.50406396",
"0.50363964",
"0.5034226",
"0.5030886",
"0.50279397",
"0.5025661",
"0.5022235",
"0.50179267",
"0.50165486",
"0.50163645",
"0.4998566",
"0.49984935",
"0.49980322",
"0.49945498",
"0.49923667",
"0.49883467",
"0.49867955"
] |
0.69242376
|
0
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.